diff --git a/Adventures in Lestoria/BlacksmithCraftingWindow.cpp b/Adventures in Lestoria/BlacksmithCraftingWindow.cpp index c6562091..12da411f 100644 --- a/Adventures in Lestoria/BlacksmithCraftingWindow.cpp +++ b/Adventures in Lestoria/BlacksmithCraftingWindow.cpp @@ -212,7 +212,7 @@ void Menu::InitializeBlacksmithCraftingWindow(){ auto moneyIcon=blacksmithWindow->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=blacksmithWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; + auto moneyDisplay=blacksmithWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,1.85f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; moneyDisplay->SetRightAlignment(true); Player::AddMoneyListener(moneyDisplay); #pragma endregion diff --git a/Adventures in Lestoria/ConsumableCraftingWindow.cpp b/Adventures in Lestoria/ConsumableCraftingWindow.cpp index d04872c8..6a2c1f78 100644 --- a/Adventures in Lestoria/ConsumableCraftingWindow.cpp +++ b/Adventures in Lestoria/ConsumableCraftingWindow.cpp @@ -133,7 +133,7 @@ void Menu::InitializeConsumableCraftingWindow(){ auto moneyIcon=consumableCraftingWindow->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=consumableCraftingWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; + auto moneyDisplay=consumableCraftingWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,1.85f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; moneyDisplay->SetRightAlignment(true); Player::AddMoneyListener(moneyDisplay); #pragma endregion diff --git a/Adventures in Lestoria/InventoryWindow.cpp b/Adventures in Lestoria/InventoryWindow.cpp index d07f5d7f..98aa515e 100644 --- a/Adventures in Lestoria/InventoryWindow.cpp +++ b/Adventures in Lestoria/InventoryWindow.cpp @@ -150,7 +150,7 @@ void Menu::InitializeInventoryWindow(){ auto moneyIcon=inventoryWindow->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=inventoryWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,SHADOW|LEFT_ALIGN|FIT_TO_LABEL)END; + auto moneyDisplay=inventoryWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,1.85f,SHADOW|LEFT_ALIGN|FIT_TO_LABEL)END; moneyDisplay->SetRightAlignment(true); Player::AddMoneyListener(moneyDisplay); #pragma endregion diff --git a/Adventures in Lestoria/MenuLabel.h b/Adventures in Lestoria/MenuLabel.h index 9d1a4467..e2a01386 100644 --- a/Adventures in Lestoria/MenuLabel.h +++ b/Adventures in Lestoria/MenuLabel.h @@ -48,6 +48,7 @@ INCLUDE_game class MenuLabel:public MenuComponent{ protected: float scale=1; + float shadowScale=1; bool shadow=false; bool centered=true; bool multiLineCentered=false; @@ -68,7 +69,7 @@ public: this->onLabelChangeFunc=onLabelChangeFunc; } inline MenuLabel(geom2d::rectrect,std::string label,float scale=1,ComponentAttr attributes=ComponentAttr::NONE) - :MenuComponent(rect,label,MenuFunc{},ButtonAttr::UNSELECTABLE|ButtonAttr::UNSELECTABLE_VIA_KEYBOARD),scale(scale),rightAlign(attributes&ComponentAttr::RIGHT_ALIGN),centered(!(attributes&ComponentAttr::LEFT_ALIGN)&&!(attributes&ComponentAttr::RIGHT_ALIGN)),shadow(attributes&ComponentAttr::SHADOW),proportional(!(attributes&ComponentAttr::FIXED_WIDTH_FONT)),multiLineCentered(attributes&ComponentAttr::CENTER){ + :MenuComponent(rect,label,MenuFunc{},ButtonAttr::UNSELECTABLE|ButtonAttr::UNSELECTABLE_VIA_KEYBOARD),scale(scale),shadowScale(scale),rightAlign(attributes&ComponentAttr::RIGHT_ALIGN),centered(!(attributes&ComponentAttr::LEFT_ALIGN)&&!(attributes&ComponentAttr::RIGHT_ALIGN)),shadow(attributes&ComponentAttr::SHADOW),proportional(!(attributes&ComponentAttr::FIXED_WIDTH_FONT)),multiLineCentered(attributes&ComponentAttr::CENTER){ border=attributes&ComponentAttr::OUTLINE; this->background=attributes&ComponentAttr::BACKGROUND; showDefaultLabel=false; @@ -90,6 +91,7 @@ protected: censoredTextEntry=std::accumulate(GetLabel().begin(),GetLabel().end(),""s,[](std::string currentStr,const char&c){return std::move(currentStr)+'*';}); std::string_view finalLabel=censored?censoredTextEntry:GetLabel(); vf2d adjustedScale={scale,scale}; + vf2d adjustedShadowScale={shadowScale,shadowScale}; vf2d labelTextSize= proportional? vf2d(game->GetWrappedTextSizeProp(finalLabel,rect.size.x-4,adjustedScale)): @@ -103,6 +105,7 @@ protected: float sizeRatio=(labelTextSize.x)/(rect.size.x-4); if(sizeRatio>1){ adjustedScale.x/=sizeRatio; + adjustedShadowScale.x/=sizeRatio; labelTextSize.x/=sizeRatio; } } @@ -138,9 +141,9 @@ protected: }else{ if(shadow){ if(proportional){ - window.DrawShadowStringPropDecal(drawPos,finalLabel,WHITE,BLACK,adjustedScale,adjustedScale,fitToLabel?std::numeric_limits::max():rect.size.x-4); + window.DrawShadowStringPropDecal(drawPos,finalLabel,WHITE,BLACK,adjustedScale,adjustedShadowScale,fitToLabel?std::numeric_limits::max():rect.size.x-4); }else{ - window.DrawShadowStringDecal(drawPos,finalLabel,WHITE,BLACK,adjustedScale,adjustedScale,fitToLabel?std::numeric_limits::max():rect.size.x-4); + window.DrawShadowStringDecal(drawPos,finalLabel,WHITE,BLACK,adjustedScale,adjustedShadowScale,fitToLabel?std::numeric_limits::max():rect.size.x-4); } }else{ if(proportional){ diff --git a/Adventures in Lestoria/MerchantWindow.cpp b/Adventures in Lestoria/MerchantWindow.cpp index c303565e..2ef4c5f1 100644 --- a/Adventures in Lestoria/MerchantWindow.cpp +++ b/Adventures in Lestoria/MerchantWindow.cpp @@ -269,7 +269,7 @@ void Menu::InitializeMerchantWindow(){ auto moneyIcon=merchantWindow->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=merchantWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; + auto moneyDisplay=merchantWindow->ADD("Money Label",PlayerMoneyLabel)(geom2d::rect{moneyIconPos-vf2d{2+moneyTextSize.x,-2},moneyTextSize},2,1.85f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN|ComponentAttr::FIT_TO_LABEL)END; moneyDisplay->SetRightAlignment(true); Player::AddMoneyListener(moneyDisplay); #pragma endregion diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 5a359f21..4ce042d9 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -1543,7 +1543,8 @@ void Player::PerformHPRecovery(){ const float Player::GetDamageReductionPct()const{ float modDmgReductionPct=0; - modDmgReductionPct+=GetEquipStat("Damage Reduction")/100; + modDmgReductionPct+=GetEquipStat("Damage Reduction")/100.f; + if(HasEnchant("Last Reserve"))modDmgReductionPct+="Last Reserve"_ENC["DAMAGE REDUCTION PCT"]/100.f; return modDmgReductionPct; } diff --git a/Adventures in Lestoria/PlayerMoneyLabel.h b/Adventures in Lestoria/PlayerMoneyLabel.h index 4148790c..61b4ab6c 100644 --- a/Adventures in Lestoria/PlayerMoneyLabel.h +++ b/Adventures in Lestoria/PlayerMoneyLabel.h @@ -45,8 +45,12 @@ class PlayerMoneyLabel:public MenuLabel{ bool rightAligned=false; float anchorPointX=0; public: - inline PlayerMoneyLabel(geom2d::rectrect,float scale=1,ComponentAttr attributes=ComponentAttr::NONE) - :MenuLabel(rect,std::to_string(game->GetPlayer()->GetMoney()),scale,attributes){} + inline PlayerMoneyLabel(geom2d::rectrect,float scale,ComponentAttr attributes=ComponentAttr::NONE) + :PlayerMoneyLabel(rect,scale,scale,attributes){} + inline PlayerMoneyLabel(geom2d::rectrect,float scale,const float shadowScale,ComponentAttr attributes=ComponentAttr::NONE) + :MenuLabel(rect,std::to_string(game->GetPlayer()->GetMoney()),scale,attributes){ + this->shadowScale=shadowScale; + } inline virtual void OnPlayerMoneyUpdate(uint32_t newMoney)final{ SetLabel(std::to_string(newMoney)); diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 16a19bd8..5b3cd184 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 3 -#define VERSION_BUILD 10791 +#define VERSION_BUILD 10793 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 1c328cfa..72801fad 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ