mirror of
https://github.com/GearsProgress/Poke_Transporter_GB.git
synced 2026-09-14 20:15:36 -05:00
Fix bug + add entry for injecting Celebi in debug menu
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user