Add ability list updating for the hub pause character menu. Release Build 12234.
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m28s

This commit is contained in:
sigonasr2 2025-06-17 09:42:47 -04:00
parent c14740687b
commit be05839743
4 changed files with 42 additions and 23 deletions

View File

@ -343,6 +343,7 @@ void Menu::InitializeCharacterMenuWindow(){
auto abilityDescriptionLabel{characterMenuWindow->ADD("Ability Description Text",MenuLabel)(geom2d::rect<float>{{125,30+16},{116,windowSize.y-39-16}},"",1.f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW)END};
#pragma region Skill Selection Boxes
{
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},
@ -366,6 +367,7 @@ void Menu::InitializeCharacterMenuWindow(){
skillBox->Disable(); //Hide these by default.
i++;
}
}
#pragma endregion
enum class ClickedTab{

View File

@ -44,6 +44,7 @@ All rights reserved.
#include "CharacterRotatingDisplay.h"
#include "ClassInfo.h"
#include "Unlock.h"
#include "MenuIconButton.h"
INCLUDE_game
INCLUDE_GFX
@ -59,6 +60,22 @@ void Menu::InitializeHubPauseWindow(){
hubPauseWindow->ADD("Character Button",MenuComponent)(geom2d::rect<float>{{6.f,28.f},{84.f,24.f}},"Character",[](MenuFuncData data){
Component<CharacterRotatingDisplay>(CHARACTER_MENU,"Character Rotating Display")->SetIcon(GFX[classutils::GetClassInfo(game->GetPlayer()->GetClassName()).classFullImgName].Decal());
Component<MenuComponent>(CHARACTER_MENU,"Equip Selection Select Button")->Click();
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(size_t i{0};auto&[ability,slot]:abilityBoxes){
//Attempt to update icons in case the abilities have changed at some point.
//Attempt to update labels in case they have changed.
auto skillBox{Component<MenuIconButton>(CHARACTER_MENU,std::format("Skill Icon Label {}",i))};
auto skillNameLabel{Component<MenuLabel>(CHARACTER_MENU,std::format("Skill Name Label {}",i))};
skillBox->SetIcon(GFX[ability.get().icon].Decal());
skillNameLabel->SetLabel(ability.get().GetNameWithPlayerModifiers());
i++;
}
Menu::OpenMenu(CHARACTER_MENU);
return true;
},ButtonAttr::FIT_TO_LABEL)END;

View File

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