Merge pull request #342 from TwilitRealm/feat/move-link-tool

Add Move Link tool from decompgz
This commit is contained in:
TakaRikka
2026-04-12 16:23:05 -07:00
committed by GitHub
3 changed files with 33 additions and 4 deletions
+1
View File
@@ -104,6 +104,7 @@ struct CollisionViewSettings {
struct TransientSettings {
CollisionViewSettings collisionView;
bool skipFrameRateLimit;
bool moveLinkActive;
};
TransientSettings& getTransientSettings();
+23 -4
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,7 +18049,10 @@ int daAlink_c::execute() {
}
BOOL isTrigDebugMoveInput = FALSE;
#if DEBUG
#if TARGET_PC
if (dusk::getTransientSettings().moveLinkActive && daPy_getPlayerActorClass() == this) {
isTrigDebugMoveInput = TRUE;
#elif DEBUG
if (daPy_getPlayerActorClass() == this && checkDebugMoveInput()) {
isTrigDebugMoveInput = TRUE;
if (l_debugMode) {
@@ -18059,6 +18063,8 @@ int daAlink_c::execute() {
}
if (l_debugMode) {
#endif
#if TARGET_PC || DEBUG
if (checkModeFlg(0x400) && !checkBoardRide() && !checkSpinnerRide()) {
if (checkCanoeRide()) {
setSyncCanoePos();
@@ -18067,17 +18073,28 @@ int daAlink_c::execute() {
}
} else {
f32 moveSpeed;
#if TARGET_PC
if (mDoCPd_c::getHoldZ(PAD_1)) {
#else
if (mDoCPd_c::getHoldLockR(PAD_1)) {
#endif
moveSpeed = 100.0f;
} else {
moveSpeed = 50.0f;
}
#if TARGET_PC
f32 cStickY = mDoCPd_c::getSubStickY(PAD_1);
if (cStickY > 0.3f || cStickY < -0.3f) {
current.pos.y += moveSpeed * cStickY;
}
#else
if (mDoCPd_c::getHoldY(PAD_1)) {
current.pos.y += moveSpeed;
} else if (mDoCPd_c::getHoldX(PAD_1)) {
current.pos.y -= moveSpeed;
}
#endif
current.pos.x += moveSpeed * mStickValue * cM_ssin(mMoveAngle);
current.pos.z += moveSpeed * mStickValue * cM_scos(mMoveAngle);
@@ -18095,7 +18112,7 @@ int daAlink_c::execute() {
setBodyPartPos();
setAttentionPos();
} else
#endif
#endif
{
if (isTrigDebugMoveInput) {
mItemButton = 0;
@@ -18563,9 +18580,11 @@ int daAlink_c::execute() {
if (checkDeadHP()) {
eventInfo.offCondition(fopAcCnd_NOEXEC_e);
} else
#if DEBUG
#if TARGET_PC
if (!dusk::getTransientSettings().moveLinkActive)
#elif DEBUG
if (!l_debugMode)
#endif
#endif
{
if (!checkMagneBootsOn()) {
f32 gnd_nrm_y;
+9
View File
@@ -13,6 +13,8 @@
#include "JSystem/JUtility/JUTGamePad.h"
#include "SDL3/SDL_mouse.h"
#include "m_Do/m_Do_controller_pad.h"
#include "m_Do/m_Do_main.h"
#include "dusk/config.hpp"
#include "dusk/main.h"
#include "dusk/settings.h"
@@ -202,6 +204,13 @@ namespace dusk {
void ImGuiConsole::UpdateSettings() {
getTransientSettings().skipFrameRateLimit = getSettings().game.enableTurboKeybind && ImGui::IsKeyDown(ImGuiKey_Tab);
if (mDoMain::developmentMode == 1 && mDoCPd_c::getHoldL(PAD_1) && mDoCPd_c::getHoldR(PAD_1) && mDoCPd_c::getTrigY(PAD_1)) {
getTransientSettings().moveLinkActive = !getTransientSettings().moveLinkActive;
}
if (mDoMain::developmentMode != 1) {
getTransientSettings().moveLinkActive = false;
}
}
void ImGuiConsole::PreDraw() {