Add Move Link tool from decompgz

This commit is contained in:
Pheenoh
2026-04-12 12:32:27 -06:00
parent a8f5fb3899
commit a836be11bc
5 changed files with 29 additions and 23 deletions
+2
View File
@@ -71,6 +71,7 @@ struct UserSettings {
// Controls
ConfigVar<bool> enableTurboKeybind;
ConfigVar<bool> enableMoveLink;
} game;
struct {
@@ -102,6 +103,7 @@ struct CollisionViewSettings {
struct TransientSettings {
CollisionViewSettings collisionView;
bool skipFrameRateLimit;
bool moveLinkActive;
};
TransientSettings& getTransientSettings();
+9 -23
View File
@@ -51,6 +51,7 @@
#include "d/actor/d_a_ni.h"
#include "d/d_s_play.h"
#include "dusk/settings.h"
#include "res/Object/Alink.h"
#include <cstring>
@@ -18048,17 +18049,9 @@ int daAlink_c::execute() {
}
BOOL isTrigDebugMoveInput = FALSE;
#if DEBUG
if (daPy_getPlayerActorClass() == this && checkDebugMoveInput()) {
isTrigDebugMoveInput = TRUE;
if (l_debugMode) {
l_debugMode = FALSE;
} else {
l_debugMode = TRUE;
}
}
if (l_debugMode) {
if (dusk::getTransientSettings().moveLinkActive && daPy_getPlayerActorClass() == this) {
isTrigDebugMoveInput = TRUE;
if (checkModeFlg(0x400) && !checkBoardRide() && !checkSpinnerRide()) {
if (checkCanoeRide()) {
setSyncCanoePos();
@@ -18067,16 +18060,15 @@ int daAlink_c::execute() {
}
} else {
f32 moveSpeed;
if (mDoCPd_c::getHoldLockR(PAD_1)) {
if (mDoCPd_c::getHoldZ(PAD_1)) {
moveSpeed = 100.0f;
} else {
moveSpeed = 50.0f;
}
if (mDoCPd_c::getHoldY(PAD_1)) {
current.pos.y += moveSpeed;
} else if (mDoCPd_c::getHoldX(PAD_1)) {
current.pos.y -= moveSpeed;
f32 cStickY = mDoCPd_c::getSubStickY(PAD_1);
if (cStickY > 0.3f || cStickY < -0.3f) {
current.pos.y += moveSpeed * cStickY;
}
current.pos.x += moveSpeed * mStickValue * cM_ssin(mMoveAngle);
@@ -18094,9 +18086,7 @@ int daAlink_c::execute() {
setBodyPartPos();
setAttentionPos();
} else
#endif
{
} else {
if (isTrigDebugMoveInput) {
mItemButton = 0;
mItemTrigger = 0;
@@ -18562,11 +18552,7 @@ int daAlink_c::execute() {
if (checkDeadHP()) {
eventInfo.offCondition(fopAcCnd_NOEXEC_e);
} else
#if DEBUG
if (!l_debugMode)
#endif
{
} else if (!dusk::getTransientSettings().moveLinkActive) {
if (!checkMagneBootsOn()) {
f32 gnd_nrm_y;
if (mLinkAcch.ChkGroundHit()) {
+14
View File
@@ -13,6 +13,7 @@
#include "JSystem/JUtility/JUTGamePad.h"
#include "SDL3/SDL_mouse.h"
#include "m_Do/m_Do_controller_pad.h"
#include "dusk/config.hpp"
#include "dusk/main.h"
#include "dusk/settings.h"
@@ -202,6 +203,19 @@ namespace dusk {
void ImGuiConsole::UpdateSettings() {
getTransientSettings().skipFrameRateLimit = getSettings().game.enableTurboKeybind && ImGui::IsKeyDown(ImGuiKey_Tab);
if (getSettings().game.enableMoveLink) {
static bool comboHeld = false;
constexpr u32 combo = PAD_TRIGGER_L | PAD_TRIGGER_R | PAD_BUTTON_Y;
u32 rawHold = mDoCPd_c::getHold(PAD_1);
bool held = (rawHold & combo) == combo;
if (held && !comboHeld) {
getTransientSettings().moveLinkActive = !getTransientSettings().moveLinkActive;
}
comboHeld = held;
} else {
getTransientSettings().moveLinkActive = false;
}
}
void ImGuiConsole::PreDraw() {
+2
View File
@@ -156,6 +156,8 @@ namespace dusk {
"This will not work with the \"Unlock Framerate\" enhancement.");
}
config::ImGuiCheckbox("Move Link (L+R+Y)", getSettings().game.enableMoveLink);
ImGui::EndMenu();
}
+2
View File
@@ -59,6 +59,7 @@ UserSettings g_userSettings = {
// Controls
.enableTurboKeybind {"game.enableTurboKeybind", false},
.enableMoveLink {"game.enableMoveLink", false},
},
.backend = {
@@ -113,6 +114,7 @@ void registerSettings() {
Register(g_userSettings.game.noLowHpSound);
Register(g_userSettings.game.midnasLamentNonStop);
Register(g_userSettings.game.enableTurboKeybind);
Register(g_userSettings.game.enableMoveLink);
Register(g_userSettings.game.fastSpinner);
Register(g_userSettings.game.enableFrameInterpolation);