mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-07 20:11:46 -04:00
Adds option to unbind using controller only (#1212)
* Adds option to unbind using controller only
* Adds a new cheat to let you transform from the start of the game, without Midna or the Shadow Crystal
* Revert "Adds a new cheat to let you transform from the start of the game, without Midna or the Shadow Crystal"
This reverts commit 51ed736729.
* Do not allow unbinding the A or B buttons to prevent softlocks when no other input sources are available (e.g. playing on a TV)
* change 'and' to '&&' in accordance with code standards
This commit is contained in:
@@ -1033,6 +1033,12 @@ void ControllerConfigWindow::poll_pending_binding() {
|
||||
const s32 nativeButton = PADGetNativeButtonPressed(mPendingPort);
|
||||
if (nativeButton != -1) {
|
||||
const int completedPort = mPendingPort;
|
||||
if (mPendingButtonMapping->nativeButton == static_cast<u32>(nativeButton) &&
|
||||
(mPendingButtonMapping->padButton != PAD_BUTTON_A &&
|
||||
mPendingButtonMapping->padButton != PAD_BUTTON_B)) {
|
||||
unmap_pending_binding();
|
||||
return;
|
||||
}
|
||||
mPendingButtonMapping->nativeButton = static_cast<u32>(nativeButton);
|
||||
finish_pending_binding(completedPort);
|
||||
}
|
||||
@@ -1043,6 +1049,10 @@ void ControllerConfigWindow::poll_pending_binding() {
|
||||
const PADSignedNativeAxis nativeAxis = PADGetNativeAxisPulled(mPendingPort);
|
||||
if (nativeAxis.nativeAxis != -1) {
|
||||
const int completedPort = mPendingPort;
|
||||
if (mPendingAxisMapping->nativeAxis.nativeAxis == nativeAxis.nativeAxis) {
|
||||
unmap_pending_binding();
|
||||
return;
|
||||
}
|
||||
mPendingAxisMapping->nativeAxis = nativeAxis;
|
||||
mPendingAxisMapping->nativeButton = -1;
|
||||
finish_pending_binding(completedPort);
|
||||
@@ -1069,6 +1079,10 @@ void ControllerConfigWindow::poll_pending_binding() {
|
||||
|
||||
if (button != -1) {
|
||||
const int completedPort = mPendingPort;
|
||||
if (mPendingActionBinding->getValue() == button) {
|
||||
unmap_pending_binding();
|
||||
return;
|
||||
}
|
||||
mPendingActionBinding->setValue(button);
|
||||
config::Save();
|
||||
finish_pending_binding(completedPort);
|
||||
|
||||
Reference in New Issue
Block a user