Add in ability display labels. Release Build 12210.
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 9m29s
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 9m29s
This commit is contained in:
parent
3cf5651d95
commit
8f1a4e0699
@ -1,3 +1,4 @@
|
||||
|
||||
#pragma region License
|
||||
/*
|
||||
License (OLC-3)
|
||||
@ -349,20 +350,19 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
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++){
|
||||
for(size_t i{0};auto&[ability,slot]:abilityBoxes){
|
||||
float x=0;
|
||||
float y=24+i*28;
|
||||
float labelX=31;
|
||||
float labelY=24+i*28+36;
|
||||
auto skillBox{characterMenuWindow->ADD(std::format("Skill Label {}",i),MenuComponent)(geom2d::rect<float>{{x,y+28},{24,24}},"",[](MenuFuncData data){
|
||||
return true;
|
||||
})END};
|
||||
auto&[ability,slot]{abilityBoxes[i]};
|
||||
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};
|
||||
auto skillNameLabel{characterMenuWindow->ADD(std::format("Skill Name Label {}",i),MenuLabel)(geom2d::rect<float>{{labelX,labelY},{96,24}},ability.get().GetNameWithPlayerModifiers())END};
|
||||
skillBox->SetHoverFunc([&abilityNameLabel,&abilityDescriptionLabel,&ability](MenuFuncData data){
|
||||
abilityNameLabel->SetLabel(ability.get().GetNameWithPlayerModifiers());
|
||||
abilityDescriptionLabel->SetLabel(ability.get().GetDescriptionWithPlayerModifiers());
|
||||
return true;
|
||||
});
|
||||
i++;
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
@ -380,7 +380,7 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
else slot->Disable();
|
||||
}
|
||||
for(int i=0;i<abilityBoxes.size();i++){
|
||||
auto slot{Component<MenuComponent>(data.menu.GetType(),std::format("Skill Label {}",i))};
|
||||
auto slot{Component<MenuComponent>(data.menu.GetType(),std::format("Skill Icon Label {}",i))};
|
||||
if(tabClicked==SKILLS)slot->Enable();
|
||||
else slot->Disable();
|
||||
}
|
||||
|
@ -37,13 +37,13 @@ All rights reserved.
|
||||
#pragma endregion
|
||||
|
||||
#include "Menu.h"
|
||||
#include "MenuComponent.h"
|
||||
#include "GameState.h"
|
||||
#include "MenuLabel.h"
|
||||
#include "AdventuresInLestoria.h"
|
||||
#include "CharacterRotatingDisplay.h"
|
||||
#include "ClassInfo.h"
|
||||
#include "Unlock.h"
|
||||
#include "MenuItemButton.h"
|
||||
|
||||
INCLUDE_game
|
||||
INCLUDE_GFX
|
||||
@ -59,6 +59,22 @@ void Menu::InitializePauseWindow(){
|
||||
pauseWindow->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;
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 12209
|
||||
#define VERSION_BUILD 12210
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user