diff options
| author | coco875 <59367621+coco875@users.noreply.github.com> | 2025-06-19 22:26:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-19 16:26:04 -0600 |
| commit | 5d7cf20c83bf49e6b27f07684535727506526012 (patch) | |
| tree | d5a02b39520ff255f4b1ffc557be5026d481427c /src/port/ui/ImguiUI.cpp | |
| parent | 602141fb11e2614583caa23b250ca115ce451c99 (diff) | |
pr Code 80005fd0 (#181)
* fix error
* a lot of change
* basic rename of local variable
* continue rename and improve Enhancements
* re-apply change
* revert the remove of dma_texture and fix mtxf_multiplication
* more documentation port
* some fix
* more fix
* fix arround
* Update torch
* fix spelling
---------
Co-authored-by: MegaMech <MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/port/ui/ImguiUI.cpp')
| -rw-r--r-- | src/port/ui/ImguiUI.cpp | 611 |
1 files changed, 310 insertions, 301 deletions
diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 237e8d27f..8cbd5e54e 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -21,10 +21,10 @@ #include "PortMenu.h" extern "C" { - extern s32 gGamestateNext; - extern s32 gMenuSelection; - #include "audio/external.h" - #include "defines.h" +extern s32 gGamestateNext; +extern s32 gMenuSelection; +#include "audio/external.h" +#include "defines.h" } namespace GameUI { @@ -128,294 +128,308 @@ static const char* filters[3] = { }; void DrawSettingsMenu() { -// if (UIWidgets::BeginMenu("Settings")) { -// if (UIWidgets::BeginMenu("Audio")) { -// UIWidgets::CVarSliderFloat("Master Volume", "gGameMasterVolume", 0.0f, 1.0f, 1.0f, { -// .format = "%.0f%%", -// .isPercentage = true, -// }); -// if (UIWidgets::CVarSliderFloat("Main Music Volume", "gMainMusicVolume", 0.0f, 1.0f, 1.0f, -// { -// .format = "%.0f%%", -// .isPercentage = true, -// })) { -// audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f)); -// } -// if (UIWidgets::CVarSliderFloat("Sound Effects Volume", "gSFXMusicVolume", -// 0.0f, 1.0f, 1.0f, { -// .format = "%.0f%%", -// .isPercentage = true, -// })) { -// audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f)); -// } -// if (UIWidgets::CVarSliderFloat("Environment Volume", "gEnvironmentVolume", -// 0.0f, 1.0f, 1.0f, { -// .format = "%.0f%%", -// .isPercentage = true, -// })) { -// audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f)); -// } -// -// static std::unordered_map<Ship::AudioBackend, const char*> audioBackendNames = { -// { Ship::AudioBackend::WASAPI, "Windows Audio Session API" }, -// { Ship::AudioBackend::SDL, "SDL" }, -// }; -// -// ImGui::Text("Audio API (Needs reload)"); -// auto currentAudioBackend = Ship::Context::GetInstance()->GetAudio()->GetCurrentAudioBackend(); -// -// if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { -// UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); -// } -// if (ImGui::BeginCombo("##AApi", audioBackendNames[currentAudioBackend])) { -// for (uint8_t i = 0; i < -// Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) { -// auto backend = Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i]; -// if (ImGui::Selectable(audioBackendNames[backend], backend == currentAudioBackend)) { -// Ship::Context::GetInstance()->GetAudio()->SetCurrentAudioBackend(backend); -// } -// } -// ImGui::EndCombo(); -// } -// if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { -// UIWidgets::ReEnableComponent(""); -// } -// -// ImGui::EndMenu(); -// } -// -// UIWidgets::Spacer(0); -// -// if (UIWidgets::BeginMenu("Controller")) { -// UIWidgets::WindowButton("Controller Mapping", "gInputEditorWindow", GameUI::mInputEditorWindow); -// -// UIWidgets::Spacer(0); -// -//#ifndef __SWITCH__ -// UIWidgets::CVarCheckbox( -// "Menubar Controller Navigation", "gControlNav", -// { .tooltip = "Allows controller navigation of the SOH menu bar (Settings, Enhancements,...)\nCAUTION: " -// "This will disable game inputs while the menubar is visible.\n\nD-pad to move between " -// "items, A to select, and X to grab focus on the menu bar" }); -//#endif -// UIWidgets::CVarCheckbox("Show Inputs", "gInputEnabled", -// { .tooltip = "Shows currently pressed inputs on the bottom right of the screen" }); -// if (CVarGetInteger("gInputEnabled", 0)) { -// UIWidgets::CVarSliderFloat( -// "Input Scale", "gInputScale", 1.0f, 3.0f, 1.0f, -// { -// .tooltip = "Sets the on screen size of the displayed inputs from the Show Inputs setting", -// .format = "%.1fx", -// }); -// } -// -// ImGui::EndMenu(); -// } -// -// ImGui::EndMenu(); -// } -// -// ImGui::SetCursorPosY(0.0f); -// if (UIWidgets::BeginMenu("Graphics")) { -// UIWidgets::WindowButton("Resolution Editor", "gAdvancedResolutionEditorEnabled", -// GameUI::mAdvancedResolutionSettingsWindow); -// -// UIWidgets::Spacer(0); -// -// // Previously was running every frame, and nothing was setting it? Maybe a bad copy/paste? -// // Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); -// // UIWidgets::Tooltip("Multiplies your output resolution by the value inputted, as a more intensive but -// // effective form of anti-aliasing"); -//#ifndef __WIIU__ -// if (UIWidgets::CVarSliderInt( -// "MSAA: %d", "gMSAAValue", 1, 8, 1, -// { .tooltip = -// "Activates multi-sample anti-aliasing when above 1x up to 8x for 8 samples for every pixel" })) { -// Ship::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); -// } -//#endif -// -// { // FPS Slider -// const int minFps = 30; -// static int maxFps; -// if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == -// Ship::WindowBackend::FAST3D_DXGI_DX11) { -// maxFps = 360; -// } else { -// maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); -// } -// int currentFps = 0; -//#ifdef __WIIU__ -// UIWidgets::Spacer(0); -// // only support divisors of 60 on the Wii U -// if (currentFps > 60) { -// currentFps = 60; -// } else { -// currentFps = 60 / (60 / currentFps); -// } -// -// int fpsSlider = 1; -// if (currentFps == 30) { -// ImGui::Text("FPS: Original (30)"); -// } else { -// ImGui::Text("FPS: %d", currentFps); -// if (currentFps == 30) { -// fpsSlider = 2; -// } else { // currentFps == 60 -// fpsSlider = 3; -// } -// } -// if (CVarGetInteger("gMatchRefreshRate", 0)) { -// UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); -// } -// -// if (ImGui::Button(" - ##WiiUFPS")) { -// fpsSlider--; -// } -// ImGui::SameLine(); -// ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); -// -// UIWidgets::Spacer(0); -// -// ImGui::PushItemWidth(std::min((ImGui::GetContentRegionAvail().x - 60.0f), 260.0f)); -// ImGui::SliderInt("##WiiUFPSSlider", &fpsSlider, 1, 3, "", ImGuiSliderFlags_AlwaysClamp); -// ImGui::PopItemWidth(); -// -// ImGui::SameLine(); -// ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); -// if (ImGui::Button(" + ##WiiUFPS")) { -// fpsSlider++; -// } -// -// if (CVarGetInteger("gMatchRefreshRate", 0)) { -// UIWidgets::ReEnableComponent(""); -// } -// if (fpsSlider > 3) { -// fpsSlider = 3; -// } else if (fpsSlider < 1) { -// fpsSlider = 1; -// } -// -// if (fpsSlider == 1) { -// currentFps = 20; -// } else if (fpsSlider == 2) { -// currentFps = 30; -// } else if (fpsSlider == 3) { -// currentFps = 60; -// } -// CVarSetInteger("gInterpolationFPS", currentFps); -// Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); -//#else -// bool matchingRefreshRate = -// CVarGetInteger("gMatchRefreshRate", 0) && -// Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::FAST3D_DXGI_DX11; -// UIWidgets::CVarSliderInt((currentFps == 20) ? "FPS: Original (20)" : "FPS: %d", "gInterpolationFPS", minFps, -// maxFps, 1, { .disabled = matchingRefreshRate }); -//#endif -// if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == -// Ship::WindowBackend::FAST3D_DXGI_DX11) { -// UIWidgets::Tooltip( -// "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. " -// "This is purely " -// "visual and does not impact game logic, execution of glitches etc.\n\n" -// "A higher target FPS than your monitor's refresh rate will waste resources, and might give a worse " -// "result."); -// } else { -// UIWidgets::Tooltip( -// "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " -// "visual and does not impact game logic, execution of glitches etc."); -// } -// } // END FPS Slider -// -// if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { -// UIWidgets::Spacer(0); -// if (ImGui::Button("Match Refresh Rate")) { -// int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); -// if (hz >= 30 && hz <= 360) { -// CVarSetInteger("gInterpolationFPS", hz); -// Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); -// } -// } -// } else { -// UIWidgets::PaddedEnhancementCheckbox("Match Refresh Rate", "gMatchRefreshRate", true, false); -// } -// -// UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate"); -// -// if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { -// UIWidgets::PaddedEnhancementSliderInt( -// CVarGetInteger("gExtraLatencyThreshold", 0) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS", -// "##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 0, true, true, false); -// UIWidgets::Tooltip("When Interpolation FPS setting is at least this threshold, add one frame of input lag " -// "(e.g. 16.6 ms for 60 FPS) in order to avoid jitter. This setting allows the CPU to " -// "work on one frame while GPU works on the previous frame.\nThis setting should be used " -// "when your computer is too slow to do CPU + GPU work in time."); -// } -// -// UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); -// -// static std::unordered_map<Ship::WindowBackend, const char*> windowBackendNames = { -// { Ship::WindowBackend::FAST3D_DXGI_DX11, "DirectX" }, -// { Ship::WindowBackend::FAST3D_SDL_OPENGL, "OpenGL" }, -// { Ship::WindowBackend::FAST3D_SDL_METAL, "Metal" }, -// }; -// -// ImGui::Text("Renderer API (Needs reload)"); -// Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend(); -// Ship::WindowBackend configWindowBackend; -// int configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1); -// if (Ship::Context::GetInstance()->GetWindow()->IsAvailableWindowBackend(configWindowBackendId)) { -// configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId); -// } else { -// configWindowBackend = runningWindowBackend; -// } -// -// if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { -// UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); -// } -// if (ImGui::BeginCombo("##RApi", windowBackendNames[configWindowBackend])) { -// for (size_t i = 0; i < Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); -// i++) { -// auto backend = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->data()[i]; -// if (ImGui::Selectable(windowBackendNames[backend], backend == configWindowBackend)) { -// Ship::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", static_cast<int>(backend)); -// Ship::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name", -// windowBackendNames[backend]); -// Ship::Context::GetInstance()->GetConfig()->Save(); -// } -// } -// ImGui::EndCombo(); -// } -// if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { -// UIWidgets::ReEnableComponent(""); -// } -// -// if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) { -// UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false); -// } -// -// if (Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) { -// UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false); -// } -// -// if (Ship::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports()) { -// UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false, false, "", -// UIWidgets::CheckboxGraphics::Cross, true); -// UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a reload " -// "to take effect."); -// } -// -// // If more filters are added to LUS, make sure to add them to the filters list here -// ImGui::Text("Texture Filter (Needs reload)"); -// -// UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0); -// -// UIWidgets::Spacer(0); -// -// Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->DrawSettings(); -// -// ImGui::EndMenu(); -// } + // if (UIWidgets::BeginMenu("Settings")) { + // if (UIWidgets::BeginMenu("Audio")) { + // UIWidgets::CVarSliderFloat("Master Volume", "gGameMasterVolume", 0.0f, 1.0f, 1.0f, { + // .format = "%.0f%%", + // .isPercentage = true, + // }); + // if (UIWidgets::CVarSliderFloat("Main Music Volume", "gMainMusicVolume", 0.0f, 1.0f, 1.0f, + // { + // .format = "%.0f%%", + // .isPercentage = true, + // })) { + // audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f)); + // } + // if (UIWidgets::CVarSliderFloat("Sound Effects Volume", "gSFXMusicVolume", + // 0.0f, 1.0f, 1.0f, { + // .format = "%.0f%%", + // .isPercentage = true, + // })) { + // audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f)); + // } + // if (UIWidgets::CVarSliderFloat("Environment Volume", "gEnvironmentVolume", + // 0.0f, 1.0f, 1.0f, { + // .format = "%.0f%%", + // .isPercentage = true, + // })) { + // audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f)); + // } + // + // static std::unordered_map<Ship::AudioBackend, const char*> audioBackendNames = { + // { Ship::AudioBackend::WASAPI, "Windows Audio Session API" }, + // { Ship::AudioBackend::SDL, "SDL" }, + // }; + // + // ImGui::Text("Audio API (Needs reload)"); + // auto currentAudioBackend = Ship::Context::GetInstance()->GetAudio()->GetCurrentAudioBackend(); + // + // if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { + // UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); + // } + // if (ImGui::BeginCombo("##AApi", audioBackendNames[currentAudioBackend])) { + // for (uint8_t i = 0; i < + // Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) { + // auto backend = + // Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i]; if + // (ImGui::Selectable(audioBackendNames[backend], backend == currentAudioBackend)) { + // Ship::Context::GetInstance()->GetAudio()->SetCurrentAudioBackend(backend); + // } + // } + // ImGui::EndCombo(); + // } + // if (Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size() <= 1) { + // UIWidgets::ReEnableComponent(""); + // } + // + // ImGui::EndMenu(); + // } + // + // UIWidgets::Spacer(0); + // + // if (UIWidgets::BeginMenu("Controller")) { + // UIWidgets::WindowButton("Controller Mapping", "gInputEditorWindow", GameUI::mInputEditorWindow); + // + // UIWidgets::Spacer(0); + // + // #ifndef __SWITCH__ + // UIWidgets::CVarCheckbox( + // "Menubar Controller Navigation", "gControlNav", + // { .tooltip = "Allows controller navigation of the SOH menu bar (Settings, + // Enhancements,...)\nCAUTION: " + // "This will disable game inputs while the menubar is visible.\n\nD-pad to move between + // " "items, A to select, and X to grab focus on the menu bar" }); + // #endif + // UIWidgets::CVarCheckbox("Show Inputs", "gInputEnabled", + // { .tooltip = "Shows currently pressed inputs on the bottom right of the + // screen" }); + // if (CVarGetInteger("gInputEnabled", 0)) { + // UIWidgets::CVarSliderFloat( + // "Input Scale", "gInputScale", 1.0f, 3.0f, 1.0f, + // { + // .tooltip = "Sets the on screen size of the displayed inputs from the Show Inputs setting", + // .format = "%.1fx", + // }); + // } + // + // ImGui::EndMenu(); + // } + // + // ImGui::EndMenu(); + // } + // + // ImGui::SetCursorPosY(0.0f); + // if (UIWidgets::BeginMenu("Graphics")) { + // UIWidgets::WindowButton("Resolution Editor", "gAdvancedResolutionEditorEnabled", + // GameUI::mAdvancedResolutionSettingsWindow); + // + // UIWidgets::Spacer(0); + // + // // Previously was running every frame, and nothing was setting it? Maybe a bad copy/paste? + // // Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", + // 1)); + // // UIWidgets::Tooltip("Multiplies your output resolution by the value inputted, as a more intensive but + // // effective form of anti-aliasing"); + // #ifndef __WIIU__ + // if (UIWidgets::CVarSliderInt( + // "MSAA: %d", "gMSAAValue", 1, 8, 1, + // { .tooltip = + // "Activates multi-sample anti-aliasing when above 1x up to 8x for 8 samples for every pixel" + // })) { + // Ship::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); + // } + // #endif + // + // { // FPS Slider + // const int minFps = 30; + // static int maxFps; + // if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == + // Ship::WindowBackend::FAST3D_DXGI_DX11) { + // maxFps = 360; + // } else { + // maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); + // } + // int currentFps = 0; + // #ifdef __WIIU__ + // UIWidgets::Spacer(0); + // // only support divisors of 60 on the Wii U + // if (currentFps > 60) { + // currentFps = 60; + // } else { + // currentFps = 60 / (60 / currentFps); + // } + // + // int fpsSlider = 1; + // if (currentFps == 30) { + // ImGui::Text("FPS: Original (30)"); + // } else { + // ImGui::Text("FPS: %d", currentFps); + // if (currentFps == 30) { + // fpsSlider = 2; + // } else { // currentFps == 60 + // fpsSlider = 3; + // } + // } + // if (CVarGetInteger("gMatchRefreshRate", 0)) { + // UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); + // } + // + // if (ImGui::Button(" - ##WiiUFPS")) { + // fpsSlider--; + // } + // ImGui::SameLine(); + // ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + // + // UIWidgets::Spacer(0); + // + // ImGui::PushItemWidth(std::min((ImGui::GetContentRegionAvail().x - 60.0f), 260.0f)); + // ImGui::SliderInt("##WiiUFPSSlider", &fpsSlider, 1, 3, "", ImGuiSliderFlags_AlwaysClamp); + // ImGui::PopItemWidth(); + // + // ImGui::SameLine(); + // ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + // if (ImGui::Button(" + ##WiiUFPS")) { + // fpsSlider++; + // } + // + // if (CVarGetInteger("gMatchRefreshRate", 0)) { + // UIWidgets::ReEnableComponent(""); + // } + // if (fpsSlider > 3) { + // fpsSlider = 3; + // } else if (fpsSlider < 1) { + // fpsSlider = 1; + // } + // + // if (fpsSlider == 1) { + // currentFps = 20; + // } else if (fpsSlider == 2) { + // currentFps = 30; + // } else if (fpsSlider == 3) { + // currentFps = 60; + // } + // CVarSetInteger("gInterpolationFPS", currentFps); + // Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + // #else + // bool matchingRefreshRate = + // CVarGetInteger("gMatchRefreshRate", 0) && + // Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != + // Ship::WindowBackend::FAST3D_DXGI_DX11; + // UIWidgets::CVarSliderInt((currentFps == 20) ? "FPS: Original (20)" : "FPS: %d", "gInterpolationFPS", + // minFps, + // maxFps, 1, { .disabled = matchingRefreshRate }); + // #endif + // if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == + // Ship::WindowBackend::FAST3D_DXGI_DX11) { + // UIWidgets::Tooltip( + // "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. " + // "This is purely " + // "visual and does not impact game logic, execution of glitches etc.\n\n" + // "A higher target FPS than your monitor's refresh rate will waste resources, and might give a + // worse " "result."); + // } else { + // UIWidgets::Tooltip( + // "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is + // purely " "visual and does not impact game logic, execution of glitches etc."); + // } + // } // END FPS Slider + // + // if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == + // Ship::WindowBackend::FAST3D_DXGI_DX11) { + // UIWidgets::Spacer(0); + // if (ImGui::Button("Match Refresh Rate")) { + // int hz = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); + // if (hz >= 30 && hz <= 360) { + // CVarSetInteger("gInterpolationFPS", hz); + // Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + // } + // } + // } else { + // UIWidgets::PaddedEnhancementCheckbox("Match Refresh Rate", "gMatchRefreshRate", true, false); + // } + // + // UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate"); + // + // if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == + // Ship::WindowBackend::FAST3D_DXGI_DX11) { + // UIWidgets::PaddedEnhancementSliderInt( + // CVarGetInteger("gExtraLatencyThreshold", 0) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS", + // "##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 0, true, true, false); + // UIWidgets::Tooltip("When Interpolation FPS setting is at least this threshold, add one frame of input + // lag " + // "(e.g. 16.6 ms for 60 FPS) in order to avoid jitter. This setting allows the CPU to + // " "work on one frame while GPU works on the previous frame.\nThis setting should be + // used " "when your computer is too slow to do CPU + GPU work in time."); + // } + // + // UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); + // + // static std::unordered_map<Ship::WindowBackend, const char*> windowBackendNames = { + // { Ship::WindowBackend::FAST3D_DXGI_DX11, "DirectX" }, + // { Ship::WindowBackend::FAST3D_SDL_OPENGL, "OpenGL" }, + // { Ship::WindowBackend::FAST3D_SDL_METAL, "Metal" }, + // }; + // + // ImGui::Text("Renderer API (Needs reload)"); + // Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend(); + // Ship::WindowBackend configWindowBackend; + // int configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1); + // if (Ship::Context::GetInstance()->GetWindow()->IsAvailableWindowBackend(configWindowBackendId)) { + // configWindowBackend = static_cast<Ship::WindowBackend>(configWindowBackendId); + // } else { + // configWindowBackend = runningWindowBackend; + // } + // + // if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { + // UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); + // } + // if (ImGui::BeginCombo("##RApi", windowBackendNames[configWindowBackend])) { + // for (size_t i = 0; i < + // Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); + // i++) { + // auto backend = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->data()[i]; + // if (ImGui::Selectable(windowBackendNames[backend], backend == configWindowBackend)) { + // Ship::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", + // static_cast<int>(backend)); + // Ship::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name", + // windowBackendNames[backend]); + // Ship::Context::GetInstance()->GetConfig()->Save(); + // } + // } + // ImGui::EndCombo(); + // } + // if (Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size() <= 1) { + // UIWidgets::ReEnableComponent(""); + // } + // + // if (Ship::Context::GetInstance()->GetWindow()->CanDisableVerticalSync()) { + // UIWidgets::PaddedEnhancementCheckbox("Enable Vsync", "gVsyncEnabled", true, false); + // } + // + // if (Ship::Context::GetInstance()->GetWindow()->SupportsWindowedFullscreen()) { + // UIWidgets::PaddedEnhancementCheckbox("Windowed fullscreen", "gSdlWindowedFullscreen", true, false); + // } + // + // if (Ship::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports()) { + // UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false, + // false, "", + // UIWidgets::CheckboxGraphics::Cross, true); + // UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a + // reload " + // "to take effect."); + // } + // + // // If more filters are added to LUS, make sure to add them to the filters list here + // ImGui::Text("Texture Filter (Needs reload)"); + // + // UIWidgets::EnhancementCombobox("gTextureFilter", filters, 0); + // + // UIWidgets::Spacer(0); + // + // Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGameOverlay()->DrawSettings(); + // + // ImGui::EndMenu(); + // } } void DrawMenuBarIcon() { @@ -445,15 +459,12 @@ void DrawMenuBarIcon() { } void DrawGameMenu() { - } void DrawEnhancementsMenu() { if (UIWidgets::BeginMenu("Enhancements")) { - if (UIWidgets::BeginMenu("Gameplay")) { - ImGui::EndMenu(); } @@ -462,7 +473,6 @@ void DrawEnhancementsMenu() { } void DrawCheatsMenu() { - } const char* debugInfoPages[6] = { @@ -470,7 +480,6 @@ const char* debugInfoPages[6] = { }; void DrawDebugMenu() { - } void GameMenuBar::DrawElement() { @@ -481,19 +490,19 @@ void GameMenuBar::DrawElement() { ImGui::SetCursorPosY(0.0f); - //DrawSettingsMenu(); + // DrawSettingsMenu(); ImGui::SetCursorPosY(0.0f); - //DrawEnhancementsMenu(); + // DrawEnhancementsMenu(); ImGui::SetCursorPosY(0.0f); - //DrawCheatsMenu(); + // DrawCheatsMenu(); ImGui::SetCursorPosY(0.0f); - //DrawDebugMenu(); + // DrawDebugMenu(); ImGui::EndMenuBar(); } |
