Fix bug + add entry for injecting Celebi in debug menu

This commit is contained in:
Philippe Symons
2026-03-26 15:30:46 +01:00
parent 2982b9ba93
commit db21eba3b9
4 changed files with 13 additions and 3 deletions

View File

@@ -144,6 +144,7 @@ MenuInputHandleState vertical_menu::handle_input()
{
MenuInputHandleState result;
bool did_navigate = false;
bool viewport_changed = false;
// If no items or not focused, there's nothing to handle.
if(items_.size() <= 1 || !is_focused_)
@@ -181,6 +182,7 @@ MenuInputHandleState vertical_menu::handle_input()
if(focused_index_ >= current_viewport_end_index)
{
++viewport_start_index_;
viewport_changed = true;
}
did_navigate = true;
}
@@ -190,6 +192,7 @@ MenuInputHandleState vertical_menu::handle_input()
if(focused_index_ < viewport_start_index_)
{
--viewport_start_index_;
viewport_changed = true;
}
did_navigate = true;
}
@@ -198,7 +201,10 @@ MenuInputHandleState vertical_menu::handle_input()
if(did_navigate)
{
const unsigned render_index = focused_index_ - viewport_start_index_;
update_viewport();
if(viewport_changed)
{
update_viewport();
}
handle_selection_change(focused_index_, settings_.x, settings_.y + settings_.margin_top + (render_index * settings_.item_height));
return MenuInputHandleState::HANDLED;
}