-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Macro system based on recording clicks rather than typing (#4006)
* Add a new macro system that tracks clicks * Old macro system is still around, but currently inaccessible. Maybe give an option if people rebel against that.
- Loading branch information
1 parent
6399288
commit 03725d2
Showing
19 changed files
with
563 additions
and
163 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
forge-game/src/main/java/forge/game/player/actions/ActivateAbilityAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package forge.game.player.actions; | ||
|
||
import forge.game.GameEntityView; | ||
|
||
public class ActivateAbilityAction extends PlayerAction{ | ||
public ActivateAbilityAction(GameEntityView cardView) { | ||
super(cardView); | ||
name = "Activate ability"; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
forge-game/src/main/java/forge/game/player/actions/CastSpellAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package forge.game.player.actions; | ||
|
||
import forge.game.GameEntityView; | ||
|
||
public class CastSpellAction extends PlayerAction { | ||
public CastSpellAction(GameEntityView cardView) { | ||
super(cardView); | ||
name = "Cast spell"; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
forge-game/src/main/java/forge/game/player/actions/FinishTargetingAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package forge.game.player.actions; | ||
|
||
public class FinishTargetingAction extends PlayerAction{ | ||
public FinishTargetingAction() { | ||
super(null); | ||
|
||
name = "Finish game entity"; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
forge-game/src/main/java/forge/game/player/actions/PassPriorityAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package forge.game.player.actions; | ||
|
||
public class PassPriorityAction extends PlayerAction { | ||
public PassPriorityAction() { | ||
super(null); | ||
name = "Pass Priority"; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
forge-game/src/main/java/forge/game/player/actions/PayCostAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package forge.game.player.actions; | ||
|
||
import forge.game.GameEntityView; | ||
|
||
public class PayCostAction extends PlayerAction { | ||
public PayCostAction(GameEntityView cardView) { | ||
super(cardView); | ||
name = "Pay cost"; | ||
gameEntityView = cardView; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
forge-game/src/main/java/forge/game/player/actions/PayManaFromPoolAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package forge.game.player.actions; | ||
|
||
|
||
public class PayManaFromPoolAction extends PlayerAction{ | ||
private byte colorSelected; | ||
public PayManaFromPoolAction(byte colorCode) { | ||
super(null); | ||
|
||
name = "Pay mana"; | ||
colorSelected = colorCode; | ||
} | ||
|
||
public byte getSelectedColor() { | ||
return colorSelected; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
forge-game/src/main/java/forge/game/player/actions/PlayerAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package forge.game.player.actions; | ||
|
||
import forge.game.GameEntityView; | ||
import forge.game.player.PlayerController; | ||
|
||
public abstract class PlayerAction { | ||
protected String name; | ||
protected GameEntityView gameEntityView = null; | ||
|
||
public PlayerAction(GameEntityView cardView) { | ||
gameEntityView = cardView; | ||
} | ||
|
||
public void run(PlayerController controller) { | ||
// Turn this abstract soon | ||
// This should try to replicate the recorded macro action | ||
} | ||
|
||
public GameEntityView getGameEntityView() { | ||
return gameEntityView; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
forge-game/src/main/java/forge/game/player/actions/SelectCardAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package forge.game.player.actions; | ||
|
||
import forge.game.GameEntityView; | ||
|
||
public class SelectCardAction extends PlayerAction{ | ||
public SelectCardAction(GameEntityView cardView) { | ||
super(cardView); | ||
name = "Select card"; | ||
} | ||
|
||
|
||
} |
11 changes: 11 additions & 0 deletions
11
forge-game/src/main/java/forge/game/player/actions/SelectPlayerAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package forge.game.player.actions; | ||
|
||
import forge.game.GameEntityView; | ||
|
||
public class SelectPlayerAction extends PlayerAction { | ||
public SelectPlayerAction(GameEntityView playerView) { | ||
super(playerView); | ||
name = "Select player"; | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
forge-game/src/main/java/forge/game/player/actions/TargetEntityAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package forge.game.player.actions; | ||
|
||
import forge.game.GameEntityView; | ||
|
||
public class TargetEntityAction extends PlayerAction { | ||
// TODO Add distribution damage/counters | ||
public TargetEntityAction(GameEntityView cardView) { | ||
super(cardView); | ||
name = "Target game entity"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
package forge.interfaces; | ||
|
||
import forge.game.player.actions.PlayerAction; | ||
|
||
public interface IMacroSystem { | ||
void addRememberedAction(PlayerAction action); | ||
void setRememberedActions(); | ||
void nextRememberedAction(); | ||
boolean isRecording(); | ||
String playbackText(); | ||
} |
Oops, something went wrong.