From 48c294fc247e8286a15e1f70b98465f9f9b809dc Mon Sep 17 00:00:00 2001 From: MaikelChan Date: Tue, 6 Aug 2024 14:21:36 +0200 Subject: [PATCH] Recalculate model position in character profile menu every tick, so it adjusts when resizing the window. --- src/game/trainingmenus.c | 63 +++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/src/game/trainingmenus.c b/src/game/trainingmenus.c index d183e3b2f..4729e17c3 100644 --- a/src/game/trainingmenus.c +++ b/src/game/trainingmenus.c @@ -1535,19 +1535,7 @@ MenuDialogHandlerResult ciCharacterProfileMenuDialog(s32 operation, struct menud f32 y; f32 scale; - switch (operation) { - case MENUOP_OPEN: - if (bodynum == BODY_DRCAROLL) { - scale = 0.7f; - g_Menus[g_MpPlayerNum].menumodel.zoom = -1; - } else { - g_Menus[g_MpPlayerNum].menumodel.zoom = 30; - scale = 1.0f; - } - - g_Menus[g_MpPlayerNum].menumodel.zoomtimer60 = TICKS(120); - g_Menus[g_MpPlayerNum].menumodel.removingpiece = false; - +#ifndef PLATFORM_N64 #if VERSION == VERSION_PAL_FINAL if (g_ViRes != VIRES_HI) { x = -117; @@ -1574,6 +1562,50 @@ MenuDialogHandlerResult ciCharacterProfileMenuDialog(s32 operation, struct menud if (optionsGetScreenRatio() == SCREENRATIO_16_9) { x = -100; } +#endif +#endif + + switch (operation) { + case MENUOP_OPEN: + if (bodynum == BODY_DRCAROLL) { + scale = 0.7f; + g_Menus[g_MpPlayerNum].menumodel.zoom = -1; + } else { + g_Menus[g_MpPlayerNum].menumodel.zoom = 30; + scale = 1.0f; + } + + g_Menus[g_MpPlayerNum].menumodel.zoomtimer60 = TICKS(120); + g_Menus[g_MpPlayerNum].menumodel.removingpiece = false; + +#ifdef PLATFORM_N64 +#if VERSION == VERSION_PAL_FINAL + if (g_ViRes != VIRES_HI) { + x = -117; + + if (optionsGetScreenRatio() == SCREENRATIO_16_9) { + x = -87; + } + } else { + x = -177; + + if (optionsGetScreenRatio() == SCREENRATIO_16_9) { + x = -127; + } + } +#elif VERSION == VERSION_PAL_BETA + x = -117; + + if (optionsGetScreenRatio() == SCREENRATIO_16_9) { + x = -87; + } +#else + x = -130; + + if (optionsGetScreenRatio() == SCREENRATIO_16_9) { + x = -100; + } +#endif #endif y = -15; @@ -1603,6 +1635,11 @@ MenuDialogHandlerResult ciCharacterProfileMenuDialog(s32 operation, struct menud case MENUOP_CLOSE: break; case MENUOP_TICK: +#ifndef PLATFORM_N64 + x = (float)x * ((f32)SCREEN_WIDTH_LO / (f32)SCREEN_HEIGHT_LO) / videoGetAspect(); + g_Menus[g_MpPlayerNum].menumodel.newposx = x; +#endif + if (bodynum == BODY_DRCAROLL) { static struct modelpartvisibility vis[] = { { MODELPART_DRCAROLL_0001, false },