mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-09 04:30:49 -04:00
Address PR feedback for Move Link tool
- Gate on developmentMode instead of dedicated setting - Simplify combo check to getHoldL + getHoldR + getTrigY - Use #if TARGET_PC ifdefs, preserve original #if DEBUG code - Remove enableMoveLink ConfigVar and menu checkbox
This commit is contained in:
@@ -71,7 +71,6 @@ struct UserSettings {
|
||||
|
||||
// Controls
|
||||
ConfigVar<bool> enableTurboKeybind;
|
||||
ConfigVar<bool> enableMoveLink;
|
||||
} game;
|
||||
|
||||
struct {
|
||||
|
||||
@@ -18049,7 +18049,7 @@ int daAlink_c::execute() {
|
||||
}
|
||||
|
||||
BOOL isTrigDebugMoveInput = FALSE;
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getTransientSettings().moveLinkActive && daPy_getPlayerActorClass() == this) {
|
||||
isTrigDebugMoveInput = TRUE;
|
||||
if (checkModeFlg(0x400) && !checkBoardRide() && !checkSpinnerRide()) {
|
||||
@@ -18086,7 +18086,57 @@ int daAlink_c::execute() {
|
||||
|
||||
setBodyPartPos();
|
||||
setAttentionPos();
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
#if DEBUG
|
||||
if (daPy_getPlayerActorClass() == this && checkDebugMoveInput()) {
|
||||
isTrigDebugMoveInput = TRUE;
|
||||
if (l_debugMode) {
|
||||
l_debugMode = FALSE;
|
||||
} else {
|
||||
l_debugMode = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (l_debugMode) {
|
||||
if (checkModeFlg(0x400) && !checkBoardRide() && !checkSpinnerRide()) {
|
||||
if (checkCanoeRide()) {
|
||||
setSyncCanoePos();
|
||||
} else {
|
||||
setSyncRide(0);
|
||||
}
|
||||
} else {
|
||||
f32 moveSpeed;
|
||||
if (mDoCPd_c::getHoldLockR(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;
|
||||
}
|
||||
|
||||
current.pos.x += moveSpeed * mStickValue * cM_ssin(mMoveAngle);
|
||||
current.pos.z += moveSpeed * mStickValue * cM_scos(mMoveAngle);
|
||||
}
|
||||
|
||||
setMatrix();
|
||||
mpLinkModel->calc();
|
||||
|
||||
if (!checkWolf()) {
|
||||
setItemMatrix(0);
|
||||
} else {
|
||||
setWolfItemMatrix();
|
||||
}
|
||||
|
||||
setBodyPartPos();
|
||||
setAttentionPos();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
if (isTrigDebugMoveInput) {
|
||||
mItemButton = 0;
|
||||
mItemTrigger = 0;
|
||||
@@ -18552,7 +18602,13 @@ int daAlink_c::execute() {
|
||||
|
||||
if (checkDeadHP()) {
|
||||
eventInfo.offCondition(fopAcCnd_NOEXEC_e);
|
||||
} else if (!dusk::getTransientSettings().moveLinkActive) {
|
||||
} else
|
||||
#if TARGET_PC
|
||||
if (!dusk::getTransientSettings().moveLinkActive)
|
||||
#elif DEBUG
|
||||
if (!l_debugMode)
|
||||
#endif
|
||||
{
|
||||
if (!checkMagneBootsOn()) {
|
||||
f32 gnd_nrm_y;
|
||||
if (mLinkAcch.ChkGroundHit()) {
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#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"
|
||||
@@ -204,16 +205,10 @@ 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 {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,8 +156,6 @@ namespace dusk {
|
||||
"This will not work with the \"Unlock Framerate\" enhancement.");
|
||||
}
|
||||
|
||||
config::ImGuiCheckbox("Move Link (L+R+Y)", getSettings().game.enableMoveLink);
|
||||
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ UserSettings g_userSettings = {
|
||||
|
||||
// Controls
|
||||
.enableTurboKeybind {"game.enableTurboKeybind", false},
|
||||
.enableMoveLink {"game.enableMoveLink", false},
|
||||
},
|
||||
|
||||
.backend = {
|
||||
@@ -114,7 +113,6 @@ 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user