mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-12 19:09:34 +07:00
Minor UI style tweaks
This commit is contained in:
parent
3d0a1868c6
commit
36ecb45fb4
Binary file not shown.
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 326 B |
Binary file not shown.
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 318 B |
@ -24,7 +24,7 @@ import static mindustry.gen.Tex.*;
|
|||||||
@StyleDefaults
|
@StyleDefaults
|
||||||
public class Styles{
|
public class Styles{
|
||||||
//TODO all these names are inconsistent and not descriptive
|
//TODO all these names are inconsistent and not descriptive
|
||||||
public static Drawable black, black9, black8, black6, black3, black5, none, flatDown, flatOver, accentDrawable;
|
public static Drawable black, black9, black8, black6, black3, black5, grayPanel, none, flatDown, flatOver, accentDrawable;
|
||||||
|
|
||||||
public static ButtonStyle defaultb, underlineb;
|
public static ButtonStyle defaultb, underlineb;
|
||||||
|
|
||||||
@ -32,6 +32,8 @@ public class Styles{
|
|||||||
public static TextButtonStyle defaultt,
|
public static TextButtonStyle defaultt,
|
||||||
/** Flat, square, opaque. */
|
/** Flat, square, opaque. */
|
||||||
flatt,
|
flatt,
|
||||||
|
/** Flat, square, opaque, gray. */
|
||||||
|
grayt,
|
||||||
/** Flat, square, toggleable. */
|
/** Flat, square, toggleable. */
|
||||||
flatTogglet,
|
flatTogglet,
|
||||||
/** Flat, square, gray border.*/
|
/** Flat, square, gray border.*/
|
||||||
@ -102,6 +104,7 @@ public class Styles{
|
|||||||
black5 = whiteui.tint(0f, 0f, 0f, 0.5f);
|
black5 = whiteui.tint(0f, 0f, 0f, 0.5f);
|
||||||
black3 = whiteui.tint(0f, 0f, 0f, 0.3f);
|
black3 = whiteui.tint(0f, 0f, 0f, 0.3f);
|
||||||
none = whiteui.tint(0f, 0f, 0f, 0f);
|
none = whiteui.tint(0f, 0f, 0f, 0f);
|
||||||
|
grayPanel = whiteui.tint(Pal.darkestGray);
|
||||||
flatDown = createFlatDown();
|
flatDown = createFlatDown();
|
||||||
flatOver = whiteui.tint(Color.valueOf("454545"));
|
flatOver = whiteui.tint(Color.valueOf("454545"));
|
||||||
accentDrawable = whiteui.tint(Pal.accent);
|
accentDrawable = whiteui.tint(Pal.accent);
|
||||||
@ -144,6 +147,14 @@ public class Styles{
|
|||||||
down = flatOver;
|
down = flatOver;
|
||||||
up = black;
|
up = black;
|
||||||
}};
|
}};
|
||||||
|
grayt = new TextButtonStyle(){{
|
||||||
|
over = flatOver;
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.white;
|
||||||
|
disabledFontColor = Color.lightGray;
|
||||||
|
down = flatOver;
|
||||||
|
up = grayPanel;
|
||||||
|
}};
|
||||||
logict = new TextButtonStyle(){{
|
logict = new TextButtonStyle(){{
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
|
@ -40,7 +40,7 @@ public class CustomGameDialog extends BaseDialog{
|
|||||||
float images = 146f;
|
float images = 146f;
|
||||||
|
|
||||||
ImageButtonStyle style = new ImageButtonStyle(){{
|
ImageButtonStyle style = new ImageButtonStyle(){{
|
||||||
up = Styles.none;
|
up = Styles.grayPanel;
|
||||||
down = Styles.flatOver;
|
down = Styles.flatOver;
|
||||||
over = Styles.flatOver;
|
over = Styles.flatOver;
|
||||||
disabled = Styles.none;
|
disabled = Styles.none;
|
||||||
|
@ -103,7 +103,7 @@ public class LoadDialog extends BaseDialog{
|
|||||||
|
|
||||||
any = true;
|
any = true;
|
||||||
|
|
||||||
TextButton button = new TextButton("", Styles.flatt);
|
TextButton button = new TextButton("", Styles.grayt);
|
||||||
button.getLabel().remove();
|
button.getLabel().remove();
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ public class MapsDialog extends BaseDialog{
|
|||||||
mapTable.row();
|
mapTable.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
TextButton button = mapTable.button("", Styles.flatt, () -> showMapInfo(map)).width(mapsize).pad(8).get();
|
TextButton button = mapTable.button("", Styles.grayt, () -> showMapInfo(map)).width(mapsize).pad(8).get();
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
button.margin(9);
|
button.margin(9);
|
||||||
button.add(map.name()).width(mapsize - 18f).center().get().setEllipsis(true);
|
button.add(map.name()).width(mapsize - 18f).center().get().setEllipsis(true);
|
||||||
|
@ -77,9 +77,8 @@ public class Reconstructor extends UnitBlock{
|
|||||||
table.row();
|
table.row();
|
||||||
for(var upgrade : upgrades){
|
for(var upgrade : upgrades){
|
||||||
if(upgrade[0].unlockedNow() && upgrade[1].unlockedNow()){
|
if(upgrade[0].unlockedNow() && upgrade[1].unlockedNow()){
|
||||||
table.table(Tex.whiteui, t -> {
|
table.table(Styles.grayPanel, t -> {
|
||||||
t.left();
|
t.left();
|
||||||
t.setColor(Pal.darkestGray);
|
|
||||||
|
|
||||||
t.image(upgrade[0].uiIcon).size(40).pad(10f).left();
|
t.image(upgrade[0].uiIcon).size(40).pad(10f).left();
|
||||||
t.table(info -> {
|
t.table(info -> {
|
||||||
@ -88,16 +87,13 @@ public class Reconstructor extends UnitBlock{
|
|||||||
}).pad(10).left();
|
}).pad(10).left();
|
||||||
}).fill().padTop(5).padBottom(5);
|
}).fill().padTop(5).padBottom(5);
|
||||||
|
|
||||||
table.table(t -> {
|
table.table(Styles.grayPanel, t -> {
|
||||||
t.setBackground(Tex.whiteui);
|
|
||||||
t.setColor(Pal.darkestGray);
|
|
||||||
|
|
||||||
t.image(Icon.right).color(Pal.darkishGray).size(40).pad(10f);
|
t.image(Icon.right).color(Pal.darkishGray).size(40).pad(10f);
|
||||||
}).fill().padTop(5).padBottom(5);
|
}).fill().padTop(5).padBottom(5);
|
||||||
|
|
||||||
table.table(Tex.whiteui, t -> {
|
table.table(Styles.grayPanel, t -> {
|
||||||
t.left();
|
t.left();
|
||||||
t.setColor(Pal.darkestGray);
|
|
||||||
|
|
||||||
t.image(upgrade[1].uiIcon).size(40).pad(10f).right();
|
t.image(upgrade[1].uiIcon).size(40).pad(10f).right();
|
||||||
t.table(info -> {
|
t.table(info -> {
|
||||||
|
@ -136,9 +136,7 @@ public class UnitAssembler extends PayloadBlock{
|
|||||||
int tier = 0;
|
int tier = 0;
|
||||||
for(var plan : plans){
|
for(var plan : plans){
|
||||||
int ttier = tier;
|
int ttier = tier;
|
||||||
table.table(t -> {
|
table.table(Styles.grayPanel, t -> {
|
||||||
t.setBackground(Tex.whiteui);
|
|
||||||
t.setColor(Pal.darkestGray);
|
|
||||||
|
|
||||||
if(plan.unit.isBanned()){
|
if(plan.unit.isBanned()){
|
||||||
t.image(Icon.cancel).color(Pal.remove).size(40).pad(10);
|
t.image(Icon.cancel).color(Pal.remove).size(40).pad(10);
|
||||||
@ -146,7 +144,7 @@ public class UnitAssembler extends PayloadBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(plan.unit.unlockedNow()){
|
if(plan.unit.unlockedNow()){
|
||||||
t.image(plan.unit.uiIcon).size(40).pad(10f).left();
|
t.image(plan.unit.uiIcon).scaling(Scaling.fit).size(40).pad(10f).left();
|
||||||
t.table(info -> {
|
t.table(info -> {
|
||||||
info.defaults().left();
|
info.defaults().left();
|
||||||
info.add(plan.unit.localizedName);
|
info.add(plan.unit.localizedName);
|
||||||
|
@ -109,9 +109,7 @@ public class UnitFactory extends UnitBlock{
|
|||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
for(var plan : plans){
|
for(var plan : plans){
|
||||||
table.table(t -> {
|
table.table(Styles.grayPanel, t -> {
|
||||||
t.setBackground(Tex.whiteui);
|
|
||||||
t.setColor(Pal.darkestGray);
|
|
||||||
|
|
||||||
if(plan.unit.isBanned()){
|
if(plan.unit.isBanned()){
|
||||||
t.image(Icon.cancel).color(Pal.remove).size(40);
|
t.image(Icon.cancel).color(Pal.remove).size(40);
|
||||||
|
Loading…
Reference in New Issue
Block a user