Added map objective button

This commit is contained in:
Anuken
2022-04-19 19:00:22 -04:00
parent be9d3b334c
commit 6d7f8a1123
5 changed files with 50 additions and 19 deletions
+2
View File
@@ -310,6 +310,7 @@ openlink = Open Link
copylink = Copy Link copylink = Copy Link
back = Back back = Back
max = Max max = Max
objective = Map Objective
crash.export = Export Crash Logs crash.export = Export Crash Logs
crash.none = No crash logs found. crash.none = No crash logs found.
crash.exported = Crash logs exported. crash.exported = Crash logs exported.
@@ -700,6 +701,7 @@ sector.impact0078.description = Here lie remnants of the interstellar transport
sector.planetaryTerminal.description = The final target.\n\nThis coastal base contains a structure capable of launching Cores to local planets. It is extremely well guarded.\n\nProduce naval units. Eliminate the enemy as quickly as possible. Research the launch structure. sector.planetaryTerminal.description = The final target.\n\nThis coastal base contains a structure capable of launching Cores to local planets. It is extremely well guarded.\n\nProduce naval units. Eliminate the enemy as quickly as possible. Research the launch structure.
sector.onset.name = The Onset sector.onset.name = The Onset
sector.onset.description = The tutorial sector. This objective has not been created yet. Await further information.
status.burning.name = Burning status.burning.name = Burning
status.freezing.name = Freezing status.freezing.name = Freezing
+2
View File
@@ -72,6 +72,7 @@ public class UI implements ApplicationListener, Loadable{
public ModsDialog mods; public ModsDialog mods;
public ColorPicker picker; public ColorPicker picker;
public LogicDialog logic; public LogicDialog logic;
public FullTextDialog fullText;
public Cursor drillCursor, unloadCursor, targetCursor; public Cursor drillCursor, unloadCursor, targetCursor;
@@ -197,6 +198,7 @@ public class UI implements ApplicationListener, Loadable{
mods = new ModsDialog(); mods = new ModsDialog();
schematics = new SchematicsDialog(); schematics = new SchematicsDialog();
logic = new LogicDialog(); logic = new LogicDialog();
fullText = new FullTextDialog();
Group group = Core.scene.root; Group group = Core.scene.root;
@@ -0,0 +1,21 @@
package mindustry.ui.dialogs;
import arc.util.*;
public class FullTextDialog extends BaseDialog{
public FullTextDialog(){
super("");
shouldPause = true;
addCloseButton();
}
public void show(String titleText, String text){
title.setText(titleText);
cont.clear();
cont.add(text).grow().wrap().labelAlign(Align.center);
super.show();
}
}
@@ -32,6 +32,12 @@ public class PausedDialog extends BaseDialog{
float dw = 220f; float dw = 220f;
cont.defaults().width(dw).height(55).pad(5f); cont.defaults().width(dw).height(55).pad(5f);
cont.button("@objective", Icon.info, () -> {
//TODO pause game, better dialog.
ui.fullText.show("@objective", state.rules.sector.preset.description);
}).padTop(-60f).colspan(2)
.visible(() -> state.rules.sector != null && state.rules.sector.preset != null && state.rules.sector.preset.description != null).row();
cont.button("@back", Icon.left, this::hide).name("back"); cont.button("@back", Icon.left, this::hide).name("back");
cont.button("@settings", Icon.settings, ui.settings::show).name("settings"); cont.button("@settings", Icon.settings, ui.settings::show).name("settings");