diff --git a/Adventures in Lestoria/BlacksmithCraftingWindow.cpp b/Adventures in Lestoria/BlacksmithCraftingWindow.cpp index aa653d04..d941c9db 100644 --- a/Adventures in Lestoria/BlacksmithCraftingWindow.cpp +++ b/Adventures in Lestoria/BlacksmithCraftingWindow.cpp @@ -78,9 +78,9 @@ void Menu::InitializeBlacksmithCraftingWindow(){ Component(BLACKSMITH,"Weapon Inventory Display")->Enable(); Component(BLACKSMITH,"Armor Inventory Display")->Disable(); data.component.lock()->selected=true; - std::vector>*itemList=&Component(data.menu.GetType(),"Weapon Inventory Display")->GetComponents(); - if(itemList->size()>0){ - data.menu.SetSelection((*itemList)[0]); + std::vector>itemList=Component(data.menu.GetType(),"Weapon Inventory Display")->GetComponents(); + if(itemList.size()>0){ + data.menu.SetSelection(itemList[0]); }else{ data.menu.SetSelection(std::weak_ptr(Component(data.menu.GetType(),"Leave Button"))); } @@ -96,9 +96,9 @@ void Menu::InitializeBlacksmithCraftingWindow(){ Component(BLACKSMITH,"Weapon Inventory Display")->Disable(); Component(BLACKSMITH,"Armor Inventory Display")->Enable(); data.component.lock()->selected=true; - std::vector>*itemList=&Component(data.menu.GetType(),"Armor Inventory Display")->GetComponents(); - if(itemList->size()>0){ - data.menu.SetSelection((*itemList)[0]); + std::vector>itemList=Component(data.menu.GetType(),"Armor Inventory Display")->GetComponents(); + if(itemList.size()>0){ + data.menu.SetSelection(itemList[0]); }else{ data.menu.SetSelection(std::weak_ptr(Component(data.menu.GetType(),"Leave Button"))); } diff --git a/Adventures in Lestoria/CharacterMenuWindow.cpp b/Adventures in Lestoria/CharacterMenuWindow.cpp index 7c04b04e..0402e272 100644 --- a/Adventures in Lestoria/CharacterMenuWindow.cpp +++ b/Adventures in Lestoria/CharacterMenuWindow.cpp @@ -327,7 +327,8 @@ void Menu::InitializeCharacterMenuWindow(){ {{game->KEY_MOUSE_RIGHT,Pressed},{[](MenuFuncData data){ if(!data.menu.GetSelection().expired()&& data.menu.GetSelection().lock()->GetName().starts_with("Equip Slot ")){ - if(!ISBLANK(Inventory::GetEquip(EquipSlot(data.menu.GetSelection().lock()->I(Attribute::EQUIP_TYPE))))){ + EquipSlot slot=EquipSlot(data.menu.GetSelection().lock()->I(Attribute::EQUIP_TYPE)); + if(!ISBLANK(Inventory::GetEquip(slot))){ return "Unequip"; } } @@ -335,16 +336,22 @@ void Menu::InitializeCharacterMenuWindow(){ },[](MenuType type){ if(!Menu::menus[type]->GetSelection().expired()&& Menu::menus[type]->GetSelection().lock()->GetName().starts_with("Equip Slot ")){ - if(!ISBLANK(Inventory::GetEquip(EquipSlot(Menu::menus[type]->GetSelection().lock()->I(Attribute::EQUIP_TYPE))))){ - Inventory::UnequipItem(EquipSlot(Menu::menus[type]->GetSelection().lock()->I(Attribute::EQUIP_TYPE))); - SoundEffect::PlaySFX("Unequip Armor",SoundEffect::CENTERED); + EquipSlot slot=EquipSlot(Menu::menus[type]->GetSelection().lock()->I(Attribute::EQUIP_TYPE)); + if(!ISBLANK(Inventory::GetEquip(slot))){ + Inventory::UnequipItem(slot); + if(slot&EquipSlot::RING1||slot&EquipSlot::RING2){ + SoundEffect::PlaySFX("Unequip Accessory",SoundEffect::CENTERED); + }else{ + SoundEffect::PlaySFX("Unequip Armor",SoundEffect::CENTERED); + } } } }}}, {{game->KEY_FACELEFT,Pressed},{[](MenuFuncData data){ if(!data.menu.GetSelection().expired()&& data.menu.GetSelection().lock()->GetName().starts_with("Equip Slot ")){ - if(!ISBLANK(Inventory::GetEquip(EquipSlot(data.menu.GetSelection().lock()->I(Attribute::EQUIP_TYPE))))){ + EquipSlot slot=EquipSlot(data.menu.GetSelection().lock()->I(Attribute::EQUIP_TYPE)); + if(!ISBLANK(Inventory::GetEquip(slot))){ return "Unequip"; } } @@ -352,9 +359,14 @@ void Menu::InitializeCharacterMenuWindow(){ },[](MenuType type){ if(!Menu::menus[type]->GetSelection().expired()&& Menu::menus[type]->GetSelection().lock()->GetName().starts_with("Equip Slot ")){ - if(!ISBLANK(Inventory::GetEquip(EquipSlot(Menu::menus[type]->GetSelection().lock()->I(Attribute::EQUIP_TYPE))))){ - Inventory::UnequipItem(EquipSlot(Menu::menus[type]->GetSelection().lock()->I(Attribute::EQUIP_TYPE))); - SoundEffect::PlaySFX("Unequip Armor",SoundEffect::CENTERED); + EquipSlot slot=EquipSlot(Menu::menus[type]->GetSelection().lock()->I(Attribute::EQUIP_TYPE)); + if(!ISBLANK(Inventory::GetEquip(slot))){ + Inventory::UnequipItem(slot); + if(slot&EquipSlot::RING1||slot&EquipSlot::RING2){ + SoundEffect::PlaySFX("Unequip Accessory",SoundEffect::CENTERED); + }else{ + SoundEffect::PlaySFX("Unequip Armor",SoundEffect::CENTERED); + } } } }}}, diff --git a/Adventures in Lestoria/Key.cpp b/Adventures in Lestoria/Key.cpp index b0cb4532..9d0e79ee 100644 --- a/Adventures in Lestoria/Key.cpp +++ b/Adventures in Lestoria/Key.cpp @@ -316,6 +316,11 @@ void InputGroup::DrawInput(const std::variantwidth+"Interface.InputHelperSpacing"_F; + buttonImgSize.y=std::max(buttonImgSize.y,float(input.GetIcon(GameSettings::GetIconType()).Sprite()->height)); + buttonImgs.push_back(input.GetIcon(GameSettings::GetIconType()).Decal()); + }else if(input.HasIcon()){ buttonImgSize.x+=input.GetIcon().Sprite()->width+"Interface.InputHelperSpacing"_F; buttonImgSize.y=std::max(buttonImgSize.y,float(input.GetIcon().Sprite()->height)); @@ -330,8 +335,12 @@ void InputGroup::DrawInput(const std::variantwidth+"Interface.InputHelperSpacing"_F; + buttonImgSize.y=std::max(buttonImgSize.y,float(primaryKey.value().GetIcon(GameSettings::GetIconType()).Sprite()->height)); + buttonImgs.push_back(primaryKey.value().GetIcon(GameSettings::GetIconType()).Decal()); + }else if(primaryKey.value().HasIcon()){ - buttonImgSize.x+=primaryKey.value().GetIcon().Sprite()->width+"Interface.InputHelperSpacing"_F; buttonImgSize.y=std::max(buttonImgSize.y,float(primaryKey.value().GetIcon().Sprite()->height)); buttonImgs.push_back(primaryKey.value().GetIcon().Decal()); diff --git a/Adventures in Lestoria/Menu.cpp b/Adventures in Lestoria/Menu.cpp index c87342d1..048213f2 100644 --- a/Adventures in Lestoria/Menu.cpp +++ b/Adventures in Lestoria/Menu.cpp @@ -715,6 +715,7 @@ const std::weak_ptrMenu::GetKeySelection()const{ } void Menu::SetSelection(std::weak_ptrbutton,const bool scroll,const bool reset){ + if(button.expired())return; selection=button; if(navigationGroups.count(button.lock()->GetName())|| !button.lock()->parentComponent.expired()&&navigationGroups.count(button.lock()->parentComponent.lock()->GetName())){ diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 7b363461..c70db3d4 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -151,8 +151,17 @@ bool Monster::_SetX(float x,const bool monsterInvoked){ return true; } else { geom2d::rectcollision={collisionRect.pos,collisionRect.size}; + bool insideArenaBounds=true; + #pragma region Calculate Arena Bounds check for Bosses + if(isBoss){ + const geom2d::rectarenaBounds=game->GetZones().at("BossArena")[0].zone; + if(!geom2d::contains(arenaBounds,newPos)){ + insideArenaBounds=false; + } + } + #pragma endregion #pragma region lambdas - auto NoEnemyCollisionWithTile=[&](){return isBoss||!geom2d::overlaps(newPos,collision);}; + auto NoEnemyCollisionWithTile=[&](){return (isBoss&&insideArenaBounds)||!geom2d::overlaps(newPos,collision);}; #pragma endregion collision.pos+=tilePos; if(NoEnemyCollisionWithTile()){ @@ -181,8 +190,17 @@ bool Monster::_SetY(float y,const bool monsterInvoked){ return true; } else { geom2d::rectcollision={collisionRect.pos,collisionRect.size}; + bool insideArenaBounds=true; + #pragma region Calculate Arena Bounds check for Bosses + if(isBoss){ + const geom2d::rectarenaBounds=game->GetZones().at("BossArena")[0].zone; + if(!geom2d::contains(arenaBounds,newPos)){ + insideArenaBounds=false; + } + } + #pragma endregion #pragma region lambdas - auto NoEnemyCollisionWithTile=[&](){return isBoss||!geom2d::overlaps(newPos,collision);}; + auto NoEnemyCollisionWithTile=[&](){return (isBoss&&insideArenaBounds)||!geom2d::overlaps(newPos,collision);}; #pragma endregion collision.pos+=tilePos; if(NoEnemyCollisionWithTile()){ diff --git a/Adventures in Lestoria/OverworldMapLevelWindow.cpp b/Adventures in Lestoria/OverworldMapLevelWindow.cpp index 6afba7ab..03c633b0 100644 --- a/Adventures in Lestoria/OverworldMapLevelWindow.cpp +++ b/Adventures in Lestoria/OverworldMapLevelWindow.cpp @@ -74,7 +74,9 @@ void Menu::InitializeOverworldMapLevelWindow(){ Menu::OpenMenu(OVERWORLD_MENU); }}}, {{game->KEY_CONFIRM},{"Start Stage",[](MenuType type){ - Component(type,"Enter Button")->Click(); + if(!Menu::UsingMouseNavigation()){ + Component(type,"Enter Button")->Click(); + } }}}, {{game->KEY_CHANGE_LOADOUT},{"Change Loadout",[](MenuType type){ Component(type,"Change Loadout Button")->Click(); diff --git a/Adventures in Lestoria/SettingsWindow.cpp b/Adventures in Lestoria/SettingsWindow.cpp index 83b9caaf..f5b8d605 100644 --- a/Adventures in Lestoria/SettingsWindow.cpp +++ b/Adventures in Lestoria/SettingsWindow.cpp @@ -157,6 +157,9 @@ void Menu::InitializeSettingsWindow(){ ERR(std::format("WARNING! Unhandled icon type {}!",int(GameSettings::GetIconType()))); } } + if(Menu::IsCurrentlyActive(data.menu.GetType())){ + SoundEffect::PlaySFX("Button Click",SoundEffect::CENTERED); + } return true; })END; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 822ea06a..07ffd224 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 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 7465 +#define VERSION_BUILD 7474 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/audio/events.txt b/Adventures in Lestoria/assets/config/audio/events.txt index 708de2d5..fdd02333 100644 --- a/Adventures in Lestoria/assets/config/audio/events.txt +++ b/Adventures in Lestoria/assets/config/audio/events.txt @@ -196,6 +196,11 @@ Events # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) File[0] = equip2.ogg, 60% } + Unequip Accessory + { + # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) + File[0] = equip_ring.ogg, 60%, 70%, 70% + } Ursule Dead { # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index e558b914..2256f6cf 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ