mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-28 07:22:21 -08:00
More UI and layout changes
This commit is contained in:
parent
2c5546c6fb
commit
f0959ab356
9 changed files with 50 additions and 60 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 53 KiB |
|
|
@ -112,7 +112,7 @@
|
|||
},
|
||||
clear-partial: {
|
||||
down: whiteui,
|
||||
up: button-select,
|
||||
up: pane,
|
||||
over: flat-down,
|
||||
font: default-font,
|
||||
fontColor: white,
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
},
|
||||
clear-full: {
|
||||
down: whiteui,
|
||||
up: button-select,
|
||||
up: pane,
|
||||
over: flat-down
|
||||
},
|
||||
clear-partial: {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ public class UI implements ApplicationListener{
|
|||
public HudFragment hudfrag;
|
||||
public ChatFragment chatfrag;
|
||||
public PlayerListFragment listfrag;
|
||||
public BackgroundFragment backfrag;
|
||||
public LoadingFragment loadfrag;
|
||||
|
||||
public WidgetGroup menuGroup, hudGroup;
|
||||
|
|
@ -159,7 +158,6 @@ public class UI implements ApplicationListener{
|
|||
hudfrag = new HudFragment();
|
||||
chatfrag = new ChatFragment();
|
||||
listfrag = new PlayerListFragment();
|
||||
backfrag = new BackgroundFragment();
|
||||
loadfrag = new LoadingFragment();
|
||||
|
||||
editor = new MapEditorDialog();
|
||||
|
|
@ -197,7 +195,6 @@ public class UI implements ApplicationListener{
|
|||
Core.scene.add(menuGroup);
|
||||
Core.scene.add(hudGroup);
|
||||
|
||||
// backfrag.build(group);
|
||||
control.input().getFrag().build(hudGroup);
|
||||
hudfrag.build(hudGroup);
|
||||
menufrag.build(menuGroup);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class ItemsDisplay extends Table{
|
|||
top().left();
|
||||
margin(0);
|
||||
|
||||
table("flat", t -> {
|
||||
table("button", t -> {
|
||||
t.margin(10).marginLeft(15).marginTop(15f);
|
||||
t.add("$launcheditems").colspan(3).left().padBottom(5);
|
||||
t.row();
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ import io.anuke.arc.Core;
|
|||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.collection.ObjectSet;
|
||||
import io.anuke.arc.collection.ObjectSet.ObjectSetIterator;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.graphics.g2d.Draw;
|
||||
import io.anuke.arc.graphics.g2d.Lines;
|
||||
import io.anuke.arc.scene.Group;
|
||||
import io.anuke.arc.scene.ui.Image;
|
||||
import io.anuke.arc.scene.ui.TextButton;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.arc.scene.ui.layout.Unit;
|
||||
import io.anuke.arc.util.Align;
|
||||
import io.anuke.arc.util.Structs;
|
||||
import io.anuke.arc.scene.ui.layout.*;
|
||||
import io.anuke.arc.util.*;
|
||||
import io.anuke.mindustry.content.Zones;
|
||||
import io.anuke.mindustry.core.GameState.State;
|
||||
import io.anuke.mindustry.game.Saves.SaveSlot;
|
||||
|
|
@ -57,48 +57,53 @@ public class DeployDialog extends FloatingDialog{
|
|||
Core.settings.save();
|
||||
}
|
||||
|
||||
cont.stack(control.saves.getZoneSlot() == null ? new View() : new Table(){{
|
||||
SaveSlot slot = control.saves.getZoneSlot();
|
||||
Stack stack = new Stack();
|
||||
stack.add(new View());
|
||||
|
||||
TextButton[] b = {null};
|
||||
if(control.saves.getZoneSlot() != null){
|
||||
stack.add(new Image("whiteui", new Color(0f, 0f, 0f, 0.9f)));
|
||||
stack.add(new Table(t -> {
|
||||
SaveSlot slot = control.saves.getZoneSlot();
|
||||
|
||||
TextButton button = addButton(Core.bundle.format("resume", slot.getZone().localizedName()), () -> {
|
||||
if(b[0].childrenPressed()) return;
|
||||
TextButton button = t.addButton(Core.bundle.format("resume", slot.getZone().localizedName()), () -> {
|
||||
|
||||
hide();
|
||||
ui.loadAnd(() -> {
|
||||
try{
|
||||
control.saves.getZoneSlot().load();
|
||||
state.set(State.playing);
|
||||
}catch(SaveException e){ //make sure to handle any save load errors!
|
||||
e.printStackTrace();
|
||||
if(control.saves.getZoneSlot() != null) control.saves.getZoneSlot().delete();
|
||||
Core.app.post(() -> ui.showInfo("$save.corrupted"));
|
||||
show();
|
||||
}
|
||||
});
|
||||
}).size(230f).get();
|
||||
b[0] = button;
|
||||
hide();
|
||||
ui.loadAnd(() -> {
|
||||
try{
|
||||
control.saves.getZoneSlot().load();
|
||||
state.set(State.playing);
|
||||
}catch(SaveException e){ //make sure to handle any save load errors!
|
||||
e.printStackTrace();
|
||||
if(control.saves.getZoneSlot() != null) control.saves.getZoneSlot().delete();
|
||||
Core.app.post(() -> ui.showInfo("$save.corrupted"));
|
||||
show();
|
||||
}
|
||||
});
|
||||
}).size(230f).get();
|
||||
|
||||
String color = "[lightgray]";
|
||||
String color = "[lightgray]";
|
||||
|
||||
button.defaults().colspan(2);
|
||||
button.row();
|
||||
button.add(Core.bundle.format("save.wave", color + slot.getWave()));
|
||||
button.row();
|
||||
button.label(() -> Core.bundle.format("save.playtime", color + slot.getPlayTime()));
|
||||
button.row();
|
||||
button.defaults().colspan(2);
|
||||
button.row();
|
||||
button.add(Core.bundle.format("save.wave", color + slot.getWave()));
|
||||
button.row();
|
||||
button.label(() -> Core.bundle.format("save.playtime", color + slot.getPlayTime()));
|
||||
button.row();
|
||||
|
||||
row();
|
||||
t.row();
|
||||
|
||||
addButton("$abandon", () -> {
|
||||
ui.showConfirm("$warning", "$abandon.text", () -> {
|
||||
slot.delete();
|
||||
setup();
|
||||
});
|
||||
}).fillX().height(50f).pad(3);
|
||||
t.addButton("$abandon", () -> {
|
||||
ui.showConfirm("$warning", "$abandon.text", () -> {
|
||||
slot.delete();
|
||||
setup();
|
||||
});
|
||||
}).fillX().height(50f).pad(3);
|
||||
}));
|
||||
}
|
||||
|
||||
}}, new ItemsDisplay()).grow();
|
||||
stack.add(new ItemsDisplay());
|
||||
|
||||
cont.add(stack).grow();
|
||||
|
||||
//set up direct and indirect children
|
||||
for(ZoneNode node : nodes){
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
package io.anuke.mindustry.ui.fragments;
|
||||
|
||||
import io.anuke.arc.scene.Group;
|
||||
|
||||
public class BackgroundFragment extends Fragment{
|
||||
|
||||
|
||||
@Override
|
||||
public void build(Group parent){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -68,7 +68,7 @@ public class MenuFragment extends Fragment{
|
|||
float logoh = logow * (float)logo.getHeight() / logo.getWidth();
|
||||
|
||||
Draw.color();
|
||||
Draw.rect(Draw.wrap(logo), (int)(Core.graphics.getWidth() / 2), (int)(Core.graphics.getHeight() - 10 - logoh) + logoh / 2 - (Core.graphics.isPortrait() ? Unit.dp.scl(30f) : 0f), logow, logoh);
|
||||
Draw.rect(Draw.wrap(logo), (Core.graphics.getWidth() / 2), (int)(Core.graphics.getHeight() - 10 - logoh) + logoh / 2 - (Core.graphics.isPortrait() ? Unit.dp.scl(30f) : 0f), logow, logoh);
|
||||
}).touchable(Touchable.disabled);
|
||||
}
|
||||
|
||||
|
|
@ -81,11 +81,11 @@ public class MenuFragment extends Fragment{
|
|||
container.defaults().size(size).pad(5).padTop(4f);
|
||||
|
||||
MobileButton
|
||||
play = new MobileButton("icon-play-2", isize, "$play", ui.deploy::show),
|
||||
maps = new MobileButton("icon-map", isize, "$maps", ui.maps::show),
|
||||
play = new MobileButton("icon-play-2", isize, "$campaign", ui.deploy::show),
|
||||
custom = new MobileButton("icon-play-custom", isize, "$customgame", this::showCustomSelect),
|
||||
maps = new MobileButton("icon-load", isize, "$loadgame", ui.load::show),
|
||||
join = new MobileButton("icon-add", isize, "$joingame", ui.join::show),
|
||||
editor = new MobileButton("icon-editor", isize, "$editor", () -> ui.loadAnd(ui.editor::show)),
|
||||
editor = new MobileButton("icon-editor", isize, "$editor", ui.maps::show),
|
||||
tools = new MobileButton("icon-tools", isize, "$settings", ui.settings::show),
|
||||
donate = new MobileButton("icon-donate", isize, "$donate", () -> Core.net.openURI(donationURL)),
|
||||
exit = new MobileButton("icon-exit", isize, "$quit", () -> Core.app.exit());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue