diff --git a/Adventures in Lestoria/Adventures in Lestoria.tiled-project b/Adventures in Lestoria/Adventures in Lestoria.tiled-project index 87c0dbcc..4c77688e 100644 --- a/Adventures in Lestoria/Adventures in Lestoria.tiled-project +++ b/Adventures in Lestoria/Adventures in Lestoria.tiled-project @@ -281,7 +281,11 @@ "CAMPAIGN_3_6", "CAMPAIGN_3_7", "CAMPAIGN_3_8", - "CAMPAIGN_3_B1" + "CAMPAIGN_3_B1", + "BOSS_3", + "BOSS_3_B", + "STORY_3_1", + "STORY_3_2" ], "valuesAsFlags": false }, diff --git a/Adventures in Lestoria/ArtificerEnchantWindow.cpp b/Adventures in Lestoria/ArtificerEnchantWindow.cpp index c510da47..eeab6d3d 100644 --- a/Adventures in Lestoria/ArtificerEnchantWindow.cpp +++ b/Adventures in Lestoria/ArtificerEnchantWindow.cpp @@ -38,12 +38,92 @@ All rights reserved. #include "Menu.h" #include "AdventuresInLestoria.h" +#include "RowInventoryScrollableWindowComponent.h" +#include "MenuItemItemButton.h" +#include "MenuLabel.h" +#include "MenuDecal.h" +#include "PlayerMoneyLabel.h" INCLUDE_game void Menu::InitializeArtificerEnchantWindow(){ - Menu*artificerEnchantWindow=CreateMenu(ARTIFICER_ENCHANT,CENTERED,vi2d{144,144}); + Menu*artificerEnchantWindow=CreateMenu(ARTIFICER_ENCHANT,CENTERED,game->GetScreenSize()-vi2d{52,52}); + + auto enchantingTitleLabel{artificerEnchantWindow->ADD("Enchanting Title Label",MenuLabel)(geom2d::rect{{0.f,-16.f},{artificerEnchantWindow->size.x,24.f}},"Accessory Enchanting",2.f,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END}; + + auto inventoryLabel{artificerEnchantWindow->ADD("Accessory List Label",MenuLabel)(geom2d::rect{{0.f,12.f},{180.f,12.f}},"Choose Accessory:",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END}; + + auto itemIcon{artificerEnchantWindow->ADD("Item Icon",MenuItemItemButton)(geom2d::rect({artificerEnchantWindow->size.x/2+4.f,16.f},{48,48}),Item::BLANK,DO_NOTHING,"","Item Description",IconButtonAttr::NOT_SELECTABLE)END}; + itemIcon->SetIconScale({2.f,2.f}); + itemIcon->SetCompactDescriptions(true); + + auto accessoryDescription{artificerEnchantWindow->ADD("Item Description",MenuLabel)(geom2d::rect{{artificerEnchantWindow->size.x/2+56.f,16.f},{artificerEnchantWindow->size.x/2-40.f,72.f}},"",0.5f,ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE|ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END}; + + const auto ResetRefineDisplay{[artificerEnchantWindow](){ + MenuType menuType{artificerEnchantWindow->GetType()}; + Component(menuType,"Item Icon")->SetItem(Item::BLANK); + }}; + const auto EnableRefineDisplay{[artificerEnchantWindow](){ + MenuType menuType{artificerEnchantWindow->GetType()}; + const std::weak_ptr&selectedItem{Component(menuType,"Item Icon")->GetItem()}; + }}; + + auto inventoryDisplay{artificerEnchantWindow->ADD("Accessory List",RowInventoryScrollableWindowComponent)(geom2d::rect{{0.f,28.f},{artificerEnchantWindow->size.x/2-4.f,artificerEnchantWindow->size.y-44}},"","",[](MenuFuncData data){ + OnClick: + RowItemDisplay&item{*DYNAMIC_POINTER_CAST(data.component)}; + DYNAMIC_POINTER_CAST(data.parentComponent.lock())->SelectChild(DYNAMIC_POINTER_CAST(data.component)); + return true; + },[EnableRefineDisplay](MenuFuncData data){OnHover: + RowItemDisplay&item{*DYNAMIC_POINTER_CAST(data.component)}; + Component(data.menu.type,"Item Icon")->SetItem(item.GetItem()); + EnableRefineDisplay(); + return true; + },[ResetRefineDisplay,EnableRefineDisplay](MenuFuncData data){OnMouseOut: + ResetRefineDisplay(); + auto childComponent{DYNAMIC_POINTER_CAST(data.parentComponent.lock())->GetSelectedChild()}; + if(childComponent){ + RowItemDisplay&item{childComponent.value().get()}; + Component(data.menu.type,"Item Icon")->SetItem(item.GetItem()); + EnableRefineDisplay(); + } + return true; + }, + InventoryCreator::RowPlayer_InventoryUpdate, + InventoryWindowOptions{.padding=1,.size={artificerEnchantWindow->size.x/2-5.f-12.f,28}})END}; + + auto enchantListHeaderLabel{artificerEnchantWindow->ADD("Enchant List Header",MenuLabel)(geom2d::rect{{artificerEnchantWindow->size.x/2+4.f,92.f},{artificerEnchantWindow->size.x/2+12.f,12.f}},"Possible Enchantments:",1.f,ComponentAttr::FIT_TO_LABEL|ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE|ComponentAttr::SHADOW)END}; + + auto enchantContainer{artificerEnchantWindow->ADD("Enchant Container",ScrollableWindowComponent)(geom2d::rect{{artificerEnchantWindow->size.x/2+4.f,104.f},{artificerEnchantWindow->size.x/2+12.f,44.f}})END}; + auto enchantCostLabel{artificerEnchantWindow->ADD("Enchant Cost Label",MenuLabel)(geom2d::rect{{artificerEnchantWindow->size.x/2+4.f,152.f},{64.f,20.f}},"Enchant Cost:",1.f,ComponentAttr::SHADOW|ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE)END}; + + auto fragmentCostIcon{artificerEnchantWindow->ADD("Fragment Cost Icon",MenuDecal)(geom2d::rect{{artificerEnchantWindow->size.x/2+68.f,152.f},{12.f,12.f}})END}; + auto fragmentDisplayLabel{artificerEnchantWindow->ADD("Fragment Label",MenuLabel)(geom2d::rect{{artificerEnchantWindow->size.x/2+80.f,152.f},{artificerEnchantWindow->size.x/2-60.f,12.f}},"",1.f,ComponentAttr::SHADOW|ComponentAttr::FIT_TO_LABEL|ComponentAttr::LEFT_ALIGN)END}; + auto fragmentMoneyCostLabel{artificerEnchantWindow->ADD("Fragment Money Cost Label",MenuLabel)(geom2d::rect{{artificerEnchantWindow->size.x/2+80.f,164.f},{artificerEnchantWindow->size.x/2-60.f,12.f}},"",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END}; + + auto fragmentEnchantButton{artificerEnchantWindow->ADD("Fragment Enchant Button",MenuComponent)(geom2d::rect{{artificerEnchantWindow->size.x/2+96.f,180.f},{artificerEnchantWindow->size.x/2-80.f,12.f}},"Enchant",[EnableRefineDisplay](MenuFuncData data){ + onClick: + EnableRefineDisplay(); //Refresh the current display contents. + Menu::OpenMenu(ARTIFICER_ENCHANT_CONFIRM,true); + return true; + })END}; + + #pragma region Money Display + vf2d moneyIconPos{artificerEnchantWindow->size.x/2-28.f,artificerEnchantWindow->size.y-12.f}; + auto moneyIcon=artificerEnchantWindow->ADD("Money Icon",MenuIconButton)(geom2d::rect{moneyIconPos,{24,24}},GFX["money.png"].Decal(),DO_NOTHING,IconButtonAttr::NOT_SELECTABLE|IconButtonAttr::NO_OUTLINE|IconButtonAttr::NO_BACKGROUND)END; + std::string moneyText=std::to_string(game->GetPlayer()->GetMoney()); + vf2d moneyTextSize=game->GetTextSizeProp(moneyText)*2; + auto moneyDisplay=artificerEnchantWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos+vf2d{26.f,4.f},moneyTextSize},2,1.85f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; + Player::AddMoneyListener(moneyDisplay); + #pragma endregion + + auto backButton{artificerEnchantWindow->ADD("Back",MenuComponent)(geom2d::rect{{0.f,artificerEnchantWindow->size.y-12.f},{96.f,16.f}},"Back",[](MenuFuncData data){ + Menu::CloseMenu(); + return true; + })END}; + + Menu::AddInventoryListener(inventoryDisplay,"Accessories"); + artificerEnchantWindow->SetupKeyboardNavigation( [](MenuType type,Data&returnData){ //On Open returnData=""; diff --git a/Adventures in Lestoria/ArtificerRefineWindow.cpp b/Adventures in Lestoria/ArtificerRefineWindow.cpp index e1918d9c..67841f5f 100644 --- a/Adventures in Lestoria/ArtificerRefineWindow.cpp +++ b/Adventures in Lestoria/ArtificerRefineWindow.cpp @@ -51,7 +51,7 @@ INCLUDE_game void Menu::InitializeArtificerRefineWindow(){ Menu*const artificerRefineWindow{CreateMenu(ARTIFICER_REFINE,CENTERED,game->GetScreenSize()-vi2d{52,52})}; - auto disassemblyTitleLabel{artificerRefineWindow->ADD("Refining Title Label",MenuLabel)(geom2d::rect{{0.f,-16.f},{artificerRefineWindow->size.x,24.f}},"Accessory Refinement",2.f,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END}; + auto refiningTitleLabel{artificerRefineWindow->ADD("Refining Title Label",MenuLabel)(geom2d::rect{{0.f,-16.f},{artificerRefineWindow->size.x,24.f}},"Accessory Refinement",2.f,ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::BACKGROUND)END}; auto inventoryLabel{artificerRefineWindow->ADD("Accessory List Label",MenuLabel)(geom2d::rect{{0.f,12.f},{180.f,12.f}},"Choose Accessory:",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END}; @@ -59,7 +59,7 @@ void Menu::InitializeArtificerRefineWindow(){ itemIcon->SetIconScale({2.f,2.f}); itemIcon->SetCompactDescriptions(true); - auto accessoryDescription{artificerRefineWindow->ADD("Item Description",MenuLabel)(geom2d::rect{{artificerRefineWindow->size.x/2+56.f,28.f},{artificerRefineWindow->size.x/2-56.f,72.f}},"",0.5f,ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE|ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END}; + auto accessoryDescription{artificerRefineWindow->ADD("Item Description",MenuLabel)(geom2d::rect{{artificerRefineWindow->size.x/2+56.f,28.f},{artificerRefineWindow->size.x/2-40.f,72.f}},"",0.5f,ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE|ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END}; const auto ResetRefineDisplay{[artificerRefineWindow](){ MenuType menuType{artificerRefineWindow->GetType()}; @@ -114,7 +114,7 @@ void Menu::InitializeArtificerRefineWindow(){ InventoryCreator::RowPlayer_InventoryUpdate, InventoryWindowOptions{.padding=1,.size={artificerRefineWindow->size.x/2-5.f-12.f,28}})END}; - auto statsBlock{artificerRefineWindow->ADD("Stats Block",MenuRefineLabel)(geom2d::rect{{artificerRefineWindow->size.x/2+4.f,104.f},{artificerRefineWindow->size.x/2-4.f,44.f}},Item::BLANK,1.f,ComponentAttr::BACKGROUND|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::FIXED_WIDTH_FONT|ComponentAttr::FIT_TO_LABEL|ComponentAttr::LEFT_ALIGN)END}; + auto statsBlock{artificerRefineWindow->ADD("Stats Block",MenuRefineLabel)(geom2d::rect{{artificerRefineWindow->size.x/2+4.f,104.f},{artificerRefineWindow->size.x/2+12.f,44.f}},Item::BLANK,1.f,ComponentAttr::BACKGROUND|ComponentAttr::SHADOW|ComponentAttr::OUTLINE|ComponentAttr::FIXED_WIDTH_FONT|ComponentAttr::FIT_TO_LABEL|ComponentAttr::LEFT_ALIGN)END}; auto refineCostLabel{artificerRefineWindow->ADD("Refine Cost Label",MenuLabel)(geom2d::rect{{artificerRefineWindow->size.x/2+4.f,152.f},{64.f,20.f}},"Refine Cost:",1.f,ComponentAttr::SHADOW|ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE)END}; @@ -122,7 +122,7 @@ void Menu::InitializeArtificerRefineWindow(){ auto fragmentDisplayLabel{artificerRefineWindow->ADD("Fragment Label",MenuLabel)(geom2d::rect{{artificerRefineWindow->size.x/2+80.f,152.f},{artificerRefineWindow->size.x/2-60.f,12.f}},"",1.f,ComponentAttr::SHADOW|ComponentAttr::FIT_TO_LABEL|ComponentAttr::LEFT_ALIGN)END}; auto fragmentMoneyCostLabel{artificerRefineWindow->ADD("Fragment Money Cost Label",MenuLabel)(geom2d::rect{{artificerRefineWindow->size.x/2+80.f,164.f},{artificerRefineWindow->size.x/2-60.f,12.f}},"",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END}; - auto fragmentRefineButton{artificerRefineWindow->ADD("Fragment Refine Button",MenuComponent)(geom2d::rect{{artificerRefineWindow->size.x/2+96.f,180.f},{artificerRefineWindow->size.x/2-76.f,12.f}},"Refine",[EnableRefineDisplay](MenuFuncData data){ + auto fragmentRefineButton{artificerRefineWindow->ADD("Fragment Refine Button",MenuComponent)(geom2d::rect{{artificerRefineWindow->size.x/2+96.f,180.f},{artificerRefineWindow->size.x/2-80.f,12.f}},"Refine",[EnableRefineDisplay](MenuFuncData data){ onClick: SoundEffect::PlaySFX("Sprint",SoundEffect::CENTERED); std::weak_ptritem{Component(data.menu.type,"Item Icon")->GetItem()}; diff --git a/Adventures in Lestoria/Item.cpp b/Adventures in Lestoria/Item.cpp index 875c28ab..cf8ba473 100644 --- a/Adventures in Lestoria/Item.cpp +++ b/Adventures in Lestoria/Item.cpp @@ -1521,4 +1521,8 @@ const Pixel Stats::GetShimmeringColor(){ const std::optional&Item::FragmentIcon()const{ return ITEM_DATA.at(FragmentName()).FragmentIcon(); +} + +void Item::ApplyRandomEnchant(){ + } \ No newline at end of file diff --git a/Adventures in Lestoria/Item.h b/Adventures in Lestoria/Item.h index 964bf2b8..e94149d4 100644 --- a/Adventures in Lestoria/Item.h +++ b/Adventures in Lestoria/Item.h @@ -256,6 +256,7 @@ public: void Lock(); void Unlock(); void EnchantItem(const std::string_view enchantName); + void ApplyRandomEnchant(); std::optionalGetEnchant()const; const bool HasEnchant()const; friend const bool operator==(std::shared_ptrlhs,std::shared_ptrrhs){return lhs->it==rhs->it&&lhs->randomizedStats==rhs->randomizedStats;}; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index b949c1ba..9b88d61e 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 5 -#define VERSION_BUILD 11483 +#define VERSION_BUILD 11493 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Campaigns/World_Map.tmx b/Adventures in Lestoria/assets/Campaigns/World_Map.tmx index 32cabc01..5549eedd 100644 --- a/Adventures in Lestoria/assets/Campaigns/World_Map.tmx +++ b/Adventures in Lestoria/assets/Campaigns/World_Map.tmx @@ -835,13 +835,14 @@ - + + @@ -849,6 +850,8 @@ + + @@ -856,6 +859,8 @@ + + @@ -863,6 +868,8 @@ + + @@ -870,6 +877,9 @@ + + + @@ -877,6 +887,8 @@ + + @@ -884,6 +896,7 @@ + @@ -891,6 +904,8 @@ + + @@ -898,27 +913,31 @@ - + + + - + - + + + diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 43bd0e08..a23d1d61 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ