mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09:27 +02:00
i hate crammed
This commit is contained in:
@@ -13,6 +13,7 @@ import arc.scene.style.TransformDrawable;
|
|||||||
import arc.scene.ui.*;
|
import arc.scene.ui.*;
|
||||||
import arc.scene.ui.layout.Stack;
|
import arc.scene.ui.layout.Stack;
|
||||||
import arc.scene.ui.layout.Table;
|
import arc.scene.ui.layout.Table;
|
||||||
|
import arc.scene.utils.Elem;
|
||||||
import arc.struct.Seq;
|
import arc.struct.Seq;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.Vars;
|
import mindustry.Vars;
|
||||||
@@ -500,9 +501,10 @@ public class HudUi {
|
|||||||
table.left();
|
table.left();
|
||||||
addBars();
|
addBars();
|
||||||
table.add(new Table(scene.getStyle(Button.ButtonStyle.class).up, t -> {
|
table.add(new Table(scene.getStyle(Button.ButtonStyle.class).up, t -> {
|
||||||
|
t.defaults().width(25 * 8f);
|
||||||
|
|
||||||
t.table(Tex.underline2, tt -> {
|
t.table(Tex.underline2, tt -> {
|
||||||
tt.top();
|
Stack stack = new Stack(){{
|
||||||
tt.add(new Stack(){{
|
|
||||||
add(new Table(ttt -> {
|
add(new Table(ttt -> {
|
||||||
ttt.add(new Image(){{
|
ttt.add(new Image(){{
|
||||||
update(() -> {
|
update(() -> {
|
||||||
@@ -531,7 +533,7 @@ public class HudUi {
|
|||||||
Label label = new Label(() -> (int)(getUnit().type == null ? 0 : getUnit().type.armor) + "");
|
Label label = new Label(() -> (int)(getUnit().type == null ? 0 : getUnit().type.armor) + "");
|
||||||
label.setColor(Pal.surge);
|
label.setColor(Pal.surge);
|
||||||
label.setSize(0.6f);
|
label.setSize(0.6f);
|
||||||
temp.add(label).center().padLeft(getUnit().type == null ? 8f : getUnit().type.armor < 10 ? 8f : 0f);
|
temp.add(label).center().padLeft(getUnit().type == null || getUnit().type.armor < 10 ? -4f : 0f);
|
||||||
temp.pack();
|
temp.pack();
|
||||||
}){
|
}){
|
||||||
@Override
|
@Override
|
||||||
@@ -542,25 +544,37 @@ public class HudUi {
|
|||||||
});
|
});
|
||||||
}}).growX().left().padLeft(5 * 8f);
|
}}).growX().left().padLeft(5 * 8f);
|
||||||
}));
|
}));
|
||||||
}}).left();
|
}};
|
||||||
tt.add(new Label(() ->{
|
|
||||||
|
Label label = new Label(() ->{
|
||||||
String name = "";
|
String name = "";
|
||||||
if(getUnit() instanceof BlockUnitUnit && ((BlockUnitUnit)getUnit()).tile() instanceof Turret.TurretBuild) name = "[accent]" + ((BlockUnitUnit)getUnit()).tile().block.localizedName + "[]";
|
if(getUnit() instanceof BlockUnitUnit && ((BlockUnitUnit)getUnit()).tile() instanceof Turret.TurretBuild) name = "[accent]" + ((BlockUnitUnit)getUnit()).tile().block.localizedName + "[]";
|
||||||
else if(getUnit() != null && getUnit().type != null) name = "[accent]" + getUnit().type.localizedName + "[]";
|
else if(getUnit() != null && getUnit().type != null) name = "[accent]" + getUnit().type.localizedName + "[]";
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
})).center();
|
});
|
||||||
tt.button("?", Styles.clearPartialt, () -> {
|
|
||||||
|
TextButton button = Elem.newButton("?", Styles.clearPartialt, () -> {
|
||||||
if(getUnit().type != null && getUnit() instanceof BlockUnitUnit && ((BlockUnitUnit)getUnit()).tile() instanceof Turret.TurretBuild) ui.content.show(((BlockUnitUnit)getUnit()).tile().block);
|
if(getUnit().type != null && getUnit() instanceof BlockUnitUnit && ((BlockUnitUnit)getUnit()).tile() instanceof Turret.TurretBuild) ui.content.show(((BlockUnitUnit)getUnit()).tile().block);
|
||||||
else if(getUnit().type != null) ui.content.show(getUnit().type);
|
else if(getUnit().type != null) ui.content.show(getUnit().type);
|
||||||
}).right().size(8 * 5).padTop(-5).padRight(-5).grow().name("info");
|
|
||||||
});
|
});
|
||||||
t.defaults().size(25 * 8f);
|
|
||||||
|
tt.top();
|
||||||
|
tt.table(ttt -> { //unit icon/armor
|
||||||
|
ttt.add(stack);
|
||||||
|
}).left();
|
||||||
|
tt.table(ttt -> { //unit name
|
||||||
|
ttt.defaults().width(12 * 8f);
|
||||||
|
ttt.add(label).padLeft(24f);
|
||||||
|
}).center();
|
||||||
|
tt.table(ttt -> { //unit info
|
||||||
|
ttt.defaults().size(5 * 8f);
|
||||||
|
ttt.add(button).padLeft(-24f);
|
||||||
|
}).right();
|
||||||
|
});
|
||||||
t.row();
|
t.row();
|
||||||
t.table(tt -> {
|
t.table(tt -> {
|
||||||
tt.defaults().width(23 * 8f);
|
tt.defaults().width(23 * 8f).height(4f * 8f).top();
|
||||||
tt.defaults().height(4f * 8f);
|
|
||||||
tt.top();
|
|
||||||
for(Element bar : bars){
|
for(Element bar : bars){
|
||||||
tt.add(bar).growX().left();
|
tt.add(bar).growX().left();
|
||||||
tt.row();
|
tt.row();
|
||||||
|
|||||||
Reference in New Issue
Block a user