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
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m28s
This commit is contained in:
parent
c14740687b
commit
be05839743
@ -343,28 +343,30 @@ 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};
|
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
|
#pragma region Skill Selection Boxes
|
||||||
const std::array abilityBoxes{
|
{
|
||||||
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility1(),AbilitySlot::ABILITY1},
|
const std::array abilityBoxes{
|
||||||
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility2(),AbilitySlot::ABILITY2},
|
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility1(),AbilitySlot::ABILITY1},
|
||||||
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility3(),AbilitySlot::ABILITY3},
|
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility2(),AbilitySlot::ABILITY2},
|
||||||
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility4(),AbilitySlot::ABILITY4},
|
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility3(),AbilitySlot::ABILITY3},
|
||||||
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetRightClickAbility(),AbilitySlot::DEFENSIVE},
|
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){
|
};
|
||||||
float x=0;
|
for(size_t i{0};auto&[ability,slot]:abilityBoxes){
|
||||||
float y=24+i*28;
|
float x=0;
|
||||||
float labelX=31;
|
float y=24+i*28;
|
||||||
float labelY=24+i*28+36;
|
float labelX=31;
|
||||||
auto skillBox{characterMenuWindow->ADD(std::format("Skill Icon Label {}",i),MenuIconButton)(geom2d::rect<float>{{x,y+28},{24,24}},GFX[ability.get().icon].Decal(),DO_NOTHING)END};
|
float labelY=24+i*28+36;
|
||||||
auto skillNameLabel{characterMenuWindow->ADD(std::format("Skill Name Label {}",i),MenuLabel)(geom2d::rect<float>{{labelX,labelY},{96,24}},ability.get().GetNameWithPlayerModifiers())END};
|
auto skillBox{characterMenuWindow->ADD(std::format("Skill Icon Label {}",i),MenuIconButton)(geom2d::rect<float>{{x,y+28},{24,24}},GFX[ability.get().icon].Decal(),DO_NOTHING)END};
|
||||||
skillBox->SetHoverFunc([slot](MenuFuncData data){
|
auto skillNameLabel{characterMenuWindow->ADD(std::format("Skill Name Label {}",i),MenuLabel)(geom2d::rect<float>{{labelX,labelY},{96,24}},ability.get().GetNameWithPlayerModifiers())END};
|
||||||
const auto&ability{game->GetPlayer()->GetAbility(slot)};
|
skillBox->SetHoverFunc([slot](MenuFuncData data){
|
||||||
Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")->SetLabel(ability.GetNameWithPlayerModifiers());
|
const auto&ability{game->GetPlayer()->GetAbility(slot)};
|
||||||
Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")->SetLabel(ability.GetDescriptionWithPlayerModifiers());
|
Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")->SetLabel(ability.GetNameWithPlayerModifiers());
|
||||||
return true;
|
Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")->SetLabel(ability.GetDescriptionWithPlayerModifiers());
|
||||||
});
|
return true;
|
||||||
skillBox->Disable(); //Hide these by default.
|
});
|
||||||
i++;
|
skillBox->Disable(); //Hide these by default.
|
||||||
|
i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ All rights reserved.
|
|||||||
#include "CharacterRotatingDisplay.h"
|
#include "CharacterRotatingDisplay.h"
|
||||||
#include "ClassInfo.h"
|
#include "ClassInfo.h"
|
||||||
#include "Unlock.h"
|
#include "Unlock.h"
|
||||||
|
#include "MenuIconButton.h"
|
||||||
|
|
||||||
INCLUDE_game
|
INCLUDE_game
|
||||||
INCLUDE_GFX
|
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){
|
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<CharacterRotatingDisplay>(CHARACTER_MENU,"Character Rotating Display")->SetIcon(GFX[classutils::GetClassInfo(game->GetPlayer()->GetClassName()).classFullImgName].Decal());
|
||||||
Component<MenuComponent>(CHARACTER_MENU,"Equip Selection Select Button")->Click();
|
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);
|
Menu::OpenMenu(CHARACTER_MENU);
|
||||||
return true;
|
return true;
|
||||||
},ButtonAttr::FIT_TO_LABEL)END;
|
},ButtonAttr::FIT_TO_LABEL)END;
|
||||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 1
|
#define VERSION_MAJOR 1
|
||||||
#define VERSION_MINOR 3
|
#define VERSION_MINOR 3
|
||||||
#define VERSION_PATCH 0
|
#define VERSION_PATCH 0
|
||||||
#define VERSION_BUILD 12210
|
#define VERSION_BUILD 12234
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user