Skip to content

Commit

Permalink
Achievements: Make indicator fade always 0.1s
Browse files Browse the repository at this point in the history
Depending on the rate that new indicators are added, with the old value
of 0.5s it was possible to have ghost indicators that never clear.
  • Loading branch information
dreamsyntax committed Feb 24, 2025
1 parent 02789eb commit 0fa8bc1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pcsx2/Achievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ namespace Achievements
static constexpr float LEADERBOARD_STARTED_NOTIFICATION_TIME = 3.0f;
static constexpr float LEADERBOARD_FAILED_NOTIFICATION_TIME = 3.0f;

static constexpr float INDICATOR_FADE_IN_TIME = 0.1f;
static constexpr float INDICATOR_FADE_OUT_TIME = 0.5f;
static constexpr float INDICATOR_FADE_TIME = 0.1f;

static constexpr size_t URL_BUFFER_SIZE = 256;

Expand Down Expand Up @@ -1918,8 +1917,7 @@ template <typename T>
static float IndicatorOpacity(const T& i)
{
const float elapsed = static_cast<float>(i.show_hide_time.GetTimeSeconds());
const float time = i.active ? Achievements::INDICATOR_FADE_IN_TIME : Achievements::INDICATOR_FADE_OUT_TIME;
const float opacity = (elapsed >= time) ? 1.0f : (elapsed / time);
const float opacity = (elapsed >= Achievements::INDICATOR_FADE_TIME) ? 1.0f : (elapsed / Achievements::INDICATOR_FADE_TIME);
return (i.active) ? opacity : (1.0f - opacity);
}

Expand Down

0 comments on commit 0fa8bc1

Please sign in to comment.