add enhancements menu tab

This commit is contained in:
TakaRikka
2026-04-02 03:11:58 -07:00
parent b3196db113
commit f04a0d2119
15 changed files with 116 additions and 51 deletions
+1 -1
+2
View File
@@ -1347,6 +1347,8 @@ set(DUSK_FILES
src/dusk/imgui/ImGuiMenuGame.hpp
src/dusk/imgui/ImGuiMenuTools.cpp
src/dusk/imgui/ImGuiMenuTools.hpp
src/dusk/imgui/ImGuiMenuEnhancements.cpp
src/dusk/imgui/ImGuiMenuEnhancements.hpp
src/dusk/imgui/ImGuiProcessOverlay.cpp
src/dusk/imgui/ImGuiCameraOverlay.cpp
src/dusk/imgui/ImGuiHeapOverlay.cpp
-7
View File
@@ -8425,11 +8425,4 @@ inline daAlink_c* daAlink_getAlinkActorClass() {
return (daAlink_c*)dComIfGp_getLinkPlayer();
}
#if TARGET_PC
namespace dusk::tweaks {
extern bool FastIronBoots;
extern bool InvertCameraXAxis;
}
#endif
#endif /* D_A_D_A_ALINK_H */
+3 -8
View File
@@ -54,11 +54,6 @@
#include "res/Object/Alink.h"
#include <cstring>
#if TARGET_PC
bool dusk::tweaks::FastIronBoots = false;
bool dusk::tweaks::InvertCameraXAxis = false;
#endif
static int daAlink_Create(fopAc_ac_c* i_this);
static int daAlink_Delete(daAlink_c* i_this);
static int daAlink_Execute(daAlink_c* i_this);
@@ -7515,7 +7510,7 @@ void daAlink_c::setBlendMoveAnime(f32 i_morf) {
BOOL sp24 = checkEventRun();
BOOL sp20 = checkBootsMoveAnime(1);
#if TARGET_PC
if (dusk::tweaks::FastIronBoots) {
if (dusk::ImGuiMenuEnhancements::m_enhancements.fastIronBoots) {
sp20 = FALSE;
}
#endif
@@ -9480,7 +9475,7 @@ void daAlink_c::setStickData() {
mHeavySpeedMultiplier = mpHIO->mItem.mIronBoots.m.mInputFactor;
}
#if TARGET_PC
if (dusk::tweaks::FastIronBoots) {
if (dusk::ImGuiMenuEnhancements::m_enhancements.fastIronBoots) {
mHeavySpeedMultiplier = 1.0f;
}
#endif
@@ -9492,7 +9487,7 @@ void daAlink_c::setStickData() {
mHeavySpeedMultiplier = mpHIO->mItem.mIronBoots.m.mWaterInputFactor;
}
#if TARGET_PC
if (dusk::tweaks::FastIronBoots) {
if (dusk::ImGuiMenuEnhancements::m_enhancements.fastIronBoots) {
mHeavySpeedMultiplier = 1.0f;
}
#endif
+9 -3
View File
@@ -23,6 +23,8 @@
#include "d/actor/d_a_npc_tkc.h"
#include <cstring>
#include "dusk/imgui/ImGuiMenuEnhancements.hpp"
BOOL daAlink_c::checkEventRun() const {
return dComIfGp_event_runCheck() || checkPlayerDemoMode();
}
@@ -4290,7 +4292,7 @@ static fopAc_ac_c* daAlink_searchPortal(fopAc_ac_c* i_actor, void* i_data) {
}
bool daAlink_c::checkAcceptWarp() {
#if VERSION != VERSION_WII_USA_R0
#if TARGET_PC || VERSION != VERSION_WII_USA_R0
cM3dGPla plane;
#endif
@@ -4298,7 +4300,9 @@ bool daAlink_c::checkAcceptWarp() {
* Fixed in versions above Wii USA Rev 0 by checking FLG0_WATER_IN_MOVE
*/
if (mLinkAcch.ChkGroundHit() && !checkModeFlg(MODE_PLAYER_FLY)
#if VERSION != VERSION_WII_USA_R0
#if TARGET_PC
&& (dusk::ImGuiMenuEnhancements::m_enhancements.restoreWiiGlitches || !checkNoResetFlg0(FLG0_WATER_IN_MOVE))
#elif VERSION != VERSION_WII_USA_R0
&& !checkNoResetFlg0(FLG0_WATER_IN_MOVE)
#endif
)
@@ -4307,7 +4311,9 @@ bool daAlink_c::checkAcceptWarp() {
* Fixed in versions above Wii USA Rev 0 by checking getSlidePolygon
*/
if (
#if VERSION != VERSION_WII_USA_R0
#if TARGET_PC
(dusk::ImGuiMenuEnhancements::m_enhancements.restoreWiiGlitches || !getSlidePolygon(&plane)) &&
#elif VERSION != VERSION_WII_USA_R0
!getSlidePolygon(&plane) &&
#endif
!checkForestOldCentury()
+5 -1
View File
@@ -6,6 +6,8 @@
#include "d/actor/d_a_alink.h"
#include "d/actor/d_a_tag_magne.h"
#include "dusk/imgui/ImGuiMenuEnhancements.hpp"
void daAlink_c::concatMagneBootMtx() {
if (checkMagneBootsOn()) {
mDoMtx_stack_c::concat(mMagneBootMtx);
@@ -348,7 +350,9 @@ int daAlink_c::procMagneBootsFly() {
* Fixed in GCN and Wii KOR versions by adding a checkEquipHeavyBoots check
*/
if (dComIfG_Bgsp().ChkPolySafe(mPolyInfo2)
#if PLATFORM_GCN || VERSION == VERSION_WII_KOR
#if TARGET_PC
&& (dusk::ImGuiMenuEnhancements::m_enhancements.restoreWiiGlitches || checkEquipHeavyBoots())
#elif PLATFORM_GCN || VERSION == VERSION_WII_KOR
&& checkEquipHeavyBoots()
#endif
)
+3 -1
View File
@@ -28,6 +28,8 @@
#include "d/d_debug_camera.h"
#endif
#include "dusk/imgui/ImGuiMenuEnhancements.hpp"
namespace {
static f32 limitf(f32 value, f32 min, f32 max) {
@@ -764,7 +766,7 @@ void dCamera_c::updatePad() {
var_f31 = mDoCPd_c::getSubStickX3D(mPadID);
#if TARGET_PC
if (dusk::tweaks::InvertCameraXAxis) {
if (dusk::ImGuiMenuEnhancements::m_enhancements.invertCameraXAxis) {
var_f31 *= -1.0f;
}
#endif
+1 -1
View File
@@ -11381,7 +11381,7 @@ void dKy_bg_MAxx_proc(void* bg_model_p) {
C_MTXLightPerspective(sp1D8, dComIfGd_getView()->fovy,
camera_p->view.aspect, 1.0f, 1.0f,
#if TARGET_PC
dusk::g_imguiConsole.isWaterProjectionOffsetEnabled() ? -0.01f : 0.0f, 0.0f);
dusk::ImGuiMenuEnhancements::m_enhancements.useWaterProjectionOffset ? -0.01f : 0.0f, 0.0f);
#else
-0.01f, 0.0f);
#endif
+1
View File
@@ -181,6 +181,7 @@ namespace dusk {
if (ImGui::BeginMainMenuBar()) {
m_menuGame.draw();
m_menuTools.draw();
m_menuEnhancements.draw();
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - 80.0f);
ImGuiIO& io = ImGui::GetIO();
+2 -2
View File
@@ -7,6 +7,7 @@
#include "imgui.h"
#include "ImGuiMenuGame.hpp"
#include "ImGuiMenuTools.hpp"
#include "ImGuiMenuEnhancements.hpp"
namespace dusk {
class ImGuiConsole {
@@ -14,8 +15,6 @@ namespace dusk {
ImGuiConsole();
void draw();
bool isBloomEnabled() { return m_menuGame.isBloomEnabled(); }
bool isWaterProjectionOffsetEnabled() { return m_menuGame.isWaterProjectionOffsetEnabled(); }
ImGuiMenuTools::CollisionViewSettings& getCollisionViewSettings() { return m_menuTools.getCollisionViewSettings(); }
static bool CheckMenuViewToggle(ImGuiKey key, bool& active);
@@ -25,6 +24,7 @@ namespace dusk {
ImGuiMenuGame m_menuGame;
ImGuiMenuTools m_menuTools;
ImGuiMenuEnhancements m_menuEnhancements;
};
extern ImGuiConsole g_imguiConsole;
+55
View File
@@ -0,0 +1,55 @@
#include "fmt/format.h"
#include "imgui.h"
#include "aurora/gfx.h"
#include "ImGuiConsole.hpp"
#include "ImGuiMenuEnhancements.hpp"
#include <imgui_internal.h>
namespace dusk {
EnhancementsSettings ImGuiMenuEnhancements::m_enhancements = {
.fastIronBoots = false,
.invertCameraXAxis = false,
.restoreWiiGlitches = false,
.enableBloom = true,
.useWaterProjectionOffset = false,
};
ImGuiMenuEnhancements::ImGuiMenuEnhancements() {}
void ImGuiMenuEnhancements::draw() {
if (ImGui::BeginMenu("Enhancements")) {
if (ImGui::BeginMenu("Quality of Life")) {
ImGui::Checkbox("Fast Iron Boots", &m_enhancements.fastIronBoots);
ImGui::Checkbox("Invert Camera X Axis", &m_enhancements.invertCameraXAxis);
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Graphics")) {
ImGui::Checkbox("Native Bloom", &m_enhancements.enableBloom);
ImGui::Checkbox("Water Projection Offset", &m_enhancements.useWaterProjectionOffset);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Adds GC-specific -0.01 transS offset\n"
"that causes ~6px ghost artifacts in water reflections");
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Restorations")) {
ImGui::Checkbox("Restore Wii 1.0 Glitches", &m_enhancements.restoreWiiGlitches);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Restores patched glitches from Wii USA 1.0, the first released version");
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Cheats")) {
ImGui::EndMenu();
}
ImGui::EndMenu();
}
}
}
+28
View File
@@ -0,0 +1,28 @@
#ifndef DUSK_IMGUI_MENUENHANCEMENTS_HPP
#define DUSK_IMGUI_MENUENHANCEMENTS_HPP
#include <aurora/aurora.h>
#include <pad.h>
#include <string>
#include "imgui.h"
namespace dusk {
struct EnhancementsSettings {
bool fastIronBoots;
bool invertCameraXAxis;
bool restoreWiiGlitches;
bool enableBloom;
bool useWaterProjectionOffset;
};
class ImGuiMenuEnhancements {
public:
ImGuiMenuEnhancements();
void draw();
static EnhancementsSettings m_enhancements;
};
}
#endif // DUSK_IMGUI_MENUENHANCEMENTS_HPP
+4 -19
View File
@@ -25,17 +25,8 @@ namespace dusk {
if (ImGui::BeginMenu("Graphics")) {
if (ImGui::MenuItem("Toggle Fullscreen", "F11")) {
m_graphicsSettings.m_fullscreen = !m_graphicsSettings.m_fullscreen;
VISetWindowFullscreen(m_graphicsSettings.m_fullscreen);
}
ImGui::Separator();
ImGui::Checkbox("Native Bloom", &m_graphicsSettings.m_enableBloom);
ImGui::Checkbox("Water Projection Offset", &m_graphicsSettings.m_waterProjectionOffset);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Adds GC-specific -0.01 transS offset\n"
"that causes ~6px ghost artifacts in water reflections");
m_fullscreen = !m_fullscreen;
VISetWindowFullscreen(m_fullscreen);
}
ImGui::EndMenu();
@@ -76,12 +67,6 @@ namespace dusk {
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Tweaks")) {
ImGui::MenuItem("Fast iron boots", nullptr, &tweaks::FastIronBoots);
ImGui::MenuItem("Invert Camera X Axis", nullptr, &tweaks::InvertCameraXAxis);
ImGui::EndMenu();
}
ImGui::EndMenu();
}
@@ -93,8 +78,8 @@ namespace dusk {
}
if (ImGui::IsKeyPressed(ImGuiKey_F11)) {
m_graphicsSettings.m_fullscreen = !m_graphicsSettings.m_fullscreen;
VISetWindowFullscreen(m_graphicsSettings.m_fullscreen);
m_fullscreen = !m_fullscreen;
VISetWindowFullscreen(m_fullscreen);
}
}
+1 -7
View File
@@ -12,8 +12,6 @@ namespace dusk {
public:
ImGuiMenuGame();
void draw();
bool isBloomEnabled() { return m_graphicsSettings.m_enableBloom; }
bool isWaterProjectionOffsetEnabled() { return m_graphicsSettings.m_waterProjectionOffset; }
void windowInputViewer();
void windowControllerConfig();
@@ -35,11 +33,7 @@ namespace dusk {
int m_pendingPort = -1;
} m_controllerConfig;
struct {
bool m_enableBloom = 1;
bool m_waterProjectionOffset = false;
bool m_fullscreen = false;
} m_graphicsSettings;
bool m_fullscreen = false;
bool m_showControllerConfig = false;
+1 -1
View File
@@ -1166,7 +1166,7 @@ void mDoGph_gInf_c::bloom_c::remove() {
void mDoGph_gInf_c::bloom_c::draw() {
#if TARGET_PC
if (!dusk::g_imguiConsole.isBloomEnabled()) {
if (!dusk::ImGuiMenuEnhancements::m_enhancements.enableBloom) {
return;
}
#endif