Fix reference problems with ability displays. Release Build 12233.
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 7m52s

This commit is contained in:
sigonasr2 2025-06-04 15:47:06 -05:00
parent 2e5a033929
commit 2d99785bb7
3 changed files with 16 additions and 5 deletions

View File

@ -126,6 +126,7 @@ const std::string Ability::GetDescriptionWithPlayerModifiers()const{
std::string separatorVal{variableName.substr(separatorMarker+1)};
if(!specialPrefixes.count(separatorKey))ERR(std::format("Could not find translation function for key {} inside special prefixes map!",separatorKey))
else {
if(!data.HasProperty(separatorVal))return false; //Could not be found in this section, will need to seek in another location.
finalText+=specialValCol.toHTMLColorCode()+specialPrefixes[separatorKey](data,separatorVal)+WHITE.toHTMLColorCode();
bracesFound=false;
return true;

View File

@ -374,7 +374,7 @@ void Menu::InitializeCharacterMenuWindow(){
};
//Used in conjunction with the onClick events of MenuComponents tab.
auto OnTabClick=[&abilityBoxes](const ClickedTab tabClicked,const MenuFuncData&data){
auto OnTabClick=[](const ClickedTab tabClicked,const MenuFuncData&data){
using enum ClickedTab;
auto abilityNameLabel{Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")};
auto abilityDescriptionLabel{Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")};
@ -383,10 +383,20 @@ void Menu::InitializeCharacterMenuWindow(){
if(tabClicked==EQUIPMENT)slot->Enable();
else slot->Disable();
}
const std::array abilityBoxes{
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility1(),AbilitySlot::ABILITY1},
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility2(),AbilitySlot::ABILITY2},
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility3(),AbilitySlot::ABILITY3},
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility4(),AbilitySlot::ABILITY4},
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetRightClickAbility(),AbilitySlot::DEFENSIVE},
};
for(int i=0;i<abilityBoxes.size();i++){
auto slot{Component<MenuComponent>(data.menu.GetType(),std::format("Skill Icon Label {}",i))};
if(tabClicked==SKILLS)slot->Enable();
else slot->Disable();
auto&[ability,slot]{abilityBoxes[i]};
Component<MenuIconButton>(data.menu.GetType(),std::format("Skill Icon Label {}",i))->SetIcon(GFX[ability.get().icon].Decal());
Component<MenuLabel>(data.menu.GetType(),std::format("Skill Name Label {}",i))->SetLabel(ability.get().GetNameWithPlayerModifiers());
auto abilityLabel{Component<MenuComponent>(data.menu.GetType(),std::format("Skill Icon Label {}",i))};
if(tabClicked==SKILLS)abilityLabel->Enable();
else abilityLabel->Disable();
}
Component<MenuComponent>(data.menu.GetType(),"Equipment Tab")->SetSelected(tabClicked==EQUIPMENT);
Component<MenuComponent>(data.menu.GetType(),"Skills Tab")->SetSelected(tabClicked==SKILLS);

View File

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 12227
#define VERSION_BUILD 12233
#define stringify(a) stringify_(a)
#define stringify_(a) #a