diff --git a/Adventures in Lestoria/CharacterMenuWindow.cpp b/Adventures in Lestoria/CharacterMenuWindow.cpp index bba3877e..2c3ac5da 100644 --- a/Adventures in Lestoria/CharacterMenuWindow.cpp +++ b/Adventures in Lestoria/CharacterMenuWindow.cpp @@ -46,33 +46,19 @@ All rights reserved. #include "EquipSlotButton.h" #include "Item.h" #include "ScrollableWindowComponent.h" -#include "RowItemDisplay.h" +#include "AccessoryRowItemDisplay.h" #include "SoundEffect.h" #include "ProgressBar.h" -#include +#include "MenuItemLabel.h" INCLUDE_game INCLUDE_GFX -void Menu::InitializeCharacterMenuWindow(){ - static bool equipmentWindowOpened=false; - static int lastEquipButtonOpened=0; - - vf2d windowSize=game->GetScreenSize()-vf2d{52,52}; - Menu*characterMenuWindow=CreateMenu(CHARACTER_MENU,CENTERED,windowSize); - - characterMenuWindow->ADD("Character Label",MenuLabel)(geom2d::rect{{0,-4},{float(windowSize.x)-1,24}},"Character",2,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END; - characterMenuWindow->ADD("Equip Slot Outline",MenuComponent)(geom2d::rect{{0,28},{120,windowSize.y-37}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)END; - characterMenuWindow->ADD("Character Rotating Display",CharacterRotatingDisplay)(geom2d::rect{{118,18},{130,windowSize.y-28}},GFX[classutils::GetClassInfo(game->GetPlayer()->GetClassName()).classFullImgName].Decal())END; - - characterMenuWindow->ADD("Level Class Display",MenuLabel)(geom2d::rect{vf2d{126.f,windowSize.y-28},{118.f,8.f}},std::format("Lv{} {}",game->GetPlayer()->Level(),game->GetPlayer()->GetClassName()),1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; - characterMenuWindow->ADD("XP Bar",ProgressBar)(geom2d::rect{vf2d{126.f,10.f+windowSize.y-28},{118.f,8.f}},Pixel{247,183,82},BLACK,game->GetPlayer()->CurrentXP(),game->GetPlayer()->NextLevelXPRequired(),"xp")END; - +namespace CharacterMenuWindow{ struct AttributeData{ std::string attrName; const std::functioncalcFunc; }; - const static std::arraydisplayAttrs{ AttributeData{"Health",[&]()->int{return game->GetPlayer()->GetMaxHealth();}}, AttributeData{"Attack",[&]()->int{return game->GetPlayer()->GetAttack();}}, @@ -82,8 +68,74 @@ void Menu::InitializeCharacterMenuWindow(){ AttributeData{"Crit Rate",[&]()->int{return ceil(game->GetPlayer()->GetCritRatePct()*100);}}, AttributeData{"Crit Dmg",[&]()->int{return ceil(game->GetPlayer()->GetCritDmgPct()*100);}}, }; - const static std::arrayslotNames{"Helmet","Weapon","Armor","Gloves","Pants","Shoes","Ring 1","Ring 2"}; + template + std::shared_ptrGenerateItemDisplay(std::shared_ptrparent,int invIndex,const std::weak_ptrit){ + auto component=parent->ADD("Equip Item "+std::to_string(invIndex),T)(geom2d::rect{{2,2+invIndex*29.f},{120-15,28}},it, + [&](MenuFuncData data){ + const auto SelectedEquipIsDifferent=[](std::weak_ptrcomp){ + EquipSlot slot=EquipSlot(comp.lock()->I(Attribute::EQUIP_TYPE)); + std::weak_ptrcurrentItem=Inventory::GetEquip(slot); + + switch(slot){ + case EquipSlot::RING1: + case EquipSlot::RING2:{ + std::weak_ptrotherItem; + + if(slot&EquipSlot::RING1)otherItem=Inventory::GetEquip(EquipSlot::RING2); + else + if(slot&EquipSlot::RING2)otherItem=Inventory::GetEquip(EquipSlot::RING1); + return ISBLANK(otherItem)|| + (&*comp.lock()->GetItem().lock()!=&*otherItem.lock()&& + &*comp.lock()->GetItem().lock()!=&*currentItem.lock()); + }break; + default:{ + return &*comp.lock()->GetItem().lock()!=&*currentItem.lock(); + } + } + }; + + std::weak_ptrcomp=DYNAMIC_POINTER_CAST(data.component.lock()); + if(!comp.expired()){ + if(SelectedEquipIsDifferent(comp)){ //If we find that the opposite ring slot is equipped to us, this would be an item swap or the exact same ring, therefore no stat calculations apply. + Inventory::EquipItem(comp.lock()->GetItem(),EquipSlot(comp.lock()->I(Attribute::EQUIP_TYPE))); + if(Menu::IsCurrentlyActive(data.menu.GetType())){ + SoundEffect::PlaySFX(comp.lock()->GetItem().lock()->UseSound(),SoundEffect::CENTERED); + } + for(std::weak_ptrbutton:DYNAMIC_POINTER_CAST(data.parentComponent.lock())->GetComponents()){ + std::weak_ptrcomp=DYNAMIC_POINTER_CAST(button.lock()); + comp.lock()->SetSelected(false); + } + comp.lock()->SetSelected(true); + for(int counter=0;const AttributeData&attribute:displayAttrs){ + std::shared_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); + statDisplayLabel->SetStatChangeAmt(0); + } + std::shared_ptrequipButton=Component(CHARACTER_MENU,"Equip Slot "+slotNames[data.parentComponent.lock()->I(A::INDEXED_THEME)]); + equipButton->SetItem(comp.lock()->GetItem(),false); + } + }else{ + ERR("WARNING! Attempting to cast a button that isn't a RowItemDisplay!"); + } + return true; + },"","")END; + return component; + } +}; + +void Menu::InitializeCharacterMenuWindow(){ + static bool equipmentWindowOpened=false; + static int lastEquipButtonOpened=0; + + vf2d windowSize=game->GetScreenSize()-vf2d{52,52}; + Menu*characterMenuWindow=CreateMenu(CHARACTER_MENU,CENTERED,windowSize); + + characterMenuWindow->ADD("Character Label",MenuLabel)(geom2d::rect{{0,-4},{float(windowSize.x)-1,24}},"Character",2,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END; + characterMenuWindow->ADD("Equip Slot Outline",MenuComponent)(geom2d::rect{{0,28},{120,windowSize.y-37}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)END; + characterMenuWindow->ADD("Character Rotating Display",CharacterRotatingDisplay)(geom2d::rect{{118,18},{130,windowSize.y-28}},GFX[classutils::GetClassInfo(game->GetPlayer()->GetClassName()).classFullImgName].Decal())END; + + characterMenuWindow->ADD("Level Class Display",MenuLabel)(geom2d::rect{vf2d{126.f,windowSize.y-28},{118.f,8.f}},std::format("Lv{} {}",game->GetPlayer()->Level(),game->GetPlayer()->GetClassName()),1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; + characterMenuWindow->ADD("XP Bar",ProgressBar)(geom2d::rect{vf2d{126.f,10.f+windowSize.y-28},{118.f,8.f}},Pixel{247,183,82},BLACK,game->GetPlayer()->CurrentXP(),game->GetPlayer()->NextLevelXPRequired(),"xp")END; characterMenuWindow->ADD("Equip Selection Outline",MenuComponent)(geom2d::rect{{123,28},{120,windowSize.y-37}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)END ->Disable(); @@ -98,11 +150,11 @@ void Menu::InitializeCharacterMenuWindow(){ Component(data.component.lock()->parentMenu,"Equip Selection Bottom Outline")->Disable(); Component(data.component.lock()->parentMenu,"Equip Selection Select Button")->Disable(); Component(data.component.lock()->parentMenu,"Character Rotating Display")->Enable(); - for(int counter=0;const AttributeData&attribute:displayAttrs){ + for(int counter=0;const CharacterMenuWindow::AttributeData&attribute:CharacterMenuWindow::displayAttrs){ std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); statDisplayLabel.lock()->SetStatChangeAmt(0); } - data.menu.SetSelection(std::string_view(std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(data.menu.I(A::EQUIP_TYPE)))-1]))); + data.menu.SetSelection(std::string_view(std::format("Equip Slot {}",CharacterMenuWindow::slotNames[std::bit_width(unsigned(data.menu.I(A::EQUIP_TYPE)))-1]))); equipmentWindowOpened=false; return true; })DEPTH 0 END; @@ -129,7 +181,7 @@ void Menu::InitializeCharacterMenuWindow(){ labelY-=8; } EquipSlot slot=EquipSlot(equipSlot); - auto equipmentSlot=characterMenuWindow->ADD("Equip Slot "+slotNames[i],EquipSlotButton)(geom2d::rect{{x,y+28},{24,24}},slot, + auto equipmentSlot=characterMenuWindow->ADD("Equip Slot "+CharacterMenuWindow::slotNames[i],EquipSlotButton)(geom2d::rect{{x,y+28},{24,24}},slot, [&](MenuFuncData data){ EquipSlot slot=EquipSlot(data.component.lock()->I(Attribute::EQUIP_TYPE)); data.menu.I(A::EQUIP_TYPE)=int(slot); @@ -147,50 +199,45 @@ void Menu::InitializeCharacterMenuWindow(){ std::shared_ptrequipList=Component(data.component.lock()->parentMenu,"Equip List"); equipList->RemoveAllComponents(); for(int counter=0;const std::weak_ptrit:availableEquipment){ - const static auto OppositeRingSlotDoesNotMatchCurrentEquip=[](std::weak_ptrcomp){ - EquipSlot slot=EquipSlot(comp.lock()->I(Attribute::EQUIP_TYPE)); - std::weak_ptrotherItem; - if(slot&EquipSlot::RING1)otherItem=Inventory::GetEquip(EquipSlot::RING2); - else - if(slot&EquipSlot::RING2)otherItem=Inventory::GetEquip(EquipSlot::RING1); - return ISBLANK(otherItem)||(&*comp.lock()->GetItem().lock()!=&*otherItem.lock()); - }; - - auto equip=equipList->ADD("Equip Item "+std::to_string(counter),RowItemDisplay)(geom2d::rect{{2,2+counter*29.f},{120-15,28}},it, - [](MenuFuncData data){ - std::weak_ptrcomp=DYNAMIC_POINTER_CAST(data.component.lock()); - if(!comp.expired()){ - if(OppositeRingSlotDoesNotMatchCurrentEquip(comp.lock())){ //If we find that the opposite ring slot is equipped to us, this would be an item swap or the exact same ring, therefore no stat calculations apply. - Inventory::EquipItem(comp.lock()->GetItem(),EquipSlot(comp.lock()->I(Attribute::EQUIP_TYPE))); - if(Menu::IsCurrentlyActive(data.menu.GetType())){ - SoundEffect::PlaySFX(comp.lock()->GetItem().lock()->UseSound(),SoundEffect::CENTERED); - } - for(std::weak_ptrbutton:DYNAMIC_POINTER_CAST(data.parentComponent.lock())->GetComponents()){ - std::weak_ptrcomp=DYNAMIC_POINTER_CAST(button.lock()); - comp.lock()->SetSelected(false); - } - comp.lock()->SetSelected(true); - for(int counter=0;const AttributeData&attribute:displayAttrs){ - std::shared_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); - statDisplayLabel->SetStatChangeAmt(0); - } - std::shared_ptrequipButton=Component(CHARACTER_MENU,"Equip Slot "+slotNames[data.parentComponent.lock()->I(A::INDEXED_THEME)]); - equipButton->SetItem(comp.lock()->GetItem(),false); - } - }else{ - ERR("WARNING! Attempting to cast a button that isn't a RowItemDisplay!"); - } - return true; - },"Item Name","Item Description")END; + std::shared_ptrequip; + const bool isAccessorySlot=slot&(EquipSlot::RING1|EquipSlot::RING2); + if(isAccessorySlot){ + equip=CharacterMenuWindow::GenerateItemDisplay(equipList,counter,it); + }else{ + equip=CharacterMenuWindow::GenerateItemDisplay(equipList,counter,it); + } equip->SetHoverFunc( [&](MenuFuncData data){ + const auto SelectedEquipIsDifferent=[](std::weak_ptrcomp){ + EquipSlot slot=EquipSlot(comp.lock()->I(Attribute::EQUIP_TYPE)); + std::weak_ptrcurrentItem=Inventory::GetEquip(slot); + + switch(slot){ + case EquipSlot::RING1: + case EquipSlot::RING2:{ + std::weak_ptrotherItem; + + if(slot&EquipSlot::RING1)otherItem=Inventory::GetEquip(EquipSlot::RING2); + else + if(slot&EquipSlot::RING2)otherItem=Inventory::GetEquip(EquipSlot::RING1); + return ISBLANK(otherItem)|| + (&*comp.lock()->GetItem().lock()!=&*otherItem.lock()&& + &*comp.lock()->GetItem().lock()!=&*currentItem.lock()); + }break; + default:{ + return &*comp.lock()->GetItem().lock()!=&*currentItem.lock(); + } + } + }; + + if(!data.component.lock()->GetSubcomponentParent().expired())return true; std::weak_ptrbutton=DYNAMIC_POINTER_CAST(data.component.lock()); if(!button.expired()){ const std::weak_ptrbuttonItem=button.lock()->GetItem(); std::vectorstatsBeforeEquip; EquipSlot slot=EquipSlot(button.lock()->I(Attribute::EQUIP_TYPE)); - for(const AttributeData&attribute:displayAttrs){ + for(const CharacterMenuWindow::AttributeData&attribute:CharacterMenuWindow::displayAttrs){ statsBeforeEquip.push_back(attribute.calcFunc()); } @@ -202,9 +249,9 @@ void Menu::InitializeCharacterMenuWindow(){ if(slot&EquipSlot::RING1)otherItem=Inventory::GetEquip(EquipSlot::RING2); else if(slot&EquipSlot::RING2)otherItem=Inventory::GetEquip(EquipSlot::RING1); - if(OppositeRingSlotDoesNotMatchCurrentEquip(button.lock())){ //If we find that the opposite ring slot is equipped to us, this would be an item swap or the exact same ring, therefore no stat calculations apply. + if(SelectedEquipIsDifferent(button.lock())){ //If we find that the opposite ring slot is equipped to us, this would be an item swap or the exact same ring, therefore no stat calculations apply. Inventory::EquipItem(buttonItem,slot); - for(int counter=0;const AttributeData&attribute:displayAttrs){ + for(int counter=0;const CharacterMenuWindow::AttributeData&attribute:CharacterMenuWindow::displayAttrs){ std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); int statChangeAmt=attribute.calcFunc()-statsBeforeEquip[counter]; statDisplayLabel.lock()->SetStatChangeAmt(statChangeAmt); @@ -222,6 +269,10 @@ void Menu::InitializeCharacterMenuWindow(){ if(slot&EquipSlot::RING2)Inventory::EquipItem(otherItem,EquipSlot::RING1); } } + Component(data.menu.GetType(),"Item Name")->SetItem(buttonItem); + Component(data.menu.GetType(),"Item Description")->SetItem(buttonItem); + Component(data.menu.GetType(),"Item Name")->Enable(); + Component(data.menu.GetType(),"Item Description")->Enable(); }else{ ERR("WARNING! Attempting to cast a button that isn't a RowItemDisplay!"); } @@ -229,11 +280,13 @@ void Menu::InitializeCharacterMenuWindow(){ }); equip->SetMouseOutFunc( [](MenuFuncData data){ - for(int counter=0;const AttributeData&attribute:displayAttrs){ + for(int counter=0;const CharacterMenuWindow::AttributeData&attribute:CharacterMenuWindow::displayAttrs){ std::weak_ptrstatDisplayLabel=Component(CHARACTER_MENU,"Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label"); statDisplayLabel.lock()->SetStatChangeAmt(0); counter++; } + Component(data.menu.GetType(),"Item Name")->Disable(); + Component(data.menu.GetType(),"Item Description")->Disable(); return true; }); @@ -259,7 +312,7 @@ void Menu::InitializeCharacterMenuWindow(){ auto equipmentList=equipList->GetComponents(); auto itemEquipped=std::find_if(equipmentList.begin(),equipmentList.end(),[&](std::weak_ptr&component){ - return !ISBLANK(Inventory::GetEquip(slot))&&&*DYNAMIC_POINTER_CAST(component)->GetItem().lock()==&*Inventory::GetEquip(slot).lock(); + return !ISBLANK(Inventory::GetEquip(slot))&&component.lock()->GetSubcomponentParent().expired()&&&*DYNAMIC_POINTER_CAST(component)->GetItem().lock()==&*Inventory::GetEquip(slot).lock(); }); if(itemEquipped!=equipmentList.end()){ data.menu.SetSelection(*itemEquipped,true,true); @@ -301,24 +354,23 @@ void Menu::InitializeCharacterMenuWindow(){ equipmentSlot->SetShowQuantity(false); equipmentSlot->SetCompactDescriptions(false); equipSlot<<=1; - characterMenuWindow->ADD("Equip Label "+slotNames[i],PopupMenuLabel)(geom2d::rect{{labelX,labelY},{24,16}},slotNames[i],vf2d{0.5,1.f},ComponentAttr::SHADOW)END; + characterMenuWindow->ADD("Equip Label "+CharacterMenuWindow::slotNames[i],PopupMenuLabel)(geom2d::rect{{labelX,labelY},{24,16}},CharacterMenuWindow::slotNames[i],vf2d{0.5,1.f},ComponentAttr::SHADOW)END; Menu::AddEquipStatListener(equipmentSlot); } characterMenuWindow->ADD("Stat Display Outline",MenuComponent)(geom2d::rect{{245,28},{62,windowSize.y-37}},"",DO_NOTHING,ButtonAttr::UNSELECTABLE)END; int yOffset=0; - for(const AttributeData&attribute:displayAttrs){ + for(const CharacterMenuWindow::AttributeData&attribute:CharacterMenuWindow::displayAttrs){ std::string attrStr=GetLabelText(ItemAttribute::Get(attribute.attrName)); auto attrLabel=characterMenuWindow->ADD("Attribute "+std::string(ItemAttribute::Get(attribute.attrName).Name())+" Label",StatLabel)(geom2d::rect{{245,28+2+float(yOffset)},{62,18}},ItemAttribute::Get(attribute.attrName),attribute.calcFunc,1,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; - //Menu::AddEquipStatListener(attrLabel); yOffset+=20; } characterMenuWindow->ADD("Back button",MenuComponent)(geom2d::rect{{windowSize.x/2-64,windowSize.y-4.f},{128,12}},"Back",[](MenuFuncData data){Menu::stack.pop_back();return true;})END; - auto itemNameDisplay=characterMenuWindow->ADD("Item Name",MenuLabel)(geom2d::rect{{0,28},{120,12}},"",1,ComponentAttr::BACKGROUND|ComponentAttr::LEFT_ALIGN|ComponentAttr::OUTLINE|ComponentAttr::SHADOW|ComponentAttr::FIT_TO_LABEL)END; - auto itemDescriptionDisplay=characterMenuWindow->ADD("Item Description",MenuLabel)(geom2d::rect{{0,40},{120,windowSize.y-49}},"",1,ComponentAttr::BACKGROUND|ComponentAttr::LEFT_ALIGN|ComponentAttr::OUTLINE|ComponentAttr::SHADOW)END; + auto itemNameDisplay=characterMenuWindow->ADD("Item Name",MenuItemLabel)(geom2d::rect{{0,28},{120,12}},std::weak_ptr{},ITEM_NAME,1.f,ComponentAttr::BACKGROUND|ComponentAttr::LEFT_ALIGN|ComponentAttr::OUTLINE|ComponentAttr::SHADOW|ComponentAttr::FIT_TO_LABEL)END; + auto itemDescriptionDisplay=characterMenuWindow->ADD("Item Description",MenuItemLabel)(geom2d::rect{{0,40},{120,windowSize.y-49}},std::weak_ptr{},ITEM_DESCRIPTION,1.f,ComponentAttr::BACKGROUND|ComponentAttr::LEFT_ALIGN|ComponentAttr::OUTLINE|ComponentAttr::SHADOW)END; auto itemEquipNameDisplay=characterMenuWindow->ADD("Item Equip Name",MenuLabel)(geom2d::rect{{123,28},{120,12}},"",1,ComponentAttr::BACKGROUND|ComponentAttr::LEFT_ALIGN|ComponentAttr::OUTLINE|ComponentAttr::SHADOW|ComponentAttr::FIT_TO_LABEL)END; auto itemEquipDescriptionDisplay=characterMenuWindow->ADD("Item Equip Description",MenuLabel)(geom2d::rect{{123,40},{120,windowSize.y-49}},"",1,ComponentAttr::BACKGROUND|ComponentAttr::LEFT_ALIGN|ComponentAttr::OUTLINE|ComponentAttr::SHADOW)END; @@ -329,7 +381,7 @@ void Menu::InitializeCharacterMenuWindow(){ characterMenuWindow->SetupKeyboardNavigation( [](MenuType type,Data&returnData){ //On Open - returnData=std::format("Equip Slot {}",slotNames[0]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[0]); }, { //Button Key {{game->KEY_SHOULDER,Pressed},{"Scroll",[](MenuType type){}}}, @@ -422,6 +474,27 @@ void Menu::InitializeCharacterMenuWindow(){ Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->IncreaseSelectionIndex(-3.f); } }}}, + {game->KEY_SELECT,{[](MenuFuncData data){ + if(!data.menu.GetSelection().expired()&& + !data.menu.GetSelection().lock()->parentComponent.expired()&& + data.menu.GetSelection().lock()->parentComponent.lock()->GetName()=="Equip List" + &&data.component.lock()->GetSubcomponentParent().expired() + &&EquipSlot(data.menu.I(A::EQUIP_TYPE))&(EquipSlot::RING1|EquipSlot::RING2)){ + if(DYNAMIC_POINTER_CAST(data.menu.GetSelection().lock())->GetItem().lock()->IsLocked()){ + return "Unlock"; + }else{ + return "Lock"; + } + } + return ""; + },[](MenuType type){ + if(!Menu::menus[type]->GetSelection().expired()&& + !Menu::menus[type]->GetSelection().lock()->parentComponent.expired()&& + Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->GetName()=="Equip List" + &&Menu::menus[type]->GetSelection().lock()->GetSubcomponentParent().expired()){ + DYNAMIC_POINTER_CAST(Menu::menus[type]->GetSelection().lock())->GetLockButton().lock()->Click(); + } + }}}, } ,{ //Button Navigation Rules {"Equip List",{ @@ -451,11 +524,11 @@ void Menu::InitializeCharacterMenuWindow(){ }, .left=[](MenuType type,Data&returnData){ auto equipList=Component(type,"Equip List")->GetComponents(); - returnData=std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); }, .right=[](MenuType type,Data&returnData){ auto equipList=Component(type,"Equip List")->GetComponents(); - returnData=std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); } }}, {"Equip Selection Select Button",{ @@ -475,108 +548,108 @@ void Menu::InitializeCharacterMenuWindow(){ }, .left=[](MenuType type,Data&returnData){ auto equipList=Component(type,"Equip List")->GetComponents(); - returnData=std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); }, .right=[](MenuType type,Data&returnData){ auto equipList=Component(type,"Equip List")->GetComponents(); - returnData=std::format("Equip Slot {}",slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[std::bit_width(unsigned(Menu::menus[type]->I(A::EQUIP_TYPE)))-1]); } }}, - {std::format("Equip Slot {}", slotNames[0]),{ + {std::format("Equip Slot {}", CharacterMenuWindow::slotNames[0]),{ .up="Back button", - .down=std::format("Equip Slot {}", slotNames[2]), + .down=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[2]), .left=[&](MenuType type,Data&returnData){ if(equipmentWindowOpened){ returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; }else{ - returnData=std::format("Equip Slot {}",slotNames[1]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[1]); } }, - .right=std::format("Equip Slot {}", slotNames[1]),}}, - {std::format("Equip Slot {}", slotNames[1]),{ + .right=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[1]),}}, + {std::format("Equip Slot {}", CharacterMenuWindow::slotNames[1]),{ .up="Back button", - .down=std::format("Equip Slot {}", slotNames[3]), - .left=std::format("Equip Slot {}", slotNames[0]), + .down=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[3]), + .left=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[0]), .right=[](MenuType type,Data&returnData){ if(equipmentWindowOpened){ returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; }else{ - returnData=std::format("Equip Slot {}",slotNames[0]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[0]); } },}}, - {std::format("Equip Slot {}", slotNames[2]),{ - .up=std::format("Equip Slot {}", slotNames[0]), - .down=std::format("Equip Slot {}", slotNames[4]), + {std::format("Equip Slot {}", CharacterMenuWindow::slotNames[2]),{ + .up=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[0]), + .down=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[4]), .left=[](MenuType type,Data&returnData){ if(equipmentWindowOpened){ returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; }else{ - returnData=std::format("Equip Slot {}",slotNames[3]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[3]); } }, - .right=std::format("Equip Slot {}", slotNames[3]),}}, - {std::format("Equip Slot {}", slotNames[3]),{ - .up=std::format("Equip Slot {}", slotNames[1]), - .down=std::format("Equip Slot {}", slotNames[5]), - .left=std::format("Equip Slot {}", slotNames[2]), + .right=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[3]),}}, + {std::format("Equip Slot {}", CharacterMenuWindow::slotNames[3]),{ + .up=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[1]), + .down=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[5]), + .left=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[2]), .right=[](MenuType type,Data&returnData){ if(equipmentWindowOpened){ returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; }else{ - returnData=std::format("Equip Slot {}",slotNames[2]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[2]); } },}}, - {std::format("Equip Slot {}", slotNames[4]),{ - .up=std::format("Equip Slot {}", slotNames[2]), - .down=std::format("Equip Slot {}", slotNames[6]), + {std::format("Equip Slot {}", CharacterMenuWindow::slotNames[4]),{ + .up=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[2]), + .down=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[6]), .left=[](MenuType type,Data&returnData){ if(equipmentWindowOpened){ returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; }else{ - returnData=std::format("Equip Slot {}",slotNames[5]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[5]); } }, - .right=std::format("Equip Slot {}", slotNames[5]), + .right=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[5]), }}, - {std::format("Equip Slot {}", slotNames[5]),{ - .up=std::format("Equip Slot {}", slotNames[3]), - .down=std::format("Equip Slot {}", slotNames[7]), - .left=std::format("Equip Slot {}", slotNames[4]), + {std::format("Equip Slot {}", CharacterMenuWindow::slotNames[5]),{ + .up=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[3]), + .down=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[7]), + .left=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[4]), .right=[](MenuType type,Data&returnData){ if(equipmentWindowOpened){ returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; }else{ - returnData=std::format("Equip Slot {}",slotNames[4]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[4]); } },}}, - {std::format("Equip Slot {}", slotNames[6]),{ - .up=std::format("Equip Slot {}", slotNames[4]), + {std::format("Equip Slot {}", CharacterMenuWindow::slotNames[6]),{ + .up=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[4]), .down="Back button", .left=[](MenuType type,Data&returnData){ if(equipmentWindowOpened){ returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; }else{ - returnData=std::format("Equip Slot {}",slotNames[7]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[7]); } }, - .right=std::format("Equip Slot {}",slotNames[7]), + .right=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[7]), }}, - {std::format("Equip Slot {}", slotNames[7]),{ - .up=std::format("Equip Slot {}", slotNames[5]), + {std::format("Equip Slot {}", CharacterMenuWindow::slotNames[7]),{ + .up=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[5]), .down="Back button", - .left=std::format("Equip Slot {}",slotNames[6]), + .left=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[6]), .right=[](MenuType type,Data&returnData){ if(equipmentWindowOpened){ returnData=Component(type,"Equip List")->GetComponents()[unsigned(Menu::menus[type]->I(A::ITEM_SLOT))]; }else{ - returnData=std::format("Equip Slot {}",slotNames[6]); + returnData=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[6]); } },}}, {"Back button",{ - .up=std::format("Equip Slot {}", slotNames[7]), - .down=std::format("Equip Slot {}", slotNames[0]), - .left=std::format("Equip Slot {}", slotNames[7]), - .right=std::format("Equip Slot {}",slotNames[6]), + .up=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[7]), + .down=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[0]), + .left=std::format("Equip Slot {}", CharacterMenuWindow::slotNames[7]), + .right=std::format("Equip Slot {}",CharacterMenuWindow::slotNames[6]), }}, }); } \ No newline at end of file diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index 862949a7..ea9af8d1 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -10,7 +10,4 @@ should gemstones dropp from boss stages aswell? (Maybe lower droprate?) Funny text colors with text color override on blacksmith menu -Toggle for displaying error messages -Pressing down from the - button on sherman should move to the craft button as well. -Inventory menu still not blinking -Pressing R2/L2 scrolls through monster loot/stage loot window REALLY fast \ No newline at end of file +Toggle for displaying error messages \ No newline at end of file diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 0c18ee2d..269b8a53 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 5 #define VERSION_PATCH 1 -#define VERSION_BUILD 8087 +#define VERSION_BUILD 8105 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index e6e3b6ad..e995a982 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -141,6 +141,7 @@ Monsters # Jump property overrides JumpTimer = 10.0 + JumpDelayTime = 1.2 JumpAttackDamage = 20 JumpKnockbackFactor = 50.0 JumpMoveSpd = 90 diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 904dafca..4373fc67 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ