Styles documented
This commit is contained in:
Binary file not shown.
@@ -480,7 +480,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
|
||||
Cons<EditorTool> addTool = tool -> {
|
||||
|
||||
ImageButton button = new ImageButton(ui.getIcon(tool.name()), Styles.clearTogglei);
|
||||
ImageButton button = new ImageButton(ui.getIcon(tool.name()), Styles.squareTogglei);
|
||||
button.clicked(() -> {
|
||||
view.setTool(tool);
|
||||
if(lastTable[0] != null){
|
||||
@@ -516,7 +516,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
table.button(b -> {
|
||||
b.left();
|
||||
b.marginLeft(6);
|
||||
b.setStyle(Styles.clearTogglet);
|
||||
b.setStyle(Styles.flatTogglet);
|
||||
b.add(Core.bundle.get("toolmode." + name)).left();
|
||||
b.row();
|
||||
b.add(Core.bundle.get("toolmode." + name + ".description")).color(Color.lightGray).left();
|
||||
@@ -556,16 +556,16 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
|
||||
tools.defaults().size(size, size);
|
||||
|
||||
tools.button(Icon.menu, Styles.cleari, menu::show);
|
||||
tools.button(Icon.menu, Styles.flati, menu::show);
|
||||
|
||||
ImageButton grid = tools.button(Icon.grid, Styles.clearTogglei, () -> view.setGrid(!view.isGrid())).get();
|
||||
ImageButton grid = tools.button(Icon.grid, Styles.squareTogglei, () -> view.setGrid(!view.isGrid())).get();
|
||||
|
||||
addTool.get(EditorTool.zoom);
|
||||
|
||||
tools.row();
|
||||
|
||||
ImageButton undo = tools.button(Icon.undo, Styles.cleari, editor::undo).get();
|
||||
ImageButton redo = tools.button(Icon.redo, Styles.cleari, editor::redo).get();
|
||||
ImageButton undo = tools.button(Icon.undo, Styles.flati, editor::undo).get();
|
||||
ImageButton redo = tools.button(Icon.redo, Styles.flati, editor::redo).get();
|
||||
|
||||
addTool.get(EditorTool.pick);
|
||||
|
||||
@@ -587,7 +587,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
addTool.get(EditorTool.fill);
|
||||
addTool.get(EditorTool.spray);
|
||||
|
||||
ImageButton rotate = tools.button(Icon.right, Styles.cleari, () -> editor.rotation = (editor.rotation + 1) % 4).get();
|
||||
ImageButton rotate = tools.button(Icon.right, Styles.flati, () -> editor.rotation = (editor.rotation + 1) % 4).get();
|
||||
rotate.getImage().update(() -> {
|
||||
rotate.getImage().setRotation(editor.rotation * 90);
|
||||
rotate.getImage().setOrigin(Align.center);
|
||||
@@ -605,7 +605,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
int i = 0;
|
||||
|
||||
for(Team team : Team.baseTeams){
|
||||
ImageButton button = new ImageButton(Tex.whiteui, Styles.clearTogglePartiali);
|
||||
ImageButton button = new ImageButton(Tex.whiteui, Styles.clearNoneTogglei);
|
||||
button.margin(4f);
|
||||
button.getImageCell().grow();
|
||||
button.getStyle().imageUpColor = team.color;
|
||||
@@ -788,7 +788,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
|| (!searchText.isEmpty() && !block.localizedName.toLowerCase().contains(searchText.toLowerCase()))
|
||||
) continue;
|
||||
|
||||
ImageButton button = new ImageButton(Tex.whiteui, Styles.clearTogglei);
|
||||
ImageButton button = new ImageButton(Tex.whiteui, Styles.squareTogglei);
|
||||
button.getStyle().imageUp = new TextureRegionDrawable(region);
|
||||
button.clicked(() -> editor.drawBlock = block);
|
||||
button.resizeImage(8 * 4f);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class SectorGenerateDialog extends BaseDialog{
|
||||
for(var plan : content.planets()){
|
||||
if(plan.generator == null || plan.sectors.size == 0) continue;
|
||||
|
||||
p.button(plan.localizedName, Styles.clearTogglet, () -> {
|
||||
p.button(plan.localizedName, Styles.flatTogglet, () -> {
|
||||
planet = plan;
|
||||
sector = Math.min(sector, planet.sectors.size - 1);
|
||||
seed = 0;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.table(Tex.button, t -> {
|
||||
for(Sort s : Sort.all){
|
||||
t.button("@waves.sort." + s, Styles.clearTogglet, () -> {
|
||||
t.button("@waves.sort." + s, Styles.flatTogglet, () -> {
|
||||
sort = s;
|
||||
dialog.hide();
|
||||
buildGroups();
|
||||
@@ -346,7 +346,7 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
}
|
||||
|
||||
for(var spawn : spawner.getSpawns()){
|
||||
p.button(spawn.x + ", " + spawn.y, Styles.clearTogglet, () -> {
|
||||
p.button(spawn.x + ", " + spawn.y, Styles.flatTogglet, () -> {
|
||||
group.spawn = Point2.pack(spawn.x, spawn.y);
|
||||
dialog.hide();
|
||||
}).size(110f, 45f).checked(spawn.pos() == group.spawn);
|
||||
@@ -361,7 +361,7 @@ public class WaveInfoDialog extends BaseDialog{
|
||||
}
|
||||
}
|
||||
|
||||
p.button("@waves.spawn.all", Styles.clearTogglet, () -> {
|
||||
p.button("@waves.spawn.all", Styles.flatTogglet, () -> {
|
||||
group.spawn = -1;
|
||||
dialog.hide();
|
||||
}).size(110f, 45f).checked(-1 == group.spawn);
|
||||
|
||||
@@ -457,19 +457,19 @@ public class DesktopInput extends InputHandler{
|
||||
table.row();
|
||||
table.left().margin(0f).defaults().size(48f).left();
|
||||
|
||||
table.button(Icon.paste, Styles.clearPartiali, () -> {
|
||||
table.button(Icon.paste, Styles.clearNonei, () -> {
|
||||
ui.schematics.show();
|
||||
}).tooltip("@schematics");
|
||||
|
||||
table.button(Icon.book, Styles.clearPartiali, () -> {
|
||||
table.button(Icon.book, Styles.clearNonei, () -> {
|
||||
ui.database.show();
|
||||
}).tooltip("@database");
|
||||
|
||||
table.button(Icon.tree, Styles.clearPartiali, () -> {
|
||||
table.button(Icon.tree, Styles.clearNonei, () -> {
|
||||
ui.research.show();
|
||||
}).visible(() -> state.isCampaign()).tooltip("@research");
|
||||
|
||||
table.button(Icon.map, Styles.clearPartiali, () -> {
|
||||
table.button(Icon.map, Styles.clearNonei, () -> {
|
||||
ui.planet.show();
|
||||
}).visible(() -> state.isCampaign()).tooltip("@planetmap");
|
||||
}
|
||||
|
||||
@@ -189,18 +189,18 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
table.row();
|
||||
table.left().margin(0f).defaults().size(48f);
|
||||
|
||||
table.button(Icon.hammer, Styles.clearTogglePartiali, () -> {
|
||||
table.button(Icon.hammer, Styles.clearNoneTogglei, () -> {
|
||||
mode = mode == breaking ? block == null ? none : placing : breaking;
|
||||
lastBlock = block;
|
||||
}).update(l -> l.setChecked(mode == breaking)).name("breakmode");
|
||||
|
||||
//diagonal swap button
|
||||
table.button(Icon.diagonal, Styles.clearTogglePartiali, () -> {
|
||||
table.button(Icon.diagonal, Styles.clearNoneTogglei, () -> {
|
||||
Core.settings.put("swapdiagonal", !Core.settings.getBool("swapdiagonal"));
|
||||
}).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal")));
|
||||
|
||||
//rotate button
|
||||
table.button(Icon.right, Styles.clearTogglePartiali, () -> {
|
||||
table.button(Icon.right, Styles.clearNoneTogglei, () -> {
|
||||
if(block != null && block.rotate){
|
||||
rotation = Mathf.mod(rotation + 1, 4);
|
||||
}else{
|
||||
@@ -219,7 +219,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
});
|
||||
|
||||
//confirm button
|
||||
table.button(Icon.ok, Styles.clearPartiali, () -> {
|
||||
table.button(Icon.ok, Styles.clearNonei, () -> {
|
||||
for(BuildPlan plan : selectPlans){
|
||||
Tile tile = plan.tile();
|
||||
|
||||
@@ -273,7 +273,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
t.table(Tex.pane, b -> {
|
||||
b.defaults().size(50f);
|
||||
|
||||
ImageButtonStyle style = Styles.clearPartiali;
|
||||
ImageButtonStyle style = Styles.clearNonei;
|
||||
|
||||
b.button(Icon.save, style, this::showSchematicSave).disabled(f -> lastSchematic == null || lastSchematic.file != null);
|
||||
b.button(Icon.cancel, style, () -> {
|
||||
|
||||
@@ -452,7 +452,9 @@ public class LCanvas extends Table{
|
||||
public JumpCurve curve;
|
||||
|
||||
public JumpButton(Prov<StatementElem> getter, Cons<StatementElem> setter){
|
||||
super(Tex.logicNode, Styles.colori);
|
||||
super(Tex.logicNode, new ImageButtonStyle(){{
|
||||
imageUpColor = Color.white;
|
||||
}});
|
||||
|
||||
to = getter;
|
||||
addListener(listener = new ClickListener());
|
||||
|
||||
@@ -491,7 +491,7 @@ public class LStatements{
|
||||
int c = 0;
|
||||
for(Item item : Vars.content.items()){
|
||||
if(!item.unlockedNow()) continue;
|
||||
i.button(new TextureRegionDrawable(item.uiIcon), Styles.cleari, iconSmall, () -> {
|
||||
i.button(new TextureRegionDrawable(item.uiIcon), Styles.flati, iconSmall, () -> {
|
||||
stype("@" + item.name);
|
||||
hide.run();
|
||||
}).size(40f);
|
||||
@@ -505,7 +505,7 @@ public class LStatements{
|
||||
int c = 0;
|
||||
for(Liquid item : Vars.content.liquids()){
|
||||
if(!item.unlockedNow()) continue;
|
||||
i.button(new TextureRegionDrawable(item.uiIcon), Styles.cleari, iconSmall, () -> {
|
||||
i.button(new TextureRegionDrawable(item.uiIcon), Styles.flati, iconSmall, () -> {
|
||||
stype("@" + item.name);
|
||||
hide.run();
|
||||
}).size(40f);
|
||||
@@ -531,7 +531,7 @@ public class LStatements{
|
||||
for(int i = 0; i < tables.length; i++){
|
||||
int fi = i;
|
||||
|
||||
t.button(icons[i], Styles.clearTogglei, () -> {
|
||||
t.button(icons[i], Styles.squareTogglei, () -> {
|
||||
selected = fi;
|
||||
|
||||
stack.clearChildren();
|
||||
@@ -870,7 +870,7 @@ public class LStatements{
|
||||
int c = 0;
|
||||
for(UnitType item : Vars.content.units()){
|
||||
if(!item.unlockedNow() || item.isHidden() || !item.logicControllable) continue;
|
||||
i.button(new TextureRegionDrawable(item.uiIcon), Styles.cleari, iconSmall, () -> {
|
||||
i.button(new TextureRegionDrawable(item.uiIcon), Styles.flati, iconSmall, () -> {
|
||||
type = "@" + item.name;
|
||||
field.setText(type);
|
||||
hide.run();
|
||||
@@ -1033,7 +1033,7 @@ public class LStatements{
|
||||
int c = 0;
|
||||
for(Item item : Vars.content.items()){
|
||||
if(!item.unlockedNow()) continue;
|
||||
i.button(new TextureRegionDrawable(item.uiIcon), Styles.cleari, iconSmall, () -> {
|
||||
i.button(new TextureRegionDrawable(item.uiIcon), Styles.flati, iconSmall, () -> {
|
||||
ore = "@" + item.name;
|
||||
rebuild(table);
|
||||
hide.run();
|
||||
|
||||
@@ -561,7 +561,7 @@ public class Mods implements Loadable{
|
||||
d.left().marginLeft(15f);
|
||||
for(Content c : m.erroredContent){
|
||||
d.add(c.minfo.sourceFile.nameWithoutExtension()).left().padRight(10);
|
||||
d.button("@details", Icon.downOpen, Styles.transt, () -> {
|
||||
d.button("@details", Icon.downOpen, Styles.cleart, () -> {
|
||||
new Dialog(""){{
|
||||
setFillParent(true);
|
||||
cont.pane(e -> e.add(c.minfo.error).wrap().grow().labelAlign(Align.center, Align.left)).grow();
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ItemsDisplay extends Table{
|
||||
}
|
||||
}).scrollX(false), false).setDuration(0.3f);
|
||||
|
||||
c.button("@globalitems", Icon.downOpen, Styles.clearTogglet, col::toggle).update(t -> {
|
||||
c.button("@globalitems", Icon.downOpen, Styles.flatTogglet, col::toggle).update(t -> {
|
||||
t.setChecked(col.isCollapsed());
|
||||
((Image)t.getChildren().get(1)).setDrawable(col.isCollapsed() ? Icon.upOpen : Icon.downOpen);
|
||||
}).padBottom(4).left().fillX().margin(12f).minWidth(200f);
|
||||
|
||||
@@ -32,18 +32,57 @@ public class Styles{
|
||||
public static TextButtonStyle defaultt,
|
||||
/** Flat, square, opaque. */
|
||||
flatt,
|
||||
/** Flat, square, toggleable. */
|
||||
flatTogglet,
|
||||
/** Flat, square, gray border.*/
|
||||
flatBordert,
|
||||
/** No background whatsoever, only text. */
|
||||
nonet,
|
||||
clearPartialt,
|
||||
clearTogglet,
|
||||
/** Similar to flatToggle, but slightly tweaked for logic. */
|
||||
logicTogglet,
|
||||
clearToggleMenut,
|
||||
togglet, transt,
|
||||
/** Similar to flatToggle, but with a transparent base background. */
|
||||
flatToggleMenut,
|
||||
/** Toggle variant of default style. */
|
||||
togglet,
|
||||
/** Partially transparent square button. */
|
||||
cleart,
|
||||
/** Similar to flatToggle, but without a darker border. */
|
||||
fullTogglet,
|
||||
/** Toggle-able version of flatBorder. */
|
||||
squareTogglet,
|
||||
/** Special square button for logic dialogs. */
|
||||
logict;
|
||||
|
||||
public static ImageButtonStyle defaulti, nodei, emptyi, emptytogglei, selecti, logici, geni, colori, accenti, cleari, clearFulli, clearPartiali, clearTogglei, clearTransi, clearToggleTransi, clearTogglePartiali;
|
||||
/** Default image button style - gray corners at 45 degrees. */
|
||||
public static ImageButtonStyle defaulti,
|
||||
/** Used for research nodes in the tech tree. */
|
||||
nodei,
|
||||
/** No background, tints the image itself when hovered. */
|
||||
emptyi,
|
||||
/** Toggleable variant of emptyi */
|
||||
emptyTogglei,
|
||||
/** Displays border around image when selected; used in placement fragment. */
|
||||
selecti,
|
||||
/** Pure black version of emptyi, used for logic toolbar. */
|
||||
logici,
|
||||
/** Used for toolbar in map generation filters. */
|
||||
geni,
|
||||
/** Gray, toggleable, no backvround. */
|
||||
grayi,
|
||||
/** Flat, square, black background. */
|
||||
flati,
|
||||
/** Square border. */
|
||||
squarei,
|
||||
/** Square border, toggleable. */
|
||||
squareTogglei,
|
||||
/** No background unless focused, no border. */
|
||||
clearNonei,
|
||||
/** Partially transparent black background. */
|
||||
cleari,
|
||||
/** Toggleable variant of cleari. */
|
||||
clearTogglei,
|
||||
/** clearNone, but toggleable. */
|
||||
clearNoneTogglei;
|
||||
|
||||
public static ScrollPaneStyle defaultPane, horizontalPane, smallPane, noBarPane;
|
||||
public static SliderStyle defaultSlider;
|
||||
@@ -113,7 +152,7 @@ public class Styles{
|
||||
down = flatOver;
|
||||
up = underlineWhite;
|
||||
}};
|
||||
clearPartialt = new TextButtonStyle(){{
|
||||
flatBordert = new TextButtonStyle(){{
|
||||
down = flatOver;
|
||||
up = pane;
|
||||
over = flatDownBase;
|
||||
@@ -121,7 +160,7 @@ public class Styles{
|
||||
fontColor = Color.white;
|
||||
disabledFontColor = Color.gray;
|
||||
}};
|
||||
transt = new TextButtonStyle(){{
|
||||
cleart = new TextButtonStyle(){{
|
||||
down = flatDown;
|
||||
up = none;
|
||||
over = flatOver;
|
||||
@@ -129,7 +168,7 @@ public class Styles{
|
||||
fontColor = Color.white;
|
||||
disabledFontColor = Color.gray;
|
||||
}};
|
||||
clearTogglet = new TextButtonStyle(){{
|
||||
flatTogglet = new TextButtonStyle(){{
|
||||
font = Fonts.def;
|
||||
fontColor = Color.white;
|
||||
checked = flatDown;
|
||||
@@ -149,7 +188,7 @@ public class Styles{
|
||||
disabled = black;
|
||||
disabledFontColor = Color.gray;
|
||||
}};
|
||||
clearToggleMenut = new TextButtonStyle(){{
|
||||
flatToggleMenut = new TextButtonStyle(){{
|
||||
font = Fonts.def;
|
||||
fontColor = Color.white;
|
||||
checked = flatDown;
|
||||
@@ -206,7 +245,7 @@ public class Styles{
|
||||
imageOverColor = Color.lightGray;
|
||||
imageUpColor = Color.white;
|
||||
}};
|
||||
emptytogglei = new ImageButtonStyle(){{
|
||||
emptyTogglei = new ImageButtonStyle(){{
|
||||
imageCheckedColor = Color.white;
|
||||
imageDownColor = Color.white;
|
||||
imageUpColor = Color.gray;
|
||||
@@ -216,33 +255,27 @@ public class Styles{
|
||||
up = none;
|
||||
}};
|
||||
logici = new ImageButtonStyle(){{
|
||||
//imageDownColor = Pal.accent;
|
||||
imageUpColor = Color.black;
|
||||
}};
|
||||
geni = new ImageButtonStyle(){{
|
||||
imageDownColor = Pal.accent;
|
||||
imageUpColor = Color.black;
|
||||
}};
|
||||
colori = new ImageButtonStyle(){{
|
||||
//imageDownColor = Pal.accent;
|
||||
imageUpColor = Color.white;
|
||||
}};
|
||||
accenti = new ImageButtonStyle(){{
|
||||
//imageDownColor = Pal.accent;
|
||||
grayi = new ImageButtonStyle(){{
|
||||
imageUpColor = Color.lightGray;
|
||||
imageDownColor = Color.white;
|
||||
}};
|
||||
cleari = new ImageButtonStyle(){{
|
||||
flati = new ImageButtonStyle(){{
|
||||
down = flatOver;
|
||||
up = black;
|
||||
over = flatOver;
|
||||
}};
|
||||
clearFulli = new ImageButtonStyle(){{
|
||||
squarei = new ImageButtonStyle(){{
|
||||
down = whiteui;
|
||||
up = pane;
|
||||
over = flatDown;
|
||||
}};
|
||||
clearPartiali = new ImageButtonStyle(){{
|
||||
clearNonei = new ImageButtonStyle(){{
|
||||
down = flatDown;
|
||||
up = none;
|
||||
over = flatOver;
|
||||
@@ -250,13 +283,13 @@ public class Styles{
|
||||
imageDisabledColor = Color.gray;
|
||||
imageUpColor = Color.white;
|
||||
}};
|
||||
clearTogglei = new ImageButtonStyle(){{
|
||||
squareTogglei = new ImageButtonStyle(){{
|
||||
down = flatDown;
|
||||
checked = flatDown;
|
||||
up = black;
|
||||
over = flatOver;
|
||||
}};
|
||||
clearTransi = new ImageButtonStyle(){{
|
||||
cleari = new ImageButtonStyle(){{
|
||||
down = flatDown;
|
||||
up = black6;
|
||||
over = flatOver;
|
||||
@@ -264,13 +297,13 @@ public class Styles{
|
||||
imageDisabledColor = Color.lightGray;
|
||||
imageUpColor = Color.white;
|
||||
}};
|
||||
clearToggleTransi = new ImageButtonStyle(){{
|
||||
clearTogglei = new ImageButtonStyle(){{
|
||||
down = flatDown;
|
||||
checked = flatDown;
|
||||
up = black6;
|
||||
over = flatOver;
|
||||
}};
|
||||
clearTogglePartiali = new ImageButtonStyle(){{
|
||||
clearNoneTogglei = new ImageButtonStyle(){{
|
||||
down = flatDown;
|
||||
checked = flatDown;
|
||||
up = none;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -134,7 +134,7 @@ public class HudFragment{
|
||||
select.left();
|
||||
select.defaults().size(dsize).left();
|
||||
|
||||
ImageButtonStyle style = Styles.clearTransi;
|
||||
ImageButtonStyle style = Styles.cleari;
|
||||
|
||||
select.button(Icon.menu, style, ui.paused::show).name("menu");
|
||||
flip = select.button(Icon.upOpen, style, this::toggleMenus).get();
|
||||
@@ -242,7 +242,7 @@ public class HudFragment{
|
||||
teams.left();
|
||||
int i = 0;
|
||||
for(Team team : Team.baseTeams){
|
||||
ImageButton button = teams.button(Tex.whiteui, Styles.clearTogglePartiali, 40f, () -> Call.setPlayerTeamEditor(player, team))
|
||||
ImageButton button = teams.button(Tex.whiteui, Styles.clearNoneTogglei, 40f, () -> Call.setPlayerTeamEditor(player, team))
|
||||
.size(50f).margin(6f).get();
|
||||
button.getImageCell().grow();
|
||||
button.getStyle().imageUpColor = team.color;
|
||||
|
||||
@@ -226,7 +226,7 @@ public class MenuFragment{
|
||||
for(Buttoni b : buttons){
|
||||
if(b == null) continue;
|
||||
Button[] out = {null};
|
||||
out[0] = t.button(b.text, b.icon, Styles.clearToggleMenut, () -> {
|
||||
out[0] = t.button(b.text, b.icon, Styles.flatToggleMenut, () -> {
|
||||
if(currentMenu == out[0]){
|
||||
currentMenu = null;
|
||||
fadeOutMenu();
|
||||
|
||||
@@ -343,7 +343,7 @@ public class PlacementFragment{
|
||||
.left().width(190f).padLeft(5);
|
||||
header.add().growX();
|
||||
if(unlocked(displayBlock)){
|
||||
header.button("?", Styles.clearPartialt, () -> {
|
||||
header.button("?", Styles.flatBordert, () -> {
|
||||
ui.content.show(displayBlock);
|
||||
Events.fire(new BlockInfoEvent());
|
||||
}).size(8 * 5).padTop(-5).padRight(-5).right().grow().name("blockinfo");
|
||||
@@ -518,7 +518,7 @@ public class PlacementFragment{
|
||||
needsAssign = false;
|
||||
}
|
||||
|
||||
categories.button(ui.getIcon(cat.name()), Styles.clearToggleTransi, () -> {
|
||||
categories.button(ui.getIcon(cat.name()), Styles.clearTogglei, () -> {
|
||||
currentCategory = cat;
|
||||
if(control.input.block != null){
|
||||
control.input.block = getSelectedBlock(currentCategory);
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ItemSelection{
|
||||
for(T item : items){
|
||||
if(!item.unlockedNow() || (item instanceof Item checkVisible && state.rules.hiddenBuildItems.contains(checkVisible)) || item.isHidden()) continue;
|
||||
|
||||
ImageButton button = cont.button(Tex.whiteui, Styles.clearToggleTransi, 24, () -> {
|
||||
ImageButton button = cont.button(Tex.whiteui, Styles.clearTogglei, 24, () -> {
|
||||
if(closeSelect) control.input.config.hideConfig();
|
||||
}).group(group).tooltip(item.localizedName).get();
|
||||
button.changed(() -> consumer.get(button.isChecked() ? item : null));
|
||||
|
||||
@@ -166,7 +166,7 @@ public class LaunchPad extends Block{
|
||||
return;
|
||||
}
|
||||
|
||||
table.button(Icon.upOpen, Styles.clearTransi, () -> {
|
||||
table.button(Icon.upOpen, Styles.cleari, () -> {
|
||||
ui.planet.showSelect(state.rules.sector, other -> {
|
||||
if(state.isCampaign()){
|
||||
state.rules.sector.info.destination = other;
|
||||
|
||||
@@ -131,7 +131,7 @@ public class CanvasBlock extends Block{
|
||||
|
||||
@Override
|
||||
public void buildConfiguration(Table table){
|
||||
table.button(Icon.pencil, Styles.clearTransi, () -> {
|
||||
table.button(Icon.pencil, Styles.cleari, () -> {
|
||||
Dialog dialog = new Dialog();
|
||||
|
||||
Pixmap pix = makePixmap();
|
||||
@@ -197,7 +197,7 @@ public class CanvasBlock extends Block{
|
||||
for(int i = 0; i < palette.length; i++){
|
||||
int fi = i;
|
||||
|
||||
var button = p.button(Tex.whiteui, Styles.clearTogglei, 30, () -> {
|
||||
var button = p.button(Tex.whiteui, Styles.squareTogglei, 30, () -> {
|
||||
curColor[0] = palette[fi];
|
||||
}).size(44).checked(b -> curColor[0] == palette[fi]).get();
|
||||
button.getStyle().imageUpColor = new Color(palette[i]);
|
||||
|
||||
@@ -565,7 +565,7 @@ public class LogicBlock extends Block{
|
||||
return;
|
||||
}
|
||||
|
||||
table.button(Icon.pencil, Styles.clearTransi, () -> {
|
||||
table.button(Icon.pencil, Styles.cleari, () -> {
|
||||
ui.logic.show(code, executor, privileged, code -> configure(compress(code, relativeConnections())));
|
||||
}).size(40);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class MessageBlock extends Block{
|
||||
|
||||
@Override
|
||||
public void buildConfiguration(Table table){
|
||||
table.button(Icon.pencil, Styles.clearTransi, () -> {
|
||||
table.button(Icon.pencil, Styles.cleari, () -> {
|
||||
if(mobile){
|
||||
Core.input.getTextInput(new TextInput(){{
|
||||
text = message.toString();
|
||||
|
||||
Reference in New Issue
Block a user