Shift elements in refinement and enchanting windows around slightly. Add in framework for Accessory Enchanting window. Add in missing connection points for the boss stages of Chapter 3. Release Build 11493.

pull/65/head
sigonasr2 3 months ago
parent 564190d2c6
commit 773c011eb9
  1. 6
      Adventures in Lestoria/Adventures in Lestoria.tiled-project
  2. 82
      Adventures in Lestoria/ArtificerEnchantWindow.cpp
  3. 8
      Adventures in Lestoria/ArtificerRefineWindow.cpp
  4. 4
      Adventures in Lestoria/Item.cpp
  5. 1
      Adventures in Lestoria/Item.h
  6. 2
      Adventures in Lestoria/Version.h
  7. 27
      Adventures in Lestoria/assets/Campaigns/World_Map.tmx
  8. BIN
      x64/Release/Adventures in Lestoria.exe

@ -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
},

@ -38,11 +38,91 @@ 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<float>{{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<float>{{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<float>({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<float>{{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<MenuItemItemButton>(menuType,"Item Icon")->SetItem(Item::BLANK);
}};
const auto EnableRefineDisplay{[artificerEnchantWindow](){
MenuType menuType{artificerEnchantWindow->GetType()};
const std::weak_ptr<Item>&selectedItem{Component<MenuItemItemButton>(menuType,"Item Icon")->GetItem()};
}};
auto inventoryDisplay{artificerEnchantWindow->ADD("Accessory List",RowInventoryScrollableWindowComponent)(geom2d::rect<float>{{0.f,28.f},{artificerEnchantWindow->size.x/2-4.f,artificerEnchantWindow->size.y-44}},"","",[](MenuFuncData data){
OnClick:
RowItemDisplay&item{*DYNAMIC_POINTER_CAST<RowItemDisplay>(data.component)};
DYNAMIC_POINTER_CAST<RowInventoryScrollableWindowComponent>(data.parentComponent.lock())->SelectChild(DYNAMIC_POINTER_CAST<RowItemDisplay>(data.component));
return true;
},[EnableRefineDisplay](MenuFuncData data){OnHover:
RowItemDisplay&item{*DYNAMIC_POINTER_CAST<RowItemDisplay>(data.component)};
Component<MenuItemItemButton>(data.menu.type,"Item Icon")->SetItem(item.GetItem());
EnableRefineDisplay();
return true;
},[ResetRefineDisplay,EnableRefineDisplay](MenuFuncData data){OnMouseOut:
ResetRefineDisplay();
auto childComponent{DYNAMIC_POINTER_CAST<RowInventoryScrollableWindowComponent>(data.parentComponent.lock())->GetSelectedChild()};
if(childComponent){
RowItemDisplay&item{childComponent.value().get()};
Component<MenuItemItemButton>(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<float>{{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<float>{{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<float>{{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<float>{{artificerEnchantWindow->size.x/2+68.f,152.f},{12.f,12.f}})END};
auto fragmentDisplayLabel{artificerEnchantWindow->ADD("Fragment Label",MenuLabel)(geom2d::rect<float>{{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<float>{{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<float>{{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<float>{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<float>{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<float>{{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

@ -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<float>{{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<float>{{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<float>{{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<float>{{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<float>{{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<float>{{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<float>{{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<float>{{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<float>{{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<float>{{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<float>{{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<float>{{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_ptr<Item>item{Component<MenuItemItemButton>(data.menu.type,"Item Icon")->GetItem()};

@ -1522,3 +1522,7 @@ const Pixel Stats::GetShimmeringColor(){
const std::optional<std::string>&Item::FragmentIcon()const{
return ITEM_DATA.at(FragmentName()).FragmentIcon();
}
void Item::ApplyRandomEnchant(){
}

@ -256,6 +256,7 @@ public:
void Lock();
void Unlock();
void EnchantItem(const std::string_view enchantName);
void ApplyRandomEnchant();
std::optional<ItemEnchant>GetEnchant()const;
const bool HasEnchant()const;
friend const bool operator==(std::shared_ptr<Item>lhs,std::shared_ptr<Item>rhs){return lhs->it==rhs->it&&lhs->randomizedStats==rhs->randomizedStats;};

@ -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

@ -835,13 +835,14 @@
<properties>
<property name="Connection 3 - South" type="object" value="38"/>
<property name="Connection 4 - West" type="object" value="8"/>
<property name="Map" propertytype="Level" value="NONE"/>
<property name="Map" propertytype="Level" value="STORY_3_1"/>
<property name="Type" propertytype="StageType" value="STORY"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
</properties>
</object>
<object id="38" name="Stage III-I" type="StagePlate" x="709" y="497" width="42" height="14">
<properties>
<property name="Connection 3 - South" type="object" value="39"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_1"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
@ -849,6 +850,8 @@
</object>
<object id="39" name="Stage III-II" type="StagePlate" x="725" y="565" width="42" height="14">
<properties>
<property name="Connection 2 - East" type="object" value="40"/>
<property name="Connection 3 - South" type="object" value="40"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_2"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
@ -856,6 +859,8 @@
</object>
<object id="40" name="Stage III-III" type="StagePlate" x="769" y="597" width="42" height="14">
<properties>
<property name="Connection 1 - North" type="object" value="41"/>
<property name="Connection 2 - East" type="object" value="41"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_3"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
@ -863,6 +868,8 @@
</object>
<object id="41" name="Stage III-IV" type="StagePlate" x="809" y="561" width="42" height="14">
<properties>
<property name="Connection 1 - North" type="object" value="42"/>
<property name="Connection 2 - East" type="object" value="42"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_4"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
@ -870,6 +877,9 @@
</object>
<object id="42" name="Stage III-V" type="StagePlate" x="849" y="509" width="42" height="14">
<properties>
<property name="Connection 1 - North" type="object" value="49"/>
<property name="Connection 2 - East" type="object" value="49"/>
<property name="Connection 3 - South" type="object" value="43"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_5"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
@ -877,6 +887,8 @@
</object>
<object id="43" name="Stage III-VI" type="StagePlate" x="885" y="569" width="42" height="14">
<properties>
<property name="Connection 3 - South" type="object" value="44"/>
<property name="Connection 4 - West" type="object" value="42"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_6"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
@ -884,6 +896,7 @@
</object>
<object id="44" name="Stage III-VII" type="StagePlate" x="873" y="641" width="42" height="14">
<properties>
<property name="Connection 2 - East" type="object" value="45"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_7"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
@ -891,6 +904,8 @@
</object>
<object id="45" name="Stage III-VIII" type="StagePlate" x="937" y="637" width="42" height="14">
<properties>
<property name="Connection 3 - South" type="object" value="46"/>
<property name="Connection 4 - West" type="object" value="44"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_8"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
@ -898,27 +913,31 @@
</object>
<object id="46" name="Boss III" type="StagePlate" x="917" y="653" width="30" height="22">
<properties>
<property name="Map" propertytype="Level" value="NONE"/>
<property name="Connection 3 - South" type="object" value="48"/>
<property name="Connection 4 - West" type="object" value="48"/>
<property name="Map" propertytype="Level" value="BOSS_3"/>
<property name="Type" propertytype="StageType" value="BOSS"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
</properties>
</object>
<object id="47" name="Boss B-III" type="StagePlate" x="949" y="377" width="30" height="22">
<properties>
<property name="Map" propertytype="Level" value="NONE"/>
<property name="Map" propertytype="Level" value="BOSS_3_B"/>
<property name="Type" propertytype="StageType" value="BOSS"/>
<property name="Unlock Condition" propertytype="Level" value="STORY_2_1"/>
</properties>
</object>
<object id="48" name="Story III-II" type="StagePlate" x="909" y="685" width="18" height="22">
<properties>
<property name="Map" propertytype="Level" value="NONE"/>
<property name="Map" propertytype="Level" value="STORY_3_2"/>
<property name="Type" propertytype="StageType" value="STORY"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>
</properties>
</object>
<object id="49" name="Stage B-III" type="StagePlate" x="897" y="441" width="42" height="14">
<properties>
<property name="Connection 1 - North" type="object" value="47"/>
<property name="Connection 2 - East" type="object" value="47"/>
<property name="Map" propertytype="Level" value="CAMPAIGN_3_B1"/>
<property name="Type" propertytype="StageType" value="DUNGEON"/>
<property name="Unlock Condition" propertytype="Level" value="WORLD_MAP"/>

Loading…
Cancel
Save