Working copy merge from multimultishotdamagemultchange branch.
All checks were successful
Emscripten Build / Build_and_Deploy_Web_Build (push) Successful in 6m23s

This commit is contained in:
sigonasr2 2025-07-30 08:27:57 -05:00
parent 9ee29654b8
commit 0d5d0cda5c
3 changed files with 47 additions and 32 deletions

View File

@ -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}; 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{
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()->GetAbility1(),AbilitySlot::ABILITY1}, std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility2(),AbilitySlot::ABILITY2},
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()->GetAbility3(),AbilitySlot::ABILITY3}, std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility4(),AbilitySlot::ABILITY4},
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetAbility4(),AbilitySlot::ABILITY4}, std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetRightClickAbility(),AbilitySlot::DEFENSIVE},
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetRightClickAbility(),AbilitySlot::DEFENSIVE}, };
}; for(size_t i{0};auto&[ability,slot]:abilityBoxes){
for(size_t i{0};auto&[ability,slot]:abilityBoxes){ float x=8;
float x=4; float y=14+i*28;
float y=4+i*28; float labelX=24;
float labelX=28; float labelY=24+i*26+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 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};
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){
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());
Component<MenuLabel>(data.menu.GetType(),"Ability Name Text")->SetLabel(ability.GetNameWithPlayerModifiers()); Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")->SetLabel(ability.GetDescriptionWithPlayerModifiers());
Component<MenuLabel>(data.menu.GetType(),"Ability Description Text")->SetLabel(ability.GetDescriptionWithPlayerModifiers()); return true;
return true; });
}); skillBox->Disable(); //Hide these by default.
skillBox->Disable(); //Hide these by default. i++;
i++;
}
} }
#pragma endregion #pragma endregion
@ -393,21 +391,36 @@ void Menu::InitializeCharacterMenuWindow(){
std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetRightClickAbility(),AbilitySlot::DEFENSIVE}, std::pair<std::reference_wrapper<Ability>,AbilitySlot>{game->GetPlayer()->GetRightClickAbility(),AbilitySlot::DEFENSIVE},
}; };
for(int i=0;i<abilityBoxes.size();i++){ for(int i=0;i<abilityBoxes.size();i++){
auto&[ability,slot]{abilityBoxes[i]}; auto&[ability,slot]{abilityBoxes[i]};
Component<MenuIconButton>(data.menu.GetType(),std::format("Skill Icon Label {}",i))->SetIcon(GFX[ability.get().icon].Decal()); auto abilityIcon{Component<MenuIconButton>(data.menu.GetType(),std::format("Skill Icon Label {}",i))};
Component<MenuLabel>(data.menu.GetType(),std::format("Skill Name Label {}",i))->SetLabel(ability.get().GetNameWithPlayerModifiers()); auto abilityText{Component<MenuLabel>(data.menu.GetType(),std::format("Skill Name Label {}",i))};
auto abilityLabel{Component<MenuComponent>(data.menu.GetType(),std::format("Skill Icon Label {}",i))}; abilityIcon->SetIcon(GFX[ability.get().icon].Decal());
if(tabClicked==SKILLS)abilityLabel->Enable(); abilityText->SetLabel(ability.get().GetNameWithPlayerModifiers());
else abilityLabel->Disable(); 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(),"Equipment Tab")->SetSelected(tabClicked==EQUIPMENT);
Component<MenuComponent>(data.menu.GetType(),"Skills Tab")->SetSelected(tabClicked==SKILLS); 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){ if(tabClicked==EQUIPMENT){
abilityNameLabel->Disable(); abilityNameLabel->Disable();
abilityDescriptionLabel->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{ }else{
abilityNameLabel->Enable(); abilityNameLabel->Enable();
abilityDescriptionLabel->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();
}
} }
}; };

View File

@ -73,6 +73,8 @@ void Menu::InitializePauseWindow(){
auto skillNameLabel{Component<MenuLabel>(CHARACTER_MENU,std::format("Skill Name Label {}",i))}; auto skillNameLabel{Component<MenuLabel>(CHARACTER_MENU,std::format("Skill Name Label {}",i))};
skillBox->SetIcon(GFX[ability.get().icon].Decal()); skillBox->SetIcon(GFX[ability.get().icon].Decal());
skillNameLabel->SetLabel(ability.get().GetNameWithPlayerModifiers()); skillNameLabel->SetLabel(ability.get().GetNameWithPlayerModifiers());
skillBox->Disable();
skillNameLabel->Disable();
i++; i++;
} }
Menu::OpenMenu(CHARACTER_MENU); Menu::OpenMenu(CHARACTER_MENU);

View File

@ -79,11 +79,11 @@ void State_MainMenu::OnUserUpdate(AiL*game){
game->UpdateCamera(game->GetElapsedTime()); game->UpdateCamera(game->GetElapsedTime());
game->ClearTimedOutGarbage(); game->ClearTimedOutGarbage();
}; }
void State_MainMenu::Draw(AiL*game){ void State_MainMenu::Draw(AiL*game){
game->RenderWorld(game->GetElapsedTime()); game->RenderWorld(game->GetElapsedTime());
TitleScreen::Draw(); TitleScreen::Draw();
}; }
const ZoneData&State_MainMenu::ChooseRandomFocusArea(){ const ZoneData&State_MainMenu::ChooseRandomFocusArea(){
//std::vector<ZoneData> //std::vector<ZoneData>