diff --git a/OTRExporter b/OTRExporter index 854685155..d2fd3202b 160000 --- a/OTRExporter +++ b/OTRExporter @@ -1 +1 @@ -Subproject commit 854685155a6addaf72ec2415ac481a08ace9f9ce +Subproject commit d2fd3202b47e6d46367bd43a72b3c20b69935be6 diff --git a/libultraship b/libultraship index 57a599474..80c2c5e9c 160000 --- a/libultraship +++ b/libultraship @@ -1 +1 @@ -Subproject commit 57a599474665fcbad958864fbbecda843d37940f +Subproject commit 80c2c5e9c6a5681428f759100c2428c5e41f333c diff --git a/mm/2s2h/BenGui/BenGui.cpp b/mm/2s2h/BenGui/BenGui.cpp index c6fab34a3..4121bea60 100644 --- a/mm/2s2h/BenGui/BenGui.cpp +++ b/mm/2s2h/BenGui/BenGui.cpp @@ -113,7 +113,6 @@ void SetupGuiElements() { mItemTrackerSettingsWindow = std::make_shared("gWindows.ItemTrackerSettings", "Item Tracker Settings", ImVec2(800, 400)); gui->AddGuiWindow(mItemTrackerSettingsWindow); - gui->SetPadBtnTogglesMenu(); mNotificationWindow = std::make_shared("gWindows.Notifications", "Notifications Window"); gui->AddGuiWindow(mNotificationWindow); diff --git a/mm/2s2h/BenGui/BenInputEditorWindow.cpp b/mm/2s2h/BenGui/BenInputEditorWindow.cpp index 6bb0ce028..e0ac36b92 100644 --- a/mm/2s2h/BenGui/BenInputEditorWindow.cpp +++ b/mm/2s2h/BenGui/BenInputEditorWindow.cpp @@ -58,7 +58,7 @@ void BenInputEditorWindow::UpdateElement() { } } - Ship::Context::GetInstance()->GetWindow()->GetGui()->BlockImGuiGamepadNavigation(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->BlockGamepadNavigation(); } else { if (mGameInputBlockTimer != INT32_MAX) { mGameInputBlockTimer--; @@ -69,13 +69,13 @@ void BenInputEditorWindow::UpdateElement() { } } - if (Ship::Context::GetInstance()->GetWindow()->GetGui()->ImGuiGamepadNavigationEnabled()) { + if (Ship::Context::GetInstance()->GetWindow()->GetGui()->GamepadNavigationEnabled()) { mMappingInputBlockTimer = ImGui::GetIO().Framerate / 3; } else { mMappingInputBlockTimer = INT32_MAX; } - Ship::Context::GetInstance()->GetWindow()->GetGui()->UnblockImGuiGamepadNavigation(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->UnblockGamepadNavigation(); } } diff --git a/mm/2s2h/BenGui/BenMenu.cpp b/mm/2s2h/BenGui/BenMenu.cpp index 1708ee72f..1091dcba6 100644 --- a/mm/2s2h/BenGui/BenMenu.cpp +++ b/mm/2s2h/BenGui/BenMenu.cpp @@ -292,7 +292,7 @@ void BenMenu::AddSettings() { int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); if (hz >= 20 && hz <= 360) { CVarSetInteger("gInterpolationFPS", hz); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } }) .PreFunc([](WidgetInfo& info) { info.isHidden = mBenMenu->disabledMap.at(DISABLE_FOR_NOT_DIRECTX).active; }) @@ -1257,7 +1257,7 @@ void BenMenu::AddDevTools() { CVarSetFloat(WARP_POINT_CVAR "Z", player->actor.world.pos.z); CVarSetFloat(WARP_POINT_CVAR "Rotation", player->actor.shape.rot.y); CVarSetInteger(WARP_POINT_CVAR "Saved", 1); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); }) .PreFunc( [](WidgetInfo& info) { info.isHidden = mBenMenu->disabledMap.at(DISABLE_FOR_NULL_PLAY_STATE).active; }); @@ -1278,7 +1278,7 @@ void BenMenu::AddDevTools() { CVarClear(WARP_POINT_CVAR "Z"); CVarClear(WARP_POINT_CVAR "Rotation"); CVarClear(WARP_POINT_CVAR "Saved"); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); }) .PreFunc([](WidgetInfo& info) { info.isHidden = mBenMenu->disabledMap.at(DISABLE_FOR_NULL_PLAY_STATE).active || diff --git a/mm/2s2h/BenGui/CosmeticEditor.cpp b/mm/2s2h/BenGui/CosmeticEditor.cpp index 4a481a6e8..9e4ce9cdf 100644 --- a/mm/2s2h/BenGui/CosmeticEditor.cpp +++ b/mm/2s2h/BenGui/CosmeticEditor.cpp @@ -155,7 +155,7 @@ void CosmeticEditorRandomizeElement(CosmeticEditorElement element) { CVarSetColor(element.colorCvar, colorSelected); CVarSetInteger(element.colorChangedCvar, true); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } void CosmeticEditorRandomizeAllElements() { @@ -217,13 +217,13 @@ void CosmeticEditorDrawColorTab() { CVarSetColor(entry.colorCvar, colorSelected); CVarSetInteger(entry.colorChangedCvar, true); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } ImGui::SameLine(); if (ImGui::Button(ICON_FA_UNDO, ImVec2(27.0f, 27.0f))) { CVarClear(entry.colorCvar); CVarClear(entry.colorChangedCvar); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } ImGui::SameLine(); if (ImGui::Button(ICON_FA_RECYCLE, ImVec2(27.0f, 27.0f))) { diff --git a/mm/2s2h/BenGui/HudEditor.cpp b/mm/2s2h/BenGui/HudEditor.cpp index 604951f63..5d9f61676 100644 --- a/mm/2s2h/BenGui/HudEditor.cpp +++ b/mm/2s2h/BenGui/HudEditor.cpp @@ -235,7 +235,7 @@ void HudEditorWindow::DrawElement() { break; } } - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } for (int i = HUD_EDITOR_ELEMENT_B; i < HUD_EDITOR_ELEMENT_MAX; i++) { @@ -266,14 +266,14 @@ void HudEditorWindow::DrawElement() { CVarSetColor(hudEditorElements[i].colorCvar, colorSelected); CVarSetInteger(hudEditorElements[i].colorChangedCvar, true); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } ImGui::SameLine(); if (ImGui::Button(ICON_FA_REFRESH)) { float color[4] = { defaultColor[0], defaultColor[1], defaultColor[2], defaultColor[3] }; CVarClear(hudEditorElements[i].colorCvar); CVarClear(hudEditorElements[i].colorChangedCvar); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } ImGui::SameLine(); if (UIWidgets::CVarCombobox("Mode", hudEditorElements[i].modeCvar, modeNames, diff --git a/mm/2s2h/BenGui/Menu.cpp b/mm/2s2h/BenGui/Menu.cpp index 9274e5233..cddd41009 100644 --- a/mm/2s2h/BenGui/Menu.cpp +++ b/mm/2s2h/BenGui/Menu.cpp @@ -272,14 +272,14 @@ void Menu::MenuDrawItem(WidgetInfo& widget, uint32_t width, UIWidgets::Colors me }; } break; case WIDGET_AUDIO_BACKEND: { - auto currentAudioBackend = Ship::Context::GetInstance()->GetAudio()->GetAudioBackend(); + auto currentAudioBackend = Ship::Context::GetInstance()->GetAudio()->GetCurrentAudioBackend(); UIWidgets::ComboboxOptions options = {}; options.color = menuThemeIndex; options.tooltip = "Sets the audio API used by the game. Requires a relaunch to take effect."; options.disabled = Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1; options.disabledTooltip = "Only one audio API is available on this platform."; if (UIWidgets::Combobox("Audio API", ¤tAudioBackend, audioBackendsMap, options)) { - Ship::Context::GetInstance()->GetAudio()->SetAudioBackend(currentAudioBackend); + Ship::Context::GetInstance()->GetAudio()->SetCurrentAudioBackend(currentAudioBackend); } } break; case WIDGET_VIDEO_BACKEND: { diff --git a/mm/2s2h/BenGui/UIWidgets.cpp b/mm/2s2h/BenGui/UIWidgets.cpp index ad7249025..4c6e43e71 100644 --- a/mm/2s2h/BenGui/UIWidgets.cpp +++ b/mm/2s2h/BenGui/UIWidgets.cpp @@ -292,7 +292,7 @@ bool CVarCheckbox(const char* label, const char* cvarName, const CheckboxOptions bool value = (bool)CVarGetInteger(cvarName, options.defaultValue); if (Checkbox(label, &value, options)) { CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); ShipInit::Init(cvarName); dirty = true; } @@ -406,7 +406,7 @@ bool CVarSliderInt(const char* label, const char* cvarName, const IntSliderOptio int32_t value = CVarGetInteger(cvarName, options.defaultValue); if (SliderInt(label, &value, options)) { CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); ShipInit::Init(cvarName); dirty = true; } @@ -517,7 +517,7 @@ bool CVarSliderFloat(const char* label, const char* cvarName, const FloatSliderO float value = CVarGetFloat(cvarName, options.defaultValue); if (SliderFloat(label, &value, options)) { CVarSetFloat(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); ShipInit::Init(cvarName); dirty = true; } @@ -535,7 +535,7 @@ bool CVarColorPicker(const char* label, const char* cvarName, Color_RGBA8 defaul color.b = (uint8_t)(colorVec.z * 255.0f); color.a = (uint8_t)(colorVec.w * 255.0f); CVarSetColor(cvarName, color); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); ShipInit::Init(cvarName); changed = true; } diff --git a/mm/2s2h/BenGui/UIWidgets.hpp b/mm/2s2h/BenGui/UIWidgets.hpp index 2596b8196..a4c432d8d 100644 --- a/mm/2s2h/BenGui/UIWidgets.hpp +++ b/mm/2s2h/BenGui/UIWidgets.hpp @@ -427,7 +427,7 @@ namespace UIWidgets { int32_t value = CVarGetInteger(cvarName, options.defaultIndex); if (Combobox(label, &value, comboSource, options)) { CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); ShipInit::Init(cvarName); dirty = true; } @@ -666,7 +666,7 @@ namespace UIWidgets { int32_t value = CVarGetInteger(cvarName, options.defaultIndex); if (Combobox(label, &value, comboMap, options)) { CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); ShipInit::Init(cvarName); dirty = true; } @@ -679,7 +679,7 @@ namespace UIWidgets { int32_t value = CVarGetInteger(cvarName, options.defaultIndex); if (Combobox(label, &value, comboVector, options)) { CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); ShipInit::Init(cvarName); dirty = true; } @@ -692,7 +692,7 @@ namespace UIWidgets { int32_t value = CVarGetInteger(cvarName, options.defaultIndex); if (Combobox(label, &value, comboArray, options)) { CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); ShipInit::Init(cvarName); dirty = true; } diff --git a/mm/2s2h/BenPort.cpp b/mm/2s2h/BenPort.cpp index 288b774a8..1b0b2726e 100644 --- a/mm/2s2h/BenPort.cpp +++ b/mm/2s2h/BenPort.cpp @@ -178,8 +178,8 @@ OTRGlobals::OTRGlobals() { Ship::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v"); auto overlay = context->GetInstance()->GetWindow()->GetGui()->GetGameOverlay(); - overlay->LoadFont("Press Start 2P", "fonts/PressStart2P-Regular.ttf", 12.0f); - overlay->LoadFont("Fipps", "fonts/Fipps-Regular.otf", 32.0f); + overlay->LoadFont("Press Start 2P", 12.0f, "fonts/PressStart2P-Regular.ttf"); + overlay->LoadFont("Fipps", 32.0f, "fonts/Fipps-Regular.otf"); overlay->SetCurrentFont(CVarGetString(CVAR_GAME_OVERLAY_FONT, "Press Start 2P")); auto loader = context->GetResourceManager()->GetResourceLoader(); @@ -310,7 +310,7 @@ ImFont* OTRGlobals::CreateFontWithSize(float size, std::string fontPath) { initData->ResourceVersion = 0; initData->Path = fontPath; std::shared_ptr fontData = std::static_pointer_cast( - Ship::Context::GetInstance()->GetResourceManager()->LoadResource(fontPath, false, initData)); + Ship::Context::GetInstance()->GetResourceManager()->LoadResource(fontPath, 0, false, initData)); font = mImGuiIo->Fonts->AddFontFromMemoryTTF(fontData->Data, fontData->DataSize, size); } // FontAwesome fonts need to have their sizes reduced by 2.0f/3.0f in order to align correctly diff --git a/mm/2s2h/DeveloperTools/CollisionViewer.cpp b/mm/2s2h/DeveloperTools/CollisionViewer.cpp index 6c9507552..fcf666d00 100644 --- a/mm/2s2h/DeveloperTools/CollisionViewer.cpp +++ b/mm/2s2h/DeveloperTools/CollisionViewer.cpp @@ -64,7 +64,7 @@ void CollisionViewerWindow::DrawElement() { CVarClear("gCollisionViewer.ATCollisionColor"); CVarClear("gCollisionViewer.SpecialSurfaceColor"); CVarClear("gCollisionViewer.InteractableColor"); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } ImGui::SeparatorText("Collision Types"); diff --git a/mm/2s2h/DeveloperTools/EventLog.cpp b/mm/2s2h/DeveloperTools/EventLog.cpp index e1da01d23..677da9d57 100644 --- a/mm/2s2h/DeveloperTools/EventLog.cpp +++ b/mm/2s2h/DeveloperTools/EventLog.cpp @@ -313,7 +313,7 @@ void EventLogWindow::DrawElement() { CVarSetInteger("gEventLog.Filter.OpenText", 0); CVarSetInteger("gEventLog.Filter.ItemGive", 0); } - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } g->CurrentItemFlags = backup_item_flags; @@ -342,7 +342,7 @@ void EventLogWindow::DrawElement() { s32 maxEntries = CVarGetInteger("gEventLog.MaxEntries", 1000); if (ImGui::InputScalar("##maxEntriesInput", ImGuiDataType_S32, &maxEntries)) { CVarSetInteger("gEventLog.MaxEntries", MAX(0, maxEntries)); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); TrimEventLog(); } ImGui::PopItemWidth(); diff --git a/mm/2s2h/DeveloperTools/WarpPoint.cpp b/mm/2s2h/DeveloperTools/WarpPoint.cpp index 98ce5cc9d..1ae1b96d2 100644 --- a/mm/2s2h/DeveloperTools/WarpPoint.cpp +++ b/mm/2s2h/DeveloperTools/WarpPoint.cpp @@ -92,7 +92,7 @@ void RenderWarpPointSection() { CVarSetFloat(WARP_POINT_CVAR "Z", player->actor.world.pos.z); CVarSetFloat(WARP_POINT_CVAR "Rotation", player->actor.shape.rot.y); CVarSetInteger(WARP_POINT_CVAR "Saved", 1); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } if (CVarGetInteger(WARP_POINT_CVAR "Saved", 0)) { u32 sceneId = @@ -108,7 +108,7 @@ void RenderWarpPointSection() { CVarClear(WARP_POINT_CVAR "Z"); CVarClear(WARP_POINT_CVAR "Rotation"); CVarClear(WARP_POINT_CVAR "Saved"); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick(); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); } ImGui::SameLine(); if (UIWidgets::Button("Warp", { .size = UIWidgets::Sizes::Inline })) {