Compare commits
2 Commits
0d5d0cda5c
...
9b252334e5
Author | SHA1 | Date | |
---|---|---|---|
9b252334e5 | |||
ad28ead6d5 |
@ -137,8 +137,12 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
->Disable();
|
||||
characterMenuWindow->ADD("Equip List",ScrollableWindowComponent)(geom2d::rect<float>{{123,28},{120,windowSize.y-37-24}})DEPTH -1 END
|
||||
->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();
|
||||
|
||||
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",
|
||||
[](MenuFuncData data){
|
||||
Component<MenuComponent>(data.component.lock()->parentMenu,"Equip Selection Outline")->Disable();
|
||||
@ -339,8 +343,9 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
}
|
||||
#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 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 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)DEPTH -1 END};
|
||||
abilityNameLabel->Disable();
|
||||
|
||||
#pragma region Skill Selection Boxes
|
||||
const std::array abilityBoxes{
|
||||
@ -359,11 +364,23 @@ 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};
|
||||
skillBox->SetHoverFunc([slot](MenuFuncData data){
|
||||
const auto&ability{game->GetPlayer()->GetAbility(slot)};
|
||||
Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")->SetLabel(ability.GetNameWithPlayerModifiers());
|
||||
Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")->SetLabel(ability.GetDescriptionWithPlayerModifiers());
|
||||
auto abilityNameTextLabel{Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")};
|
||||
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;
|
||||
});
|
||||
skillBox->Disable(); //Hide these by default.
|
||||
skillNameLabel->Disable(); //Hide these by default.
|
||||
i++;
|
||||
}
|
||||
#pragma endregion
|
||||
@ -397,8 +414,10 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
abilityIcon->SetIcon(GFX[ability.get().icon].Decal());
|
||||
abilityText->SetLabel(ability.get().GetNameWithPlayerModifiers());
|
||||
if(tabClicked==SKILLS){
|
||||
abilityIcon->Enable();
|
||||
abilityText->Enable();
|
||||
if(abilityText->GetLabel()!="???"){ //Unknown abilities should remain hidden for the player's surprise.
|
||||
abilityIcon->Enable();
|
||||
abilityText->Enable();
|
||||
}
|
||||
}else{
|
||||
abilityIcon->Disable();
|
||||
abilityText->Disable();
|
||||
|
@ -67,9 +67,9 @@ using ToggleFunc=std::function<bool(ToggleFuncData)>;
|
||||
#define END )
|
||||
#define DEPTH ,
|
||||
|
||||
#define DEFAULT_DEPTH -999999
|
||||
#define STARTING_DEPTH 999999
|
||||
#define MAX_MENUS 64
|
||||
constexpr int DEFAULT_DEPTH = -999999;
|
||||
constexpr int STARTING_DEPTH = 999999;
|
||||
constexpr uint16_t MAX_MENUS = 64;
|
||||
|
||||
using Data=std::variant<ButtonName,std::weak_ptr<MenuComponent>>;
|
||||
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.
|
||||
protected:
|
||||
int depth=0;
|
||||
int depth=0; //Higher depth (positive) means in front. Lower depth (negative) means behind.
|
||||
float hoverEffect=0;
|
||||
std::string name="";
|
||||
geom2d::rect<float>rect;
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 12212
|
||||
#define VERSION_BUILD 12245
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user