Styles documented
This commit is contained in:
@@ -68,7 +68,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
b.image(con.uiIcon).size(iconMed).padRight(3);
|
||||
b.add(con.localizedName).color(Color.lightGray).padLeft(3).growX().left().wrap();
|
||||
|
||||
b.button(Icon.cancel, Styles.clearPartiali, () -> {
|
||||
b.button(Icon.cancel, Styles.clearNonei, () -> {
|
||||
set.remove(con);
|
||||
rebuild[0].run();
|
||||
}).size(70f).pad(-4f).padLeft(0f);
|
||||
@@ -87,7 +87,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
int[] i = {0};
|
||||
content.<T>getBy(type).each(b -> !set.contains(b) && pred.get(b), b -> {
|
||||
int cols = mobile && Core.graphics.isPortrait() ? 4 : 12;
|
||||
t.button(new TextureRegionDrawable(b.uiIcon), Styles.cleari, iconMed, () -> {
|
||||
t.button(new TextureRegionDrawable(b.uiIcon), Styles.flati, iconMed, () -> {
|
||||
set.add(b);
|
||||
rebuild[0].run();
|
||||
dialog.hide();
|
||||
@@ -224,7 +224,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
main.table(Tex.button, t -> {
|
||||
t.margin(10f);
|
||||
var group = new ButtonGroup<>();
|
||||
var style = Styles.clearTogglet;
|
||||
var style = Styles.flatTogglet;
|
||||
|
||||
t.defaults().size(140f, 50f);
|
||||
|
||||
@@ -285,7 +285,7 @@ public class CustomRulesDialog extends BaseDialog{
|
||||
t.add(text).left().padRight(5);
|
||||
|
||||
for(Team team : Team.baseTeams){
|
||||
t.button(Tex.whiteui, Styles.clearTogglei, 38f, () -> {
|
||||
t.button(Tex.whiteui, Styles.squareTogglei, 38f, () -> {
|
||||
cons.get(team);
|
||||
}).pad(1f).checked(b -> prov.get() == team).size(60f).tooltip(team.localized()).with(i -> i.getStyle().imageUpColor = team.color);
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class FileChooser extends BaseDialog{
|
||||
Fi[] names = getFileNames();
|
||||
|
||||
Image upimage = new Image(Icon.upOpen);
|
||||
TextButton upbutton = new TextButton(".." + directory.toString(), Styles.clearTogglet);
|
||||
TextButton upbutton = new TextButton(".." + directory.toString(), Styles.flatTogglet);
|
||||
upbutton.clicked(() -> {
|
||||
directory = directory.parent();
|
||||
setLastDirectory(directory);
|
||||
@@ -218,7 +218,7 @@ public class FileChooser extends BaseDialog{
|
||||
|
||||
String filename = file.name();
|
||||
|
||||
TextButton button = new TextButton(filename.replace("[", "[["), Styles.clearTogglet);
|
||||
TextButton button = new TextButton(filename.replace("[", "[["), Styles.flatTogglet);
|
||||
button.getLabel().setWrap(false);
|
||||
button.getLabel().setEllipsis(true);
|
||||
group.add(button);
|
||||
|
||||
@@ -29,9 +29,9 @@ public class HostDialog extends BaseDialog{
|
||||
ui.listfrag.rebuild();
|
||||
}).grow().pad(8).get().setMaxLength(40);
|
||||
|
||||
ImageButton button = t.button(Tex.whiteui, Styles.clearFulli, 40, () -> {
|
||||
ImageButton button = t.button(Tex.whiteui, Styles.squarei, 40, () -> {
|
||||
new PaletteDialog().show(color -> {
|
||||
player.color().set(color);
|
||||
player.color.set(color);
|
||||
Core.settings.put("color-0", color.rgba());
|
||||
});
|
||||
}).size(54f).get();
|
||||
|
||||
@@ -322,7 +322,7 @@ public class JoinDialog extends BaseDialog{
|
||||
Core.settings.put("name", text);
|
||||
}).grow().pad(8).maxTextLength(maxNameLength);
|
||||
|
||||
ImageButton button = t.button(Tex.whiteui, Styles.clearFulli, 40, () -> {
|
||||
ImageButton button = t.button(Tex.whiteui, Styles.squarei, 40, () -> {
|
||||
new PaletteDialog().show(color -> {
|
||||
player.color().set(color);
|
||||
Core.settings.put("color-0", color.rgba8888());
|
||||
@@ -424,7 +424,7 @@ public class JoinDialog extends BaseDialog{
|
||||
|
||||
//button for showing/hiding servers
|
||||
ImageButton[] image = {null};
|
||||
image[0] = head.button(hidden ? Icon.eyeOffSmall : Icon.eyeSmall, Styles.accenti, () -> {
|
||||
image[0] = head.button(hidden ? Icon.eyeOffSmall : Icon.eyeSmall, Styles.grayi, () -> {
|
||||
group.setHidden(!group.hidden());
|
||||
image[0].getStyle().imageUp = group.hidden() ? Icon.eyeOffSmall : Icon.eyeSmall;
|
||||
if(group.hidden() && !showHidden){
|
||||
|
||||
@@ -71,7 +71,7 @@ public class LanguageDialog extends BaseDialog{
|
||||
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
||||
|
||||
for(Locale loc : locales){
|
||||
TextButton button = new TextButton(getDisplayName(loc), Styles.clearTogglet);
|
||||
TextButton button = new TextButton(getDisplayName(loc), Styles.flatTogglet);
|
||||
button.clicked(() -> {
|
||||
if(getLocale().equals(loc)) return;
|
||||
Core.settings.put("locale", loc.toString());
|
||||
|
||||
@@ -65,7 +65,7 @@ public class LoadDialog extends BaseDialog{
|
||||
TextureRegionDrawable icon = Vars.ui.getIcon("mode" + Strings.capitalize(mode.name()));
|
||||
boolean sandbox = mode == Gamemode.sandbox;
|
||||
if(Core.atlas.isFound(icon.getRegion()) || sandbox){
|
||||
search.button(sandbox ? Icon.terrain : icon, Styles.emptytogglei, () -> {
|
||||
search.button(sandbox ? Icon.terrain : icon, Styles.emptyTogglei, () -> {
|
||||
filteredMode = filteredMode == mode ? null : mode;
|
||||
rebuild();
|
||||
}).size(60f).checked(b -> filteredMode == mode).tooltip("@mode." + mode.name() + ".name");
|
||||
@@ -116,7 +116,7 @@ public class LoadDialog extends BaseDialog{
|
||||
t.right();
|
||||
t.defaults().size(40f);
|
||||
|
||||
t.button(Icon.save, Styles.emptytogglei, () -> {
|
||||
t.button(Icon.save, Styles.emptyTogglei, () -> {
|
||||
slot.setAutosave(!slot.isAutosave());
|
||||
}).checked(slot.isAutosave()).right();
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class LoadoutDialog extends BaseDialog{
|
||||
updater.run();
|
||||
}).size(bsize);
|
||||
|
||||
t.button(Icon.pencil, Styles.cleari, () -> ui.showTextInput("@configure", stack.item.localizedName, 10, stack.amount + "", true, str -> {
|
||||
t.button(Icon.pencil, Styles.flati, () -> ui.showTextInput("@configure", stack.item.localizedName, 10, stack.amount + "", true, str -> {
|
||||
if(Strings.canParsePositiveInt(str)){
|
||||
int amount = Strings.parseInt(str);
|
||||
if(amount >= 0 && amount <= capacity){
|
||||
|
||||
@@ -209,7 +209,7 @@ public class MapsDialog extends BaseDialog{
|
||||
for(Gamemode mode : Gamemode.all){
|
||||
TextureRegionDrawable icon = Vars.ui.getIcon("mode" + Strings.capitalize(mode.name()));
|
||||
if(Core.atlas.isFound(icon.getRegion())){
|
||||
t.button(icon, Styles.emptytogglei, () -> {
|
||||
t.button(icon, Styles.emptyTogglei, () -> {
|
||||
if(modes.contains(mode)){
|
||||
modes.remove(mode);
|
||||
}else{
|
||||
@@ -224,13 +224,13 @@ public class MapsDialog extends BaseDialog{
|
||||
|
||||
menu.add("@editor.filters.type").width(150f).left();
|
||||
menu.table(Tex.button, t -> {
|
||||
t.button("@custom", Styles.clearTogglet, () -> {
|
||||
t.button("@custom", Styles.flatTogglet, () -> {
|
||||
showCustom = !showCustom;
|
||||
Core.settings.put("editorshowcustommaps", showCustom);
|
||||
Core.settings.forceSave();
|
||||
rebuildMaps();
|
||||
}).size(150f, 60f).checked(showCustom);
|
||||
t.button("@builtin", Styles.clearTogglet, () -> {
|
||||
t.button("@builtin", Styles.flatTogglet, () -> {
|
||||
showBuiltIn = !showBuiltIn;
|
||||
Core.settings.put("editorshowbuiltinmaps", showBuiltIn);
|
||||
Core.settings.forceSave();
|
||||
@@ -241,13 +241,13 @@ public class MapsDialog extends BaseDialog{
|
||||
|
||||
menu.add("@editor.filters.search").width(150f).left();
|
||||
menu.table(Tex.button, t -> {
|
||||
t.button("@editor.filters.author", Styles.clearTogglet, () -> {
|
||||
t.button("@editor.filters.author", Styles.flatTogglet, () -> {
|
||||
searchAuthor = !searchAuthor;
|
||||
Core.settings.put("editorsearchauthor", searchAuthor);
|
||||
Core.settings.forceSave();
|
||||
rebuildMaps();
|
||||
}).size(150f, 60f).checked(searchAuthor);
|
||||
t.button("@editor.filters.description", Styles.clearTogglet, () -> {
|
||||
t.button("@editor.filters.description", Styles.flatTogglet, () -> {
|
||||
searchDescription = !searchDescription;
|
||||
Core.settings.put("editorsearchdescription", searchDescription);
|
||||
Core.settings.forceSave();
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ModsDialog extends BaseDialog{
|
||||
searchtxt = res;
|
||||
rebuildBrowser();
|
||||
}).growX().get();
|
||||
table.button(Icon.list, Styles.clearPartiali, 32f, () -> {
|
||||
table.button(Icon.list, Styles.clearNonei, 32f, () -> {
|
||||
orderDate = !orderDate;
|
||||
rebuildBrowser();
|
||||
}).update(b -> b.getStyle().imageUp = (orderDate ? Icon.list : Icon.star)).size(40f).get()
|
||||
@@ -154,7 +154,7 @@ public class ModsDialog extends BaseDialog{
|
||||
cont.table(buttons -> {
|
||||
buttons.left().defaults().growX().height(60f).uniformX();
|
||||
|
||||
TextButtonStyle style = Styles.clearPartialt;
|
||||
TextButtonStyle style = Styles.flatBordert;
|
||||
float margin = 12f;
|
||||
|
||||
buttons.button("@mod.import", Icon.add, style, () -> {
|
||||
@@ -276,12 +276,12 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
t.table(right -> {
|
||||
right.right();
|
||||
right.button(item.enabled() ? Icon.downOpen : Icon.upOpen, Styles.clearPartiali, () -> {
|
||||
right.button(item.enabled() ? Icon.downOpen : Icon.upOpen, Styles.clearNonei, () -> {
|
||||
mods.setEnabled(item, !item.enabled());
|
||||
setup();
|
||||
}).size(50f).disabled(!item.isSupported());
|
||||
|
||||
right.button(item.hasSteamID() ? Icon.link : Icon.trash, Styles.clearPartiali, () -> {
|
||||
right.button(item.hasSteamID() ? Icon.link : Icon.trash, Styles.clearNonei, () -> {
|
||||
if(!item.hasSteamID()){
|
||||
ui.showConfirm("@confirm", "@mod.remove.confirm", () -> {
|
||||
mods.removeMod(item);
|
||||
@@ -294,12 +294,12 @@ public class ModsDialog extends BaseDialog{
|
||||
|
||||
if(steam && !item.hasSteamID()){
|
||||
right.row();
|
||||
right.button(Icon.export, Styles.clearPartiali, () -> {
|
||||
right.button(Icon.export, Styles.clearNonei, () -> {
|
||||
platform.publish(item);
|
||||
}).size(50f);
|
||||
}
|
||||
}).growX().right().padRight(-8f).padTop(-8f);
|
||||
}, Styles.clearPartialt, () -> showMod(item)).size(w, h).growX().pad(4f);
|
||||
}, Styles.flatBordert, () -> showMod(item)).size(w, h).growX().pad(4f);
|
||||
pane[0].row();
|
||||
}
|
||||
}
|
||||
@@ -382,7 +382,7 @@ public class ModsDialog extends BaseDialog{
|
||||
d.cont.pane(cs -> {
|
||||
int i = 0;
|
||||
for(UnlockableContent c : all){
|
||||
cs.button(new TextureRegionDrawable(c.uiIcon), Styles.cleari, iconMed, () -> {
|
||||
cs.button(new TextureRegionDrawable(c.uiIcon), Styles.flati, iconMed, () -> {
|
||||
ui.content.show(c);
|
||||
}).size(50f).with(im -> {
|
||||
var click = im.getClickListener();
|
||||
@@ -482,7 +482,7 @@ public class ModsDialog extends BaseDialog{
|
||||
"\n" + Core.bundle.format("mod.requiresversion", mod.minGameVersion)))
|
||||
.width(358f).wrap().grow().pad(4f, 2f, 4f, 6f).top().left().labelAlign(Align.topLeft);
|
||||
|
||||
}, Styles.clearPartialt, () -> {
|
||||
}, Styles.flatBordert, () -> {
|
||||
var sel = new BaseDialog(mod.name);
|
||||
sel.cont.pane(p -> p.add(mod.description + "\n\n[accent]" + Core.bundle.get("editor.author") + "[lightgray] " + mod.author)
|
||||
.width(mobile ? 400f : 500f).wrap().pad(4f).labelAlign(Align.center, Align.left)).grow();
|
||||
|
||||
@@ -21,7 +21,7 @@ public class PaletteDialog extends Dialog{
|
||||
for(int i = 0; i < playerColors.length; i++){
|
||||
Color color = playerColors[i];
|
||||
|
||||
ImageButton button = table.button(Tex.whiteui, Styles.clearTogglei, 34, () -> {
|
||||
ImageButton button = table.button(Tex.whiteui, Styles.squareTogglei, 34, () -> {
|
||||
cons.get(color);
|
||||
hide();
|
||||
}).size(48).get();
|
||||
|
||||
@@ -559,7 +559,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
for(int i = 0; i < content.planets().size; i++){
|
||||
Planet planet = content.planets().get(i);
|
||||
if(selectable(planet)){
|
||||
pt.button(planet.localizedName, Styles.clearTogglet, () -> {
|
||||
pt.button(planet.localizedName, Styles.flatTogglet, () -> {
|
||||
selected = null;
|
||||
launchSector = null;
|
||||
if(state.planet != planet){
|
||||
@@ -961,7 +961,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
if(sector.preset == null){
|
||||
title.add().growX();
|
||||
|
||||
title.button(Icon.pencilSmall, Styles.clearPartiali, () -> {
|
||||
title.button(Icon.pencilSmall, Styles.clearNonei, () -> {
|
||||
ui.showTextInput("@sectors.rename", "@name", 20, sector.name(), v -> {
|
||||
sector.setName(v);
|
||||
updateSelected();
|
||||
@@ -974,7 +974,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
new TextureRegionDrawable(sector.info.contentIcon.uiIcon) :
|
||||
Icon.icons.get(sector.info.icon + "Small");
|
||||
|
||||
title.button(icon == null ? Icon.noneSmall : icon, Styles.clearPartiali, iconSmall, () -> {
|
||||
title.button(icon == null ? Icon.noneSmall : icon, Styles.clearNonei, iconSmall, () -> {
|
||||
new Dialog(""){{
|
||||
closeOnBack();
|
||||
setFillParent(true);
|
||||
@@ -992,7 +992,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
t.marginRight(19f);
|
||||
t.defaults().size(48f);
|
||||
|
||||
t.button(Icon.none, Styles.clearTogglei, () -> {
|
||||
t.button(Icon.none, Styles.squareTogglei, () -> {
|
||||
sector.info.icon = null;
|
||||
sector.info.contentIcon = null;
|
||||
refresh.run();
|
||||
@@ -1004,7 +1004,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
for(var key : defaultIcons){
|
||||
var value = Icon.icons.get(key);
|
||||
|
||||
t.button(value, Styles.clearTogglei, () -> {
|
||||
t.button(value, Styles.squareTogglei, () -> {
|
||||
sector.info.icon = key;
|
||||
sector.info.contentIcon = null;
|
||||
refresh.run();
|
||||
@@ -1021,7 +1021,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
i = 0;
|
||||
for(UnlockableContent u : content.getBy(ctype).<UnlockableContent>as()){
|
||||
if(!u.isHidden() && u.unlocked()){
|
||||
t.button(new TextureRegionDrawable(u.uiIcon), Styles.clearTogglei, iconMed, () -> {
|
||||
t.button(new TextureRegionDrawable(u.uiIcon), Styles.squareTogglei, iconMed, () -> {
|
||||
sector.info.icon = null;
|
||||
sector.info.contentIcon = u;
|
||||
refresh.run();
|
||||
@@ -1081,7 +1081,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
||||
stable.row();
|
||||
|
||||
if(sector.hasBase()){
|
||||
stable.button("@stats", Icon.info, Styles.transt, () -> showStats(sector)).height(40f).fillX().row();
|
||||
stable.button("@stats", Icon.info, Styles.cleart, () -> showStats(sector)).height(40f).fillX().row();
|
||||
}
|
||||
|
||||
if((sector.hasBase() && mode == look) || canSelect(sector) || (sector.preset != null && sector.preset.alwaysUnlocked) || debugSelect){
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
if(node.requiresUnlock && !node.content.unlocked() && node != getPrefRoot()) continue;
|
||||
|
||||
//TODO toggle
|
||||
in.button(node.localizedName(), node.icon(), Styles.clearTogglet, iconMed, () -> {
|
||||
in.button(node.localizedName(), node.icon(), Styles.flatTogglet, iconMed, () -> {
|
||||
if(node == lastNode){
|
||||
return;
|
||||
}
|
||||
@@ -581,7 +581,7 @@ public class ResearchDialog extends BaseDialog{
|
||||
b.margin(0).left().defaults().left();
|
||||
|
||||
if(selectable && (node.content.description != null || node.content.stats.toMap().size > 0)){
|
||||
b.button(Icon.info, Styles.cleari, () -> ui.content.show(node.content)).growY().width(50f);
|
||||
b.button(Icon.info, Styles.flati, () -> ui.content.show(node.content)).growY().width(50f);
|
||||
}
|
||||
b.add().grow();
|
||||
b.table(desc -> {
|
||||
|
||||
@@ -144,7 +144,7 @@ public class SchematicsDialog extends BaseDialog{
|
||||
buttons.left();
|
||||
buttons.defaults().size(50f);
|
||||
|
||||
ImageButtonStyle style = Styles.clearPartiali;
|
||||
ImageButtonStyle style = Styles.clearNonei;
|
||||
|
||||
buttons.button(Icon.info, style, () -> {
|
||||
showInfo(s);
|
||||
@@ -231,7 +231,7 @@ public class SchematicsDialog extends BaseDialog{
|
||||
hide();
|
||||
}
|
||||
}
|
||||
}).pad(4).style(Styles.cleari).get();
|
||||
}).pad(4).style(Styles.flati).get();
|
||||
|
||||
sel[0].getStyle().up = Tex.pane;
|
||||
|
||||
@@ -419,7 +419,7 @@ public class SchematicsDialog extends BaseDialog{
|
||||
int i = 0;
|
||||
for(UnlockableContent u : content.getBy(ctype).<UnlockableContent>as()){
|
||||
if(!u.isHidden() && u.unlockedNow() && u.hasEmoji() && !tags.contains(u.emoji())){
|
||||
t.button(new TextureRegionDrawable(u.uiIcon), Styles.cleari, iconMed, () -> {
|
||||
t.button(new TextureRegionDrawable(u.uiIcon), Styles.flati, iconMed, () -> {
|
||||
String out = u.emoji() + "";
|
||||
|
||||
tags.add(out);
|
||||
|
||||
Reference in New Issue
Block a user