mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09:27 +02:00
fixed scaling 1
This commit is contained in:
@@ -3,6 +3,7 @@ package UnitInfo;
|
|||||||
import UnitInfo.core.*;
|
import UnitInfo.core.*;
|
||||||
import arc.files.*;
|
import arc.files.*;
|
||||||
import arc.graphics.g2d.TextureRegion;
|
import arc.graphics.g2d.TextureRegion;
|
||||||
|
import arc.scene.ui.layout.Scl;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import mindustry.world.Tile;
|
import mindustry.world.Tile;
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ public class SVars {
|
|||||||
public static TextureRegion clear = atlas.find("clear");
|
public static TextureRegion clear = atlas.find("clear");
|
||||||
public static TextureRegion error = atlas.find("error");
|
public static TextureRegion error = atlas.find("error");
|
||||||
public static float modUiScale = settings.getInt("infoUiScale") / 100f == 0 ? 1 : settings.getInt("infoUiScale") / 100f;
|
public static float modUiScale = settings.getInt("infoUiScale") / 100f == 0 ? 1 : settings.getInt("infoUiScale") / 100f;
|
||||||
|
public static float scaledScale = Scl.scl(Math.min(modUiScale, 1));
|
||||||
|
|
||||||
public static Seq<Tile> pathTiles = new Seq<>();
|
public static Seq<Tile> pathTiles = new Seq<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ public class HudUi {
|
|||||||
ttt.top().right();
|
ttt.top().right();
|
||||||
Image image = new Image(Icon.warning.getRegion()).setScaling(Scaling.fit);
|
Image image = new Image(Icon.warning.getRegion()).setScaling(Scaling.fit);
|
||||||
image.update(() -> image.setColor(Tmp.c2.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f))));
|
image.update(() -> image.setColor(Tmp.c2.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f))));
|
||||||
ttt.add(image).size(Scl.scl(Math.min(modUiScale, 1)) * 12f);
|
ttt.add(image).size(scaledScale * 12f);
|
||||||
ttt.pack();
|
ttt.pack();
|
||||||
}));
|
}));
|
||||||
}}).pad(6);
|
}}).pad(6);
|
||||||
@@ -448,7 +448,7 @@ public class HudUi {
|
|||||||
fontColor = Color.white;
|
fontColor = Color.white;
|
||||||
background = Styles.black8;
|
background = Styles.black8;
|
||||||
}});
|
}});
|
||||||
if(modUiScale < 1) label.setFontScale(Scl.scl(modUiScale));
|
label.setFontScale(scaledScale);
|
||||||
Table labelTable = new Table(t -> t.add(label).left().padRight(Scl.scl(modUiScale) * 40 * 8f));
|
Table labelTable = new Table(t -> t.add(label).left().padRight(Scl.scl(modUiScale) * 40 * 8f));
|
||||||
|
|
||||||
table.table(t -> {
|
table.table(t -> {
|
||||||
@@ -755,7 +755,7 @@ public class HudUi {
|
|||||||
public void addUnitTable(){
|
public void addUnitTable(){
|
||||||
if(uiIndex != 0) return;
|
if(uiIndex != 0) return;
|
||||||
unitTable = new Table(table -> {
|
unitTable = new Table(table -> {
|
||||||
table.left().defaults().width(Scl.scl(Math.min(modUiScale, 1)) * 27 * 8f).maxHeight(Scl.scl(Math.min(modUiScale, 1)) * 35 * 8f).align(Align.left);
|
table.left().defaults().width(scaledScale * 27 * 8f).maxHeight(scaledScale * 35 * 8f).align(Align.left);
|
||||||
addBars();
|
addBars();
|
||||||
Table table1 = new Table(Tex.button, t -> {
|
Table table1 = new Table(Tex.button, t -> {
|
||||||
t.table(Tex.underline2, tt -> {
|
t.table(Tex.underline2, tt -> {
|
||||||
@@ -802,7 +802,7 @@ public class HudUi {
|
|||||||
if(name.length() > 12) return name.substring(0, 12) + "...";
|
if(name.length() > 12) return name.substring(0, 12) + "...";
|
||||||
return name;
|
return name;
|
||||||
});
|
});
|
||||||
if(modUiScale < 1) label.setFontScale(Scl.scl(modUiScale));
|
label.setFontScale(scaledScale);
|
||||||
|
|
||||||
TextButton button = Elem.newButton("?", Styles.clearPartialt, () -> {
|
TextButton button = Elem.newButton("?", Styles.clearPartialt, () -> {
|
||||||
if(getTarget() instanceof Unit u && u.type != null)
|
if(getTarget() instanceof Unit u && u.type != null)
|
||||||
@@ -845,12 +845,12 @@ public class HudUi {
|
|||||||
else if(getTarget() instanceof Building b) return b.block.localizedName;
|
else if(getTarget() instanceof Building b) return b.block.localizedName;
|
||||||
return "";
|
return "";
|
||||||
});
|
});
|
||||||
if(modUiScale < 1) label2.setFontScale(Scl.scl(modUiScale));
|
label2.setFontScale(scaledScale);
|
||||||
tool2.add(label2);
|
tool2.add(label2);
|
||||||
});
|
});
|
||||||
to.row();
|
to.row();
|
||||||
Label label2 = new Label(()->getTarget() == null ? "(" + 0 + ", " + 0 + ")" : "(" + Strings.fixed(getTarget().x() / tilesize, 2) + ", " + Strings.fixed(getTarget().y() / tilesize, 2) + ")");
|
Label label2 = new Label(()->getTarget() == null ? "(" + 0 + ", " + 0 + ")" : "(" + Strings.fixed(getTarget().x() / tilesize, 2) + ", " + Strings.fixed(getTarget().y() / tilesize, 2) + ")");
|
||||||
if(modUiScale < 1) label2.setFontScale(Scl.scl(modUiScale));
|
label2.setFontScale(scaledScale);
|
||||||
to.add(label2);
|
to.add(label2);
|
||||||
})));
|
})));
|
||||||
tt.update(()->tt.setBackground(((NinePatchDrawable)Tex.underline2).tint(getTarget().isNull() ? Color.gray : getTarget().team().color)));
|
tt.update(()->tt.setBackground(((NinePatchDrawable)Tex.underline2).tint(getTarget().isNull() ? Color.gray : getTarget().team().color)));
|
||||||
@@ -909,10 +909,8 @@ public class HudUi {
|
|||||||
if(!settings.getBool("emptywave") && state.rules.spawns.find(g -> g.getSpawned(j) > 0) == null) continue;
|
if(!settings.getBool("emptywave") && state.rules.spawns.find(g -> g.getSpawned(j) > 0) == null) continue;
|
||||||
table.table(t -> {
|
table.table(t -> {
|
||||||
table.center();
|
table.center();
|
||||||
final int jj = j+1;
|
Label label = new Label(() -> "[#" + (state.wave == j+1 ? Color.red.toString() : Pal.accent.toString()) + "]" + (j+1) + "[]");
|
||||||
Label label = new Label(() -> "[#" + (state.wave == j+1 ? Color.red.toString() : Pal.accent.toString()) + "]" + jj + "[]");
|
label.setFontScale(scaledScale);
|
||||||
if(modUiScale < 1) label.setFontScale(Scl.scl(modUiScale));
|
|
||||||
|
|
||||||
t.add(label);
|
t.add(label);
|
||||||
}).size(Scl.scl(modUiScale) * 4 * 8f);
|
}).size(Scl.scl(modUiScale) * 4 * 8f);
|
||||||
|
|
||||||
@@ -922,9 +920,8 @@ public class HudUi {
|
|||||||
tx.add("[lightgray]<Empty>[]");
|
tx.add("[lightgray]<Empty>[]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int row = 0;
|
|
||||||
ObjectIntMap<SpawnGroup> groups = new ObjectIntMap<>();
|
|
||||||
|
|
||||||
|
ObjectIntMap<SpawnGroup> groups = new ObjectIntMap<>();
|
||||||
for(SpawnGroup group : state.rules.spawns) {
|
for(SpawnGroup group : state.rules.spawns) {
|
||||||
if(group.getSpawned(j) <= 0) continue;
|
if(group.getSpawned(j) <= 0) continue;
|
||||||
SpawnGroup sameTypeKey = groups.keys().toArray().find(g -> g.type == group.type && g.effect != StatusEffects.boss);
|
SpawnGroup sameTypeKey = groups.keys().toArray().find(g -> g.type == group.type && g.effect != StatusEffects.boss);
|
||||||
@@ -941,37 +938,36 @@ public class HudUi {
|
|||||||
ObjectIntMap<SpawnGroup> groupsTmp = new ObjectIntMap<>();
|
ObjectIntMap<SpawnGroup> groupsTmp = new ObjectIntMap<>();
|
||||||
groupSorted.each(g -> groupsTmp.put(g, groups.get(g)));
|
groupSorted.each(g -> groupsTmp.put(g, groups.get(g)));
|
||||||
|
|
||||||
|
int row = 0;
|
||||||
for(SpawnGroup group : groupsTmp.keys()){
|
for(SpawnGroup group : groupsTmp.keys()){
|
||||||
int amount = groupsTmp.get(group);
|
int amount = groupsTmp.get(group);
|
||||||
row ++;
|
|
||||||
|
|
||||||
tx.table(tt -> {
|
tx.table(tt -> {
|
||||||
tt.right();
|
tt.right();
|
||||||
Image image = new Image(group.type.uiIcon).setScaling(Scaling.fit);
|
Image image = new Image(group.type.uiIcon).setScaling(Scaling.fit);
|
||||||
tt.add(new Stack(){{
|
tt.stack(
|
||||||
add(new Table(ttt -> {
|
new Table(ttt -> {
|
||||||
ttt.center();
|
ttt.center();
|
||||||
ttt.add(image).size(iconLarge * Scl.scl(Math.min(modUiScale, 1)));
|
ttt.add(image).size(iconMed * scaledScale);
|
||||||
ttt.pack();
|
ttt.pack();
|
||||||
}));
|
}),
|
||||||
|
|
||||||
add(new Table(ttt -> {
|
new Table(ttt -> {
|
||||||
ttt.bottom().left();
|
ttt.bottom().left();
|
||||||
Label label = new Label(() -> amount + "");
|
Label label = new Label(() -> amount + "");
|
||||||
if(modUiScale < 1) label.setFontScale(Scl.scl(modUiScale));
|
label.setFontScale(scaledScale * 0.85f);
|
||||||
ttt.add(label);
|
ttt.add(label);
|
||||||
ttt.pack();
|
ttt.pack();
|
||||||
}));
|
}),
|
||||||
|
|
||||||
add(new Table(ttt -> {
|
new Table(ttt -> {
|
||||||
ttt.top().right();
|
ttt.top().right();
|
||||||
Image image = new Image(Icon.warning.getRegion()).setScaling(Scaling.fit);
|
Image image1 = new Image(Icon.warning.getRegion()).setScaling(Scaling.fit);
|
||||||
image.update(() -> image.setColor(Tmp.c2.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f))));
|
image1.update(() -> image1.setColor(Tmp.c2.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time, 2f, 1f))));
|
||||||
ttt.add(image).size(Scl.scl(Math.min(modUiScale, 1)) * 12f);
|
ttt.add(image1).size(scaledScale * 12f);
|
||||||
ttt.visible(() -> group.effect == StatusEffects.boss);
|
ttt.visible(() -> group.effect == StatusEffects.boss);
|
||||||
ttt.pack();
|
ttt.pack();
|
||||||
}));
|
})
|
||||||
}}).pad(2f * Scl.scl(modUiScale));
|
).pad(2f * Scl.scl(modUiScale));
|
||||||
tt.clicked(() -> {
|
tt.clicked(() -> {
|
||||||
if(input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(group.type.name) != 0){
|
if(input.keyDown(KeyCode.shiftLeft) && Fonts.getUnicode(group.type.name) != 0){
|
||||||
app.setClipboardText((char)Fonts.getUnicode(group.type.name) + "");
|
app.setClipboardText((char)Fonts.getUnicode(group.type.name) + "");
|
||||||
@@ -1029,7 +1025,7 @@ public class HudUi {
|
|||||||
}
|
}
|
||||||
})));
|
})));
|
||||||
});
|
});
|
||||||
if(row % 4 == 0) tx.row();
|
if(++row % 4 == 0) tx.row();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
table.row();
|
table.row();
|
||||||
@@ -1056,7 +1052,7 @@ public class HudUi {
|
|||||||
wavePane.setWidget(new Table(tx -> tx.table(this::setWave).left()));
|
wavePane.setWidget(new Table(tx -> tx.table(this::setWave).left()));
|
||||||
|
|
||||||
waveTable = new Table(table -> {
|
waveTable = new Table(table -> {
|
||||||
table.left().defaults().width(Scl.scl(Math.min(modUiScale, 1)) * 32 * 8f).maxHeight(Scl.scl(Math.min(modUiScale, 1)) * 32 * 8f).align(Align.left);
|
table.left().defaults().width(scaledScale * 32 * 8f).maxHeight(scaledScale * 32 * 8f).align(Align.left);
|
||||||
table.add(new Table(Tex.button, t -> t.add(wavePane)){
|
table.add(new Table(Tex.button, t -> t.add(wavePane)){
|
||||||
@Override
|
@Override
|
||||||
protected void drawBackground(float x, float y) {
|
protected void drawBackground(float x, float y) {
|
||||||
@@ -1065,7 +1061,7 @@ public class HudUi {
|
|||||||
getBackground().draw(x, y, width, height);
|
getBackground().draw(x, y, width, height);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
}).padRight(Scl.scl(Math.min(modUiScale, 1)) * 39 * 8f);
|
}).padRight(scaledScale * 39 * 8f);
|
||||||
|
|
||||||
table.fillParent = true;
|
table.fillParent = true;
|
||||||
table.visibility = () -> uiIndex == 1;
|
table.visibility = () -> uiIndex == 1;
|
||||||
@@ -1078,7 +1074,7 @@ public class HudUi {
|
|||||||
if((state.rules.pvp && coreItems.teams[i] != player.team()) || coreItems.teams[i].cores().isEmpty()) continue;
|
if((state.rules.pvp && coreItems.teams[i] != player.team()) || coreItems.teams[i].cores().isEmpty()) continue;
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
Label label = new Label(() -> "[#" + coreItems.teams[finalI].color.toString() + "]" + coreItems.teams[finalI].name + "[]");
|
Label label = new Label(() -> "[#" + coreItems.teams[finalI].color.toString() + "]" + coreItems.teams[finalI].name + "[]");
|
||||||
if(modUiScale < 1) label.setFontScale(Scl.scl(modUiScale));
|
label.setFontScale(scaledScale);
|
||||||
t.background(Tex.underline2).add(label).center();
|
t.background(Tex.underline2).add(label).center();
|
||||||
t.row();
|
t.row();
|
||||||
t.add(coreItems.tables.get(finalI)).left();
|
t.add(coreItems.tables.get(finalI)).left();
|
||||||
@@ -1104,14 +1100,14 @@ public class HudUi {
|
|||||||
});
|
});
|
||||||
|
|
||||||
itemTable = new Table(table -> {
|
itemTable = new Table(table -> {
|
||||||
table.left().defaults().width(Scl.scl(Math.min(modUiScale, 1)) * 50 * 8f).height(Scl.scl(Math.min(modUiScale, 1)) * 32 * 8f).align(Align.left);
|
table.left().defaults().width(scaledScale * 50 * 8f).height(scaledScale * 32 * 8f).align(Align.left);
|
||||||
table.table(Tex.button, t -> {
|
table.table(Tex.button, t -> {
|
||||||
t.add(itemPane);
|
t.add(itemPane);
|
||||||
t.update(() -> {
|
t.update(() -> {
|
||||||
NinePatchDrawable patch = (NinePatchDrawable)Tex.button;
|
NinePatchDrawable patch = (NinePatchDrawable)Tex.button;
|
||||||
t.setBackground(patch.tint(Tmp.c1.set(patch.getPatch().getColor()).a(settings.getInt("uiopacity") / 100f)));
|
t.setBackground(patch.tint(Tmp.c1.set(patch.getPatch().getColor()).a(settings.getInt("uiopacity") / 100f)));
|
||||||
});
|
});
|
||||||
}).padRight(Scl.scl(Math.min(modUiScale, 1)) * 39 * 8f);
|
}).padRight(scaledScale * 39 * 8f);
|
||||||
|
|
||||||
table.fillParent = true;
|
table.fillParent = true;
|
||||||
table.visibility = () -> uiIndex == 2;
|
table.visibility = () -> uiIndex == 2;
|
||||||
|
|||||||
@@ -3,12 +3,8 @@ package UnitInfo.ui;
|
|||||||
import arc.Core;
|
import arc.Core;
|
||||||
import arc.graphics.Color;
|
import arc.graphics.Color;
|
||||||
import arc.math.Mathf;
|
import arc.math.Mathf;
|
||||||
import arc.scene.Element;
|
|
||||||
import arc.scene.event.HandCursorListener;
|
import arc.scene.event.HandCursorListener;
|
||||||
import arc.scene.ui.Image;
|
import arc.scene.ui.*;
|
||||||
import arc.scene.ui.Label;
|
|
||||||
import arc.scene.ui.ScrollPane;
|
|
||||||
import arc.scene.ui.Tooltip;
|
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.Strings;
|
import arc.util.Strings;
|
||||||
@@ -24,9 +20,7 @@ import mindustry.type.*;
|
|||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import mindustry.world.blocks.storage.*;
|
import mindustry.world.blocks.storage.*;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import static UnitInfo.SVars.*;
|
||||||
|
|
||||||
import static UnitInfo.SVars.modUiScale;
|
|
||||||
import static arc.Core.*;
|
import static arc.Core.*;
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -39,7 +33,9 @@ public class CoresItemsDisplay {
|
|||||||
private CoreBlock.CoreBuild core;
|
private CoreBlock.CoreBuild core;
|
||||||
public Team[] teams;
|
public Team[] teams;
|
||||||
public Seq<Table> tables = new Seq<>();
|
public Seq<Table> tables = new Seq<>();
|
||||||
|
|
||||||
float heat;
|
float heat;
|
||||||
|
boolean once;
|
||||||
|
|
||||||
public CoresItemsDisplay(Team[] teams) {
|
public CoresItemsDisplay(Team[] teams) {
|
||||||
this.teams = teams;
|
this.teams = teams;
|
||||||
@@ -82,7 +78,7 @@ public class CoresItemsDisplay {
|
|||||||
public Table setTable(Team team){
|
public Table setTable(Team team){
|
||||||
return new Table(t -> {
|
return new Table(t -> {
|
||||||
t.clear();
|
t.clear();
|
||||||
t.background(Styles.black6).margin(2).defaults().width(Scl.scl(Math.min(modUiScale, 1)) * 48 * 8f);
|
t.background(Styles.black6).margin(2).defaults().width(scaledScale * 48 * 8f);
|
||||||
|
|
||||||
t.update(() -> {
|
t.update(() -> {
|
||||||
core = team.core();
|
core = team.core();
|
||||||
@@ -92,20 +88,17 @@ public class CoresItemsDisplay {
|
|||||||
heat = 0;
|
heat = 0;
|
||||||
updateItem(team);
|
updateItem(team);
|
||||||
}
|
}
|
||||||
if(coreAmount.get(team) != team.cores().size ||
|
if(coreAmount.get(team) != team.cores().size){
|
||||||
content.items().contains(item -> core != null && core.items.get(item) > 0 && usedItems.get(team).add(item)) ||
|
coreAmount.put(team, team.cores().size);
|
||||||
content.units().contains(unit -> Groups.unit.count(u -> u.type == unit && u.team == team) > 0 && usedUnits.get(team).add(unit))){
|
|
||||||
rebuild();
|
rebuild();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
final int[] i = {0};
|
|
||||||
t.table(coretable -> {
|
t.table(coretable -> {
|
||||||
|
final int[] i = {0};
|
||||||
for(CoreBlock.CoreBuild core : team.cores()) {
|
for(CoreBlock.CoreBuild core : team.cores()) {
|
||||||
coretable.table().update(tt -> {
|
coretable.table(tt -> {
|
||||||
tt.clear();
|
tt.stack(
|
||||||
tt.table(ttt -> {
|
|
||||||
ttt.stack(
|
|
||||||
new Table(s -> {
|
new Table(s -> {
|
||||||
s.center();
|
s.center();
|
||||||
Image image = new Image(core.block.uiIcon);
|
Image image = new Image(core.block.uiIcon);
|
||||||
@@ -124,7 +117,7 @@ public class CoresItemsDisplay {
|
|||||||
if (modUiScale < 1) label.setFontScale(Scl.scl(modUiScale));
|
if (modUiScale < 1) label.setFontScale(Scl.scl(modUiScale));
|
||||||
tttt.background(Tex.button).add(label);
|
tttt.background(Tex.button).add(label);
|
||||||
}));
|
}));
|
||||||
s.add(image).size(iconLarge * Scl.scl(Math.min(modUiScale, 1)));
|
s.add(image).size(iconLarge * scaledScale);
|
||||||
}),
|
}),
|
||||||
new Table(h -> {
|
new Table(h -> {
|
||||||
h.bottom().defaults().height(Scl.scl(modUiScale) * 9f).width(Scl.scl(modUiScale) * iconLarge * 1.5f).growX();
|
h.bottom().defaults().height(Scl.scl(modUiScale) * 9f).width(Scl.scl(modUiScale) * iconLarge * 1.5f).growX();
|
||||||
@@ -132,29 +125,28 @@ public class CoresItemsDisplay {
|
|||||||
h.pack();
|
h.pack();
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
ttt.row();
|
tt.row();
|
||||||
Label label = new Label(() -> "(" + (int) core.x / 8 + ", " + (int) core.y / 8 + ")");
|
Label label = new Label(() -> "(" + (int) core.x / 8 + ", " + (int) core.y / 8 + ")");
|
||||||
label.setFontScale(Scl.scl(Math.min(modUiScale, 1)) * 0.75f);
|
label.setFontScale(scaledScale * 0.75f);
|
||||||
ttt.add(label);
|
tt.add(label);
|
||||||
});
|
}).padTop(scaledScale * 2).padLeft(scaledScale * 4).padRight(scaledScale * 4);
|
||||||
if(++i[0] % 5 == 0) coretable.row();
|
if(++i[0] % 5 == 0) coretable.row();
|
||||||
}).padLeft(4).padRight(4);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
t.row();
|
t.row();
|
||||||
i[0] = 0;
|
t.table().update(itemTable -> {
|
||||||
t.table(itemTable -> {
|
itemTable.clear();
|
||||||
itemTable.center();
|
final int[] i = {0};
|
||||||
for(Item item : content.items()){
|
for(Item item : content.items()){
|
||||||
itemTable.table().update(tt -> {
|
itemTable.table(tt -> {
|
||||||
tt.clear();
|
tt.center();
|
||||||
if(team.core() != null && team.core().items.has(item)) {
|
if(team.core() != null && team.core().items.has(item)) {
|
||||||
tt.stack(
|
tt.stack(
|
||||||
new Table(ttt -> {
|
new Table(ttt -> {
|
||||||
ttt.image(item.uiIcon).size(iconSmall * Scl.scl(Math.min(modUiScale, 1))).tooltip(tttt -> tttt.background(Styles.black6).margin(2f * Scl.scl(Math.min(modUiScale, 1))).add(item.localizedName).style(Styles.outlineLabel));
|
ttt.image(item.uiIcon).size(iconSmall * scaledScale).tooltip(tttt -> tttt.background(Styles.black6).margin(2f * scaledScale).add(item.localizedName).style(Styles.outlineLabel));
|
||||||
Label label = new Label(() -> core == null ? "0" : UI.formatAmount(core.items.get(item)));
|
Label label = new Label(() -> core == null ? "0" : UI.formatAmount(core.items.get(item)));
|
||||||
label.setFontScale(Scl.scl(Math.min(modUiScale, 1)));
|
label.setFontScale(scaledScale);
|
||||||
ttt.add(label).minWidth(5 * 8f * Scl.scl(Math.min(modUiScale, 1))).left();
|
ttt.add(label).minWidth(5 * 8f * scaledScale).left();
|
||||||
}),
|
}),
|
||||||
new Table(ttt -> {
|
new Table(ttt -> {
|
||||||
ttt.bottom().right();
|
ttt.bottom().right();
|
||||||
@@ -162,28 +154,28 @@ public class CoresItemsDisplay {
|
|||||||
int amount = updateItems.get(team).get(item.id).amount;
|
int amount = updateItems.get(team).get(item.id).amount;
|
||||||
return (amount > 0 ? "[green]+" : amount == 0 ? "[orange]" : "[red]") + amount + "[]";
|
return (amount > 0 ? "[green]+" : amount == 0 ? "[orange]" : "[red]") + amount + "[]";
|
||||||
});
|
});
|
||||||
label.setFontScale(0.65f * Scl.scl(Math.min(modUiScale, 1)));
|
label.setFontScale(0.65f * scaledScale);
|
||||||
ttt.add(label).bottom().right().padTop(16f * Scl.scl(Math.min(modUiScale, 1)));
|
ttt.add(label).bottom().right().padTop(16f * scaledScale);
|
||||||
ttt.pack();
|
ttt.pack();
|
||||||
})
|
})
|
||||||
).padRight(3 * Scl.scl(Math.min(modUiScale, 1))).left();
|
).padRight(3 * scaledScale).left();
|
||||||
if(++i[0] % 5 == 0) itemTable.row();
|
if(++i[0] % 5 == 0) itemTable.row();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
t.row();
|
t.row();
|
||||||
i[0] = 0;
|
t.table().update(unitTable -> {
|
||||||
t.table(unitTable -> {
|
unitTable.clear();
|
||||||
unitTable.center();
|
final int[] i = {0};
|
||||||
for(UnitType unit : content.units()){
|
for(UnitType unit : content.units()){
|
||||||
unitTable.table().update(tt -> {
|
unitTable.table(tt -> {
|
||||||
tt.clear();
|
tt.center();
|
||||||
if(unit != UnitTypes.block && Groups.unit.contains(u -> u.type == unit && u.team == team)){
|
if(unit != UnitTypes.block && Groups.unit.contains(u -> u.type == unit && u.team == team)){
|
||||||
tt.image(unit.uiIcon).size(iconSmall * Scl.scl(Math.min(modUiScale, 1))).padRight(3 * Scl.scl(Math.min(modUiScale, 1))).tooltip(ttt -> ttt.background(Styles.black6).margin(2f * Scl.scl(Math.min(modUiScale, 1))).add(unit.localizedName).style(Styles.outlineLabel));
|
tt.image(unit.uiIcon).size(iconSmall * scaledScale).padRight(3 * scaledScale).tooltip(ttt -> ttt.background(Styles.black6).margin(2f * scaledScale).add(unit.localizedName).style(Styles.outlineLabel));
|
||||||
Label label = new Label(() -> core == null ? "0" : UI.formatAmount(Groups.unit.count(u -> u.team == team && u.type == unit)));
|
Label label = new Label(() -> core == null ? "0" : UI.formatAmount(Groups.unit.count(u -> u.team == team && u.type == unit)));
|
||||||
label.setFontScale(Scl.scl(Math.min(modUiScale, 1)));
|
label.setFontScale(scaledScale);
|
||||||
tt.add(label).padRight(3 * Scl.scl(Math.min(modUiScale, 1))).minWidth(5 * 8f * Scl.scl(Math.min(modUiScale, 1))).left();
|
tt.add(label).padRight(3 * scaledScale).minWidth(5 * 8f * scaledScale).left();
|
||||||
if(++i[0] % 5 == 0) unitTable.row();
|
if(++i[0] % 5 == 0) unitTable.row();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user