mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-02 11:10:50 +03:00
More UI fixes
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user