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() {
|
private void onFooterRender() {
|
||||||
|
CastlingResult allowedCastlings = getAllowedCastlings();
|
||||||
|
ImGui.beginDisabled(allowedCastlings == CastlingResult.None || allowedCastlings == CastlingResult.Big);
|
||||||
if (ImGui.button("Roque")) {
|
if (ImGui.button("Roque")) {
|
||||||
sendCastling();
|
sendCastling();
|
||||||
}
|
}
|
||||||
|
ImGui.endDisabled();
|
||||||
ImGui.sameLine();
|
ImGui.sameLine();
|
||||||
|
ImGui.beginDisabled(allowedCastlings == CastlingResult.None || allowedCastlings == CastlingResult.Small);
|
||||||
if (ImGui.button("Grand Roque")) {
|
if (ImGui.button("Grand Roque")) {
|
||||||
sendBigCastling();
|
sendBigCastling();
|
||||||
}
|
}
|
||||||
|
ImGui.endDisabled();
|
||||||
ImGui.sameLine();
|
ImGui.sameLine();
|
||||||
if (ImGui.button("Annuler le coup précédent")) {
|
if (ImGui.button("Annuler le coup précédent")) {
|
||||||
sendUndo();
|
sendUndo();
|
||||||
|
|||||||
@@ -72,11 +72,11 @@ public class Window implements Closeable {
|
|||||||
this.regularTasks = new ArrayList<>();
|
this.regularTasks = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addRegularTask(Consumer<Float> task) {
|
public synchronized void addRegularTask(Consumer<Float> task) {
|
||||||
this.regularTasks.add(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) {
|
public synchronized void scheduleTask(Runnable runnable) {
|
||||||
this.tasks.add(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();
|
Runnable task = getNextTask();
|
||||||
while (task != null) {
|
while (task != null) {
|
||||||
task.run();
|
task.run();
|
||||||
|
|||||||
Reference in New Issue
Block a user