Working copy merge from multimultishotdamagemultchange branch.
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m23s
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m23s
This commit is contained in:
parent
9ee29654b8
commit
0d5d0cda5c
@ -343,30 +343,28 @@ 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},
|
||||
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){
|
||||
float x=4;
|
||||
float y=4+i*28;
|
||||
float labelX=28;
|
||||
float labelY=24+i*28+36;
|
||||
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([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());
|
||||
return true;
|
||||
});
|
||||
skillBox->Disable(); //Hide these by default.
|
||||
i++;
|
||||
}
|
||||
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},
|
||||
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){
|
||||
float x=8;
|
||||
float y=14+i*28;
|
||||
float labelX=24;
|
||||
float labelY=24+i*26+28;
|
||||
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+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());
|
||||
return true;
|
||||
});
|
||||
skillBox->Disable(); //Hide these by default.
|
||||
i++;
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
@ -393,21 +391,36 @@ void Menu::InitializeCharacterMenuWindow(){
|
||||
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetRightClickAbility(),AbilitySlot::DEFENSIVE},
|
||||
};
|
||||
for(int i=0;i<abilityBoxes.size();i++){
|
||||
auto&[ability,slot]{abilityBoxes[i]};
|
||||
Component<MenuIconButton>(data.menu.GetType(),std::format("Skill Icon Label {}",i))->SetIcon(GFX[ability.get().icon].Decal());
|
||||
Component<MenuLabel>(data.menu.GetType(),std::format("Skill Name Label {}",i))->SetLabel(ability.get().GetNameWithPlayerModifiers());
|
||||
auto abilityLabel{Component<MenuComponent>(data.menu.GetType(),std::format("Skill Icon Label {}",i))};
|
||||
if(tabClicked==SKILLS)abilityLabel->Enable();
|
||||
else abilityLabel->Disable();
|
||||
auto&[ability,slot]{abilityBoxes[i]};
|
||||
auto abilityIcon{Component<MenuIconButton>(data.menu.GetType(),std::format("Skill Icon Label {}",i))};
|
||||
auto abilityText{Component<MenuLabel>(data.menu.GetType(),std::format("Skill Name Label {}",i))};
|
||||
abilityIcon->SetIcon(GFX[ability.get().icon].Decal());
|
||||
abilityText->SetLabel(ability.get().GetNameWithPlayerModifiers());
|
||||
if(tabClicked==SKILLS){
|
||||
abilityIcon->Enable();
|
||||
abilityText->Enable();
|
||||
}else{
|
||||
abilityIcon->Disable();
|
||||
abilityText->Disable();
|
||||
}
|
||||
}
|
||||
Component<MenuComponent>(data.menu.GetType(),"Equipment Tab")->SetSelected(tabClicked==EQUIPMENT);
|
||||
Component<MenuComponent>(data.menu.GetType(),"Skills Tab")->SetSelected(tabClicked==SKILLS);
|
||||
const static std::array<std::string,8>slotNames{"Helmet","Weapon","Armor","Gloves","Pants","Shoes","Ring 1","Ring 2"};
|
||||
if(tabClicked==EQUIPMENT){
|
||||
abilityNameLabel->Disable();
|
||||
abilityDescriptionLabel->Disable();
|
||||
for(size_t ind{0};ind<slotNames.size();ind++){
|
||||
Component<MenuItemItemButton>(CHARACTER_MENU,"Equip Slot "+slotNames[ind])->Enable();
|
||||
Component<PopupMenuLabel>(CHARACTER_MENU,"Equip Label "+slotNames[ind])->Enable();
|
||||
}
|
||||
}else{
|
||||
abilityNameLabel->Enable();
|
||||
abilityDescriptionLabel->Enable();
|
||||
for(size_t ind{0};ind<slotNames.size();ind++){
|
||||
Component<MenuItemItemButton>(CHARACTER_MENU,"Equip Slot "+slotNames[ind])->Disable();
|
||||
Component<PopupMenuLabel>(CHARACTER_MENU,"Equip Label "+slotNames[ind])->Disable();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -73,6 +73,8 @@ void Menu::InitializePauseWindow(){
|
||||
auto skillNameLabel{Component<MenuLabel>(CHARACTER_MENU,std::format("Skill Name Label {}",i))};
|
||||
skillBox->SetIcon(GFX[ability.get().icon].Decal());
|
||||
skillNameLabel->SetLabel(ability.get().GetNameWithPlayerModifiers());
|
||||
skillBox->Disable();
|
||||
skillNameLabel->Disable();
|
||||
i++;
|
||||
}
|
||||
Menu::OpenMenu(CHARACTER_MENU);
|
||||
|
@ -79,11 +79,11 @@ void State_MainMenu::OnUserUpdate(AiL*game){
|
||||
game->UpdateCamera(game->GetElapsedTime());
|
||||
|
||||
game->ClearTimedOutGarbage();
|
||||
};
|
||||
}
|
||||
void State_MainMenu::Draw(AiL*game){
|
||||
game->RenderWorld(game->GetElapsedTime());
|
||||
TitleScreen::Draw();
|
||||
};
|
||||
}
|
||||
|
||||
const ZoneData&State_MainMenu::ChooseRandomFocusArea(){
|
||||
//std::vector<ZoneData>
|
||||
|
Loading…
x
Reference in New Issue
Block a user