Make the editor grid a bit more rigid; add a few more basic tiles

This commit is contained in:
Eevee (Evelyn Woods) 2020-09-10 20:44:34 -06:00
parent 6bfb5f7896
commit 0c2295dc1d
2 changed files with 20 additions and 13 deletions

View File

@ -679,7 +679,7 @@ const EDITOR_TOOLS = [{
icon: 'icons/tool-wire.png', icon: 'icons/tool-wire.png',
name: "Wire", name: "Wire",
desc: "Draw CC2 wiring", desc: "Draw CC2 wiring",
// TODO text tool; thin walls tool; map generator?; subtools for select tool (copy, paste, crop) // TODO text tool; thin walls tool; ice tool; map generator?; subtools for select tool (copy, paste, crop)
}]; }];
// Tiles the "adjust" tool will turn into each other // Tiles the "adjust" tool will turn into each other
const EDITOR_ADJUST_TOGGLES = { const EDITOR_ADJUST_TOGGLES = {
@ -708,16 +708,21 @@ const EDITOR_ADJUST_TOGGLES = {
}; };
// TODO this MUST use a cc2 tileset! // TODO this MUST use a cc2 tileset!
const EDITOR_PALETTE = [{ const EDITOR_PALETTE = [{
title: "Our hero", title: "Basics",
tiles: ['player'], tiles: [
'player',
'chip', 'chip_extra',
'floor', 'wall', 'hint', 'socket', 'exit',
],
}, { }, {
title: "Terrain", title: "Terrain",
tiles: [ tiles: [
'floor', 'wall', 'hint', 'socket', 'exit',
'popwall', 'popwall',
'fake_floor', 'fake_wall', 'fake_floor', 'fake_wall',
'wall_invisible', 'wall_appearing',
'gravel', 'gravel',
'dirt', 'dirt',
'door_blue', 'door_red', 'door_yellow', 'door_green',
'water', 'turtle', 'fire', 'water', 'turtle', 'fire',
'ice', 'ice_nw', 'ice_ne', 'ice_sw', 'ice_se', 'ice', 'ice_nw', 'ice_ne', 'ice_sw', 'ice_se',
'force_floor_n', 'force_floor_s', 'force_floor_w', 'force_floor_e', 'force_floor_all', 'force_floor_n', 'force_floor_s', 'force_floor_w', 'force_floor_e', 'force_floor_all',
@ -725,7 +730,6 @@ const EDITOR_PALETTE = [{
}, { }, {
title: "Items", title: "Items",
tiles: [ tiles: [
'chip', 'chip_extra',
'key_blue', 'key_red', 'key_yellow', 'key_green', 'key_blue', 'key_red', 'key_yellow', 'key_green',
'flippers', 'fire_boots', 'cleats', 'suction_boots', 'flippers', 'fire_boots', 'cleats', 'suction_boots',
], ],
@ -747,9 +751,9 @@ const EDITOR_PALETTE = [{
tiles: [ tiles: [
'bomb', 'bomb',
'dirt_block', 'dirt_block',
'button_red', 'button_blue',
'cloner', 'button_red', 'cloner',
'trap', 'button_brown', 'trap',
], ],
}]; }];
class Editor extends PrimaryView { class Editor extends PrimaryView {

View File

@ -528,11 +528,11 @@ main.--has-demo .demo-controls {
flex: 1 1 auto; flex: 1 1 auto;
display: grid; display: grid;
grid: grid:
"controls level" "controls level" min-content
"palette level" "palette level" 1fr
/ minmax(20%, 1fr) auto / minmax(25%, auto) auto
; ;
gap: 1em; gap: 0.5em;
min-height: 0; min-height: 0;
margin: auto; margin: auto;
@ -571,6 +571,9 @@ main.--has-demo .demo-controls {
} }
#editor .palette { #editor .palette {
grid-area: palette; grid-area: palette;
min-width: 20vw;
padding-right: 0.25em; /* in case of scrollbar */
overflow-y: auto;
} }
#editor .palette h2 { #editor .palette h2 {
font-size: 1em; font-size: 1em;
@ -590,5 +593,5 @@ main.--has-demo .demo-controls {
margin: 0.25em; margin: 0.25em;
} }
.palette-entry.--selected { .palette-entry.--selected {
outline: 2px solid gold; box-shadow: 0 0 0 1px black, 0 0 0 2px white;
} }