More UI fixes

This commit is contained in:
Anuken
2026-09-09 09:07:37 -04:00
parent cfe01850aa
commit 80a99eb031
2 changed files with 4 additions and 3 deletions
@@ -10,6 +10,7 @@ import arc.scene.ui.layout.*;
import arc.util.*; import arc.util.*;
import mindustry.gen.*; import mindustry.gen.*;
import mindustry.graphics.*; import mindustry.graphics.*;
import mindustry.input.*;
import mindustry.ui.*; import mindustry.ui.*;
import java.util.*; import java.util.*;
@@ -118,7 +119,7 @@ public class KeybindDialog extends Dialog{
openDialog(keybind); openDialog(keybind);
}).size(bw, bh); }).size(bw, bh);
} }
table.button("@settings.resetKey", tstyle, keybind::resetToDefault).disabled(t -> keybind.isDefault()).size(bw, bh).pad(2f).padLeft(4f); if(keybind != Binding.menu) table.button("@settings.resetKey", tstyle, keybind::resetToDefault).disabled(t -> keybind.isDefault()).size(bw, bh).pad(2f).padLeft(4f);
table.row(); table.row();
} }
@@ -404,7 +404,7 @@ public class PlacementFragment{
line.left(); line.left();
line.image(stack.item.uiIcon).size(8 * 2); line.image(stack.item.uiIcon).size(8 * 2);
line.add(stack.item.localizedName).maxWidth(140f).fillX().color(Color.lightGray).padLeft(2).left().get().setEllipsis(true); line.add(stack.item.localizedName).maxWidth(140f).fillX().color(Color.lightGray).padLeft(2).left().get().setEllipsis(true);
line.labelWrap(() -> { line.label(() -> {
Building core = player.core(); Building core = player.core();
int stackamount = Math.round(stack.amount * state.rules.buildCostMultiplier); int stackamount = Math.round(stack.amount * state.rules.buildCostMultiplier);
if(core == null || state.rules.infiniteResources) return "*/" + stackamount; if(core == null || state.rules.infiniteResources) return "*/" + stackamount;
@@ -413,7 +413,7 @@ public class PlacementFragment{
String color = (amount < stackamount / 2f ? "[scarlet]" : amount < stackamount ? "[accent]" : "[white]"); String color = (amount < stackamount / 2f ? "[scarlet]" : amount < stackamount ? "[accent]" : "[white]");
return color + UI.formatAmount(amount) + "[white]/" + stackamount; return color + UI.formatAmount(amount) + "[white]/" + stackamount;
}).padLeft(5); }).padLeft(5).wrap(true); //TODO: in practice wrapping does nothing and items will go offscreen, is this fine?
}).left(); }).left();
req.row(); req.row();
} }