diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index bd07c576..501a69ee 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -1720,6 +1720,8 @@ void AiL::RenderHud(){ if(runTimeAmt<"Player.Health Warning Flicker Time"_F){ healthOutlineCol="Player.Health Warning Outline Color"_Pixel; } + + Input::SetLightbar(healthOutlineCol); } DrawDecal({2,2},GFX["heart_outline.png"].Decal(),{1.f,1.f},healthOutlineCol); diff --git a/Adventures in Lestoria/Key.cpp b/Adventures in Lestoria/Key.cpp index c305eaf3..42d663ef 100644 --- a/Adventures in Lestoria/Key.cpp +++ b/Adventures in Lestoria/Key.cpp @@ -1219,4 +1219,12 @@ const int Input::GetKeyCode()const{ const bool InputEngageGroup::GetLabelVisible()const{ return labelVisible; +} + +void Input::SetLightbar(const Pixel col){ + if(SteamInput()){ + for(int i=0;iSetLEDColor(steamControllers[i],col.r,col.g,col.b,0); + } + } } \ No newline at end of file diff --git a/Adventures in Lestoria/Key.h b/Adventures in Lestoria/Key.h index 8b879c2b..ff8c3fda 100644 --- a/Adventures in Lestoria/Key.h +++ b/Adventures in Lestoria/Key.h @@ -140,6 +140,7 @@ public: const int GetKeyCode()const; friend const bool operator==(const Input&input1,const Input&input2); std::string GetProperIconName(std::string currentIconName)const; + static void SetLightbar(const Pixel col); static uint64_t ingameControlsHandle; }; diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index ed8c2beb..0c0f1001 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -748,6 +748,7 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){ hurtRumbleTime="Player.Hurt Rumble Time"_F; Input::StartVibration(); + Input::SetLightbar(PixelLerp(GREEN,DARK_RED,GetHealth()/GetMaxHealth())); if(lastHitTimer>0){ damageNumberPtr.get()->damage+=int(mod_dmg); @@ -1016,6 +1017,7 @@ bool Player::Heal(int damage,bool suppressDamageNumber){ if(!suppressDamageNumber&&damage>0){ DAMAGENUMBER_LIST.push_back(std::make_shared(GetPos(),damage,true,HEALTH_GAIN)); } + Input::SetLightbar(PixelLerp(GREEN,DARK_RED,GetHealth()/GetMaxHealth())); return true; } diff --git a/Adventures in Lestoria/State_Death.cpp b/Adventures in Lestoria/State_Death.cpp index 452218bc..0d7dfbf7 100644 --- a/Adventures in Lestoria/State_Death.cpp +++ b/Adventures in Lestoria/State_Death.cpp @@ -83,6 +83,7 @@ void State_Death::OnUserUpdate(AiL*game){ Menu::OpenMenu(MenuType::DEATH); } game->SetMosaicEffect(uint8_t(util::lerp(9.f,1.f,(gameSlowdownPct-7)/3.f))); + Input::SetLightbar(PixelLerp(BLACK,DARK_RED,sin((1.5*game->GetRuntime())/2.f)+0.5f)); } if(gameSlowdownPct<10.f){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 52657640..95b076b1 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 0 #define VERSION_PATCH 0 -#define VERSION_BUILD 8398 +#define VERSION_BUILD 8399 #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 9d5e0513..a3d2d782 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ