Shipwright/soh/soh/SohGui.cpp

239 lines
10 KiB
C++
Raw Normal View History

build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
//
// SohGui.cpp
// soh
//
// Created by David Chavez on 24.08.22.
//
#include "SohGui.hpp"
#include <spdlog/spdlog.h>
#ifndef IMGUI_DEFINE_MATH_OPERATORS
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
#define IMGUI_DEFINE_MATH_OPERATORS
#endif
#include <ImGui/imgui.h>
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
#include <ImGui/imgui_internal.h>
#include <libultraship/libultraship.h>
#include <Fast3D/gfx_pc.h>
#ifdef __APPLE__
#include "graphic/Fast3D/gfx_metal.h"
#endif
#ifdef __SWITCH__
#include <port/switch/SwitchImpl.h>
#endif
#include "UIWidgets.hpp"
#include "include/global.h"
#include "include/z64audio.h"
#include "soh/SaveManager.h"
#include "OTRGlobals.h"
#include "soh/Enhancements/presets.h"
#include "soh/resource/type/Skeleton.h"
#include "libultraship/libultraship.h"
#ifdef ENABLE_REMOTE_CONTROL
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
#include "Enhancements/crowd-control/CrowdControl.h"
#include "Enhancements/game-interactor/GameInteractor_Sail.h"
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
#endif
#include "Enhancements/game-interactor/GameInteractor.h"
#include "Enhancements/cosmetics/authenticGfxPatches.h"
Advanced controls for aspect ratio, resolution, and integer scaling. (#3130) * Advanced Resolution Settings first working version with most features implemented * Update advancedResolutionEditor.cpp Added auto-resizing logic for Pixel Perfect Mode. Minor fixes. * Tweaks and tidying up. Disable integer scale slider if automatic sizing is overriding it. Don't offer these UI options on Apple. Removed unused code. Updated LUS. * Update libultraship * Filenames and style fixes Filenames and folders now more closely match rest of project. Tidied newlines/comments. (SohMenuBar.cpp) Label of button changed to fit menu. (ResolutionEditor.cpp) Default window size improved. * Update libultraship (However, I still need to make the GUI controls acknowledge the new constraints.) * Update libultraship (and changed the name of some cvars) * Added constraints to the inputs. Added a fps drop warning. * Tweaks based on feedback * Update libultraship * Enabled on Apple - For currently ongoing Retina DPI troubleshooting. (Also removed the duplicated N64 Mode toggle.) * Update libultraship * Update LUS, update CVar names, small tweaks And one significant fix: Enhancement checkboxes in ResolutionEditor now default to off. * Add Additional Settings and the accursed horizontal resolution field. There's still a few bugs with it that I haven't squashed, but I need to stop for now and just commit what I've got. (This is honestly causing more problems than it solves, but i'm tired of getting questions about it.) * Resolved many of the lingering bugs with the previous commit * Horizontal Resolution field now properly acknowledges resolution bounds. * Don't show "Horiz. pixel count" field if not enforcing aspect ratio. Additionally: * Don't change settings if selecting "Custom" from preset dropdowns. * Added a missing horizontal pixel count clamp check. * Tidied up redundant behaviour. * Additional comments, and a checkbox to disable aspect correction on consoles. * Change how frame rate threshold is calculated. * More minor UI tweaks. * Added missing CVarSave() calls where needed. Added a short update countdown for the numerical CVars. This is intended to prevent CVarSave() from being called too often. * Added a helpful button to cover a potential support issue. * "Fit Automatically" has been moved to LUS and is now smarter. This will require another PR in LUS to be opened by me. * Swap to new branch for libultraship * Even more clever integer scaling behavior. "IntegerScale" is itself now a CVar group. * Tidy up comments. * Fix a typo that prevented `IsDroppingFrames()` from working (Maybe more than a mere typo, but a typo was involved.) * Remove unused and unnecessary variables. * Group "Integer Scaling" under its own collapsing header * Changed label for the Enabled advanced settings checkbox. * Update libultraship + Formatting pass on ResolutionEditor.cpp * Add `(Select "Off" to disable.)` help text for the aspect ratio setting and hide UI elements accordingly. Only show the fields if user chooses Custom. Padding has been shifted accordingly too. Also fixed a long standing error with the Y field disappearing when modifying X. * Well I suppose that's no-longer necessary. * Update libultraship with commits from main branch (up to e5df3a9) * Tweak comments. * Save current ImGui Combo items as a console variable to improve user experience. * Change language of NeverExceedBounds checkbox description to be more affirmative, so it makes more sense. Add tooltip for NeverExceedBounds checkbox. Tweak some comments related to additional settings. * Add list of colours to use with TextColored elements. * Move some UI elements around. Add an extra MSAA slider to the editor window. * Integer Scaling header is DefaultOpen if player has Pixel Perfect Mode active upon window creation. + Amend tooltips. * Fix a minor oversight with default configuration. Fixes an issue where default aspect ratio settings on a fresh SoH configuration weren't matching the defaults assigned in libultraship. The default values are now 16:9, matching LUS. Additionally, the combo box now defaults specifically to the 16:9 preset instead of "Custom". (Fixing the defaults in LUS to be 4:3 isn't worth a LUS bump, so this slight workaround will do for the sake of this PR.) * Make resolution slider `disabled` condition a variable, for readability. * Small tweak to combo item saving * Use `SCREEN_HEIGHT` and `SCREEN_WIDTH` for constraints * Simplify "Show a horizontal resolution field" logic by using pixel dimensions as the aspect ratio directly, since now this view hides the aspect ratio setting from the user anyway. * Correct aspect ratio visualiser to be un-inverted + actually display it as a ratio. * Remove update flags from combo boxes + remove update countdown + remove non-functioning 'IsBoolArrayTrue' function. (The countdown was an okay idea but I didn't implement it correctly. It's better to just keep it simple.) * Code review suggestion: disable UI elements conditionally (+ tweaks to code style) * Invisible tweaks to the Integer Scaling-related Additional Settings This looks like a lot but it's mostly just re-arranging a cluttered area of the code for clarity. Actual changes to functionality are: * Help text now "disabled" along with the checkbox. * The NeverExceedBounds checkbox will now reset the unused ExceedBoundsBy cvar if it's been changed. * Assorted small tweaks to comments and variable declarations. * Code review suggestion: tweak "Window exceeded" warning condition * Missed a thingy.
2023-12-23 16:19:41 -05:00
#include "Enhancements/resolution-editor/ResolutionEditor.h"
#include "Enhancements/debugger/MessageViewer.h"
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
bool ToggleAltAssetsAtEndOfFrame = false;
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
bool isBetaQuestEnabled = false;
extern "C" {
void enableBetaQuest() { isBetaQuestEnabled = true; }
void disableBetaQuest() { isBetaQuestEnabled = false; }
}
namespace SohGui {
// MARK: - Properties
static const char* chestSizeAndTextureMatchesContentsOptions[4] = { "Disabled", "Both", "Texture Only", "Size Only" };
static const char* bunnyHoodOptions[3] = { "Disabled", "Faster Run & Longer Jump", "Faster Run" };
static const char* allPowers[9] = {
"Vanilla (1x)",
"Double (2x)",
"Quadruple (4x)",
"Octuple (8x)",
"Foolish (16x)",
"Ridiculous (32x)",
"Merciless (64x)",
"Pure Torture (128x)",
"OHKO (256x)" };
static const char* subPowers[8] = { allPowers[0], allPowers[1], allPowers[2], allPowers[3], allPowers[4], allPowers[5], allPowers[6], allPowers[7] };
static const char* subSubPowers[7] = { allPowers[0], allPowers[1], allPowers[2], allPowers[3], allPowers[4], allPowers[5], allPowers[6] };
static const char* zFightingOptions[3] = { "Disabled", "Consistent Vanish", "No Vanish" };
static const char* autosaveLabels[6] = { "Off", "New Location + Major Item", "New Location + Any Item", "New Location", "Major Item", "Any Item" };
static const char* FastFileSelect[5] = { "File N.1", "File N.2", "File N.3", "Zelda Map Select (require OoT Debug Mode)", "File select" };
static const char* bonkDamageValues[8] = {
"No Damage",
"0.25 Heart",
"0.5 Heart",
"1 Heart",
"2 Hearts",
"4 Hearts",
"8 Hearts",
"OHKO"
};
static const inline std::vector<std::pair<const char*, const char*>> audioBackends = {
#ifdef _WIN32
{ "wasapi", "Windows Audio Session API" },
#endif
#if defined(__linux)
{ "pulse", "PulseAudio" },
#endif
{ "sdl", "SDL Audio" }
};
// MARK: - Helpers
std::string GetWindowButtonText(const char* text, bool menuOpen) {
char buttonText[100] = "";
if (menuOpen) {
strcat(buttonText, ICON_FA_CHEVRON_RIGHT " ");
}
strcat(buttonText, text);
if (!menuOpen) { strcat(buttonText, " "); }
return buttonText;
}
// MARK: - Delegates
std::shared_ptr<SohMenuBar> mSohMenuBar;
std::shared_ptr<LUS::GuiWindow> mConsoleWindow;
std::shared_ptr<LUS::GuiWindow> mStatsWindow;
std::shared_ptr<LUS::GuiWindow> mInputEditorWindow;
std::shared_ptr<AudioEditor> mAudioEditorWindow;
std::shared_ptr<InputViewer> mInputViewer;
std::shared_ptr<InputViewerSettingsWindow> mInputViewerSettings;
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
std::shared_ptr<CosmeticsEditorWindow> mCosmeticsEditorWindow;
std::shared_ptr<ActorViewerWindow> mActorViewerWindow;
std::shared_ptr<ColViewerWindow> mColViewerWindow;
std::shared_ptr<SaveEditorWindow> mSaveEditorWindow;
std::shared_ptr<DLViewerWindow> mDLViewerWindow;
2023-09-17 00:20:13 -04:00
std::shared_ptr<ValueViewerWindow> mValueViewerWindow;
std::shared_ptr<MessageViewer> mMessageViewerWindow;
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
std::shared_ptr<GameplayStatsWindow> mGameplayStatsWindow;
std::shared_ptr<CheckTracker::CheckTrackerSettingsWindow> mCheckTrackerSettingsWindow;
std::shared_ptr<CheckTracker::CheckTrackerWindow> mCheckTrackerWindow;
std::shared_ptr<EntranceTrackerWindow> mEntranceTrackerWindow;
std::shared_ptr<ItemTrackerSettingsWindow> mItemTrackerSettingsWindow;
std::shared_ptr<ItemTrackerWindow> mItemTrackerWindow;
std::shared_ptr<RandomizerSettingsWindow> mRandomizerSettingsWindow;
Advanced controls for aspect ratio, resolution, and integer scaling. (#3130) * Advanced Resolution Settings first working version with most features implemented * Update advancedResolutionEditor.cpp Added auto-resizing logic for Pixel Perfect Mode. Minor fixes. * Tweaks and tidying up. Disable integer scale slider if automatic sizing is overriding it. Don't offer these UI options on Apple. Removed unused code. Updated LUS. * Update libultraship * Filenames and style fixes Filenames and folders now more closely match rest of project. Tidied newlines/comments. (SohMenuBar.cpp) Label of button changed to fit menu. (ResolutionEditor.cpp) Default window size improved. * Update libultraship (However, I still need to make the GUI controls acknowledge the new constraints.) * Update libultraship (and changed the name of some cvars) * Added constraints to the inputs. Added a fps drop warning. * Tweaks based on feedback * Update libultraship * Enabled on Apple - For currently ongoing Retina DPI troubleshooting. (Also removed the duplicated N64 Mode toggle.) * Update libultraship * Update LUS, update CVar names, small tweaks And one significant fix: Enhancement checkboxes in ResolutionEditor now default to off. * Add Additional Settings and the accursed horizontal resolution field. There's still a few bugs with it that I haven't squashed, but I need to stop for now and just commit what I've got. (This is honestly causing more problems than it solves, but i'm tired of getting questions about it.) * Resolved many of the lingering bugs with the previous commit * Horizontal Resolution field now properly acknowledges resolution bounds. * Don't show "Horiz. pixel count" field if not enforcing aspect ratio. Additionally: * Don't change settings if selecting "Custom" from preset dropdowns. * Added a missing horizontal pixel count clamp check. * Tidied up redundant behaviour. * Additional comments, and a checkbox to disable aspect correction on consoles. * Change how frame rate threshold is calculated. * More minor UI tweaks. * Added missing CVarSave() calls where needed. Added a short update countdown for the numerical CVars. This is intended to prevent CVarSave() from being called too often. * Added a helpful button to cover a potential support issue. * "Fit Automatically" has been moved to LUS and is now smarter. This will require another PR in LUS to be opened by me. * Swap to new branch for libultraship * Even more clever integer scaling behavior. "IntegerScale" is itself now a CVar group. * Tidy up comments. * Fix a typo that prevented `IsDroppingFrames()` from working (Maybe more than a mere typo, but a typo was involved.) * Remove unused and unnecessary variables. * Group "Integer Scaling" under its own collapsing header * Changed label for the Enabled advanced settings checkbox. * Update libultraship + Formatting pass on ResolutionEditor.cpp * Add `(Select "Off" to disable.)` help text for the aspect ratio setting and hide UI elements accordingly. Only show the fields if user chooses Custom. Padding has been shifted accordingly too. Also fixed a long standing error with the Y field disappearing when modifying X. * Well I suppose that's no-longer necessary. * Update libultraship with commits from main branch (up to e5df3a9) * Tweak comments. * Save current ImGui Combo items as a console variable to improve user experience. * Change language of NeverExceedBounds checkbox description to be more affirmative, so it makes more sense. Add tooltip for NeverExceedBounds checkbox. Tweak some comments related to additional settings. * Add list of colours to use with TextColored elements. * Move some UI elements around. Add an extra MSAA slider to the editor window. * Integer Scaling header is DefaultOpen if player has Pixel Perfect Mode active upon window creation. + Amend tooltips. * Fix a minor oversight with default configuration. Fixes an issue where default aspect ratio settings on a fresh SoH configuration weren't matching the defaults assigned in libultraship. The default values are now 16:9, matching LUS. Additionally, the combo box now defaults specifically to the 16:9 preset instead of "Custom". (Fixing the defaults in LUS to be 4:3 isn't worth a LUS bump, so this slight workaround will do for the sake of this PR.) * Make resolution slider `disabled` condition a variable, for readability. * Small tweak to combo item saving * Use `SCREEN_HEIGHT` and `SCREEN_WIDTH` for constraints * Simplify "Show a horizontal resolution field" logic by using pixel dimensions as the aspect ratio directly, since now this view hides the aspect ratio setting from the user anyway. * Correct aspect ratio visualiser to be un-inverted + actually display it as a ratio. * Remove update flags from combo boxes + remove update countdown + remove non-functioning 'IsBoolArrayTrue' function. (The countdown was an okay idea but I didn't implement it correctly. It's better to just keep it simple.) * Code review suggestion: disable UI elements conditionally (+ tweaks to code style) * Invisible tweaks to the Integer Scaling-related Additional Settings This looks like a lot but it's mostly just re-arranging a cluttered area of the code for clarity. Actual changes to functionality are: * Help text now "disabled" along with the checkbox. * The NeverExceedBounds checkbox will now reset the unused ExceedBoundsBy cvar if it's been changed. * Assorted small tweaks to comments and variable declarations. * Code review suggestion: tweak "Window exceeded" warning condition * Missed a thingy.
2023-12-23 16:19:41 -05:00
std::shared_ptr<AdvancedResolutionSettings::AdvancedResolutionSettingsWindow> mAdvancedResolutionSettingsWindow;
std::shared_ptr<SohModalWindow> mModalWindow;
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
void SetupGuiElements() {
auto gui = LUS::Context::GetInstance()->GetWindow()->GetGui();
mSohMenuBar = std::make_shared<SohMenuBar>("gOpenMenuBar", CVarGetInteger("gOpenMenuBar", 0));
gui->SetMenuBar(std::reinterpret_pointer_cast<LUS::GuiMenuBar>(mSohMenuBar));
if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) {
#if defined(__SWITCH__) || defined(__WIIU__)
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press - to access enhancements menu");
#else
gui->GetGameOverlay()->TextDrawNotification(30.0f, true, "Press F1 to access enhancements menu");
#endif
}
mStatsWindow = gui->GetGuiWindow("Stats");
if (mStatsWindow == nullptr) {
SPDLOG_ERROR("Could not find stats window");
}
mConsoleWindow = gui->GetGuiWindow("Console");
if (mConsoleWindow == nullptr) {
SPDLOG_ERROR("Could not find console window");
}
mInputEditorWindow = gui->GetGuiWindow("Input Editor");
if (mInputEditorWindow == nullptr) {
SPDLOG_ERROR("Could not find input editor window");
}
mAudioEditorWindow = std::make_shared<AudioEditor>("gAudioEditor.WindowOpen", "Audio Editor");
gui->AddGuiWindow(mAudioEditorWindow);
mInputViewer = std::make_shared<InputViewer>("gOpenWindows.InputViewer", "Input Viewer");
gui->AddGuiWindow(mInputViewer);
mInputViewerSettings = std::make_shared<InputViewerSettingsWindow>("gOpenWindows.InputViewerSettings", "Input Viewer Settings");
gui->AddGuiWindow(mInputViewerSettings);
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
mCosmeticsEditorWindow = std::make_shared<CosmeticsEditorWindow>("gCosmeticsEditorEnabled", "Cosmetics Editor");
gui->AddGuiWindow(mCosmeticsEditorWindow);
mActorViewerWindow = std::make_shared<ActorViewerWindow>("gActorViewerEnabled", "Actor Viewer");
gui->AddGuiWindow(mActorViewerWindow);
mColViewerWindow = std::make_shared<ColViewerWindow>("gCollisionViewerEnabled", "Collision Viewer");
gui->AddGuiWindow(mColViewerWindow);
mSaveEditorWindow = std::make_shared<SaveEditorWindow>("gSaveEditorEnabled", "Save Editor");
gui->AddGuiWindow(mSaveEditorWindow);
mDLViewerWindow = std::make_shared<DLViewerWindow>("gDLViewerEnabled", "Display List Viewer");
gui->AddGuiWindow(mDLViewerWindow);
2023-09-17 00:20:13 -04:00
mValueViewerWindow = std::make_shared<ValueViewerWindow>("gValueViewer.WindowOpen", "Value Viewer");
gui->AddGuiWindow(mValueViewerWindow);
mMessageViewerWindow = std::make_shared<MessageViewer>("gMessageViewerEnabled", "Message Viewer");
gui->AddGuiWindow(mMessageViewerWindow);
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
mGameplayStatsWindow = std::make_shared<GameplayStatsWindow>("gGameplayStatsEnabled", "Gameplay Stats");
gui->AddGuiWindow(mGameplayStatsWindow);
mCheckTrackerWindow = std::make_shared<CheckTracker::CheckTrackerWindow>("gCheckTrackerEnabled", "Check Tracker");
gui->AddGuiWindow(mCheckTrackerWindow);
mCheckTrackerSettingsWindow = std::make_shared<CheckTracker::CheckTrackerSettingsWindow>("gCheckTrackerSettingsEnabled", "Check Tracker Settings");
gui->AddGuiWindow(mCheckTrackerSettingsWindow);
mEntranceTrackerWindow = std::make_shared<EntranceTrackerWindow>("gEntranceTrackerEnabled","Entrance Tracker");
gui->AddGuiWindow(mEntranceTrackerWindow);
mItemTrackerWindow = std::make_shared<ItemTrackerWindow>("gItemTrackerEnabled", "Item Tracker");
gui->AddGuiWindow(mItemTrackerWindow);
mItemTrackerSettingsWindow = std::make_shared<ItemTrackerSettingsWindow>("gItemTrackerSettingsEnabled", "Item Tracker Settings");
gui->AddGuiWindow(mItemTrackerSettingsWindow);
mRandomizerSettingsWindow = std::make_shared<RandomizerSettingsWindow>("gRandomizerSettingsEnabled", "Randomizer Settings");
gui->AddGuiWindow(mRandomizerSettingsWindow);
Advanced controls for aspect ratio, resolution, and integer scaling. (#3130) * Advanced Resolution Settings first working version with most features implemented * Update advancedResolutionEditor.cpp Added auto-resizing logic for Pixel Perfect Mode. Minor fixes. * Tweaks and tidying up. Disable integer scale slider if automatic sizing is overriding it. Don't offer these UI options on Apple. Removed unused code. Updated LUS. * Update libultraship * Filenames and style fixes Filenames and folders now more closely match rest of project. Tidied newlines/comments. (SohMenuBar.cpp) Label of button changed to fit menu. (ResolutionEditor.cpp) Default window size improved. * Update libultraship (However, I still need to make the GUI controls acknowledge the new constraints.) * Update libultraship (and changed the name of some cvars) * Added constraints to the inputs. Added a fps drop warning. * Tweaks based on feedback * Update libultraship * Enabled on Apple - For currently ongoing Retina DPI troubleshooting. (Also removed the duplicated N64 Mode toggle.) * Update libultraship * Update LUS, update CVar names, small tweaks And one significant fix: Enhancement checkboxes in ResolutionEditor now default to off. * Add Additional Settings and the accursed horizontal resolution field. There's still a few bugs with it that I haven't squashed, but I need to stop for now and just commit what I've got. (This is honestly causing more problems than it solves, but i'm tired of getting questions about it.) * Resolved many of the lingering bugs with the previous commit * Horizontal Resolution field now properly acknowledges resolution bounds. * Don't show "Horiz. pixel count" field if not enforcing aspect ratio. Additionally: * Don't change settings if selecting "Custom" from preset dropdowns. * Added a missing horizontal pixel count clamp check. * Tidied up redundant behaviour. * Additional comments, and a checkbox to disable aspect correction on consoles. * Change how frame rate threshold is calculated. * More minor UI tweaks. * Added missing CVarSave() calls where needed. Added a short update countdown for the numerical CVars. This is intended to prevent CVarSave() from being called too often. * Added a helpful button to cover a potential support issue. * "Fit Automatically" has been moved to LUS and is now smarter. This will require another PR in LUS to be opened by me. * Swap to new branch for libultraship * Even more clever integer scaling behavior. "IntegerScale" is itself now a CVar group. * Tidy up comments. * Fix a typo that prevented `IsDroppingFrames()` from working (Maybe more than a mere typo, but a typo was involved.) * Remove unused and unnecessary variables. * Group "Integer Scaling" under its own collapsing header * Changed label for the Enabled advanced settings checkbox. * Update libultraship + Formatting pass on ResolutionEditor.cpp * Add `(Select "Off" to disable.)` help text for the aspect ratio setting and hide UI elements accordingly. Only show the fields if user chooses Custom. Padding has been shifted accordingly too. Also fixed a long standing error with the Y field disappearing when modifying X. * Well I suppose that's no-longer necessary. * Update libultraship with commits from main branch (up to e5df3a9) * Tweak comments. * Save current ImGui Combo items as a console variable to improve user experience. * Change language of NeverExceedBounds checkbox description to be more affirmative, so it makes more sense. Add tooltip for NeverExceedBounds checkbox. Tweak some comments related to additional settings. * Add list of colours to use with TextColored elements. * Move some UI elements around. Add an extra MSAA slider to the editor window. * Integer Scaling header is DefaultOpen if player has Pixel Perfect Mode active upon window creation. + Amend tooltips. * Fix a minor oversight with default configuration. Fixes an issue where default aspect ratio settings on a fresh SoH configuration weren't matching the defaults assigned in libultraship. The default values are now 16:9, matching LUS. Additionally, the combo box now defaults specifically to the 16:9 preset instead of "Custom". (Fixing the defaults in LUS to be 4:3 isn't worth a LUS bump, so this slight workaround will do for the sake of this PR.) * Make resolution slider `disabled` condition a variable, for readability. * Small tweak to combo item saving * Use `SCREEN_HEIGHT` and `SCREEN_WIDTH` for constraints * Simplify "Show a horizontal resolution field" logic by using pixel dimensions as the aspect ratio directly, since now this view hides the aspect ratio setting from the user anyway. * Correct aspect ratio visualiser to be un-inverted + actually display it as a ratio. * Remove update flags from combo boxes + remove update countdown + remove non-functioning 'IsBoolArrayTrue' function. (The countdown was an okay idea but I didn't implement it correctly. It's better to just keep it simple.) * Code review suggestion: disable UI elements conditionally (+ tweaks to code style) * Invisible tweaks to the Integer Scaling-related Additional Settings This looks like a lot but it's mostly just re-arranging a cluttered area of the code for clarity. Actual changes to functionality are: * Help text now "disabled" along with the checkbox. * The NeverExceedBounds checkbox will now reset the unused ExceedBoundsBy cvar if it's been changed. * Assorted small tweaks to comments and variable declarations. * Code review suggestion: tweak "Window exceeded" warning condition * Missed a thingy.
2023-12-23 16:19:41 -05:00
mAdvancedResolutionSettingsWindow = std::make_shared<AdvancedResolutionSettings::AdvancedResolutionSettingsWindow>("gAdvancedResolutionEditorEnabled", "Advanced Resolution Settings");
gui->AddGuiWindow(mAdvancedResolutionSettingsWindow);
mModalWindow = std::make_shared<SohModalWindow>("gOpenWindows.modalWindowEnabled", "Modal Window");
gui->AddGuiWindow(mModalWindow);
mModalWindow->Show();
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
}
void Destroy() {
mModalWindow = nullptr;
Advanced controls for aspect ratio, resolution, and integer scaling. (#3130) * Advanced Resolution Settings first working version with most features implemented * Update advancedResolutionEditor.cpp Added auto-resizing logic for Pixel Perfect Mode. Minor fixes. * Tweaks and tidying up. Disable integer scale slider if automatic sizing is overriding it. Don't offer these UI options on Apple. Removed unused code. Updated LUS. * Update libultraship * Filenames and style fixes Filenames and folders now more closely match rest of project. Tidied newlines/comments. (SohMenuBar.cpp) Label of button changed to fit menu. (ResolutionEditor.cpp) Default window size improved. * Update libultraship (However, I still need to make the GUI controls acknowledge the new constraints.) * Update libultraship (and changed the name of some cvars) * Added constraints to the inputs. Added a fps drop warning. * Tweaks based on feedback * Update libultraship * Enabled on Apple - For currently ongoing Retina DPI troubleshooting. (Also removed the duplicated N64 Mode toggle.) * Update libultraship * Update LUS, update CVar names, small tweaks And one significant fix: Enhancement checkboxes in ResolutionEditor now default to off. * Add Additional Settings and the accursed horizontal resolution field. There's still a few bugs with it that I haven't squashed, but I need to stop for now and just commit what I've got. (This is honestly causing more problems than it solves, but i'm tired of getting questions about it.) * Resolved many of the lingering bugs with the previous commit * Horizontal Resolution field now properly acknowledges resolution bounds. * Don't show "Horiz. pixel count" field if not enforcing aspect ratio. Additionally: * Don't change settings if selecting "Custom" from preset dropdowns. * Added a missing horizontal pixel count clamp check. * Tidied up redundant behaviour. * Additional comments, and a checkbox to disable aspect correction on consoles. * Change how frame rate threshold is calculated. * More minor UI tweaks. * Added missing CVarSave() calls where needed. Added a short update countdown for the numerical CVars. This is intended to prevent CVarSave() from being called too often. * Added a helpful button to cover a potential support issue. * "Fit Automatically" has been moved to LUS and is now smarter. This will require another PR in LUS to be opened by me. * Swap to new branch for libultraship * Even more clever integer scaling behavior. "IntegerScale" is itself now a CVar group. * Tidy up comments. * Fix a typo that prevented `IsDroppingFrames()` from working (Maybe more than a mere typo, but a typo was involved.) * Remove unused and unnecessary variables. * Group "Integer Scaling" under its own collapsing header * Changed label for the Enabled advanced settings checkbox. * Update libultraship + Formatting pass on ResolutionEditor.cpp * Add `(Select "Off" to disable.)` help text for the aspect ratio setting and hide UI elements accordingly. Only show the fields if user chooses Custom. Padding has been shifted accordingly too. Also fixed a long standing error with the Y field disappearing when modifying X. * Well I suppose that's no-longer necessary. * Update libultraship with commits from main branch (up to e5df3a9) * Tweak comments. * Save current ImGui Combo items as a console variable to improve user experience. * Change language of NeverExceedBounds checkbox description to be more affirmative, so it makes more sense. Add tooltip for NeverExceedBounds checkbox. Tweak some comments related to additional settings. * Add list of colours to use with TextColored elements. * Move some UI elements around. Add an extra MSAA slider to the editor window. * Integer Scaling header is DefaultOpen if player has Pixel Perfect Mode active upon window creation. + Amend tooltips. * Fix a minor oversight with default configuration. Fixes an issue where default aspect ratio settings on a fresh SoH configuration weren't matching the defaults assigned in libultraship. The default values are now 16:9, matching LUS. Additionally, the combo box now defaults specifically to the 16:9 preset instead of "Custom". (Fixing the defaults in LUS to be 4:3 isn't worth a LUS bump, so this slight workaround will do for the sake of this PR.) * Make resolution slider `disabled` condition a variable, for readability. * Small tweak to combo item saving * Use `SCREEN_HEIGHT` and `SCREEN_WIDTH` for constraints * Simplify "Show a horizontal resolution field" logic by using pixel dimensions as the aspect ratio directly, since now this view hides the aspect ratio setting from the user anyway. * Correct aspect ratio visualiser to be un-inverted + actually display it as a ratio. * Remove update flags from combo boxes + remove update countdown + remove non-functioning 'IsBoolArrayTrue' function. (The countdown was an okay idea but I didn't implement it correctly. It's better to just keep it simple.) * Code review suggestion: disable UI elements conditionally (+ tweaks to code style) * Invisible tweaks to the Integer Scaling-related Additional Settings This looks like a lot but it's mostly just re-arranging a cluttered area of the code for clarity. Actual changes to functionality are: * Help text now "disabled" along with the checkbox. * The NeverExceedBounds checkbox will now reset the unused ExceedBoundsBy cvar if it's been changed. * Assorted small tweaks to comments and variable declarations. * Code review suggestion: tweak "Window exceeded" warning condition * Missed a thingy.
2023-12-23 16:19:41 -05:00
mAdvancedResolutionSettingsWindow = nullptr;
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
mRandomizerSettingsWindow = nullptr;
mItemTrackerWindow = nullptr;
mItemTrackerSettingsWindow = nullptr;
mEntranceTrackerWindow = nullptr;
mCheckTrackerWindow = nullptr;
mCheckTrackerSettingsWindow = nullptr;
mGameplayStatsWindow = nullptr;
mDLViewerWindow = nullptr;
2023-09-17 00:20:13 -04:00
mValueViewerWindow = nullptr;
mMessageViewerWindow = nullptr;
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
mSaveEditorWindow = nullptr;
mColViewerWindow = nullptr;
mActorViewerWindow = nullptr;
mCosmeticsEditorWindow = nullptr;
mAudioEditorWindow = nullptr;
mInputEditorWindow = nullptr;
mStatsWindow = nullptr;
mConsoleWindow = nullptr;
mSohMenuBar = nullptr;
mInputViewer = nullptr;
mInputViewerSettings = nullptr;
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
}
void RegisterPopup(std::string title, std::string message, std::string button1, std::string button2, std::function<void()> button1callback, std::function<void()> button2callback) {
mModalWindow->RegisterPopup(title, message, button1, button2, button1callback, button2callback);
}
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
}