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.

pull/35/head
sigonasr2 1 year ago
parent f8a9bd1e27
commit aec9646d40
  1. 21
      Adventures in Lestoria/Menu.cpp
  2. 2
      Adventures in Lestoria/Menu.h
  3. 2
      Adventures in Lestoria/Version.h
  4. 6
      Adventures in Lestoria/assets/Campaigns/1_1_v2.tmx
  5. BIN
      x64/Release/Adventures in Lestoria.exe

@ -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);
}

@ -250,6 +250,8 @@ private:
std::weak_ptr<MenuComponent>selection;
std::weak_ptr<MenuComponent>keyboardSelection;
bool ignoreInputs=false; //We set this to true because on the next button release, we don't want buttons to cause menu navigation. This is for when the player needs to activate the cursor via keyboard/gamepad and nothing is highlighted. It gets reset to false once a button has been released.
static bool MOUSE_NAVIGATION;
bool cover; //A black cover for when a menu pops up to fade out the stuff behind it.
};

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
#define VERSION_BUILD 6014
#define VERSION_BUILD 6020
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -1076,7 +1076,7 @@
</object>
<object id="4" name="Green Slime" type="Monster" x="1052" y="4304">
<properties>
<property name="Type" propertytype="MonsterName" value="Bear"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="2"/>
</properties>
<point/>
@ -1717,14 +1717,14 @@
</object>
<object id="151" name="Green Slime" type="Monster" x="1056" y="4386">
<properties>
<property name="Type" propertytype="MonsterName" value="Bear"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="2"/>
</properties>
<point/>
</object>
<object id="155" name="Green Slime" type="Monster" x="1050" y="4218">
<properties>
<property name="Type" propertytype="MonsterName" value="Bear"/>
<property name="Type" propertytype="MonsterName" value="Green Slime"/>
<property name="spawner" type="object" value="2"/>
</properties>
<point/>

Loading…
Cancel
Save