it is gone
This commit is contained in:
@@ -169,10 +169,10 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
SaveSlot slot = control.saves.importSave(file);
|
SaveSlot slot = control.saves.importSave(file);
|
||||||
ui.load.runLoadSave(slot);
|
ui.load.runLoadSave(slot);
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
ui.showError(Core.bundle.format("save.import.fail", Strings.parseException(e, true)));
|
ui.showException("save.import.fail", e);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
ui.showError("$save.import.invalid");
|
ui.showErrorMessage("$save.import.invalid");
|
||||||
}
|
}
|
||||||
}else if(map){ //open map
|
}else if(map){ //open map
|
||||||
FileHandle file = Core.files.local("temp-map." + mapExtension);
|
FileHandle file = Core.files.local("temp-map." + mapExtension);
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import java.lang.annotation.*;
|
|||||||
|
|
||||||
public class Annotations{
|
public class Annotations{
|
||||||
|
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
public @interface StyleDefaults {
|
||||||
|
}
|
||||||
|
|
||||||
/** Indicates that a method should always call its super version. */
|
/** Indicates that a method should always call its super version. */
|
||||||
@Target(ElementType.METHOD)
|
@Target(ElementType.METHOD)
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
|||||||
@@ -1,26 +1,22 @@
|
|||||||
package io.anuke.annotations;
|
package io.anuke.annotations;
|
||||||
|
|
||||||
import com.squareup.javapoet.*;
|
import com.squareup.javapoet.*;
|
||||||
|
import io.anuke.annotations.Annotations.*;
|
||||||
|
|
||||||
import javax.annotation.processing.AbstractProcessor;
|
import javax.annotation.processing.*;
|
||||||
import javax.annotation.processing.ProcessingEnvironment;
|
import javax.lang.model.*;
|
||||||
import javax.annotation.processing.RoundEnvironment;
|
import javax.lang.model.element.*;
|
||||||
import javax.annotation.processing.SupportedSourceVersion;
|
import javax.tools.Diagnostic.*;
|
||||||
import javax.lang.model.SourceVersion;
|
import javax.tools.*;
|
||||||
import javax.lang.model.element.Modifier;
|
import java.nio.file.*;
|
||||||
import javax.lang.model.element.TypeElement;
|
import java.util.*;
|
||||||
import javax.tools.Diagnostic.Kind;
|
|
||||||
import javax.tools.StandardLocation;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@SupportedSourceVersion(SourceVersion.RELEASE_8)
|
@SupportedSourceVersion(SourceVersion.RELEASE_8)
|
||||||
|
@SupportedAnnotationTypes("io.anuke.annotations.Annotations.StyleDefaults")
|
||||||
public class AssetsAnnotationProcessor extends AbstractProcessor{
|
public class AssetsAnnotationProcessor extends AbstractProcessor{
|
||||||
/** Name of the base package to put all the generated classes. */
|
/** Name of the base package to put all the generated classes. */
|
||||||
private static final String packageName = "io.anuke.mindustry.gen";
|
private static final String packageName = "io.anuke.mindustry.gen";
|
||||||
|
private String path;
|
||||||
private int round;
|
private int round;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -38,13 +34,13 @@ public class AssetsAnnotationProcessor extends AbstractProcessor{
|
|||||||
if(round++ != 0) return false; //only process 1 round
|
if(round++ != 0) return false; //only process 1 round
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
path = Paths.get(Utils.filer.createResource(StandardLocation.CLASS_OUTPUT, "no", "no")
|
||||||
String path = Paths.get(Utils.filer.createResource(StandardLocation.CLASS_OUTPUT, "no", "no")
|
|
||||||
.toUri().toURL().toString().substring(System.getProperty("os.name").contains("Windows") ? 6 : "file:".length()))
|
.toUri().toURL().toString().substring(System.getProperty("os.name").contains("Windows") ? 6 : "file:".length()))
|
||||||
.getParent().getParent().getParent().getParent().getParent().getParent().toString();
|
.getParent().getParent().getParent().getParent().getParent().getParent().toString();
|
||||||
|
|
||||||
process("Sounds", path + "/assets/sounds", "io.anuke.arc.audio.Sound", "newSound");
|
processSounds("Sounds", path + "/assets/sounds", "io.anuke.arc.audio.Sound");
|
||||||
process("Musics", path + "/assets/music", "io.anuke.arc.audio.Music", "newMusic");
|
processSounds("Musics", path + "/assets/music", "io.anuke.arc.audio.Music");
|
||||||
|
processUI(roundEnv.getElementsAnnotatedWith(StyleDefaults.class));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
@@ -53,19 +49,72 @@ public class AssetsAnnotationProcessor extends AbstractProcessor{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
void processUI(Set<? extends Element> elements) throws Exception{
|
||||||
public Set<String> getSupportedAnnotationTypes() {
|
String[] iconSizes = {"small", "smaller", "tiny"};
|
||||||
return Collections.singleton("*");
|
|
||||||
|
TypeSpec.Builder type = TypeSpec.classBuilder("Tex").addModifiers(Modifier.PUBLIC);
|
||||||
|
TypeSpec.Builder ictype = TypeSpec.classBuilder("Icon").addModifiers(Modifier.PUBLIC);
|
||||||
|
MethodSpec.Builder load = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
MethodSpec.Builder icload = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
String resources = path + "/assets-raw/sprites/ui";
|
||||||
|
Files.walk(Paths.get(resources)).forEach(p -> {
|
||||||
|
if(Files.isDirectory(p)) return;
|
||||||
|
|
||||||
|
String filename = p.getFileName().toString();
|
||||||
|
filename = filename.substring(0, filename.indexOf("."));
|
||||||
|
|
||||||
|
ArrayList<String> names = new ArrayList<>();
|
||||||
|
names.add("");
|
||||||
|
if(filename.contains("icon")){
|
||||||
|
names.addAll(Arrays.asList(iconSizes));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(String suffix : names){
|
||||||
|
suffix = suffix.isEmpty() ? "" : "-" + suffix;
|
||||||
|
|
||||||
|
String sfilen = filename + suffix;
|
||||||
|
String dtype = p.getFileName().toString().endsWith(".9.png") ? "io.anuke.arc.scene.style.NinePatchDrawable" : "io.anuke.arc.scene.style.TextureRegionDrawable";
|
||||||
|
|
||||||
|
String varname = capitalize(sfilen);
|
||||||
|
TypeSpec.Builder ttype = type;
|
||||||
|
MethodSpec.Builder tload = load;
|
||||||
|
if(varname.startsWith("icon")){
|
||||||
|
varname = varname.substring("icon".length());
|
||||||
|
varname = Character.toLowerCase(varname.charAt(0)) + varname.substring(1);
|
||||||
|
ttype = ictype;
|
||||||
|
tload = icload;
|
||||||
|
if(SourceVersion.isKeyword(varname)) varname += "i";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(SourceVersion.isKeyword(varname)) varname += "s";
|
||||||
|
|
||||||
|
ttype.addField(ClassName.bestGuess(dtype), varname, Modifier.STATIC, Modifier.PUBLIC);
|
||||||
|
tload.addStatement(varname + " = ("+dtype+")io.anuke.arc.Core.atlas.getDrawable($S)", sfilen);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
for(Element elem : elements){
|
||||||
|
TypeElement t = (TypeElement)elem;
|
||||||
|
t.getEnclosedElements().stream().filter(e -> e.getKind() == ElementKind.FIELD).forEach(field -> {
|
||||||
|
String fname = field.getSimpleName().toString();
|
||||||
|
if(fname.startsWith("default")){
|
||||||
|
load.addStatement("io.anuke.arc.Core.scene.addStyle(" + field.asType().toString() + ".class, io.anuke.mindustry.ui.Style." + fname + ")");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ictype.addMethod(icload.build());
|
||||||
|
JavaFile.builder(packageName, ictype.build()).build().writeTo(Utils.filer);
|
||||||
|
|
||||||
|
type.addMethod(load.build());
|
||||||
|
JavaFile.builder(packageName, type.build()).build().writeTo(Utils.filer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void process(String classname, String path, String rtype, String loadMethod) throws Exception{
|
void processSounds(String classname, String path, String rtype) throws Exception{
|
||||||
TypeSpec.Builder type = TypeSpec.classBuilder(classname).addModifiers(Modifier.PUBLIC);
|
TypeSpec.Builder type = TypeSpec.classBuilder(classname).addModifiers(Modifier.PUBLIC);
|
||||||
//MethodSpec.Builder load = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
|
||||||
MethodSpec.Builder dispose = MethodSpec.methodBuilder("dispose").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
MethodSpec.Builder dispose = MethodSpec.methodBuilder("dispose").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
|
||||||
MethodSpec.Builder loadBegin = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
MethodSpec.Builder loadBegin = MethodSpec.methodBuilder("load").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
|
||||||
|
|
||||||
|
|
||||||
HashSet<String> names = new HashSet<>();
|
HashSet<String> names = new HashSet<>();
|
||||||
Files.list(Paths.get(path)).forEach(p -> {
|
Files.list(Paths.get(path)).forEach(p -> {
|
||||||
String fname = p.getFileName().toString();
|
String fname = p.getFileName().toString();
|
||||||
@@ -84,26 +133,38 @@ public class AssetsAnnotationProcessor extends AbstractProcessor{
|
|||||||
|
|
||||||
String filepath = path.substring(path.lastIndexOf("/") + 1) + "/" + fname;
|
String filepath = path.substring(path.lastIndexOf("/") + 1) + "/" + fname;
|
||||||
|
|
||||||
//load.addStatement(name + " = io.anuke.arc.Core.audio."+loadMethod+"(io.anuke.arc.Core.files.internal(io.anuke.arc.Core.app.getType() != io.anuke.arc.Application.ApplicationType.iOS ? $S : $S))",
|
|
||||||
//filepath, filepath.replace(".ogg", ".mp3"));
|
|
||||||
String filename = "io.anuke.arc.Core.app.getType() != io.anuke.arc.Application.ApplicationType.iOS ? \"" + filepath + "\" : \"" + filepath.replace(".ogg", ".mp3")+"\"";
|
String filename = "io.anuke.arc.Core.app.getType() != io.anuke.arc.Application.ApplicationType.iOS ? \"" + filepath + "\" : \"" + filepath.replace(".ogg", ".mp3")+"\"";
|
||||||
|
|
||||||
loadBegin.addStatement("io.anuke.arc.Core.assets.load("+filename +", "+rtype+".class).loaded = a -> " + name + " = ("+rtype+")a", filepath, filepath.replace(".ogg", ".mp3"));
|
loadBegin.addStatement("io.anuke.arc.Core.assets.load("+filename +", "+rtype+".class).loaded = a -> " + name + " = ("+rtype+")a", filepath, filepath.replace(".ogg", ".mp3"));
|
||||||
|
|
||||||
|
|
||||||
dispose.addStatement(name + ".dispose()");
|
dispose.addStatement(name + ".dispose()");
|
||||||
dispose.addStatement(name + " = null");
|
dispose.addStatement(name + " = null");
|
||||||
type.addField(FieldSpec.builder(ClassName.bestGuess(rtype), name, Modifier.STATIC, Modifier.PUBLIC).initializer("new io.anuke.arc.audio.mock.Mock" + rtype.substring(rtype.lastIndexOf(".") + 1)+ "()").build());
|
type.addField(FieldSpec.builder(ClassName.bestGuess(rtype), name, Modifier.STATIC, Modifier.PUBLIC).initializer("new io.anuke.arc.audio.mock.Mock" + rtype.substring(rtype.lastIndexOf(".") + 1)+ "()").build());
|
||||||
//cons.consume(type, fname, name);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if(classname.equals("Sounds")){
|
if(classname.equals("Sounds")){
|
||||||
type.addField(FieldSpec.builder(ClassName.bestGuess(rtype), "none", Modifier.STATIC, Modifier.PUBLIC).initializer("new io.anuke.arc.audio.mock.Mock" + rtype.substring(rtype.lastIndexOf(".") + 1)+ "()").build());
|
type.addField(FieldSpec.builder(ClassName.bestGuess(rtype), "none", Modifier.STATIC, Modifier.PUBLIC).initializer("new io.anuke.arc.audio.mock.Mock" + rtype.substring(rtype.lastIndexOf(".") + 1)+ "()").build());
|
||||||
}
|
}
|
||||||
|
|
||||||
//type.addMethod(load.build());
|
|
||||||
type.addMethod(loadBegin.build());
|
type.addMethod(loadBegin.build());
|
||||||
type.addMethod(dispose.build());
|
type.addMethod(dispose.build());
|
||||||
JavaFile.builder(packageName, type.build()).build().writeTo(Utils.filer);
|
JavaFile.builder(packageName, type.build()).build().writeTo(Utils.filer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static String capitalize(String s){
|
||||||
|
StringBuilder result = new StringBuilder(s.length());
|
||||||
|
|
||||||
|
for(int i = 0; i < s.length(); i++){
|
||||||
|
char c = s.charAt(i);
|
||||||
|
if(c != '_' && c != '-'){
|
||||||
|
if(i > 0 && (s.charAt(i - 1) == '_' || s.charAt(i - 1) == '-')){
|
||||||
|
result.append(Character.toUpperCase(c));
|
||||||
|
}else{
|
||||||
|
result.append(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 91 B After Width: | Height: | Size: 91 B |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 566 KiB After Width: | Height: | Size: 575 KiB |
@@ -279,7 +279,9 @@
|
|||||||
},
|
},
|
||||||
WindowStyle: {
|
WindowStyle: {
|
||||||
default: {
|
default: {
|
||||||
|
stageBackground: dialogDim,
|
||||||
titleFont: default,
|
titleFont: default,
|
||||||
|
background: window-empty,
|
||||||
titleFontColor: accent
|
titleFontColor: accent
|
||||||
},
|
},
|
||||||
dialog: {
|
dialog: {
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
|
|||||||
|
|
||||||
UI.loadDefaultFont();
|
UI.loadDefaultFont();
|
||||||
|
|
||||||
assets.load(new AssetDescriptor<>("sprites/sprites.atlas", TextureAtlas.class)).loaded = t -> atlas = (TextureAtlas)t;
|
assets.load(new AssetDescriptor<>("sprites/sprites.atlas", TextureAtlas.class)).loaded = t -> {
|
||||||
|
atlas = (TextureAtlas)t;
|
||||||
|
};
|
||||||
|
|
||||||
assets.loadRun("maps", Map.class, () -> maps.loadPreviews());
|
assets.loadRun("maps", Map.class, () -> maps.loadPreviews());
|
||||||
|
|
||||||
|
|||||||
@@ -62,14 +62,6 @@ public class Vars implements Loadable{
|
|||||||
public static final float itemSize = 5f;
|
public static final float itemSize = 5f;
|
||||||
/** extra padding around the world; units outside this bound will begin to self-destruct. */
|
/** extra padding around the world; units outside this bound will begin to self-destruct. */
|
||||||
public static final float worldBounds = 100f;
|
public static final float worldBounds = 100f;
|
||||||
/** default size of UI icons.*/
|
|
||||||
public static final int iconsize = 48;
|
|
||||||
/** size of UI icons (small)*/
|
|
||||||
public static final int iconsizesmall = 32;
|
|
||||||
/** size of UI icons (medium)*/
|
|
||||||
public static final int iconsizemed = 30;
|
|
||||||
/** size of UI icons (medium)*/
|
|
||||||
public static final int iconsizetiny = 16;
|
|
||||||
/** units outside of this bound will simply die instantly */
|
/** units outside of this bound will simply die instantly */
|
||||||
public static final float finalWorldBounds = worldBounds + 500;
|
public static final float finalWorldBounds = worldBounds + 500;
|
||||||
/** ticks spent out of bound until self destruct. */
|
/** ticks spent out of bound until self destruct. */
|
||||||
|
|||||||
@@ -14,13 +14,11 @@ import io.anuke.arc.freetype.FreetypeFontLoader.*;
|
|||||||
import io.anuke.arc.function.*;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.graphics.*;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.graphics.g2d.*;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.graphics.g2d.TextureAtlas.*;
|
|
||||||
import io.anuke.arc.input.*;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.arc.math.*;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.scene.*;
|
import io.anuke.arc.scene.*;
|
||||||
import io.anuke.arc.scene.actions.*;
|
import io.anuke.arc.scene.actions.*;
|
||||||
import io.anuke.arc.scene.event.*;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.style.*;
|
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.TextField.*;
|
import io.anuke.arc.scene.ui.TextField.*;
|
||||||
import io.anuke.arc.scene.ui.Tooltip.*;
|
import io.anuke.arc.scene.ui.Tooltip.*;
|
||||||
@@ -31,6 +29,7 @@ import io.anuke.mindustry.editor.*;
|
|||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
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.dialogs.*;
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
import io.anuke.mindustry.ui.fragments.*;
|
import io.anuke.mindustry.ui.fragments.*;
|
||||||
|
|
||||||
@@ -38,8 +37,6 @@ import static io.anuke.arc.scene.actions.Actions.*;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class UI implements ApplicationListener, Loadable{
|
public class UI implements ApplicationListener, Loadable{
|
||||||
private Skin skin;
|
|
||||||
|
|
||||||
public MenuFragment menufrag;
|
public MenuFragment menufrag;
|
||||||
public HudFragment hudfrag;
|
public HudFragment hudfrag;
|
||||||
public ChatFragment chatfrag;
|
public ChatFragment chatfrag;
|
||||||
@@ -73,7 +70,6 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
public Cursor drillCursor, unloadCursor;
|
public Cursor drillCursor, unloadCursor;
|
||||||
|
|
||||||
public UI(){
|
public UI(){
|
||||||
skin = new Skin();
|
|
||||||
setupFonts();
|
setupFonts();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,22 +80,17 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadSync(){
|
public void loadSync(){
|
||||||
//TODO type-safe skin files
|
Fonts.outline.getData().markupEnabled = true;
|
||||||
skin.addRegions(Core.atlas);
|
Fonts.def.getData().markupEnabled = true;
|
||||||
loadExtraStyle(skin);
|
Fonts.def.setOwnsTexture(false);
|
||||||
skin.add("outline", Core.assets.get("outline"));
|
|
||||||
skin.getFont("outline").getData().markupEnabled = true;
|
|
||||||
skin.getFont("default").getData().markupEnabled = true;
|
|
||||||
skin.getFont("default").setOwnsTexture(false);
|
|
||||||
skin.load(Core.files.internal("sprites/uiskin.json"));
|
|
||||||
|
|
||||||
for(BitmapFont font : skin.getAll(BitmapFont.class).values()){
|
Core.assets.getAll(BitmapFont.class, new Array<>()).each(font -> font.setUseIntegerPositions(true));
|
||||||
font.setUseIntegerPositions(true);
|
Core.scene = new Scene();
|
||||||
}
|
|
||||||
|
|
||||||
Core.scene = new Scene(skin);
|
|
||||||
Core.input.addProcessor(Core.scene);
|
Core.input.addProcessor(Core.scene);
|
||||||
|
|
||||||
|
Tex.load();
|
||||||
|
Icon.load();
|
||||||
|
|
||||||
Dialog.setShowAction(() -> sequence(alpha(0f), fadeIn(0.1f)));
|
Dialog.setShowAction(() -> sequence(alpha(0f), fadeIn(0.1f)));
|
||||||
Dialog.setHideAction(() -> sequence(fadeOut(0.1f)));
|
Dialog.setHideAction(() -> sequence(fadeOut(0.1f)));
|
||||||
|
|
||||||
@@ -153,26 +144,7 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
incremental = true;
|
incremental = true;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
Core.assets.load("outline", BitmapFont.class, new FreeTypeFontLoaderParameter("fonts/font.ttf", param));
|
Core.assets.load("outline", BitmapFont.class, new FreeTypeFontLoaderParameter("fonts/font.ttf", param)).loaded = t -> Fonts.outline = (BitmapFont)t;
|
||||||
}
|
|
||||||
|
|
||||||
void loadExtraStyle(Skin skin){
|
|
||||||
AtlasRegion region = Core.atlas.find("flat-down-base");
|
|
||||||
int[] splits = region.splits;
|
|
||||||
|
|
||||||
ScaledNinePatchDrawable copy = new ScaledNinePatchDrawable(new NinePatch(region, splits[0], splits[1], splits[2], splits[3])){
|
|
||||||
public float getLeftWidth(){ return 0; }
|
|
||||||
public float getRightWidth(){ return 0; }
|
|
||||||
public float getTopHeight(){ return 0; }
|
|
||||||
public float getBottomHeight(){ return 0; }
|
|
||||||
};
|
|
||||||
copy.setMinWidth(0);
|
|
||||||
copy.setMinHeight(0);
|
|
||||||
copy.setTopHeight(0);
|
|
||||||
copy.setRightWidth(0);
|
|
||||||
copy.setBottomHeight(0);
|
|
||||||
copy.setLeftWidth(0);
|
|
||||||
skin.add("flat-down", copy, Drawable.class);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadExtraCursors(){
|
void loadExtraCursors(){
|
||||||
@@ -185,8 +157,8 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
FreeTypeFontParameter param = fontParameter();
|
FreeTypeFontParameter param = fontParameter();
|
||||||
|
|
||||||
Core.assets.load("default", BitmapFont.class, new FreeTypeFontLoaderParameter(fontName, param)).loaded = f -> skin.add("default", f);
|
Core.assets.load("default", BitmapFont.class, new FreeTypeFontLoaderParameter(fontName, param)).loaded = f -> Fonts.def = (BitmapFont)f;
|
||||||
Core.assets.load("chat", BitmapFont.class, new FreeTypeFontLoaderParameter(fontName, param)).loaded = f -> skin.add("chat", f);
|
Core.assets.load("chat", BitmapFont.class, new FreeTypeFontLoaderParameter(fontName, param)).loaded = f -> Fonts.chat = (BitmapFont)f;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FreeTypeFontParameter fontParameter(){
|
static FreeTypeFontParameter fontParameter(){
|
||||||
@@ -291,7 +263,7 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showTextInput(String titleText, String text, int textLength, String def, TextFieldFilter filter, Consumer<String> confirmed){
|
public void showTextInput(String titleText, String text, int textLength, String def, TextFieldFilter filter, Consumer<String> confirmed){
|
||||||
new Dialog(titleText, "dialog"){{
|
new Dialog(titleText){{
|
||||||
cont.margin(30).add(text).padRight(6f);
|
cont.margin(30).add(text).padRight(6f);
|
||||||
TextField field = cont.addField(def, t -> {
|
TextField field = cont.addField(def, t -> {
|
||||||
}).size(170f, 50f).get();
|
}).size(170f, 50f).get();
|
||||||
@@ -323,7 +295,7 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showInfo(String info){
|
public void showInfo(String info){
|
||||||
new Dialog("", "dialog"){{
|
new Dialog(""){{
|
||||||
getCell(cont).growX();
|
getCell(cont).growX();
|
||||||
cont.margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
cont.margin(15).add(info).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
||||||
buttons.addButton("$ok", this::hide).size(90, 50).pad(4);
|
buttons.addButton("$ok", this::hide).size(90, 50).pad(4);
|
||||||
@@ -331,12 +303,12 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showErrorMessage(String text){
|
public void showErrorMessage(String text){
|
||||||
new Dialog("", "dialog"){{
|
new Dialog(""){{
|
||||||
setFillParent(false);
|
setFillParent(false);
|
||||||
cont.margin(15f);
|
cont.margin(15f);
|
||||||
cont.add("$error.title");
|
cont.add("$error.title");
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.addImage("whiteui").fillX().pad(2).height(4f).color(Color.SCARLET);
|
cont.addImage().fillX().pad(2).height(4f).color(Color.SCARLET);
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.add(text).pad(2f);
|
cont.add(text).pad(2f);
|
||||||
buttons.addButton("$ok", this::hide).size(120, 50).pad(4);
|
buttons.addButton("$ok", this::hide).size(120, 50).pad(4);
|
||||||
@@ -348,21 +320,21 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showException(String text, Throwable exc){
|
public void showException(String text, Throwable exc){
|
||||||
new Dialog("", "dialog"){{
|
new Dialog(""){{
|
||||||
String message = Strings.getFinalMesage(exc);
|
String message = Strings.getFinalMesage(exc);
|
||||||
|
|
||||||
setFillParent(true);
|
setFillParent(true);
|
||||||
cont.margin(15);
|
cont.margin(15);
|
||||||
cont.add("$error.title").colspan(2);
|
cont.add("$error.title").colspan(2);
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.addImage("whiteui").fillX().pad(2).colspan(2).height(4f).color(Color.SCARLET);
|
cont.addImage().fillX().pad(2).colspan(2).height(4f).color(Color.SCARLET);
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.add((text.startsWith("$") ? Core.bundle.get(text.substring(1)) : text) + (message == null ? "" : "\n[lightgray](" + message + ")")).colspan(2).center().get().setAlignment(Align.center);
|
cont.add((text.startsWith("$") ? Core.bundle.get(text.substring(1)) : text) + (message == null ? "" : "\n[lightgray](" + message + ")")).colspan(2).center().get().setAlignment(Align.center);
|
||||||
cont.row();
|
cont.row();
|
||||||
|
|
||||||
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", "toggle", col::toggle).size(180f, 50f).checked(b -> !col.isCollapsed()).fillX().right();
|
cont.addButton("$details", Style.toggleTbutton, 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);
|
||||||
@@ -370,24 +342,24 @@ public class UI implements ApplicationListener, Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showText(String titleText, String text){
|
public void showText(String titleText, String text){
|
||||||
new Dialog(titleText, "dialog"){{
|
new Dialog(titleText){{
|
||||||
cont.margin(15).add(text).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
cont.margin(15).add(text).width(400f).wrap().get().setAlignment(Align.center, Align.center);
|
||||||
buttons.addButton("$ok", this::hide).size(90, 50).pad(4);
|
buttons.addButton("$ok", this::hide).size(90, 50).pad(4);
|
||||||
}}.show();
|
}}.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showInfoText(String titleText, String text){
|
public void showInfoText(String titleText, String text){
|
||||||
new Dialog(titleText, "dialog"){{
|
new Dialog(titleText){{
|
||||||
cont.margin(15).add(text).width(400f).wrap().left().get().setAlignment(Align.left, Align.left);
|
cont.margin(15).add(text).width(400f).wrap().left().get().setAlignment(Align.left, Align.left);
|
||||||
buttons.addButton("$ok", this::hide).size(90, 50).pad(4);
|
buttons.addButton("$ok", this::hide).size(90, 50).pad(4);
|
||||||
}}.show();
|
}}.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showSmall(String titleText, String text){
|
public void showSmall(String titleText, String text){
|
||||||
new Dialog(titleText, "dialog"){{
|
new Dialog(titleText){{
|
||||||
cont.margin(10).add(text);
|
cont.margin(10).add(text);
|
||||||
titleTable.row();
|
titleTable.row();
|
||||||
titleTable.addImage("whiteui").color(Pal.accent).height(3f).growX().pad(2f);
|
titleTable.addImage().color(Pal.accent).height(3f).growX().pad(2f);
|
||||||
buttons.addButton("$ok", this::hide).size(90, 50).pad(4);
|
buttons.addButton("$ok", this::hide).size(90, 50).pad(4);
|
||||||
}}.show();
|
}}.show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,19 +13,19 @@ import io.anuke.arc.scene.actions.*;
|
|||||||
import io.anuke.arc.scene.event.*;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.style.*;
|
import io.anuke.arc.scene.style.*;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.TextButton.*;
|
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.content.*;
|
import io.anuke.mindustry.content.*;
|
||||||
import io.anuke.mindustry.core.GameState.*;
|
import io.anuke.mindustry.core.GameState.*;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
|
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.dialogs.*;
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.Block.*;
|
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
import io.anuke.mindustry.world.blocks.storage.*;
|
import io.anuke.mindustry.world.blocks.storage.*;
|
||||||
|
|
||||||
@@ -47,9 +47,9 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
private Array<Block> blocksOut = new Array<>();
|
private Array<Block> blocksOut = new Array<>();
|
||||||
|
|
||||||
public MapEditorDialog(){
|
public MapEditorDialog(){
|
||||||
super("", "dialog");
|
super("");
|
||||||
|
|
||||||
background("dark");
|
background(Style.dark);
|
||||||
|
|
||||||
editor = new MapEditor();
|
editor = new MapEditor();
|
||||||
view = new MapView(editor);
|
view = new MapView(editor);
|
||||||
@@ -59,27 +59,26 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
menu = new FloatingDialog("$menu");
|
menu = new FloatingDialog("$menu");
|
||||||
menu.addCloseButton();
|
menu.addCloseButton();
|
||||||
|
|
||||||
float isize = iconsize;
|
|
||||||
float swidth = 180f;
|
float swidth = 180f;
|
||||||
|
|
||||||
menu.cont.table(t -> {
|
menu.cont.table(t -> {
|
||||||
t.defaults().size(swidth, 60f).padBottom(5).padRight(5).padLeft(5);
|
t.defaults().size(swidth, 60f).padBottom(5).padRight(5).padLeft(5);
|
||||||
|
|
||||||
t.addImageTextButton("$editor.savemap", "icon-floppy-16", isize, this::save);
|
t.addImageTextButton("$editor.savemap", Icon.floppy16Small, this::save);
|
||||||
|
|
||||||
t.addImageTextButton("$editor.mapinfo", "icon-pencil", isize, () -> {
|
t.addImageTextButton("$editor.mapinfo", Icon.pencilSmall, () -> {
|
||||||
infoDialog.show();
|
infoDialog.show();
|
||||||
menu.hide();
|
menu.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
|
|
||||||
t.addImageTextButton("$editor.generate", "icon-editor", isize, () -> {
|
t.addImageTextButton("$editor.generate", Icon.editorSmall, () -> {
|
||||||
generateDialog.show(generateDialog::applyToEditor);
|
generateDialog.show(generateDialog::applyToEditor);
|
||||||
menu.hide();
|
menu.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
t.addImageTextButton("$editor.resize", "icon-resize", isize, () -> {
|
t.addImageTextButton("$editor.resize", Icon.resizeSmall, () -> {
|
||||||
resizeDialog.show();
|
resizeDialog.show();
|
||||||
menu.hide();
|
menu.hide();
|
||||||
});
|
});
|
||||||
@@ -87,10 +86,10 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
t.row();
|
t.row();
|
||||||
|
|
||||||
if(!ios){
|
if(!ios){
|
||||||
t.addImageTextButton("$editor.import", "icon-load-map", isize, () ->
|
t.addImageTextButton("$editor.import", Icon.loadMapSmall, () ->
|
||||||
createDialog("$editor.import",
|
createDialog("$editor.import",
|
||||||
"$editor.importmap", "$editor.importmap.description", "icon-load-map", (Runnable)loadDialog::show,
|
"$editor.importmap", "$editor.importmap.description", Icon.loadMap, (Runnable)loadDialog::show,
|
||||||
"$editor.importfile", "$editor.importfile.description", "icon-file", (Runnable)() ->
|
"$editor.importfile", "$editor.importfile.description", Icon.file, (Runnable)() ->
|
||||||
platform.showFileChooser(true, mapExtension, file -> ui.loadAnd(() -> {
|
platform.showFileChooser(true, mapExtension, file -> ui.loadAnd(() -> {
|
||||||
maps.tryCatchMapError(() -> {
|
maps.tryCatchMapError(() -> {
|
||||||
if(MapIO.isImage(file)){
|
if(MapIO.isImage(file)){
|
||||||
@@ -101,7 +100,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
|
|
||||||
"$editor.importimage", "$editor.importimage.description", "icon-file-image", (Runnable)() ->
|
"$editor.importimage", "$editor.importimage.description", Icon.fileImage, (Runnable)() ->
|
||||||
platform.showFileChooser(true, "png", file ->
|
platform.showFileChooser(true, "png", file ->
|
||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
try{
|
try{
|
||||||
@@ -116,7 +115,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Cell cell = t.addImageTextButton("$editor.export", "icon-save-map", isize, () -> {
|
Cell cell = t.addImageTextButton("$editor.export", Icon.saveMapSmall, () -> {
|
||||||
if(!ios){
|
if(!ios){
|
||||||
platform.showFileChooser(false, mapExtension, file -> {
|
platform.showFileChooser(false, mapExtension, file -> {
|
||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
@@ -152,11 +151,11 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
menu.cont.row();
|
menu.cont.row();
|
||||||
|
|
||||||
menu.cont.addImageTextButton("$editor.ingame", "icon-arrow", isize, this::playtest).padTop(-5).size(swidth * 2f + 10, 60f);
|
menu.cont.addImageTextButton("$editor.ingame", Icon.arrowSmall, this::playtest).padTop(-5).size(swidth * 2f + 10, 60f);
|
||||||
|
|
||||||
menu.cont.row();
|
menu.cont.row();
|
||||||
|
|
||||||
menu.cont.addImageTextButton("$quit", "icon-back", isize, () -> {
|
menu.cont.addImageTextButton("$quit", Icon.backSmall, () -> {
|
||||||
tryExit();
|
tryExit();
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}).size(swidth * 2f + 10, 60f);
|
}).size(swidth * 2f + 10, 60f);
|
||||||
@@ -312,7 +311,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
for(int i = 0; i < arguments.length; i += 4){
|
for(int i = 0; i < arguments.length; i += 4){
|
||||||
String name = (String)arguments[i];
|
String name = (String)arguments[i];
|
||||||
String description = (String)arguments[i + 1];
|
String description = (String)arguments[i + 1];
|
||||||
String iconname = (String)arguments[i + 2];
|
Drawable iconname = (Drawable)arguments[i + 2];
|
||||||
Runnable listenable = (Runnable)arguments[i + 3];
|
Runnable listenable = (Runnable)arguments[i + 3];
|
||||||
|
|
||||||
TextButton button = dialog.cont.addButton(name, () -> {
|
TextButton button = dialog.cont.addButton(name, () -> {
|
||||||
@@ -322,7 +321,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
}).left().margin(0).get();
|
}).left().margin(0).get();
|
||||||
|
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
button.addImage(iconname).size(iconsize).padLeft(10);
|
button.addImage(iconname).padLeft(10);
|
||||||
button.table(t -> {
|
button.table(t -> {
|
||||||
t.add(name).growX().wrap();
|
t.add(name).growX().wrap();
|
||||||
t.row();
|
t.row();
|
||||||
@@ -399,14 +398,13 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
Consumer<EditorTool> addTool = tool -> {
|
Consumer<EditorTool> addTool = tool -> {
|
||||||
|
|
||||||
ImageButton button = new ImageButton("icon-" + tool.name() + "-small", "clear-toggle");
|
ImageButton button = new ImageButton(Core.atlas.drawable("icon-" + tool.name() + "-small"), Style.clearToggleIbutton);
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
view.setTool(tool);
|
view.setTool(tool);
|
||||||
if(lastTable[0] != null){
|
if(lastTable[0] != null){
|
||||||
lastTable[0].remove();
|
lastTable[0].remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
button.resizeImage(iconsizesmall);
|
|
||||||
button.update(() -> button.setChecked(view.getTool() == tool));
|
button.update(() -> button.setChecked(view.getTool() == tool));
|
||||||
group.add(button);
|
group.add(button);
|
||||||
|
|
||||||
@@ -426,7 +424,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
lastTable[0].remove();
|
lastTable[0].remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
Table table = new Table("dialogDim");
|
Table table = new Table(Style.dialogDim);
|
||||||
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++){
|
||||||
@@ -436,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(Core.scene.skin.get("clear-toggle", TextButtonStyle.class));
|
b.setStyle(Style.clearToggleTbutton);
|
||||||
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();
|
||||||
@@ -476,16 +474,16 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
tools.defaults().size(size, size);
|
tools.defaults().size(size, size);
|
||||||
|
|
||||||
tools.addImageButton("icon-menu-large-small", "clear", iconsizesmall, menu::show);
|
tools.addImageButton(Icon.menuLargeSmall, Style.clearIbutton, menu::show);
|
||||||
|
|
||||||
ImageButton grid = tools.addImageButton("icon-grid-small", "clear-toggle", iconsizesmall, () -> view.setGrid(!view.isGrid())).get();
|
ImageButton grid = tools.addImageButton(Icon.gridSmall, Style.clearToggleIbutton, () -> view.setGrid(!view.isGrid())).get();
|
||||||
|
|
||||||
addTool.accept(EditorTool.zoom);
|
addTool.accept(EditorTool.zoom);
|
||||||
|
|
||||||
tools.row();
|
tools.row();
|
||||||
|
|
||||||
ImageButton undo = tools.addImageButton("icon-undo-small", "clear", iconsizesmall, editor::undo).get();
|
ImageButton undo = tools.addImageButton(Icon.undoSmall, Style.clearIbutton, editor::undo).get();
|
||||||
ImageButton redo = tools.addImageButton("icon-redo-small", "clear", iconsizesmall, editor::redo).get();
|
ImageButton redo = tools.addImageButton(Icon.redoSmall, Style.clearIbutton, editor::redo).get();
|
||||||
|
|
||||||
addTool.accept(EditorTool.pick);
|
addTool.accept(EditorTool.pick);
|
||||||
|
|
||||||
@@ -507,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-arrow-16-small", "clear", iconsizesmall, () -> editor.rotation = (editor.rotation + 1) % 4).get();
|
ImageButton rotate = tools.addImageButton(Icon.arrow16Small, Style.clearIbutton, () -> 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);
|
||||||
@@ -515,7 +513,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
tools.row();
|
tools.row();
|
||||||
|
|
||||||
tools.table("underline", t -> t.add("$editor.teams"))
|
tools.table(Tex.underline, t -> t.add("$editor.teams"))
|
||||||
.colspan(3).height(40).width(size * 3f + 3f).padBottom(3);
|
.colspan(3).height(40).width(size * 3f + 3f).padBottom(3);
|
||||||
|
|
||||||
tools.row();
|
tools.row();
|
||||||
@@ -525,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("whiteui", "clear-toggle-partial");
|
ImageButton button = new ImageButton(Tex.whiteui, Style.clearTogglePartialIbutton);
|
||||||
button.margin(4f);
|
button.margin(4f);
|
||||||
button.getImageCell().grow();
|
button.getImageCell().grow();
|
||||||
button.getStyle().imageUpColor = team.color;
|
button.getStyle().imageUpColor = team.color;
|
||||||
@@ -541,7 +539,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
mid.row();
|
mid.row();
|
||||||
|
|
||||||
mid.table("underline", t -> {
|
mid.table(Tex.underline, t -> {
|
||||||
Slider slider = new Slider(0, MapEditor.brushSizes.length - 1, 1, false);
|
Slider slider = new Slider(0, MapEditor.brushSizes.length - 1, 1, false);
|
||||||
slider.moved(f -> editor.brushSize = MapEditor.brushSizes[(int)(float)f]);
|
slider.moved(f -> editor.brushSize = MapEditor.brushSizes[(int)(float)f]);
|
||||||
for(int j = 0; j < MapEditor.brushSizes.length; j++){
|
for(int j = 0; j < MapEditor.brushSizes.length; j++){
|
||||||
@@ -673,11 +671,11 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
});
|
});
|
||||||
|
|
||||||
for(Block block : blocksOut){
|
for(Block block : blocksOut){
|
||||||
TextureRegion region = block.icon(Icon.medium);
|
TextureRegion region = block.icon(Block.Icon.medium);
|
||||||
|
|
||||||
if(!Core.atlas.isFound(region)) continue;
|
if(!Core.atlas.isFound(region)) continue;
|
||||||
|
|
||||||
ImageButton button = new ImageButton("whiteui", "clear-toggle");
|
ImageButton button = new ImageButton(Tex.whiteui, Style.clearToggleIbutton);
|
||||||
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);
|
||||||
@@ -692,7 +690,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
|
|
||||||
group.getButtons().get(2).setChecked(true);
|
group.getButtons().get(2).setChecked(true);
|
||||||
|
|
||||||
table.table("underline", extra -> extra.labelWrap(() -> editor.drawBlock.localizedName).width(200f).center()).growX();
|
table.table(Tex.underline, extra -> extra.labelWrap(() -> editor.drawBlock.localizedName).width(200f).center()).growX();
|
||||||
table.row();
|
table.row();
|
||||||
table.add(pane).growY().fillX();
|
table.add(pane).growY().fillX();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,12 @@ import io.anuke.arc.graphics.Pixmap.*;
|
|||||||
import io.anuke.arc.math.*;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.math.geom.*;
|
import io.anuke.arc.math.geom.*;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
|
import io.anuke.arc.scene.ui.ImageButton.*;
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.async.*;
|
import io.anuke.arc.util.async.*;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
|
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.filters.*;
|
import io.anuke.mindustry.maps.filters.*;
|
||||||
@@ -84,7 +86,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
update();
|
update();
|
||||||
}).size(160f, 64f);
|
}).size(160f, 64f);
|
||||||
|
|
||||||
buttons.addImageTextButton("$add", "icon-add", iconsize, this::showAdd).height(64f).width(140f);
|
buttons.addImageTextButton("$add", Icon.add, this::showAdd).height(64f).width(140f);
|
||||||
|
|
||||||
if(!applied){
|
if(!applied){
|
||||||
hidden(this::apply);
|
hidden(this::apply);
|
||||||
@@ -176,10 +178,8 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, new Stack(){{
|
}, new Stack(){{
|
||||||
add(new Image("loadDim"));
|
add(new Image(Style.loadDim));
|
||||||
add(new Image("icon-refresh"){{
|
add(new Image(Icon.refresh, Scaling.none));
|
||||||
setScaling(Scaling.none);
|
|
||||||
}});
|
|
||||||
visible(() -> generating && !updateEditorOnChange);
|
visible(() -> generating && !updateEditorOnChange);
|
||||||
}}).grow().padRight(10);
|
}}).grow().padRight(10);
|
||||||
t.pane(p -> filterTable = p.marginRight(6)).update(pane -> {
|
t.pane(p -> filterTable = p.marginRight(6)).update(pane -> {
|
||||||
@@ -224,7 +224,7 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
for(GenerateFilter filter : filters){
|
for(GenerateFilter filter : filters){
|
||||||
|
|
||||||
//main container
|
//main container
|
||||||
filterTable.table("button", c -> {
|
filterTable.table(Tex.button, c -> {
|
||||||
//icons to perform actions
|
//icons to perform actions
|
||||||
c.table(t -> {
|
c.table(t -> {
|
||||||
t.top();
|
t.top();
|
||||||
@@ -233,26 +233,26 @@ public class MapGenerateDialog extends FloatingDialog{
|
|||||||
t.row();
|
t.row();
|
||||||
|
|
||||||
t.table(b -> {
|
t.table(b -> {
|
||||||
String style = "clear";
|
ImageButtonStyle style = Style.clearIbutton;
|
||||||
b.defaults().size(50f);
|
b.defaults().size(50f);
|
||||||
b.addImageButton("icon-refresh-small", style, iconsizesmall, () -> {
|
b.addImageButton(Icon.refreshSmall, style, () -> {
|
||||||
filter.randomize();
|
filter.randomize();
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
|
|
||||||
b.addImageButton("icon-arrow-up-small", style, iconsizesmall, () -> {
|
b.addImageButton(Icon.arrowUpSmall, style, () -> {
|
||||||
int idx = filters.indexOf(filter);
|
int idx = filters.indexOf(filter);
|
||||||
filters.swap(idx, Math.max(0, idx - 1));
|
filters.swap(idx, Math.max(0, idx - 1));
|
||||||
rebuildFilters();
|
rebuildFilters();
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
b.addImageButton("icon-arrow-down-small",style, iconsizesmall, () -> {
|
b.addImageButton(Icon.arrowDownSmall, style, () -> {
|
||||||
int idx = filters.indexOf(filter);
|
int idx = filters.indexOf(filter);
|
||||||
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
|
filters.swap(idx, Math.min(filters.size - 1, idx + 1));
|
||||||
rebuildFilters();
|
rebuildFilters();
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
b.addImageButton("icon-trash-small", style, iconsizesmall, () -> {
|
b.addImageButton(Icon.trashSmall, style, () -> {
|
||||||
filters.remove(filter);
|
filters.remove(filter);
|
||||||
rebuildFilters();
|
rebuildFilters();
|
||||||
update();
|
update();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import io.anuke.arc.scene.ui.*;
|
|||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.io.*;
|
import io.anuke.mindustry.io.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.ui.dialogs.*;
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
|
|
||||||
public class MapInfoDialog extends FloatingDialog{
|
public class MapInfoDialog extends FloatingDialog{
|
||||||
@@ -42,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", ""), "textarea", text -> {
|
TextArea description = t.addArea(tags.get("description", ""), Style.textareaField, 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, "horizontal");
|
ScrollPane pane = new ScrollPane(table, Style.horizontalPane);
|
||||||
pane.setFadeScrollBars(false);
|
pane.setFadeScrollBars(false);
|
||||||
|
|
||||||
for(Map map : maps.all()){
|
for(Map map : maps.all()){
|
||||||
|
|
||||||
TextButton button = new TextButton(map.name(), "toggle");
|
TextButton button = new TextButton(map.name(), Style.toggleTbutton);
|
||||||
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);
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package io.anuke.mindustry.editor;
|
package io.anuke.mindustry.editor;
|
||||||
|
|
||||||
import io.anuke.arc.function.IntPositionConsumer;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
|
|
||||||
public class MapResizeDialog extends FloatingDialog{
|
public class MapResizeDialog extends FloatingDialog{
|
||||||
private static final int minSize = 50, maxSize = 500, increment = 50;
|
private static final int minSize = 50, maxSize = 500, increment = 50;
|
||||||
@@ -28,7 +29,7 @@ public class MapResizeDialog extends FloatingDialog{
|
|||||||
height = move(height, -1);
|
height = move(height, -1);
|
||||||
}).size(60f);
|
}).size(60f);
|
||||||
|
|
||||||
table.table("button", t -> t.label(() -> (w ? width : height) + "")).width(200);
|
table.table(Tex.button, t -> t.label(() -> (w ? width : height) + "")).width(200);
|
||||||
|
|
||||||
table.addButton(">", () -> {
|
table.addButton(">", () -> {
|
||||||
if(w)
|
if(w)
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
package io.anuke.mindustry.editor;
|
package io.anuke.mindustry.editor;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.scene.event.Touchable;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.ui.Label;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.TextField.TextFieldFilter;
|
import io.anuke.arc.scene.ui.TextField.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.content.*;
|
import io.anuke.mindustry.content.*;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.io.JsonIO;
|
import io.anuke.mindustry.graphics.*;
|
||||||
|
import io.anuke.mindustry.io.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
import static io.anuke.mindustry.game.SpawnGroup.never;
|
import static io.anuke.mindustry.game.SpawnGroup.never;
|
||||||
@@ -79,7 +80,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
groups = JsonIO.copy(state.rules.spawns.isEmpty() ? defaultWaves.get() : state.rules.spawns);
|
groups = JsonIO.copy(state.rules.spawns.isEmpty() ? defaultWaves.get() : state.rules.spawns);
|
||||||
|
|
||||||
cont.clear();
|
cont.clear();
|
||||||
cont.stack(new Table("clear", main -> {
|
cont.stack(new Table(Tex.clear, main -> {
|
||||||
main.pane(t -> table = t).growX().growY().padRight(8f).get().setScrollingDisabled(true, false);
|
main.pane(t -> table = t).growX().growY().padRight(8f).get().setScrollingDisabled(true, false);
|
||||||
main.row();
|
main.row();
|
||||||
main.addButton("$add", () -> {
|
main.addButton("$add", () -> {
|
||||||
@@ -94,7 +95,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
setAlignment(Align.center, Align.center);
|
setAlignment(Align.center, Align.center);
|
||||||
}}).width(390f).growY();
|
}}).width(390f).growY();
|
||||||
|
|
||||||
cont.table("clear", m -> {
|
cont.table(Tex.clear, m -> {
|
||||||
m.add("$waves.preview").color(Color.LIGHT_GRAY).growX().center().get().setAlignment(Align.center, Align.center);
|
m.add("$waves.preview").color(Color.LIGHT_GRAY).growX().center().get().setAlignment(Align.center, Align.center);
|
||||||
m.row();
|
m.row();
|
||||||
m.addButton("-", () -> {
|
m.addButton("-", () -> {
|
||||||
@@ -134,7 +135,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(groups != null){
|
if(groups != null){
|
||||||
for(SpawnGroup group : groups){
|
for(SpawnGroup group : groups){
|
||||||
table.table("button", t -> {
|
table.table(Tex.button, t -> {
|
||||||
t.margin(0).defaults().pad(3).padLeft(5f).growX().left();
|
t.margin(0).defaults().pad(3).padLeft(5f).growX().left();
|
||||||
t.addButton(b -> {
|
t.addButton(b -> {
|
||||||
b.left();
|
b.left();
|
||||||
@@ -238,7 +239,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
|
|
||||||
for(int i = start; i < displayed + start; i++){
|
for(int i = start; i < displayed + start; i++){
|
||||||
int wave = i;
|
int wave = i;
|
||||||
preview.table("underline", table -> {
|
preview.table(Tex.underline, table -> {
|
||||||
table.add((wave + 1) + "").color(Pal.accent).center().colspan(2).get().setAlignment(Align.center, Align.center);
|
table.add((wave + 1) + "").color(Pal.accent).center().colspan(2).get().setAlignment(Align.center, Align.center);
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import io.anuke.mindustry.io.*;
|
|||||||
import io.anuke.mindustry.net.Administration.*;
|
import io.anuke.mindustry.net.Administration.*;
|
||||||
import io.anuke.mindustry.net.*;
|
import io.anuke.mindustry.net.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
|
|
||||||
@@ -372,7 +373,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void drawName(){
|
public void drawName(){
|
||||||
BitmapFont font = Core.scene.skin.getFont("default");
|
BitmapFont font = Fonts.def;
|
||||||
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
||||||
final float nameHeight = 11;
|
final float nameHeight = 11;
|
||||||
final float textHeight = 15;
|
final float textHeight = 15;
|
||||||
@@ -391,9 +392,9 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
|||||||
if(isAdmin){
|
if(isAdmin){
|
||||||
float s = 3f;
|
float s = 3f;
|
||||||
Draw.color(color.r * 0.5f, color.g * 0.5f, color.b * 0.5f, 1f);
|
Draw.color(color.r * 0.5f, color.g * 0.5f, color.b * 0.5f, 1f);
|
||||||
Draw.rect(Core.atlas.find("icon-admin-small"), x + layout.width / 2f + 2 + 1, y + nameHeight - 1.5f, s, s);
|
Draw.rect(Core.atlas.find("icon-admin-badge"), x + layout.width / 2f + 2 + 1, y + nameHeight - 1.5f, s, s);
|
||||||
Draw.color(color);
|
Draw.color(color);
|
||||||
Draw.rect(Core.atlas.find("icon-admin-small"), x + layout.width / 2f + 2 + 1, y + nameHeight - 1f, s, s);
|
Draw.rect(Core.atlas.find("icon-admin-badge"), x + layout.width / 2f + 2 + 1, y + nameHeight - 1f, s, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Core.settings.getBool("playerchat") && ((textFadeTime > 0 && lastText != null) || isTyping)){
|
if(Core.settings.getBool("playerchat") && ((textFadeTime > 0 && lastText != null) || isTyping)){
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import io.anuke.mindustry.game.*;
|
|||||||
import io.anuke.mindustry.game.Teams.*;
|
import io.anuke.mindustry.game.Teams.*;
|
||||||
import io.anuke.mindustry.gen.*;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.net.Net;
|
|
||||||
import io.anuke.mindustry.net.*;
|
import io.anuke.mindustry.net.*;
|
||||||
import io.anuke.mindustry.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.blocks.*;
|
import io.anuke.mindustry.world.blocks.*;
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
|||||||
(3f + Mathf.absin(Time.time(), 5f, 1f)) * itemtime);
|
(3f + Mathf.absin(Time.time(), 5f, 1f)) * itemtime);
|
||||||
|
|
||||||
if(number){
|
if(number){
|
||||||
Core.scene.skin.getFont("outline").draw(item.amount + "",
|
Fonts.outline.draw(item.amount + "",
|
||||||
x + Angles.trnsx(rotation + 180f, backTrns),
|
x + Angles.trnsx(rotation + 180f, backTrns),
|
||||||
y + Angles.trnsy(rotation + 180f, backTrns) - 3,
|
y + Angles.trnsy(rotation + 180f, backTrns) - 3,
|
||||||
Pal.accent, 0.25f * itemtime / UnitScl.dp.scl(1f), false, Align.center
|
Pal.accent, 0.25f * itemtime / UnitScl.dp.scl(1f), false, Align.center
|
||||||
|
|||||||
@@ -17,8 +17,10 @@ import io.anuke.mindustry.entities.traits.BuilderTrait.*;
|
|||||||
import io.anuke.mindustry.entities.traits.*;
|
import io.anuke.mindustry.entities.traits.*;
|
||||||
import io.anuke.mindustry.entities.type.*;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.input.PlaceUtils.*;
|
import io.anuke.mindustry.input.PlaceUtils.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -249,27 +251,27 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void buildUI(Table table){
|
public void buildUI(Table table){
|
||||||
table.addImage("whiteui").color(Pal.gray).height(4f).colspan(4).growX();
|
table.addImage().color(Pal.gray).height(4f).colspan(4).growX();
|
||||||
table.row();
|
table.row();
|
||||||
table.left().margin(0f).defaults().size(48f);
|
table.left().margin(0f).defaults().size(48f);
|
||||||
|
|
||||||
table.addImageButton("icon-break-small", "clear-toggle-partial", iconsizesmall, () -> {
|
table.addImageButton(Icon.breakSmall, Style.clearTogglePartialIbutton, () -> {
|
||||||
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-diagonal-small", "clear-toggle-partial", iconsizesmall, () -> {
|
table.addImageButton(Icon.diagonalSmall, Style.clearTogglePartialIbutton, () -> {
|
||||||
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-arrow-small", "clear-partial", iconsizesmall, () -> rotation = Mathf.mod(rotation + 1, 4))
|
table.addImageButton(Icon.arrowSmall, Style.clearPartialIbutton,() -> 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-check-small", "clear-partial", iconsizesmall, () -> {
|
table.addImageButton(Icon.checkSmall, Style.clearPartialIbutton, () -> {
|
||||||
for(PlaceRequest request : selection){
|
for(PlaceRequest request : selection){
|
||||||
Tile tile = request.tile();
|
Tile tile = request.tile();
|
||||||
|
|
||||||
@@ -295,7 +297,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
|
|
||||||
Core.scene.table(t -> {
|
Core.scene.table(t -> {
|
||||||
t.bottom().left().visible(() -> (player.isBuilding() || block != null || mode == breaking) && !state.is(State.menu));
|
t.bottom().left().visible(() -> (player.isBuilding() || block != null || mode == breaking) && !state.is(State.menu));
|
||||||
t.addImageTextButton("$cancel", "icon-cancel", 16*2, () -> {
|
t.addImageTextButton("$cancel", Icon.cancelSmall, () -> {
|
||||||
player.clearBuilding();
|
player.clearBuilding();
|
||||||
mode = none;
|
mode = none;
|
||||||
block = null;
|
block = null;
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
package io.anuke.mindustry.ui;
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.function.FloatProvider;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.function.Supplier;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.graphics.Color;
|
|
||||||
import io.anuke.arc.graphics.g2d.*;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.math.geom.Rectangle;
|
import io.anuke.arc.math.geom.*;
|
||||||
import io.anuke.arc.scene.Element;
|
import io.anuke.arc.scene.*;
|
||||||
import io.anuke.arc.scene.style.Drawable;
|
import io.anuke.arc.scene.style.*;
|
||||||
import io.anuke.arc.util.pooling.Pools;
|
import io.anuke.arc.util.pooling.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
|
|
||||||
public class Bar extends Element{
|
public class Bar extends Element{
|
||||||
private static Rectangle scissor = new Rectangle();
|
private static Rectangle scissor = new Rectangle();
|
||||||
@@ -53,11 +53,13 @@ public class Bar extends Element{
|
|||||||
blink = Mathf.lerpDelta(blink, 0f, 0.2f);
|
blink = Mathf.lerpDelta(blink, 0f, 0.2f);
|
||||||
value = Mathf.lerpDelta(value, computed, 0.15f);
|
value = Mathf.lerpDelta(value, computed, 0.15f);
|
||||||
|
|
||||||
|
Drawable bar = Tex.bar;
|
||||||
|
|
||||||
Draw.colorl(0.1f);
|
Draw.colorl(0.1f);
|
||||||
Draw.drawable("bar", x, y, width, height);
|
bar.draw(x, y, width, height);
|
||||||
Draw.color(color, blinkColor, blink);
|
Draw.color(color, blinkColor, blink);
|
||||||
|
|
||||||
Drawable top = Core.scene.skin.getDrawable("bar-top");
|
Drawable top = Tex.barTop;
|
||||||
float topWidth = width * value;
|
float topWidth = width * value;
|
||||||
|
|
||||||
if(topWidth > Core.atlas.find("bar-top").getWidth()){
|
if(topWidth > Core.atlas.find("bar-top").getWidth()){
|
||||||
@@ -71,7 +73,7 @@ public class Bar extends Element{
|
|||||||
|
|
||||||
Draw.color();
|
Draw.color();
|
||||||
|
|
||||||
BitmapFont font = Core.scene.skin.getFont("default");
|
BitmapFont font = Fonts.def;
|
||||||
GlyphLayout lay = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
GlyphLayout lay = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
||||||
lay.setText(font, name);
|
lay.setText(font, name);
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class ContentDisplay{
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(8).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(8).padLeft(0).padRight(0).fillX();
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ public class ContentDisplay{
|
|||||||
table.add(block.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
table.add(block.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(8).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(8).padLeft(0).padRight(0).fillX();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ public class ContentDisplay{
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ public class ContentDisplay{
|
|||||||
table.add(item.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
table.add(item.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public class ContentDisplay{
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ public class ContentDisplay{
|
|||||||
table.add(liquid.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
table.add(liquid.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +139,7 @@ public class ContentDisplay{
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ public class ContentDisplay{
|
|||||||
table.add(mech.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
table.add(mech.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ public class ContentDisplay{
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ public class ContentDisplay{
|
|||||||
table.add(unit.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
table.add(unit.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImage("whiteui").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
table.addImage().height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
9
core/src/io/anuke/mindustry/ui/Fonts.java
Normal file
9
core/src/io/anuke/mindustry/ui/Fonts.java
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
|
|
||||||
|
public class Fonts{
|
||||||
|
public static BitmapFont def;
|
||||||
|
public static BitmapFont outline;
|
||||||
|
public static BitmapFont chat;
|
||||||
|
}
|
||||||
14
core/src/io/anuke/mindustry/ui/IconSize.java
Normal file
14
core/src/io/anuke/mindustry/ui/IconSize.java
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
|
public enum IconSize{
|
||||||
|
def(48),
|
||||||
|
small(32),
|
||||||
|
smaller(30),
|
||||||
|
tiny(16);
|
||||||
|
|
||||||
|
public final int size;
|
||||||
|
|
||||||
|
IconSize(int size){
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.ui;
|
|||||||
import io.anuke.arc.collection.ObjectIntMap;
|
import io.anuke.arc.collection.ObjectIntMap;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.Item.Icon;
|
import io.anuke.mindustry.type.Item.Icon;
|
||||||
import io.anuke.mindustry.type.ItemType;
|
import io.anuke.mindustry.type.ItemType;
|
||||||
@@ -26,7 +27,7 @@ public class ItemsDisplay extends Table{
|
|||||||
top().left();
|
top().left();
|
||||||
margin(0);
|
margin(0);
|
||||||
|
|
||||||
table("button", t -> {
|
table(Tex.button,t -> {
|
||||||
t.margin(10).marginLeft(15).marginTop(15f);
|
t.margin(10).marginLeft(15).marginTop(15f);
|
||||||
t.add("$launcheditems").colspan(3).left().padBottom(5);
|
t.add("$launcheditems").colspan(3).left().padBottom(5);
|
||||||
t.row();
|
t.row();
|
||||||
|
|||||||
@@ -6,13 +6,14 @@ import io.anuke.arc.input.KeyCode;
|
|||||||
import io.anuke.arc.scene.Element;
|
import io.anuke.arc.scene.Element;
|
||||||
import io.anuke.arc.scene.event.*;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class Minimap extends Table{
|
public class Minimap extends Table{
|
||||||
|
|
||||||
public Minimap(){
|
public Minimap(){
|
||||||
background("pane");
|
background(Tex.pane);
|
||||||
float margin = 5f;
|
float margin = 5f;
|
||||||
touchable(Touchable.enabled);
|
touchable(Touchable.enabled);
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
package io.anuke.mindustry.ui;
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
|
import io.anuke.arc.scene.style.*;
|
||||||
import io.anuke.arc.scene.ui.ImageButton;
|
import io.anuke.arc.scene.ui.ImageButton;
|
||||||
import io.anuke.arc.util.Align;
|
import io.anuke.arc.util.Align;
|
||||||
|
|
||||||
public class MobileButton extends ImageButton{
|
public class MobileButton extends ImageButton{
|
||||||
|
|
||||||
public MobileButton(String icon, float isize, String text, Runnable listener){
|
public MobileButton(Drawable icon, String text, Runnable listener){
|
||||||
super(icon);
|
super(icon);
|
||||||
resizeImage(isize);
|
|
||||||
clicked(listener);
|
clicked(listener);
|
||||||
row();
|
row();
|
||||||
add(text).growX().wrap().center().get().setAlignment(Align.center, Align.center);
|
add(text).growX().wrap().center().get().setAlignment(Align.center, Align.center);
|
||||||
|
|||||||
365
core/src/io/anuke/mindustry/ui/Style.java
Normal file
365
core/src/io/anuke/mindustry/ui/Style.java
Normal file
@@ -0,0 +1,365 @@
|
|||||||
|
package io.anuke.mindustry.ui;
|
||||||
|
|
||||||
|
import io.anuke.annotations.Annotations.*;
|
||||||
|
import io.anuke.arc.*;
|
||||||
|
import io.anuke.arc.graphics.*;
|
||||||
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
|
import io.anuke.arc.graphics.g2d.TextureAtlas.*;
|
||||||
|
import io.anuke.arc.scene.style.*;
|
||||||
|
import io.anuke.arc.scene.ui.Button.*;
|
||||||
|
import io.anuke.arc.scene.ui.CheckBox.*;
|
||||||
|
import io.anuke.arc.scene.ui.Dialog.*;
|
||||||
|
import io.anuke.arc.scene.ui.ImageButton.*;
|
||||||
|
import io.anuke.arc.scene.ui.KeybindDialog.*;
|
||||||
|
import io.anuke.arc.scene.ui.Label.*;
|
||||||
|
import io.anuke.arc.scene.ui.ScrollPane.*;
|
||||||
|
import io.anuke.arc.scene.ui.Slider.*;
|
||||||
|
import io.anuke.arc.scene.ui.TextButton.*;
|
||||||
|
import io.anuke.arc.scene.ui.TextField.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.graphics.*;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.gen.Tex.*;
|
||||||
|
|
||||||
|
@StyleDefaults
|
||||||
|
public class Style{
|
||||||
|
public static Drawable
|
||||||
|
dialogDim = whiteui.tint(0f, 0f, 0f, 0.9f),
|
||||||
|
loadDim = whiteui.tint(0f, 0f, 0f, 0.8f),
|
||||||
|
guideDim = whiteui.tint(0f, 0f, 0f, 0.3f),
|
||||||
|
chatfield = whiteui.tint(0f, 0f, 0f, 0.2f),
|
||||||
|
dark = whiteui.tint(0f, 0f, 0f, 1f),
|
||||||
|
none = whiteui.tint(0f, 0f, 0f, 0.1f),
|
||||||
|
flatTrans = whiteui.tint(0f, 0f, 0f, 0.6f),
|
||||||
|
flat = whiteui.tint(0f, 0f, 0f, 1f),
|
||||||
|
flatDown = createFlatDown(),
|
||||||
|
flatOver = whiteui.tint(Color.valueOf("454545"));
|
||||||
|
|
||||||
|
public static ButtonStyle
|
||||||
|
defaultButton = new ButtonStyle(){{
|
||||||
|
down = buttonDown;
|
||||||
|
up = button;
|
||||||
|
over = buttonOver;
|
||||||
|
disabled = buttonDisabled;
|
||||||
|
}},
|
||||||
|
squareButton = new ButtonStyle(){{
|
||||||
|
over = buttonSquareOver;
|
||||||
|
disabled = buttonDisabled;
|
||||||
|
down = buttonSquareDown;
|
||||||
|
up = buttonSquare;
|
||||||
|
}},
|
||||||
|
toggleButton = new ButtonStyle(){{
|
||||||
|
checked = buttonDown;
|
||||||
|
down = buttonDown;
|
||||||
|
up = button;
|
||||||
|
}},
|
||||||
|
waveButton = new ButtonStyle(){{
|
||||||
|
up = buttonEdge4;
|
||||||
|
over = buttonEdgeOver4;
|
||||||
|
disabled = buttonEdge4;
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static TextButtonStyle
|
||||||
|
defaultTbutton = new TextButtonStyle(){{
|
||||||
|
over = buttonOver;
|
||||||
|
disabled = buttonDisabled;
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
down = buttonDown;
|
||||||
|
up = button;
|
||||||
|
}},
|
||||||
|
squareTbutton = new TextButtonStyle(){{
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
over = buttonSquareOver;
|
||||||
|
disabled = buttonDisabled;
|
||||||
|
down = buttonSquareDown;
|
||||||
|
up = buttonSquare;
|
||||||
|
}},
|
||||||
|
nodeTbutton = new TextButtonStyle(){{
|
||||||
|
disabled = button;
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
up = buttonOver;
|
||||||
|
over = buttonDown;
|
||||||
|
}},
|
||||||
|
rightTbutton = 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;
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
down = flatOver;
|
||||||
|
up = flat;
|
||||||
|
}},
|
||||||
|
discordTbutton = new TextButtonStyle(){{
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
up = discordBanner;
|
||||||
|
}},
|
||||||
|
infoTbutton = new TextButtonStyle(){{
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
up = infoBanner;
|
||||||
|
}},
|
||||||
|
clearPartialTbutton = new TextButtonStyle(){{
|
||||||
|
down = whiteui;
|
||||||
|
up = pane;
|
||||||
|
over = flatDown;
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
}},
|
||||||
|
clearPartial2Tbutton = 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;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
checked = flatDown;
|
||||||
|
down = flatDown;
|
||||||
|
up = flat;
|
||||||
|
over = flatOver;
|
||||||
|
disabled = flat;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
}},
|
||||||
|
clearToggleMenuTbutton = new TextButtonStyle(){{
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
checked = flatDown;
|
||||||
|
down = flatDown;
|
||||||
|
up = clear;
|
||||||
|
over = flatOver;
|
||||||
|
disabled = flat;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
}},
|
||||||
|
toggleTbutton = new TextButtonStyle(){{
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
checked = buttonDown;
|
||||||
|
down = buttonDown;
|
||||||
|
up = button;
|
||||||
|
over = buttonOver;
|
||||||
|
disabled = buttonDisabled;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static ImageButtonStyle
|
||||||
|
defaultIbutton = new ImageButtonStyle(){{
|
||||||
|
down = buttonDown;
|
||||||
|
up = button;
|
||||||
|
over = buttonOver;
|
||||||
|
imageDisabledColor = Color.GRAY;
|
||||||
|
imageUpColor = Color.WHITE;
|
||||||
|
disabled = buttonDisabled;
|
||||||
|
}},
|
||||||
|
nodeIbutton = new ImageButtonStyle(){{
|
||||||
|
up = buttonOver;
|
||||||
|
over = buttonDown;
|
||||||
|
}},
|
||||||
|
rightIbutton = new ImageButtonStyle(){{
|
||||||
|
over = buttonRightOver;
|
||||||
|
down = buttonRightDown;
|
||||||
|
up = buttonRight;
|
||||||
|
}},
|
||||||
|
emptyIbutton = new ImageButtonStyle(){{
|
||||||
|
imageDownColor = Pal.accent;
|
||||||
|
imageUpColor = Color.WHITE;
|
||||||
|
}},
|
||||||
|
emptytoggleIbutton = new ImageButtonStyle(){{
|
||||||
|
imageCheckedColor = Color.WHITE;
|
||||||
|
imageDownColor = Color.WHITE;
|
||||||
|
imageUpColor = Color.GRAY;
|
||||||
|
}},
|
||||||
|
staticIbutton = 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;
|
||||||
|
up = none;
|
||||||
|
}},
|
||||||
|
clearIbutton = new ImageButtonStyle(){{
|
||||||
|
down = flatOver;
|
||||||
|
up = flat;
|
||||||
|
over = flatOver;
|
||||||
|
}},
|
||||||
|
clearFullIbutton = new ImageButtonStyle(){{
|
||||||
|
down = whiteui;
|
||||||
|
up = pane;
|
||||||
|
over = flatDown;
|
||||||
|
}},
|
||||||
|
clearPartialIbutton = new ImageButtonStyle(){{
|
||||||
|
down = flatDown;
|
||||||
|
up = none;
|
||||||
|
over = flatOver;
|
||||||
|
}},
|
||||||
|
clearToggleIbutton = new ImageButtonStyle(){{
|
||||||
|
down = flatDown;
|
||||||
|
checked = flatDown;
|
||||||
|
up = flat;
|
||||||
|
over = flatOver;
|
||||||
|
}},
|
||||||
|
clearTransIbutton = new ImageButtonStyle(){{
|
||||||
|
down = flatDown;
|
||||||
|
up = flatTrans;
|
||||||
|
over = flatOver;
|
||||||
|
}},
|
||||||
|
clearToggleTransIbutton = new ImageButtonStyle(){{
|
||||||
|
down = flatDown;
|
||||||
|
checked = flatDown;
|
||||||
|
up = flatTrans;
|
||||||
|
over = flatOver;
|
||||||
|
}},
|
||||||
|
clearTogglePartialIbutton = new ImageButtonStyle(){{
|
||||||
|
down = flatDown;
|
||||||
|
checked = flatDown;
|
||||||
|
up = none;
|
||||||
|
over = flatOver;
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static ScrollPaneStyle
|
||||||
|
defaultPane = new ScrollPaneStyle(){{
|
||||||
|
vScroll = scroll;
|
||||||
|
vScrollKnob = scrollKnobVerticalBlack;
|
||||||
|
}},
|
||||||
|
horizontalPane = new ScrollPaneStyle(){{
|
||||||
|
vScroll = scroll;
|
||||||
|
vScrollKnob = scrollKnobVerticalBlack;
|
||||||
|
hScroll = scrollHorizontal;
|
||||||
|
hScrollKnob = scrollKnobHorizontalBlack;
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static KeybindDialogStyle
|
||||||
|
defaultKeybindDialog = new KeybindDialogStyle(){{
|
||||||
|
keyColor = Pal.accent;
|
||||||
|
keyNameColor = Color.WHITE;
|
||||||
|
controllerColor = Color.LIGHT_GRAY;
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static SliderStyle
|
||||||
|
defaultHorizontalSlider = new SliderStyle(){{
|
||||||
|
background = slider;
|
||||||
|
knob = sliderKnob;
|
||||||
|
knobOver = sliderKnobOver;
|
||||||
|
knobDown = sliderKnobDown;
|
||||||
|
}},
|
||||||
|
defaultVerticalSlider = new SliderStyle(){{
|
||||||
|
background = sliderVertical;
|
||||||
|
knob = sliderKnob;
|
||||||
|
knobOver = sliderKnobOver;
|
||||||
|
knobDown = sliderKnobDown;
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static LabelStyle
|
||||||
|
defaultLabel = new LabelStyle(){{
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
}},
|
||||||
|
outlineLabel = new LabelStyle(){{
|
||||||
|
font = Fonts.outline;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
}};
|
||||||
|
|
||||||
|
public static TextFieldStyle
|
||||||
|
defaultField = new TextFieldStyle(){{
|
||||||
|
font = Fonts.chat;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
disabledBackground = underlineDisabled;
|
||||||
|
selection = Tex.selection;
|
||||||
|
background = underline;
|
||||||
|
invalidBackground = underlineRed;
|
||||||
|
cursor = Tex.cursor;
|
||||||
|
messageFont = Fonts.def;
|
||||||
|
messageFontColor = Color.GRAY;
|
||||||
|
}},
|
||||||
|
textareaField = new TextFieldStyle(){{
|
||||||
|
font = Fonts.chat;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
selection = Tex.selection;
|
||||||
|
background = underline;
|
||||||
|
cursor = Tex.cursor;
|
||||||
|
messageFont = Fonts.def;
|
||||||
|
messageFontColor = Color.GRAY;
|
||||||
|
}};
|
||||||
|
public static CheckBoxStyle
|
||||||
|
defaultCheck = new CheckBoxStyle(){{
|
||||||
|
checkboxOn = checkOn;
|
||||||
|
checkboxOff = checkOff;
|
||||||
|
checkboxOnOver = checkOnOver;
|
||||||
|
checkboxOver = checkOver;
|
||||||
|
checkboxOnDisabled = checkOnDisabled;
|
||||||
|
checkboxOffDisabled = checkDisabled;
|
||||||
|
font = Fonts.def;
|
||||||
|
fontColor = Color.WHITE;
|
||||||
|
disabledFontColor = Color.GRAY;
|
||||||
|
}};
|
||||||
|
public static DialogStyle
|
||||||
|
defaultWindow = new DialogStyle(){{
|
||||||
|
stageBackground = dialogDim;
|
||||||
|
titleFont = Fonts.def;
|
||||||
|
background = windowEmpty;
|
||||||
|
titleFontColor = Pal.accent;
|
||||||
|
}},
|
||||||
|
fulldialogWindow = new DialogStyle(){{
|
||||||
|
stageBackground = dark;
|
||||||
|
titleFont = Fonts.def;
|
||||||
|
background = windowEmpty;
|
||||||
|
titleFontColor = Pal.accent;
|
||||||
|
}};
|
||||||
|
|
||||||
|
|
||||||
|
private static Drawable createFlatDown(){
|
||||||
|
AtlasRegion region = Core.atlas.find("flat-down-base");
|
||||||
|
int[] splits = region.splits;
|
||||||
|
|
||||||
|
ScaledNinePatchDrawable copy = new ScaledNinePatchDrawable(new NinePatch(region, splits[0], splits[1], splits[2], splits[3])){
|
||||||
|
public float getLeftWidth(){ return 0; }
|
||||||
|
public float getRightWidth(){ return 0; }
|
||||||
|
public float getTopHeight(){ return 0; }
|
||||||
|
public float getBottomHeight(){ return 0; }
|
||||||
|
};
|
||||||
|
copy.setMinWidth(0);
|
||||||
|
copy.setMinHeight(0);
|
||||||
|
copy.setTopHeight(0);
|
||||||
|
copy.setRightWidth(0);
|
||||||
|
copy.setBottomHeight(0);
|
||||||
|
copy.setLeftWidth(0);
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
package io.anuke.mindustry.ui.dialogs;
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.collection.*;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.scene.ui.ScrollPane;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.ui.Links;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.ui.Links.LinkEntry;
|
import io.anuke.mindustry.ui.*;
|
||||||
|
import io.anuke.mindustry.ui.Links.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -47,17 +48,17 @@ public class AboutDialog extends FloatingDialog{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Table table = new Table("underline");
|
Table table = new Table(Tex.underline);
|
||||||
table.margin(0);
|
table.margin(0);
|
||||||
table.table(img -> {
|
table.table(img -> {
|
||||||
img.addImage("whiteui").height(h - 5).width(40f).color(link.color);
|
img.addImage().height(h - 5).width(40f).color(link.color);
|
||||||
img.row();
|
img.row();
|
||||||
img.addImage("whiteui").height(5).width(40f).color(link.color.cpy().mul(0.8f, 0.8f, 0.8f, 1f));
|
img.addImage().height(5).width(40f).color(link.color.cpy().mul(0.8f, 0.8f, 0.8f, 1f));
|
||||||
}).expandY();
|
}).expandY();
|
||||||
|
|
||||||
table.table(i -> {
|
table.table(i -> {
|
||||||
i.background("button-edge-3");
|
i.background(Tex.buttonEdge3);
|
||||||
i.addImage("icon-" + link.name).size(iconsize);
|
i.addImage(Core.atlas.drawable("icon-" + link.name));
|
||||||
}).size(h - 5, h);
|
}).size(h - 5, h);
|
||||||
|
|
||||||
table.table(inset -> {
|
table.table(inset -> {
|
||||||
@@ -66,7 +67,7 @@ public class AboutDialog extends FloatingDialog{
|
|||||||
inset.labelWrap(link.description).width(w - 100f).color(Color.LIGHT_GRAY).growX();
|
inset.labelWrap(link.description).width(w - 100f).color(Color.LIGHT_GRAY).growX();
|
||||||
}).padLeft(8);
|
}).padLeft(8);
|
||||||
|
|
||||||
table.addImageButton("icon-link", iconsize, () -> {
|
table.addImageButton(Icon.link, () -> {
|
||||||
if(!Core.net.openURI(link.link)){
|
if(!Core.net.openURI(link.link)){
|
||||||
ui.showErrorMessage("$linkfail");
|
ui.showErrorMessage("$linkfail");
|
||||||
Core.app.setClipboardText(link.link);
|
Core.app.setClipboardText(link.link);
|
||||||
@@ -98,7 +99,7 @@ public class AboutDialog extends FloatingDialog{
|
|||||||
dialog.cont.add("$credits.text");
|
dialog.cont.add("$credits.text");
|
||||||
dialog.cont.row();
|
dialog.cont.row();
|
||||||
if(!contributors.isEmpty()){
|
if(!contributors.isEmpty()){
|
||||||
dialog.cont.addImage("whiteui").color(Pal.accent).fillX().height(3f).pad(3f);
|
dialog.cont.addImage().color(Pal.accent).fillX().height(3f).pad(3f);
|
||||||
dialog.cont.row();
|
dialog.cont.row();
|
||||||
dialog.cont.add("$contributors");
|
dialog.cont.add("$contributors");
|
||||||
dialog.cont.row();
|
dialog.cont.row();
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package io.anuke.mindustry.ui.dialogs;
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
import io.anuke.arc.scene.ui.ScrollPane;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.net.Administration.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -32,12 +33,12 @@ public class AdminsDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(PlayerInfo info : netServer.admins.getAdmins()){
|
for(PlayerInfo info : netServer.admins.getAdmins()){
|
||||||
Table res = new Table("button");
|
Table res = new Table(Tex.button);
|
||||||
res.margin(14f);
|
res.margin(14f);
|
||||||
|
|
||||||
res.labelWrap("[LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
|
res.labelWrap("[LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
|
||||||
res.add().growX();
|
res.add().growX();
|
||||||
res.addImageButton("icon-cancel", iconsize, () -> {
|
res.addImageButton(Icon.cancel, () -> {
|
||||||
ui.showConfirm("$confirm", "$confirmunadmin", () -> {
|
ui.showConfirm("$confirm", "$confirmunadmin", () -> {
|
||||||
netServer.admins.unAdminPlayer(info.id);
|
netServer.admins.unAdminPlayer(info.id);
|
||||||
playerGroup.all().each(player -> {
|
playerGroup.all().each(player -> {
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package io.anuke.mindustry.ui.dialogs;
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
import io.anuke.arc.scene.ui.ScrollPane;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.net.Administration.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -33,12 +34,12 @@ public class BansDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(PlayerInfo info : netServer.admins.getBanned()){
|
for(PlayerInfo info : netServer.admins.getBanned()){
|
||||||
Table res = new Table("button");
|
Table res = new Table(Tex.button);
|
||||||
res.margin(14f);
|
res.margin(14f);
|
||||||
|
|
||||||
res.labelWrap("IP: [LIGHT_GRAY]" + info.lastIP + "\n[]Name: [LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
|
res.labelWrap("IP: [LIGHT_GRAY]" + info.lastIP + "\n[]Name: [LIGHT_GRAY]" + info.lastName).width(w - h - 24f);
|
||||||
res.add().growX();
|
res.add().growX();
|
||||||
res.addImageButton("icon-cancel", iconsize, () -> {
|
res.addImageButton(Icon.cancel, () -> {
|
||||||
ui.showConfirm("$confirm", "$confirmunban", () -> {
|
ui.showConfirm("$confirm", "$confirmunban", () -> {
|
||||||
netServer.admins.unbanPlayerID(info.id);
|
netServer.admins.unbanPlayerID(info.id);
|
||||||
setup();
|
setup();
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
package io.anuke.mindustry.ui.dialogs;
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
import io.anuke.arc.function.Consumer;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.arc.scene.ui.Dialog;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.ImageButton;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.player;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
import static io.anuke.mindustry.Vars.playerColors;
|
|
||||||
|
|
||||||
public class ColorPickDialog extends Dialog{
|
public class ColorPickDialog extends Dialog{
|
||||||
private Consumer<Color> cons;
|
private Consumer<Color> cons;
|
||||||
|
|
||||||
public ColorPickDialog(){
|
public ColorPickDialog(){
|
||||||
super("", "dialog");
|
super("");
|
||||||
build();
|
build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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("whiteui", "clear-toggle", 34, () -> {
|
ImageButton button = table.addImageButton(Tex.whiteui, Style.clearToggleIbutton, 34, () -> {
|
||||||
cons.accept(color);
|
cons.accept(color);
|
||||||
hide();
|
hide();
|
||||||
}).size(48).get();
|
}).size(48).get();
|
||||||
|
|||||||
@@ -1,21 +1,19 @@
|
|||||||
package io.anuke.mindustry.ui.dialogs;
|
package io.anuke.mindustry.ui.dialogs;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.arc.input.KeyCode;
|
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.util.Align;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.graphics.*;
|
||||||
|
|
||||||
public class ControlsDialog extends KeybindDialog{
|
public class ControlsDialog extends KeybindDialog{
|
||||||
|
|
||||||
public ControlsDialog(){
|
public ControlsDialog(){
|
||||||
setStyle(Core.scene.skin.get("dialog", WindowStyle.class));
|
|
||||||
|
|
||||||
setFillParent(true);
|
setFillParent(true);
|
||||||
title.setAlignment(Align.center);
|
title.setAlignment(Align.center);
|
||||||
titleTable.row();
|
titleTable.row();
|
||||||
titleTable.add(new Image("whiteui"))
|
titleTable.add(new Image())
|
||||||
.growX().height(3f).pad(4f).get().setColor(Pal.accent);
|
.growX().height(3f).pad(4f).get().setColor(Pal.accent);
|
||||||
if(Vars.mobile){
|
if(Vars.mobile){
|
||||||
cont.row();
|
cont.row();
|
||||||
@@ -26,7 +24,7 @@ public class ControlsDialog extends KeybindDialog{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCloseButton(){
|
public void addCloseButton(){
|
||||||
buttons.addImageTextButton("$back", "icon-arrow-left", 30f, this::hide).size(230f, 64f);
|
buttons.addImageTextButton("$back", Icon.arrowLeftSmall, this::hide).size(230f, 64f);
|
||||||
|
|
||||||
keyDown(key -> {
|
keyDown(key -> {
|
||||||
if(key == KeyCode.ESCAPE || key == KeyCode.BACK)
|
if(key == KeyCode.ESCAPE || key == KeyCode.BACK)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import io.anuke.arc.scene.ui.layout.*;
|
|||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.maps.*;
|
import io.anuke.mindustry.maps.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
@@ -47,7 +48,7 @@ public class CustomGameDialog extends FloatingDialog{
|
|||||||
maps.row();
|
maps.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButton image = new ImageButton(new TextureRegion(map.texture), "clear");
|
ImageButton image = new ImageButton(new TextureRegion(map.texture), Style.clearIbutton);
|
||||||
image.margin(5);
|
image.margin(5);
|
||||||
image.top();
|
image.top();
|
||||||
|
|
||||||
@@ -59,14 +60,14 @@ public class CustomGameDialog extends FloatingDialog{
|
|||||||
t.left();
|
t.left();
|
||||||
for(Gamemode mode : Gamemode.all){
|
for(Gamemode mode : Gamemode.all){
|
||||||
if(mode.valid(map) && Core.atlas.has("icon-mode-" + mode.name())){
|
if(mode.valid(map) && Core.atlas.has("icon-mode-" + mode.name())){
|
||||||
t.addImage("icon-mode-" + mode.name()).size(16f).pad(4f);
|
t.addImage(Core.atlas.drawable("icon-mode-" + mode.name())).size(16f).pad(4f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).left();
|
}).left();
|
||||||
image.row();
|
image.row();
|
||||||
image.add(map.name()).pad(1f).growX().wrap().left().get().setEllipsis(true);
|
image.add(map.name()).pad(1f).growX().wrap().left().get().setEllipsis(true);
|
||||||
image.row();
|
image.row();
|
||||||
image.addImage("whiteui", Pal.gray).growX().pad(3).height(4f);
|
image.addImage(Tex.whiteui, Pal.gray).growX().pad(3).height(4f);
|
||||||
image.row();
|
image.row();
|
||||||
image.add(img).size(images);
|
image.add(img).size(images);
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import io.anuke.mindustry.Vars;
|
|||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.game.Content;
|
import io.anuke.mindustry.game.Content;
|
||||||
import io.anuke.mindustry.game.UnlockableContent;
|
import io.anuke.mindustry.game.UnlockableContent;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
import io.anuke.mindustry.type.ContentType;
|
import io.anuke.mindustry.type.ContentType;
|
||||||
|
|
||||||
@@ -43,7 +44,7 @@ public class DatabaseDialog extends FloatingDialog{
|
|||||||
|
|
||||||
table.add("$content." + type.name() + ".name").growX().left().color(Pal.accent);
|
table.add("$content." + type.name() + ".name").growX().left().color(Pal.accent);
|
||||||
table.row();
|
table.row();
|
||||||
table.addImage("whiteui").growX().pad(5).padLeft(0).padRight(0).height(3).color(Pal.accent);
|
table.addImage().growX().pad(5).padLeft(0).padRight(0).height(3).color(Pal.accent);
|
||||||
table.row();
|
table.row();
|
||||||
table.table(list -> {
|
table.table(list -> {
|
||||||
list.left();
|
list.left();
|
||||||
@@ -55,8 +56,8 @@ public class DatabaseDialog extends FloatingDialog{
|
|||||||
for(int i = 0; i < array.size; i++){
|
for(int i = 0; i < array.size; i++){
|
||||||
UnlockableContent unlock = (UnlockableContent)array.get(i);
|
UnlockableContent unlock = (UnlockableContent)array.get(i);
|
||||||
|
|
||||||
Image image = unlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image("icon-locked", Pal.gray);
|
Image image = unlocked(unlock) ? new Image(unlock.getContentIcon()) : new Image(Icon.lockedSmall, Pal.gray);
|
||||||
list.add(image).size(unlocked(unlock) ? 8*4 : Vars.iconsize).pad(3);
|
list.add(image).size(8*4).pad(3);
|
||||||
ClickListener listener = new ClickListener();
|
ClickListener listener = new ClickListener();
|
||||||
image.addListener(listener);
|
image.addListener(listener);
|
||||||
if(!Vars.mobile && unlocked(unlock)){
|
if(!Vars.mobile && unlocked(unlock)){
|
||||||
@@ -66,7 +67,7 @@ public class DatabaseDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(unlocked(unlock)){
|
if(unlocked(unlock)){
|
||||||
image.clicked(() -> Vars.ui.content.show(unlock));
|
image.clicked(() -> Vars.ui.content.show(unlock));
|
||||||
image.addListener(new Tooltip(t -> t.background("button").add(unlock.localizedName())));
|
image.addListener(new Tooltip(t -> t.background(Tex.button).add(unlock.localizedName())));
|
||||||
}
|
}
|
||||||
|
|
||||||
if((++count) % maxWidth == 0){
|
if((++count) % maxWidth == 0){
|
||||||
|
|||||||
@@ -17,11 +17,13 @@ import io.anuke.arc.util.*;
|
|||||||
import io.anuke.mindustry.content.*;
|
import io.anuke.mindustry.content.*;
|
||||||
import io.anuke.mindustry.core.GameState.*;
|
import io.anuke.mindustry.core.GameState.*;
|
||||||
import io.anuke.mindustry.game.Saves.*;
|
import io.anuke.mindustry.game.Saves.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.io.SaveIO.*;
|
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.TreeLayout.*;
|
import io.anuke.mindustry.ui.TreeLayout.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -33,7 +35,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
private Rectangle bounds = new Rectangle();
|
private Rectangle bounds = new Rectangle();
|
||||||
|
|
||||||
public DeployDialog(){
|
public DeployDialog(){
|
||||||
super("", "fulldialog");
|
super("", Style.fulldialogWindow);
|
||||||
|
|
||||||
ZoneNode root = new ZoneNode(Zones.groundZero, null);
|
ZoneNode root = new ZoneNode(Zones.groundZero, null);
|
||||||
|
|
||||||
@@ -45,7 +47,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
bounds.y += nodeSize*0.4f;
|
bounds.y += nodeSize*0.4f;
|
||||||
|
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
buttons.addImageTextButton("$techtree", "icon-tree", iconsize, () -> ui.tech.show()).size(230f, 64f);
|
buttons.addImageTextButton("$techtree", Icon.tree, () -> ui.tech.show()).size(230f, 64f);
|
||||||
|
|
||||||
shown(this::setup);
|
shown(this::setup);
|
||||||
}
|
}
|
||||||
@@ -85,7 +87,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
Stack sub = new Stack();
|
Stack sub = new Stack();
|
||||||
|
|
||||||
if(slot.getZone() != null){
|
if(slot.getZone() != null){
|
||||||
sub.add(new Table(f -> f.margin(4f).add(new Image("whiteui")).color(Color.fromGray(0.1f)).grow()));
|
sub.add(new Table(f -> f.margin(4f).add(new Image()).color(Color.fromGray(0.1f)).grow()));
|
||||||
|
|
||||||
sub.add(new Table(f -> f.margin(4f).add(new Image(slot.getZone().preview).setScaling(Scaling.fit)).update(img -> {
|
sub.add(new Table(f -> f.margin(4f).add(new Image(slot.getZone().preview).setScaling(Scaling.fit)).update(img -> {
|
||||||
TextureRegionDrawable draw = (TextureRegionDrawable)img.getDrawable();
|
TextureRegionDrawable draw = (TextureRegionDrawable)img.getDrawable();
|
||||||
@@ -100,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()), "square", () -> {
|
TextButton button = Elements.newButton(Core.bundle.format("resume", slot.getZone().localizedName()), Style.squareTbutton, () -> {
|
||||||
hide();
|
hide();
|
||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
logic.reset();
|
logic.reset();
|
||||||
@@ -173,10 +175,10 @@ 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("outline").width(140).growX().get().setAlignment(Align.center);
|
button.labelWrap(zone.localizedName()).style(Style.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());
|
||||||
button.row();
|
button.row();
|
||||||
flasher.accept(button.add("$locked").get());
|
flasher.accept(button.add("$locked").get());
|
||||||
}
|
}
|
||||||
@@ -199,7 +201,7 @@ public class DeployDialog extends FloatingDialog{
|
|||||||
stack.add(new Table(t -> t.margin(4f).add(new Image(node.zone.preview).setScaling(Scaling.stretch)).color(node.zone.unlocked() ? Color.DARK_GRAY : Color.fromGray(0.2f)).grow()));
|
stack.add(new Table(t -> t.margin(4f).add(new Image(node.zone.preview).setScaling(Scaling.stretch)).color(node.zone.unlocked() ? Color.DARK_GRAY : Color.fromGray(0.2f)).grow()));
|
||||||
stack.update(() -> stack.setPosition(node.x + panX + width / 2f, node.y + panY + height / 2f, Align.center));
|
stack.update(() -> stack.setPosition(node.x + panX + width / 2f, node.y + panY + height / 2f, Align.center));
|
||||||
|
|
||||||
Button button = new Button("square");
|
Button button = new Button(Tex.buttonSquare);
|
||||||
buildButton(node.zone, button);
|
buildButton(node.zone, button);
|
||||||
stack.add(button);
|
stack.add(button);
|
||||||
addChild(stack);
|
addChild(stack);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.ui.dialogs;
|
|||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.scene.ui.Dialog;
|
import io.anuke.arc.scene.ui.Dialog;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -10,7 +11,7 @@ import static io.anuke.mindustry.Vars.*;
|
|||||||
public class DiscordDialog extends Dialog{
|
public class DiscordDialog extends Dialog{
|
||||||
|
|
||||||
public DiscordDialog(){
|
public DiscordDialog(){
|
||||||
super("", "dialog");
|
super("");
|
||||||
|
|
||||||
float h = 70f;
|
float h = 70f;
|
||||||
|
|
||||||
@@ -19,17 +20,17 @@ public class DiscordDialog extends Dialog{
|
|||||||
Color color = Color.valueOf("7289da");
|
Color color = Color.valueOf("7289da");
|
||||||
|
|
||||||
cont.table(t -> {
|
cont.table(t -> {
|
||||||
t.background("button").margin(0);
|
t.background(Tex.button).margin(0);
|
||||||
|
|
||||||
t.table(img -> {
|
t.table(img -> {
|
||||||
img.addImage("whiteui").height(h - 5).width(40f).color(color);
|
img.addImage().height(h - 5).width(40f).color(color);
|
||||||
img.row();
|
img.row();
|
||||||
img.addImage("whiteui").height(5).width(40f).color(color.cpy().mul(0.8f, 0.8f, 0.8f, 1f));
|
img.addImage().height(5).width(40f).color(color.cpy().mul(0.8f, 0.8f, 0.8f, 1f));
|
||||||
}).expandY();
|
}).expandY();
|
||||||
|
|
||||||
t.table(i -> {
|
t.table(i -> {
|
||||||
i.background("button");
|
i.background(Tex.button);
|
||||||
i.addImage("icon-discord").size(iconsize);
|
i.addImage(Icon.discord);
|
||||||
}).size(h).left();
|
}).size(h).left();
|
||||||
|
|
||||||
t.add("$discord").color(Pal.accent).growX().padLeft(10f);
|
t.add("$discord").color(Pal.accent).growX().padLeft(10f);
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ import io.anuke.arc.scene.ui.*;
|
|||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.pooling.*;
|
import io.anuke.arc.util.pooling.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.platform;
|
||||||
|
|
||||||
public class FileChooser extends FloatingDialog{
|
public class FileChooser extends FloatingDialog{
|
||||||
private static final FileHandle homeDirectory = Core.files.absolute(OS.isMac ? OS.getProperty("user.home") + "/Downloads/" : Core.files.getExternalStoragePath());
|
private static final FileHandle homeDirectory = Core.files.absolute(OS.isMac ? OS.getProperty("user.home") + "/Downloads/" : Core.files.getExternalStoragePath());
|
||||||
@@ -90,10 +92,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
|
|
||||||
Table icontable = new Table();
|
Table icontable = new Table();
|
||||||
|
|
||||||
float isize = iconsize;
|
ImageButton up = new ImageButton(Icon.folderParent);
|
||||||
|
|
||||||
ImageButton up = new ImageButton("icon-folder-parent");
|
|
||||||
up.resizeImage(isize);
|
|
||||||
up.clicked(() -> {
|
up.clicked(() -> {
|
||||||
directory = directory.parent();
|
directory = directory.parent();
|
||||||
updateFiles(true);
|
updateFiles(true);
|
||||||
@@ -104,19 +103,15 @@ public class FileChooser extends FloatingDialog{
|
|||||||
up.setDisabled(true);
|
up.setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButton back = new ImageButton("icon-arrow-left");
|
ImageButton back = new ImageButton(Icon.arrowLeft);
|
||||||
back.resizeImage(isize);
|
ImageButton forward = new ImageButton(Icon.arrowRight);
|
||||||
|
|
||||||
ImageButton forward = new ImageButton("icon-arrow-right");
|
|
||||||
forward.resizeImage(isize);
|
|
||||||
|
|
||||||
forward.clicked(() -> stack.forward());
|
forward.clicked(() -> stack.forward());
|
||||||
back.clicked(() -> stack.back());
|
back.clicked(() -> stack.back());
|
||||||
forward.setDisabled(() -> !stack.canForward());
|
forward.setDisabled(() -> !stack.canForward());
|
||||||
back.setDisabled(() -> !stack.canBack());
|
back.setDisabled(() -> !stack.canBack());
|
||||||
|
|
||||||
ImageButton home = new ImageButton("icon-home");
|
ImageButton home = new ImageButton(Icon.home);
|
||||||
home.resizeImage(isize);
|
|
||||||
home.clicked(() -> {
|
home.clicked(() -> {
|
||||||
directory = homeDirectory;
|
directory = homeDirectory;
|
||||||
lastDirectory = directory;
|
lastDirectory = directory;
|
||||||
@@ -181,7 +176,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
|
|
||||||
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
||||||
|
|
||||||
layout.setText(Core.scene.skin.getFont("default"), navigation.getText());
|
layout.setText(Fonts.def, navigation.getText());
|
||||||
|
|
||||||
if(layout.width < navigation.getWidth()){
|
if(layout.width < navigation.getWidth()){
|
||||||
navigation.setCursorPosition(0);
|
navigation.setCursorPosition(0);
|
||||||
@@ -197,15 +192,15 @@ 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-folder-parent-small");
|
Image upimage = new Image(Icon.folderParentSmall);
|
||||||
TextButton upbutton = new TextButton(".." + directory.toString(), "clear-toggle");
|
TextButton upbutton = new TextButton(".." + directory.toString(), Style.clearToggleTbutton);
|
||||||
upbutton.clicked(() -> {
|
upbutton.clicked(() -> {
|
||||||
directory = directory.parent();
|
directory = directory.parent();
|
||||||
lastDirectory = directory;
|
lastDirectory = directory;
|
||||||
updateFiles(true);
|
updateFiles(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
upbutton.left().add(upimage).padRight(4f).size(iconsizesmall).padLeft(4);
|
upbutton.left().add(upimage).padRight(4f).padLeft(4);
|
||||||
upbutton.getLabel().setAlignment(Align.left);
|
upbutton.getLabel().setAlignment(Align.left);
|
||||||
upbutton.getCells().reverse();
|
upbutton.getCells().reverse();
|
||||||
|
|
||||||
@@ -221,7 +216,7 @@ public class FileChooser extends FloatingDialog{
|
|||||||
|
|
||||||
String filename = file.name();
|
String filename = file.name();
|
||||||
|
|
||||||
TextButton button = new TextButton(shorten(filename), "clear-toggle");
|
TextButton button = new TextButton(shorten(filename), Style.clearToggleTbutton);
|
||||||
group.add(button);
|
group.add(button);
|
||||||
|
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
@@ -239,9 +234,9 @@ public class FileChooser extends FloatingDialog{
|
|||||||
button.setChecked(filename.equals(filefield.getText()));
|
button.setChecked(filename.equals(filefield.getText()));
|
||||||
});
|
});
|
||||||
|
|
||||||
Image image = new Image(file.isDirectory() ? "icon-folder-small" : "icon-file-text-small");
|
Image image = new Image(file.isDirectory() ? Icon.folderSmall : Icon.fileTextSmall);
|
||||||
|
|
||||||
button.add(image).padRight(4f).padLeft(4).size(iconsizesmall);
|
button.add(image).padRight(4f).padLeft(4);
|
||||||
button.getCells().reverse();
|
button.getCells().reverse();
|
||||||
files.top().left().add(button).align(Align.topLeft).fillX().expandX()
|
files.top().left().add(button).align(Align.topLeft).fillX().expandX()
|
||||||
.height(50).pad(2).padTop(0).padBottom(0).colspan(2);
|
.height(50).pad(2).padTop(0).padBottom(0).colspan(2);
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import io.anuke.mindustry.core.GameState.*;
|
|||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
import io.anuke.mindustry.gen.*;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.*;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.net.Net;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -16,12 +15,12 @@ public class FloatingDialog extends Dialog{
|
|||||||
private boolean wasPaused;
|
private boolean wasPaused;
|
||||||
protected boolean shouldPause;
|
protected boolean shouldPause;
|
||||||
|
|
||||||
public FloatingDialog(String title, String style){
|
public FloatingDialog(String title, DialogStyle style){
|
||||||
super(title, style);
|
super(title, style);
|
||||||
setFillParent(true);
|
setFillParent(true);
|
||||||
this.title.setAlignment(Align.center);
|
this.title.setAlignment(Align.center);
|
||||||
titleTable.row();
|
titleTable.row();
|
||||||
titleTable.addImage("whiteui", Pal.accent)
|
titleTable.addImage(Tex.whiteui, Pal.accent)
|
||||||
.growX().height(3f).pad(4f);
|
.growX().height(3f).pad(4f);
|
||||||
|
|
||||||
hidden(() -> {
|
hidden(() -> {
|
||||||
@@ -42,7 +41,7 @@ public class FloatingDialog extends Dialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public FloatingDialog(String title){
|
public FloatingDialog(String title){
|
||||||
this(title, "dialog");
|
this(title, Core.scene.getStyle(DialogStyle.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onResize(Runnable run){
|
protected void onResize(Runnable run){
|
||||||
@@ -56,7 +55,7 @@ public class FloatingDialog extends Dialog{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCloseButton(){
|
public void addCloseButton(){
|
||||||
buttons.addImageTextButton("$back", "icon-arrow-left", iconsize, this::hide).size(210f, 64f);
|
buttons.addImageTextButton("$back", Icon.arrowLeft, this::hide).size(210f, 64f);
|
||||||
|
|
||||||
keyDown(key -> {
|
keyDown(key -> {
|
||||||
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){
|
if(key == KeyCode.ESCAPE || key == KeyCode.BACK){
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import io.anuke.arc.graphics.*;
|
|||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
@@ -27,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("whiteui", "clear-full", 40, () -> {
|
ImageButton button = t.addImageButton(Tex.whiteui, Style.clearFullIbutton, 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));
|
||||||
|
|||||||
@@ -6,14 +6,15 @@ import io.anuke.arc.collection.*;
|
|||||||
import io.anuke.arc.graphics.*;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.input.*;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.arc.math.*;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.scene.style.*;
|
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.net.*;
|
import io.anuke.mindustry.net.*;
|
||||||
import io.anuke.mindustry.net.Packets.*;
|
import io.anuke.mindustry.net.Packets.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -98,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(), "clear", () -> {
|
TextButton button = buttons[0] = remote.addButton("[accent]" + server.displayIP(), Style.clearTbutton, () -> {
|
||||||
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[]" +
|
||||||
@@ -117,7 +118,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
|
|
||||||
inner.add(button.getLabel()).growX();
|
inner.add(button.getLabel()).growX();
|
||||||
|
|
||||||
inner.addImageButton("icon-arrow-up-small", "empty", iconsizesmall, () -> {
|
inner.addImageButton(Icon.arrowUpSmall, Style.emptyIbutton, () -> {
|
||||||
int index = servers.indexOf(server);
|
int index = servers.indexOf(server);
|
||||||
if(index > 0){
|
if(index > 0){
|
||||||
servers.remove(index);
|
servers.remove(index);
|
||||||
@@ -136,16 +137,16 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
|
|
||||||
}).margin(3f).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton("icon-loading-small", "empty", iconsizesmall, () -> {
|
inner.addImageButton(Icon.loadingSmall, Style.emptyIbutton, () -> {
|
||||||
refreshServer(server);
|
refreshServer(server);
|
||||||
}).margin(3f).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton("icon-pencil-small", "empty", iconsizesmall, () -> {
|
inner.addImageButton(Icon.pencilSmall, Style.emptyIbutton, () -> {
|
||||||
renaming = server;
|
renaming = server;
|
||||||
add.show();
|
add.show();
|
||||||
}).margin(3f).padTop(6f).top().right();
|
}).margin(3f).padTop(6f).top().right();
|
||||||
|
|
||||||
inner.addImageButton("icon-trash-16-small", "empty", iconsizesmall, () -> {
|
inner.addImageButton(Icon.trash16Small, Style.emptyIbutton, () -> {
|
||||||
ui.showConfirm("$confirm", "$server.delete", () -> {
|
ui.showConfirm("$confirm", "$server.delete", () -> {
|
||||||
servers.removeValue(server, true);
|
servers.removeValue(server, true);
|
||||||
saveServers();
|
saveServers();
|
||||||
@@ -236,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("whiteui", "clear-full", 40, () -> {
|
ImageButton button = t.addImageButton(Tex.whiteui, Style.clearFullIbutton, 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));
|
||||||
@@ -248,7 +249,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
cont.row();
|
cont.row();
|
||||||
cont.add(pane).width(w + 38).pad(0);
|
cont.add(pane).width(w + 38).pad(0);
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.addCenteredImageTextButton("$server.add", "icon-add", iconsize, () -> {
|
cont.addCenteredImageTextButton("$server.add", Icon.add, () -> {
|
||||||
renaming = null;
|
renaming = null;
|
||||||
add.show();
|
add.show();
|
||||||
}).marginLeft(6).width(w).height(80f).update(button -> {
|
}).marginLeft(6).width(w).height(80f).update(button -> {
|
||||||
@@ -273,8 +274,8 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
totalHosts = 0;
|
totalHosts = 0;
|
||||||
|
|
||||||
local.clear();
|
local.clear();
|
||||||
local.background((Drawable)null);
|
local.background(null);
|
||||||
local.table("button", t -> t.label(() -> "[accent]" + Core.bundle.get("hosts.discovering.any") + Strings.animated(Time.time(), 4, 10f, ".")).pad(10f)).growX();
|
local.table(Tex.button, t -> t.label(() -> "[accent]" + Core.bundle.get("hosts.discovering.any") + Strings.animated(Time.time(), 4, 10f, ".")).pad(10f)).growX();
|
||||||
net.discoverServers(this::addLocalHost, this::finishLocalHosts);
|
net.discoverServers(this::addLocalHost, this::finishLocalHosts);
|
||||||
for(String host : defaultServers){
|
for(String host : defaultServers){
|
||||||
net.pingHost(host, port, this::addLocalHost, e -> {});
|
net.pingHost(host, port, this::addLocalHost, e -> {});
|
||||||
@@ -284,12 +285,12 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
void finishLocalHosts(){
|
void finishLocalHosts(){
|
||||||
if(totalHosts == 0){
|
if(totalHosts == 0){
|
||||||
local.clear();
|
local.clear();
|
||||||
local.background("button");
|
local.background(Tex.button);
|
||||||
local.add("$hosts.none").pad(10f);
|
local.add("$hosts.none").pad(10f);
|
||||||
local.add().growX();
|
local.add().growX();
|
||||||
local.addImageButton("icon-loading", iconsize, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
|
local.addImageButton(Icon.loading, this::refreshLocal).pad(-12f).padLeft(0).size(70f);
|
||||||
}else{
|
}else{
|
||||||
local.background((Drawable)null);
|
local.background(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,13 +298,13 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
if(totalHosts == 0){
|
if(totalHosts == 0){
|
||||||
local.clear();
|
local.clear();
|
||||||
}
|
}
|
||||||
local.background((Drawable)null);
|
local.background(null);
|
||||||
totalHosts++;
|
totalHosts++;
|
||||||
float w = targetWidth();
|
float w = targetWidth();
|
||||||
|
|
||||||
local.row();
|
local.row();
|
||||||
|
|
||||||
TextButton button = local.addButton("", "clear", () -> connect(host.address, port))
|
TextButton button = local.addButton("", Style.clearTbutton, () -> connect(host.address, port))
|
||||||
.width(w).pad(5f).get();
|
.width(w).pad(5f).get();
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
buildServer(host, button);
|
buildServer(host, button);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import io.anuke.arc.scene.ui.*;
|
|||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.arc.util.Log;
|
import io.anuke.arc.util.Log;
|
||||||
import io.anuke.arc.util.Strings;
|
import io.anuke.arc.util.Strings;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
@@ -29,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)), "clear-toggle");
|
TextButton button = new TextButton(Strings.capitalize(loc.getDisplayName(loc)), Style.clearToggleTbutton);
|
||||||
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());
|
||||||
|
|||||||
@@ -11,9 +11,11 @@ import io.anuke.arc.scene.ui.layout.*;
|
|||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.core.GameState.*;
|
import io.anuke.mindustry.core.GameState.*;
|
||||||
import io.anuke.mindustry.game.Saves.*;
|
import io.anuke.mindustry.game.Saves.*;
|
||||||
|
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 java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
@@ -57,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("", "clear");
|
TextButton button = new TextButton("", Style.clearTbutton);
|
||||||
button.getLabel().remove();
|
button.getLabel().remove();
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
|
|
||||||
@@ -69,45 +71,44 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
title.table(t -> {
|
title.table(t -> {
|
||||||
t.right();
|
t.right();
|
||||||
|
|
||||||
t.addImageButton("icon-floppy", "emptytoggle", iconsize, () -> {
|
t.addImageButton(Icon.floppy, Style.emptytoggleIbutton, () -> {
|
||||||
slot.setAutosave(!slot.isAutosave());
|
slot.setAutosave(!slot.isAutosave());
|
||||||
}).checked(slot.isAutosave()).right();
|
}).checked(slot.isAutosave()).right();
|
||||||
|
|
||||||
t.addImageButton("icon-trash", "empty", iconsize, () -> {
|
t.addImageButton(Icon.trash, Style.emptyIbutton, () -> {
|
||||||
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
|
ui.showConfirm("$confirm", "$save.delete.confirm", () -> {
|
||||||
slot.delete();
|
slot.delete();
|
||||||
setup();
|
setup();
|
||||||
});
|
});
|
||||||
}).size(iconsize).right();
|
}).right();
|
||||||
|
|
||||||
t.addImageButton("icon-pencil", "empty", iconsize, () -> {
|
t.addImageButton(Icon.pencil, Style.emptyIbutton, () -> {
|
||||||
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();
|
||||||
});
|
});
|
||||||
}).size(iconsize).right();
|
}).right();
|
||||||
|
|
||||||
t.addImageButton("icon-save", "empty", iconsize, () -> {
|
t.addImageButton(Icon.save, Style.emptyIbutton, () -> {
|
||||||
if(!ios){
|
if(!ios){
|
||||||
platform.showFileChooser(false, saveExtension, file -> {
|
platform.showFileChooser(false, saveExtension, file -> {
|
||||||
|
try{
|
||||||
|
slot.exportFile(file);
|
||||||
|
setup();
|
||||||
|
}catch(IOException e){
|
||||||
|
ui.showException("save.export.fail", e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
try{
|
try{
|
||||||
|
FileHandle file = Core.files.local("save-" + slot.getName() + "." + saveExtension);
|
||||||
slot.exportFile(file);
|
slot.exportFile(file);
|
||||||
setup();
|
platform.shareFile(file);
|
||||||
}catch(IOException e){
|
}catch(Exception e){
|
||||||
ui.showException("save.export.fail", e);
|
ui.showException("save.export.fail", e);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}else{
|
|
||||||
try{
|
|
||||||
FileHandle file = Core.files.local("save-" + slot.getName() + "." + saveExtension);
|
|
||||||
slot.exportFile(file);
|
|
||||||
platform.shareFile(file);
|
|
||||||
}catch(Exception e){
|
|
||||||
ui.showException("save.export.fail", e);
|
|
||||||
}
|
}
|
||||||
}
|
}).right();
|
||||||
}).size(iconsize).right();
|
|
||||||
|
|
||||||
|
|
||||||
}).padRight(-10).growX();
|
}).padRight(-10).growX();
|
||||||
}).growX().colspan(2);
|
}).growX().colspan(2);
|
||||||
@@ -169,7 +170,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(ios) return;
|
if(ios) return;
|
||||||
|
|
||||||
slots.addImageTextButton("$save.import", "icon-add", iconsize, () -> {
|
slots.addImageTextButton("$save.import", Icon.add, () -> {
|
||||||
platform.showFileChooser(true, saveExtension, file -> {
|
platform.showFileChooser(true, saveExtension, file -> {
|
||||||
if(SaveIO.isSaveValid(file)){
|
if(SaveIO.isSaveValid(file)){
|
||||||
try{
|
try{
|
||||||
|
|||||||
@@ -6,7 +6,9 @@ import io.anuke.arc.function.*;
|
|||||||
import io.anuke.arc.input.*;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.arc.scene.ui.*;
|
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.type.*;
|
import io.anuke.mindustry.type.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -44,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("", "clear", () -> {
|
TextButton button = dialog.cont.addButton("", Style.clearTbutton, () -> {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
supplier.get().add(new ItemStack(item, 0));
|
supplier.get().add(new ItemStack(item, 0));
|
||||||
updater.run();
|
updater.run();
|
||||||
@@ -67,7 +69,7 @@ public class LoadoutDialog extends FloatingDialog{
|
|||||||
}).size(210f, 64f);
|
}).size(210f, 64f);
|
||||||
|
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.addImageTextButton("$back", "icon-arrow-left", iconsize, this::hide).size(210f, 64f);
|
cont.addImageTextButton("$back", Icon.arrowLeft, this::hide).size(210f, 64f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void show(int capacity, Supplier<Array<ItemStack>> supplier, Runnable reseter, Runnable updater, Runnable hider, Predicate<Item> filter){
|
public void show(int capacity, Supplier<Array<ItemStack>> supplier, Runnable reseter, Runnable updater, Runnable hider, Predicate<Item> filter){
|
||||||
@@ -87,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", "clear-partial", () -> {
|
items.addButton("x", Style.clearPartialTbutton, () -> {
|
||||||
supplier.get().remove(stack);
|
supplier.get().remove(stack);
|
||||||
updater.run();
|
updater.run();
|
||||||
setup();
|
setup();
|
||||||
}).size(bsize);
|
}).size(bsize);
|
||||||
|
|
||||||
items.addButton("-", "clear-partial", () -> {
|
items.addButton("-", Style.clearPartialTbutton, () -> {
|
||||||
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("+", "clear-partial", () -> {
|
items.addButton("+", Style.clearPartialTbutton, () -> {
|
||||||
stack.amount = Math.min(stack.amount + step, capacity);
|
stack.amount = Math.min(stack.amount + step, capacity);
|
||||||
updater.run();
|
updater.run();
|
||||||
}).size(bsize);
|
}).size(bsize);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import io.anuke.arc.scene.ui.*;
|
|||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.game.*;
|
import io.anuke.mindustry.game.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.maps.*;
|
import io.anuke.mindustry.maps.*;
|
||||||
import io.anuke.mindustry.ui.*;
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
@@ -55,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(), "toggle", () -> {
|
modes.addButton(mode.toString(), Style.toggleTbutton, () -> {
|
||||||
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));
|
||||||
@@ -66,7 +67,7 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
|
|
||||||
cont.add(selmode);
|
cont.add(selmode);
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.addImageTextButton("$customize", "icon-tools-small", iconsizesmall, () -> dialog.show(rules, () -> rules = map.applyRules(selectedGamemode))).width(230);
|
cont.addImageTextButton("$customize", Icon.toolsSmall, () -> dialog.show(rules, () -> rules = map.applyRules(selectedGamemode))).width(230);
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.add(new BorderImage(map.texture, 3f)).size(mobile && !Core.graphics.isPortrait() ? 150f : 250f).get().setScaling(Scaling.fit);
|
cont.add(new BorderImage(map.texture, 3f)).size(mobile && !Core.graphics.isPortrait() ? 150f : 250f).get().setScaling(Scaling.fit);
|
||||||
//only maps with survival are valid for high scores
|
//only maps with survival are valid for high scores
|
||||||
@@ -78,7 +79,7 @@ public class MapPlayDialog extends FloatingDialog{
|
|||||||
buttons.clearChildren();
|
buttons.clearChildren();
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
|
|
||||||
buttons.addImageTextButton("$play", "icon-play", iconsize, () -> {
|
buttons.addImageTextButton("$play", Icon.play, () -> {
|
||||||
control.playMap(map, rules);
|
control.playMap(map, rules);
|
||||||
hide();
|
hide();
|
||||||
ui.custom.hide();
|
ui.custom.hide();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import io.anuke.arc.scene.ui.*;
|
|||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
|
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.*;
|
||||||
@@ -43,13 +44,13 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
buttons.clearChildren();
|
buttons.clearChildren();
|
||||||
|
|
||||||
if(Core.graphics.isPortrait() && !ios){
|
if(Core.graphics.isPortrait() && !ios){
|
||||||
buttons.addImageTextButton("$back", "icon-arrow-left", iconsize, this::hide).size(210f*2f, 64f).colspan(2);
|
buttons.addImageTextButton("$back", Icon.arrowLeft, this::hide).size(210f*2f, 64f).colspan(2);
|
||||||
buttons.row();
|
buttons.row();
|
||||||
}else{
|
}else{
|
||||||
buttons.addImageTextButton("$back", "icon-arrow-left", iconsize, this::hide).size(210f, 64f);
|
buttons.addImageTextButton("$back", Icon.arrowLeft, this::hide).size(210f, 64f);
|
||||||
}
|
}
|
||||||
|
|
||||||
buttons.addImageTextButton("$editor.newmap", "icon-add", iconsize, () -> {
|
buttons.addImageTextButton("$editor.newmap", Icon.add, () -> {
|
||||||
ui.showTextInput("$editor.newmap", "$name", "", text -> {
|
ui.showTextInput("$editor.newmap", "$name", "", text -> {
|
||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
hide();
|
hide();
|
||||||
@@ -60,7 +61,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
}).size(210f, 64f);
|
}).size(210f, 64f);
|
||||||
|
|
||||||
if(!ios){
|
if(!ios){
|
||||||
buttons.addImageTextButton("$editor.importmap", "icon-load", iconsize, () -> {
|
buttons.addImageTextButton("$editor.importmap", Icon.load, () -> {
|
||||||
platform.showFileChooser(true, mapExtension, file -> {
|
platform.showFileChooser(true, mapExtension, file -> {
|
||||||
ui.loadAnd(() -> {
|
ui.loadAnd(() -> {
|
||||||
maps.tryCatchMapError(() -> {
|
maps.tryCatchMapError(() -> {
|
||||||
@@ -127,12 +128,12 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
maps.row();
|
maps.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
TextButton button = maps.addButton("", "clear", () -> showMapInfo(map)).width(mapsize).pad(8).get();
|
TextButton button = maps.addButton("", Style.clearTbutton, () -> 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);
|
||||||
button.row();
|
button.row();
|
||||||
button.addImage("whiteui").growX().pad(4).color(Pal.gray);
|
button.addImage().growX().pad(4).color(Pal.gray);
|
||||||
button.row();
|
button.row();
|
||||||
button.stack(new Image(map.texture).setScaling(Scaling.fit), new BorderImage(map.texture).setScaling(Scaling.fit)).size(mapsize - 20f);
|
button.stack(new Image(map.texture).setScaling(Scaling.fit), new BorderImage(map.texture).setScaling(Scaling.fit)).size(mapsize - 20f);
|
||||||
button.row();
|
button.row();
|
||||||
@@ -159,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("flat", desc -> {
|
table.table(Style.flat, desc -> {
|
||||||
desc.top();
|
desc.top();
|
||||||
Table t = new Table();
|
Table t = new Table();
|
||||||
t.margin(6);
|
t.margin(6);
|
||||||
@@ -185,7 +186,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.addImageTextButton("$editor.openin", "icon-load-map-small", iconsizesmall, () -> {
|
table.addImageTextButton("$editor.openin", Icon.loadMapSmall, () -> {
|
||||||
try{
|
try{
|
||||||
Vars.ui.editor.beginEditMap(map.file);
|
Vars.ui.editor.beginEditMap(map.file);
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
@@ -196,7 +197,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
}).fillX().height(54f).marginLeft(10);
|
}).fillX().height(54f).marginLeft(10);
|
||||||
|
|
||||||
table.addImageTextButton("$delete", "icon-trash-16-small", iconsizesmall, () -> {
|
table.addImageTextButton("$delete", Icon.trash16Small, () -> {
|
||||||
ui.showConfirm("$confirm", Core.bundle.format("map.delete", map.name()), () -> {
|
ui.showConfirm("$confirm", Core.bundle.format("map.delete", map.name()), () -> {
|
||||||
maps.removeMap(map);
|
maps.removeMap(map);
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import io.anuke.arc.graphics.g2d.*;
|
|||||||
import io.anuke.arc.input.*;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.arc.scene.event.*;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.renderer;
|
import static io.anuke.mindustry.Vars.renderer;
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ public class MinimapDialog extends FloatingDialog{
|
|||||||
void setup(){
|
void setup(){
|
||||||
cont.clearChildren();
|
cont.clearChildren();
|
||||||
|
|
||||||
cont.table("pane", t -> {
|
cont.table(Tex.pane,t -> {
|
||||||
t.addRect((x, y, width, height) -> {
|
t.addRect((x, y, width, height) -> {
|
||||||
if(renderer.minimap.getRegion() == null) return;
|
if(renderer.minimap.getRegion() == null) return;
|
||||||
Draw.color(Color.WHITE);
|
Draw.color(Color.WHITE);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.ui.dialogs;
|
|||||||
import io.anuke.arc.*;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.input.*;
|
import io.anuke.arc.input.*;
|
||||||
import io.anuke.mindustry.core.GameState.*;
|
import io.anuke.mindustry.core.GameState.*;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -71,24 +72,22 @@ public class PausedDialog extends FloatingDialog{
|
|||||||
|
|
||||||
}else{
|
}else{
|
||||||
cont.defaults().size(120f).pad(5);
|
cont.defaults().size(120f).pad(5);
|
||||||
float isize = iconsize;
|
cont.addRowImageTextButton("$back", Icon.play2, this::hide);
|
||||||
|
cont.addRowImageTextButton("$settings", Icon.tools, ui.settings::show);
|
||||||
cont.addRowImageTextButton("$back", "icon-play-2", isize, this::hide);
|
|
||||||
cont.addRowImageTextButton("$settings", "icon-tools", isize, ui.settings::show);
|
|
||||||
|
|
||||||
if(!world.isZone() && !state.isEditor()){
|
if(!world.isZone() && !state.isEditor()){
|
||||||
cont.addRowImageTextButton("$save", "icon-save", isize, save::show);
|
cont.addRowImageTextButton("$save", Icon.save, save::show);
|
||||||
|
|
||||||
cont.row();
|
cont.row();
|
||||||
|
|
||||||
cont.addRowImageTextButton("$load", "icon-load", isize, load::show).disabled(b -> net.active());
|
cont.addRowImageTextButton("$load", Icon.load, load::show).disabled(b -> net.active());
|
||||||
}else{
|
}else{
|
||||||
cont.row();
|
cont.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
cont.addRowImageTextButton("$hostserver.mobile", "icon-host", isize, ui.host::show).disabled(b -> net.active());
|
cont.addRowImageTextButton("$hostserver.mobile", Icon.host, ui.host::show).disabled(b -> net.active());
|
||||||
|
|
||||||
cont.addRowImageTextButton("$quit", "icon-quit", isize, this::showQuitConfirm);
|
cont.addRowImageTextButton("$quit", Icon.quit, this::showQuitConfirm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import io.anuke.arc.scene.ui.TextButton;
|
|||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.game.Saves.SaveSlot;
|
import io.anuke.mindustry.game.Saves.SaveSlot;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ public class SaveDialog extends LoadDialog{
|
|||||||
|
|
||||||
public void addSetup(){
|
public void addSetup(){
|
||||||
slots.row();
|
slots.row();
|
||||||
slots.addImageTextButton("$save.new", "icon-add", 14 * 3, () ->
|
slots.addImageTextButton("$save.new", Icon.add, () ->
|
||||||
ui.showTextInput("$save", "$save.newslot", 30, "", text -> {
|
ui.showTextInput("$save", "$save.newslot", 30, "", text -> {
|
||||||
ui.loadAnd("$saving", () -> {
|
ui.loadAnd("$saving", () -> {
|
||||||
control.saves.addSave(text);
|
control.saves.addSave(text);
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ import io.anuke.arc.scene.*;
|
|||||||
import io.anuke.arc.scene.event.*;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.SettingsDialog.SettingsTable.*;
|
import io.anuke.arc.scene.ui.SettingsDialog.SettingsTable.*;
|
||||||
|
import io.anuke.arc.scene.ui.TextButton.*;
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.core.GameState.*;
|
import io.anuke.mindustry.core.GameState.*;
|
||||||
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 static io.anuke.arc.Core.bundle;
|
import static io.anuke.arc.Core.bundle;
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -30,8 +32,6 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
private boolean wasPaused;
|
private boolean wasPaused;
|
||||||
|
|
||||||
public SettingsMenuDialog(){
|
public SettingsMenuDialog(){
|
||||||
setStyle(Core.scene.skin.get("dialog", WindowStyle.class));
|
|
||||||
|
|
||||||
hidden(() -> {
|
hidden(() -> {
|
||||||
Sounds.back.play();
|
Sounds.back.play();
|
||||||
if(!state.is(State.menu)){
|
if(!state.is(State.menu)){
|
||||||
@@ -53,13 +53,13 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
setFillParent(true);
|
setFillParent(true);
|
||||||
title.setAlignment(Align.center);
|
title.setAlignment(Align.center);
|
||||||
titleTable.row();
|
titleTable.row();
|
||||||
titleTable.add(new Image("whiteui")).growX().height(3f).pad(4f).get().setColor(Pal.accent);
|
titleTable.add(new Image()).growX().height(3f).pad(4f).get().setColor(Pal.accent);
|
||||||
|
|
||||||
cont.clearChildren();
|
cont.clearChildren();
|
||||||
cont.remove();
|
cont.remove();
|
||||||
buttons.remove();
|
buttons.remove();
|
||||||
|
|
||||||
menu = new Table("button");
|
menu = new Table(Tex.button);
|
||||||
|
|
||||||
game = new SettingsTable();
|
game = new SettingsTable();
|
||||||
graphics = new SettingsTable();
|
graphics = new SettingsTable();
|
||||||
@@ -77,9 +77,9 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
dataDialog = new FloatingDialog("$settings.data");
|
dataDialog = new FloatingDialog("$settings.data");
|
||||||
dataDialog.addCloseButton();
|
dataDialog.addCloseButton();
|
||||||
|
|
||||||
dataDialog.cont.table("button", t -> {
|
dataDialog.cont.table(Tex.button, t -> {
|
||||||
t.defaults().size(240f, 60f).left();
|
t.defaults().size(240f, 60f).left();
|
||||||
String style = "clear";
|
TextButtonStyle style = Style.clearTbutton;
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
String style = "clear";
|
TextButtonStyle style = Style.clearTbutton;
|
||||||
|
|
||||||
menu.defaults().size(300f, 60f);
|
menu.defaults().size(300f, 60f);
|
||||||
menu.addButton("$settings.game", style, () -> visible(0));
|
menu.addButton("$settings.game", style, () -> visible(0));
|
||||||
@@ -317,7 +317,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCloseButton(){
|
public void addCloseButton(){
|
||||||
buttons.addImageTextButton("$back", "icon-arrow-left", 30f, () -> {
|
buttons.addImageTextButton("$back", Icon.arrowLeftSmaller, () -> {
|
||||||
if(prefs.getChildren().first() != menu){
|
if(prefs.getChildren().first() != menu){
|
||||||
back();
|
back();
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ 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.TreeLayout.*;
|
import io.anuke.mindustry.ui.TreeLayout.*;
|
||||||
import io.anuke.mindustry.world.Block.*;
|
import io.anuke.mindustry.world.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -47,7 +48,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
|
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
|
|
||||||
buttons.addImageTextButton("$database", "icon-database", iconsize, () -> {
|
buttons.addImageTextButton("$database", Icon.database, () -> {
|
||||||
hide();
|
hide();
|
||||||
ui.database.show();
|
ui.database.show();
|
||||||
}).size(210f, 64f);
|
}).size(210f, 64f);
|
||||||
@@ -142,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(Icon.medium), "node");
|
ImageButton button = new ImageButton(node.node.block.icon(Block.Icon.medium), Style.nodeIbutton);
|
||||||
button.visible(() -> node.visible);
|
button.visible(() -> node.visible);
|
||||||
button.clicked(() -> {
|
button.clicked(() -> {
|
||||||
if(mobile){
|
if(mobile){
|
||||||
@@ -186,9 +187,9 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
button.update(() -> {
|
button.update(() -> {
|
||||||
float offset = (Core.graphics.getHeight() % 2) / 2f;
|
float offset = (Core.graphics.getHeight() % 2) / 2f;
|
||||||
button.setPosition(node.x + panX + width / 2f, node.y + panY + height / 2f + offset, Align.center);
|
button.setPosition(node.x + panX + width / 2f, node.y + panY + height / 2f + offset, Align.center);
|
||||||
button.getStyle().up = Core.scene.skin.getDrawable(!locked(node.node) ? "button-over" : !data.hasItems(node.node.requirements) ? "button-red" : "button");
|
button.getStyle().up = !locked(node.node) ? Tex.buttonOver : !data.hasItems(node.node.requirements) ? Tex.buttonRed : Tex.button;
|
||||||
((TextureRegionDrawable)button.getStyle().imageUp)
|
((TextureRegionDrawable)button.getStyle().imageUp)
|
||||||
.setRegion(node.visible ? node.node.block.icon(Icon.medium) : Core.atlas.find("icon-locked"));
|
.setRegion(node.visible ? node.node.block.icon(Block.Icon.medium) : Core.atlas.find("icon-locked"));
|
||||||
button.getImage().setColor(!locked(node.node) ? Color.WHITE : Color.GRAY);
|
button.getImage().setColor(!locked(node.node) ? Color.WHITE : Color.GRAY);
|
||||||
});
|
});
|
||||||
addChild(button);
|
addChild(button);
|
||||||
@@ -257,12 +258,12 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
infoTable.update(() -> infoTable.setPosition(button.getX() + button.getWidth(), button.getY() + button.getHeight(), Align.topLeft));
|
infoTable.update(() -> infoTable.setPosition(button.getX() + button.getWidth(), button.getY() + button.getHeight(), Align.topLeft));
|
||||||
|
|
||||||
infoTable.left();
|
infoTable.left();
|
||||||
infoTable.background("button").margin(8f);
|
infoTable.background(Tex.button).margin(8f);
|
||||||
|
|
||||||
infoTable.table(b -> {
|
infoTable.table(b -> {
|
||||||
b.margin(0).left().defaults().left();
|
b.margin(0).left().defaults().left();
|
||||||
|
|
||||||
b.addImageButton("icon-info-small", "clear", iconsizesmall, () -> ui.content.show(node.block)).growY().width(50f);
|
b.addImageButton(Icon.infoSmall, Style.clearIbutton, () -> 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();
|
||||||
@@ -289,7 +290,7 @@ public class TechTreeDialog extends FloatingDialog{
|
|||||||
|
|
||||||
if(mobile && locked(node)){
|
if(mobile && locked(node)){
|
||||||
b.row();
|
b.row();
|
||||||
b.addImageTextButton("$research", "icon-check-small", "node", iconsizesmall, () -> unlock(node))
|
b.addImageTextButton("$research", Icon.checkSmall, Style.nodeTbutton, () -> unlock(node))
|
||||||
.disabled(i -> !data.hasItems(node.requirements)).growX().height(44f).colspan(3);
|
.disabled(i -> !data.hasItems(node.requirements)).growX().height(44f).colspan(3);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.ui.dialogs;
|
|||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.entities.type.Player;
|
import io.anuke.mindustry.entities.type.Player;
|
||||||
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.net.Administration.TraceInfo;
|
import io.anuke.mindustry.net.Administration.TraceInfo;
|
||||||
|
|
||||||
public class TraceDialog extends FloatingDialog{
|
public class TraceDialog extends FloatingDialog{
|
||||||
@@ -17,7 +18,7 @@ public class TraceDialog extends FloatingDialog{
|
|||||||
public void show(Player player, TraceInfo info){
|
public void show(Player player, TraceInfo info){
|
||||||
cont.clear();
|
cont.clear();
|
||||||
|
|
||||||
Table table = new Table("clear");
|
Table table = new Table(Tex.clear);
|
||||||
table.margin(14);
|
table.margin(14);
|
||||||
table.defaults().pad(1);
|
table.defaults().pad(1);
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import io.anuke.mindustry.graphics.*;
|
|||||||
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.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.Block.*;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -55,7 +54,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
|
|
||||||
cont.pane(cont -> {
|
cont.pane(cont -> {
|
||||||
if(zone.locked()){
|
if(zone.locked()){
|
||||||
cont.addImage("icon-locked");
|
cont.addImage(Icon.locked);
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.add("$locked").padBottom(6);
|
cont.add("$locked").padBottom(6);
|
||||||
cont.row();
|
cont.row();
|
||||||
@@ -68,9 +67,9 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
r.add("$complete").colspan(2).left();
|
r.add("$complete").colspan(2).left();
|
||||||
r.row();
|
r.row();
|
||||||
for(ZoneRequirement other : zone.zoneRequirements){
|
for(ZoneRequirement other : zone.zoneRequirements){
|
||||||
r.addImage("icon-terrain").padRight(4);
|
r.addImage(Icon.terrain).padRight(4);
|
||||||
r.add(Core.bundle.format("zone.requirement", other.wave, other.zone.localizedName())).color(Color.LIGHT_GRAY);
|
r.add(Core.bundle.format("zone.requirement", other.wave, other.zone.localizedName())).color(Color.LIGHT_GRAY);
|
||||||
r.addImage(other.zone.bestWave() >= other.wave ? "icon-check-small" : "icon-cancel-small", other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
r.addImage(other.zone.bestWave() >= other.wave ? Icon.checkSmall : Icon.cancelSmall, other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
||||||
r.row();
|
r.row();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -83,9 +82,9 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
r.add("$research.list").colspan(2).left();
|
r.add("$research.list").colspan(2).left();
|
||||||
r.row();
|
r.row();
|
||||||
for(Block block : zone.blockRequirements){
|
for(Block block : zone.blockRequirements){
|
||||||
r.addImage(block.icon(Icon.small)).size(8 * 3).padRight(4);
|
r.addImage(block.icon(Block.Icon.small)).size(8 * 3).padRight(4);
|
||||||
r.add(block.localizedName).color(Color.LIGHT_GRAY);
|
r.add(block.localizedName).color(Color.LIGHT_GRAY);
|
||||||
r.addImage(data.isUnlocked(block) ? "icon-check-small" : "icon-cancel-small", data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
r.addImage(data.isUnlocked(block) ? Icon.checkSmall : Icon.cancelSmall, data.isUnlocked(block) ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3);
|
||||||
r.row();
|
r.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +95,7 @@ public class ZoneInfoDialog extends FloatingDialog{
|
|||||||
}else{
|
}else{
|
||||||
cont.add(zone.localizedName()).color(Pal.accent).growX().center();
|
cont.add(zone.localizedName()).color(Pal.accent).growX().center();
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.addImage("whiteui").color(Pal.accent).height(3).pad(6).growX();
|
cont.addImage().color(Pal.accent).height(3).pad(6).growX();
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.table(desc -> {
|
cont.table(desc -> {
|
||||||
desc.left().defaults().left().width(Core.graphics.isPortrait() ? 350f : 500f);
|
desc.left().defaults().left().width(Core.graphics.isPortrait() ? 350f : 500f);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import io.anuke.arc.util.*;
|
|||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.entities.type.Player;
|
import io.anuke.mindustry.entities.type.Player;
|
||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
import io.anuke.mindustry.gen.Call;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.type.Item;
|
||||||
import io.anuke.mindustry.type.Item.Icon;
|
import io.anuke.mindustry.type.Item.Icon;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
@@ -88,7 +88,7 @@ public class BlockInventoryFragment extends Fragment{
|
|||||||
|
|
||||||
table.clearChildren();
|
table.clearChildren();
|
||||||
table.clearActions();
|
table.clearActions();
|
||||||
table.background("inventory");
|
table.background(Tex.inventory);
|
||||||
table.touchable(Touchable.enabled);
|
table.touchable(Touchable.enabled);
|
||||||
table.update(() -> {
|
table.update(() -> {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import io.anuke.arc.util.*;
|
|||||||
import io.anuke.mindustry.*;
|
import io.anuke.mindustry.*;
|
||||||
import io.anuke.mindustry.gen.*;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.input.*;
|
import io.anuke.mindustry.input.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
import static io.anuke.arc.Core.*;
|
import static io.anuke.arc.Core.*;
|
||||||
import static io.anuke.mindustry.Vars.net;
|
import static io.anuke.mindustry.Vars.net;
|
||||||
@@ -45,7 +46,7 @@ public class ChatFragment extends Table{
|
|||||||
super();
|
super();
|
||||||
|
|
||||||
setFillParent(true);
|
setFillParent(true);
|
||||||
font = scene.skin.getFont("default");
|
font = Fonts.def;
|
||||||
|
|
||||||
visible(() -> {
|
visible(() -> {
|
||||||
if(!net.active() && messages.size > 0){
|
if(!net.active() && messages.size > 0){
|
||||||
@@ -98,10 +99,10 @@ public class ChatFragment extends Table{
|
|||||||
fieldlabel.getStyle().font = font;
|
fieldlabel.getStyle().font = font;
|
||||||
fieldlabel.setStyle(fieldlabel.getStyle());
|
fieldlabel.setStyle(fieldlabel.getStyle());
|
||||||
|
|
||||||
chatfield = new TextField("", new TextField.TextFieldStyle(scene.skin.get(TextField.TextFieldStyle.class)));
|
chatfield = new TextField("", new TextField.TextFieldStyle(scene.getStyle(TextField.TextFieldStyle.class)));
|
||||||
chatfield.setFilter((field, c) -> field.getText().length() < Vars.maxTextLength);
|
chatfield.setFilter((field, c) -> field.getText().length() < Vars.maxTextLength);
|
||||||
chatfield.getStyle().background = null;
|
chatfield.getStyle().background = null;
|
||||||
chatfield.getStyle().font = scene.skin.getFont("chat");
|
chatfield.getStyle().font = Fonts.chat;
|
||||||
chatfield.getStyle().fontColor = Color.WHITE;
|
chatfield.getStyle().fontColor = Color.WHITE;
|
||||||
chatfield.setStyle(chatfield.getStyle());
|
chatfield.setStyle(chatfield.getStyle());
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import io.anuke.arc.scene.actions.*;
|
|||||||
import io.anuke.arc.scene.event.*;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.style.*;
|
import io.anuke.arc.scene.style.*;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
|
import io.anuke.arc.scene.ui.ImageButton.*;
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.core.GameState.*;
|
import io.anuke.mindustry.core.GameState.*;
|
||||||
@@ -26,6 +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.dialogs.*;
|
import io.anuke.mindustry.ui.dialogs.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
@@ -59,12 +61,12 @@ public class HudFragment extends Fragment{
|
|||||||
select.left();
|
select.left();
|
||||||
select.defaults().size(dsize).left();
|
select.defaults().size(dsize).left();
|
||||||
|
|
||||||
String style = "clear-trans";
|
ImageButtonStyle style = Style.clearTransIbutton;
|
||||||
|
|
||||||
select.addImageButton("icon-menu-large", style, iconsize, ui.paused::show);
|
select.addImageButton(Icon.menuLarge, style, ui.paused::show);
|
||||||
flip = select.addImageButton("icon-arrow-up", style, iconsize, this::toggleMenus).get();
|
flip = select.addImageButton(Icon.arrowUp, style, this::toggleMenus).get();
|
||||||
|
|
||||||
select.addImageButton("icon-pause", style, iconsize, () -> {
|
select.addImageButton(Icon.pause, style, () -> {
|
||||||
if(net.active()){
|
if(net.active()){
|
||||||
ui.listfrag.toggle();
|
ui.listfrag.toggle();
|
||||||
}else{
|
}else{
|
||||||
@@ -72,14 +74,14 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
}).name("pause").update(i -> {
|
}).name("pause").update(i -> {
|
||||||
if(net.active()){
|
if(net.active()){
|
||||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-players");
|
i.getStyle().imageUp = Icon.players;
|
||||||
}else{
|
}else{
|
||||||
i.setDisabled(false);
|
i.setDisabled(false);
|
||||||
i.getStyle().imageUp = Core.scene.skin.getDrawable(state.is(State.paused) ? "icon-play" : "icon-pause");
|
i.getStyle().imageUp = state.is(State.paused) ? Icon.play : Icon.pause;
|
||||||
}
|
}
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
select.addImageButton("icon-settings", style, iconsize, () -> {
|
select.addImageButton(Icon.settings, style,() -> {
|
||||||
if(net.active() && mobile){
|
if(net.active() && mobile){
|
||||||
if(ui.chatfrag.chatOpen()){
|
if(ui.chatfrag.chatOpen()){
|
||||||
ui.chatfrag.hide();
|
ui.chatfrag.hide();
|
||||||
@@ -93,13 +95,13 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
}).update(i -> {
|
}).update(i -> {
|
||||||
if(net.active() && mobile){
|
if(net.active() && mobile){
|
||||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-chat");
|
i.getStyle().imageUp = Icon.chat;
|
||||||
}else{
|
}else{
|
||||||
i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-database");
|
i.getStyle().imageUp = Icon.database;
|
||||||
}
|
}
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
select.addImage("whiteui").color(Pal.gray).width(4f).fillY();
|
select.addImage().color(Pal.gray).width(4f).fillY();
|
||||||
|
|
||||||
float size = UnitScl.dp.scl(dsize);
|
float size = UnitScl.dp.scl(dsize);
|
||||||
Array<Element> children = new Array<>(select.getChildren());
|
Array<Element> children = new Array<>(select.getChildren());
|
||||||
@@ -124,7 +126,7 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
cont.row();
|
cont.row();
|
||||||
cont.addImage("whiteui").height(4f).color(Pal.gray).fillX();
|
cont.addImage().height(4f).color(Pal.gray).fillX();
|
||||||
cont.row();
|
cont.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,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("wave");
|
Button waves = new Button(Style.waveButton);
|
||||||
Table btable = new Table().margin(0);
|
Table btable = new Table().margin(0);
|
||||||
|
|
||||||
stack.add(waves);
|
stack.add(waves);
|
||||||
@@ -152,13 +154,13 @@ public class HudFragment extends Fragment{
|
|||||||
addPlayButton(btable);
|
addPlayButton(btable);
|
||||||
wavesMain.add(stack).width(dsize * 4 + 4f);
|
wavesMain.add(stack).width(dsize * 4 + 4f);
|
||||||
wavesMain.row();
|
wavesMain.row();
|
||||||
wavesMain.table("button", t -> t.margin(10f).add(new Bar("boss.health", Pal.health, () -> state.boss() == null ? 0f : state.boss().healthf()).blink(Color.WHITE))
|
wavesMain.table(Tex.button, t -> t.margin(10f).add(new Bar("boss.health", Pal.health, () -> state.boss() == null ? 0f : state.boss().healthf()).blink(Color.WHITE))
|
||||||
.grow()).fillX().visible(() -> state.rules.waves && state.boss() != null).height(60f).get();
|
.grow()).fillX().visible(() -> state.rules.waves && state.boss() != null).height(60f).get();
|
||||||
wavesMain.row();
|
wavesMain.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
editorMain.table("button-edge-4", t -> {
|
editorMain.table(Tex.buttonEdge4, t -> {
|
||||||
//t.margin(0f);
|
//t.margin(0f);
|
||||||
t.add("$editor.teams").growX().left();
|
t.add("$editor.teams").growX().left();
|
||||||
t.row();
|
t.row();
|
||||||
@@ -166,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("white", "clear-toggle-partial", 40f, () -> Call.setPlayerTeamEditor(player, team))
|
ImageButton button = teams.addImageButton(Tex.whiteui, Style.clearTogglePartialIbutton, 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;
|
||||||
@@ -181,11 +183,11 @@ public class HudFragment extends Fragment{
|
|||||||
if(enableUnitEditing){
|
if(enableUnitEditing){
|
||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
t.addImageTextButton("$editor.spawn", "icon-add", iconsize, () -> {
|
t.addImageTextButton("$editor.spawn", Icon.add, () -> {
|
||||||
FloatingDialog dialog = new FloatingDialog("$editor.spawn");
|
FloatingDialog dialog = new FloatingDialog("$editor.spawn");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(UnitType type : content.<UnitType>getBy(ContentType.unit)){
|
for(UnitType type : content.<UnitType>getBy(ContentType.unit)){
|
||||||
dialog.cont.addImageButton("white", 48, () -> {
|
dialog.cont.addImageButton(Tex.whiteui, 48, () -> {
|
||||||
Call.spawnUnitEditor(player, type);
|
Call.spawnUnitEditor(player, type);
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
}).get().getStyle().imageUp = new TextureRegionDrawable(type.iconRegion);
|
}).get().getStyle().imageUp = new TextureRegionDrawable(type.iconRegion);
|
||||||
@@ -200,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", "toggle", iconsize, () -> {}).fillX().update(b -> {
|
t.addImageTextButton("$editor.removeunit", Icon.quit, Style.toggleTbutton, () -> {}).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);
|
||||||
@@ -241,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("outline");
|
info.label(() -> fps.get(Core.graphics.getFramesPerSecond())).left().style(Style.outlineLabel);
|
||||||
info.row();
|
info.row();
|
||||||
info.label(() -> ping.get(netClient.getPing())).visible(net::client).left().style("outline");
|
info.label(() -> ping.get(netClient.getPing())).visible(net::client).left().style(Style.outlineLabel);
|
||||||
}).top().left();
|
}).top().left();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -253,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("flat", c -> c.add("$nearpoint")
|
t.table(Style.flat, 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;
|
||||||
@@ -261,7 +263,7 @@ public class HudFragment extends Fragment{
|
|||||||
|
|
||||||
parent.fill(t -> {
|
parent.fill(t -> {
|
||||||
t.visible(() -> netServer.isWaitingForPlayers());
|
t.visible(() -> netServer.isWaitingForPlayers());
|
||||||
t.table("button", c -> c.add("$waiting.players"));
|
t.table(Tex.button, c -> c.add("$waiting.players"));
|
||||||
});
|
});
|
||||||
|
|
||||||
//'core is under attack' table
|
//'core is under attack' table
|
||||||
@@ -307,7 +309,7 @@ public class HudFragment extends Fragment{
|
|||||||
|
|
||||||
return coreAttackOpacity > 0;
|
return coreAttackOpacity > 0;
|
||||||
});
|
});
|
||||||
t.table("button", top -> top.add("$coreattack").pad(2)
|
t.table(Tex.button, top -> top.add("$coreattack").pad(2)
|
||||||
.update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
|
.update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -316,14 +318,14 @@ public class HudFragment extends Fragment{
|
|||||||
Runnable resize = () -> {
|
Runnable resize = () -> {
|
||||||
t.clearChildren();
|
t.clearChildren();
|
||||||
t.top().right().visible(() -> state.rules.tutorial);
|
t.top().right().visible(() -> state.rules.tutorial);
|
||||||
t.stack(new Button("default"){{
|
t.stack(new Button(){{
|
||||||
marginLeft(48f);
|
marginLeft(48f);
|
||||||
labelWrap(() -> control.tutorial.stage.text() + (control.tutorial.canNext() ? "\n\n" + Core.bundle.get("tutorial.next") : "")).width(!Core.graphics.isPortrait() ? 400f : 160f).pad(2f);
|
labelWrap(() -> control.tutorial.stage.text() + (control.tutorial.canNext() ? "\n\n" + Core.bundle.get("tutorial.next") : "")).width(!Core.graphics.isPortrait() ? 400f : 160f).pad(2f);
|
||||||
clicked(() -> control.tutorial.nextSentence());
|
clicked(() -> control.tutorial.nextSentence());
|
||||||
setDisabled(() -> !control.tutorial.canNext());
|
setDisabled(() -> !control.tutorial.canNext());
|
||||||
}},
|
}},
|
||||||
new Table(f -> {
|
new Table(f -> {
|
||||||
f.left().addImageButton("icon-arrow-left-small", "empty", iconsizesmall, () -> {
|
f.left().addImageButton(Icon.arrowLeftSmall, Style.emptyIbutton, () -> {
|
||||||
control.tutorial.prevSentence();
|
control.tutorial.prevSentence();
|
||||||
}).width(44f).growY().visible(() -> control.tutorial.canPrev());
|
}).width(44f).growY().visible(() -> control.tutorial.canPrev());
|
||||||
}));
|
}));
|
||||||
@@ -336,13 +338,13 @@ public class HudFragment extends Fragment{
|
|||||||
//paused table
|
//paused table
|
||||||
parent.fill(t -> {
|
parent.fill(t -> {
|
||||||
t.top().visible(() -> state.isPaused()).touchable(Touchable.disabled);
|
t.top().visible(() -> state.isPaused()).touchable(Touchable.disabled);
|
||||||
t.table("button-trans", top -> top.add("$paused").pad(5f));
|
t.table(Tex.buttonTrans, top -> top.add("$paused").pad(5f));
|
||||||
});
|
});
|
||||||
|
|
||||||
//'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("outline");
|
t.add("$saveload").style(Style.outlineLabel);
|
||||||
});
|
});
|
||||||
|
|
||||||
blockfrag.build(parent);
|
blockfrag.build(parent);
|
||||||
@@ -390,14 +392,14 @@ public class HudFragment extends Fragment{
|
|||||||
scheduleToast(() -> {
|
scheduleToast(() -> {
|
||||||
Sounds.message.play();
|
Sounds.message.play();
|
||||||
|
|
||||||
Table table = new Table("button");
|
Table table = new Table(Tex.button);
|
||||||
table.update(() -> {
|
table.update(() -> {
|
||||||
if(state.is(State.menu)){
|
if(state.is(State.menu)){
|
||||||
table.remove();
|
table.remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
table.margin(12);
|
table.margin(12);
|
||||||
table.addImage("icon-check").size(iconsize).pad(3);
|
table.addImage(Icon.check).pad(3);
|
||||||
table.add(text).wrap().width(280f).get().setAlignment(Align.center, Align.center);
|
table.add(text).wrap().width(280f).get().setAlignment(Align.center, Align.center);
|
||||||
table.pack();
|
table.pack();
|
||||||
|
|
||||||
@@ -426,7 +428,7 @@ public class HudFragment extends Fragment{
|
|||||||
//if there's currently no unlock notification...
|
//if there's currently no unlock notification...
|
||||||
if(lastUnlockTable == null){
|
if(lastUnlockTable == null){
|
||||||
scheduleToast(() -> {
|
scheduleToast(() -> {
|
||||||
Table table = new Table("button");
|
Table table = new Table(Tex.button);
|
||||||
table.update(() -> {
|
table.update(() -> {
|
||||||
if(state.is(State.menu)){
|
if(state.is(State.menu)){
|
||||||
table.remove();
|
table.remove();
|
||||||
@@ -498,7 +500,7 @@ public class HudFragment extends Fragment{
|
|||||||
|
|
||||||
lastUnlockLayout.add(image);
|
lastUnlockLayout.add(image);
|
||||||
}else{ //else, add a specific icon to denote no more space
|
}else{ //else, add a specific icon to denote no more space
|
||||||
lastUnlockLayout.addImage("icon-add");
|
lastUnlockLayout.addImage(Icon.add);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastUnlockLayout.pack();
|
lastUnlockLayout.pack();
|
||||||
@@ -506,7 +508,7 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showLaunch(){
|
public void showLaunch(){
|
||||||
Image image = new Image("whiteui");
|
Image image = new Image();
|
||||||
image.getColor().a = 0f;
|
image.getColor().a = 0f;
|
||||||
image.setFillParent(true);
|
image.setFillParent(true);
|
||||||
image.actions(Actions.fadeIn(40f / 60f));
|
image.actions(Actions.fadeIn(40f / 60f));
|
||||||
@@ -551,7 +553,7 @@ public class HudFragment extends Fragment{
|
|||||||
|
|
||||||
private void toggleMenus(){
|
private void toggleMenus(){
|
||||||
if(flip != null){
|
if(flip != null){
|
||||||
flip.getStyle().imageUp = Core.scene.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up");
|
flip.getStyle().imageUp = shown ? Icon.arrowDown : Icon.arrowUp;
|
||||||
}
|
}
|
||||||
|
|
||||||
shown = !shown;
|
shown = !shown;
|
||||||
@@ -642,7 +644,7 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addPlayButton(Table table){
|
private void addPlayButton(Table table){
|
||||||
table.right().addImageButton("icon-play", "right", 30f, () -> {
|
table.right().addImageButton(Icon.playSmaller, Style.rightIbutton, 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()){
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import io.anuke.arc.scene.ui.Label;
|
|||||||
import io.anuke.arc.scene.ui.TextButton;
|
import io.anuke.arc.scene.ui.TextButton;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.graphics.Pal;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
public class LoadingFragment extends Fragment{
|
public class LoadingFragment extends Fragment{
|
||||||
private Table table;
|
private Table table;
|
||||||
@@ -14,16 +15,16 @@ public class LoadingFragment extends Fragment{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void build(Group parent){
|
public void build(Group parent){
|
||||||
parent.fill("loadDim", t -> {
|
parent.fill(Style.loadDim,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();
|
||||||
|
|
||||||
t.addImage("whiteui").growX().height(3f).pad(4f).growX().get().setColor(Pal.accent);
|
t.addImage().growX().height(3f).pad(4f).growX().get().setColor(Pal.accent);
|
||||||
t.row();
|
t.row();
|
||||||
t.add("$loading").name("namelabel").pad(10f);
|
t.add("$loading").name("namelabel").pad(10f);
|
||||||
t.row();
|
t.row();
|
||||||
t.addImage("whiteui").growX().height(3f).pad(4f).growX().get().setColor(Pal.accent);
|
t.addImage().growX().height(3f).pad(4f).growX().get().setColor(Pal.accent);
|
||||||
t.row();
|
t.row();
|
||||||
|
|
||||||
button = t.addButton("$cancel", () -> {
|
button = t.addButton("$cancel", () -> {
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
package io.anuke.mindustry.ui.fragments;
|
package io.anuke.mindustry.ui.fragments;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.Events;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.graphics.Texture;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.scene.*;
|
||||||
import io.anuke.arc.math.Interpolation;
|
import io.anuke.arc.scene.actions.*;
|
||||||
import io.anuke.arc.scene.Group;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.actions.Actions;
|
import io.anuke.arc.scene.style.*;
|
||||||
import io.anuke.arc.scene.event.Touchable;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.Button;
|
|
||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.Align;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.game.EventType.DisposeEvent;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
import io.anuke.mindustry.game.EventType.ResizeEvent;
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.game.Version;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.graphics.MenuRenderer;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.ui.MobileButton;
|
import io.anuke.mindustry.ui.*;
|
||||||
|
import io.anuke.mindustry.ui.Style;
|
||||||
|
|
||||||
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("", "info", ui.about::show).size(84, 45));
|
parent.fill(c -> c.bottom().left().addButton("", Style.infoTbutton, ui.about::show).size(84, 45));
|
||||||
parent.fill(c -> c.bottom().right().addButton("", "discord", ui.discord::show).size(84, 45));
|
parent.fill(c -> c.bottom().right().addButton("", Style.discordTbutton, 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);
|
||||||
@@ -79,8 +79,8 @@ public class MenuFragment extends Fragment{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
Draw.rect(Draw.wrap(logo), fx, fy, logow, logoh);
|
Draw.rect(Draw.wrap(logo), fx, fy, logow, logoh);
|
||||||
|
|
||||||
Core.scene.skin.font().setColor(Color.WHITE);
|
Fonts.def.setColor(Color.WHITE);
|
||||||
Core.scene.skin.font().draw(versionText, fx, fy - logoh/2f, Align.center);
|
Fonts.def.draw(versionText, fx, fy - logoh/2f, Align.center);
|
||||||
}).touchable(Touchable.disabled);
|
}).touchable(Touchable.disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,18 +89,17 @@ public class MenuFragment extends Fragment{
|
|||||||
container.setSize(Core.graphics.getWidth(), Core.graphics.getHeight());
|
container.setSize(Core.graphics.getWidth(), Core.graphics.getHeight());
|
||||||
|
|
||||||
float size = 120f;
|
float size = 120f;
|
||||||
float isize = iconsize;
|
|
||||||
container.defaults().size(size).pad(5).padTop(4f);
|
container.defaults().size(size).pad(5).padTop(4f);
|
||||||
|
|
||||||
MobileButton
|
MobileButton
|
||||||
play = new MobileButton("icon-play-2", isize, "$campaign", ui.deploy::show),
|
play = new MobileButton(Icon.play2, "$campaign", ui.deploy::show),
|
||||||
custom = new MobileButton("icon-play-custom", isize, "$customgame", ui.custom::show),
|
custom = new MobileButton(Icon.playCustom, "$customgame", ui.custom::show),
|
||||||
maps = new MobileButton("icon-load", isize, "$loadgame", ui.load::show),
|
maps = new MobileButton(Icon.load, "$loadgame", ui.load::show),
|
||||||
join = new MobileButton("icon-add", isize, "$joingame", ui.join::show),
|
join = new MobileButton(Icon.add, "$joingame", ui.join::show),
|
||||||
editor = new MobileButton("icon-editor", isize, "$editor", ui.maps::show),
|
editor = new MobileButton(Icon.editor, "$editor", ui.maps::show),
|
||||||
tools = new MobileButton("icon-tools", isize, "$settings", ui.settings::show),
|
tools = new MobileButton(Icon.tools, "$settings", ui.settings::show),
|
||||||
donate = new MobileButton("icon-link", isize, "$website", () -> Core.net.openURI("https://anuke.itch.io/mindustry")),
|
donate = new MobileButton(Icon.link, "$website", () -> Core.net.openURI("https://anuke.itch.io/mindustry")),
|
||||||
exit = new MobileButton("icon-exit", isize, "$quit", () -> Core.app.exit());
|
exit = new MobileButton(Icon.exit, "$quit", () -> Core.app.exit());
|
||||||
|
|
||||||
if(!Core.graphics.isPortrait()){
|
if(!Core.graphics.isPortrait()){
|
||||||
container.marginTop(60f);
|
container.marginTop(60f);
|
||||||
@@ -147,25 +146,26 @@ public class MenuFragment extends Fragment{
|
|||||||
|
|
||||||
|
|
||||||
float width = 230f;
|
float width = 230f;
|
||||||
String background = "flat-trans";
|
Drawable background = Style.flatTrans;
|
||||||
|
|
||||||
container.left();
|
container.left();
|
||||||
container.add().width(Core.graphics.getWidth()/10f);
|
container.add().width(Core.graphics.getWidth()/10f);
|
||||||
container.table(background, t -> {
|
container.table(background, t -> {
|
||||||
t.defaults().width(width).height(70f);
|
t.defaults().width(width).height(70f);
|
||||||
|
|
||||||
|
//todo buttons should be small
|
||||||
buttons(t,
|
buttons(t,
|
||||||
new Buttoni("$play", "icon-play-2",
|
new Buttoni("$play", Icon.play2Small,
|
||||||
new Buttoni("$campaign", "icon-play-2", ui.deploy::show),
|
new Buttoni("$campaign", Icon.play2Small, ui.deploy::show),
|
||||||
new Buttoni("$joingame", "icon-add", ui.join::show),
|
new Buttoni("$joingame", Icon.addSmall, ui.join::show),
|
||||||
new Buttoni("$customgame", "icon-editor", ui.custom::show),
|
new Buttoni("$customgame", Icon.editorSmall, ui.custom::show),
|
||||||
new Buttoni("$loadgame", "icon-load", ui.load::show),
|
new Buttoni("$loadgame", Icon.loadSmall, ui.load::show),
|
||||||
new Buttoni("$tutorial", "icon-info", control::playTutorial)
|
new Buttoni("$tutorial", Icon.infoSmall, control::playTutorial)
|
||||||
),
|
),
|
||||||
new Buttoni("$editor", "icon-editor", ui.maps::show),
|
new Buttoni("$editor", Icon.editorSmall, ui.maps::show),
|
||||||
new Buttoni("$settings", "icon-tools", ui.settings::show),
|
new Buttoni("$settings", Icon.toolsSmall, ui.settings::show),
|
||||||
new Buttoni("$about.button", "icon-info", ui.about::show),
|
new Buttoni("$about.button", Icon.infoSmall, ui.about::show),
|
||||||
new Buttoni("$quit", "icon-exit", Core.app::exit)
|
new Buttoni("$quit", Icon.exitSmall, Core.app::exit)
|
||||||
);
|
);
|
||||||
|
|
||||||
}).width(width).growY();
|
}).width(width).growY();
|
||||||
@@ -198,8 +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 + "-small", "clear-toggle-menu",
|
out[0] = t.addImageTextButton(b.text, b.icon, Style.clearToggleMenuTbutton, () -> {
|
||||||
iconsizesmall, () -> {
|
|
||||||
if(currentMenu == out[0]){
|
if(currentMenu == out[0]){
|
||||||
currentMenu = null;
|
currentMenu = null;
|
||||||
fadeOutMenu();
|
fadeOutMenu();
|
||||||
@@ -225,19 +224,19 @@ public class MenuFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class Buttoni{
|
private class Buttoni{
|
||||||
final String icon;
|
final Drawable icon;
|
||||||
final String text;
|
final String text;
|
||||||
final Runnable runnable;
|
final Runnable runnable;
|
||||||
final Buttoni[] submenu;
|
final Buttoni[] submenu;
|
||||||
|
|
||||||
public Buttoni(String text, String icon, Runnable runnable){
|
public Buttoni(String text, Drawable icon, Runnable runnable){
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
this.text = text;
|
this.text = text;
|
||||||
this.runnable = runnable;
|
this.runnable = runnable;
|
||||||
this.submenu = null;
|
this.submenu = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Buttoni(String text, String icon, Buttoni... buttons){
|
public Buttoni(String text, Drawable icon, Buttoni... buttons){
|
||||||
this.icon = icon;
|
this.icon = icon;
|
||||||
this.text = text;
|
this.text = text;
|
||||||
this.runnable = () -> {};
|
this.runnable = () -> {};
|
||||||
|
|||||||
@@ -12,11 +12,12 @@ import io.anuke.arc.scene.ui.*;
|
|||||||
import io.anuke.arc.scene.ui.layout.*;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.mindustry.entities.type.*;
|
import io.anuke.mindustry.entities.type.*;
|
||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
|
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.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.Block.*;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -137,13 +138,13 @@ public class PlacementFragment extends Fragment{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButton button = blockTable.addImageButton("icon-locked", "select", 8 * 4, () -> {
|
ImageButton button = blockTable.addImageButton(Icon.lockedSmall, Style.selectIbutton, () -> {
|
||||||
if(unlocked(block)){
|
if(unlocked(block)){
|
||||||
input.block = input.block == block ? null : block;
|
input.block = input.block == block ? null : block;
|
||||||
}
|
}
|
||||||
}).size(46f).group(group).name("block-" + block.name).get();
|
}).size(46f).group(group).name("block-" + block.name).get();
|
||||||
|
|
||||||
button.getStyle().imageUp = new TextureRegionDrawable(block.icon(Icon.medium));
|
button.getStyle().imageUp = new TextureRegionDrawable(block.icon(Block.Icon.medium));
|
||||||
|
|
||||||
button.update(() -> { //color unplacable things gray
|
button.update(() -> { //color unplacable things gray
|
||||||
TileEntity core = player.getClosestCore();
|
TileEntity core = player.getClosestCore();
|
||||||
@@ -169,7 +170,7 @@ public class PlacementFragment extends Fragment{
|
|||||||
};
|
};
|
||||||
|
|
||||||
//top table with hover info
|
//top table with hover info
|
||||||
frame.table("button-edge-2", top -> {
|
frame.table(Tex.buttonEdge2,top -> {
|
||||||
topTable = top;
|
topTable = top;
|
||||||
top.add(new Table()).growX().update(topTable -> {
|
top.add(new Table()).growX().update(topTable -> {
|
||||||
//don't refresh unnecessarily
|
//don't refresh unnecessarily
|
||||||
@@ -189,12 +190,12 @@ public class PlacementFragment extends Fragment{
|
|||||||
|
|
||||||
topTable.table(header -> {
|
topTable.table(header -> {
|
||||||
header.left();
|
header.left();
|
||||||
header.add(new Image(lastDisplay.icon(Icon.medium))).size(8 * 4);
|
header.add(new Image(lastDisplay.icon(Block.Icon.medium))).size(8 * 4);
|
||||||
header.labelWrap(() -> !unlocked(lastDisplay) ? Core.bundle.get("block.unknown") : lastDisplay.localizedName)
|
header.labelWrap(() -> !unlocked(lastDisplay) ? Core.bundle.get("block.unknown") : lastDisplay.localizedName)
|
||||||
.left().width(190f).padLeft(5);
|
.left().width(190f).padLeft(5);
|
||||||
header.add().growX();
|
header.add().growX();
|
||||||
if(unlocked(lastDisplay)){
|
if(unlocked(lastDisplay)){
|
||||||
header.addButton("?", "clear-partial", () -> {
|
header.addButton("?", Style.clearPartialTbutton, () -> {
|
||||||
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");
|
||||||
@@ -243,9 +244,9 @@ public class PlacementFragment extends Fragment{
|
|||||||
});
|
});
|
||||||
}).colspan(3).fillX().visible(() -> getSelected() != null || tileDisplayBlock() != null).touchable(Touchable.enabled);
|
}).colspan(3).fillX().visible(() -> getSelected() != null || tileDisplayBlock() != null).touchable(Touchable.enabled);
|
||||||
frame.row();
|
frame.row();
|
||||||
frame.addImage("whiteui").color(Pal.gray).colspan(3).height(4).growX();
|
frame.addImage().color(Pal.gray).colspan(3).height(4).growX();
|
||||||
frame.row();
|
frame.row();
|
||||||
frame.table("pane-2", blocksSelect -> {
|
frame.table(Tex.pane2, blocksSelect -> {
|
||||||
blocksSelect.margin(4).marginTop(0);
|
blocksSelect.margin(4).marginTop(0);
|
||||||
blocksSelect.table(blocks -> blockTable = blocks).grow();
|
blocksSelect.table(blocks -> blockTable = blocks).grow();
|
||||||
blocksSelect.row();
|
blocksSelect.row();
|
||||||
@@ -267,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("flat-trans");
|
categories.addImage(Style.flatTrans);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
categories.addImageButton("icon-" + cat.name() + "-med", "clear-toggle-trans", iconsizemed, () -> {
|
categories.addImageButton(Core.atlas.drawable("icon-" + cat.name() + "-smaller"), Style.clearToggleTransIbutton, () -> {
|
||||||
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());
|
||||||
|
|||||||
@@ -1,21 +1,18 @@
|
|||||||
package io.anuke.mindustry.ui.fragments;
|
package io.anuke.mindustry.ui.fragments;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.graphics.g2d.Lines;
|
import io.anuke.arc.scene.*;
|
||||||
import io.anuke.arc.scene.Group;
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.event.Touchable;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.Image;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.scene.ui.layout.UnitScl;
|
import io.anuke.mindustry.core.GameState.*;
|
||||||
import io.anuke.arc.util.Interval;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.arc.util.Scaling;
|
import io.anuke.mindustry.graphics.*;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.net.*;
|
||||||
import io.anuke.mindustry.gen.Call;
|
import io.anuke.mindustry.net.Packets.*;
|
||||||
import io.anuke.mindustry.graphics.Pal;
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.net.Net;
|
|
||||||
import io.anuke.mindustry.net.NetConnection;
|
|
||||||
import io.anuke.mindustry.net.Packets.AdminAction;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -43,7 +40,7 @@ public class PlayerListFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
cont.table("button-trans", pane -> {
|
cont.table(Tex.buttonTrans, pane -> {
|
||||||
pane.label(() -> Core.bundle.format(playerGroup.size() == 1 ? "players.single" : "players", playerGroup.size()));
|
pane.label(() -> Core.bundle.format(playerGroup.size() == 1 ? "players.single" : "players", playerGroup.size()));
|
||||||
pane.row();
|
pane.row();
|
||||||
pane.pane(content).grow().get().setScrollingDisabled(true, false);
|
pane.pane(content).grow().get().setScrollingDisabled(true, false);
|
||||||
@@ -96,7 +93,7 @@ public class PlayerListFragment extends Fragment{
|
|||||||
button.labelWrap("[#" + user.color.toString().toUpperCase() + "]" + user.name).width(170f).pad(10);
|
button.labelWrap("[#" + user.color.toString().toUpperCase() + "]" + user.name).width(170f).pad(10);
|
||||||
button.add().grow();
|
button.add().grow();
|
||||||
|
|
||||||
button.addImage("icon-admin").size(iconsize).visible(() -> user.isAdmin && !(!user.isLocal && net.server())).padRight(5).get().updateVisibility();
|
button.addImage(Icon.admin).visible(() -> user.isAdmin && !(!user.isLocal && net.server())).padRight(5).get().updateVisibility();
|
||||||
|
|
||||||
if((net.server() || player.isAdmin) && !user.isLocal && (!user.isAdmin || net.server())){
|
if((net.server() || player.isAdmin) && !user.isLocal && (!user.isAdmin || net.server())){
|
||||||
button.add().growY();
|
button.add().growY();
|
||||||
@@ -106,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-ban-small", "clear-partial", iconsizesmall,
|
t.addImageButton(Icon.banSmall, Style.clearPartialIbutton,
|
||||||
() -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(user, AdminAction.ban)));
|
() -> ui.showConfirm("$confirm", "$confirmban", () -> Call.onAdminRequest(user, AdminAction.ban)));
|
||||||
t.addImageButton("icon-cancel-small", "clear-partial", iconsizesmall,
|
t.addImageButton(Icon.cancelSmall, Style.clearPartialIbutton,
|
||||||
() -> 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-admin-small", "clear-toggle-partial", iconsizesmall, () -> {
|
t.addImageButton(Icon.adminSmall, Style.clearTogglePartialIbutton, () -> {
|
||||||
if(net.client()) return;
|
if(net.client()) return;
|
||||||
|
|
||||||
String id = user.uuid;
|
String id = user.uuid;
|
||||||
@@ -129,14 +126,14 @@ 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-zoom-small", "clear-partial", iconsizesmall, () -> Call.onAdminRequest(user, AdminAction.trace));
|
t.addImageButton(Icon.zoomSmall, Style.clearPartialIbutton, () -> Call.onAdminRequest(user, AdminAction.trace));
|
||||||
|
|
||||||
}).padRight(12).size(bs + 10f, bs);
|
}).padRight(12).size(bs + 10f, bs);
|
||||||
}
|
}
|
||||||
|
|
||||||
content.add(button).padBottom(-6).width(350f).maxHeight(h + 14);
|
content.add(button).padBottom(-6).width(350f).maxHeight(h + 14);
|
||||||
content.row();
|
content.row();
|
||||||
content.addImage("whiteui").height(4f).color(state.rules.pvp ? user.getTeam().color : Pal.gray).growX();
|
content.addImage().height(4f).color(state.rules.pvp ? user.getTeam().color : Pal.gray).growX();
|
||||||
content.row();
|
content.row();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ public class Block extends BlockStorage{
|
|||||||
if(renderer.pixelator.enabled()) return 0;
|
if(renderer.pixelator.enabled()) return 0;
|
||||||
|
|
||||||
Color color = valid ? Pal.accent : Pal.remove;
|
Color color = valid ? Pal.accent : Pal.remove;
|
||||||
BitmapFont font = Core.scene.skin.getFont("outline");
|
BitmapFont font = Fonts.outline;
|
||||||
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new);
|
||||||
boolean ints = font.usesIntegerPositions();
|
boolean ints = font.usesIntegerPositions();
|
||||||
font.setUseIntegerPositions(false);
|
font.setUseIntegerPositions(false);
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
package io.anuke.mindustry.world.blocks;
|
package io.anuke.mindustry.world.blocks;
|
||||||
|
|
||||||
import io.anuke.arc.collection.Array;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.function.Consumer;
|
import io.anuke.arc.function.*;
|
||||||
import io.anuke.arc.function.Supplier;
|
import io.anuke.arc.scene.style.*;
|
||||||
import io.anuke.arc.scene.style.TextureRegionDrawable;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.scene.ui.ButtonGroup;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.scene.ui.ImageButton;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.ui.Style;
|
||||||
import io.anuke.mindustry.type.Item.Icon;
|
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -28,9 +27,9 @@ 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("whiteui", "clear-toggle-trans", 24, () -> control.input.frag.config.hideConfig()).group(group).get();
|
ImageButton button = cont.addImageButton(Tex.whiteui, Style.clearToggleTransIbutton, 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(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));
|
||||||
|
|
||||||
if(i++ % 4 == 3){
|
if(i++ % 4 == 3){
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ public class Drill extends Block{
|
|||||||
for(int i = 0; i < list.size; i++){
|
for(int i = 0; i < list.size; i++){
|
||||||
Item item = list.get(i);
|
Item item = list.get(i);
|
||||||
|
|
||||||
table.addImage(item.name + "1").size(8 * 3).padRight(2).padLeft(2).padTop(3).padBottom(3);
|
table.addImage(Core.atlas.find(item.name + "1")).size(8 * 3).padRight(2).padLeft(2).padTop(3).padBottom(3);
|
||||||
table.add(item.localizedName());
|
table.add(item.localizedName());
|
||||||
if(i != list.size - 1){
|
if(i != list.size - 1){
|
||||||
table.add("/").padLeft(5).padRight(5);
|
table.add("/").padLeft(5).padRight(5);
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ import io.anuke.arc.scene.ui.ImageButton;
|
|||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.mindustry.entities.type.Player;
|
import io.anuke.mindustry.entities.type.Player;
|
||||||
import io.anuke.mindustry.entities.type.TileEntity;
|
import io.anuke.mindustry.entities.type.TileEntity;
|
||||||
import io.anuke.mindustry.gen.Call;
|
import io.anuke.mindustry.gen.*;
|
||||||
import io.anuke.mindustry.type.Liquid;
|
import io.anuke.mindustry.type.Liquid;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
|
||||||
@@ -83,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("clear", "clear-toggle-trans", 24, () -> control.input.frag.config.hideConfig()).size(38).group(group).get();
|
ImageButton button = cont.addImageButton(Tex.clear, Style.clearToggleTransIbutton, 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();
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import io.anuke.mindustry.entities.units.*;
|
|||||||
import io.anuke.mindustry.game.*;
|
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.world.*;
|
import io.anuke.mindustry.world.*;
|
||||||
import io.anuke.mindustry.world.meta.*;
|
import io.anuke.mindustry.world.meta.*;
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ public class CommandCenter extends Block{
|
|||||||
CommandCenterEntity entity = tile.entity();
|
CommandCenterEntity entity = tile.entity();
|
||||||
super.draw(tile);
|
super.draw(tile);
|
||||||
|
|
||||||
float size = iconsizesmall/4f;
|
float size = IconSize.small.size/4f;
|
||||||
|
|
||||||
Draw.color(bottomColor);
|
Draw.color(bottomColor);
|
||||||
Draw.rect(commandRegions[entity.command.ordinal()], tile.drawx(), tile.drawy() - 1, size, size);
|
Draw.rect(commandRegions[entity.command.ordinal()], tile.drawx(), tile.drawy() - 1, size, size);
|
||||||
@@ -80,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("icon-command-" + cmd.name() + "-small", "clear-toggle-trans", iconsizesmall, () -> Call.onCommandCenterSet(player, tile, cmd))
|
buttons.addImageButton(Core.atlas.drawable("icon-command-" + cmd.name() + "-small"), Style.clearToggleTransIbutton, () -> 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("outline").center().growX().get().setAlignment(Align.center);
|
table.label(() -> entity.command.localized()).style(Style.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)
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
package io.anuke.mindustry.world.meta.values;
|
package io.anuke.mindustry.world.meta.values;
|
||||||
|
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.*;
|
||||||
import io.anuke.arc.collection.ObjectMap;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.graphics.g2d.TextureRegion;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.*;
|
||||||
import io.anuke.arc.util.Strings;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.content.StatusEffects;
|
import io.anuke.mindustry.content.*;
|
||||||
import io.anuke.mindustry.entities.bullet.BulletType;
|
import io.anuke.mindustry.entities.bullet.*;
|
||||||
import io.anuke.mindustry.game.UnlockableContent;
|
import io.anuke.mindustry.game.*;
|
||||||
import io.anuke.mindustry.type.Item;
|
import io.anuke.mindustry.gen.*;
|
||||||
|
import io.anuke.mindustry.type.*;
|
||||||
import io.anuke.mindustry.type.Item.Icon;
|
import io.anuke.mindustry.type.Item.Icon;
|
||||||
import io.anuke.mindustry.world.meta.StatValue;
|
import io.anuke.mindustry.world.meta.*;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.tilesize;
|
import static io.anuke.mindustry.Vars.tilesize;
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ public class AmmoListValue<T extends UnlockableContent> implements StatValue{
|
|||||||
BulletType type = map.get(t);
|
BulletType type = map.get(t);
|
||||||
table.addImage(icon(t)).size(3 * 8).padRight(4).right().top();
|
table.addImage(icon(t)).size(3 * 8).padRight(4).right().top();
|
||||||
table.add(t.localizedName()).padRight(10).left().top();
|
table.add(t.localizedName()).padRight(10).left().top();
|
||||||
table.table("underline", bt -> {
|
table.table(Tex.underline, bt -> {
|
||||||
bt.left().defaults().padRight(3).left();
|
bt.left().defaults().padRight(3).left();
|
||||||
|
|
||||||
if(type.damage > 0){
|
if(type.damage > 0){
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import io.anuke.mindustry.game.Version;
|
|||||||
import io.anuke.mindustry.maps.Map;
|
import io.anuke.mindustry.maps.Map;
|
||||||
import io.anuke.mindustry.net.*;
|
import io.anuke.mindustry.net.*;
|
||||||
import io.anuke.mindustry.net.Net.*;
|
import io.anuke.mindustry.net.Net.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -83,7 +84,7 @@ public class DesktopLauncher extends ClientLauncher{
|
|||||||
|
|
||||||
t.toFront();
|
t.toFront();
|
||||||
});
|
});
|
||||||
t.table("guideDim", f -> label[0] = f.add("").get()).visible(() -> visible[0]);
|
t.table(Style.guideDim,f -> label[0] = f.add("").get()).visible(() -> visible[0]);
|
||||||
});
|
});
|
||||||
|
|
||||||
Log.setLogger(new LogHandler(){
|
Log.setLogger(new LogHandler(){
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import io.anuke.arc.util.io.*;
|
|||||||
import io.anuke.mindustry.game.EventType.*;
|
import io.anuke.mindustry.game.EventType.*;
|
||||||
import io.anuke.mindustry.game.Saves.*;
|
import io.anuke.mindustry.game.Saves.*;
|
||||||
import io.anuke.mindustry.io.*;
|
import io.anuke.mindustry.io.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
import org.robovm.apple.foundation.*;
|
import org.robovm.apple.foundation.*;
|
||||||
import org.robovm.apple.uikit.*;
|
import org.robovm.apple.uikit.*;
|
||||||
import org.robovm.objc.block.*;
|
import org.robovm.objc.block.*;
|
||||||
@@ -134,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("dialogDim", t -> {
|
Core.scene.table(Style.dialogDim,t -> {
|
||||||
t.visible(() -> {
|
t.visible(() -> {
|
||||||
if(!forced) return false;
|
if(!forced) return false;
|
||||||
t.toFront();
|
t.toFront();
|
||||||
@@ -172,10 +173,10 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
|||||||
ui.load.runLoadSave(slot);
|
ui.load.runLoadSave(slot);
|
||||||
}
|
}
|
||||||
}catch(IOException e){
|
}catch(IOException e){
|
||||||
ui.showError(Core.bundle.format("save.import.fail", Strings.parseException(e, true)));
|
ui.showException("save.import.fail", e);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
ui.showError("save.import.invalid");
|
ui.showErrorMessage("save.import.invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,14 +6,9 @@ import io.anuke.arc.files.*;
|
|||||||
import io.anuke.arc.graphics.*;
|
import io.anuke.arc.graphics.*;
|
||||||
import io.anuke.arc.graphics.g2d.*;
|
import io.anuke.arc.graphics.g2d.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
|
import io.anuke.mindustry.ui.*;
|
||||||
|
|
||||||
public class Upscaler{
|
public class Upscaler{
|
||||||
static Res[] resolutions = {
|
|
||||||
new Res(Vars.iconsizesmall, "-small"),
|
|
||||||
new Res(Vars.iconsizemed, "-med"),
|
|
||||||
new Res(Vars.iconsize, ""),
|
|
||||||
};
|
|
||||||
|
|
||||||
public static void main(String[] args){
|
public static void main(String[] args){
|
||||||
new SdlApplication(new ApplicationListener(){
|
new SdlApplication(new ApplicationListener(){
|
||||||
@Override
|
@Override
|
||||||
@@ -35,12 +30,13 @@ public class Upscaler{
|
|||||||
Time.mark();
|
Time.mark();
|
||||||
FileHandle[] list = file.list();
|
FileHandle[] list = file.list();
|
||||||
|
|
||||||
for(Res res : resolutions){
|
for(IconSize size : IconSize.values()){
|
||||||
SquareMarcher marcher = new SquareMarcher(res.size);
|
String suffix = size == IconSize.def ? "" : "-" + size.name();
|
||||||
|
SquareMarcher marcher = new SquareMarcher(size.size);
|
||||||
|
|
||||||
for(FileHandle img : list){
|
for(FileHandle img : list){
|
||||||
if(img.extension().equals("png")){
|
if(img.extension().equals("png")){
|
||||||
marcher.render(new Pixmap(img), img.sibling(img.nameWithoutExtension() + res.suffix + ".png"));
|
marcher.render(new Pixmap(img), img.sibling(img.nameWithoutExtension() + suffix + ".png"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user