achievement_menu: improved outro animation

This commit is contained in:
Hyper 2024-12-01 03:32:34 +00:00
parent f1448b12e2
commit dcd31ffab6
2 changed files with 5 additions and 3 deletions

View file

@ -8,7 +8,7 @@
float g_achievementMenuIntroTime = 0.0f; float g_achievementMenuIntroTime = 0.0f;
constexpr float g_achievementMenuIntroThreshold = 3.0f; constexpr float g_achievementMenuIntroThreshold = 3.0f;
float g_achievementMenuOutroTime = 0.0f; float g_achievementMenuOutroTime = 0.0f;
constexpr float g_achievementMenuOutroThreshold = 0.42f; constexpr float g_achievementMenuOutroThreshold = 0.32f;
bool g_isAchievementMenuOutro = false; bool g_isAchievementMenuOutro = false;
void CHudPauseAddOptionsItemMidAsmHook(PPCRegister& pThis) void CHudPauseAddOptionsItemMidAsmHook(PPCRegister& pThis)
@ -136,7 +136,7 @@ PPC_FUNC(sub_824B0930)
if (g_achievementMenuIntroThreshold >= g_achievementMenuIntroTime) if (g_achievementMenuIntroThreshold >= g_achievementMenuIntroTime)
__imp__sub_824B0930(ctx, base); __imp__sub_824B0930(ctx, base);
if (pInputState->GetPadState().IsTapped(SWA::eKeyState_B)) if (pInputState->GetPadState().IsTapped(SWA::eKeyState_B) && !g_isAchievementMenuOutro)
{ {
AchievementMenu::Close(); AchievementMenu::Close();

View file

@ -355,7 +355,9 @@ static void DrawContentContainer()
auto drawList = ImGui::GetForegroundDrawList(); auto drawList = ImGui::GetForegroundDrawList();
// Expand/retract animation. // Expand/retract animation.
auto motion = ComputeMotion(g_appearTime, CONTENT_CONTAINER_COMMON_MOTION_START, CONTENT_CONTAINER_COMMON_MOTION_END); auto motion = g_isClosing
? ComputeMotion(g_appearTime, 0, CONTENT_CONTAINER_COMMON_MOTION_START)
: ComputeMotion(g_appearTime, CONTENT_CONTAINER_COMMON_MOTION_START, CONTENT_CONTAINER_COMMON_MOTION_END);
auto minX = g_isClosing auto minX = g_isClosing
? Hermite(256, 306, motion) ? Hermite(256, 306, motion)