diff --git a/Adventures in Lestoria/CharacterMenuWindow.cpp b/Adventures in Lestoria/CharacterMenuWindow.cpp index 55aa602c..997bc652 100644 --- a/Adventures in Lestoria/CharacterMenuWindow.cpp +++ b/Adventures in Lestoria/CharacterMenuWindow.cpp @@ -137,8 +137,12 @@ void Menu::InitializeCharacterMenuWindow(){ ->Disable(); characterMenuWindow->ADD("Equip List",ScrollableWindowComponent)(geom2d::rect{{123,28},{120,windowSize.y-37-24}})DEPTH -1 END ->Disable(); - characterMenuWindow->ADD("Equip Selection Bottom Outline",MenuComponent)(geom2d::rect{{123,28+(windowSize.y-37-24)},{120,24}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)END + characterMenuWindow->ADD("Equip Selection Bottom Outline",MenuComponent)(geom2d::rect{{123,28+(windowSize.y-37-24)},{120,24}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)DEPTH 2 END ->Disable(); + + auto abilitySelectionOutline{characterMenuWindow->ADD("Ability Selection Outline",MenuComponent)(geom2d::rect{{123,28},{120,windowSize.y-37}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)DEPTH 0 END}; + abilitySelectionOutline->Disable(); + auto equipSelectionSelectButton=characterMenuWindow->ADD("Equip Selection Select Button",MenuComponent)(geom2d::rect{{123+12,28+(windowSize.y-37-24)+6},{96,12}},"Select", [](MenuFuncData data){ Component(data.component.lock()->parentMenu,"Equip Selection Outline")->Disable(); @@ -339,8 +343,9 @@ void Menu::InitializeCharacterMenuWindow(){ } #pragma endregion - auto abilityNameLabel{characterMenuWindow->ADD("Ability Name Text",MenuLabel)(geom2d::rect{{125,30},{116,windowSize.y-39}},"",1.f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW)END}; - auto abilityDescriptionLabel{characterMenuWindow->ADD("Ability Description Text",MenuLabel)(geom2d::rect{{125,30+16},{116,windowSize.y-39-16}},"",1.f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW)END}; + auto abilityNameLabel{characterMenuWindow->ADD("Ability Name Text",MenuLabel)(geom2d::rect{{123,28},{116,12}},"",1.f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)DEPTH -1 END}; + auto abilityDescriptionLabel{characterMenuWindow->ADD("Ability Description Text",MenuLabel)(geom2d::rect{{125,30+16},{116,windowSize.y-39-16}},"",1.f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW)DEPTH -1 END}; + abilityNameLabel->Disable(); #pragma region Skill Selection Boxes const std::array abilityBoxes{ @@ -359,8 +364,19 @@ void Menu::InitializeCharacterMenuWindow(){ auto skillNameLabel{characterMenuWindow->ADD(std::format("Skill Name Label {}",i),MenuLabel)(geom2d::rect{{labelX+4,labelY-6},{96,24}},ability.get().GetNameWithPlayerModifiers())END}; skillBox->SetHoverFunc([slot](MenuFuncData data){ const auto&ability{game->GetPlayer()->GetAbility(slot)}; - Component(data.menu.GetType(),"Ability Name Text")->SetLabel(ability.GetNameWithPlayerModifiers()); - Component(data.menu.GetType(),"Ability Description Text")->SetLabel(ability.GetDescriptionWithPlayerModifiers()); + auto abilityNameTextLabel{Component(data.menu.GetType(),"Ability Name Text")}; + auto abilityDescriptionTextLabel{Component(data.menu.GetType(),"Ability Description Text")}; + abilityNameTextLabel->SetLabel(ability.GetNameWithPlayerModifiers()); + abilityDescriptionTextLabel->SetLabel(ability.GetDescriptionWithPlayerModifiers()); + abilityNameTextLabel->Enable(); + abilityDescriptionTextLabel->Enable(); + Component(data.menu.GetType(),"Ability Selection Outline")->Enable(); + return true; + }); + skillBox->SetMouseOutFunc([](MenuFuncData data){ + Component(data.menu.GetType(),"Ability Name Text")->Disable(); + Component(data.menu.GetType(),"Ability Description Text")->Disable(); + Component(data.menu.GetType(),"Ability Selection Outline")->Disable(); return true; }); skillBox->Disable(); //Hide these by default. @@ -398,8 +414,10 @@ void Menu::InitializeCharacterMenuWindow(){ abilityIcon->SetIcon(GFX[ability.get().icon].Decal()); abilityText->SetLabel(ability.get().GetNameWithPlayerModifiers()); if(tabClicked==SKILLS){ - abilityIcon->Enable(); - abilityText->Enable(); + if(abilityText->GetLabel()!="???"){ //Unknown abilities should remain hidden for the player's surprise. + abilityIcon->Enable(); + abilityText->Enable(); + } }else{ abilityIcon->Disable(); abilityText->Disable(); diff --git a/Adventures in Lestoria/Menu.h b/Adventures in Lestoria/Menu.h index 046b9c00..4a303c55 100644 --- a/Adventures in Lestoria/Menu.h +++ b/Adventures in Lestoria/Menu.h @@ -67,9 +67,9 @@ using ToggleFunc=std::function; #define END ) #define DEPTH , -#define DEFAULT_DEPTH -999999 -#define STARTING_DEPTH 999999 -#define MAX_MENUS 64 +constexpr int DEFAULT_DEPTH = -999999; +constexpr int STARTING_DEPTH = 999999; +constexpr uint16_t MAX_MENUS = 64; using Data=std::variant>; using MenuDataFunc=std::function; diff --git a/Adventures in Lestoria/MenuComponent.h b/Adventures in Lestoria/MenuComponent.h index b7820030..36110647 100644 --- a/Adventures in Lestoria/MenuComponent.h +++ b/Adventures in Lestoria/MenuComponent.h @@ -99,7 +99,7 @@ private: std::weak_ptrsubcomponentParent; //For subcomponents, this value provides the actual component this subcomponent was spawned from. protected: - int depth=0; + int depth=0; //Higher depth (positive) means in front. Lower depth (negative) means behind. float hoverEffect=0; std::string name=""; geom2d::rectrect; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 7814705a..60942500 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 12214 +#define VERSION_BUILD 12245 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 52dfdae4..c7b5b9fe 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ