diff --git a/Adventures in Lestoria/Key.cpp b/Adventures in Lestoria/Key.cpp index 41cb5649..27beec4c 100644 --- a/Adventures in Lestoria/Key.cpp +++ b/Adventures in Lestoria/Key.cpp @@ -664,6 +664,15 @@ void InputGroup::DrawInput(const std::variantrenderer,const vf2d pos,const std::string_view displayText,const uint8_t alpha,InputType type,vf2d textScale)const{ std::optionalprimaryKey; + + auto OriginalGameIcon=[](std::optionalinput)->bool{ + if(input.has_value()){ + EInputActionOrigin action=Input::steamGameInputToOrigin.at(Steam::SteamInput(input.value().key)).second[0]; + return Input::steamIconToGameIcon.count(action); + } + return true; + }; + switch(type){ case CONTROLLER:{ if(SteamInput()){ @@ -709,8 +718,10 @@ void InputGroup::DrawPrimaryInput(const std::variantwidth*alteredIconScale*textScale.x+"Interface.InputHelperSpacing"_F; buttonImgSize.y=std::max(buttonImgSize.y,float(primaryKey.value().GetIcon().Sprite()->height*alteredIconScale)); @@ -733,7 +744,7 @@ void InputGroup::DrawPrimaryInput(const std::variant(renderer)->DrawDecal(pos+offset-vf2d{0.f,2.f},img,alteredIconScale*textScale,{255,255,255,alpha}); #pragma endregion if(std::holds_alternative(renderer)){ @@ -802,6 +813,34 @@ void InputGroup::DrawPrimaryInput(const std::variantGetGlyphPNGForActionOrigin(action,k_ESteamInputGlyphSize_Small,0)); + if(steamIconToGameIcon.count(action)){ + return GFX.at(GetProperIconName(steamIconToGameIcon[action])); + }else{ + return GFX.at(SteamInput()->GetGlyphPNGForActionOrigin(action,k_ESteamInputGlyphSize_Small,0)); + } } return GFX.at(GenericKey::keyLiteral.at({type,key}).iconName); } diff --git a/Adventures in Lestoria/Key.h b/Adventures in Lestoria/Key.h index eb87a93d..ae668e52 100644 --- a/Adventures in Lestoria/Key.h +++ b/Adventures in Lestoria/Key.h @@ -137,6 +137,7 @@ public: const Renderable&GetIcon(IconType type)const; const int GetKeyCode()const; friend const bool operator==(const Input&input1,const Input&input2); + std::string GetProperIconName(std::string currentIconName)const; static uint64_t ingameControlsHandle; }; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index b7f6c32e..cb78c578 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 8330 +#define VERSION_BUILD 8336 #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 f4402e68..945d2014 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ