diff --git a/src/game/level_update.h b/src/game/level_update.h index ecf9c3a3..3c71e1af 100644 --- a/src/game/level_update.h +++ b/src/game/level_update.h @@ -119,6 +119,7 @@ enum HUDDisplayFlag { u16 level_control_timer(s32 timerOp); void fade_into_special_warp(u32 arg, u32 color); +void initiate_warp(s16 destLevel, s16 destArea, s16 destWarpNode, s32 arg3); void load_level_init_text(u32 arg); s16 level_trigger_warp(struct MarioState *m, s32 warpOp); void level_set_transition(s16 length, void (*updateFunction)(s16 *)); diff --git a/src/moon/imgui/imgui_impl.cpp b/src/moon/imgui/imgui_impl.cpp index 5b59f958..ccc3aa5b 100644 --- a/src/moon/imgui/imgui_impl.cpp +++ b/src/moon/imgui/imgui_impl.cpp @@ -70,6 +70,8 @@ extern "C" { #include "pc/pc_main.h" #include "game/camera.h" #include "game/mario.h" +#include "game/level_update.h" +#include "level_table.h" } #include "pc/configfile.h" @@ -98,6 +100,15 @@ static void HelpMarker(const char* desc) } } +void warp_to(s16 destLevel, s16 destArea = 0x01, s16 destWarpNode = 0x0A) { + if (gCurrLevelNum == destLevel) { + return; + } + + initiate_warp(destLevel, destArea, destWarpNode, 0); + fade_into_special_warp(0,0); +} + #ifdef TARGET_SWITCH namespace MoonNX { SwkbdConfig kbd; @@ -188,6 +199,8 @@ namespace MoonInternal { int selected_sky_item = 0; int current_sky_item = 0; + int current_level_sel = 0; + void setupFonts() { ImGuiIO& io = ImGui::GetIO(); // for (auto entry = Moon::fonts.begin(); entry != Moon::fonts.end(); entry++){ @@ -360,7 +373,7 @@ namespace MoonInternal { if (ImGui::BeginMenu("View")) { ImGui::MenuItem("Stats", NULL, &configImGui.s_stats); ImGui::MenuItem("Machinima", NULL, &configImGui.s_machinima); - ImGui::MenuItem("Quick Toggles", NULL, &configImGui.s_toggles); + ImGui::MenuItem("Quick Options", NULL, &configImGui.s_toggles); ImGui::MenuItem("Appearance", NULL, &configImGui.s_appearance); //ImGui::MenuItem("Debug Textures", NULL, &configImGui.texture_debug); ImGui::EndMenu(); @@ -432,7 +445,7 @@ namespace MoonInternal { } if (configImGui.s_toggles && show_menu_bar){ ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0)); - ImGui::Begin("Quick Toggles", NULL, ImGuiWindowFlags_None); + ImGui::Begin("Quick Options", NULL, ImGuiWindowFlags_None); ImGui::Dummy(ImVec2(0, 5)); @@ -451,6 +464,106 @@ namespace MoonInternal { ImGui::Dummy(ImVec2(0, 5)); + const char* levelList[] = { + "Castle Grounds", "Castle Inside", "Bob-omb Battlefield", + "Whomp's Fortress", "Princess's Secret Slide", "Tower of the Wing Cap", + "Jolly Roger Bay", "Secret Aquarium", "Cool, Cool Mountain", + "Bowser in the Dark World", "Big Boo's Haunt", "Hazy Maze Cave", + "Cavern of the Metal Cap", "Lethal Lava Land", "Shifting Sand Land", + "Vanish Cap under the Moat", "Dire, Dire Docks", "Bowser in the Fire Sea", + "Snowman's Land", "Wet-Dry World", "Tall, Tall Mountain", "Tiny, Huge Island", + "Tick Tock Clock", "Wing Mario Over the Rainbow", "Rainbow Ride", "Bowser in the Sky" + }; + ImGui::Combo("Level", ¤t_level_sel, levelList, IM_ARRAYSIZE(levelList)); + + if (ImGui::Button("Warp")) { + switch (current_level_sel) { + case 0: + warp_to(LEVEL_CASTLE_GROUNDS, 0x01, 0x04); + break; + case 1: + warp_to(LEVEL_CASTLE, 0x01, 0x01); + break; + case 2: + warp_to(LEVEL_BOB); + break; + case 3: + warp_to(LEVEL_WF); + break; + case 4: + warp_to(LEVEL_PSS); + break; + case 5: + warp_to(LEVEL_TOTWC); + break; + case 6: + warp_to(LEVEL_JRB); + break; + case 7: + warp_to(LEVEL_SA); + break; + case 8: + warp_to(LEVEL_CCM); + break; + case 9: + warp_to(LEVEL_BITDW); + break; + case 10: + warp_to(LEVEL_BBH); + break; + case 11: + warp_to(LEVEL_HMC); + break; + case 12: + warp_to(LEVEL_COTMC); + break; + case 13: + warp_to(LEVEL_LLL); + break; + case 14: + warp_to(LEVEL_SSL); + break; + case 15: + warp_to(LEVEL_VCUTM); + break; + case 16: + warp_to(LEVEL_DDD); + break; + case 17: + warp_to(LEVEL_BITFS); + break; + case 18: + warp_to(LEVEL_SL); + break; + case 19: + warp_to(LEVEL_WDW); + break; + case 20: + warp_to(LEVEL_TTM); + break; + case 21: + warp_to(LEVEL_THI); + break; + case 22: + warp_to(LEVEL_TTC); + break; + case 23: + warp_to(LEVEL_WMOTR); + break; + case 24: + warp_to(LEVEL_RR); + break; + case 25: + warp_to(LEVEL_BITS); + break; + default: + warp_to(LEVEL_CASTLE_GROUNDS); + break; + } + } + + ImGui::Dummy(ImVec2(0, 5)); + /* const char* skyStates[] = { "Default", "Night", "Green", "Blue", "Pink"}; ImGui::Combo("Skybox", &selected_sky_item, skyStates, IM_ARRAYSIZE(skyStates));