Fix lightbar settings, add failsafe retry loading for icons and action button handles when the icons fail to load for reasons. Fix sin wave breathing for lightbar on death screen, misplaced division operation. Release Build 8418.

mac-build
sigonasr2 8 months ago
parent 412a88d294
commit 19ceff257a
  1. 7
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 8
      Adventures in Lestoria/Key.cpp
  3. 4
      Adventures in Lestoria/Player.cpp
  4. 2
      Adventures in Lestoria/State_Death.cpp
  5. 2
      Adventures in Lestoria/TODO.txt
  6. 2
      Adventures in Lestoria/Version.h
  7. 4
      Adventures in Lestoria/olcPGEX_ViewPort.h
  8. 4
      Adventures in Lestoria/olcPixelGameEngine.h
  9. BIN
      x64/Release/Adventures in Lestoria.exe

@ -2084,6 +2084,8 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
Inventory::Clear("Stage Loot");
Inventory::ResetLoadoutItemsUsed();
Input::SetLightbar({255,0,255});
GetPlayer()->hp=GetPlayer()->GetMaxHealth();
GetPlayer()->mana=GetPlayer()->GetMaxMana();
GetPlayer()->SetState(State::NORMAL);
@ -2092,6 +2094,11 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
GetPlayer()->SetIframes(0.f);
GetPlayer()->SetInvisible(false);
GetPlayer()->ResetVelocity();
if(SteamInput()){ //This is kind of a hack to refresh the in-game controls handle and button icons if for some reason it's not setup correctly.
Input::LoadSteamButtonIcons();
Input::ingameControlsHandle=SteamInput()->GetActionSetHandle("InGameControls");
}
ZONE_LIST=game->MAP_DATA[game->GetCurrentLevel()].ZoneData;
return true;

@ -174,14 +174,16 @@ void Input::Initialize(){
void Input::LoadSteamButtonIcons(){
GFX.Unlock();
LOG(std::format("Steam Icons may be required... Loading in {} icons",int(k_EInputActionOrigin_Count)));
for(int i=1;i<k_EInputActionOrigin_Count;i++){
const char*imageName{SteamInput()->GetGlyphPNGForActionOrigin(EInputActionOrigin(i),k_ESteamInputGlyphSize_Small,0U)};
if(imageName!=nullptr){
std::string loadImage{imageName};
if(loadImage.length()>0&&!GFX.count(loadImage)){
if(loadImage.length()>0&&(!GFX.count(loadImage)||GFX.at(loadImage).Decal()==nullptr)){
LOG(std::format("Loading steam image {}",loadImage));
GFX[loadImage].Load(loadImage);
if(!GFX.count(loadImage))GFX[loadImage];
if(GFX.at(loadImage).Load(loadImage)!=rcode::OK){
LOG(std::format("WARNING! Failed to load steam image {}!",loadImage));
}
}
}
}

@ -748,7 +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()));
Input::SetLightbar(PixelLerp(DARK_RED,GREEN,GetHealth()/GetMaxHealth()));
if(lastHitTimer>0){
damageNumberPtr.get()->damage+=int(mod_dmg);
@ -1017,7 +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()));
Input::SetLightbar(PixelLerp(DARK_RED,GREEN,GetHealth()/GetMaxHealth()));
return true;
}

@ -83,7 +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));
Input::SetLightbar(PixelLerp(BLACK,DARK_RED,sin(1.5f*game->GetRuntime())/2.f+0.5f));
}
if(gameSlowdownPct<10.f){

@ -14,10 +14,8 @@ Equip Gear using Start menu tutorial
Steam Controller SDK
Steam Rich Presence
Add in vsync system option
Remove Unlock All Button
Sword attack should linger
Add game file debug logging
============================================

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 0
#define VERSION_PATCH 0
#define VERSION_BUILD 8413
#define VERSION_BUILD 8418
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -636,6 +636,7 @@ void olc::ViewPort::DrawStringDecal(const olc::vf2d& pos, std::string_view sText
}
if(!pge->garbageCollector.count(key)||pge->garbageCollector[key].originalStr!=sText){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
vi2d imageSize=pge->GetWrappedTextSize(sText,width,scale);
if(imageSize.x<1||imageSize.y<1)return;
Decal*newDecal=nullptr;
if(!pge->garbageCollector.count(key)){
newDecal=new Decal(new Sprite(imageSize.x/scale.x,imageSize.y/scale.x));
@ -678,6 +679,7 @@ void olc::ViewPort::DrawStringPropDecal(const olc::vf2d& pos, std::string_view s
}
if(!pge->garbageCollector.count(key)||pge->garbageCollector[key].originalStr!=sText){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
vi2d imageSize=pge->GetWrappedTextSizeProp(sText,width,scale);
if(imageSize.x<1||imageSize.y<1)return;
Decal*newDecal=nullptr;
if(!pge->garbageCollector.count(key)){
newDecal=new Decal(new Sprite(imageSize.x/scale.x,imageSize.y/scale.x));
@ -705,6 +707,7 @@ void olc::ViewPort::DrawShadowStringDecal(const olc::vf2d& pos, std::string_view
}
if(!pge->garbageCollector.count(key)||pge->garbageCollector[key].originalStr!=sText){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
vi2d imageSize=pge->GetWrappedTextSize(sText,width,scale);
if(imageSize.x<1||imageSize.y<1)return;
Decal*newDecal=nullptr;
if(!pge->garbageCollector.count(key)){
newDecal=new Decal(new Sprite(imageSize.x/scale.x,imageSize.x/scale.x));
@ -752,6 +755,7 @@ void olc::ViewPort::DrawShadowStringPropDecal(const olc::vf2d& pos, std::string_
}
if(!pge->garbageCollector.count(key)||pge->garbageCollector[key].originalStr!=sText){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
vi2d imageSize=pge->GetWrappedTextSizeProp(sText,width,scale);
if(imageSize.x<1||imageSize.y<1)return;
Decal*newDecal=nullptr;
if(!pge->garbageCollector.count(key)){
newDecal=new Decal(new Sprite(imageSize.x/scale.x,imageSize.x/scale.x));

@ -3581,6 +3581,7 @@ namespace olc
}
if(!garbageCollector.count(key)||garbageCollector[key].originalStr!=sText){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
vi2d imageSize=GetWrappedTextSize(sText,width,scale);
if(imageSize.x<1||imageSize.y<1)return;
Decal*newDecal=nullptr;
if(!garbageCollector.count(key)){
newDecal=new Decal(new Sprite(imageSize.x/scale.x,imageSize.y/scale.x));
@ -3609,6 +3610,7 @@ namespace olc
}
if(!garbageCollector.count(key)||garbageCollector[key].originalStr!=sText){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
vi2d imageSize=GetWrappedTextSizeProp(sText,width,scale);
if(imageSize.x<1||imageSize.y<1)return;
Decal*newDecal=nullptr;
if(!garbageCollector.count(key)){
newDecal=new Decal(new Sprite(imageSize.x/scale.x,imageSize.y/scale.x));
@ -3636,6 +3638,7 @@ namespace olc
}
if(!garbageCollector.count(key)||garbageCollector[key].originalStr!=sText){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
vi2d imageSize=GetWrappedTextSize(sText,width,scale);
if(imageSize.x<1||imageSize.y<1)return;
Decal*newDecal=nullptr;
if(!garbageCollector.count(key)){
newDecal=new Decal(new Sprite(imageSize.x/scale.x,imageSize.x/scale.x));
@ -3738,6 +3741,7 @@ namespace olc
}
if(!garbageCollector.count(key)||garbageCollector[key].originalStr!=sText){ //If the text key already exists, don't have to recreate the decal, just update the expire time.
vi2d imageSize=GetWrappedTextSizeProp(sText,width,scale);
if(imageSize.x<1||imageSize.y<1)return;
Decal*newDecal=nullptr;
if(!garbageCollector.count(key)){
newDecal=new Decal(new Sprite(imageSize.x/scale.x,imageSize.x/scale.x));

Loading…
Cancel
Save