Proper implementation of skill and ability displays in the Character menu. Ready for merge. Release Build 12245.
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 8m2s
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 8m2s
This commit is contained in:
parent
ad28ead6d5
commit
9b252334e5
@ -137,8 +137,12 @@ void Menu::InitializeCharacterMenuWindow(){
|
|||||||
->Disable();
|
->Disable();
|
||||||
characterMenuWindow->ADD("Equip List",ScrollableWindowComponent)(geom2d::rect<float>{{123,28},{120,windowSize.y-37-24}})DEPTH -1 END
|
characterMenuWindow->ADD("Equip List",ScrollableWindowComponent)(geom2d::rect<float>{{123,28},{120,windowSize.y-37-24}})DEPTH -1 END
|
||||||
->Disable();
|
->Disable();
|
||||||
characterMenuWindow->ADD("Equip Selection Bottom Outline",MenuComponent)(geom2d::rect<float>{{123,28+(windowSize.y-37-24)},{120,24}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)END
|
characterMenuWindow->ADD("Equip Selection Bottom Outline",MenuComponent)(geom2d::rect<float>{{123,28+(windowSize.y-37-24)},{120,24}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)DEPTH 2 END
|
||||||
->Disable();
|
->Disable();
|
||||||
|
|
||||||
|
auto abilitySelectionOutline{characterMenuWindow->ADD("Ability Selection Outline",MenuComponent)(geom2d::rect<float>{{123,28},{120,windowSize.y-37}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)DEPTH 0 END};
|
||||||
|
abilitySelectionOutline->Disable();
|
||||||
|
|
||||||
auto equipSelectionSelectButton=characterMenuWindow->ADD("Equip Selection Select Button",MenuComponent)(geom2d::rect<float>{{123+12,28+(windowSize.y-37-24)+6},{96,12}},"Select",
|
auto equipSelectionSelectButton=characterMenuWindow->ADD("Equip Selection Select Button",MenuComponent)(geom2d::rect<float>{{123+12,28+(windowSize.y-37-24)+6},{96,12}},"Select",
|
||||||
[](MenuFuncData data){
|
[](MenuFuncData data){
|
||||||
Component<MenuComponent>(data.component.lock()->parentMenu,"Equip Selection Outline")->Disable();
|
Component<MenuComponent>(data.component.lock()->parentMenu,"Equip Selection Outline")->Disable();
|
||||||
@ -339,8 +343,9 @@ void Menu::InitializeCharacterMenuWindow(){
|
|||||||
}
|
}
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
auto abilityNameLabel{characterMenuWindow->ADD("Ability Name Text",MenuLabel)(geom2d::rect<float>{{125,30},{116,windowSize.y-39}},"",1.f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW)END};
|
auto abilityNameLabel{characterMenuWindow->ADD("Ability Name Text",MenuLabel)(geom2d::rect<float>{{123,28},{116,12}},"",1.f,ComponentAttr::LEFT_ALIGN|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)DEPTH -1 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};
|
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)DEPTH -1 END};
|
||||||
|
abilityNameLabel->Disable();
|
||||||
|
|
||||||
#pragma region Skill Selection Boxes
|
#pragma region Skill Selection Boxes
|
||||||
const std::array abilityBoxes{
|
const std::array abilityBoxes{
|
||||||
@ -359,8 +364,19 @@ void Menu::InitializeCharacterMenuWindow(){
|
|||||||
auto skillNameLabel{characterMenuWindow->ADD(std::format("Skill Name Label {}",i),MenuLabel)(geom2d::rect<float>{{labelX+4,labelY-6},{96,24}},ability.get().GetNameWithPlayerModifiers())END};
|
auto skillNameLabel{characterMenuWindow->ADD(std::format("Skill Name Label {}",i),MenuLabel)(geom2d::rect<float>{{labelX+4,labelY-6},{96,24}},ability.get().GetNameWithPlayerModifiers())END};
|
||||||
skillBox->SetHoverFunc([slot](MenuFuncData data){
|
skillBox->SetHoverFunc([slot](MenuFuncData data){
|
||||||
const auto&ability{game->GetPlayer()->GetAbility(slot)};
|
const auto&ability{game->GetPlayer()->GetAbility(slot)};
|
||||||
Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")->SetLabel(ability.GetNameWithPlayerModifiers());
|
auto abilityNameTextLabel{Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")};
|
||||||
Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")->SetLabel(ability.GetDescriptionWithPlayerModifiers());
|
auto abilityDescriptionTextLabel{Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")};
|
||||||
|
abilityNameTextLabel->SetLabel(ability.GetNameWithPlayerModifiers());
|
||||||
|
abilityDescriptionTextLabel->SetLabel(ability.GetDescriptionWithPlayerModifiers());
|
||||||
|
abilityNameTextLabel->Enable();
|
||||||
|
abilityDescriptionTextLabel->Enable();
|
||||||
|
Component<MenuComponent>(data.menu.GetType(),"Ability Selection Outline")->Enable();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
skillBox->SetMouseOutFunc([](MenuFuncData data){
|
||||||
|
Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")->Disable();
|
||||||
|
Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")->Disable();
|
||||||
|
Component<MenuComponent>(data.menu.GetType(),"Ability Selection Outline")->Disable();
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
skillBox->Disable(); //Hide these by default.
|
skillBox->Disable(); //Hide these by default.
|
||||||
@ -398,8 +414,10 @@ void Menu::InitializeCharacterMenuWindow(){
|
|||||||
abilityIcon->SetIcon(GFX[ability.get().icon].Decal());
|
abilityIcon->SetIcon(GFX[ability.get().icon].Decal());
|
||||||
abilityText->SetLabel(ability.get().GetNameWithPlayerModifiers());
|
abilityText->SetLabel(ability.get().GetNameWithPlayerModifiers());
|
||||||
if(tabClicked==SKILLS){
|
if(tabClicked==SKILLS){
|
||||||
abilityIcon->Enable();
|
if(abilityText->GetLabel()!="???"){ //Unknown abilities should remain hidden for the player's surprise.
|
||||||
abilityText->Enable();
|
abilityIcon->Enable();
|
||||||
|
abilityText->Enable();
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
abilityIcon->Disable();
|
abilityIcon->Disable();
|
||||||
abilityText->Disable();
|
abilityText->Disable();
|
||||||
|
@ -67,9 +67,9 @@ using ToggleFunc=std::function<bool(ToggleFuncData)>;
|
|||||||
#define END )
|
#define END )
|
||||||
#define DEPTH ,
|
#define DEPTH ,
|
||||||
|
|
||||||
#define DEFAULT_DEPTH -999999
|
constexpr int DEFAULT_DEPTH = -999999;
|
||||||
#define STARTING_DEPTH 999999
|
constexpr int STARTING_DEPTH = 999999;
|
||||||
#define MAX_MENUS 64
|
constexpr uint16_t MAX_MENUS = 64;
|
||||||
|
|
||||||
using Data=std::variant<ButtonName,std::weak_ptr<MenuComponent>>;
|
using Data=std::variant<ButtonName,std::weak_ptr<MenuComponent>>;
|
||||||
using MenuDataFunc=std::function<void(MenuType,Data&)>;
|
using MenuDataFunc=std::function<void(MenuType,Data&)>;
|
||||||
|
@ -99,7 +99,7 @@ private:
|
|||||||
|
|
||||||
std::weak_ptr<MenuComponent>subcomponentParent; //For subcomponents, this value provides the actual component this subcomponent was spawned from.
|
std::weak_ptr<MenuComponent>subcomponentParent; //For subcomponents, this value provides the actual component this subcomponent was spawned from.
|
||||||
protected:
|
protected:
|
||||||
int depth=0;
|
int depth=0; //Higher depth (positive) means in front. Lower depth (negative) means behind.
|
||||||
float hoverEffect=0;
|
float hoverEffect=0;
|
||||||
std::string name="";
|
std::string name="";
|
||||||
geom2d::rect<float>rect;
|
geom2d::rect<float>rect;
|
||||||
|
@ -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 12214
|
#define VERSION_BUILD 12245
|
||||||
|
|
||||||
#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