When switching from mouse to keyboard navigation, the first input is ignored such that it will reveal where the cursor currently is at. Updated to Release Build 6020.

This commit is contained in:
2024-01-18 23:24:24 -06:00
parent f8a9bd1e27
commit aec9646d40
5 changed files with 13 additions and 18 deletions
+7 -14
View File
@@ -59,18 +59,6 @@ safemap<ITCategory,std::vector<std::weak_ptr<MenuComponent>>>Menu::merchantInven
std::vector<std::weak_ptr<MenuComponent>>Menu::equipStatListeners;
std::vector<std::weak_ptr<MenuComponent>>Menu::chapterListeners;
const vf2d Menu::CENTERED = {-456,-456};
//////////////////////////////////////////////////////////////////////////////////////////////////
///__/////////////////////////////////////////////////////////////////////////////////////////////
//| |////////////////////////////////////////////////////////////////////////////////////////////
//| |/////WARNING! If you are adding something here you likely are adding another container with MenuComponent pointers in it right now.
//| |/////Because we are handling raw pointers, you must also add this container to the list of iterating search removal containers that occur in the
//| |/////DESTRUCTOR of MenuComponents!!!!! (Go to MenuComponent::~MenuComponent()) THIS IS NOT A DRILL!
//|__|////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
///__/////////////////////////////////////////////////////////////////////////////////////////////
//|__/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
MenuType Menu::lastMenuTypeCreated;
std::string Menu::lastRegisteredComponent;
@@ -129,7 +117,11 @@ Menu*Menu::CreateMenu(MenuType type,vf2d pos,vf2d size){
void Menu::CheckClickAndPerformMenuSelect(AiL*game){
if(game->KEY_CONFIRM.Released()){
MenuSelect(game);
if(ignoreInputs){
ignoreInputs=false;
}else{
MenuSelect(game);
}
}
}
@@ -234,7 +226,7 @@ void Menu::Update(AiL*game){
}
}
}
if(!game->IsTextEntryEnabled()){
KeyboardButtonNavigation(game,pos);
}
@@ -481,6 +473,7 @@ void Menu::SetMouseNavigation(bool mouseNavigation){
if(MOUSE_NAVIGATION&&!mouseNavigation){
//When mouse navigation was enabled and now needs to be disabled, we store the mouse position.
lastActiveMousePos=game->GetMousePos();
ignoreInputs=true;
if(!keyboardSelection.expired()){
SetSelection(keyboardSelection);
}