Fix reference problems with ability displays. Release Build 12233.
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m49s
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m49s
This commit is contained in:
parent
7f4e6282b7
commit
c14740687b
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user