mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-16 13:59:39 -04:00
Fix hookshot hanging w/ touch controls
This commit is contained in:
@@ -4556,6 +4556,7 @@ public:
|
||||
void handleWolfHowl();
|
||||
void handleQuickTransform();
|
||||
bool checkAimContext();
|
||||
bool checkTouchAimCaptureContext();
|
||||
|
||||
void onIronBallChainInterpCallback();
|
||||
|
||||
|
||||
@@ -175,3 +175,13 @@ bool daAlink_c::checkAimContext() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool daAlink_c::checkTouchAimCaptureContext() {
|
||||
switch (mProcID) {
|
||||
case PROC_HOOKSHOT_ROOF_WAIT:
|
||||
case PROC_HOOKSHOT_WALL_WAIT:
|
||||
return false;
|
||||
default:
|
||||
return checkAimContext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +156,11 @@ bool player_attention_locked() noexcept {
|
||||
return player != nullptr && (player->checkAttentionLock() || player->checkEnemyAttentionLock());
|
||||
}
|
||||
|
||||
bool touch_aim_capture_active() noexcept {
|
||||
auto* player = daAlink_getAlinkActorClass();
|
||||
return player != nullptr && player->checkTouchAimCaptureContext() && dCamera_c::isAimActive();
|
||||
}
|
||||
|
||||
bool item_wheel_active() noexcept {
|
||||
return dMeter2Info_getWindowStatus() == 2;
|
||||
}
|
||||
@@ -692,7 +697,7 @@ void TouchControls::sync_touch_state() noexcept {
|
||||
}
|
||||
|
||||
sync_l_lock_state();
|
||||
const bool aimActive = dCamera_c::isAimActive();
|
||||
const bool aimActive = touch_aim_capture_active();
|
||||
if (aimActive && mMoveTouch.active) {
|
||||
if (!mCameraTouch.active) {
|
||||
mCameraTouch = mMoveTouch;
|
||||
@@ -1208,7 +1213,7 @@ void TouchControls::handle_touch_down(Rml::Event& event) noexcept {
|
||||
}
|
||||
|
||||
const auto id = touch_event_id(event);
|
||||
if (dCamera_c::isAimActive()) {
|
||||
if (touch_aim_capture_active()) {
|
||||
if (!mCameraTouch.active) {
|
||||
mCameraTouch = {
|
||||
.id = id,
|
||||
|
||||
Reference in New Issue
Block a user