Skip to content

Commit

Permalink
ChaosMod: Use GetEffectCompletionPercentage in Roll Credits effect
Browse files Browse the repository at this point in the history
  • Loading branch information
pongo1231 committed Jan 16, 2025
1 parent 82e340b commit df7df90
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions ChaosMod/Effects/db/Misc/MiscRollCredits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@

#include <stdafx.h>

static int s_alpha;
static float s_alphaTimer;

static void OnStart()
{
s_alpha = 0;
s_alphaTimer = 0.f;

REQUEST_ADDITIONAL_TEXT("CREDIT", 0);
while (!HAS_ADDITIONAL_TEXT_LOADED(0))
WAIT(0);
Expand Down Expand Up @@ -48,13 +42,8 @@ static void OnTick()

SET_USER_RADIO_CONTROL_ENABLED(false);

if (s_alpha < 255 && (s_alphaTimer += GET_FRAME_TIME()) > 0.1f)
{
s_alphaTimer = 0;
s_alpha++;
}

DRAW_RECT(.5f, .5f, 1.f, 1.f, 0, 0, 0, s_alpha, false);
DRAW_RECT(.5f, .5f, 1.f, 1.f, 0, 0, 0,
std::lerp(0, 255, std::min(CurrentEffect::GetEffectCompletionPercentage(), 1.f)), false);
}

// clang-format off
Expand Down

0 comments on commit df7df90

Please sign in to comment.