Skip to content

Commit

Permalink
EditorOverlayWidget: Numpad support for switching between autotilesets
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankata453 committed Nov 15, 2024
1 parent 126e60e commit 00d2ff9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/editor/overlay_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,13 +1182,17 @@ EditorOverlayWidget::on_key_down(const SDL_KeyboardEvent& key)
{
alt_pressed = true;
}
else if (sym == SDLK_0)
else if (sym == SDLK_0 || sym == SDLK_KP_0)
{
m_current_autotileset = 0;
}
else if (sym > SDLK_0 && sym <= SDLK_9)
else if (sym >= SDLK_1 && sym <= SDLK_9)
{
m_current_autotileset = static_cast<int>(sym - SDLK_0);
m_current_autotileset = static_cast<int>(sym - SDLK_1 + 1);
}
else if (sym >= SDLK_KP_1 && sym <= SDLK_KP_9)
{
m_current_autotileset = static_cast<int>(sym - SDLK_KP_1 + 1);
}
return true;
}
Expand Down

0 comments on commit 00d2ff9

Please sign in to comment.