Fix menu hovering causing selection on menus to be messed up in mouse navigation mode.

pull/35/head
sigonasr2 1 year ago
parent 4aaa954d05
commit 3ff1ff0b04
  1. 3
      Adventures in Lestoria/Menu.cpp
  2. 3
      Adventures in Lestoria/Menu.h
  3. 1
      Adventures in Lestoria/MenuComponent.h
  4. 5
      Adventures in Lestoria/TODO.txt
  5. 2
      Adventures in Lestoria/Version.h

@ -203,6 +203,7 @@ void Menu::Update(AiL*game){
}
}
}else{
selection={};
for(auto&[key,component]:components){
if(component->selectable){
if(!component->disabled&&!component->grayedOut){
@ -321,6 +322,7 @@ void Menu::SetDefaultButton(std::weak_ptr<MenuComponent>button){
void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){
std::weak_ptr<MenuComponent>prevSelection=selection;
if(!selection.expired()){
std::string selectionButtonName=selection.lock()->GetName();
if(navigationGroups.count(selectionButtonName)){
Navigation nav=navigationGroups[selectionButtonName];
@ -350,6 +352,7 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){
if(std::holds_alternative<MenuDataFunc>(nav.right))std::get<MenuDataFunc>(nav.right)(type);
}
}
}
if(game->KEY_CONFIRM.Pressed()){
SetMouseNavigation(game->GetMouse(0).bPressed); //If a click occurs we use mouse controls.

@ -163,7 +163,6 @@ public:
}else{
component->depth=depth;
}
RecalculateComponentCount();
if(components.count(componentKey)){
ERR("WARNING! Key "<<componentKey<<" for this sub-menu already exists! Key names must be unique!")
@ -174,6 +173,8 @@ public:
components.SetInitialized();
lastRegisteredComponent=componentKey;
RecalculateComponentCount();
return component;
}
void Update(AiL*game);

@ -74,6 +74,7 @@ class MenuComponent:public IAttributable{
friend class MenuItemButton;
friend class ScrollableWindowComponent;
friend class InventoryScrollableWindowComponent;
friend class EncountersSpawnListScrollableWindowComponent;
friend class MenuItemItemButton;
friend class RowItemDisplay;
MenuType menuDest;

@ -11,6 +11,8 @@ Settings Menu
remove that bind from the list. Up to two keys may be binded per action.
-We have to save keybinds to the save file.
- Fix Stage Completed screen, item displays can hit the scrollbar.
January 31st
============
Make new unlocked nodes more obvious, made neighboring nodes more obvious
@ -28,10 +30,9 @@ Story proofreading/correcting/storyboarding
- Lock up unimplemented classes.
- Don't enable all stage plates normally.
- Hide mouse cursor during controller play. Reveal it again during mouse play.
- Emscripten _DEBUG flag add as an option when building
mainMenuWindow->SetupKeyboardNavigation(
{

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

Loading…
Cancel
Save