Skip to content

Commit

Permalink
Alt+1 through Alt+8 select the palette in the block editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Sep 27, 2021
1 parent 869507f commit c4f6f57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion res/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h1>)" PROGRAM_NAME R"(</h1>
<li><b>X flip:</b> Flip the tile horizontally.</li>
<li><b>Y flip:</b> Flip the tile vertically.</li>
<li><b>Priority:</b> Display the tile above sprites, including NPCs and the player. (The lightest hue will be transparent to sprites.)</li>
<li><b>Color:</b> The tile's color. The TEXT color is meant for menus and text boxes, and should not be used for map tiles.</li>
<li><b>Color:</b> The tile's color. The TEXT color is meant for menus and text boxes, and should not be used for map tiles. Alt+1 through Alt+8 will select the <i>N</i>th palette.</li>
</ul>
<p>Selecting the X or Y flip attributes also affects placement of multiple tiles at once with Ctrl/Alt/Shift, so large symmetrical designs can be placed more easily.</p>
<p>You can also edit the collision values of the block's four quadrants. Old-style collision.bin files and up-to-date collision.asm files are both supported.</p>
Expand Down
9 changes: 9 additions & 0 deletions src/block-window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ Block_Double_Window::Block_Double_Window(int x, int y, int w, int h, const char

int Block_Double_Window::handle(int event) {
Block_Window *bw = (Block_Window *)user_data();
if (Fl::event_alt()) {
for (int p = 0; p < NUM_PALETTES; p++) {
if (Fl::test_shortcut(FL_ALT + '1' + p)) {
bw->_palette->value(p);
Block_Window::change_attributes_cb(NULL, bw);
break;
}
}
}
switch (event) {
case FL_FOCUS:
case FL_UNFOCUS:
Expand Down

0 comments on commit c4f6f57

Please sign in to comment.