mirror of
https://github.com/yawaflua/Informatis.git
synced 2025-12-10 12:09:27 +02:00
ui scale
This commit is contained in:
@@ -12,6 +12,7 @@ import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.blocks.storage.*;
|
||||
|
||||
import static UnitInfo.SVars.modUiScale;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class CoresItemsDisplay {
|
||||
@@ -95,8 +96,10 @@ public class CoresItemsDisplay {
|
||||
if(usedItems.get(team).contains(item)){
|
||||
itemTable.add(new Stack(){{
|
||||
add(new Table(tt -> {
|
||||
tt.image(item.uiIcon).size(iconSmall).tooltip(ttt -> ttt.background(Styles.black6).margin(2f).add(item.localizedName).style(Styles.outlineLabel));
|
||||
tt.label(() -> core == null ? "0" : UI.formatAmount(core.items.get(item))).minWidth(5 * 8f).left();
|
||||
tt.image(item.uiIcon).size(iconSmall * Scl.scl(modUiScale < 1 ? modUiScale : 1)).tooltip(ttt -> ttt.background(Styles.black6).margin(2f * Scl.scl(modUiScale)).add(item.localizedName).style(Styles.outlineLabel));
|
||||
Label label = new Label(() -> core == null ? "0" : UI.formatAmount(core.items.get(item)));
|
||||
label.setFontScale(Scl.scl(modUiScale < 1 ? modUiScale : 1));
|
||||
tt.add(label).minWidth(5 * 8f * Scl.scl(modUiScale)).left();
|
||||
}));
|
||||
add(new Table(tt -> {
|
||||
tt.bottom().right();
|
||||
@@ -104,11 +107,11 @@ public class CoresItemsDisplay {
|
||||
int amount = updateItems.get(team).get(item.id).amount;
|
||||
return (amount > 0 ? "[green]+" : amount == 0 ? "[orange]" : "[red]") + amount + "[]";
|
||||
});
|
||||
label.setFontScale(0.65f);
|
||||
tt.add(label).bottom().right().padTop(16f);
|
||||
label.setFontScale(0.65f * Scl.scl(modUiScale < 1 ? modUiScale : 1));
|
||||
tt.add(label).bottom().right().padTop(16f * Scl.scl(modUiScale));
|
||||
tt.pack();
|
||||
}));
|
||||
}}).padRight(3).left();
|
||||
}}).padRight(3 * Scl.scl(modUiScale)).left();
|
||||
if(++i[0] % 5 == 0) itemTable.row();
|
||||
}
|
||||
}
|
||||
@@ -119,8 +122,11 @@ public class CoresItemsDisplay {
|
||||
unitTable.center();
|
||||
for(UnitType unit : content.units()){
|
||||
if(unit != UnitTypes.block && usedUnits.get(team).contains(unit)){
|
||||
unitTable.image(unit.uiIcon).size(iconSmall).padRight(3).tooltip(tt -> tt.background(Styles.black6).margin(2f).add(unit.localizedName).style(Styles.outlineLabel));
|
||||
unitTable.label(() -> core == null ? "0" : UI.formatAmount(Groups.unit.count(u -> u.team == team && u.type == unit))).padRight(3).minWidth(5 * 8f).left();
|
||||
unitTable.image(unit.uiIcon).size(iconSmall * Scl.scl(modUiScale < 1 ? modUiScale : 1)).padRight(3 * Scl.scl(modUiScale)).tooltip(tt -> tt.background(Styles.black6).margin(2f * Scl.scl(modUiScale)).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.setFontScale(Scl.scl(modUiScale < 1 ? modUiScale : 1));
|
||||
unitTable.add(label).padRight(3 * Scl.scl(modUiScale)).minWidth(5 * 8f * Scl.scl(modUiScale)).left();
|
||||
|
||||
if(++i[0] % 5 == 0) unitTable.row();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user