mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-12-12 09:02:41 +01:00
DroidFish: Report engine name in the GUI when a new engine is started.
This commit is contained in:
@@ -400,6 +400,7 @@ you are not actively using the program.\
|
|||||||
<string name="before_selected">Before Selected</string>
|
<string name="before_selected">Before Selected</string>
|
||||||
<string name="after_selected">After Selected</string>
|
<string name="after_selected">After Selected</string>
|
||||||
<string name="replace_selected">Replace Selected</string>
|
<string name="replace_selected">Replace Selected</string>
|
||||||
|
<string name="engine">Engine</string>
|
||||||
|
|
||||||
<string name="err_too_few_spaces">Too few spaces</string>
|
<string name="err_too_few_spaces">Too few spaces</string>
|
||||||
<string name="err_invalid_piece">Invalid piece</string>
|
<string name="err_invalid_piece">Invalid piece</string>
|
||||||
|
|||||||
@@ -1765,6 +1765,13 @@ public class DroidFish extends Activity implements GUIInterface {
|
|||||||
Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reportEngineName(String engine) {
|
||||||
|
String msg = String.format("%s: %s",
|
||||||
|
getString(R.string.engine), engine);
|
||||||
|
Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void computerMoveMade() {
|
public void computerMoveMade() {
|
||||||
if (soundEnabled) {
|
if (soundEnabled) {
|
||||||
|
|||||||
@@ -64,6 +64,9 @@ public interface GUIInterface {
|
|||||||
/** Report that user attempted to make an invalid move. */
|
/** Report that user attempted to make an invalid move. */
|
||||||
public void reportInvalidMove(Move m);
|
public void reportInvalidMove(Move m);
|
||||||
|
|
||||||
|
/** Report UCI engine name. */
|
||||||
|
public void reportEngineName(String engine);
|
||||||
|
|
||||||
/** Called when computer made a move. GUI can notify user, for example by playing a sound. */
|
/** Called when computer made a move. GUI can notify user, for example by playing a sound. */
|
||||||
public void computerMoveMade();
|
public void computerMoveMade();
|
||||||
|
|
||||||
|
|||||||
@@ -697,6 +697,7 @@ public class DroidChessController {
|
|||||||
gui.runOnUIThread(new Runnable() {
|
gui.runOnUIThread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
updatePlayerNames(engineName);
|
updatePlayerNames(engineName);
|
||||||
|
gui.reportEngineName(engineName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user