diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index bff31996..394d9b02 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -373,6 +373,8 @@ bool AiL::OnUserUpdate(float fElapsedTime){ lastMousePos=GetMousePos(); }else lastMouseMovement+=fElapsedTime; + vignetteDisplayTime=std::max(0.f,vignetteDisplayTime-fElapsedTime); + if(Audio::Engine().IsPlaying(GetPlayer()->cooldownSoundInstance)){ Audio::Engine().SetVolume(GetPlayer()->cooldownSoundInstance,Audio::GetCalculatedSFXVolume("Audio.Casting Sound Volume"_F/100.f)); } @@ -1850,6 +1852,11 @@ void AiL::RenderHud(){ DrawShadowStringDecal({0,12},"Button Hold Time: "+std::to_string(Menu::menus[INVENTORY_CONSUMABLES]->buttonHoldTime)); } #endif + + Pixel vignetteOverlayColor="Interface.Vignette Color"_Pixel; + const float vignetteTotalDisplayTime="Interface.Vignette Appearance Time"_F+"Interface.Vignette Fadeout Time"_F; + if(vignetteDisplayTime<"Interface.Vignette Fadeout Time"_F)vignetteOverlayColor.a=util::lerp(0,255,vignetteDisplayTime/"Interface.Vignette Fadeout Time"_F); + DrawDecal({0,0},GFX["vignette.png"].Decal(),{1.f,1.f},vignetteOverlayColor); } void AiL::RenderCooldowns(){ @@ -3936,4 +3943,8 @@ void AiL::ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHan const float AiL::GetEncounterDuration()const{ return encounterDuration; +} + +void AiL::ShowDamageVignetteOverlay(){ + vignetteDisplayTime="Interface.Vignette Appearance Time"_F+"Interface.Vignette Fadeout Time"_F; } \ No newline at end of file diff --git a/Adventures in Lestoria/AdventuresInLestoria.h b/Adventures in Lestoria/AdventuresInLestoria.h index e1ed7e99..4602cc14 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.h +++ b/Adventures in Lestoria/AdventuresInLestoria.h @@ -182,6 +182,7 @@ private: float saveGameDisplayTime=0.f; float loadingWaitTime=0.f; bool displayHud=true; + float vignetteDisplayTime=0.f; void ValidateGameStatus(); void _PrepareLevel(MapName map,MusicChange changeMusic); @@ -319,6 +320,7 @@ public: void UpdateMonsters(); void ActivateActionSetForAllControllers(InputActionSetHandle_t actionSetHandle); const float GetEncounterDuration()const; + void ShowDamageVignetteOverlay(); struct TileGroupData{ vi2d tilePos; diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index 3e6cb36f..672cda79 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -745,6 +745,9 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){ SoundEffect::PlaySFX("Player Hit",SoundEffect::CENTERED); } if(Menu::IsMenuOpen()&&mod_dmg>0)Menu::CloseAllMenus(); + + if(mod_dmg>0)game->ShowDamageVignetteOverlay(); + hp=std::max(0,hp-int(mod_dmg)); if(hp==0&&GameState::STATE!=GameState::states[States::DEATH])GameState::ChangeState(States::DEATH); diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 1abe6596..910b295c 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 8610 +#define VERSION_BUILD 8614 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Interface.txt b/Adventures in Lestoria/assets/config/Interface.txt index 67f41ab3..26e8f201 100644 --- a/Adventures in Lestoria/assets/config/Interface.txt +++ b/Adventures in Lestoria/assets/config/Interface.txt @@ -21,6 +21,15 @@ Interface # The text color of input keys. InputButtonTextCol = 175,199,191,255 + # Vignette Appearance Wait Duration + Vignette Appearance Time = 0.4s + + # Vignette Fade out Duration + Vignette Fadeout Time = 0.2s + + # Damage Vignette Overlay Color + Vignette Color = 218, 44, 143, 255 + # The original health display color. HUD Health Display Color = 255,255,255,255 diff --git a/Adventures in Lestoria/assets/config/gfx/gfx.txt b/Adventures in Lestoria/assets/config/gfx/gfx.txt index 071359e6..68ed9369 100644 --- a/Adventures in Lestoria/assets/config/gfx/gfx.txt +++ b/Adventures in Lestoria/assets/config/gfx/gfx.txt @@ -84,6 +84,7 @@ Images GFX_Unlock = unlock.png GFX_SwordSlash = swordslash.png GFX_CustomFont = font.png + GFX_Vignette = vignette.png # Ability Icons GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index 32c4edd2..e04b05db 100644 Binary files a/Adventures in Lestoria/assets/gamepack.pak and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/Adventures in Lestoria/assets/vignette.png b/Adventures in Lestoria/assets/vignette.png new file mode 100644 index 00000000..67ad6bc7 Binary files /dev/null and b/Adventures in Lestoria/assets/vignette.png differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 4bcbc116..a0a30f73 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ