cleaning up what remains
This commit is contained in:
@@ -89,7 +89,7 @@ public class AssetsAnnotationProcessor extends AbstractProcessor{
|
|||||||
if(SourceVersion.isKeyword(varname)) varname += "s";
|
if(SourceVersion.isKeyword(varname)) varname += "s";
|
||||||
|
|
||||||
ttype.addField(ClassName.bestGuess(dtype), varname, Modifier.STATIC, Modifier.PUBLIC);
|
ttype.addField(ClassName.bestGuess(dtype), varname, Modifier.STATIC, Modifier.PUBLIC);
|
||||||
tload.addStatement(varname + " = ("+dtype+")io.anuke.arc.Core.atlas.getDrawable($S)", sfilen);
|
tload.addStatement(varname + " = ("+dtype+")io.anuke.arc.Core.atlas.drawable($S)", sfilen);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ public class AssetsAnnotationProcessor extends AbstractProcessor{
|
|||||||
t.getEnclosedElements().stream().filter(e -> e.getKind() == ElementKind.FIELD).forEach(field -> {
|
t.getEnclosedElements().stream().filter(e -> e.getKind() == ElementKind.FIELD).forEach(field -> {
|
||||||
String fname = field.getSimpleName().toString();
|
String fname = field.getSimpleName().toString();
|
||||||
if(fname.startsWith("default")){
|
if(fname.startsWith("default")){
|
||||||
load.addStatement("io.anuke.arc.Core.scene.addStyle(" + field.asType().toString() + ".class, io.anuke.mindustry.ui.Style." + fname + ")");
|
load.addStatement("io.anuke.arc.Core.scene.addStyle(" + field.asType().toString() + ".class, io.anuke.mindustry.ui.Styles." + fname + ")");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@@ -1,369 +0,0 @@
|
|||||||
{
|
|
||||||
Color: {
|
|
||||||
black: { a: 1, b: 0, g: 0, r: 0 },
|
|
||||||
white: { a: 1, b: 1, g: 1, r: 1 },
|
|
||||||
gray: { a: 1, b: 0.32, g: 0.32, r: 0.32 },
|
|
||||||
lightgray: { a: 1, b: 0.65, g: 0.65, r: 0.65 }
|
|
||||||
orange: { hex: "FFA500" },
|
|
||||||
accent: { hex: "ffd37f" }
|
|
||||||
},
|
|
||||||
TintedDrawable: {
|
|
||||||
dialogDim: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { r: 0, g: 0, b: 0, a: 0.9 }
|
|
||||||
},
|
|
||||||
guideDim: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { r: 0, g: 0, b: 0, a: 0.3 }
|
|
||||||
},
|
|
||||||
invis: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { r: 0, g: 0, b: 0, a: 0 }
|
|
||||||
}
|
|
||||||
loadDim: {
|
|
||||||
name: white,
|
|
||||||
color: { r: 0, g: 0, b: 0, a: 0.8 }
|
|
||||||
},
|
|
||||||
chatfield: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { r: 0, g: 0, b: 0, a: 0.2 }
|
|
||||||
},
|
|
||||||
dark: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { hex: "#000000ff" }
|
|
||||||
},
|
|
||||||
none: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { r: 0, g: 0, b: 0, a: 0 }
|
|
||||||
},
|
|
||||||
flat-trans: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { r: 0.0, g: 0.0, b: 0.0, a: 0.6 }
|
|
||||||
},
|
|
||||||
flat: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { r: 0.0, g: 0.0, b: 0.0, a: 1 }
|
|
||||||
},
|
|
||||||
flat-over: {
|
|
||||||
name: whiteui,
|
|
||||||
color: { hex: "#454545ff" }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
ButtonStyle: {
|
|
||||||
default: {
|
|
||||||
down: button-down,
|
|
||||||
up: button,
|
|
||||||
over: button-over,
|
|
||||||
disabled: button-disabled
|
|
||||||
},
|
|
||||||
square: {
|
|
||||||
over: button-square-over,
|
|
||||||
disabled: button-disabled,
|
|
||||||
down: button-square-down,
|
|
||||||
up: button-square
|
|
||||||
},
|
|
||||||
toggle: {
|
|
||||||
checked: button-down,
|
|
||||||
down: button-down,
|
|
||||||
up: button
|
|
||||||
},
|
|
||||||
wave: {
|
|
||||||
up: button-edge-4,
|
|
||||||
over: button-edge-over-4,
|
|
||||||
disabled: button-edge-4
|
|
||||||
},
|
|
||||||
},
|
|
||||||
TextButtonStyle: {
|
|
||||||
default: {
|
|
||||||
over: button-over,
|
|
||||||
disabled: button-disabled,
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
down: button-down,
|
|
||||||
up: button
|
|
||||||
},
|
|
||||||
square: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
over: button-square-over,
|
|
||||||
disabled: button-disabled,
|
|
||||||
down: button-square-down,
|
|
||||||
up: button-square
|
|
||||||
},
|
|
||||||
node: {
|
|
||||||
disabled: button,
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
up: button-over,
|
|
||||||
over: button-down
|
|
||||||
},
|
|
||||||
right: {
|
|
||||||
over: button-right-over,
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
down: button-right-down,
|
|
||||||
up: button-right
|
|
||||||
},
|
|
||||||
wave: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
up: button-edge-4
|
|
||||||
},
|
|
||||||
clear: {
|
|
||||||
over: flat-over,
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
down: flat-over,
|
|
||||||
up: flat
|
|
||||||
},
|
|
||||||
discord: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
up: discord-banner
|
|
||||||
},
|
|
||||||
info: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
up: info-banner
|
|
||||||
},
|
|
||||||
clear-partial: {
|
|
||||||
down: whiteui,
|
|
||||||
up: pane,
|
|
||||||
over: flat-down,
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray
|
|
||||||
},
|
|
||||||
clear-partial-2: {
|
|
||||||
down: flat-over,
|
|
||||||
up: none,
|
|
||||||
over: flat-over,
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray
|
|
||||||
},
|
|
||||||
empty: {
|
|
||||||
font: default
|
|
||||||
},
|
|
||||||
clear-toggle: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
checked: flat-down,
|
|
||||||
down: flat-down,
|
|
||||||
up: flat,
|
|
||||||
over: flat-over,
|
|
||||||
disabled: flat,
|
|
||||||
disabledFontColor: gray
|
|
||||||
},
|
|
||||||
clear-toggle-menu: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
checked: flat-down,
|
|
||||||
down: flat-down,
|
|
||||||
up: clear,
|
|
||||||
over: flat-over,
|
|
||||||
disabled: flat,
|
|
||||||
disabledFontColor: gray
|
|
||||||
}
|
|
||||||
toggle: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
checked: button-down,
|
|
||||||
down: button-down,
|
|
||||||
up: button,
|
|
||||||
over: button-over,
|
|
||||||
disabled: button-disabled,
|
|
||||||
disabledFontColor: gray
|
|
||||||
}
|
|
||||||
},
|
|
||||||
ImageButtonStyle: {
|
|
||||||
default: {
|
|
||||||
down: button-down,
|
|
||||||
up: button,
|
|
||||||
over: button-over,
|
|
||||||
imageDisabledColor: gray,
|
|
||||||
imageUpColor: white,
|
|
||||||
disabled: button-disabled
|
|
||||||
},
|
|
||||||
node: {
|
|
||||||
up: button-over,
|
|
||||||
over: button-down
|
|
||||||
},
|
|
||||||
right: {
|
|
||||||
over: button-right-over,
|
|
||||||
down: button-right-down,
|
|
||||||
up: button-right
|
|
||||||
},
|
|
||||||
empty: {
|
|
||||||
imageDownColor: accent,
|
|
||||||
imageUpColor: white
|
|
||||||
},
|
|
||||||
emptytoggle: {
|
|
||||||
imageCheckedColor: white,
|
|
||||||
imageDownColor: white,
|
|
||||||
imageUpColor: gray
|
|
||||||
},
|
|
||||||
static: {
|
|
||||||
up: button
|
|
||||||
},
|
|
||||||
static-down: {
|
|
||||||
up: button-down
|
|
||||||
},
|
|
||||||
toggle: {
|
|
||||||
checked: button-down,
|
|
||||||
down: button-down,
|
|
||||||
up: button,
|
|
||||||
imageDisabledColor: gray,
|
|
||||||
imageUpColor: white
|
|
||||||
},
|
|
||||||
select: {
|
|
||||||
checked: button-select,
|
|
||||||
up: none
|
|
||||||
},
|
|
||||||
clear: {
|
|
||||||
down: flat-over,
|
|
||||||
up: flat,
|
|
||||||
over: flat-over
|
|
||||||
},
|
|
||||||
clear-full: {
|
|
||||||
down: whiteui,
|
|
||||||
up: pane,
|
|
||||||
over: flat-down
|
|
||||||
},
|
|
||||||
clear-partial: {
|
|
||||||
down: flat-down,
|
|
||||||
up: none,
|
|
||||||
over: flat-over
|
|
||||||
},
|
|
||||||
clear-toggle: {
|
|
||||||
down: flat-down,
|
|
||||||
checked: flat-down,
|
|
||||||
up: flat,
|
|
||||||
over: flat-over
|
|
||||||
},
|
|
||||||
clear-trans: {
|
|
||||||
down: flat-down,
|
|
||||||
up: flat-trans,
|
|
||||||
over: flat-over
|
|
||||||
},
|
|
||||||
clear-toggle-trans: {
|
|
||||||
down: flat-down,
|
|
||||||
checked: flat-down,
|
|
||||||
up: flat-trans,
|
|
||||||
over: flat-over
|
|
||||||
},
|
|
||||||
clear-toggle-partial: {
|
|
||||||
down: flat-down,
|
|
||||||
checked: flat-down,
|
|
||||||
up: none,
|
|
||||||
over: flat-over
|
|
||||||
},
|
|
||||||
},
|
|
||||||
ScrollPaneStyle: {
|
|
||||||
default: {
|
|
||||||
vScroll: scroll,
|
|
||||||
vScrollKnob: scroll-knob-vertical-black
|
|
||||||
},
|
|
||||||
horizontal: {
|
|
||||||
vScroll: scroll,
|
|
||||||
vScrollKnob: scroll-knob-vertical-black,
|
|
||||||
hScroll: scroll-horizontal,
|
|
||||||
hScrollKnob: scroll-knob-horizontal-black
|
|
||||||
},
|
|
||||||
},
|
|
||||||
WindowStyle: {
|
|
||||||
default: {
|
|
||||||
stageBackground: dialogDim,
|
|
||||||
titleFont: default,
|
|
||||||
background: window-empty,
|
|
||||||
titleFontColor: accent
|
|
||||||
},
|
|
||||||
dialog: {
|
|
||||||
stageBackground: dialogDim,
|
|
||||||
titleFont: default,
|
|
||||||
background: window-empty,
|
|
||||||
titleFontColor: accent
|
|
||||||
},
|
|
||||||
fulldialog: {
|
|
||||||
stageBackground: dark,
|
|
||||||
titleFont: default,
|
|
||||||
background: window-empty,
|
|
||||||
titleFontColor: accent
|
|
||||||
}
|
|
||||||
},
|
|
||||||
KeybindDialogStyle: {
|
|
||||||
default: {
|
|
||||||
keyColor: accent,
|
|
||||||
keyNameColor: white,
|
|
||||||
controllerColor: lightgray
|
|
||||||
},
|
|
||||||
},
|
|
||||||
SliderStyle: {
|
|
||||||
default-horizontal: {
|
|
||||||
background: slider,
|
|
||||||
knob: slider-knob,
|
|
||||||
knobOver: slider-knob-over,
|
|
||||||
knobDown: slider-knob-down
|
|
||||||
},
|
|
||||||
default-vertical: {
|
|
||||||
background: slider-vertical,
|
|
||||||
knob: slider-knob,
|
|
||||||
knobOver: slider-knob-over,
|
|
||||||
knobDown: slider-knob-down
|
|
||||||
}
|
|
||||||
},
|
|
||||||
LabelStyle: {
|
|
||||||
default: {
|
|
||||||
font: default,
|
|
||||||
fontColor: white
|
|
||||||
},
|
|
||||||
outline: {
|
|
||||||
font: outline,
|
|
||||||
fontColor: white
|
|
||||||
}
|
|
||||||
},
|
|
||||||
TextFieldStyle: {
|
|
||||||
default: {
|
|
||||||
font: chat,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
disabledBackground: underline-disabled,
|
|
||||||
selection: selection,
|
|
||||||
background: underline,
|
|
||||||
invalidBackground: underline-red,
|
|
||||||
cursor: cursor,
|
|
||||||
messageFont: default,
|
|
||||||
messageFontColor: gray
|
|
||||||
}
|
|
||||||
textarea: {
|
|
||||||
font: chat,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
selection: selection,
|
|
||||||
background: underline,
|
|
||||||
cursor: cursor,
|
|
||||||
messageFont: default,
|
|
||||||
messageFontColor: gray
|
|
||||||
}
|
|
||||||
},
|
|
||||||
CheckBoxStyle: {
|
|
||||||
default: {
|
|
||||||
checkboxOn: check-on,
|
|
||||||
checkboxOff: check-off,
|
|
||||||
checkboxOnOver: check-on-over,
|
|
||||||
checkboxOver: check-over,
|
|
||||||
checkboxOnDisabled: check-on-disabled,
|
|
||||||
checkboxOffDisabled: check-disabled,
|
|
||||||
font: default,
|
|
||||||
fontColor: white,
|
|
||||||
disabledFontColor: gray,
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -334,7 +334,7 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(Strings.parseException(exc, true)).color(Color.LIGHT_GRAY).left()), true);
|
Collapser col = new Collapser(base -> base.pane(t -> t.margin(14f).add(Strings.parseException(exc, true)).color(Color.LIGHT_GRAY).left()), true);
|
||||||
|
|
||||||
cont.addButton("$details", Style.toggleTbutton, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().right();
|
cont.addButton("$details", Styles.togglet, col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().right();
|
||||||
cont.addButton("$ok", this::hide).size(100, 50).fillX().left();
|
cont.addButton("$ok", this::hide).size(100, 50).fillX().left();
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.add(col).colspan(2).pad(2);
|
cont.add(col).colspan(2).pad(2);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import io.anuke.mindustry.gen.*;
|
|||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.io.*;
|
import io.anuke.mindustry.io.*;
|
||||||
import io.anuke.mindustry.maps.*;
|
import io.anuke.mindustry.maps.*;
|
||||||
import io.anuke.mindustry.ui.Style;
|
import io.anuke.mindustry.ui.Styles;
|
||||||
import io.anuke.mindustry.ui.dialogs.*;
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
@@ -49,7 +49,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
public MapEditorDialog(){
|
public MapEditorDialog(){
|
||||||
super("");
|
super("");
|
||||||
|
|
||||||
background(Style.dark);
|
background(Styles.black);
|
||||||
|
|
||||||
editor = new MapEditor();
|
editor = new MapEditor();
|
||||||
view = new MapView(editor);
|
view = new MapView(editor);
|
||||||
@@ -398,7 +398,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
Consumer<EditorTool> addTool = tool -> {
|
Consumer<EditorTool> addTool = tool -> {
|
||||||
|
|
||||||
ImageButton button = new ImageButton(Core.atlas.drawable("icon-" + tool.name() + "-small"), Style.clearToggleIbutton);
|
ImageButton button = new ImageButton(Core.atlas.drawable("icon-" + tool.name() + "-small"), Styles.clearTogglei);
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
view.setTool(tool);
|
view.setTool(tool);
|
||||||
if(lastTable[0] != null){
|
if(lastTable[0] != null){
|
||||||
@@ -424,7 +424,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
lastTable[0].remove();
|
lastTable[0].remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
Table table = new Table(Style.dialogDim);
|
Table table = new Table(Styles.black9);
|
||||||
table.defaults().size(300f, 70f);
|
table.defaults().size(300f, 70f);
|
||||||
|
|
||||||
for(int i = 0; i < tool.altModes.length; i++){
|
for(int i = 0; i < tool.altModes.length; i++){
|
||||||
@@ -434,7 +434,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
table.addButton(b -> {
|
table.addButton(b -> {
|
||||||
b.left();
|
b.left();
|
||||||
b.marginLeft(6);
|
b.marginLeft(6);
|
||||||
b.setStyle(Style.clearToggleTbutton);
|
b.setStyle(Styles.clearTogglet);
|
||||||
b.add(Core.bundle.get("toolmode." + name)).left();
|
b.add(Core.bundle.get("toolmode." + name)).left();
|
||||||
b.row();
|
b.row();
|
||||||
b.add(Core.bundle.get("toolmode." + name + ".description")).color(Color.LIGHT_GRAY).left();
|
b.add(Core.bundle.get("toolmode." + name + ".description")).color(Color.LIGHT_GRAY).left();
|
||||||
@@ -474,16 +474,16 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
tools.defaults().size(size, size);
|
tools.defaults().size(size, size);
|
||||||
|
|
||||||
tools.addImageButton(Icon.menuLargeSmall, Style.clearIbutton, menu::show);
|
tools.addImageButton(Icon.menuLargeSmall, Styles.cleari, menu::show);
|
||||||
|
|
||||||
ImageButton grid = tools.addImageButton(Icon.gridSmall, Style.clearToggleIbutton, () -> view.setGrid(!view.isGrid())).get();
|
ImageButton grid = tools.addImageButton(Icon.gridSmall, Styles.clearTogglei, () -> view.setGrid(!view.isGrid())).get();
|
||||||
|
|
||||||
addTool.accept(EditorTool.zoom);
|
addTool.accept(EditorTool.zoom);
|
||||||
|
|
||||||
tools.row();
|
tools.row();
|
||||||
|
|
||||||
ImageButton undo = tools.addImageButton(Icon.undoSmall, Style.clearIbutton, editor::undo).get();
|
ImageButton undo = tools.addImageButton(Icon.undoSmall, Styles.cleari, editor::undo).get();
|
||||||
ImageButton redo = tools.addImageButton(Icon.redoSmall, Style.clearIbutton, editor::redo).get();
|
ImageButton redo = tools.addImageButton(Icon.redoSmall, Styles.cleari, editor::redo).get();
|
||||||
|
|
||||||
addTool.accept(EditorTool.pick);
|
addTool.accept(EditorTool.pick);
|
||||||
|
|
||||||
@@ -505,7 +505,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
addTool.accept(EditorTool.fill);
|
addTool.accept(EditorTool.fill);
|
||||||
addTool.accept(EditorTool.spray);
|
addTool.accept(EditorTool.spray);
|
||||||
|
|
||||||
ImageButton rotate = tools.addImageButton(Icon.arrow16Small, Style.clearIbutton, () -> editor.rotation = (editor.rotation + 1) % 4).get();
|
ImageButton rotate = tools.addImageButton(Icon.arrow16Small, Styles.cleari, () -> editor.rotation = (editor.rotation + 1) % 4).get();
|
||||||
rotate.getImage().update(() -> {
|
rotate.getImage().update(() -> {
|
||||||
rotate.getImage().setRotation(editor.rotation * 90);
|
rotate.getImage().setRotation(editor.rotation * 90);
|
||||||
rotate.getImage().setOrigin(Align.center);
|
rotate.getImage().setOrigin(Align.center);
|
||||||
@@ -523,7 +523,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for(Team team : Team.all){
|
for(Team team : Team.all){
|
||||||
ImageButton button = new ImageButton(Tex.whiteui, Style.clearTogglePartialIbutton);
|
ImageButton button = new ImageButton(Tex.whiteui, Styles.clearTogglePartiali);
|
||||||
button.margin(4f);
|
button.margin(4f);
|
||||||
button.getImageCell().grow();
|
button.getImageCell().grow();
|
||||||
button.getStyle().imageUpColor = team.color;
|
button.getStyle().imageUpColor = team.color;
|
||||||
@@ -675,7 +675,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
if(!Core.atlas.isFound(region)) continue;
|
if(!Core.atlas.isFound(region)) continue;
|
||||||
|
|
||||||
ImageButton button = new ImageButton(Tex.whiteui, Style.clearToggleIbutton);
|
ImageButton button = new ImageButton(Tex.whiteui, Styles.clearTogglei);
|
||||||
button.getStyle().imageUp = new TextureRegionDrawable(region);
|
button.getStyle().imageUp = new TextureRegionDrawable(region);
|
||||||
button.clicked(() -> editor.drawBlock = block);
|
button.clicked(() -> editor.drawBlock = block);
|
||||||
button.resizeImage(8 * 4f);
|
button.resizeImage(8 * 4f);
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, new Stack(){{
|
}, new Stack(){{
|
||||||
add(new Image(Style.loadDim));
|
add(new Image(Styles.black8));
|
||||||
add(new Image(Icon.refresh, Scaling.none));
|
add(new Image(Icon.refresh, Scaling.none));
|
||||||
visible(() -> generating && !updateEditorOnChange);
|
visible(() -> generating && !updateEditorOnChange);
|
||||||
}}).grow().padRight(10);
|
}}).grow().padRight(10);
|
||||||
@@ -233,7 +233,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
t.row();
|
t.row();
|
||||||
|
|
||||||
t.table(b -> {
|
t.table(b -> {
|
||||||
ImageButtonStyle style = Style.clearIbutton;
|
ImageButtonStyle style = Styles.cleari;
|
||||||
b.defaults().size(50f);
|
b.defaults().size(50f);
|
||||||
b.addImageButton(Icon.refreshSmall, style, () -> {
|
b.addImageButton(Icon.refreshSmall, style, () -> {
|
||||||
filter.randomize();
|
filter.randomize();
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class MapInfoDialog extends FloatingDialog{
|
|||||||
t.row();
|
t.row();
|
||||||
t.add("$editor.description").padRight(8).left();
|
t.add("$editor.description").padRight(8).left();
|
||||||
|
|
||||||
TextArea description = t.addArea(tags.get("description", ""), Style.textareaField, text -> {
|
TextArea description = t.addArea(tags.get("description", ""), Styles.areaField, text -> {
|
||||||
tags.put("description", text);
|
tags.put("description", text);
|
||||||
}).size(400f, 140f).get();
|
}).size(400f, 140f).get();
|
||||||
|
|
||||||
|
|||||||
@@ -48,12 +48,12 @@ public class MapLoadDialog extends FloatingDialog{
|
|||||||
table.defaults().size(200f, 90f).pad(4f);
|
table.defaults().size(200f, 90f).pad(4f);
|
||||||
table.margin(10f);
|
table.margin(10f);
|
||||||
|
|
||||||
ScrollPane pane = new ScrollPane(table, Style.horizontalPane);
|
ScrollPane pane = new ScrollPane(table, Styles.horizontalPane);
|
||||||
pane.setFadeScrollBars(false);
|
pane.setFadeScrollBars(false);
|
||||||
|
|
||||||
for(Map map : maps.all()){
|
for(Map map : maps.all()){
|
||||||
|
|
||||||
TextButton button = new TextButton(map.name(), Style.toggleTbutton);
|
TextButton button = new TextButton(map.name(), Styles.togglet);
|
||||||
button.add(new BorderImage(map.texture, 2f).setScaling(Scaling.fit)).size(16 * 4f);
|
button.add(new BorderImage(map.texture, 2f).setScaling(Scaling.fit)).size(16 * 4f);
|
||||||
button.getCells().reverse();
|
button.getCells().reverse();
|
||||||
button.clicked(() -> selected = map);
|
button.clicked(() -> selected = map);
|
||||||
|
|||||||
@@ -255,23 +255,23 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
table.row();
|
table.row();
|
||||||
table.left().margin(0f).defaults().size(48f);
|
table.left().margin(0f).defaults().size(48f);
|
||||||
|
|
||||||
table.addImageButton(Icon.breakSmall, Style.clearTogglePartialIbutton, () -> {
|
table.addImageButton(Icon.breakSmall, Styles.clearTogglePartiali, () -> {
|
||||||
mode = mode == breaking ? block == null ? none : placing : breaking;
|
mode = mode == breaking ? block == null ? none : placing : breaking;
|
||||||
lastBlock = block;
|
lastBlock = block;
|
||||||
}).update(l -> l.setChecked(mode == breaking)).name("breakmode");
|
}).update(l -> l.setChecked(mode == breaking)).name("breakmode");
|
||||||
|
|
||||||
//diagonal swap button
|
//diagonal swap button
|
||||||
table.addImageButton(Icon.diagonalSmall, Style.clearTogglePartialIbutton, () -> {
|
table.addImageButton(Icon.diagonalSmall, Styles.clearTogglePartiali, () -> {
|
||||||
Core.settings.put("swapdiagonal", !Core.settings.getBool("swapdiagonal"));
|
Core.settings.put("swapdiagonal", !Core.settings.getBool("swapdiagonal"));
|
||||||
Core.settings.save();
|
Core.settings.save();
|
||||||
}).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal")));
|
}).update(l -> l.setChecked(Core.settings.getBool("swapdiagonal")));
|
||||||
|
|
||||||
//rotate button
|
//rotate button
|
||||||
table.addImageButton(Icon.arrowSmall, Style.clearPartialIbutton,() -> rotation = Mathf.mod(rotation + 1, 4))
|
table.addImageButton(Icon.arrowSmall, Styles.clearPartiali,() -> rotation = Mathf.mod(rotation + 1, 4))
|
||||||
.update(i -> i.getImage().setRotationOrigin(rotation * 90, Align.center)).visible(() -> block != null && block.rotate);
|
.update(i -> i.getImage().setRotationOrigin(rotation * 90, Align.center)).visible(() -> block != null && block.rotate);
|
||||||
|
|
||||||
//confirm button
|
//confirm button
|
||||||
table.addImageButton(Icon.checkSmall, Style.clearPartialIbutton, () -> {
|
table.addImageButton(Icon.checkSmall, Styles.clearPartiali, () -> {
|
||||||
for(PlaceRequest request : selection){
|
for(PlaceRequest request : selection){
|
||||||
Tile tile = request.tile();
|
Tile tile = request.tile();
|
||||||
|
|
||||||
|
|||||||
@@ -22,45 +22,32 @@ import io.anuke.mindustry.graphics.*;
|
|||||||
import static io.anuke.mindustry.gen.Tex.*;
|
import static io.anuke.mindustry.gen.Tex.*;
|
||||||
|
|
||||||
@StyleDefaults
|
@StyleDefaults
|
||||||
public class Style{
|
public class Styles{
|
||||||
public static Drawable
|
public static Drawable
|
||||||
dialogDim = whiteui.tint(0f, 0f, 0f, 0.9f),
|
black = whiteui.tint(0f, 0f, 0f, 1f),
|
||||||
loadDim = whiteui.tint(0f, 0f, 0f, 0.8f),
|
black9 = whiteui.tint(0f, 0f, 0f, 0.9f),
|
||||||
guideDim = whiteui.tint(0f, 0f, 0f, 0.3f),
|
black8 = whiteui.tint(0f, 0f, 0f, 0.8f),
|
||||||
chatfield = whiteui.tint(0f, 0f, 0f, 0.2f),
|
black6 = whiteui.tint(0f, 0f, 0f, 0.6f),
|
||||||
dark = whiteui.tint(0f, 0f, 0f, 1f),
|
black3 = whiteui.tint(0f, 0f, 0f, 0.3f),
|
||||||
none = whiteui.tint(0f, 0f, 0f, 0.1f),
|
none = whiteui.tint(0f, 0f, 0f, 0f),
|
||||||
flatTrans = whiteui.tint(0f, 0f, 0f, 0.6f),
|
|
||||||
flat = whiteui.tint(0f, 0f, 0f, 1f),
|
|
||||||
flatDown = createFlatDown(),
|
flatDown = createFlatDown(),
|
||||||
flatOver = whiteui.tint(Color.valueOf("454545"));
|
flatOver = whiteui.tint(Color.valueOf("454545"));
|
||||||
|
|
||||||
public static ButtonStyle
|
public static ButtonStyle
|
||||||
defaultButton = new ButtonStyle(){{
|
defaultb = new ButtonStyle(){{
|
||||||
down = buttonDown;
|
down = buttonDown;
|
||||||
up = button;
|
up = button;
|
||||||
over = buttonOver;
|
over = buttonOver;
|
||||||
disabled = buttonDisabled;
|
disabled = buttonDisabled;
|
||||||
}},
|
}},
|
||||||
squareButton = new ButtonStyle(){{
|
waveb = new ButtonStyle(){{
|
||||||
over = buttonSquareOver;
|
|
||||||
disabled = buttonDisabled;
|
|
||||||
down = buttonSquareDown;
|
|
||||||
up = buttonSquare;
|
|
||||||
}},
|
|
||||||
toggleButton = new ButtonStyle(){{
|
|
||||||
checked = buttonDown;
|
|
||||||
down = buttonDown;
|
|
||||||
up = button;
|
|
||||||
}},
|
|
||||||
waveButton = new ButtonStyle(){{
|
|
||||||
up = buttonEdge4;
|
up = buttonEdge4;
|
||||||
over = buttonEdgeOver4;
|
over = buttonEdgeOver4;
|
||||||
disabled = buttonEdge4;
|
disabled = buttonEdge4;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
public static TextButtonStyle
|
public static TextButtonStyle
|
||||||
defaultTbutton = new TextButtonStyle(){{
|
defaultt = new TextButtonStyle(){{
|
||||||
over = buttonOver;
|
over = buttonOver;
|
||||||
disabled = buttonDisabled;
|
disabled = buttonDisabled;
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
@@ -69,7 +56,7 @@ public class Style{
|
|||||||
down = buttonDown;
|
down = buttonDown;
|
||||||
up = button;
|
up = button;
|
||||||
}},
|
}},
|
||||||
squareTbutton = new TextButtonStyle(){{
|
squaret = new TextButtonStyle(){{
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
disabledFontColor = Color.GRAY;
|
disabledFontColor = Color.GRAY;
|
||||||
@@ -78,7 +65,7 @@ public class Style{
|
|||||||
down = buttonSquareDown;
|
down = buttonSquareDown;
|
||||||
up = buttonSquare;
|
up = buttonSquare;
|
||||||
}},
|
}},
|
||||||
nodeTbutton = new TextButtonStyle(){{
|
nodet = new TextButtonStyle(){{
|
||||||
disabled = button;
|
disabled = button;
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
@@ -86,39 +73,25 @@ public class Style{
|
|||||||
up = buttonOver;
|
up = buttonOver;
|
||||||
over = buttonDown;
|
over = buttonDown;
|
||||||
}},
|
}},
|
||||||
rightTbutton = new TextButtonStyle(){{
|
cleart = new TextButtonStyle(){{
|
||||||
over = buttonRightOver;
|
|
||||||
font = Fonts.def;
|
|
||||||
fontColor = Color.WHITE;
|
|
||||||
disabledFontColor = Color.GRAY;
|
|
||||||
down = buttonRightDown;
|
|
||||||
up = buttonRight;
|
|
||||||
}},
|
|
||||||
waveTbutton = new TextButtonStyle(){{
|
|
||||||
font = Fonts.def;
|
|
||||||
fontColor = Color.WHITE;
|
|
||||||
disabledFontColor = Color.GRAY;
|
|
||||||
up = buttonEdge4;
|
|
||||||
}},
|
|
||||||
clearTbutton = new TextButtonStyle(){{
|
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
disabledFontColor = Color.GRAY;
|
disabledFontColor = Color.GRAY;
|
||||||
down = flatOver;
|
down = flatOver;
|
||||||
up = flat;
|
up = black;
|
||||||
}},
|
}},
|
||||||
discordTbutton = new TextButtonStyle(){{
|
discordt = new TextButtonStyle(){{
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
up = discordBanner;
|
up = discordBanner;
|
||||||
}},
|
}},
|
||||||
infoTbutton = new TextButtonStyle(){{
|
infot = new TextButtonStyle(){{
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
up = infoBanner;
|
up = infoBanner;
|
||||||
}},
|
}},
|
||||||
clearPartialTbutton = new TextButtonStyle(){{
|
clearPartialt = new TextButtonStyle(){{
|
||||||
down = whiteui;
|
down = whiteui;
|
||||||
up = pane;
|
up = pane;
|
||||||
over = flatDown;
|
over = flatDown;
|
||||||
@@ -126,38 +99,27 @@ public class Style{
|
|||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
disabledFontColor = Color.GRAY;
|
disabledFontColor = Color.GRAY;
|
||||||
}},
|
}},
|
||||||
clearPartial2Tbutton = new TextButtonStyle(){{
|
clearTogglet = new TextButtonStyle(){{
|
||||||
down = flatOver;
|
|
||||||
up = none;
|
|
||||||
over = flatOver;
|
|
||||||
font = Fonts.def;
|
|
||||||
fontColor = Color.WHITE;
|
|
||||||
disabledFontColor = Color.GRAY;
|
|
||||||
}},
|
|
||||||
emptyTbutton = new TextButtonStyle(){{
|
|
||||||
font = Fonts.def;
|
|
||||||
}},
|
|
||||||
clearToggleTbutton = new TextButtonStyle(){{
|
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
checked = flatDown;
|
checked = flatDown;
|
||||||
down = flatDown;
|
down = flatDown;
|
||||||
up = flat;
|
up = black;
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
disabled = flat;
|
disabled = black;
|
||||||
disabledFontColor = Color.GRAY;
|
disabledFontColor = Color.GRAY;
|
||||||
}},
|
}},
|
||||||
clearToggleMenuTbutton = new TextButtonStyle(){{
|
clearToggleMenut = new TextButtonStyle(){{
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
checked = flatDown;
|
checked = flatDown;
|
||||||
down = flatDown;
|
down = flatDown;
|
||||||
up = clear;
|
up = clear;
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
disabled = flat;
|
disabled = black;
|
||||||
disabledFontColor = Color.GRAY;
|
disabledFontColor = Color.GRAY;
|
||||||
}},
|
}},
|
||||||
toggleTbutton = new TextButtonStyle(){{
|
togglet = new TextButtonStyle(){{
|
||||||
font = Fonts.def;
|
font = Fonts.def;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
checked = buttonDown;
|
checked = buttonDown;
|
||||||
@@ -169,7 +131,7 @@ public class Style{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
public static ImageButtonStyle
|
public static ImageButtonStyle
|
||||||
defaultIbutton = new ImageButtonStyle(){{
|
defaulti = new ImageButtonStyle(){{
|
||||||
down = buttonDown;
|
down = buttonDown;
|
||||||
up = button;
|
up = button;
|
||||||
over = buttonOver;
|
over = buttonOver;
|
||||||
@@ -177,74 +139,61 @@ public class Style{
|
|||||||
imageUpColor = Color.WHITE;
|
imageUpColor = Color.WHITE;
|
||||||
disabled = buttonDisabled;
|
disabled = buttonDisabled;
|
||||||
}},
|
}},
|
||||||
nodeIbutton = new ImageButtonStyle(){{
|
nodei = new ImageButtonStyle(){{
|
||||||
up = buttonOver;
|
up = buttonOver;
|
||||||
over = buttonDown;
|
over = buttonDown;
|
||||||
}},
|
}},
|
||||||
rightIbutton = new ImageButtonStyle(){{
|
righti = new ImageButtonStyle(){{
|
||||||
over = buttonRightOver;
|
over = buttonRightOver;
|
||||||
down = buttonRightDown;
|
down = buttonRightDown;
|
||||||
up = buttonRight;
|
up = buttonRight;
|
||||||
}},
|
}},
|
||||||
emptyIbutton = new ImageButtonStyle(){{
|
emptyi = new ImageButtonStyle(){{
|
||||||
imageDownColor = Pal.accent;
|
imageDownColor = Pal.accent;
|
||||||
imageUpColor = Color.WHITE;
|
imageUpColor = Color.WHITE;
|
||||||
}},
|
}},
|
||||||
emptytoggleIbutton = new ImageButtonStyle(){{
|
emptytogglei = new ImageButtonStyle(){{
|
||||||
imageCheckedColor = Color.WHITE;
|
imageCheckedColor = Color.WHITE;
|
||||||
imageDownColor = Color.WHITE;
|
imageDownColor = Color.WHITE;
|
||||||
imageUpColor = Color.GRAY;
|
imageUpColor = Color.GRAY;
|
||||||
}},
|
}},
|
||||||
staticIbutton = new ImageButtonStyle(){{
|
selecti = new ImageButtonStyle(){{
|
||||||
up = button;
|
|
||||||
}},
|
|
||||||
staticDownIbutton = new ImageButtonStyle(){{
|
|
||||||
up = buttonDown;
|
|
||||||
}},
|
|
||||||
toggleIbutton = new ImageButtonStyle(){{
|
|
||||||
checked = buttonDown;
|
|
||||||
down = buttonDown;
|
|
||||||
up = button;
|
|
||||||
imageDisabledColor = Color.GRAY;
|
|
||||||
imageUpColor = Color.WHITE;
|
|
||||||
}},
|
|
||||||
selectIbutton = new ImageButtonStyle(){{
|
|
||||||
checked = buttonSelect;
|
checked = buttonSelect;
|
||||||
up = none;
|
up = none;
|
||||||
}},
|
}},
|
||||||
clearIbutton = new ImageButtonStyle(){{
|
cleari = new ImageButtonStyle(){{
|
||||||
down = flatOver;
|
down = flatOver;
|
||||||
up = flat;
|
up = black;
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
}},
|
}},
|
||||||
clearFullIbutton = new ImageButtonStyle(){{
|
clearFulli = new ImageButtonStyle(){{
|
||||||
down = whiteui;
|
down = whiteui;
|
||||||
up = pane;
|
up = pane;
|
||||||
over = flatDown;
|
over = flatDown;
|
||||||
}},
|
}},
|
||||||
clearPartialIbutton = new ImageButtonStyle(){{
|
clearPartiali = new ImageButtonStyle(){{
|
||||||
down = flatDown;
|
down = flatDown;
|
||||||
up = none;
|
up = none;
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
}},
|
}},
|
||||||
clearToggleIbutton = new ImageButtonStyle(){{
|
clearTogglei = new ImageButtonStyle(){{
|
||||||
down = flatDown;
|
down = flatDown;
|
||||||
checked = flatDown;
|
checked = flatDown;
|
||||||
up = flat;
|
up = black;
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
}},
|
}},
|
||||||
clearTransIbutton = new ImageButtonStyle(){{
|
clearTransi = new ImageButtonStyle(){{
|
||||||
down = flatDown;
|
down = flatDown;
|
||||||
up = flatTrans;
|
up = black6;
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
}},
|
}},
|
||||||
clearToggleTransIbutton = new ImageButtonStyle(){{
|
clearToggleTransi = new ImageButtonStyle(){{
|
||||||
down = flatDown;
|
down = flatDown;
|
||||||
checked = flatDown;
|
checked = flatDown;
|
||||||
up = flatTrans;
|
up = black6;
|
||||||
over = flatOver;
|
over = flatOver;
|
||||||
}},
|
}},
|
||||||
clearTogglePartialIbutton = new ImageButtonStyle(){{
|
clearTogglePartiali = new ImageButtonStyle(){{
|
||||||
down = flatDown;
|
down = flatDown;
|
||||||
checked = flatDown;
|
checked = flatDown;
|
||||||
up = none;
|
up = none;
|
||||||
@@ -271,13 +220,13 @@ public class Style{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
public static SliderStyle
|
public static SliderStyle
|
||||||
defaultHorizontalSlider = new SliderStyle(){{
|
defaultSlider = new SliderStyle(){{
|
||||||
background = slider;
|
background = slider;
|
||||||
knob = sliderKnob;
|
knob = sliderKnob;
|
||||||
knobOver = sliderKnobOver;
|
knobOver = sliderKnobOver;
|
||||||
knobDown = sliderKnobDown;
|
knobDown = sliderKnobDown;
|
||||||
}},
|
}},
|
||||||
defaultVerticalSlider = new SliderStyle(){{
|
vSlider = new SliderStyle(){{
|
||||||
background = sliderVertical;
|
background = sliderVertical;
|
||||||
knob = sliderKnob;
|
knob = sliderKnob;
|
||||||
knobOver = sliderKnobOver;
|
knobOver = sliderKnobOver;
|
||||||
@@ -307,7 +256,7 @@ public class Style{
|
|||||||
messageFont = Fonts.def;
|
messageFont = Fonts.def;
|
||||||
messageFontColor = Color.GRAY;
|
messageFontColor = Color.GRAY;
|
||||||
}},
|
}},
|
||||||
textareaField = new TextFieldStyle(){{
|
areaField = new TextFieldStyle(){{
|
||||||
font = Fonts.chat;
|
font = Fonts.chat;
|
||||||
fontColor = Color.WHITE;
|
fontColor = Color.WHITE;
|
||||||
disabledFontColor = Color.GRAY;
|
disabledFontColor = Color.GRAY;
|
||||||
@@ -330,20 +279,19 @@ public class Style{
|
|||||||
disabledFontColor = Color.GRAY;
|
disabledFontColor = Color.GRAY;
|
||||||
}};
|
}};
|
||||||
public static DialogStyle
|
public static DialogStyle
|
||||||
defaultWindow = new DialogStyle(){{
|
defaultDialog = new DialogStyle(){{
|
||||||
stageBackground = dialogDim;
|
stageBackground = black9;
|
||||||
titleFont = Fonts.def;
|
titleFont = Fonts.def;
|
||||||
background = windowEmpty;
|
background = windowEmpty;
|
||||||
titleFontColor = Pal.accent;
|
titleFontColor = Pal.accent;
|
||||||
}},
|
}},
|
||||||
fulldialogWindow = new DialogStyle(){{
|
fullDialog = new DialogStyle(){{
|
||||||
stageBackground = dark;
|
stageBackground = black;
|
||||||
titleFont = Fonts.def;
|
titleFont = Fonts.def;
|
||||||
background = windowEmpty;
|
background = windowEmpty;
|
||||||
titleFontColor = Pal.accent;
|
titleFontColor = Pal.accent;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
private static Drawable createFlatDown(){
|
private static Drawable createFlatDown(){
|
||||||
AtlasRegion region = Core.atlas.find("flat-down-base");
|
AtlasRegion region = Core.atlas.find("flat-down-base");
|
||||||
int[] splits = region.splits;
|
int[] splits = region.splits;
|
||||||
@@ -25,7 +25,7 @@ public class ColorPickDialog extends Dialog{
|
|||||||
for(int i = 0; i < playerColors.length; i++){
|
for(int i = 0; i < playerColors.length; i++){
|
||||||
Color color = playerColors[i];
|
Color color = playerColors[i];
|
||||||
|
|
||||||
ImageButton button = table.addImageButton(Tex.whiteui, Style.clearToggleIbutton, 34, () -> {
|
ImageButton button = table.addImageButton(Tex.whiteui, Styles.clearTogglei, 34, () -> {
|
||||||
cons.accept(color);
|
cons.accept(color);
|
||||||
hide();
|
hide();
|
||||||
}).size(48).get();
|
}).size(48).get();
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class CustomGameDialog extends FloatingDialog{
|
|||||||
maps.row();
|
maps.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButton image = new ImageButton(new TextureRegion(map.texture), Style.clearIbutton);
|
ImageButton image = new ImageButton(new TextureRegion(map.texture), Styles.cleari);
|
||||||
image.margin(5);
|
image.margin(5);
|
||||||
image.top();
|
image.top();
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import io.anuke.mindustry.io.SaveIO.*;
|
|||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.type.Zone.*;
|
import io.anuke.mindustry.type.Zone.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.ui.Style;
|
import io.anuke.mindustry.ui.Styles;
|
||||||
import io.anuke.mindustry.ui.TreeLayout.*;
|
import io.anuke.mindustry.ui.TreeLayout.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -35,7 +35,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
private Rectangle bounds = new Rectangle();
|
private Rectangle bounds = new Rectangle();
|
||||||
|
|
||||||
public DeployDialog(){
|
public DeployDialog(){
|
||||||
super("", Style.fulldialogWindow);
|
super("", Styles.fullDialog);
|
||||||
|
|
||||||
ZoneNode root = new ZoneNode(Zones.groundZero, null);
|
ZoneNode root = new ZoneNode(Zones.groundZero, null);
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
}).color(Color.DARK_GRAY).grow()));
|
}).color(Color.DARK_GRAY).grow()));
|
||||||
}
|
}
|
||||||
|
|
||||||
TextButton button = Elements.newButton(Core.bundle.format("resume", slot.getZone().localizedName()), Style.squareTbutton, () -> {
|
TextButton button = Elements.newButton(Core.bundle.format("resume", slot.getZone().localizedName()), Styles.squaret, () -> {
|
||||||
hide();
|
hide();
|
||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
logic.reset();
|
logic.reset();
|
||||||
@@ -175,7 +175,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
button.clicked(() -> info.show(zone));
|
button.clicked(() -> info.show(zone));
|
||||||
|
|
||||||
if(zone.unlocked() && !hidden(zone)){
|
if(zone.unlocked() && !hidden(zone)){
|
||||||
button.labelWrap(zone.localizedName()).style(Style.outlineLabel).width(140).growX().get().setAlignment(Align.center);
|
button.labelWrap(zone.localizedName()).style(Styles.outlineLabel).width(140).growX().get().setAlignment(Align.center);
|
||||||
}else{
|
}else{
|
||||||
Consumer<Element> flasher = zone.canUnlock() && !hidden(zone) ? e -> e.update(() -> e.getColor().set(Color.WHITE).lerp(Pal.accent, Mathf.absin(3f, 1f))) : e -> {};
|
Consumer<Element> flasher = zone.canUnlock() && !hidden(zone) ? e -> e.update(() -> e.getColor().set(Color.WHITE).lerp(Pal.accent, Mathf.absin(3f, 1f))) : e -> {};
|
||||||
flasher.accept(button.addImage(Icon.locked).get());
|
flasher.accept(button.addImage(Icon.locked).get());
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
//macs are confined to the Downloads/ directory
|
//macs are confined to the Downloads/ directory
|
||||||
if(!OS.isMac){
|
if(!OS.isMac){
|
||||||
Image upimage = new Image(Icon.folderParentSmall);
|
Image upimage = new Image(Icon.folderParentSmall);
|
||||||
TextButton upbutton = new TextButton(".." + directory.toString(), Style.clearToggleTbutton);
|
TextButton upbutton = new TextButton(".." + directory.toString(), Styles.clearTogglet);
|
||||||
upbutton.clicked(() -> {
|
upbutton.clicked(() -> {
|
||||||
directory = directory.parent();
|
directory = directory.parent();
|
||||||
lastDirectory = directory;
|
lastDirectory = directory;
|
||||||
@@ -216,7 +216,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
|
|
||||||
String filename = file.name();
|
String filename = file.name();
|
||||||
|
|
||||||
TextButton button = new TextButton(shorten(filename), Style.clearToggleTbutton);
|
TextButton button = new TextButton(shorten(filename), Styles.clearTogglet);
|
||||||
group.add(button);
|
group.add(button);
|
||||||
|
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public class HostDialog extends FloatingDialog{
|
|||||||
ui.listfrag.rebuild();
|
ui.listfrag.rebuild();
|
||||||
}).grow().pad(8).get().setMaxLength(40);
|
}).grow().pad(8).get().setMaxLength(40);
|
||||||
|
|
||||||
ImageButton button = t.addImageButton(Tex.whiteui, Style.clearFullIbutton, 40, () -> {
|
ImageButton button = t.addImageButton(Tex.whiteui, Styles.clearFulli, 40, () -> {
|
||||||
new ColorPickDialog().show(color -> {
|
new ColorPickDialog().show(color -> {
|
||||||
player.color.set(color);
|
player.color.set(color);
|
||||||
Core.settings.put("color-0", Color.rgba8888(color));
|
Core.settings.put("color-0", Color.rgba8888(color));
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
//why are java lambdas this bad
|
//why are java lambdas this bad
|
||||||
TextButton[] buttons = {null};
|
TextButton[] buttons = {null};
|
||||||
|
|
||||||
TextButton button = buttons[0] = remote.addButton("[accent]" + server.displayIP(), Style.clearTbutton, () -> {
|
TextButton button = buttons[0] = remote.addButton("[accent]" + server.displayIP(), Styles.cleart, () -> {
|
||||||
if(!buttons[0].childrenPressed()){
|
if(!buttons[0].childrenPressed()){
|
||||||
if(server.lastHost != null && server.lastHost.version != Version.build && Version.build != -1 && server.lastHost.version != -1){
|
if(server.lastHost != null && server.lastHost.version != Version.build && Version.build != -1 && server.lastHost.version != -1){
|
||||||
ui.showInfo("[scarlet]" + (server.lastHost.version > Version.build ? KickReason.clientOutdated : KickReason.serverOutdated).toString() + "\n[]" +
|
ui.showInfo("[scarlet]" + (server.lastHost.version > Version.build ? KickReason.clientOutdated : KickReason.serverOutdated).toString() + "\n[]" +
|
||||||
@@ -118,7 +118,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
|
|
||||||
inner.add(button.getLabel()).growX();
|
inner.add(button.getLabel()).growX();
|
||||||
|
|
||||||
inner.addImageButton(Icon.arrowUpSmall, Style.emptyIbutton, () -> {
|
inner.addImageButton(Icon.arrowUpSmall, Styles.emptyi, () -> {
|
||||||
int index = servers.indexOf(server);
|
int index = servers.indexOf(server);
|
||||||
if(index > 0){
|
if(index > 0){
|
||||||
servers.remove(index);
|
servers.remove(index);
|
||||||
@@ -137,16 +137,16 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
|
|
||||||
}).margin(3f).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton(Icon.loadingSmall, Style.emptyIbutton, () -> {
|
inner.addImageButton(Icon.loadingSmall, Styles.emptyi, () -> {
|
||||||
refreshServer(server);
|
refreshServer(server);
|
||||||
}).margin(3f).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton(Icon.pencilSmall, Style.emptyIbutton, () -> {
|
inner.addImageButton(Icon.pencilSmall, Styles.emptyi, () -> {
|
||||||
renaming = server;
|
renaming = server;
|
||||||
add.show();
|
add.show();
|
||||||
}).margin(3f).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton(Icon.trash16Small, Style.emptyIbutton, () -> {
|
inner.addImageButton(Icon.trash16Small, Styles.emptyi, () -> {
|
||||||
ui.showConfirm("$confirm", "$server.delete", () -> {
|
ui.showConfirm("$confirm", "$server.delete", () -> {
|
||||||
servers.removeValue(server, true);
|
servers.removeValue(server, true);
|
||||||
saveServers();
|
saveServers();
|
||||||
@@ -237,7 +237,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
Core.settings.save();
|
Core.settings.save();
|
||||||
}).grow().pad(8).get().setMaxLength(maxNameLength);
|
}).grow().pad(8).get().setMaxLength(maxNameLength);
|
||||||
|
|
||||||
ImageButton button = t.addImageButton(Tex.whiteui, Style.clearFullIbutton, 40, () -> {
|
ImageButton button = t.addImageButton(Tex.whiteui, Styles.clearFulli, 40, () -> {
|
||||||
new ColorPickDialog().show(color -> {
|
new ColorPickDialog().show(color -> {
|
||||||
player.color.set(color);
|
player.color.set(color);
|
||||||
Core.settings.put("color-0", Color.rgba8888(color));
|
Core.settings.put("color-0", Color.rgba8888(color));
|
||||||
@@ -304,7 +304,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
|
|
||||||
local.row();
|
local.row();
|
||||||
|
|
||||||
TextButton button = local.addButton("", Style.clearTbutton, () -> connect(host.address, port))
|
TextButton button = local.addButton("", Styles.cleart, () -> connect(host.address, port))
|
||||||
.width(w).pad(5f).get();
|
.width(w).pad(5f).get();
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
buildServer(host, button);
|
buildServer(host, button);
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class LanguageDialog extends FloatingDialog{
|
|||||||
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
ButtonGroup<TextButton> group = new ButtonGroup<>();
|
||||||
|
|
||||||
for(Locale loc : locales){
|
for(Locale loc : locales){
|
||||||
TextButton button = new TextButton(Strings.capitalize(loc.getDisplayName(loc)), Style.clearToggleTbutton);
|
TextButton button = new TextButton(Strings.capitalize(loc.getDisplayName(loc)), Styles.clearTogglet);
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
if(getLocale().equals(loc)) return;
|
if(getLocale().equals(loc)) return;
|
||||||
Core.settings.put("locale", loc.toString());
|
Core.settings.put("locale", loc.toString());
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import io.anuke.mindustry.gen.*;
|
|||||||
import io.anuke.mindustry.io.*;
|
import io.anuke.mindustry.io.*;
|
||||||
import io.anuke.mindustry.io.SaveIO.*;
|
import io.anuke.mindustry.io.SaveIO.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.ui.Style;
|
import io.anuke.mindustry.ui.Styles;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
for(SaveSlot slot : array){
|
for(SaveSlot slot : array){
|
||||||
if(slot.isHidden()) continue;
|
if(slot.isHidden()) continue;
|
||||||
|
|
||||||
TextButton button = new TextButton("", Style.clearTbutton);
|
TextButton button = new TextButton("", Styles.cleart);
|
||||||
button.getLabel().remove();
|
button.getLabel().remove();
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
|
|
||||||
@@ -71,25 +71,25 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
title.table(t -> {
|
title.table(t -> {
|
||||||
t.right();
|
t.right();
|
||||||
|
|
||||||
t.addImageButton(Icon.floppy, Style.emptytoggleIbutton, () -> {
|
t.addImageButton(Icon.floppy, Styles.emptytogglei, () -> {
|
||||||
slot.setAutosave(!slot.isAutosave());
|
slot.setAutosave(!slot.isAutosave());
|
||||||
}).checked(slot.isAutosave()).right();
|
}).checked(slot.isAutosave()).right();
|
||||||
|
|
||||||
t.addImageButton(Icon.trash, Style.emptyIbutton, () -> {
|
t.addImageButton(Icon.trash, Styles.emptyi, () -> {
|
||||||
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
|
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
|
||||||
slot.delete();
|
slot.delete();
|
||||||
setup();
|
setup();
|
||||||
});
|
});
|
||||||
}).right();
|
}).right();
|
||||||
|
|
||||||
t.addImageButton(Icon.pencil, Style.emptyIbutton, () -> {
|
t.addImageButton(Icon.pencil, Styles.emptyi, () -> {
|
||||||
ui.showTextInput("$save.rename", "$save.rename.text", slot.getName(), text -> {
|
ui.showTextInput("$save.rename", "$save.rename.text", slot.getName(), text -> {
|
||||||
slot.setName(text);
|
slot.setName(text);
|
||||||
setup();
|
setup();
|
||||||
});
|
});
|
||||||
}).right();
|
}).right();
|
||||||
|
|
||||||
t.addImageButton(Icon.save, Style.emptyIbutton, () -> {
|
t.addImageButton(Icon.save, Styles.emptyi, () -> {
|
||||||
if(!ios){
|
if(!ios){
|
||||||
platform.showFileChooser(false, saveExtension, file -> {
|
platform.showFileChooser(false, saveExtension, file -> {
|
||||||
try{
|
try{
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public class LoadoutDialog extends FloatingDialog{
|
|||||||
FloatingDialog dialog = new FloatingDialog("");
|
FloatingDialog dialog = new FloatingDialog("");
|
||||||
dialog.setFillParent(false);
|
dialog.setFillParent(false);
|
||||||
for(Item item : content.items().select(item -> filter.test(item) && item.type == ItemType.material && supplier.get().find(stack -> stack.item == item) == null)){
|
for(Item item : content.items().select(item -> filter.test(item) && item.type == ItemType.material && supplier.get().find(stack -> stack.item == item) == null)){
|
||||||
TextButton button = dialog.cont.addButton("", Style.clearTbutton, () -> {
|
TextButton button = dialog.cont.addButton("", Styles.cleart, () -> {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
supplier.get().add(new ItemStack(item, 0));
|
supplier.get().add(new ItemStack(item, 0));
|
||||||
updater.run();
|
updater.run();
|
||||||
@@ -89,17 +89,17 @@ public class LoadoutDialog extends FloatingDialog{
|
|||||||
int step = 50;
|
int step = 50;
|
||||||
|
|
||||||
for(ItemStack stack : supplier.get()){
|
for(ItemStack stack : supplier.get()){
|
||||||
items.addButton("x", Style.clearPartialTbutton, () -> {
|
items.addButton("x", Styles.clearPartialt, () -> {
|
||||||
supplier.get().remove(stack);
|
supplier.get().remove(stack);
|
||||||
updater.run();
|
updater.run();
|
||||||
setup();
|
setup();
|
||||||
}).size(bsize);
|
}).size(bsize);
|
||||||
|
|
||||||
items.addButton("-", Style.clearPartialTbutton, () -> {
|
items.addButton("-", Styles.clearPartialt, () -> {
|
||||||
stack.amount = Math.max(stack.amount - step, 0);
|
stack.amount = Math.max(stack.amount - step, 0);
|
||||||
updater.run();
|
updater.run();
|
||||||
}).size(bsize);
|
}).size(bsize);
|
||||||
items.addButton("+", Style.clearPartialTbutton, () -> {
|
items.addButton("+", Styles.clearPartialt, () -> {
|
||||||
stack.amount = Math.min(stack.amount + step, capacity);
|
stack.amount = Math.min(stack.amount + step, capacity);
|
||||||
updater.run();
|
updater.run();
|
||||||
}).size(bsize);
|
}).size(bsize);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
for(Gamemode mode : Gamemode.values()){
|
for(Gamemode mode : Gamemode.values()){
|
||||||
if(mode.hidden) continue;
|
if(mode.hidden) continue;
|
||||||
|
|
||||||
modes.addButton(mode.toString(), Style.toggleTbutton, () -> {
|
modes.addButton(mode.toString(), Styles.togglet, () -> {
|
||||||
selectedGamemode = mode;
|
selectedGamemode = mode;
|
||||||
rules = map.applyRules(mode);
|
rules = map.applyRules(mode);
|
||||||
}).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f).disabled(!mode.valid(map));
|
}).update(b -> b.setChecked(selectedGamemode == mode)).size(140f, 54f).disabled(!mode.valid(map));
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
maps.row();
|
maps.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
TextButton button = maps.addButton("", Style.clearTbutton, () -> showMapInfo(map)).width(mapsize).pad(8).get();
|
TextButton button = maps.addButton("", Styles.cleart, () -> 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);
|
||||||
@@ -160,7 +160,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
|
|
||||||
table.stack(new Image(map.texture).setScaling(Scaling.fit), new BorderImage(map.texture).setScaling(Scaling.fit)).size(mapsize);
|
table.stack(new Image(map.texture).setScaling(Scaling.fit), new BorderImage(map.texture).setScaling(Scaling.fit)).size(mapsize);
|
||||||
|
|
||||||
table.table(Style.flat, desc -> {
|
table.table(Styles.black, desc -> {
|
||||||
desc.top();
|
desc.top();
|
||||||
Table t = new Table();
|
Table t = new Table();
|
||||||
t.margin(6);
|
t.margin(6);
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
|
|
||||||
dataDialog.cont.table(Tex.button, t -> {
|
dataDialog.cont.table(Tex.button, t -> {
|
||||||
t.defaults().size(240f, 60f).left();
|
t.defaults().size(240f, 60f).left();
|
||||||
TextButtonStyle style = Style.clearTbutton;
|
TextButtonStyle style = Styles.cleart;
|
||||||
|
|
||||||
t.addButton("$settings.cleardata", style, () -> ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
|
t.addButton("$settings.cleardata", style, () -> ui.showConfirm("$confirm", "$settings.clearall.confirm", () -> {
|
||||||
ObjectMap<String, Object> map = new ObjectMap<>();
|
ObjectMap<String, Object> map = new ObjectMap<>();
|
||||||
@@ -177,7 +177,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
void rebuildMenu(){
|
void rebuildMenu(){
|
||||||
menu.clearChildren();
|
menu.clearChildren();
|
||||||
|
|
||||||
TextButtonStyle style = Style.clearTbutton;
|
TextButtonStyle style = Styles.cleart;
|
||||||
|
|
||||||
menu.defaults().size(300f, 60f);
|
menu.defaults().size(300f, 60f);
|
||||||
menu.addButton("$settings.game", style, () -> visible(0));
|
menu.addButton("$settings.game", style, () -> visible(0));
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import io.anuke.mindustry.gen.*;
|
|||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.ui.Style;
|
import io.anuke.mindustry.ui.Styles;
|
||||||
import io.anuke.mindustry.ui.TreeLayout.*;
|
import io.anuke.mindustry.ui.TreeLayout.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
infoTable.touchable(Touchable.enabled);
|
infoTable.touchable(Touchable.enabled);
|
||||||
|
|
||||||
for(TechTreeNode node : nodes){
|
for(TechTreeNode node : nodes){
|
||||||
ImageButton button = new ImageButton(node.node.block.icon(Block.Icon.medium), Style.nodeIbutton);
|
ImageButton button = new ImageButton(node.node.block.icon(Block.Icon.medium), Styles.nodei);
|
||||||
button.visible(() -> node.visible);
|
button.visible(() -> node.visible);
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
if(mobile){
|
if(mobile){
|
||||||
@@ -263,7 +263,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
infoTable.table(b -> {
|
infoTable.table(b -> {
|
||||||
b.margin(0).left().defaults().left();
|
b.margin(0).left().defaults().left();
|
||||||
|
|
||||||
b.addImageButton(Icon.infoSmall, Style.clearIbutton, () -> ui.content.show(node.block)).growY().width(50f);
|
b.addImageButton(Icon.infoSmall, Styles.cleari, () -> ui.content.show(node.block)).growY().width(50f);
|
||||||
b.add().grow();
|
b.add().grow();
|
||||||
b.table(desc -> {
|
b.table(desc -> {
|
||||||
desc.left().defaults().left();
|
desc.left().defaults().left();
|
||||||
@@ -290,7 +290,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(mobile && locked(node)){
|
if(mobile && locked(node)){
|
||||||
b.row();
|
b.row();
|
||||||
b.addImageTextButton("$research", Icon.checkSmall, Style.nodeTbutton, () -> unlock(node))
|
b.addImageTextButton("$research", Icon.checkSmall, Styles.nodet, () -> unlock(node))
|
||||||
.disabled(i -> !data.hasItems(node.requirements)).growX().height(44f).colspan(3);
|
.disabled(i -> !data.hasItems(node.requirements)).growX().height(44f).colspan(3);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import io.anuke.mindustry.input.*;
|
|||||||
import io.anuke.mindustry.net.Packets.*;
|
import io.anuke.mindustry.net.Packets.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.ui.Style;
|
import io.anuke.mindustry.ui.Styles;
|
||||||
import io.anuke.mindustry.ui.dialogs.*;
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -61,7 +61,7 @@ public class HudFragment extends Fragment{
|
|||||||
select.left();
|
select.left();
|
||||||
select.defaults().size(dsize).left();
|
select.defaults().size(dsize).left();
|
||||||
|
|
||||||
ImageButtonStyle style = Style.clearTransIbutton;
|
ImageButtonStyle style = Styles.clearTransi;
|
||||||
|
|
||||||
select.addImageButton(Icon.menuLarge, style, ui.paused::show);
|
select.addImageButton(Icon.menuLarge, style, ui.paused::show);
|
||||||
flip = select.addImageButton(Icon.arrowUp, style, this::toggleMenus).get();
|
flip = select.addImageButton(Icon.arrowUp, style, this::toggleMenus).get();
|
||||||
@@ -144,7 +144,7 @@ public class HudFragment extends Fragment{
|
|||||||
wavesMain.visible(() -> shown && !state.isEditor());
|
wavesMain.visible(() -> shown && !state.isEditor());
|
||||||
wavesMain.top().left();
|
wavesMain.top().left();
|
||||||
Stack stack = new Stack();
|
Stack stack = new Stack();
|
||||||
Button waves = new Button(Style.waveButton);
|
Button waves = new Button(Styles.waveb);
|
||||||
Table btable = new Table().margin(0);
|
Table btable = new Table().margin(0);
|
||||||
|
|
||||||
stack.add(waves);
|
stack.add(waves);
|
||||||
@@ -168,7 +168,7 @@ public class HudFragment extends Fragment{
|
|||||||
teams.left();
|
teams.left();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(Team team : Team.all){
|
for(Team team : Team.all){
|
||||||
ImageButton button = teams.addImageButton(Tex.whiteui, Style.clearTogglePartialIbutton, 40f, () -> Call.setPlayerTeamEditor(player, team))
|
ImageButton button = teams.addImageButton(Tex.whiteui, Styles.clearTogglePartiali, 40f, () -> Call.setPlayerTeamEditor(player, team))
|
||||||
.size(50f).margin(6f).get();
|
.size(50f).margin(6f).get();
|
||||||
button.getImageCell().grow();
|
button.getImageCell().grow();
|
||||||
button.getStyle().imageUpColor = team.color;
|
button.getStyle().imageUpColor = team.color;
|
||||||
@@ -202,7 +202,7 @@ public class HudFragment extends Fragment{
|
|||||||
float[] position = {0, 0};
|
float[] position = {0, 0};
|
||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
t.addImageTextButton("$editor.removeunit", Icon.quit, Style.toggleTbutton, () -> {}).fillX().update(b -> {
|
t.addImageTextButton("$editor.removeunit", Icon.quit, Styles.togglet, () -> {}).fillX().update(b -> {
|
||||||
boolean[] found = {false};
|
boolean[] found = {false};
|
||||||
if(b.isChecked()){
|
if(b.isChecked()){
|
||||||
Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
|
Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);
|
||||||
@@ -243,9 +243,9 @@ public class HudFragment extends Fragment{
|
|||||||
IntFormat fps = new IntFormat("fps");
|
IntFormat fps = new IntFormat("fps");
|
||||||
IntFormat ping = new IntFormat("ping");
|
IntFormat ping = new IntFormat("ping");
|
||||||
|
|
||||||
info.label(() -> fps.get(Core.graphics.getFramesPerSecond())).left().style(Style.outlineLabel);
|
info.label(() -> fps.get(Core.graphics.getFramesPerSecond())).left().style(Styles.outlineLabel);
|
||||||
info.row();
|
info.row();
|
||||||
info.label(() -> ping.get(netClient.getPing())).visible(net::client).left().style(Style.outlineLabel);
|
info.label(() -> ping.get(netClient.getPing())).visible(net::client).left().style(Styles.outlineLabel);
|
||||||
}).top().left();
|
}).top().left();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ public class HudFragment extends Fragment{
|
|||||||
//spawner warning
|
//spawner warning
|
||||||
parent.fill(t -> {
|
parent.fill(t -> {
|
||||||
t.touchable(Touchable.disabled);
|
t.touchable(Touchable.disabled);
|
||||||
t.table(Style.flat, c -> c.add("$nearpoint")
|
t.table(Styles.black, c -> c.add("$nearpoint")
|
||||||
.update(l -> l.setColor(Tmp.c1.set(Color.WHITE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 10f, 1f))))
|
.update(l -> l.setColor(Tmp.c1.set(Color.WHITE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 10f, 1f))))
|
||||||
.get().setAlignment(Align.center, Align.center))
|
.get().setAlignment(Align.center, Align.center))
|
||||||
.margin(6).update(u -> u.color.a = Mathf.lerpDelta(u.color.a, Mathf.num(spawner.playerNear()), 0.1f)).get().color.a = 0f;
|
.margin(6).update(u -> u.color.a = Mathf.lerpDelta(u.color.a, Mathf.num(spawner.playerNear()), 0.1f)).get().color.a = 0f;
|
||||||
@@ -325,7 +325,7 @@ public class HudFragment extends Fragment{
|
|||||||
setDisabled(() -> !control.tutorial.canNext());
|
setDisabled(() -> !control.tutorial.canNext());
|
||||||
}},
|
}},
|
||||||
new Table(f -> {
|
new Table(f -> {
|
||||||
f.left().addImageButton(Icon.arrowLeftSmall, Style.emptyIbutton, () -> {
|
f.left().addImageButton(Icon.arrowLeftSmall, Styles.emptyi, () -> {
|
||||||
control.tutorial.prevSentence();
|
control.tutorial.prevSentence();
|
||||||
}).width(44f).growY().visible(() -> control.tutorial.canPrev());
|
}).width(44f).growY().visible(() -> control.tutorial.canPrev());
|
||||||
}));
|
}));
|
||||||
@@ -344,7 +344,7 @@ public class HudFragment extends Fragment{
|
|||||||
//'saving' indicator
|
//'saving' indicator
|
||||||
parent.fill(t -> {
|
parent.fill(t -> {
|
||||||
t.bottom().visible(() -> control.saves.isSaving());
|
t.bottom().visible(() -> control.saves.isSaving());
|
||||||
t.add("$saveload").style(Style.outlineLabel);
|
t.add("$saveload").style(Styles.outlineLabel);
|
||||||
});
|
});
|
||||||
|
|
||||||
blockfrag.build(parent);
|
blockfrag.build(parent);
|
||||||
@@ -644,7 +644,7 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addPlayButton(Table table){
|
private void addPlayButton(Table table){
|
||||||
table.right().addImageButton(Icon.playSmaller, Style.rightIbutton, 30f, () -> {
|
table.right().addImageButton(Icon.playSmaller, Styles.righti, 30f, () -> {
|
||||||
if(net.client() && player.isAdmin){
|
if(net.client() && player.isAdmin){
|
||||||
Call.onAdminRequest(player, AdminAction.wave);
|
Call.onAdminRequest(player, AdminAction.wave);
|
||||||
}else if(inLaunchWave()){
|
}else if(inLaunchWave()){
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class LoadingFragment extends Fragment{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(Group parent){
|
public void build(Group parent){
|
||||||
parent.fill(Style.loadDim,t -> {
|
parent.fill(Styles.black8, t -> {
|
||||||
t.visible(false);
|
t.visible(false);
|
||||||
t.touchable(Touchable.enabled);
|
t.touchable(Touchable.enabled);
|
||||||
t.add().height(70f).row();
|
t.add().height(70f).row();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import io.anuke.mindustry.game.*;
|
|||||||
import io.anuke.mindustry.gen.*;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.ui.Style;
|
import io.anuke.mindustry.ui.Styles;
|
||||||
|
|
||||||
import static io.anuke.arc.Core.assets;
|
import static io.anuke.arc.Core.assets;
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -61,8 +61,8 @@ public class MenuFragment extends Fragment{
|
|||||||
|
|
||||||
//info icon
|
//info icon
|
||||||
if(mobile){
|
if(mobile){
|
||||||
parent.fill(c -> c.bottom().left().addButton("", Style.infoTbutton, ui.about::show).size(84, 45));
|
parent.fill(c -> c.bottom().left().addButton("", Styles.infot, ui.about::show).size(84, 45));
|
||||||
parent.fill(c -> c.bottom().right().addButton("", Style.discordTbutton, ui.discord::show).size(84, 45));
|
parent.fill(c -> c.bottom().right().addButton("", Styles.discordt, ui.discord::show).size(84, 45));
|
||||||
}
|
}
|
||||||
|
|
||||||
String versionText = "[#ffffffba]" + ((Version.build == -1) ? "[#fc8140aa]custom build" : (Version.type.equals("official") ? Version.modifier : Version.type) + " build " + Version.build);
|
String versionText = "[#ffffffba]" + ((Version.build == -1) ? "[#fc8140aa]custom build" : (Version.type.equals("official") ? Version.modifier : Version.type) + " build " + Version.build);
|
||||||
@@ -146,7 +146,7 @@ public class MenuFragment extends Fragment{
|
|||||||
|
|
||||||
|
|
||||||
float width = 230f;
|
float width = 230f;
|
||||||
Drawable background = Style.flatTrans;
|
Drawable background = Styles.black6;
|
||||||
|
|
||||||
container.left();
|
container.left();
|
||||||
container.add().width(Core.graphics.getWidth()/10f);
|
container.add().width(Core.graphics.getWidth()/10f);
|
||||||
@@ -198,7 +198,7 @@ public class MenuFragment extends Fragment{
|
|||||||
private void buttons(Table t, Buttoni... buttons){
|
private void buttons(Table t, Buttoni... buttons){
|
||||||
for(Buttoni b : buttons){
|
for(Buttoni b : buttons){
|
||||||
Button[] out = {null};
|
Button[] out = {null};
|
||||||
out[0] = t.addImageTextButton(b.text, b.icon, Style.clearToggleMenuTbutton, () -> {
|
out[0] = t.addImageTextButton(b.text, b.icon, Styles.clearToggleMenut, () -> {
|
||||||
if(currentMenu == out[0]){
|
if(currentMenu == out[0]){
|
||||||
currentMenu = null;
|
currentMenu = null;
|
||||||
fadeOutMenu();
|
fadeOutMenu();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import io.anuke.mindustry.gen.*;
|
|||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.input.*;
|
import io.anuke.mindustry.input.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.ui.Style;
|
import io.anuke.mindustry.ui.Styles;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -138,7 +138,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButton button = blockTable.addImageButton(Icon.lockedSmall, Style.selectIbutton, () -> {
|
ImageButton button = blockTable.addImageButton(Icon.lockedSmall, Styles.selecti, () -> {
|
||||||
if(unlocked(block)){
|
if(unlocked(block)){
|
||||||
input.block = input.block == block ? null : block;
|
input.block = input.block == block ? null : block;
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
.left().width(190f).padLeft(5);
|
.left().width(190f).padLeft(5);
|
||||||
header.add().growX();
|
header.add().growX();
|
||||||
if(unlocked(lastDisplay)){
|
if(unlocked(lastDisplay)){
|
||||||
header.addButton("?", Style.clearPartialTbutton, () -> {
|
header.addButton("?", Styles.clearPartialt, () -> {
|
||||||
ui.content.show(lastDisplay);
|
ui.content.show(lastDisplay);
|
||||||
Events.fire(new BlockInfoEvent());
|
Events.fire(new BlockInfoEvent());
|
||||||
}).size(8 * 5).padTop(-5).padRight(-5).right().grow().name("blockinfo");
|
}).size(8 * 5).padTop(-5).padRight(-5).right().grow().name("blockinfo");
|
||||||
@@ -268,11 +268,11 @@ public class PlacementFragment extends Fragment{
|
|||||||
if(f++ % 2 == 0) categories.row();
|
if(f++ % 2 == 0) categories.row();
|
||||||
|
|
||||||
if(categoryEmpty[cat.ordinal()]){
|
if(categoryEmpty[cat.ordinal()]){
|
||||||
categories.addImage(Style.flatTrans);
|
categories.addImage(Styles.black6);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
categories.addImageButton(Core.atlas.drawable("icon-" + cat.name() + "-smaller"), Style.clearToggleTransIbutton, () -> {
|
categories.addImageButton(Core.atlas.drawable("icon-" + cat.name() + "-smaller"), Styles.clearToggleTransi, () -> {
|
||||||
currentCategory = cat;
|
currentCategory = cat;
|
||||||
rebuildCategory.run();
|
rebuildCategory.run();
|
||||||
}).group(group).update(i -> i.setChecked(currentCategory == cat)).name("category-" + cat.name());
|
}).group(group).update(i -> i.setChecked(currentCategory == cat)).name("category-" + cat.name());
|
||||||
|
|||||||
@@ -103,14 +103,14 @@ public class PlayerListFragment extends Fragment{
|
|||||||
button.table(t -> {
|
button.table(t -> {
|
||||||
t.defaults().size(bs);
|
t.defaults().size(bs);
|
||||||
|
|
||||||
t.addImageButton(Icon.banSmall, Style.clearPartialIbutton,
|
t.addImageButton(Icon.banSmall, Styles.clearPartiali,
|
||||||
() -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(user, AdminAction.ban)));
|
() -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(user, AdminAction.ban)));
|
||||||
t.addImageButton(Icon.cancelSmall, Style.clearPartialIbutton,
|
t.addImageButton(Icon.cancelSmall, Styles.clearPartiali,
|
||||||
() -> ui.showConfirm("$confirm", "$confirmkick", () -> Call.onAdminRequest(user, AdminAction.kick)));
|
() -> ui.showConfirm("$confirm", "$confirmkick", () -> Call.onAdminRequest(user, AdminAction.kick)));
|
||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
|
|
||||||
t.addImageButton(Icon.adminSmall, Style.clearTogglePartialIbutton, () -> {
|
t.addImageButton(Icon.adminSmall, Styles.clearTogglePartiali, () -> {
|
||||||
if(net.client()) return;
|
if(net.client()) return;
|
||||||
|
|
||||||
String id = user.uuid;
|
String id = user.uuid;
|
||||||
@@ -126,7 +126,7 @@ public class PlayerListFragment extends Fragment{
|
|||||||
.touchable(() -> net.client() ? Touchable.disabled : Touchable.enabled)
|
.touchable(() -> net.client() ? Touchable.disabled : Touchable.enabled)
|
||||||
.checked(user.isAdmin);
|
.checked(user.isAdmin);
|
||||||
|
|
||||||
t.addImageButton(Icon.zoomSmall, Style.clearPartialIbutton, () -> Call.onAdminRequest(user, AdminAction.trace));
|
t.addImageButton(Icon.zoomSmall, Styles.clearPartiali, () -> Call.onAdminRequest(user, AdminAction.trace));
|
||||||
|
|
||||||
}).padRight(12).size(bs + 10f, bs);
|
}).padRight(12).size(bs + 10f, bs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import io.anuke.arc.scene.ui.*;
|
|||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.mindustry.gen.*;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.ui.Style;
|
import io.anuke.mindustry.ui.Styles;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ public class ItemSelection{
|
|||||||
for(Item item : items){
|
for(Item item : items){
|
||||||
if(!data.isUnlocked(item) && world.isZone()) continue;
|
if(!data.isUnlocked(item) && world.isZone()) continue;
|
||||||
|
|
||||||
ImageButton button = cont.addImageButton(Tex.whiteui, Style.clearToggleTransIbutton, 24, () -> control.input.frag.config.hideConfig()).group(group).get();
|
ImageButton button = cont.addImageButton(Tex.whiteui, Styles.clearToggleTransi, 24, () -> control.input.frag.config.hideConfig()).group(group).get();
|
||||||
button.changed(() -> consumer.accept(button.isChecked() ? item : null));
|
button.changed(() -> consumer.accept(button.isChecked() ? item : null));
|
||||||
button.getStyle().imageUp = new TextureRegionDrawable(item.icon(Item.Icon.medium));
|
button.getStyle().imageUp = new TextureRegionDrawable(item.icon(Item.Icon.medium));
|
||||||
button.update(() -> button.setChecked(holder.get() == item));
|
button.update(() -> button.setChecked(holder.get() == item));
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class LiquidSource extends Block{
|
|||||||
|
|
||||||
for(int i = 0; i < items.size; i++){
|
for(int i = 0; i < items.size; i++){
|
||||||
final int f = i;
|
final int f = i;
|
||||||
ImageButton button = cont.addImageButton(Tex.clear, Style.clearToggleTransIbutton, 24, () -> control.input.frag.config.hideConfig()).size(38).group(group).get();
|
ImageButton button = cont.addImageButton(Tex.clear, Styles.clearToggleTransi, 24, () -> control.input.frag.config.hideConfig()).size(38).group(group).get();
|
||||||
button.changed(() -> {
|
button.changed(() -> {
|
||||||
Call.setLiquidSourceLiquid(null, tile, button.isChecked() ? items.get(f) : null);
|
Call.setLiquidSourceLiquid(null, tile, button.isChecked() ? items.get(f) : null);
|
||||||
control.input.frag.config.hideConfig();
|
control.input.frag.config.hideConfig();
|
||||||
|
|||||||
@@ -81,12 +81,12 @@ public class CommandCenter extends Block{
|
|||||||
Table buttons = new Table();
|
Table buttons = new Table();
|
||||||
|
|
||||||
for(UnitCommand cmd : UnitCommand.all){
|
for(UnitCommand cmd : UnitCommand.all){
|
||||||
buttons.addImageButton(Core.atlas.drawable("icon-command-" + cmd.name() + "-small"), Style.clearToggleTransIbutton, () -> Call.onCommandCenterSet(player, tile, cmd))
|
buttons.addImageButton(Core.atlas.drawable("icon-command-" + cmd.name() + "-small"), Styles.clearToggleTransi, () -> Call.onCommandCenterSet(player, tile, cmd))
|
||||||
.size(44).group(group).update(b -> b.setChecked(entity.command == cmd));
|
.size(44).group(group).update(b -> b.setChecked(entity.command == cmd));
|
||||||
}
|
}
|
||||||
table.add(buttons);
|
table.add(buttons);
|
||||||
table.row();
|
table.row();
|
||||||
table.label(() -> entity.command.localized()).style(Style.outlineLabel).center().growX().get().setAlignment(Align.center);
|
table.label(() -> entity.command.localized()).style(Styles.outlineLabel).center().growX().get().setAlignment(Align.center);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Remote(called = Loc.server, forward = true, targets = Loc.both)
|
@Remote(called = Loc.server, forward = true, targets = Loc.both)
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class DesktopLauncher extends ClientLauncher{
|
|||||||
|
|
||||||
t.toFront();
|
t.toFront();
|
||||||
});
|
});
|
||||||
t.table(Style.guideDim,f -> label[0] = f.add("").get()).visible(() -> visible[0]);
|
t.table(Styles.black3, f -> label[0] = f.add("").get()).visible(() -> visible[0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
Log.setLogger(new LogHandler(){
|
Log.setLogger(new LogHandler(){
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
|||||||
|
|
||||||
Events.on(ClientLoadEvent.class, e -> {
|
Events.on(ClientLoadEvent.class, e -> {
|
||||||
Core.app.post(() -> Core.app.post(() -> {
|
Core.app.post(() -> Core.app.post(() -> {
|
||||||
Core.scene.table(Style.dialogDim,t -> {
|
Core.scene.table(Styles.black9, t -> {
|
||||||
t.visible(() -> {
|
t.visible(() -> {
|
||||||
if(!forced) return false;
|
if(!forced) return false;
|
||||||
t.toFront();
|
t.toFront();
|
||||||
|
|||||||
Reference in New Issue
Block a user