Added server info toast method
This commit is contained in:
@@ -266,6 +266,11 @@ public class NetClient implements ApplicationListener{
|
|||||||
ui.showText("", message);
|
ui.showText("", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Remote(variants = Variant.both)
|
||||||
|
public static void onInfoToast(String message, float duration){
|
||||||
|
ui.showInfoFadeBg(message, duration);
|
||||||
|
}
|
||||||
|
|
||||||
@Remote(variants = Variant.both)
|
@Remote(variants = Variant.both)
|
||||||
public static void onSetRules(Rules rules){
|
public static void onSetRules(Rules rules){
|
||||||
state.rules = rules;
|
state.rules = rules;
|
||||||
|
|||||||
@@ -289,6 +289,14 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
Core.scene.add(table);
|
Core.scene.add(table);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showInfoFadeBg(String info, float duration){
|
||||||
|
Table table = new Table();
|
||||||
|
table.setFillParent(true);
|
||||||
|
table.actions(Actions.delay(duration * 0.9f), Actions.fadeOut(duration * 0.1f, Interpolation.fade), Actions.remove());
|
||||||
|
table.top().table(Styles.black3, t -> t.margin(4).add(info).style(Styles.outlineLabel)).padTop(10);
|
||||||
|
Core.scene.add(table);
|
||||||
|
}
|
||||||
|
|
||||||
public void showInfo(String info){
|
public void showInfo(String info){
|
||||||
new Dialog(""){{
|
new Dialog(""){{
|
||||||
getCell(cont).growX();
|
getCell(cont).growX();
|
||||||
|
|||||||
Reference in New Issue
Block a user