Skip to content

Commit 7aed990

Browse files
committed
Close dialogs on game over
1 parent 7ba45df commit 7aed990

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/testing/dialogs/StatusDialog.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public class StatusDialog extends TUBaseDialog{
2727
private float duration = 10f;
2828
private boolean perma;
2929

30-
3130
public StatusDialog(){
3231
super("@tu-status-menu.name");
3332

src/testing/dialogs/TUBaseDialog.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package testing.dialogs;
22

3+
import arc.*;
4+
import mindustry.game.EventType.*;
35
import mindustry.ui.dialogs.*;
46
import testing.util.*;
57

@@ -14,6 +16,8 @@ public TUBaseDialog(String title){
1416
shown(() -> {
1517
TUVars.activeDialog = this;
1618
});
19+
20+
Events.on(GameOverEvent.class, e -> hide());
1721
}
1822

1923
protected void rebuild(){

src/testing/ui/TerrainPainterFragment.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,15 @@ public void build(Group parent){
233233
if(show) ui.hudfrag.shown = false;
234234
});
235235

236-
//Should run after rebuild
236+
//Disable pause menu when open and display message
237237
ui.paused.shown(() -> {
238238
if(show){
239239
ui.showInfoFade("@tu-painter.paused");
240240
Core.app.post(() -> ui.paused.hide());
241241
}
242242
});
243+
244+
Events.on(GameOverEvent.class, e -> hide());
243245
}
244246

245247
public void show(){

0 commit comments

Comments
 (0)