mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- Reorganized the code a bit (for auto-yield shortcuts).
This commit is contained in:
@@ -139,10 +139,10 @@ public class KeyboardShortcuts {
|
|||||||
if (!Singletons.getControl().getCurrentScreen().isMatchScreen()) { return; }
|
if (!Singletons.getControl().getCurrentScreen().isMatchScreen()) { return; }
|
||||||
if (matchUI == null) { return; }
|
if (matchUI == null) { return; }
|
||||||
StackItemView si = matchUI.getGameView().peekStack();
|
StackItemView si = matchUI.getGameView().peekStack();
|
||||||
if (si != null && si.isAbility()) {
|
if (si != null && si.isAbility() && matchUI.isLocalPlayer(si.getActivatingPlayer())) {
|
||||||
matchUI.setShouldAutoYield(si.getKey(), true);
|
matchUI.setShouldAutoYield(si.getKey(), true);
|
||||||
int triggerID = Integer.valueOf(si.getSourceTrigger());
|
int triggerID = Integer.valueOf(si.getSourceTrigger());
|
||||||
if (si.isOptionalTrigger() && matchUI.isLocalPlayer(si.getActivatingPlayer())) {
|
if (si.isOptionalTrigger()) {
|
||||||
matchUI.setShouldAlwaysAcceptTrigger(triggerID);
|
matchUI.setShouldAlwaysAcceptTrigger(triggerID);
|
||||||
}
|
}
|
||||||
matchUI.getGameController().passPriority();
|
matchUI.getGameController().passPriority();
|
||||||
@@ -157,10 +157,10 @@ public class KeyboardShortcuts {
|
|||||||
if (!Singletons.getControl().getCurrentScreen().isMatchScreen()) { return; }
|
if (!Singletons.getControl().getCurrentScreen().isMatchScreen()) { return; }
|
||||||
if (matchUI == null) { return; }
|
if (matchUI == null) { return; }
|
||||||
StackItemView si = matchUI.getGameView().peekStack();
|
StackItemView si = matchUI.getGameView().peekStack();
|
||||||
if (si != null && si.isAbility()) {
|
if (si != null && si.isAbility() && matchUI.isLocalPlayer(si.getActivatingPlayer())) {
|
||||||
matchUI.setShouldAutoYield(si.getKey(), true);
|
matchUI.setShouldAutoYield(si.getKey(), true);
|
||||||
int triggerID = Integer.valueOf(si.getSourceTrigger());
|
int triggerID = Integer.valueOf(si.getSourceTrigger());
|
||||||
if (si.isOptionalTrigger() && matchUI.isLocalPlayer(si.getActivatingPlayer())) {
|
if (si.isOptionalTrigger()) {
|
||||||
matchUI.setShouldAlwaysDeclineTrigger(triggerID);
|
matchUI.setShouldAlwaysDeclineTrigger(triggerID);
|
||||||
}
|
}
|
||||||
matchUI.getGameController().passPriority();
|
matchUI.getGameController().passPriority();
|
||||||
|
|||||||
Reference in New Issue
Block a user