From 51189791c031c66033dccad9fce1bfc05a273afc Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sat, 16 Nov 2024 04:32:10 -0300 Subject: [PATCH] update level select --- include/mods.h | 2 + src/mods/levelselect.c | 84 +++++++++++++++++++++--------------------- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/include/mods.h b/include/mods.h index aa9f3093..3047c8d2 100644 --- a/include/mods.h +++ b/include/mods.h @@ -96,6 +96,8 @@ void RamMod_Update(void); void Spawner(void); #endif +#define DEBUG_SKIP_BRIEFING 1 + /* // @port: Tag the transform. diff --git a/src/mods/levelselect.c b/src/mods/levelselect.c index ad562096..5d058ffa 100644 --- a/src/mods/levelselect.c +++ b/src/mods/levelselect.c @@ -1,5 +1,6 @@ #include "global.h" #include "fox_map.h" +#include "mods.h" extern PlanetId sPlanetList[15]; extern PlanetId sCurrentPlanetId; @@ -28,6 +29,8 @@ void Map_LevelSelect(void) { "ZONESS", "CORNERIA", "TITANIA", "AQUAS", "FORTUNA", "VENOM 1", "SOLAR", "VENOM 2", }; static s32 startOption = 0; + static s32 timer = 30; + static s32 startLevel = 0; // static f32 zStart = 0.0f; // f32 zInc; @@ -74,63 +77,58 @@ void Map_LevelSelect(void) { startOption ^= 1; } - // if (contPress->button & U_CBUTTONS) { - // zInc = 100.0f; - // } else if (contPress->button & R_CBUTTONS) { - // zInc = 1000.0f; - // } else if (contPress->button & D_CBUTTONS) { - // zInc = -100.0f; - // } else if (contPress->button & L_CBUTTONS) { - // zInc = -1000.0f; - // } - // if (gControllerHold[0].button & R_TRIG) { - // zInc *= 100.0f; - // } - // zStart += zInc; - // if(zStart < 0.0f) { - // zStart = 0.0f; - // } else if (zStart > 500000.0f) { - // zStart = 500000.0f; - // } + int y = 225; /* Draw */ if ((sCurrentPlanetId >= 0) && (sCurrentPlanetId < PLANET_MAX)) { RCP_SetupDL(&gMasterDisp, SETUPDL_83); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 0, 255); - Graphics_DisplaySmallText(20, 200, 1.0f, 1.0f, "PLANET:"); - Graphics_DisplaySmallText(80, 200, 1.0f, 1.0f, sLevelSelectPlanetNames[sPlanetArray[mission][difficulty]]); + Graphics_DisplaySmallText(20, y, 1.0f, 1.0f, "PLANET:"); + Graphics_DisplaySmallText(80, y, 1.0f, 1.0f, sLevelSelectPlanetNames[sPlanetArray[mission][difficulty]]); if (startOption) { if ((sCurrentPlanetId == PLANET_SECTOR_X) || (sCurrentPlanetId == PLANET_METEO)) { - Graphics_DisplaySmallText(80, 210, 1.0f, 1.0f, "WARP ZONE"); + Graphics_DisplaySmallText(80 + 60 + 10, y, 1.0f, 1.0f, "WARP ZONE"); } else if (sCurrentPlanetId == PLANET_VENOM) { - Graphics_DisplaySmallText(80, 210, 1.0f, 1.0f, "ANDROSS"); + Graphics_DisplaySmallText(80 + 60 + 3, y, 1.0f, 1.0f, "ANDROSS"); } else if (sCurrentPlanetId == PLANET_AREA_6) { - Graphics_DisplaySmallText(80, 210, 1.0f, 1.0f, "BETA SB"); + Graphics_DisplaySmallText(80 + 60 - 3, y, 1.0f, 1.0f, "BETA SB"); } } } - // Bypass briefing - if ((sMapState == 2) && (sMapSubState > 0)) { - if (sCurrentPlanetId == PLANET_VENOM) { - if (startOption) { - gCurrentLevel = LEVEL_VENOM_ANDROSS; - } else if (sPlanetArray[mission][difficulty] == SAVE_SLOT_VENOM_2) { - gCurrentLevel = LEVEL_VENOM_2; - } - } else if ((sCurrentPlanetId == PLANET_AREA_6) && startOption) { - gCurrentLevel = LEVEL_UNK_4; - } - Map_LevelStart_AudioSpecSetup(gCurrentLevel); - sLevelStartState = 0; - D_menu_801CD968 = 0; - Map_PlayLevel(); - if (startOption && ((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X) || - (sPlanetArray[mission][difficulty] == SAVE_SLOT_VENOM_2))) { - gLevelPhase = 1; - } - // gSavedPathProgress = gPathProgress = zStart; + if (gControllerPress[0].button & A_BUTTON) { + timer = 15; + startLevel = 1; } + + if (timer > 0) { + timer--; + } + + // Bypass briefing + #if DEBUG_SKIP_BRIEFING + if ((timer == 0) && (startLevel == 1)) { + if ((sMapState == 2) && (sMapSubState > 0)) { + if (sCurrentPlanetId == PLANET_VENOM) { + if (startOption) { + gCurrentLevel = LEVEL_VENOM_ANDROSS; + } else if (sPlanetArray[mission][difficulty] == SAVE_SLOT_VENOM_2) { + gCurrentLevel = LEVEL_VENOM_2; + } + } else if ((sCurrentPlanetId == PLANET_AREA_6) && startOption) { + gCurrentLevel = LEVEL_UNK_4; + } + Map_LevelStart_AudioSpecSetup(gCurrentLevel); + sLevelStartState = 0; + D_menu_801CD968 = 0; + Map_PlayLevel(); + if (startOption && ((gCurrentLevel == LEVEL_METEO) || (gCurrentLevel == LEVEL_SECTOR_X) || + (sPlanetArray[mission][difficulty] == SAVE_SLOT_VENOM_2))) { + gLevelPhase = 1; + } + } + } + #endif }