|
|
@ -665,12 +665,14 @@ void Crawler::RenderWorld(float fElapsedTime){ |
|
|
|
|
|
|
|
|
|
|
|
auto RenderZone=[&](geom2d::rect<int>&zone){ |
|
|
|
auto RenderZone=[&](geom2d::rect<int>&zone){ |
|
|
|
game->SetDecalMode(DecalMode::ADDITIVE); |
|
|
|
game->SetDecalMode(DecalMode::ADDITIVE); |
|
|
|
Pixel ringColor={64,255,64,uint8_t(abs(sin(game->levelTime))*255)}; |
|
|
|
Pixel ringColor={128,128,128,uint8_t(abs(sin(game->levelTime))*255)}; |
|
|
|
|
|
|
|
Decal*ringDecal=GFX["finishring_green.png"].Decal(); |
|
|
|
if(!player->IsOutOfCombat()){ |
|
|
|
if(!player->IsOutOfCombat()){ |
|
|
|
game->SetDecalMode(DecalMode::NORMAL); |
|
|
|
game->SetDecalMode(DecalMode::NORMAL); |
|
|
|
ringColor.r=ringColor.g=ringColor.b=64; |
|
|
|
ringColor.r=ringColor.g=ringColor.b=64; |
|
|
|
|
|
|
|
ringDecal=GFX["finishring.png"].Decal(); |
|
|
|
} |
|
|
|
} |
|
|
|
view.DrawDecal(zone.pos,GFX["finishring.png"].Decal(),vf2d(zone.size)/vf2d(GFX["finishring.png"].Sprite()->Size()),ringColor); |
|
|
|
view.DrawDecal(zone.pos,ringDecal,vf2d(zone.size)/vf2d(GFX["finishring.png"].Sprite()->Size()),ringColor); |
|
|
|
game->SetDecalMode(DecalMode::NORMAL); |
|
|
|
game->SetDecalMode(DecalMode::NORMAL); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -1094,17 +1096,24 @@ Player*Crawler::GetPlayer(){ |
|
|
|
void Crawler::RenderHud(){ |
|
|
|
void Crawler::RenderHud(){ |
|
|
|
RenderCooldowns(); |
|
|
|
RenderCooldowns(); |
|
|
|
|
|
|
|
|
|
|
|
if(GetPlayer()->GetCastInfo().castTimer>0){ |
|
|
|
auto RenderCastbar=[&](const CastInfo&cast){ |
|
|
|
FillRectDecal(vf2d{ScreenWidth()/2-92.f,ScreenHeight()-90.f},{184,20},BLACK); |
|
|
|
FillRectDecal(vf2d{ScreenWidth()/2-92.f,ScreenHeight()-90.f},{184,20},BLACK); |
|
|
|
FillRectDecal(vf2d{ScreenWidth()/2-90.f,ScreenHeight()-88.f},{180,16},DARK_GREY); |
|
|
|
FillRectDecal(vf2d{ScreenWidth()/2-90.f,ScreenHeight()-88.f},{180,16},DARK_GREY); |
|
|
|
float timer=GetPlayer()->GetCastInfo().castTimer; |
|
|
|
float timer=cast.castTimer; |
|
|
|
float totalTime=GetPlayer()->GetCastInfo().castTotalTime; |
|
|
|
float totalTime=cast.castTotalTime; |
|
|
|
std::string castText=GetPlayer()->GetCastInfo().name; |
|
|
|
std::string castText=cast.name; |
|
|
|
GradientFillRectDecal(vf2d{ScreenWidth()/2-90.f,ScreenHeight()-88.f},{(timer/totalTime)*180,16},{247,125,37},{247,125,37},{247,184,37},{247,184,37}); |
|
|
|
GradientFillRectDecal(vf2d{ScreenWidth()/2-90.f,ScreenHeight()-88.f},{(timer/totalTime)*180,16},{247,125,37},{247,125,37},{247,184,37},{247,184,37}); |
|
|
|
std::stringstream castTimeDisplay;
|
|
|
|
std::stringstream castTimeDisplay;
|
|
|
|
castTimeDisplay<<std::fixed<<std::setprecision(1)<<timer; |
|
|
|
castTimeDisplay<<std::fixed<<std::setprecision(1)<<timer; |
|
|
|
DrawShadowStringPropDecal(vf2d{ScreenWidth()/2+90.f,ScreenHeight()-80.f}-vf2d{float(GetTextSizeProp(castTimeDisplay.str()).x),0},castTimeDisplay.str(),WHITE,BLACK); |
|
|
|
DrawShadowStringPropDecal(vf2d{ScreenWidth()/2+90.f,ScreenHeight()-80.f}-vf2d{float(GetTextSizeProp(castTimeDisplay.str()).x),0},castTimeDisplay.str(),WHITE,BLACK); |
|
|
|
DrawShadowStringPropDecal(vf2d{ScreenWidth()/2.f-GetTextSizeProp(castText).x*2/2,ScreenHeight()-64.f},castText,WHITE,BLACK,{2,3},2.f); |
|
|
|
DrawShadowStringPropDecal(vf2d{ScreenWidth()/2.f-GetTextSizeProp(castText).x*2/2,ScreenHeight()-64.f},castText,WHITE,BLACK,{2,3},2.f); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(GetPlayer()->GetCastInfo().castTimer>0){ |
|
|
|
|
|
|
|
RenderCastbar(GetPlayer()->GetCastInfo()); |
|
|
|
|
|
|
|
}else |
|
|
|
|
|
|
|
if(GetPlayer()->GetEndZoneStandTime()>0){ |
|
|
|
|
|
|
|
RenderCastbar(CastInfo{"Exiting Level...",GetPlayer()->GetEndZoneStandTime(),"Player.End Zone Wait Time"_F}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DrawDecal({2,2},GFX["heart.png"].Decal()); |
|
|
|
DrawDecal({2,2},GFX["heart.png"].Decal()); |
|
|
|