mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-25 05:51:47 -08:00
Merge branch 'master' of https://github.com/Anuken/Mindustry
This commit is contained in:
commit
cd1ed97e52
2 changed files with 14 additions and 0 deletions
|
|
@ -266,6 +266,11 @@ public class NetClient implements ApplicationListener{
|
|||
ui.showText("", message);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void onInfoPopup(String message, float duration, int align, int top, int left, int bottom, int right){
|
||||
ui.showInfoPopup(message, duration, align, top, left, bottom, right);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void onInfoToast(String message, float duration){
|
||||
ui.showInfoToast(message, duration);
|
||||
|
|
|
|||
|
|
@ -302,6 +302,15 @@ public class UI implements ApplicationListener, Loadable{
|
|||
Core.scene.add(table);
|
||||
}
|
||||
|
||||
public void showInfoPopup(String info, float duration, int align, int top, int left, int bottom, int right){
|
||||
Table table = new Table();
|
||||
table.setFillParent(true);
|
||||
table.update(() -> { if(state.is(State.menu)) table.remove(); });
|
||||
table.actions(Actions.delay(duration), Actions.remove());
|
||||
table.align(align).table(Styles.black3, t -> t.margin(4).add(info).style(Styles.outlineLabel)).pad(top,left,bottom,right);
|
||||
Core.scene.add(table);
|
||||
}
|
||||
|
||||
public void showInfo(String info){
|
||||
new Dialog(""){{
|
||||
getCell(cont).growX();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue