Compare commits
2 Commits
e37da34f68
...
e52988e511
| Author | SHA1 | Date | |
|---|---|---|---|
| e52988e511 | |||
| 6bc164937b |
@@ -203,13 +203,18 @@ public class DDDView extends GameAdapter implements CommandSender {
|
||||
}
|
||||
|
||||
private void onFooterRender() {
|
||||
CastlingResult allowedCastlings = getAllowedCastlings();
|
||||
ImGui.beginDisabled(allowedCastlings == CastlingResult.None || allowedCastlings == CastlingResult.Big);
|
||||
if (ImGui.button("Roque")) {
|
||||
sendCastling();
|
||||
}
|
||||
ImGui.endDisabled();
|
||||
ImGui.sameLine();
|
||||
ImGui.beginDisabled(allowedCastlings == CastlingResult.None || allowedCastlings == CastlingResult.Small);
|
||||
if (ImGui.button("Grand Roque")) {
|
||||
sendBigCastling();
|
||||
}
|
||||
ImGui.endDisabled();
|
||||
ImGui.sameLine();
|
||||
if (ImGui.button("Annuler le coup précédent")) {
|
||||
sendUndo();
|
||||
|
||||
@@ -72,11 +72,11 @@ public class Window implements Closeable {
|
||||
this.regularTasks = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void addRegularTask(Consumer<Float> task) {
|
||||
public synchronized void addRegularTask(Consumer<Float> task) {
|
||||
this.regularTasks.add(task);
|
||||
}
|
||||
|
||||
public void removeRegularTask(Consumer<Float> task) {this.regularTasks.remove(task);}
|
||||
public synchronized void removeRegularTask(Consumer<Float> task) {this.regularTasks.remove(task);}
|
||||
|
||||
public synchronized void scheduleTask(Runnable runnable) {
|
||||
this.tasks.add(runnable);
|
||||
@@ -195,7 +195,7 @@ public class Window implements Closeable {
|
||||
}
|
||||
}
|
||||
|
||||
private void executeTasks(float delta) {
|
||||
private synchronized void executeTasks(float delta) {
|
||||
Runnable task = getNextTask();
|
||||
while (task != null) {
|
||||
task.run();
|
||||
|
||||
Reference in New Issue
Block a user