Add controller lightbar response based on ingame events. Release Build 8399.

pull/57/head
sigonasr2 8 months ago
parent 8a3a101d28
commit cb39f0859b
  1. 2
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 8
      Adventures in Lestoria/Key.cpp
  3. 1
      Adventures in Lestoria/Key.h
  4. 2
      Adventures in Lestoria/Player.cpp
  5. 1
      Adventures in Lestoria/State_Death.cpp
  6. 2
      Adventures in Lestoria/Version.h
  7. BIN
      x64/Release/Adventures in Lestoria.exe

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

@ -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;i<controllerCount;i++){
SteamInput()->SetLEDColor(steamControllers[i],col.r,col.g,col.b,0);
}
}
}

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

@ -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<DamageNumber>(GetPos(),damage,true,HEALTH_GAIN));
}
Input::SetLightbar(PixelLerp(GREEN,DARK_RED,GetHealth()/GetMaxHealth()));
return true;
}

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

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

Loading…
Cancel
Save