Skip to content

Commit

Permalink
Reset UI scale to 100% when broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Apr 8, 2023
1 parent f4fabec commit 11ad5a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions core/src/mindustry/Vars.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ public static void loadSettings(){
settings.setAutosave(false);
settings.load();

//https://github.com/Anuken/Mindustry/issues/8483
if(settings.getInt("uiscale") == 5){
settings.put("uiscale", 100);
}

Scl.setProduct(Math.max(settings.getInt("uiscale", 100), 25) / 100f);

if(!loadLocales) return;
Expand Down
4 changes: 2 additions & 2 deletions core/src/mindustry/entities/comp/BuildingComp.java
Original file line number Diff line number Diff line change
Expand Up @@ -1433,7 +1433,7 @@ public void display(Table table){
l.left();
for(Item item : content.items()){
if(flowItems.hasFlowItem(item)){
l.image(item.uiIcon).padRight(3f);
l.image(item.uiIcon).scaling(Scaling.fit).padRight(3f);
l.label(() -> flowItems.getFlowRate(item) < 0 ? "..." : Strings.fixed(flowItems.getFlowRate(item), 1) + ps).color(Color.lightGray);
l.row();
}
Expand Down Expand Up @@ -1463,7 +1463,7 @@ public void display(Table table){
l.left();
for(var liquid : content.liquids()){
if(liquids.hasFlowLiquid(liquid)){
l.image(liquid.uiIcon).padRight(3f);
l.image(liquid.uiIcon).scaling(Scaling.fit).size(32f).padRight(3f);
l.label(() -> liquids.getFlowRate(liquid) < 0 ? "..." : Strings.fixed(liquids.getFlowRate(liquid), 1) + ps).color(Color.lightGray);
l.row();
}
Expand Down
7 changes: 5 additions & 2 deletions core/src/mindustry/ui/fragments/HudFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -794,15 +794,18 @@ public void draw(){
if(!obj.qualified()) continue;

String text = obj.text();
if(text != null){
if(text != null && !text.isEmpty()){
if(!first) builder.append("\n[white]");
builder.append(text);

first = false;
}
}

return builder;
//TODO: display standard status when empty objective?
if(builder.length() > 0){
return builder;
}
}

if(!state.rules.waves && state.rules.attackMode){
Expand Down

0 comments on commit 11ad5a0

Please sign in to comment.