mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Fix so UI updated immediately when match started remotely
This commit is contained in:
@@ -67,6 +67,11 @@ public class GuiDesktop implements IGuiBase {
|
|||||||
"../forge-gui/" : "";
|
"../forge-gui/" : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invokeInEdtNow(final Runnable proc) {
|
||||||
|
proc.run();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invokeInEdtLater(final Runnable proc) {
|
public void invokeInEdtLater(final Runnable proc) {
|
||||||
SwingUtilities.invokeLater(proc);
|
SwingUtilities.invokeLater(proc);
|
||||||
|
|||||||
@@ -64,6 +64,12 @@ public class GuiMobile implements IGuiBase {
|
|||||||
return assetsDir;
|
return assetsDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invokeInEdtNow(final Runnable proc) {
|
||||||
|
proc.run();
|
||||||
|
Gdx.graphics.requestRendering(); //must request rendering in case this procedure wasn't triggered by a local event
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void invokeInEdtLater(final Runnable proc) {
|
public void invokeInEdtLater(final Runnable proc) {
|
||||||
Gdx.app.postRunnable(proc);
|
Gdx.app.postRunnable(proc);
|
||||||
|
|||||||
@@ -21,16 +21,16 @@ public class FThreads {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void invokeInEdtLater(final Runnable runnable) {
|
public static void invokeInEdtLater(final Runnable proc) {
|
||||||
GuiBase.getInterface().invokeInEdtLater(runnable);
|
GuiBase.getInterface().invokeInEdtLater(proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void invokeInEdtNowOrLater(final Runnable proc) {
|
public static void invokeInEdtNowOrLater(final Runnable proc) {
|
||||||
if (isGuiThread()) {
|
if (isGuiThread()) {
|
||||||
proc.run();
|
GuiBase.getInterface().invokeInEdtNow(proc);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
invokeInEdtLater(proc);
|
GuiBase.getInterface().invokeInEdtLater(proc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ public interface IGuiBase {
|
|||||||
boolean isRunningOnDesktop();
|
boolean isRunningOnDesktop();
|
||||||
String getCurrentVersion();
|
String getCurrentVersion();
|
||||||
String getAssetsDir();
|
String getAssetsDir();
|
||||||
|
void invokeInEdtNow(Runnable runnable);
|
||||||
void invokeInEdtLater(Runnable runnable);
|
void invokeInEdtLater(Runnable runnable);
|
||||||
void invokeInEdtAndWait(Runnable proc);
|
void invokeInEdtAndWait(Runnable proc);
|
||||||
boolean isGuiThread();
|
boolean isGuiThread();
|
||||||
|
|||||||
Reference in New Issue
Block a user