tcr/java/src/game/gui/Style.java

104 lines
3.3 KiB
Java
Raw Normal View History

2025-03-11 14:09:49 +01:00
package game.gui;
import game.properties.IStringSerializable;
import game.util.Displayable;
import game.vars.CVarCategory;
import game.vars.Variable;
import game.vars.Variable.IntType;
public enum Style implements IStringSerializable, Displayable {
2025-03-20 15:33:08 +01:00
DEFAULT("default", "Standard"), SHINY("shiny", "Glänzend"), GRAY("gray", "Grau"), BLUE("blue", "Blau"), CUSTOM("custom", "Angepasst");
2025-03-11 14:09:49 +01:00
public final String id;
public final String name;
private Style(String id, String name) {
this.id = id;
this.name = name;
}
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_border_top", category = CVarCategory.GUI, display = "Umrahmung oben / l.")
2025-03-11 14:09:49 +01:00
public int brdr_top;
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_border_btm", category = CVarCategory.GUI, display = "Umrahmung unten / r.")
2025-03-11 14:09:49 +01:00
public int brdr_btm;
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_button_top", category = CVarCategory.GUI, display = "Knopf oben")
2025-03-11 14:09:49 +01:00
public int fill_top;
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_button_btm", category = CVarCategory.GUI, display = "Knopf unten")
2025-03-11 14:09:49 +01:00
public int fill_btm;
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_textbox_top", category = CVarCategory.GUI, display = "Textfeld oben")
2025-03-11 14:09:49 +01:00
public int field_top;
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_textbox_btm", category = CVarCategory.GUI, display = "Textfeld unten")
2025-03-11 14:09:49 +01:00
public int field_btm;
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_label_text", category = CVarCategory.GUI, display = "Beschriftung")
2025-03-11 14:09:49 +01:00
public int text_label;
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_button_text", category = CVarCategory.GUI, display = "Knopf Text")
2025-03-11 14:09:49 +01:00
public int text_base;
2025-03-21 13:08:55 +01:00
@Variable(type = IntType.COLOR, name = "color_textbox_text", category = CVarCategory.GUI, display = "Textfeld Text")
2025-03-11 14:09:49 +01:00
public int text_field;
static {
DEFAULT
2025-03-20 15:33:08 +01:00
.border(0xa0a0a0, 0x202020)
.base(0x606060, 0x404040, 0xffffff, 0xefefef)
.field(0x000000, 0x101010, 0xffffff);
SHINY
2025-03-11 14:09:49 +01:00
.border(0xffffff, 0x3f3f3f)
.base(0x404040, 0x000000, 0xffffff, 0xefefef)
2025-03-20 15:33:08 +01:00
.field(0x000000, 0x202020, 0xdfdfdf);
2025-03-11 14:09:49 +01:00
GRAY
.border(0x000000, 0x202020)
.base(0x808080, 0x000000, 0xffffff, 0xffffff)
2025-03-20 15:33:08 +01:00
.field(0x404040, 0x808080, 0xffffff);
2025-03-11 14:09:49 +01:00
BLUE
.border(0x0000df, 0x300020)
.base(0x2020a0, 0x000020, 0x8fffaf, 0x00cfaf)
2025-03-20 15:33:08 +01:00
.field(0x505090, 0x406060, 0xcfdfff);
2025-03-11 14:09:49 +01:00
CUSTOM
.border(0x000000, 0x000000)
.base(0x808080, 0x808080, 0xffffff, 0xffffff)
2025-03-20 15:33:08 +01:00
.field(0x808080, 0x808080, 0xffffff);
2025-03-11 14:09:49 +01:00
}
private Style border(int top, int btm) {
this.brdr_top = top | 0xff000000;
this.brdr_btm = btm | 0xff000000;
return this;
}
private Style base(int top, int btm, int text, int label) {
this.fill_top = top | 0xff000000;
this.fill_btm = btm | 0xff000000;
this.text_base = text | 0xff000000;
this.text_label = label | 0xff000000;
return this;
}
private Style field(int top, int btm, int text) {
this.field_top = top | 0xff000000;
this.field_btm = btm | 0xff000000;
this.text_field = text | 0xff000000;
return this;
}
public String getName() {
return this.id;
}
public String getDisplay() {
return this.name;
}
2025-03-20 15:33:08 +01:00
public void copyToCustom() {
CUSTOM
.border(this.brdr_top, this.brdr_btm)
.base(this.fill_top, this.fill_btm, this.text_base, this.text_label)
.field(this.field_top, this.field_btm, this.text_field);
}
2025-03-11 14:09:49 +01:00
}