Skip to content

Commit

Permalink
Bump LUS and OTRExporter pt.1 (#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez authored Feb 4, 2025
1 parent cf8f57a commit 63079f1
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 33 deletions.
2 changes: 1 addition & 1 deletion OTRExporter
1 change: 0 additions & 1 deletion mm/2s2h/BenGui/BenGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ void SetupGuiElements() {
mItemTrackerSettingsWindow = std::make_shared<ItemTrackerSettingsWindow>("gWindows.ItemTrackerSettings",
"Item Tracker Settings", ImVec2(800, 400));
gui->AddGuiWindow(mItemTrackerSettingsWindow);
gui->SetPadBtnTogglesMenu();

mNotificationWindow = std::make_shared<Notification::Window>("gWindows.Notifications", "Notifications Window");
gui->AddGuiWindow(mNotificationWindow);
Expand Down
6 changes: 3 additions & 3 deletions mm/2s2h/BenGui/BenInputEditorWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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--;
Expand All @@ -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();
}
}

Expand Down
6 changes: 3 additions & 3 deletions mm/2s2h/BenGui/BenMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; })
Expand Down Expand Up @@ -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; });
Expand All @@ -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 ||
Expand Down
6 changes: 3 additions & 3 deletions mm/2s2h/BenGui/CosmeticEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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))) {
Expand Down
6 changes: 3 additions & 3 deletions mm/2s2h/BenGui/HudEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions mm/2s2h/BenGui/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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", &currentAudioBackend, audioBackendsMap, options)) {
Ship::Context::GetInstance()->GetAudio()->SetAudioBackend(currentAudioBackend);
Ship::Context::GetInstance()->GetAudio()->SetCurrentAudioBackend(currentAudioBackend);
}
} break;
case WIDGET_VIDEO_BACKEND: {
Expand Down
8 changes: 4 additions & 4 deletions mm/2s2h/BenGui/UIWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions mm/2s2h/BenGui/UIWidgets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -666,7 +666,7 @@ namespace UIWidgets {
int32_t value = CVarGetInteger(cvarName, options.defaultIndex);
if (Combobox<T>(label, &value, comboMap, options)) {
CVarSetInteger(cvarName, value);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
ShipInit::Init(cvarName);
dirty = true;
}
Expand All @@ -679,7 +679,7 @@ namespace UIWidgets {
int32_t value = CVarGetInteger(cvarName, options.defaultIndex);
if (Combobox<T>(label, &value, comboVector, options)) {
CVarSetInteger(cvarName, value);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
ShipInit::Init(cvarName);
dirty = true;
}
Expand All @@ -692,7 +692,7 @@ namespace UIWidgets {
int32_t value = CVarGetInteger(cvarName, options.defaultIndex);
if (Combobox<T>(label, &value, comboArray, options)) {
CVarSetInteger(cvarName, value);
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesOnNextTick();
Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame();
ShipInit::Init(cvarName);
dirty = true;
}
Expand Down
6 changes: 3 additions & 3 deletions mm/2s2h/BenPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -310,7 +310,7 @@ ImFont* OTRGlobals::CreateFontWithSize(float size, std::string fontPath) {
initData->ResourceVersion = 0;
initData->Path = fontPath;
std::shared_ptr<Ship::Font> fontData = std::static_pointer_cast<Ship::Font>(
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
Expand Down
2 changes: 1 addition & 1 deletion mm/2s2h/DeveloperTools/CollisionViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions mm/2s2h/DeveloperTools/EventLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions mm/2s2h/DeveloperTools/WarpPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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 })) {
Expand Down

0 comments on commit 63079f1

Please sign in to comment.