From de33b2c98f8bbc929ddd0bd83fd89a6ab072aa88 Mon Sep 17 00:00:00 2001 From: Peter Osterlund Date: Tue, 8 Oct 2019 20:55:09 +0200 Subject: [PATCH] Add button action "force computer move" --- .../java/org/petero/droidfish/DroidFish.java | 9 ++ DroidFishApp/src/main/res/raw/stop.svg | 97 +++++++++++++++++++ DroidFishApp/src/main/res/values/strings.xml | 2 + 3 files changed, 108 insertions(+) create mode 100644 DroidFishApp/src/main/res/raw/stop.svg diff --git a/DroidFishApp/src/main/java/org/petero/droidfish/DroidFish.java b/DroidFishApp/src/main/java/org/petero/droidfish/DroidFish.java index f8dc623..cdba001 100644 --- a/DroidFishApp/src/main/java/org/petero/droidfish/DroidFish.java +++ b/DroidFishApp/src/main/java/org/petero/droidfish/DroidFish.java @@ -374,6 +374,15 @@ public class DroidFish extends Activity setBoardFlip(false); } }); + addAction(new UIAction() { + public String getId() { return "forceMove"; } + public int getName() { return R.string.option_force_computer_move; } + public int getIcon() { return R.raw.stop; } + public boolean enabled() { return true; } + public void run() { + ctrl.stopSearch(); + } + }); addAction(new UIAction() { public String getId() { return "largeButtons"; } public int getName() { return R.string.toggle_large_buttons; } diff --git a/DroidFishApp/src/main/res/raw/stop.svg b/DroidFishApp/src/main/res/raw/stop.svg new file mode 100644 index 0000000..afddfa4 --- /dev/null +++ b/DroidFishApp/src/main/res/raw/stop.svg @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + diff --git a/DroidFishApp/src/main/res/values/strings.xml b/DroidFishApp/src/main/res/values/strings.xml index 062c18b..7a9176c 100644 --- a/DroidFishApp/src/main/res/values/strings.xml +++ b/DroidFishApp/src/main/res/values/strings.xml @@ -753,6 +753,7 @@ If you are running on battery power, it is recommended that you change settings Disabled @string/flip_board @string/toggle_analysis + @string/option_force_computer_move @string/toggle_show_thinking @string/toggle_book_hints @string/toggle_tb_hints @@ -770,6 +771,7 @@ If you are running on battery power, it is recommended that you change settings flipboard toggleAnalysis + forceMove showThinking bookHints tbHints