diff --git a/.gitignore b/.gitignore index 611dd73e9a..2f7d9218d7 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,9 @@ logs/ /desktop/gifexport/ /core/lib/ /core/assets-raw/sprites/generated/ +/core/assets-raw/sprites_out/ /annotations/build/ -/kryonet/build/ +/net/build/ /tools/build/ /tests/build/ /server/build/ diff --git a/README.md b/README.md index f6fbd91e13..aa9924199e 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,7 @@ A pixelated sandbox tower defense game made using [LibGDX](https://libgdx.badlogicgames.com/). Winner of the [GDL Metal Monstrosity Jam](https://itch.io/jam/gdl---metal-monstrosity-jam). _[Trello Board](https://trello.com/b/aE2tcUwF/mindustry-40-plans)_ -_[Wiki](http://mindustry.wikia.com/wiki/Mindustry_Wiki)_ -_[Discord](https://discord.gg/r8BkXNd)_ +_[Wiki](http://mindustry.wikia.com/wiki/Mindustry_Wiki)_ ### Building diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index b0e4475812..989b5dd893 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -17,6 +17,7 @@ android:appCategory="game" android:label="@string/app_name" android:theme="@style/GdxTheme" android:fullBackupContent="@xml/backup_rules"> + 1 Доллар 2 Доллара - 5 Доллара + 5 Долларов 10 Долларов 15 Долларов 25 Долларов diff --git a/android/res/values-uk/strings.xml b/android/res/values-uk/strings.xml new file mode 100644 index 0000000000..f1303715ff --- /dev/null +++ b/android/res/values-uk/strings.xml @@ -0,0 +1,15 @@ + + + + Mindustry + + 1 Доллар + 2 Доллара + 5 Долларів + 10 Долларів + 15 Долларів + 25 Долларів + 50 Долларів + + + diff --git a/android/src/io/anuke/mindustry/AndroidLauncher.java b/android/src/io/anuke/mindustry/AndroidLauncher.java index c75b6af249..8fbb105dc4 100644 --- a/android/src/io/anuke/mindustry/AndroidLauncher.java +++ b/android/src/io/anuke/mindustry/AndroidLauncher.java @@ -11,25 +11,25 @@ import android.os.Bundle; import android.provider.Settings.Secure; import android.telephony.TelephonyManager; import android.util.Log; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.Base64Coder; import com.google.android.gms.common.GoogleApiAvailability; import com.google.android.gms.common.GooglePlayServicesNotAvailableException; import com.google.android.gms.common.GooglePlayServicesRepairableException; import com.google.android.gms.security.ProviderInstaller; -import io.anuke.kryonet.KryoClient; -import io.anuke.kryonet.KryoServer; +import io.anuke.arc.Core; +import io.anuke.arc.backends.android.surfaceview.AndroidApplication; +import io.anuke.arc.backends.android.surfaceview.AndroidApplicationConfiguration; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.util.Strings; +import io.anuke.arc.util.serialization.Base64Coder; +import io.anuke.net.KryoClient; +import io.anuke.net.KryoServer; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.game.Saves.SaveSlot; import io.anuke.mindustry.io.SaveIO; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.ui.dialogs.FileChooser; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Strings; import java.io.File; import java.io.FileInputStream; @@ -39,7 +39,7 @@ import java.util.ArrayList; import static io.anuke.mindustry.Vars.*; -public class AndroidLauncher extends PatchedAndroidApplication{ +public class AndroidLauncher extends AndroidApplication{ public static final int PERMISSION_REQUEST_CODE = 1; boolean doubleScaleTablets = true; FileChooser chooser; @@ -49,6 +49,7 @@ public class AndroidLauncher extends PatchedAndroidApplication{ super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); config.useImmersiveMode = true; + config.depth = 0; Platform.instance = new Platform(){ @Override @@ -161,23 +162,23 @@ public class AndroidLauncher extends PatchedAndroidApplication{ InputStream inStream; if(myFile != null) inStream = new FileInputStream(myFile); else inStream = getContentResolver().openInputStream(uri); - Gdx.app.postRunnable(() -> { + Core.app.post(() -> { if(save){ //open save System.out.println("Opening save."); - FileHandle file = Gdx.files.local("temp-save." + saveExtension); + FileHandle file = Core.files.local("temp-save." + saveExtension); file.write(inStream, false); if(SaveIO.isSaveValid(file)){ try{ SaveSlot slot = control.saves.importSave(file); ui.load.runLoadSave(slot); }catch(IOException e){ - ui.showError(Bundles.format("text.save.import.fail", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.save.import.fail", Strings.parseException(e, false))); } }else{ ui.showError("$text.save.import.invalid"); } }else if(map){ //open map - Gdx.app.postRunnable(() -> { + Core.app.post(() -> { System.out.println("Opening map."); if(!ui.editor.isShown()){ ui.editor.show(); diff --git a/android/src/io/anuke/mindustry/PatchedAndroidApplication.java b/android/src/io/anuke/mindustry/PatchedAndroidApplication.java deleted file mode 100644 index 3ed0df141e..0000000000 --- a/android/src/io/anuke/mindustry/PatchedAndroidApplication.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.anuke.mindustry; - -import com.badlogic.gdx.backends.android.AndroidApplication; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -public class PatchedAndroidApplication extends AndroidApplication { - private final ExecutorService exec = Executors.newSingleThreadExecutor(); - - @Override - protected void onPause () { - if(useImmersiveMode) { - exec.submit(() -> { - try {Thread.sleep(100);} catch (InterruptedException ignored) {} - graphics.onDrawFrame(null); - }); - } - super.onPause(); - } -} \ No newline at end of file diff --git a/annotations/src/main/java/io/anuke/annotations/RemoteMethodAnnotationProcessor.java b/annotations/src/main/java/io/anuke/annotations/RemoteMethodAnnotationProcessor.java index e361a49fdc..2762b03a8e 100644 --- a/annotations/src/main/java/io/anuke/annotations/RemoteMethodAnnotationProcessor.java +++ b/annotations/src/main/java/io/anuke/annotations/RemoteMethodAnnotationProcessor.java @@ -107,8 +107,6 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor{ ClassEntry clas = new ClassEntry(callLocation); classMap.put(callLocation, clas); classes.add(clas); - - Utils.messager.printMessage(Kind.NOTE, "Generating class '" + clas.name + "'."); } ClassEntry entry = classMap.get(callLocation); diff --git a/annotations/src/main/java/io/anuke/annotations/RemoteWriteGenerator.java b/annotations/src/main/java/io/anuke/annotations/RemoteWriteGenerator.java index 51845d0900..7a6b42d74b 100644 --- a/annotations/src/main/java/io/anuke/annotations/RemoteWriteGenerator.java +++ b/annotations/src/main/java/io/anuke/annotations/RemoteWriteGenerator.java @@ -129,7 +129,7 @@ public class RemoteWriteGenerator{ method.beginControlFlow("if(" + getCheckString(methodEntry.where) + ")"); //add statement to create packet from pool - method.addStatement("$1N packet = $2N.obtain($1N.class, $1N::new)", "io.anuke.mindustry.net.Packets.InvokePacket", "io.anuke.ucore.util.Pooling"); + method.addStatement("$1N packet = $2N.obtain($1N.class, $1N::new)", "io.anuke.mindustry.net.Packets.InvokePacket", "io.anuke.arc.util.pooling.Pools"); //assign buffer method.addStatement("packet.writeBuffer = TEMP_BUFFER"); //assign priority diff --git a/annotations/src/main/java/io/anuke/annotations/SerializeAnnotationProcessor.java b/annotations/src/main/java/io/anuke/annotations/SerializeAnnotationProcessor.java index 3cb31a1ee3..cbfdc3bc06 100644 --- a/annotations/src/main/java/io/anuke/annotations/SerializeAnnotationProcessor.java +++ b/annotations/src/main/java/io/anuke/annotations/SerializeAnnotationProcessor.java @@ -45,6 +45,7 @@ public class SerializeAnnotationProcessor extends AbstractProcessor{ Set elements = ElementFilter.typesIn(roundEnv.getElementsAnnotatedWith(Serialize.class)); TypeSpec.Builder classBuilder = TypeSpec.classBuilder(className).addModifiers(Modifier.PUBLIC); + classBuilder.addAnnotation(AnnotationSpec.builder(SuppressWarnings.class).addMember("value", "\"unchecked\"").build()); MethodSpec.Builder method = MethodSpec.methodBuilder("init").addModifiers(Modifier.PUBLIC, Modifier.STATIC); for(TypeElement elem : elements){ @@ -52,7 +53,7 @@ public class SerializeAnnotationProcessor extends AbstractProcessor{ TypeSpec.Builder serializer = TypeSpec.anonymousClassBuilder("") .addSuperinterface(ParameterizedTypeName.get( - ClassName.bestGuess("io.anuke.ucore.io.TypeSerializer"), type)); + ClassName.bestGuess("io.anuke.arc.Settings.TypeSerializer"), type)); MethodSpec.Builder writeMethod = MethodSpec.methodBuilder("write") .returns(void.class) @@ -83,8 +84,8 @@ public class SerializeAnnotationProcessor extends AbstractProcessor{ writeMethod.addStatement("stream.write" + capName + "(object." + name + ")"); readMethod.addStatement("object." + name + "= stream.read" + capName + "()"); }else{ - writeMethod.addStatement("io.anuke.ucore.core.Settings.getSerializer(" + typeName+ ".class).write(stream, object." + name + ")"); - readMethod.addStatement("object." + name + " = (" +typeName+")io.anuke.ucore.core.Settings.getSerializer(" + typeName+ ".class).read(stream)"); + writeMethod.addStatement("io.anuke.arc.Core.settings.getSerializer(" + typeName+ ".class).write(stream, object." + name + ")"); + readMethod.addStatement("object." + name + " = (" +typeName+")io.anuke.arc.Core.settings.getSerializer(" + typeName+ ".class).read(stream)"); } } @@ -93,7 +94,7 @@ public class SerializeAnnotationProcessor extends AbstractProcessor{ serializer.addMethod(writeMethod.build()); serializer.addMethod(readMethod.build()); - method.addStatement("io.anuke.ucore.core.Settings.setSerializer($N, $L)", Utils.elementUtils.getBinaryName(elem).toString().replace('$', '.') + ".class", serializer.build()); + method.addStatement("io.anuke.arc.Core.settings.setSerializer($N, $L)", Utils.elementUtils.getBinaryName(elem).toString().replace('$', '.') + ".class", serializer.build()); } classBuilder.addMethod(method.build()); diff --git a/build.gradle b/build.gradle index 582c186e19..f4ff0f9303 100644 --- a/build.gradle +++ b/build.gradle @@ -1,30 +1,58 @@ -buildscript { - repositories { +buildscript{ + repositories{ mavenLocal() mavenCentral() google() - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" } jcenter() } - dependencies { - classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0' + + dependencies{ + classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.5' classpath "com.badlogicgames.gdx:gdx-tools:1.9.9" } } -allprojects { +allprojects{ apply plugin: "idea" version = 'release' - ext { + ext{ versionNumber = '4' versionModifier = 'alpha' - if (!project.hasProperty("versionType")) versionType = 'official' + if(!project.hasProperty("versionType")) versionType = 'official' appName = 'Mindustry' gdxVersion = '1.9.9' roboVMVersion = '2.3.0' - uCoreVersion = '5871d2d0385370bc937fed3e5e301d6962a50476' + arcHash = null + + localArc = { + return (System.properties["release"] == null || System.properties["release"] == "false") && new File(projectDir.parent, '../Arc').exists() + } + + getArcHash = { + //get latest commit hash from gtihub since JITPack's '-snapshot' version doesn't work correctly + if(arcHash == null){ + try{ + arcHash = 'git ls-remote https://github.com/Anuken/Arc.git'.execute().text.split("\t")[0]//new JsonSlurper().parse(new URL("https://api.github.com/repos/Anuken/Arc/commits/master"))["sha"] + }catch(e){ + e.printStackTrace() + arcHash = "-SNAPSHOT"; + } + } + return arcHash + } + + arcModule = { String name -> + if(localArc()){ + return project(":Arc:$name") + }else{ + //skip to last submodule + if(name.contains(':')) name = name.split(':').last() + return "com.github.Anuken.Arc:$name:${getArcHash()}" + } + } getVersionString = { String buildVersion = getBuildVersion() @@ -43,7 +71,7 @@ allprojects { generateLocales = { def output = 'en\n' def bundles = new File(project(':core').projectDir, 'assets/bundles/') - bundles.listFiles().each { other -> + bundles.listFiles().each{ other -> if(other.name == "bundle.properties") return output += other.name.substring("bundle".length() + 1, other.name.lastIndexOf('.')) + "\n" } @@ -56,10 +84,9 @@ allprojects { try{ pfile.createNewFile() - }catch (Exception ignored){} - - if(pfile.exists()) { + }catch(Exception ignored){} + if(pfile.exists()){ props.load(new FileInputStream(pfile)) String buildid = getBuildVersion() @@ -74,39 +101,40 @@ allprojects { } } - repositories { + repositories{ mavenLocal() mavenCentral() - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - maven { url "https://oss.sonatype.org/content/repositories/releases/" } - maven { url 'https://jitpack.io' } + maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" } + maven{ url "https://oss.sonatype.org/content/repositories/releases/" } + maven{ url 'https://jitpack.io' } } } -project(":desktop") { +project(":desktop"){ apply plugin: "java" - dependencies { + dependencies{ compile project(":core") - compile project(":kryonet") + compile project(":net") + if(new File(projectDir.parent, '../debug').exists() && System.properties["release"] == null) compile project(":debug") - compile "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" - compile "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion" compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" + + compile arcModule("backends:backend-lwjgl3") compile 'com.github.MinnDevelopment:java-discord-rpc:v2.0.0' } } -project(":ios") { +project(":ios"){ apply plugin: "java" apply plugin: "robovm" task copyGen{ - doLast { - copy { - from("../core/build/classes/java/main/io/anuke/mindustry/gen/") { + doLast{ + copy{ + from("../core/build/classes/java/main/io/anuke/mindustry/gen/"){ include "**/*.java" } @@ -134,116 +162,96 @@ project(":ios") { props['app.mainclass'] = 'io.anuke.mindustry.IOSLauncher' props['app.executable'] = 'IOSLauncher' props['app.name'] = 'Mindustry' - props['app.build'] = (!props.containsKey("app.build") ? 40 : props['app.build'].toInteger() + 1)+"" + props['app.build'] = (!props.containsKey("app.build") ? 40 : props['app.build'].toInteger() + 1) + "" props.store(vfile.newWriter(), null) } build.dependsOn(incrementConfig) - build.dependsOn(copyGen) + if(file('robovm.properties').exists()){ + build.dependsOn(copyGen) + } - dependencies { + dependencies{ compile project(":core") - implementation project(":kryonet") + compile project(":net") + compile arcModule("backends:backend-robovm") + compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion" compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion" - compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion" compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios" - //compileOnly project(":annotations") } } -project(":core") { +project(":core"){ apply plugin: "java" - task finish { + task finish{ generateLocales() } - dependencies { + dependencies{ build.finalizedBy(finish) - def comp = System.properties["release"] == null || System.properties["release"] == "false" - if(!comp) println("Note: Compiling release build.") - - if(new File(projectDir.parent, '../uCore').exists() && comp){ - compile project(":uCore") - }else{ - compile "com.github.anuken:ucore:$uCoreVersion" - } - - if(new File(projectDir.parent, '../GDXGifRecorder').exists() && comp) { - compile project(":GDXGifRecorder") - } - - compile "com.badlogicgames.gdx:gdx:$gdxVersion" - compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion" - compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" + compile arcModule("arc-core") + compile arcModule("extensions:freetype") compileOnly project(":annotations") annotationProcessor project(":annotations") } } -project(":server") { +project(":server"){ apply plugin: "java" - configurations { - if(findProject(":android") != null){ - compile.exclude module: android - } - } - - dependencies { - + dependencies{ compile project(":core") - compile project(":kryonet") - compile "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion" - compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" + compile project(":net") + compile arcModule("backends:backend-headless") } } project(":tests"){ apply plugin: "java" - dependencies { + dependencies{ testImplementation project(":core") - testImplementation('org.junit.jupiter:junit-jupiter-api:5.1.0') - testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.1.0') - testImplementation "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion" - testImplementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" + testImplementation "org.junit.jupiter:junit-jupiter-params:5.3.1" + testImplementation "org.junit.jupiter:junit-jupiter-api:5.3.1" + testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.3.1" + compile arcModule("backends:backend-headless") } - test { + test{ useJUnitPlatform() workingDir = new File("../core/assets") } } -project(":tools") { +project(":tools"){ apply plugin: "java" - dependencies { + dependencies{ compile project(":core") } } -project(":annotations") { +project(":annotations"){ apply plugin: "java" - dependencies { + dependencies{ compile 'com.squareup:javapoet:1.11.0' } } -project(":kryonet") { +project(":net"){ apply plugin: "java" - dependencies { + dependencies{ compile project(":core") compile "org.lz4:lz4-java:1.4.1" - compile 'com.github.Anuken:kryonet:53b10247b1' + compile 'com.github.Anuken:kryonet:a64d2280880e80566ca1bdaffa55de43e51cad38' compile 'com.github.Anuken:WaifUPnP:05eb46bc577fd7674596946ba288c96c0cedd893' } -} \ No newline at end of file +} diff --git a/core/assets-raw/sprites/blocks/extra/nuclearreactor-shadow.png b/core/assets-raw/sprites/blocks/extra/nuclearreactor-shadow.png deleted file mode 100644 index 176497866c..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/nuclearreactor-shadow.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-1.png b/core/assets-raw/sprites/blocks/extra/shadow-1.png deleted file mode 100644 index edc6cdf9bb..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-1.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-2.png b/core/assets-raw/sprites/blocks/extra/shadow-2.png deleted file mode 100644 index 7b3cbfdc75..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-2.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-3.png b/core/assets-raw/sprites/blocks/extra/shadow-3.png deleted file mode 100644 index 0bc358b1db..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-3.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-4.png b/core/assets-raw/sprites/blocks/extra/shadow-4.png deleted file mode 100644 index 6bb965642b..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-4.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-5.png b/core/assets-raw/sprites/blocks/extra/shadow-5.png deleted file mode 100644 index e0020cbf44..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-5.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-6.png b/core/assets-raw/sprites/blocks/extra/shadow-6.png deleted file mode 100644 index b9c81ea3bc..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-6.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-corner.png b/core/assets-raw/sprites/blocks/extra/shadow-corner.png deleted file mode 100644 index 9f27566504..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-corner.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-round-1.png b/core/assets-raw/sprites/blocks/extra/shadow-round-1.png deleted file mode 100644 index 18db67b552..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-round-1.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-round-2.png b/core/assets-raw/sprites/blocks/extra/shadow-round-2.png deleted file mode 100644 index 5a6c5c4aa3..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-round-2.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-round-3.png b/core/assets-raw/sprites/blocks/extra/shadow-round-3.png deleted file mode 100644 index 2bda3d966b..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-round-3.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-round-4.png b/core/assets-raw/sprites/blocks/extra/shadow-round-4.png deleted file mode 100644 index 2d9ddf0d3d..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-round-4.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-rounded-2.png b/core/assets-raw/sprites/blocks/extra/shadow-rounded-2.png deleted file mode 100644 index 9faec224c2..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-rounded-2.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/extra/shadow-shock-mine.png b/core/assets-raw/sprites/blocks/extra/shadow-shock-mine.png deleted file mode 100644 index fed06b8960..0000000000 Binary files a/core/assets-raw/sprites/blocks/extra/shadow-shock-mine.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/power/power-node-large.png b/core/assets-raw/sprites/blocks/power/power-node-large.png index ee60b08d68..7af50508f5 100644 Binary files a/core/assets-raw/sprites/blocks/power/power-node-large.png and b/core/assets-raw/sprites/blocks/power/power-node-large.png differ diff --git a/core/assets-raw/sprites/blocks/power/power-node.png b/core/assets-raw/sprites/blocks/power/power-node.png index 2191ac583c..3e3a043d2d 100644 Binary files a/core/assets-raw/sprites/blocks/power/power-node.png and b/core/assets-raw/sprites/blocks/power/power-node.png differ diff --git a/core/assets-raw/sprites/blocks/production/itemvoid.png b/core/assets-raw/sprites/blocks/production/itemvoid.png index e6f9836868..1b0af09978 100644 Binary files a/core/assets-raw/sprites/blocks/production/itemvoid.png and b/core/assets-raw/sprites/blocks/production/itemvoid.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/bases/block-2.png b/core/assets-raw/sprites/blocks/turrets/bases/block-2.png index a1c8e9c7d1..63f2f93057 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/bases/block-2.png and b/core/assets-raw/sprites/blocks/turrets/bases/block-2.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/bases/block-3.png b/core/assets-raw/sprites/blocks/turrets/bases/block-3.png index ada915bfac..ec95108038 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/bases/block-3.png and b/core/assets-raw/sprites/blocks/turrets/bases/block-3.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/turrets/duo.png b/core/assets-raw/sprites/blocks/turrets/turrets/duo.png index 8882265fbc..c14c3eec09 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/turrets/duo.png and b/core/assets-raw/sprites/blocks/turrets/turrets/duo.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/turrets/hail.png b/core/assets-raw/sprites/blocks/turrets/turrets/hail.png index d59ea008e6..32de585540 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/turrets/hail.png and b/core/assets-raw/sprites/blocks/turrets/turrets/hail.png differ diff --git a/core/assets-raw/sprites/effects/clear.png b/core/assets-raw/sprites/effects/scale_marker.png similarity index 100% rename from core/assets-raw/sprites/effects/clear.png rename to core/assets-raw/sprites/effects/scale_marker.png diff --git a/core/assets-raw/sprites/pack.json b/core/assets-raw/sprites/pack.json index abd5ae6584..91480ffa76 100644 --- a/core/assets-raw/sprites/pack.json +++ b/core/assets-raw/sprites/pack.json @@ -2,5 +2,7 @@ duplicatePadding: true, combineSubdirectories: true, flattenPaths: true, - fast: true + maxWidth: 2048, + maxHeight: 2048, + fast: true, } diff --git a/core/assets-raw/sprites/ui/button-down.9.png b/core/assets-raw/sprites/ui/button-down.9.png index de800bf233..3e8c108d52 100644 Binary files a/core/assets-raw/sprites/ui/button-down.9.png and b/core/assets-raw/sprites/ui/button-down.9.png differ diff --git a/core/assets-raw/sprites/ui/button-edge-1.9.png b/core/assets-raw/sprites/ui/button-edge-1.9.png index 5833e18f2f..2502858baa 100644 Binary files a/core/assets-raw/sprites/ui/button-edge-1.9.png and b/core/assets-raw/sprites/ui/button-edge-1.9.png differ diff --git a/core/assets-raw/sprites/ui/button-edge-2.9.png b/core/assets-raw/sprites/ui/button-edge-2.9.png index 40ef1bad93..c6ee4208e1 100644 Binary files a/core/assets-raw/sprites/ui/button-edge-2.9.png and b/core/assets-raw/sprites/ui/button-edge-2.9.png differ diff --git a/core/assets-raw/sprites/ui/button-edge-3.9.png b/core/assets-raw/sprites/ui/button-edge-3.9.png index bc63ca5beb..349c5b2fe8 100644 Binary files a/core/assets-raw/sprites/ui/button-edge-3.9.png and b/core/assets-raw/sprites/ui/button-edge-3.9.png differ diff --git a/core/assets-raw/sprites/ui/button-edge-4.9.png b/core/assets-raw/sprites/ui/button-edge-4.9.png index 0d1aac1186..b8d4abb820 100644 Binary files a/core/assets-raw/sprites/ui/button-edge-4.9.png and b/core/assets-raw/sprites/ui/button-edge-4.9.png differ diff --git a/core/assets-raw/sprites/ui/button-over.9.png b/core/assets-raw/sprites/ui/button-over.9.png index e274175562..da58085c33 100644 Binary files a/core/assets-raw/sprites/ui/button-over.9.png and b/core/assets-raw/sprites/ui/button-over.9.png differ diff --git a/core/assets-raw/sprites/ui/button-select.9.png b/core/assets-raw/sprites/ui/button-select.9.png index 8011cad610..a636259c96 100644 Binary files a/core/assets-raw/sprites/ui/button-select.9.png and b/core/assets-raw/sprites/ui/button-select.9.png differ diff --git a/core/assets-raw/sprites/ui/button.9.png b/core/assets-raw/sprites/ui/button.9.png index f982c6939b..84d9576166 100644 Binary files a/core/assets-raw/sprites/ui/button.9.png and b/core/assets-raw/sprites/ui/button.9.png differ diff --git a/core/assets-raw/sprites/ui/logotext.png b/core/assets-raw/sprites/ui/logotext.png index bc40afe85a..fbe5a07d36 100644 Binary files a/core/assets-raw/sprites/ui/logotext.png and b/core/assets-raw/sprites/ui/logotext.png differ diff --git a/core/assets-raw/sprites/ui/pane-2.9.png b/core/assets-raw/sprites/ui/pane-2.9.png index bf9ca991b5..b83c929833 100644 Binary files a/core/assets-raw/sprites/ui/pane-2.9.png and b/core/assets-raw/sprites/ui/pane-2.9.png differ diff --git a/core/assets-raw/sprites/ui/pane.9.png b/core/assets-raw/sprites/ui/pane.9.png index 56c69a8dd8..eb07b24fa0 100644 Binary files a/core/assets-raw/sprites/ui/pane.9.png and b/core/assets-raw/sprites/ui/pane.9.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/bridge-conveyor.png b/core/assets-raw/sprites_replacement/blocks/distribution/bridge-conveyor.png new file mode 100644 index 0000000000..76b29569ea Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/bridge-conveyor.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-0.png new file mode 100644 index 0000000000..2e55ce429a Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-1.png new file mode 100644 index 0000000000..34a281b719 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-2.png new file mode 100644 index 0000000000..0b7db4da5c Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-3.png new file mode 100644 index 0000000000..a85cfdad60 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-0-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-0.png new file mode 100644 index 0000000000..18736adf66 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-1.png new file mode 100644 index 0000000000..807b2bf17d Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-2.png new file mode 100644 index 0000000000..faf67a8736 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-3.png new file mode 100644 index 0000000000..edbb81841f Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-1-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-0.png new file mode 100644 index 0000000000..ffd0e24f58 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-1.png new file mode 100644 index 0000000000..f249623779 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-2.png new file mode 100644 index 0000000000..3c04427e1a Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-3.png new file mode 100644 index 0000000000..439afb9c4b Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-2-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-0.png new file mode 100644 index 0000000000..2485ac23b6 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-1.png new file mode 100644 index 0000000000..c7997843d0 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-2.png new file mode 100644 index 0000000000..22e6868cce Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-3.png new file mode 100644 index 0000000000..7a94546637 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-3-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-0.png new file mode 100644 index 0000000000..3563503f6f Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-1.png new file mode 100644 index 0000000000..83c49920b4 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-2.png new file mode 100644 index 0000000000..c89f011734 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-3.png new file mode 100644 index 0000000000..acfe7e8136 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/conveyor-4-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-0.png new file mode 100644 index 0000000000..29af97eb5c Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-1.png new file mode 100644 index 0000000000..ecd054afa6 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-2.png new file mode 100644 index 0000000000..7dc49bd440 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-3.png new file mode 100644 index 0000000000..97e31e5722 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-0-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-0.png new file mode 100644 index 0000000000..7e7bb86c62 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-1.png new file mode 100644 index 0000000000..ffbafc5cdf Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-2.png new file mode 100644 index 0000000000..f9dd561d6d Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-3.png new file mode 100644 index 0000000000..5377953723 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-1-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-0.png new file mode 100644 index 0000000000..2f53cd53fd Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-1.png new file mode 100644 index 0000000000..29727566b0 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-2.png new file mode 100644 index 0000000000..464a7d4cf8 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-3.png new file mode 100644 index 0000000000..53c6124f64 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-2-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-0.png new file mode 100644 index 0000000000..aee4b266b2 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-1.png new file mode 100644 index 0000000000..a547a7790f Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-2.png new file mode 100644 index 0000000000..0dafebb699 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-3.png new file mode 100644 index 0000000000..ae7bad0c38 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-3-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-0.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-0.png new file mode 100644 index 0000000000..e001d5f945 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-1.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-1.png new file mode 100644 index 0000000000..992e544fc7 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-2.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-2.png new file mode 100644 index 0000000000..9c26ceef47 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-2.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-3.png b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-3.png new file mode 100644 index 0000000000..09db7b8269 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/conveyors/titanium-conveyor-4-3.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/distribution/junction.png b/core/assets-raw/sprites_replacement/blocks/distribution/junction.png new file mode 100644 index 0000000000..e84244e630 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/distribution/junction.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-0.png b/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-0.png new file mode 100644 index 0000000000..9dc9384971 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-1.png b/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-1.png new file mode 100644 index 0000000000..e219a5751d Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-5.png b/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-5.png new file mode 100644 index 0000000000..72461ba0b6 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/liquid/conduit-top-5.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/liquid/pulse-conduit-top-0.png b/core/assets-raw/sprites_replacement/blocks/liquid/pulse-conduit-top-0.png new file mode 100644 index 0000000000..c6a453fed9 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/liquid/pulse-conduit-top-0.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/liquid/pulse-conduit-top-1.png b/core/assets-raw/sprites_replacement/blocks/liquid/pulse-conduit-top-1.png new file mode 100644 index 0000000000..62f03471c4 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/liquid/pulse-conduit-top-1.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/power/power-node-large.png b/core/assets-raw/sprites_replacement/blocks/power/power-node-large.png new file mode 100644 index 0000000000..0a76d7e1a7 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/power/power-node-large.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/power/power-node.png b/core/assets-raw/sprites_replacement/blocks/power/power-node.png new file mode 100644 index 0000000000..0e7296b98f Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/power/power-node.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/power/powerinfinite.png b/core/assets-raw/sprites_replacement/blocks/power/powerinfinite.png new file mode 100644 index 0000000000..f4c6473df4 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/power/powerinfinite.png differ diff --git a/core/assets-raw/sprites_replacement/blocks/power/powervoid.png b/core/assets-raw/sprites_replacement/blocks/power/powervoid.png new file mode 100644 index 0000000000..fee2a2b3e8 Binary files /dev/null and b/core/assets-raw/sprites_replacement/blocks/power/powervoid.png differ diff --git a/core/assets-raw/sprites/effects/blank.png b/core/assets-raw/sprites_replacement/shapes/blank.png similarity index 100% rename from core/assets-raw/sprites/effects/blank.png rename to core/assets-raw/sprites_replacement/shapes/blank.png diff --git a/core/assets-raw/sprites/shapes/circle.png b/core/assets-raw/sprites_replacement/shapes/circle.png similarity index 100% rename from core/assets-raw/sprites/shapes/circle.png rename to core/assets-raw/sprites_replacement/shapes/circle.png diff --git a/core/assets-raw/sprites_replacement/shapes/clear.png b/core/assets-raw/sprites_replacement/shapes/clear.png new file mode 100644 index 0000000000..dc8beb206c Binary files /dev/null and b/core/assets-raw/sprites_replacement/shapes/clear.png differ diff --git a/core/assets-raw/sprites/shapes/shape-3.png b/core/assets-raw/sprites_replacement/shapes/shape-3.png similarity index 100% rename from core/assets-raw/sprites/shapes/shape-3.png rename to core/assets-raw/sprites_replacement/shapes/shape-3.png diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index ab0e7e3510..1226ab8965 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -92,6 +92,7 @@ text.server.kicked.nameInUse = There is someone with that name\nalready on this text.server.kicked.nameEmpty = Your chosen name is invalid. text.server.kicked.idInUse = You are already on this server! Connecting with two accounts is not permitted. text.server.kicked.customClient = This server does not support custom builds. Download an official version. +text.server.kicked.gameover = Game over! text.host.info = The [accent]host[] button hosts a server on port [scarlet]6567[]. \nAnybody on the same [LIGHT_GRAY]wifi or local network[] should be able to see your server in their server list.\n\nIf you want people to be able to connect from anywhere by IP, [accent]port forwarding[] is required.\n\n[LIGHT_GRAY]Note: If someone is experiencing trouble connecting to your LAN game, make sure you have allowed Mindustry access to your local network in your firewall settings. text.join.info = Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[LIGHT_GRAY]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP. text.hostserver = Host Game @@ -270,6 +271,7 @@ text.error.timedout = Timed out!\nMake sure the host has port forwarding set up, text.error.mismatch = Packet error:\npossible client/server version mismatch.\nMake sure you and the host have the latest version of Mindustry! text.error.alreadyconnected = Already connected. text.error.mapnotfound = Map file not found! +text.error.io = Network I/O error. text.error.any = Unknown network error. text.settings.language = Language @@ -384,6 +386,8 @@ category.multiplayer.name = Multiplayer command.attack = Attack command.retreat = Retreat command.patrol = Patrol +keybind.gridMode.name = Block Select +keybind.gridModeShift.name = Category Select keybind.press = Press a key... keybind.press.axis = Press an axis or key... keybind.screenshot.name = Map Screenshot @@ -406,7 +410,7 @@ keybind.toggle_menus.name = Toggle menus keybind.chat_history_prev.name = Chat history prev keybind.chat_history_next.name = Chat history next keybind.chat_scroll.name = Chat scroll -keybind.drop_unit.name = drop unit +keybind.drop_unit.name = Drop Unit keybind.zoom_minimap.name = Zoom minimap mode.text.help.title = Description of modes mode.waves.name = Waves diff --git a/core/assets/bundles/bundle_cs.properties b/core/assets/bundles/bundle_cs.properties new file mode 100644 index 0000000000..bc230d8ef4 --- /dev/null +++ b/core/assets/bundles/bundle_cs.properties @@ -0,0 +1,791 @@ +text.credits.text = Vytvořil [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[] +text.credits = Kredity +text.contributors = Překladatelé a Sponzoři +text.discord = Připoj se k Mindustry na Discordu! +text.link.discord.description = Oficiální Mindustry chatroom na Discordu! +text.link.github.description = Zdrojový kód hry +text.link.dev-builds.description = Nestabilní verze vývoje hry +text.link.trello.description = Oficiální Trello board pro plánované funkce +text.link.itch.io.description = itch.io stránka pro stažení PC nebo webové verze +text.link.google-play.description = Google Play store +text.link.wiki.description = Oficiální Mindustry wiki +text.linkfail = Nepodařilo se otevřít odkaz!\nURL byla zkopírována do schránky. +text.screenshot = Snímek obrazovky uložen {0} +text.gameover = Konec hry +text.gameover.pvp = [accent] {0}[] Tým Vyhrál! +text.sector.gameover = Tento sektor byl ztracen. Znovu obsadit? +text.sector.retry = Znovu +text.highscore = [accent]Nový Rekord! +text.wave.lasted = Vydržel jsi do vlny [accent]{0}[]. +text.level.highscore = Nejvyšší skóre: [accent]{0} +text.level.delete.title = Potvrdit smazání +text.map.delete = Jsi si jistý že chceš smazat mapu "[accent]{0}[]"? +text.level.select = Výběr levelu +text.level.mode = Herní mód: +text.construction.desktop = K odznačení bloku nebo k zastavení stavby, [accent]stiskni mezerník[]. +text.construction.title = Návod ke stavbě bloků +text.construction = Právě jsi vybral [accent]mód stavby bloků[].\n\nK pokládání, jednoduše klikni na vhodnou lokaci poblíž tvé lodi.\nJakmile jsis vybral nějaké bloky, stiskni pole potvrzení, a tvoje loď je začne sama stavět.\n\n- [accent]Odstranění bloků[] z tvého výběru kliknutím na ně.\n- [accent]Formace výběru[] provedeš podržením a táhnutím do libovolného směru.\n- [accent]Položení bloků v řadě[] Provedeš stisknutím na prázdné pole a tažením do libovolného směru.\n- [accent]Zrušení stavby nebo výběru[] provedeš stisknutím X v levém dolním rohu. +text.deconstruction.title = Návod k dekonstrukci bloků. +text.deconstruction = Právě jsi vybral [accent]Mód dekonstrukce bloků[].\n\nK boření staveb, jednoduše vyber blok poblíž tvé lodi.\nJakmile jsis vybral nějaké bloky, stiskni pole potvrzení, a tvoje loď je začne sama dekonstruovat.\n\n- [accent]Odstranění bloků[] z tvého výběru kliknutím na ně.\n- [accent]Odstranění bloků v oblasti[] provedeš stisknutím prázdného pole a přetažením do jakéhokoliv směru.\n- [accent]Zrušení dekonstrukce nebo výběru[] stisknutím X v levém dolním rohu. +text.showagain = Znovu neukazovat ! +text.coreattack = < Jádro je pod útokem! > +text.unlocks = Odemykatelné +text.savegame = Uložit hru +text.loadgame = Načíst hru +text.joingame = Připojit se ke hře +text.addplayers = Přidat/Odebrat hráče +text.customgame = Vlastní hra +text.sectors = Sektory +text.sector = Sektor: [LIGHT_GRAY]{0} +text.sector.time = Čas: [LIGHT_GRAY]{0} +text.sector.deploy = Výsadek +text.sector.abandon = Opustit +text.sector.abandon.confirm = Jsi si jistý že chceš opustit veškerý postup v tomto sektoru?\nTento krok je nevratný! +text.sector.resume = Pokračovat +text.sector.locked = [scarlet][[Incomplete] +text.sector.unexplored = [accent][[Unexplored] +text.missions = Mise:[LIGHT_GRAY] {0} +text.mission = Mise:[LIGHT_GRAY] {0} +text.mission.main = Hlavní mise:[LIGHT_GRAY] {0} +text.mission.info = Informace o misi +text.mission.complete = Mise splněna! +text.mission.complete.body = Sektor {0},{1} Byl dobyt. +text.mission.wave = Udrž se[accent] {0}/{1} []Vln\nVlna za {2} +text.mission.wave.enemies = Udrž se[accent] {0}/{1} []vln\n{2} Nepřátel +text.mission.wave.enemy = Udrž se[accent] {0}/{1} []vln\n{2} Nepřátel +text.mission.wave.menu = Udrž se[accent] {0}[] vln +text.mission.battle = Znič nepřátelské jádro +text.mission.resource.menu = Získej {0} x{1} +text.mission.resource = Získej {0}:\n[accent]{1}/{2}[] +text.mission.block = Vytvoř {0} +text.mission.unit = Vytvoř {0} Jednotek +text.mission.command = Pošli rozkaz {0} jednotkám +text.mission.linknode = Propoj energetický uzel +text.mission.display = [accent]Mise:\n[LIGHT_GRAY]{0} +text.mission.mech = Změň na Mecha[accent] {0}[] +text.mission.create = Vytvoř[accent] {0}[] +text.none = +text.close = Zavřít +text.quit = Ukončit +text.maps = Mapy +text.continue = Pokračovat +text.nextmission = Další Mise +text.maps.none = [LIGHT_GRAY]Žádné mapy nebyly nalezeny! +text.about.button = O hře +text.name = Name: +text.noname = Nejdřív si vyber[accent] herní jméno[]. +text.filename = Jméno složky: +text.unlocked = Nový blok odemknut! +text.unlocked.plural = Nové bloky odemknuty! +text.players = {0} hráčů online +text.players.single = {0} hráč online +text.server.closing = [accent]Zavírám server... +text.server.kicked.kick = Byl jsi vykopnut ze serveru! +text.server.kicked.serverClose = Server je zavřený. +text.server.kicked.sectorComplete = Sektor Dokončen. +text.server.kicked.sectorComplete.text = Tvá mise je dokončena.\nServer teď bude pokračovat v dalším sektoru. +text.server.kicked.clientOutdated = Zastaralý klient hry! Aktualizuj si hru! +text.server.kicked.serverOutdated = Zastaralý server! Řekni hostiteli o aktualizaci! +text.server.kicked.banned = Jsi zabanován na tomto serveru. +text.server.kicked.recentKick = Před nedávnem jsi byl vykopnut.\nPočkej než se znovu připojíš. +text.server.kicked.nameInUse = Někdo se stejným jménem\nje aktuálně na serveru. +text.server.kicked.nameEmpty = Tvé jméno je neplatné. +text.server.kicked.idInUse = Již jsi na tomhle serveru připojen! Připojování se dvěma účty není povoleno. +text.server.kicked.customClient = Tento server nepodporuje vlastní verze hry. Stáhni si oficiální verzi. +text.host.info = [accent]hostitel[] hostuje server na portu [scarlet]6567[]. \nKdokoliv na stejné [LIGHT_GRAY]wifi nebo místní síti[] by měl vidět server ve svém listu serverů.\n\nJestli chcete aby se uživatelé připojovali odkudkoliv pomocí IP, [accent]přesměrování portů[] je nutné.\n\n[LIGHT_GRAY]Poznámka: Jestli někdo má problém s připojením ke své LAN hře, ujistěte se že má Mindustry povolený přístup k místní síti v nastavení Firewallu. +text.join.info = Tady můžeš vložit [accent]IP serveru[] ke kterému se chceš připojit, nebo objevit [accent]Servery Místní sítě[] ke kterým se chceš připojit.\nLAN i Multiplayer jsou podporovány.\n\n[LIGHT_GRAY]Poznámka: Není žádný globální seznam serverů; Pokud se budeš chtít připojit k někomu pomocí IP, budeš jí muset znát od hostitele. +text.hostserver = Hostovat hru +text.hostserver.mobile = Hostovat\nHru +text.host = Hostitel +text.hosting = [accent]Otevírám server... +text.hosts.refresh = Obnovit +text.hosts.discovering = Hledám hry LAN +text.server.refreshing = Obnovuji servery +text.hosts.none = [lightgray]Žádné místní hry nebyly nalezeny! +text.host.invalid = [scarlet]Nejde se připojit k hostiteli. +text.trace = Vystopovat hráče +text.trace.playername = Jméno hráče: [accent]{0} +text.trace.ip = IP: [accent]{0} +text.trace.id = Unikátní ID: [accent]{0} +text.trace.android = Android Klient: [accent]{0} +text.trace.modclient = Vlastní Klient: [accent]{0} +text.trace.totalblocksbroken = Bloků zničeno celkem: [accent]{0} +text.trace.structureblocksbroken = Bloky struktůr zničeno : [accent]{0} +text.trace.lastblockbroken = Poslední zničený blok: [accent]{0} +text.trace.totalblocksplaced = Bloků položeno celkem: [accent]{0} +text.trace.lastblockplaced = Poslední blok položen: [accent]{0} +text.invalidid = Neplatná IP klienta! Poslat zprávu o chybě. +text.server.bans = Bany. +text.server.bans.none = Žádní hráči s banem nebyli nalezeni. +text.server.admins = Admini +text.server.admins.none = Žádní admini nebyli nalezeni. +text.server.add = Přidat server +text.server.delete = Jsi si jistý že chceš smazat tento server? +text.server.hostname = Hostitel: {0} +text.server.edit = Upravit server +text.server.outdated = [crimson]Zastaralý server![] +text.server.outdated.client = [crimson]Zastaralý klient![] +text.server.version = [lightgray]Verze: {0} {1} +text.server.custombuild = [yellow]Vlastní verze +text.confirmban = Jsi si jistý že chceš zabanovat tohoto hráče? +text.confirmkick = Jsi si jistý že chceš vykopnout tohoto hráče? +text.confirmunban = Jsi si jistý že chceš odbanovat tohoto hráče +text.confirmadmin = Jsi si jistý že chceš tohoto hráče pasovat na admina? +text.confirmunadmin = Jsi si jistý že chceš odebrat práva tomuto hráči? +text.joingame.title = Připojit se ke hře +text.joingame.ip = Adresa: +text.disconnect = Odpojen. +text.disconnect.data = Chyba načtení dat světa! +text.connecting = [accent]Připojuji se... +text.connecting.data = [accent]Načítám data světa... +text.server.port = Port: +text.server.addressinuse = Adresu již někdo používá! +text.server.invalidport = Neplatné číslo portu! +text.server.error = [crimson]Chyba při hostování serveru: [accent]{0} +text.save.old = Tato uložená pozice je pro starší verzi hry a již není možno jí použít.\n\n[LIGHT_GRAY]Zpětná kompatibilita bude implementována v plné verzi 4.0. +text.save.new = Nové uložení +text.save.overwrite = Jsi si jistý že chceš přepsat\ntento ukládaci slot? +text.overwrite = Přepsat +text.save.none = Žádné uložené pozice nebyly nalezeny +text.saveload = [accent]Ukládám... +text.savefail = Nepodařilo se uložit hru! +text.save.delete.confirm = Jsi si jistý že chceš smazat toto uložení? +text.save.delete = Smazat +text.save.export = Exportovat uložení +text.save.import.invalid = [accent]Toto uložení je neplatné! +text.save.import.fail = [crimson]Nepodařilo se importovat uložení: [accent]{0} +text.save.export.fail = [crimson]Nepodařilo se exportovat uložení: [accent]{0} +text.save.import = Importovat uložení +text.save.newslot = Uložit hru: +text.save.rename = Přejmenovat +text.save.rename.text = Nové jméno: +text.selectslot = Vyber uložení. +text.slot = [accent]Slot {0} +text.save.corrupted = [accent]Uložení je poškozené nebo neplatné\nPokud jsi právě aktualizoval svou hru, je to možná změnou formátu pro ukládání a [scarlet]NE[] chyba hry. +text.sector.corrupted = [accent]Byla nalezena uložená pozice pro tentosektor, ale načtení se nezdařilo.\nNová pozice byla vytvořena. +text.empty = +text.on = On +text.off = Off +text.save.autosave = Automatické uložení: {0} +text.save.map = Mapa: {0} +text.save.wave = Vlna {0} +text.save.difficulty = Obtížnost: {0} +text.save.date = Naposledy uloženo: {0} +text.save.playtime = Herní čas: {0} +text.confirm = Potvrdit +text.delete = Smazat +text.ok = OK +text.open = Otevřít +text.cancel = Zrušit +text.openlink = Otevřít Odkaz +text.copylink = Zkopírovat Odkaz +text.back = Zpět +text.quit.confirm = Jsi si jistý že chceš ukončit ? +text.changelog.title = Záznam změn +text.changelog.loading = Načítání záznamu změn... +text.changelog.error.android = [accent]Berte v potaz že záznam změn někdy nefunguje na Android 4.4 a níž!\nJe to kvůli interní chybě v systému Android. +text.changelog.error.ios = [accent]Záznam změn nění aktuálně podporován v systému IOS. +text.changelog.error = [scarlet]Chyba v načítání záznamu změn!\nZkontrolujte své připojení k internetu. +text.changelog.current = [yellow][[Aktuální verze] +text.changelog.latest = [accent][[nejnovější verze] +text.loading = [accent]Načítám... +text.saving = [accent]Ukládám... +text.wave = [accent]Vlna {0} +text.wave.waiting = [LIGHT_GRAY]Vlna za {0} +text.waiting = [LIGHT_GRAY]Čekám... +text.waiting.players = Čekání na hráče... +text.wave.enemies = [LIGHT_GRAY]{0} Nepřátel zbývá +text.wave.enemy = [LIGHT_GRAY]{0} Nepřítel zbývá +text.loadimage = Nahrát obrázek +text.saveimage = Uložit obrázek +text.unknown = Neznámý +text.custom = Vlastní +text.builtin = Zabudovaný +text.map.delete.confirm = Jsi si jistý žechceš tuto mapu smazat? tato akce je nevratná! +text.map.random = [accent]Náhodná mapa +text.map.nospawn = Tato mapa nemá žádná jádra pro hráče ke spawnutí! přidej[ROYAL] blue[] jádro na tuto mapu v editoru. +text.map.nospawn.pvp = Tato mapa nemá žádné nepřátelské jádra pro hráče ke spawnutí! přidej[SCARLET] red[] jádro na tuto mapu v editoru. +text.map.invalid = Chyba v načítání mapy: poškozený nebo neplatný soubor mapy. +text.editor.brush = Štětec +text.editor.slope = \\ +text.editor.openin = Otevřít v editoru. +text.editor.oregen = Generovat nerostné zdroje. +text.editor.oregen.info = Generování nerostných zdrojů: +text.editor.mapinfo = Informace o mapě +text.editor.author = Autor: +text.editor.description = Popis: +text.editor.name = Jméno: +text.editor.teams = Týmy +text.editor.elevation = Výška +text.editor.errorimageload = Chyba při načítání souboru:\n[accent]{0} +text.editor.errorimagesave = Chyba při ukládání souboru:\n[accent]{0} +text.editor.generate = Generovat +text.editor.resize = Změnit velikost +text.editor.loadmap = Načíst mapu +text.editor.savemap = Uložit mapu +text.editor.saved = Uloženo! +text.editor.save.noname = Tvoje mapa nemá jméno! Jméno nastavíš v Informacích o mapě. +text.editor.save.overwrite = Tvoje mapa přepisuje vestavěnou mapu! Vyber odlišné jméno v Informacích o mapě. +text.editor.import.exists = [scarlet]Není možno importovat:[] vestavěná mapa jménem '{0}' již existuje! +text.editor.import = Import +text.editor.importmap = Importovat mapu +text.editor.importmap.description = Importovat již existující mapu +text.editor.importfile = Importovat soubor +text.editor.importfile.description = Importovat externí soubor mapy +text.editor.importimage = Importovat Legacy Obrázek +text.editor.importimage.description = Importovat exrerní obrázek mapy +text.editor.export = Export +text.editor.exportfile = Exportovat soubor +text.editor.exportfile.description = Exportovat soubor mapy +text.editor.exportimage = Exportovat obrázek terénu +text.editor.exportimage.description = Exportovat obrázek souboru mapy +text.editor.loadimage = Importovat terén +text.editor.saveimage = Exportovat terén +text.editor.unsaved = [scarlet]Máš neuložené změny![]\nPřesto chceš ukončit? +text.editor.resizemap = Změnit velikost mapy +text.editor.mapname = Jméno mapy: +text.editor.overwrite = [accent]Varování!\nToto přepíše již existující mapu. +text.editor.overwrite.confirm = [scarlet]Varování![] Mapa s tímto jménem již existuje. Jsi si jistý že ji chceš přepsat? +text.editor.selectmap = Vyber mapu k načtení: +text.width = Šířka: +text.height = Výška: +text.menu = Hlavní menu +text.play = Hrát +text.load = Načíst +text.save = Uložit +text.fps = FPS: {0} +text.tps = TPS: {0} +text.ping = Odezva: {0}ms +text.language.restart = Prosím restartuj hru aby se provedla změna jazyka! +text.settings = Nastavení +text.tutorial = Tutoriál +text.editor = Editor +text.mapeditor = Editor map +text.donate = Darovat + +text.connectfail = [crimson]Nepovedlo se připojení k serveru:\n\n[accent]{0} +text.error.unreachable = Server je nedostupný.\nJe adresa napsaná správně? +text.error.invalidaddress = Neplatná adresa. +text.error.timedout = Čas vypršel!\nUjisti se že hostitel má nastavené přesměrování portů a adresa je napsaná správně! +text.error.mismatch = Chyba Packetu:\nKlient/Verze serveru se neshodují.\nUjisti se že máš nejnovější verzi Mindustry! +text.error.alreadyconnected = Již připojeno. +text.error.mapnotfound = Soubor mapy nebyl nalezen! +text.error.any = neznámá chyba sítě. + +text.settings.language = Jazyk +text.settings.reset = nastavit výchozí +text.settings.rebind = Přenastavit +text.settings.controls = Ovládání +text.settings.game = Hra +text.settings.sound = zvuky +text.settings.graphics = Zobrazení +text.settings.cleardata = Resetovat data hry... +text.settings.clear.confirm = Jsi si jistý že chceš resetovat obsah hry?\nTento krok je nevratný! +text.settings.clearall.confirm = [scarlet]Varování![]\nToto vyresetuje všechna data, včetně uložení, map, odemykatelných a nastavení ovládání.\nJakmile stiskneš 'ok' data se vymažou a hra se automaticky ukončí. +text.settings.clearsectors = Vymazaní sektorů +text.settings.clearunlocks = Vymazání odemykatelných +text.settings.clearall = Vymazat všechno +text.paused = [accent]< Pauza > +text.yes = Ano +text.no = Ne +text.info.title = Informace +text.error.title = [crimson]Objevila se chyba +text.error.crashtitle = Objevila se chyba +text.blocks.unknown=[LIGHT_GRAY]??? +text.blocks.blockinfo = Informace o bloku +text.blocks.powercapacity = Kapacita energie +text.blocks.powershot = Energie na výstřel +text.blocks.targetsair = Zaměřuje vzdušné jednotky +text.blocks.itemspeed = Zpracování +text.blocks.shootrange = Dostřel +text.blocks.size = velikost +text.blocks.liquidcapacity = Kapacita tekutin +text.blocks.maxitemssecond = Max předmětů +text.blocks.powerrange = Rozsah energie +text.blocks.poweruse = Spotřebuje energie +text.blocks.powerdamage = Energie na poškození +text.blocks.inputitemcapacity = Kapacita vstupních předmětů +text.blocks.outputitemcapacity = Kapacita výstupních předmětů +text.blocks.itemcapacity = kapacita předmětů +text.blocks.basepowergeneration = Základní generování energie +text.blocks.powertransferspeed = Přenos energie +text.blocks.craftspeed = Rychlost produkce +text.blocks.inputliquid = Vstupní tekutiny +text.blocks.inputliquidaux = Aux tekutina +text.blocks.inputitem = Vstupní předmět +text.blocks.inputitems = Vstupní předměty +text.blocks.outputitem = Výstupní předmět +text.blocks.drilltier = Vrtatelné +text.blocks.drillspeed = Základní rychlost vrtu +text.blocks.liquidoutput = Výstup tekutin +text.blocks.liquidoutputspeed = Rychlost výstupu tekutin +text.blocks.liquiduse = Spotřebuje tekutin +text.blocks.coolant = Chlazení +text.blocks.coolantuse = Spotřeba chlazení +text.blocks.inputliquidfuel = Palivo-tekutina +text.blocks.liquidfueluse = Spotřeba Paliva-tekutiny +text.blocks.boostitem = Předmět pro zrychlení +text.blocks.boostliquid = Tekutina pro zrychlení +text.blocks.health = Životy +text.blocks.inaccuracy = Nepřesnost/výchylka +text.blocks.shots = Střely +text.blocks.reload = Střely za sekundu +text.blocks.inputfuel = Palivo +text.blocks.fuelburntime = Čas spalování paliva +text.blocks.inputcapacity = Vstupní kapacita +text.blocks.outputcapacity = Výstupní kapacita +text.unit.blocks = Bloky +text.unit.powersecond = jednotek energie/sekunda +text.unit.liquidsecond = jednotek tekutin/sekundu +text.unit.itemssecond = předmětů/sekundu +text.unit.pixelssecond = pixelů/sekundu +text.unit.liquidunits = jednotek tekutin +text.unit.powerunits = jednotek energie +text.unit.degrees = úhly +text.unit.seconds = sekundy +text.unit.items = předměty +text.category.general = Všeobecné +text.category.power = Energie +text.category.liquids = Tekutiny +text.category.items = Předměty +text.category.crafting = Vyžaduje +text.category.shooting = Střílí +text.category.optional = Volitelné vylepšení +setting.indicators.name = Indikátor pro spojence +setting.autotarget.name = Automaticky zaměřuje +setting.fpscap.name = Max FPS +setting.fpscap.none = žádný +setting.fpscap.text = {0} FPS +setting.difficulty.training = Trénink +setting.difficulty.easy = lehká +setting.difficulty.normal = normální +setting.difficulty.hard = težká +setting.difficulty.insane = šílená +setting.difficulty.name = Obtížnost: +setting.screenshake.name = Třes obrazu +setting.effects.name = Zobrazit efekty +setting.sensitivity.name = Citlivost ovladače +setting.saveinterval.name = Interval automatického ukládání +setting.seconds = {0} Sekund +setting.fullscreen.name = Celá obrazovka +setting.fps.name = Ukázat snímky/sekundu +setting.vsync.name = Vertikální synchronizace +setting.lasers.name = Ukázat laser energie +setting.minimap.name = Ukázat minimapu +setting.musicvol.name = Hlasitost hudby +setting.mutemusic.name = Ztišit hudbu +setting.sfxvol.name = SFX hlasitost +setting.mutesound.name = Ztišit zvuky +setting.crashreport.name = Poslat anonymní spis o zhroucení hry +text.keybind.title = Přenastavit klávesy +category.general.name = Všeobecné +category.view.name = Pohled +category.multiplayer.name = Multiplayer +command.attack = Útok +command.retreat = Ústup +command.patrol = Hlídkovat +keybind.gridMode.name = Výběr bloků +keybind.gridModeShift.name = Výběr kategorie +keybind.press = Stiskni klívesu... +keybind.press.axis = Stiskni osu nebo klávesu... +keybind.screenshot.name = Sníměk mapy +keybind.move_x.name = Pohyb na X +keybind.move_y.name = Pohyb na Y +keybind.select.name = Vybrat/Střílet +keybind.break.name = Ničit +keybind.deselect.name = Odznačit +keybind.shoot.name = Střílet +keybind.zoom_hold.name = Přiblížení-podržení +keybind.zoom.name = přiblížení +keybind.menu.name = Hlavní nabídka +keybind.pause.name = pauza +keybind.dash.name = Sprint +keybind.chat.name = Chat +keybind.player_list.name = Seznam hráčů +keybind.console.name = Konzole +keybind.rotate.name = Otočit +keybind.toggle_menus.name = Přepínání nabídek +keybind.chat_history_prev.name = Předchozí historie chatu +keybind.chat_history_next.name = Další historie chatu +keybind.chat_scroll.name = Chat posun +keybind.drop_unit.name = Zahodit jednotku +keybind.zoom_minimap.name = Přiblížit minimapu +mode.text.help.title = Popis módů +mode.waves.name = Vlny +mode.waves.description = Normální mód. Limitované zdroje a automaticky přicházející Vlny nepřátel. +mode.sandbox.name = Sandbox +mode.sandbox.description = Nekonečné zdroje a žádný čas pro vlny nepřátel. +mode.freebuild.name = Freebuild +mode.freebuild.description = Limitované zdroje a žádný čas pro vlny nepřátel. +mode.pvp.name = PvP +mode.pvp.description = Bojuj proti ostatním hráčům v lokální síti. +mode.attack.name = Útok +mode.attack.descrption = Žádné vlny, cílem je zničit nepřátelskou základnu. +content.item.name = Předměty +content.liquid.name = Tekutiny +content.unit.name = jednotky +content.recipe.name = Bloky +content.mech.name = Mechy +item.stone.name = Kámen +item.stone.description = Běžný, nespracovaný materiál ,Používá se k separaci a přečišťování do jiných materiáů na roztavení na lávu. +item.copper.name = Měď +item.copper.description = Užitečný strukturální materiál. Používá se rozsáhle v ostatních typech bloků. +item.lead.name = Olovo +item.lead.description = Základní počáteční materiál. Požívá se rozsáhle v elektronice a v blocích pro transport tekutin. +item.coal.name = Uhlí +item.coal.description = Běžné a snadno dostupné palivo, pochází z Ostravy. +item.dense-alloy.name = Hustá Slitina +item.dense-alloy.description = Těžká slitina z Olova a Mědi. Používá se v pokročilých transportních blocích a ve vyšší třídě vrtů. +item.titanium.name = Titánium +item.titanium.description = Vzácný, velice lehký kov, používá se rozsáhle v trasportu tekutin, vrtech a letounech. +item.thorium.name = Thorium +item.thorium.description = Hustý, radioaktivní materiál, používá se jako strukturální podpora a jako nuklearní palivo. +item.silicon.name = Křemík +item.silicon.description = Extrémně užitečný polovodič, aplikuje se v solárních panelech a v komplexní elektronice. +item.plastanium.name = Plastanium +item.plastanium.description = Lehký, kujný materiál, používá se v pokročilém letectví a jako fragmentační střelivo. +item.phase-fabric.name = Fázová tkanina +item.phase-fabric.description = Skoro beztížná substance používaná v pokročilé elektronice a v sebeopravné technologii. +item.surge-alloy.name = Impulzní slitina +item.surge-alloy.description = Pokročilá slitina s unikátními elektronickými vlastnostmi. +item.biomatter.name = BioHmota +item.biomatter.description = Shluk organické kaše; Používá se k přeměně na ropu nebo jako jednoduché palivo. +item.sand.name = Písek +item.sand.description = Běžný materiál rozšířeně používaný v spalování slitin. +item.blast-compound.name = Výbušná směs +item.blast-compound.description = Těkavá směs používaná v bombácha a výbušninách. Dá se spalovat ale jako palivo se nedoporučuje. +item.pyratite.name = Pyratite +item.pyratite.description = Extrémně vznětlivá substance, používá ve vznětovém střelivu. +liquid.water.name = Voda +liquid.lava.name = Láva +liquid.oil.name = Ropa +liquid.cryofluid.name = Cryofluid +mech.alpha-mech.name = Alfa +mech.alpha-mech.weapon = Těžký Opakovač +mech.alpha-mech.ability = Roj dronů +mech.alpha-mech.description = Standartní mech. Má slušnou rychlost a poškození; Může vytvořit až 3 drony Pro zvýšenou ofenzivní způsobilost. +mech.delta-mech.name = Delta +mech.delta-mech.weapon = Obloukový generátor +mech.delta-mech.ability = Průtok +mech.delta-mech.description = Rychlý, Lehce obrněný mech vytvořený pro udeř a uteč akce. Působí malé poškození vůči struktůrám, ale může zneškodnit velkou skupinu nepřátelských jednotek velmi rychle svýmy elektro-obloukovými zbraněmi +mech.tau-mech.name = Tau +mech.tau-mech.weapon = Restruktní Laser +mech.tau-mech.ability = Opravná dávka +mech.tau-mech.description = Podpůrný mech. Léčí spojenecké stavby a jednotky střelbou do nich. Může léčit i spojence ve svém poli působení. +mech.omega-mech.name = Omega +mech.omega-mech.weapon = Rojové střely +mech.omega-mech.ability = Obrněná Konfigurace +mech.omega-mech.description = Objemný a velice dovře obrněný mech, určen pro útok v přední linii. Jeho schopnost obrnění blokuje až 90% příchozího poškození. +mech.dart-ship.name = Šipka +mech.dart-ship.weapon = Opakovač +mech.dart-ship.description = Standartní loď. Poměrně rychlý a lehký, má malou ofenzívu a pomalou rychlost těžení. +mech.javelin-ship.name = Oštěp +mech.javelin-ship.description = Loď stylu udeř a uteč. Zpočátku pomalý ale umí akcelerovat do obrovské rychlosti a létat u nepřátelských základen a působit značné škody svými elektrickými zbraněmi a raketami. +mech.javelin-ship.weapon = Dávka Raket +mech.javelin-ship.ability = Výbojový Posilovač +mech.trident-ship.name = Trojzubec +mech.trident-ship.description = Těžký bombardér. Docela dobře obrněný. +mech.trident-ship.weapon = Bombová zátoka +mech.glaive-ship.name = Glaiva +mech.glaive-ship.description = Obrovská, Dobře obrněná střelecká loď. Vybavena zápalným opakovačem. Dobrá akcelerace a maximální rychlost. +mech.glaive-ship.weapon = Plamenný Opakovač +text.item.explosiveness = [LIGHT_GRAY]Výbušnost: {0}% +text.item.flammability = [LIGHT_GRAY]Zápalnost: {0}% +text.item.radioactivity = [LIGHT_GRAY]Radioaktivita: {0}% +text.item.fluxiness = [LIGHT_GRAY]Tok energie: {0}% +text.unit.health = [LIGHT_GRAY]Životy: {0} +text.unit.speed = [LIGHT_GRAY]Rychlost: {0} +text.mech.weapon = [LIGHT_GRAY]Zbraň: {0} +text.mech.armor = [LIGHT_GRAY]Brnění: {0} +text.mech.itemcapacity = [LIGHT_GRAY]Kapacita předmětů: {0} +text.mech.minespeed = [LIGHT_GRAY]Rychlost těžení: {0} +text.mech.minepower = [LIGHT_GRAY]Síla těžení: {0} +text.mech.ability = [LIGHT_GRAY]Schopnost: {0} +text.liquid.heatcapacity = [LIGHT_GRAY]Kapacita teploty: {0} +text.liquid.viscosity = [LIGHT_GRAY]Viskozita: {0} +text.liquid.temperature = [LIGHT_GRAY]Teplota: {0} +block.constructing = {0} [LIGHT_GRAY](Constructing) +block.spawn.name = Nepřátelský Spawn +block.core.name = Jádro +block.metalfloor.name = Kovová podlaha +block.deepwater.name = Hluboká voda +block.water.name = Voda +block.lava.name = Láva +block.tar.name = Tar +block.blackstone.name = Černý kámen +block.stone.name = Kámen +block.dirt.name = Hlína +block.sand.name = Písek +block.ice.name = Led +block.snow.name = Sníh +block.grass.name = Tráva +block.shrub.name = Keř +block.rock.name = Kámen +block.blackrock.name = Černý kámen +block.icerock.name = Ledový kámen +block.copper-wall.name = Měděná zeď +block.copper-wall-large.name = Velká měděná zeď +block.dense-alloy-wall.name = Zeď husté slitiny +block.dense-alloy-wall-large.name = Velká zeď husté slitiny +block.phase-wall.name = Fázová stěna +block.phase-wall-large.name = Velká fázová stěna +block.thorium-wall.name = Thoriová stěna +block.thorium-wall-large.name = Velká thoriová stěna +block.door.name = Dveře +block.door-large.name = Velké dveře +block.duo.name = Duo +block.scorch.name = Scorch +block.hail.name = Hail +block.lancer.name = Lancer +block.conveyor.name = Dopravník +block.titanium-conveyor.name = Titániový dopravník +block.junction.name = Křižovatka +block.router.name = Směrovač +block.distributor.name = Distributor +block.sorter.name = Dělička +block.sorter.description = Třídí předměty. Jestli je předmět shodný s výběrem, je mu dovoleno projít. Naopak neshodné předměty jsou vypuštěny do prava nebo do leva. +block.overflow-gate.name = Brána přetečení +block.overflow-gate.description = Kombinace distributoru a děličky která má výstup do leva nebo do prava jen pokud je přední strana zablokovaná. +block.smelter.name = Pec +block.arc-smelter.name = Oblouková Pec +block.silicon-smelter.name = Silicon Smelter +block.phase-weaver.name = Tkalcovna pro fázovou tkaninu +block.pulverizer.name = Rozmělňovač +block.cryofluidmixer.name = Cryofluid mixér +block.melter.name = Tavírna +block.incinerator.name = Spalovna +block.biomattercompressor.name = Kompresor na Biohmotu +block.separator.name = Separátor +block.centrifuge.name = Centrifuga +block.power-node.name = Energetický uzel +block.power-node-large.name = Velký energetický uzel +block.battery.name = Baterie +block.battery-large.name = Velká baterie +block.combustion-generator.name = Spalovací generátor +block.turbine-generator.name = Turbínový generátor +block.mechanical-drill.name = Mechanický vrt +block.pneumatic-drill.name = Pneumatický vrt +block.laser-drill.name = Laserový vrt +block.water-extractor.name = Vodní extraktor +block.cultivator.name = Kultivátor +block.alpha-mech-pad.name = Plošina pro Alfa Mech +block.dart-ship-pad.name = Plošina pro Šipka Mech +block.delta-mech-pad.name = Plošina pro Delta Mech +block.javelin-ship-pad.name = Plošina pro Oštěp Mech +block.trident-ship-pad.name = Plošina pro loď Trojzubec +block.glaive-ship-pad.name = Plošina pro loď Glaiva +block.omega-mech-pad.name = Plošina pro Omega Mech +block.tau-mech-pad.name = Plošina pro Tau Mech +block.conduit.name = Potrubí +block.mechanical-pump.name = Mechanická pumpa +block.itemsource.name = Zdroj předmětů +block.itemvoid.name = Prázdnota pro předměty +block.liquidsource.name = Zdroj tekutin +block.powervoid.name = Prázdnota pro energii +block.powerinfinite.name = Nekonečný zdroj energie +block.unloader.name = Odbavovač +block.vault.name = Trezor +block.wave.name = Vlna +block.swarmer.name = Rojiště +block.salvo.name = Salva +block.ripple.name = Vlnění +block.phase-conveyor.name = Fázový přepravník +block.bridge-conveyor.name = Mostový přepravník +block.plastanium-compressor.name = Kompresor na Plastanium +block.pyratite-mixer.name = Pyratit mixér +block.blast-mixer.name = Výbušninový mixér +block.solidifer.name = Krystalizér +block.solar-panel.name = Solární panel +block.solar-panel-large.name = Velký solární panel +block.oil-extractor.name = Ropný Extraktor +block.spirit-factory.name = Továrna na Spirit Drony +block.phantom-factory.name = Továrna na Fantom Drony +block.wraith-factory.name = Továrna na Wraithy +block.ghoul-factory.name = Továrna na Ghůl Bombardéry +block.dagger-factory.name = Továrna na Dagger Mechy +block.titan-factory.name = Továrna na Titán Mechy +block.fortress-factory.name = Továrna na Fortress Mechy +block.revenant-factory.name = Továrna na Revenanty +block.repair-point.name = Opravný Bod +block.pulse-conduit.name = Pulzní potrubí +block.phase-conduit.name = Fázové potrubí +block.liquid-router.name = Směrovač tekutin +block.liquid-tank.name = Nádrž na tekutiny +block.liquid-junction.name = Křižovatka tekutin +block.bridge-conduit.name = Mostové potrubí +block.rotary-pump.name = Rotační pumpa +block.thorium-reactor.name = Thoriový Reaktor +block.command-center.name = Příkazové centrum +block.mass-driver.name = Hromadný Distributor +block.blast-drill.name = Tlakovzdušný vrt +block.thermal-pump.name = Termální pumpa +block.thermal-generator.name = Termální Generátor +block.alloy-smelter.name = Slitinová pec +block.mend-projector.name = Opravný projektor +block.surge-wall.name = Impulzní stěna +block.surge-wall-large.name = Velká Impulzní stěna +block.cyclone.name = Cyklón +block.fuse.name = Fůze +block.shock-mine.name = Šoková mina +block.overdrive-projector.name = Vysokorychlostní projektor +block.force-projector.name = Silový projektor +block.arc.name = Oblouk +block.rtg-generator.name = RTG Generátor +block.spectre.name = Spektr +block.meltdown.name = Meltdown +block.container.name = Kontejnér +block.core.description = Ta nejdůležitější stavba ve hře. +team.blue.name = modrá +team.red.name = červená +team.orange.name = oranžová +team.none.name = šedá +team.green.name = zelená +team.purple.name = fialová +unit.alpha-drone.name = Alfa Dron +unit.spirit.name = Spirit Dron +unit.spirit.description = Startovní dron. Standartně se objevuje u jádra. Automaticky těží rudy a opravuje stavby. +unit.phantom.name = Fantom Dron +unit.phantom.description = Pokročilý dron. Automaticky těží rudy a opravuje stavby. Podstatně víc efektivní než Spirit dron. +unit.dagger.name = Dagger +unit.dagger.description = Základní pozemní jednotka. Efektivní ve velkém počtu. +unit.titan.name = Titán +unit.titan.description = Pokročilá, obrněná pozemní jednotka. Útočí jak na pozemní tak vzdušné nepřátelské jednotky. +unit.ghoul.name = Ghůl Bombardér +unit.ghoul.description = Těžký, kobercový bombardér. +unit.wraith.name = Bojovník Wraith +unit.wraith.description = Rychlý, udeř a uteč stíhací letoun. +unit.fortress.name = Pevnost +unit.fortress.description = Težká, pozemní artilérní jednotka. +unit.revenant.name = Revenant +unit.revenant.description = Težká laserová plošina. +tutorial.begin = Tvá mise tady je vyhladit [LIGHT_GRAY] nepřítele[].\n\nZačneš tím že[accent] budeš těžit měd[]. Klikni na měděnou rudu poblíž tvého jádra pro těžbu. +tutorial.drill = Manuální zěžba je neefektivní.\n[accent]Vrty []budou těžit automaticky.\npolož jeden na měděnou rudu. +tutorial.conveyor = [accent]Dopravníky[] jsou zapotřebí k dopravě materiálu k jádru.\nVytvoř řadu dopravníku od vrtu až k jádru. +tutorial.morecopper = Je za potřebí více mědi.\n\nBuď ho můžeš natěžit manuáně nebo polož více vrtů. +tutorial.turret = Defenzivní stavby musí být postaveny za účelem obrany vůči[LIGHT_GRAY] nepříteli[].\nPostav střílnu Duo blízko svého jádra. +tutorial.drillturret = Duo střílny požadují[accent] měd jako střelivo []ke střelbě.\nPolož vrt blízko střílny pro zásobování mědí. +tutorial.waves = [LIGHT_GRAY] nepřítel[] je přibližuje.\n\nBraň své jádro po dobu dvou vln, postav více střílen. +tutorial.lead = Více rud je zde dostupných. Najdi a těž[accent] Olovo[].\n\nPřetáhni od tvojí jednotky k jádru pro přesun materiálu. +tutorial.smelter = Měd a olovo jsou slabé materiály.\nLepší[accent] hustá slitina[] může být vytvořena v peci.\n\npostav si jednu pec. +tutorial.densealloy = Pec teď bude produkovat slitinu.\nVyráběj si ji.\nZvyš počet produkce pokud je nutno. +tutorial.siliconsmelter = Jádro teď vytvoří[accent] spirit drona[] pro těžení a opravu bloků.\n\nTovárny pro ostatní jednotky mohou být vytvořeny za pomocí [accent] Křemíku.\nPostav Křemíkovou pec. +tutorial.silicondrill = Křemík vyžaduje[accent] uhlí[] a[accent] písek[].\nZačni tím že položíš pár vrtů. +tutorial.generator = Tato technologie vyžaduje energii k provozu.\nVytvoř[accent] spalovací generátor[]k produkci energie. +tutorial.generatordrill = Spalovací generátory vyžadujou palivo.\nZásobuj ho uhlím z vrtu. +tutorial.node = Energie vyžaduje přenos.\nVytvoř[accent] energetický uzel[] vedle svého generátoru pro přenos energie. +tutorial.nodelink = Energie může být přenášena zkrz kontakt s energetickými bloky a generátory, nebo propojením zkrze energetické uzly.\n\nPropoj energii kliknutím na uzel a následným výběrem generátoru a křemíkovou pecí. +tutorial.silicon = Křemík se teď produkuje. Vyráběj si.\n\nJe doporučeno zvýšit produkci. +tutorial.daggerfactory = Postav[accent] Továrnu na Dagger mechy.[]\n\nToto bude využito pro konstrukci útočné síly. +tutorial.router = Továrny potřebujou k provozu materiál.\nPolož na dopravník směrovač pro oddělení části nákladu k továrně. +tutorial.dagger = Propoj energetické uzly s továrnou.\nJakmile jsou požadavky splněny, Mechy se začnou stavět.\n\nPokládej vrty, generátory a dopravníky dle libosti. +tutorial.battle = [LIGHT_GRAY] Nepřítel[] prozradil lokaci svého jádra.\nZnič ho svými bojovými jednotkami. +block.copper-wall.description = Levný defenzivní blok.\nUžitečný k obraně tvého jádra a střílen v prvotních vlnách nepřátel. +block.copper-wall-large.description = Levný defenzivní blok.\nUžitečný k obraně tvého jádra a střílen v prvotních vlnách nepřátel.\nZabírá více polí. +block.dense-alloy-wall.description = Standartní defenzivní blok.\nAdekvátní obrana vůči nepřátelům. +block.dense-alloy-wall-large.description = Standartní defenzivní blok.\nAdekvátní obrana vůči nepřátelům.\nZabírá více polí. +block.thorium-wall.description = Sílný defenzivní blok.\nDobrá obrana vůči nepřátelům. +block.thorium-wall-large.description = Sílný defenzivní blok.\nDobrá obrana vůči nepřátelům..\nZabírá více polí. +block.phase-wall.description = Né tak silná jako zeď Thoria ale odráží nepřátelské projektily dokud nejsou moc silné. +block.phase-wall-large.description = Né tak silná jako zeď Thoria ale odráží nepřátelské projektily dokud nejsou moc silné.\nZabírá více polí. +block.surge-wall.description = Nejsilnější defenzivní blok.\nMá malou šanci vystřelit elektrický paprsek vůči útočníkovi. +block.surge-wall-large.description = Nejsilnější defenzivní blok.\nMá malou šanci vystřelit elektrický paprsek vůči útočníkovi.\nZabírá více polí. +block.door.description = Malé dveře, které se dají otevřít nebo zavřít kliknutím na ně.\nKdyž otevřené nepřátelé mohou střílet a dostat se skrz. +block.door-large.description = Velké dveře, které se dají otevřít nebo zavřít kliknutím na ně.\nKdyž otevřené nepřátelé mohou střílet a dostat se skrz.\nZabírá více polí. +block.mend-projector.description = Kontinuálně léčí bloky ve poli svého působení. +block.overdrive-projector.description = Zrychluje funkce blízkých struktůr jako jsou vrty a dopravníky. +block.force-projector.description = Vytvoří okolo sebe šestihrané silové pole, chrání jednotky a budovy uvnitř sebe vůči střelám. +block.shock-mine.description = Působí poškození nepřátelským jednotkám při sešlápnutí. Skoro neviditelné nepřáteli. +block.duo.description = Malá, levná střílna. +block.arc.description = Malá střílna, která střílí elektřinu v náhodném oblouku po nepřátelských jednotkách. +block.hail.description = Malá artilérní střílna. +block.lancer.description = Středně velká střílna, která střílí nabité elektrické paprsky. +block.wave.description = Středně vělká, rychle pálící střílna, která střílí krystalizované bubliny. +block.salvo.description = Středně velká střílna, která střílí v salvách. +block.swarmer.description = Středně velká střílna, která střílí rakety v dávkách. +block.ripple.description = Velká artilérní střílna, která vystřelí několik projektilů najednou. +block.cyclone.description = Velká rychle pálící střílna. +block.fuse.description = Velká střílna, která střílí paprsky krátkého dosahu. +block.spectre.description = Velká střílna, která vystřelí dva mocné projektily naráz. +block.meltdown.description = Velká střílna, která vystřelí mocný paprsek dalekého dosahu. +block.conveyor.description = Základní blok přepravy předmětů. Nese předměty kupředu a automaticky plní střílny nebo bloky výroby do kterých směřují. dá se otáčet do různých směrů. +block.titanium-conveyor.description = Pokročilý blok přepravy předmětů. Nese předměty rychleji jak standartní dopravníky. +block.phase-conveyor.description = Pokročilý blok přepravy předmětů. Využívá energii k přepravě od jednoho bodu k druhému po velice dlouhé vzdálenosti. +block.junction.description = Chová se jako most pro dva křížící se pásy dopravníků. Užitečný při situaci kdy dva rozdílné dopravníky dopravují dva rozdílné materiálny na rozdílné místa. +block.mass-driver.description = Ultimátní blok přepravy předmětů. Sbírá několik druhů předmětů a vystřelí je k dalšímu hromadnému distributoru přes veliké vzdálenosti. +block.smelter.description = Spaluje uhlí, měd a olovo pro vytvoření husté slitiny. +block.arc-smelter.description = Spaluje měd a olovo za pomocí externího energetického zdroje. +block.silicon-smelter.description = Redukuje písek s vysoce čistým koksem za účelem výroby křemíku. +block.plastanium-compressor.description = Produkuje plastánium za pomocí titánia a ropy. +block.phase-weaver.description = Produkuje fázovou tkaninu z radioaktivního thoria a velkého množství písku. +block.alloy-smelter.description = Produkuje impulzní slitinu z titánia, olova, křemíku a mědi. +block.pulverizer.description = Drtí kámen na písek. Užitečné když se v oblasti nenalézá písek. +block.pyratite-mixer.description = Míchá uhlí, olovo a písek do velice hořlavého pyratitu. +block.blast-mixer.description = Používá ropu k přeměně pyratitu do méně hořlavé ale více explozivní těkavé směsi. +block.cryofluidmixer.description = Kombinuje vodu a titánium do cryofluid, která je více efektivní pro chlazení. +block.solidifer.description = Velice rychle chladí lávu na kámen. +block.melter.description = Taví kámen při velice vysokých teplotách na lávu. +block.incinerator.description = Zbaví tě přebytku předmětů. +block.biomattercompressor.description = Stlačuje biohmotu k získání ropy. +block.separator.description = Vystaví kámen velkému tlaku vody k získání různých materiálů obsažené v kameni. +block.centrifuge.description = Více efektivní než separátor. Za to více nákladný na provoz ke které vyžaduje energii. +block.power-node.description = Vysílá energii mezi propojenými uzly. Dokáže se propojit až se čtyřmi uzly či stavbami najednou. Uzel bude dostávat zásobu energie a bude ji distribuovat mezi připojené bloky. +block.power-node-large.description = Má větší dosah než standartní energetický uzel and a dokáže propojit až 6 staveb nebo uzly. +block.battery.description = Ukládá energii kdykoliv kdy je nadbytek ,poskytuje energii kdykolik když je pokles energie v síti, tak dlouho doku zbývá kapacita. +block.battery-large.description = Uloží více energie než standartní baterie. +block.combustion-generator.description = Generuje energii spalováním ropy nebo jinných hořlavých materiálů. +block.turbine-generator.description = Více efektivní než spalovací generátor, ale vyžaduje dodatečný přísun vody. +block.thermal-generator.description = Generuje obrovské množství energie z lávy. +block.solar-panel.description = Poskytuje malé množství energie ze slunce. +block.solar-panel-large.description = Poskytuje mnohem lepší zdroj energie než standartní solární panel, za to je mnohem nákladnější na stavbu. +block.thorium-reactor.description = Generuje obrovské množství energie z radioaktivního thoria. Vyžaduje konstantní chlazení. Způsobí velikou explozi je-li zásobován nedostatečným množstvím chlazení. Výstup energie závisí na plnosti obsahu generátoru, základní generování energie se aktivuje při poloviční kapacitě. +block.rtg-generator.description = Rádioizotopní Termoelektrický Generátor nevyžaduje chlazení, za to generuje méně energie než Thoriový generátor. +block.unloader.description = Vykládá předměty z kontejnéru, trezoru nebo jádra na dopravník nebo přímo do produktivních bloků. Druh předmětu pro vykládání lze měti kliknutím na odbavovač. +block.container.description = Ukládá malé množství předmětů každého typu. Připojené kontejnéry, trezory nebo jádra se budou chovat jako samostatné skladovací jednotky. [LIGHT_GRAY] Odbavovač[] lze použít pro odbavení předmětů z kontejnéru. +block.vault.description = Ukládá velké množství předmětů každého typu. Připojené kontejnéry, trezory nebo jádra se budou chovat jako samostatné skladovací jednotky. [LIGHT_GRAY] Odbavovač[] lže použít pro odbavení předmětů z trezoru. +block.mechanical-drill.description = Levný vrt. Při položení na vhodné pole, natrvalo a pomalu produkuje materiál na který byl položen. +block.pneumatic-drill.description = Vylepšený vrt, který je rychlejší a je schopen zpracovat trdší materiály za pomocí tlaku. +block.laser-drill.description = Dovoluje vrtat ještě rychleji díky laserové technologii, požaduje energii k provozu. Dodatečně, dokáže vrtat žíly radioaktivního thoria. +block.blast-drill.description = Ultimátní vrt, vyžaduje velké množství energie k provozu. +block.water-extractor.description = Extrahuje vodu ze země. Vhodný k použití když se v oblasti nenachází zdroj vody. +block.cultivator.description = Kultivuje půdu vodou za účelem získání biohmoty. +block.oil-extractor.description = Vyžaduje velké množství energie na extrakci ropy z písku. Použíj ho když se v oblasti nenachází žádný zdroj ropy. +block.dart-ship-pad.description = Zanech zde své aktuální plavidlo a žměn ho na klasický bojový letoun.\nPoužíj ho poklikáním když se nacházíš nad ním. +block.trident-ship-pad.description = Zanech zde své aktuální plavidlo a změň ho do docela dobře obrněného těžkého bombardéru.\nPoužíj ho poklikáním když se nacházíš nad ním. +block.javelin-ship-pad.description = Zanech zde své aktuální plavidlo a změn ho na silný a rychlý stíhač s bleskovými zbraněmi.\nPoužíj ho poklikáním když se nacházíš nad ním. +block.glaive-ship-pad.description = Zanech zde své aktuální plavidlo a změn ho na velkou, dobře obrněnou střeleckou loď.\nPoužíj ho poklikáním když se nacházíš nad ním. +block.tau-mech-pad.description = Zanech zde své aktuální plavidlo a změn ho na na podpůrného mecha, který léčí spojenecké budovy a jednotky.\nPoužíj ho poklikáním když se nacházíš nad ním. +block.delta-mech-pad.description = Zanech zde své aktuální plavidlo a změn ho na rychlého, lehce obrněného mecha určeného pro udeř a uteč operace.\nPoužíj ho poklikáním když se nacházíš nad ním. +block.omega-mech-pad.description = Zanech zde své aktuální plavidlo a změn ho na objemného dobře obrněného mecha, určeného pro útok v přední linii.\nPoužíj ho poklikáním když se nacházíš nad ním. +block.spirit-factory.description = Produkuje lehké drony, kteří teží minerály a opravují budovy +block.phantom-factory.description = Produkuje pokročilé drony kteří jsou podstatně efektivnější jak spirit droni. +block.wraith-factory.description = Produkuje rychlé, udeř a uteč stíhače. +block.ghoul-factory.description = Produkuje těžké kobercové bombardéry. +block.dagger-factory.description = Produkuje standartní pozemní jednotky. +block.titan-factory.description = Produkuje pokročilé, orněné pozemní jednotky. +block.fortress-factory.description = Produkuje těžké artilérní, pozmení jednotky. +block.revenant-factory.description = Produkuje vzdušné, težké laserové stíhače.. +block.repair-point.description = Kontinuálně léčí nejbližší budovy a jednotky. +block.command-center.description = Dovoluje měnit umělou inteligenci spojeneckých jednotek. Aktuálně, útok, ztáhnout se a hlídkuj příkazy jsou podporovány. +block.conduit.description = Základní blok přepravy tekutin. Funguje jako dopravník, ale na tekutiny, chápeš ne ? Užívá se s extraktory, pumpami nebo jiným potrubím. +block.pulse-conduit.description = Pokročilý blok přepravy tekutin. Přepravuje tekutiny rychleji a více než standartní potrubí. +block.phase-conduit.description = Pokročilý blok přepravy tekutin. Používá energii k teleportu tekutin do druhého bodu přez několik polí. +block.liquid-router.description = Příjmá tekutiny z jednoho směru a vypouští je rovnoměrně do zbylých tří směrů. Dokáže uložit na krátkou dobu nějaký obsah tekutin. Užitečný při rozdělení jednoho zdroje směřující do různých cílů. +block.liquid-tank.description = Uloží velké množství tekutin. Použíj ho pro vyrovnávací zásoby vody když je příděl nestabilní nebo jako záložní chlazení pro generátory. +block.liquid-junction.description = Chová se jako most pro dvě křížící se potrubí. Užitečný v situacích když dvě rozdílné potrubí nesou rozdílný obsah na rozdílná místa. +block.bridge-conduit.description = Pokročilý blok přepravy tekutin. Dovoluje transportovat tekutiny až přez tři pole jakéhokoliv terénu nebo budovy. +block.mechanical-pump.description = Levná pumpa s pomalým tokem, ale nevyžaduje nergii k provozu. +block.rotary-pump.description = Pokročilá pumpa která, zdvojnásobuje přísun tekutin za použití energie. +block.thermal-pump.description = Ultimátní pumpa. Trojnásobně rychlejší než mechanická pumpa a jediná pumpa která dokáže pracovat s lávou. +block.router.description = Příijmá předměty z jednoho směru a posílá je rovnoměrně do zbylých tří směrů. Užitečný při rozdělení jednoho zdroje směřující do různých cílů. +block.distributor.description = Pokročilý směrovač, který z libovolného počtu vstupů vytvoří libovolný počet výstupu a rozdělí přísun předmětů rovnoměrně do každého z nich, obdoba Multiplexeru a Demultiplexeru. +block.bridge-conveyor.description = Pokročilý blok přepravy předmětů. Dovoluje transport předmětů až přez tři pole jakéhokoliv terénu nebo budovy. +block.alpha-mech-pad.description = Když je dodán dostatek energie, Přestaví tvoji loď na[accent] Alfa[] mecha. +block.itemsource.description = Nekonečný zdroj předmětů. Jen pro Sandbox. +block.liquidsource.description = Nekonečný zdroj tekutin. Jen pro Sandbox. +block.itemvoid.description = Likviduje jakéhokoliv vstupní předmět bež použití energie. Jen pro Sandbox. +block.powerinfinite.description = Nekonečný zdroj energie. Jen pro Sandbox. +block.powervoid.description = Prázdnota pro veškerou energii vstupující do něj. Jen pro Sandbox. +liquid.water.description = Nejčastěji se používá ke chlazení a zpracování odpadu. +liquid.lava.description = Může být transformován na[LIGHT_GRAY] kámen[], nebo pro generátor energie nebo jako střelivo pro určitý druh střílen. +liquid.oil.description = Může být spálen, vybouchnout nebo použit jako chlazení. +liquid.cryofluid.description = Nejefektivnější tekutina pro chlazení. diff --git a/core/assets/bundles/bundle_fr.properties b/core/assets/bundles/bundle_fr.properties index f8351c8f7b..42f1fd7640 100644 --- a/core/assets/bundles/bundle_fr.properties +++ b/core/assets/bundles/bundle_fr.properties @@ -5,9 +5,9 @@ text.link.discord.description = Le discord officiel de mindustry text.link.github.description = Code source du jeu text.link.dev-builds.description = Versions instables du jeu text.link.trello.description = Trello officiel pour les futurs ajouts . -text.link.itch.io.description = page itch.io avec le lien du téléchargement pour PC et la version web . -text.link.google-play.description = listing par le store google play -text.link.wiki.description = wiki officiel de mindustry . +text.link.itch.io.description = Page itch.io avec le lien du téléchargement pour PC et la version web . +text.link.google-play.description = Listing par le Google Play Store +text.link.wiki.description = Wiki officiel de mindustry . text.linkfail = Erreur lors de l'ouverture du lien !\nL'URL a été copié avec succès. text.gameover = Partie terminée. text.gameover.pvp = L'équipe [accent] {0}[] a gagnée ! @@ -23,7 +23,7 @@ text.level.mode = Mode de jeu : text.construction.desktop = Pour désélectionner un bloc ou arrêter de construire, appuyer sur [accent]espace[]. text.construction.title = Guide de construction des blocs text.construction = Vous venez de sélectionner le mode [accent]construction de blocs[].\n\nPour commencez à placer des blocs, appuyez simplement sur un emplacement valide proche de votre vaisseau.\nUne fois que vous avez sélectionné quelques emplacements, Appuyez sur le bouton valider pour confirmer, et votre vaisseau commencera à construire.\n\n- [accent]Enlevez des blocs[] de votre sélection en appuyant dessus.\n- [accent]Déplacez la sélection[] en restant appuyé puis en déplaçant n'importe quel bloc de la sélection.\n- [accent]Placez les blocs en ligne[] En restant appuyé sur un espace vide, puis en étirant dans une direction.\n- [accent]Annulez la construction ou la sélection[] en appuyant sur le X en bas à droite. -text.deconstruction.title = Block Deconstruction Guide +text.deconstruction.title = Guide de destruction de blocs text.deconstruction = Vous venez de sélectionner le mode [accent]destruction de blocs[].\n\nPour commencez à détruire des blocs, appuyez simplement sur un bloc proche de votre vaisseau.\nUne fois que vous avez sélectionné quelques blocs, Appuyez sur le bouton valider pour confirmer, et votre vaisseau commencera à détruire.\n\n- [accent]Enlevez des blocs[] de votre sélection en appuyant dessus.\n- [accent]Déplacez la sélection[] en restant appuyé puis en déplaçant n'importe quel bloc de la sélection.\n- [accent]Placez les blocs en ligne[] En restant appuyé sur un espace vide, puis en étirant dans une direction.\n- [accent]Annulez la construction ou la sélection[] en appuyant sur le X en bas à droite. text.showagain = Ne pas montrer la prochaine fois text.coreattack = [scarlet] @@ -49,8 +49,8 @@ text.mission.info = Infos sur la Mission text.mission.complete = Mission terminée! text.mission.complete.body = Le secteur {0},{1} a été conquis. text.mission.wave = Survivez à[accent] {0}/{1} []vague\nLa vague commence dans {2} -text.mission.wave.enemies = Survivez à[accent] {0}/{1} []vagues\n{2} Ennemis -text.mission.wave.enemy = Survivez à[accent] {0}/{1} []vagues\n{2} Ennemi +text.mission.wave.enemies = Survivez à[accent] {0}/{1} []vagues\n{2} ennemis +text.mission.wave.enemy = Survivez à[accent] {0}/{1} []vagues\n{2} ennemi text.mission.wave.menu = Survivez à[accent] {0} []vagues text.mission.battle = Détruisez la base ennemie text.mission.resource.menu = Obtenez {0} x{1} @@ -71,19 +71,19 @@ text.nextmission = Prochaine mission text.maps.none = [LIGHT_GRAY]Aucune carte trouvée! text.about.button = À propos text.name = Nom: -text.filename = File Name: +text.filename = Nom du fichier: text.unlocked = Nouveau bloc débloqué! text.unlocked.plural = Nouveaux blocs débloqués! text.players = {0} joueurs en ligne text.players.single = {0} joueur en ligne text.server.closing = [accent]Fermeture du serveur... text.server.kicked.kick = Vous avez été expulsé du serveur! -text.server.kicked.serverClose = Server closed. +text.server.kicked.serverClose = Serveur fermé. text.server.kicked.sectorComplete = Secteur terminé. text.server.kicked.sectorComplete.text = Votre mission est complète .\nLe serveur va maintenant aller au prochain secteur . text.server.kicked.clientOutdated = Client dépassé! Mettez à jour votre jeu! text.server.kicked.serverOutdated = Serveur dépassé! Demandez à l'hôte de le mettre à jour! -text.server.kicked.banned = Vous êtes banni sur ce serveur. +text.server.kicked.banned = Vous avez été banni sur ce serveur. text.server.kicked.recentKick = Vous avez été expulsé récemment.\nAttendez avant de vous connecter à nouveau. text.server.kicked.nameInUse = Il y a déjà quelqu'un avec ce nom\nsur ce serveur. text.server.kicked.nameEmpty = Votre nom doit contenir au moins une lettre ou un chiffre. @@ -208,7 +208,7 @@ text.editor.slope = \\ text.editor.openin = Ouvrir dans l'éditeur text.editor.oregen = Génération de minerais text.editor.oregen.info = Génération de minerais: -text.editor.mapinfo = Info de la carte +text.editor.mapinfo = Infos sur la carte text.editor.author = Auteur: text.editor.description = Description: text.editor.name = Nom: @@ -302,13 +302,13 @@ text.blocks.powerdamage = Énergie/Dégâts text.blocks.inputitemcapacity = Capacité d'entrée text.blocks.outputitemcapacity = Capacité de sortie text.blocks.itemcapacity = Stockage -text.blocks.basepowergeneration = Base Power Generation +text.blocks.basepowergeneration = Generation d'énergie minimale text.blocks.powertransferspeed = Vitesse de transfert d'énergie text.blocks.craftspeed = Vitesse de production text.blocks.inputliquid = Liquide requis text.blocks.inputliquidaux = Liquide optionnel -text.blocks.inputitem = Input Item -text.blocks.inputitems = objets utilisés +text.blocks.inputitem = Objets en entrée +text.blocks.inputitems = Objets utilisés text.blocks.outputitem = Objet produit text.blocks.drilltier = Forable text.blocks.drillspeed = Vitesse de forage de base @@ -356,7 +356,7 @@ setting.difficulty.normal = normal setting.difficulty.hard = difficile setting.difficulty.insane = Extreme setting.difficulty.name = Difficulté: -setting.screenshake.name = Tremblement d'écran +setting.screenshake.name = Tremblement de l'écran setting.effects.name = Montrer les effets setting.sensitivity.name = Sensibilité de la manette setting.saveinterval.name = Intervalle des sauvegardes auto @@ -403,11 +403,11 @@ keybind.drop_unit.name = drop unit keybind.zoom_minimap.name = Zoom minimap mode.text.help.title = Description des modes de jeu mode.waves.name = Vagues -mode.waves.description = le mode de jeu normal. Ressource limitée et vagues d'ennemis. +mode.waves.description = Le mode de jeu normal. Ressources limitées et vagues d'ennemis. mode.sandbox.name = bac à sable mode.sandbox.description = Ressources infinies et pas de timer pour les vagues. mode.freebuild.name = construction libre -mode.freebuild.description = Ressource limitée et pas de timer pour les vagues. +mode.freebuild.description = Ressources limitées et pas de timer pour les vagues. mode.pvp.name = JcJ mode.pvp.description = Battez-vous contre d'autres joueurs en local. content.item.name = Objets @@ -418,24 +418,24 @@ content.mech.name = Méchas item.stone.name = Pierre item.stone.description = Un matériau brut commun. Peut être séparé et raffiné en d'autres matériaux, ou fondu en lave. item.copper.name = Cuivre -item.copper.description = Un matériau de construction utile.Utilisé intensivement dans tout les blocs. +item.copper.description = Un matériau de construction utile. Utilisé intensivement dans tout les blocs. item.lead.name = Plomb -item.lead.description = Un matériau de départ . Utilisé intensivement en électronique et pour le transport de blocs. +item.lead.description = Un matériau de départ. Utilisé intensivement en électronique et pour le transport de blocs. item.coal.name = Charbon item.coal.description = Un carburant commun et facile à obtenir. item.dense-alloy.name = Alliage lourd -item.dense-alloy.description = Un alliage résistant fait de plomb et de cuivre. Utilisé dans les blocs de transports avancés et les foreuses de haut niveau. +item.dense-alloy.description = Un alliage résistant fait de plomb et de cuivre. Utilisé dans les blocs de transports avancés et dans les foreuses de haut niveau. item.titanium.name = Titane -item.titanium.description = Un métal rare super-léger largement utilisé dans le transport de liquides et d'objets ainsi que dans les foreuses de haut-niveau et l'aviation .item.thorium.name=Thorium +item.titanium.description = Un métal rare super-léger largement utilisé dans le transport de liquides et d'objets ainsi que dans les foreuses de haut-niveau et l'aviation. item.thorium.name = Thorium -item.thorium.description = Un métal dense, et radioactif utilisé comme support structurel et comme carburant nucléaire. +item.thorium.description = Un métal dense et radioactif utilisé comme support structurel et comme carburant nucléaire. item.silicon.name = Silicone -item.silicon.description = Un matériau semi-conducteur extrêmement utile, avec des utilisations dans les panneaux solaires et beaucoup d'autre composants électroniques complexes. +item.silicon.description = Un matériau semi-conducteur extrêmement utile, avec des utilisations dans les panneaux solaires et dans beaucoup d'autre composants électroniques complexes. item.plastanium.name = Plastanium item.plastanium.description = Un matériau léger et docile utilisé dans l'aviation avancée et dans les munitions à fragmentation. item.phase-fabric.name = Tissu phasé item.phase-fabric.description = Une substance au poids quasiment inexistant utilisé pour l'électronique avancé et la technologie auto-réparatrice. -item.surge-alloy.name = alliage superchargé +item.surge-alloy.name = Alliage superchargé item.surge-alloy.description = Un alliage avancé avec des propriétés électriques avancées. item.biomatter.name = Biomasse item.biomatter.description = Un mélange de matières organiques; utilisé pour la transformation en huile ou en tant que carburant de base. @@ -448,42 +448,42 @@ item.pyratite.description = Une substance extrêmement inflammable utilisée dan liquid.water.name = Eau liquid.lava.name = Lave liquid.oil.name = Pétrole -liquid.cryofluid.name = liquide cryogénique +liquid.cryofluid.name = Liquide cryogénique mech.alpha-mech.name = Alpha -mech.alpha-mech.weapon = fusil automatique +mech.alpha-mech.weapon = Fusil automatique mech.alpha-mech.ability = Essaim de drone -mech.alpha-mech.description = Le mécha standard.A une vitesse et des dégâts décents; Il peut aussi créer jusqu'à 3 drones pour des faire des dégâts supplémentaires. +mech.alpha-mech.description = Le mécha standard. À une vitesse et des dégâts décents; Il peut aussi créer jusqu'à 3 drones pour infliger des dégâts supplémentaires. mech.delta-mech.name = Delta mech.delta-mech.weapon = Arc électrique mech.delta-mech.ability = Décharge -mech.delta-mech.description = Un mécha rapide avec une armure légère fait pour des tactiques de harcèlements. Il fait par contre peu de dégâts au structures, néanmoins il peut tuer de grand groupes d'ennemis très rapidement avec ses arcs électriques . +mech.delta-mech.description = Un mécha rapide, avec une armure légère, fait pour des tactiques de harcèlements. Il inflige, par contre, peu de dégâts aux structures, néanmoins il peut tuer de grand groupes d'ennemis très rapidement avec ses arcs électriques. mech.tau-mech.name = Tau mech.tau-mech.weapon = Laser restructurant -mech.tau-mech.ability = explosion réparante -mech.tau-mech.description = Un mécha de support . Soigne les blocs alliés en tirant dessus. Il peut aussi éteindre les feux et soigner ses alliés en zone avec sa Compétence . +mech.tau-mech.ability = Explosion réparante +mech.tau-mech.description = Un mécha de support. Soigne les blocs alliés en tirant dessus. Il peut aussi éteindre les feux et soigner ses alliés en zone avec sa compétence. mech.omega-mech.name = Omega mech.omega-mech.weapon = Essaim de missiles auto-guidés mech.omega-mech.ability = Armure -mech.omega-mech.description = Un mécha cuirassé et large fait pour les assauts frontaux . Sa Compétence "Armure" lui permet de bloquer 90% des dégâts. +mech.omega-mech.description = Un mécha cuirassé et large fait pour les assauts frontaux. Sa compétence "Armure" lui permet de bloquer 90% des dégâts. mech.dart-ship.name = Dard -mech.dart-ship.weapon = pistolet automatique -mech.dart-ship.description = Le vaisseau standard. Raisonnablement rapide et léger , Il a néanmoins peu d'attaque et une faible vitesse de minage. +mech.dart-ship.weapon = Pistolet automatique +mech.dart-ship.description = Le vaisseau standard. Raisonnablement rapide et léger. Il a néanmoins peu d'attaque et une faible vitesse de minage. mech.javelin-ship.name = Javelin -mech.javelin-ship.description = Un vaisseau qui bien que lent au départ peut accélerer pour atteindre de très grandes vitesses et voler jusqu'au avant-postes ennemis, faisant d'énormes dégâts avec ses arc électriques obtenus à vitesse maximum et ses missiles. +mech.javelin-ship.description = Un vaisseau qui, bien que lent au départ, peut accélerer pour atteindre de très grandes vitesses et voler jusqu'aux avant-postes ennemis, faisant d'énormes dégâts avec ses arc électriques obtenus à vitesse maximum et ses missiles. mech.javelin-ship.weapon = Missiles explosifs autoguidés mech.javelin-ship.ability = Décharge de propulseur mech.trident-ship.name = Trident mech.trident-ship.description = Un bombardier lourd raisonnablement cuirassé. -mech.trident-ship.weapon = Largage de bombe +mech.trident-ship.weapon = Largage de bombes mech.glaive-ship.name = Glaive -mech.glaive-ship.description = Un grand vaisseau de combat cuirassé . Equipé avec un fusil automatique à munitions incendiaires . Il a aussi une bonne accéleration ainsi qu'une bonne Vitesse maximale. +mech.glaive-ship.description = Un grand vaisseau de combat cuirassé. Equipé avec un fusil automatique à munitions incendiaires. Il a aussi une bonne accéleration ainsi qu'une bonne vitesse maximale. mech.glaive-ship.weapon = Fusil automatique incendiaire text.item.explosiveness = [LIGHT_GRAY]Explosivité: {0} text.item.flammability = [LIGHT_GRAY]Inflammabilité: {0} text.item.radioactivity = [LIGHT_GRAY]Radioactivité: {0} text.item.fluxiness = [LIGHT_GRAY]Flux de Puissance: {0} -text.unit.health = [LIGHT_GRAY]Health: {0} -text.unit.speed = [LIGHT_GRAY]Speed: {0} +text.unit.health = [LIGHT_GRAY]Santé: {0} +text.unit.speed = [LIGHT_GRAY]Rapidité: {0} text.mech.weapon = [LIGHT_GRAY]Arme: {0} text.mech.armor = [LIGHT_GRAY]Armure: {0} text.mech.itemcapacity = [LIGHT_GRAY]Capacité de stockage: {0} @@ -493,25 +493,25 @@ text.mech.ability = [LIGHT_GRAY]Compétence: {0} text.liquid.heatcapacity = [LIGHT_GRAY]Capacité Thermique: {0} text.liquid.viscosity = [LIGHT_GRAY]Viscosité: {0} text.liquid.temperature = [LIGHT_GRAY]Température: {0} -block.constructing = {0}\n[LIGHT_GRAY](Constructing) -block.spawn.name = Générateur d'ennemi +block.constructing = {0}\n[LIGHT_GRAY](En Construction) +block.spawn.name = Générateur d'ennemis block.core.name = Base block.metalfloor.name = Sol en métal -block.deepwater.name = eau profonde -block.water.name = eau -block.lava.name = lave -block.tar.name = pétrole -block.blackstone.name = roche sombre -block.stone.name = roche -block.dirt.name = terre -block.sand.name = sable +block.deepwater.name = Eau profonde +block.water.name = Eau +block.lava.name = Lave +block.tar.name = Pétrole +block.blackstone.name = Roche sombre +block.stone.name = Roche +block.dirt.name = Terre +block.sand.name = Sable block.ice.name = glace -block.snow.name = neige -block.grass.name = herbe -block.shrub.name = buisson -block.rock.name = pierre -block.blackrock.name = pierre sombre -block.icerock.name = pierre gelée +block.snow.name = Neige +block.grass.name = Herbe +block.shrub.name = Buisson +block.rock.name = Pierre +block.blackrock.name = Pierre sombre +block.icerock.name = Pierre gelée block.copper-wall.name = Mur de cuivre block.copper-wall-large.name = Grand mur de cuivre block.dense-alloy-wall.name = Mur en alliage lourd @@ -578,7 +578,7 @@ block.wave.name = Vague block.swarmer.name = Essaim block.salvo.name = Salve block.ripple.name = Ripple -block.phase-conveyor.name = convoyeur phasé +block.phase-conveyor.name = Convoyeur phasé block.bridge-conveyor.name = Pont block.plastanium-compressor.name = Compresseur de Plastanium block.pyratite-mixer.name = Mixeur à Pyratite @@ -623,16 +623,16 @@ block.rtg-generator.name = G.T.R. block.spectre.name = Spectre block.meltdown.name = Meltdown block.container.name = Conteneur -block.core.description = Le batiment le plus important du jeu . -team.blue.name = bleu -team.red.name = rouge -team.orange.name = orange -team.none.name = gris -team.green.name = vert -team.purple.name = violet +block.core.description = Le batiment le plus important du jeu. +team.blue.name = Bleu +team.red.name = Rouge +team.orange.name = Orange +team.none.name = Gris +team.green.name = Vert +team.purple.name = Violet unit.alpha-drone.name = Alpha Drone unit.spirit.name = Drone sppirituel -unit.spirit.description = L'unité de soutien de départ.Apparaît dans la base par défaut .Mine automatiquement les minerais, récupère les objets au sol et répare les blocs. +unit.spirit.description = L'unité de soutien de départ. Apparaît dans la base par défaut. Mine automatiquement les minerais, récupère les objets au sol et répare les blocs. unit.phantom.name = Drone Fantôme unit.phantom.description = Une unité de soutien avancée. Mine automatiquement les minerais, récupère les objets au sol et répare les blocs. Bien plus efficace qu'un drone spirituel. unit.dagger.name = Poignard diff --git a/core/assets/bundles/bundle_fr_BE.properties b/core/assets/bundles/bundle_fr_BE.properties index 0dc8fba05b..a4af1a5971 100644 --- a/core/assets/bundles/bundle_fr_BE.properties +++ b/core/assets/bundles/bundle_fr_BE.properties @@ -207,7 +207,7 @@ text.map.nospawn = Cette carte ne possède pas de base pour que le joueur puisse text.map.nospawn.pvp = Cette carte ne contient aucune base ennemi dans lequel le joueur apparaît!\nAjoutez des bases[SCARLET] rouge[] à cette carte dans l'éditeur. text.map.invalid = Erreur lors du chargement de la carte: carte corrompue ou invalide. text.editor.brush = Pinceau -text.editor.slope = \\ +text.editor.slope = Pente text.editor.openin = Ouvrir dans l'éditeur text.editor.oregen = Génération des minerais text.editor.oregen.info = Génération de minerais: @@ -382,6 +382,8 @@ category.multiplayer.name = Multijoueur command.attack = Attaquer command.retreat = Retraite command.patrol = Patrouiller +keybind.gridMode.name = Sélectionnez le bloc +keybind.gridModeShift.name = Sélection de la catégorie keybind.press = Appuyez sur une touche ... keybind.press.axis = Appuyez sur un axe ou une touche... keybind.move_x.name = Mouvement X diff --git a/core/assets/bundles/bundle_in_ID.properties b/core/assets/bundles/bundle_in_ID.properties index 387e2f6bf3..a3d1721f67 100644 --- a/core/assets/bundles/bundle_in_ID.properties +++ b/core/assets/bundles/bundle_in_ID.properties @@ -1,98 +1,98 @@ text.credits.text = Created by [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[]\n\n[GRAY](In case you can't tell, this text is currently unfinished.\nTranslators, don't edit it yet!) -text.credits = Credits -text.discord = Bergabunglah dengan Discord Mindustry! -text.link.discord.description = the official Mindustry discord chatroom -text.link.github.description = Game source code -text.link.dev-builds.description = Unstable development builds -text.link.trello.description = Official trello board for planned features -text.link.itch.io.description = itch.io page with PC downloads and web version -text.link.google-play.description = Google Play store listing -text.link.wiki.description = official Mindustry wiki -text.linkfail = Failed to open link!\nThe URL has been copied to your cliboard. +text.credits = Kredit +text.discord = Mari bergabung di Discord Mindustry! +text.link.discord.description = grup Discord Mindustry resmi +text.link.github.description = Source code permainan +text.link.dev-builds.description = Bentukan pengembang (kurang stabil) +text.link.trello.description = Papan trello resmi untuk fitur-fitur terencana +text.link.itch.io.description = Halaman itch.io dengan unduhan PC dan versi web +text.link.google-play.description = Google Play store +text.link.wiki.description = wiki resmi Mindustry +text.linkfail = Gagal membuka link!\nURL telah disalin ke papan salin. text.gameover = Intinya hancur. -text.gameover.pvp = The[accent] {0}[] team is victorious! -text.sector.gameover = This sector has been lost. Re-deploy? -text.sector.retry = Retry +text.gameover.pvp = Tim [accent] {0}[] menang! +text.sector.gameover = Sektor ini telah hancur. Ulangi? +text.sector.retry = Ulangi text.highscore = [YELLOW]Rekor baru! -text.wave.lasted = You lasted until wave [accent]{0}[]. +text.wave.lasted = Kamu bertahan sampai gelombang ke [accent]{0}[]. text.level.highscore = Skor Tinggi: [accent]{0} text.level.delete.title = Konfirmasi Hapus -text.map.delete = Are you sure you want to delete the map "[accent]{0}[]"? +text.map.delete = Apakah kamu yakin ingin menghapus peta "[orange]{0}[]"? text.level.select = Pilih Level text.level.mode = Modus permainan: -text.construction.desktop = Desktop controls have been changed.\nTo deselect a block or stop building, [accent]use space[]. +text.construction.desktop = Kontrol desktop telah berubah.\nUntuk membatalkan blok atau menghentikan pembangunan, [accent]gunakan spasi[]. text.construction.title = Block Construction Guide text.construction = You've just selected [accent]block construction mode[].\n\nTo begin placing, simply tap a valid location near your ship.\nOnce you have selected some blocks, press the checkbox to confirm, and your ship will begin constructing them.\n\n- [accent]Remove blocks[] from your selection by tapping them.\n- [accent]Shift the selection[] by holding and dragging any block in the selection.\n- [accent]Place blocks in a line[] by tapping and holding an empty spot, then dragging in a direction.\n- [accent]Cancel construction or selection[] by pressing the X at the bottom left. text.deconstruction.title = Block Deconstruction Guide text.deconstruction = You've just selected [accent]block deconstruction mode[].\n\nTo begin breaking, simply tap a block near your ship.\nOnce you have selected some blocks, press the checkbox to confirm, and your ship will begin de-constructing them.\n\n- [accent]Remove blocks[] from your selection by tapping them.\n- [accent]Remove blocks in an area[] by tapping and holding an empty spot, then dragging in a direction.\n- [accent]Cancel deconstruction or selection[] by pressing the X at the bottom left. -text.showagain = Don't show again next session -text.coreattack = < Core is under attack! > -text.unlocks = Unlocks +text.showagain = Jangan tampilkan lagi di sesi berikutnya +text.coreattack = < Intinya sedang diserang! > +text.unlocks = Pencapaian text.savegame = Simpan Permainan text.loadgame = Lanjutkan text.joingame = Bermain Bersama -text.addplayers = Add/Remove Players -text.customgame = Custom Game -text.sectors = Sectors -text.sector = Selected Sector: [LIGHT_GRAY]{0} -text.sector.time = Time: [LIGHT_GRAY]{0} -text.sector.deploy = Deploy -text.sector.abandon = Abandon -text.sector.abandon.confirm = Are you sure you want to abandon all progress at this sector?\nThis cannot be undone! -text.sector.resume = Resume -text.sector.locked = [scarlet][[Incomplete] -text.sector.unexplored = [accent][[Unexplored] -text.missions = Missions:[LIGHT_GRAY] {0} -text.mission = Mission:[LIGHT_GRAY] {0} -text.mission.main = Main Mission:[LIGHT_GRAY] {0} -text.mission.info = Mission Info -text.mission.complete = Mission complete! -text.mission.complete.body = Sector {0},{1} has been conquered. -text.mission.wave = Survive[accent] {0}/{1} []waves\nWave in {2} -text.mission.wave.enemies = Survive[accent] {0}/{1} []waves\n{2} Enemies -text.mission.wave.enemy = Survive[accent] {0}/{1} []waves\n{2} Enemy -text.mission.wave.menu = Survive[accent] {0} []waves -text.mission.battle = Destroy the enemy base. -text.mission.resource.menu = Obtain {0} x{1} -text.mission.resource = Obtain {0}:\n[accent]{1}/{2}[] -text.mission.block = Create {0} -text.mission.unit = Create {0} Unit -text.mission.command = Send Command {0} To Units -text.mission.linknode = Link Power Node -text.mission.display = [accent]Mission:\n[LIGHT_GRAY]{0} -text.mission.mech = Switch to mech[accent] {0}[] -text.mission.create = Create[accent] {0}[] -text.none = -text.close = Close +text.addplayers = Tambah/Hapus Pemain +text.customgame = Game Bebas +text.sectors = Sektor +text.sector = Sektor Dipilih: [LIGHT_GRAY]{0} +text.sector.time = Waktu: [LIGHT_GRAY]{0} +text.sector.deploy = Pasang +text.sector.abandon = Batalkan +text.sector.abandon.confirm = Apakah kamu yakin ingin membatalkan all progress at this sector?\nIni tidak dapat diubah kembali! +text.sector.resume = Lanjutkan +text.sector.locked = [scarlet][[Belum Selesai] +text.sector.unexplored = [accent][[Belum Ditelusuri] +text.missions = Misi:[LIGHT_GRAY] {0} +text.mission = Misi:[LIGHT_GRAY] {0} +text.mission.main = Misi Utama:[LIGHT_GRAY] {0} +text.mission.info = Info Misi +text.mission.complete = Misi selesai! +text.mission.complete.body = Sektor {0},{1} telah dikuasai. +text.mission.wave = Bertahanlah selama [accent]{0}[] gelombang. +text.mission.wave.enemies = Bertahanlah selama[accent] {0}/{1} []gelombang\n{2} Musuh +text.mission.wave.enemy = Bertahanlah selama[accent] {0}/{1} []gelombang\n{2} Musuh +text.mission.wave.menu = Bertahanlah selama[accent] {0} []gelombang +text.mission.battle = Hancurkan markas musuh. +text.mission.resource.menu = Dapatkan {0} x{1} +text.mission.resource = Dapatkan {0}:\n[accent]{1}/{2}[] +text.mission.block = Buat {0} +text.mission.unit = Buat {0} Pasukan +text.mission.command = Beri Perintah {0} Ke Pasukan +text.mission.linknode = Gabungkan Power Node +text.mission.display = [accent]Misi:\n[LIGHT_GRAY]{0} +text.mission.mech = Ganti ke robot[accent] {0}[] +text.mission.create = Buat[accent] {0}[] +text.none = +text.close = Tutup text.quit = Keluar -text.maps = Maps -text.continue = Continue -text.nextmission = Next Mission -text.maps.none = [LIGHT_GRAY]No maps found! +text.maps = Peta +text.continue = Lanjutkan +text.nextmission = Tugas Berikut +text.maps.none = [LIGHT_GRAY]Peta tidak ditemukan! text.about.button = Tentang text.name = Nama: -text.filename = File Name: -text.unlocked = New Block Unlocked! -text.unlocked.plural = New Blocks Unlocked! +text.filename = Nama file: +text.unlocked = Blok Baru Terbuka! +text.unlocked.plural = Blok Baru Terbuka! text.players = {0} pemain online text.players.single = {0} pemain online text.server.closing = [accent]Menutup server... text.server.kicked.kick = Anda telah dikeluarkan dari server! -text.server.kicked.serverClose = Server closed. -text.server.kicked.sectorComplete = Sector completed. -text.server.kicked.sectorComplete.text = Your mission is complete.\nThe server will now continue at the next sector. +text.server.kicked.serverClose = Server ditutup. +text.server.kicked.sectorComplete = Sektor selesai. +text.server.kicked.sectorComplete.text = Misi Anda telah selesai.\nServer akan melanjutkan ke sektor selanjutnya. text.server.kicked.clientOutdated = Client versi lama! Update game Anda! -text.server.kicked.serverOutdated = Server versi lama! Tanyakan host untuk mengupdate! -text.server.kicked.banned = You are banned on this server. -text.server.kicked.recentKick = You have been kicked recently.\nWait before connecting again. -text.server.kicked.nameInUse = There is someone with that name\nalready on this server. -text.server.kicked.nameEmpty = Your name must contain at least one character or number. -text.server.kicked.idInUse = You are already on this server! Connecting with two accounts is not permitted. -text.server.kicked.customClient = This server does not support custom builds. Download an official version. -text.host.info = The [accent]host[] button hosts a server on ports [scarlet]6567[] and [scarlet]6568.[]\nAnybody on the same [LIGHT_GRAY]wifi or local network[] should be able to see your server in their server list.\n\nIf you want people to be able to connect from anywhere by IP, [accent]port forwarding[] is required.\n\n[LIGHT_GRAY]Note: If someone is experiencing trouble connecting to your LAN game, make sure you have allowed Mindustry access to your local network in your firewall settings. -text.join.info = Here, you can enter a [accent]server IP[] to connect to, or discover [accent]local network[] servers to connect to.\nBoth LAN and WAN multiplayer is supported.\n\n[LIGHT_GRAY]Note: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP. +text.server.kicked.serverOutdated = Server versi lama! Tanyakan host untuk memperbaharuinya! +text.server.kicked.banned = Anda telah di-ban dari server ini. +text.server.kicked.recentKick = Kamu baru saja dikeluarkan.\nTunggu sebentar sebelum terhubung kembali. +text.server.kicked.nameInUse = Ada seseorang dengan nama\nitu di server ini. +text.server.kicked.nameEmpty = Nama Anda harus mengandung setidaknya satu karakter atau angka. +text.server.kicked.idInUse = Kamu sudah ada di server ini! Menghubungkan dengan dua akun tidak diizinkan. +text.server.kicked.customClient = Server ini tidak mendukung bentukan khusus. Unduh versi resmi. +text.host.info = Tombol [accent]host[] akan membuat server dengan port [scarlet]6567[] dan [scarlet]6568.[]\nSiapa saja yang terhubung ke [LIGHT_GRAY]WiFi atau jaringan lokal[] dapat melihat server Anda di daftar server.\n\nJika Anda ingin orang-orang agar dapat terhubung dari mana saja melalui IP, diperlukan [accent]port forwarding[].\n\n[LIGHT_GRAY]Catatan: Jika seseorang mengalami kesulitan untuk bergabung, pastikan bahwa Anda telah mengizinkan akses Mindustry ke jaringan lokal Anda di pengaturan firewall. +text.join.info = Di sini, Anda dapat memasukan [accent]IP server[] yang akan dihubungkan, atau menemukan server di [accent]jaringan lokal[] untuk dihubungkan.\nKedua jaringan LAN dan WAN didukung.\n\n[LIGHT_GRAY]Catatan: There is no automatic global server list; if you want to connect to someone by IP, you would need to ask the host for their IP. text.hostserver = Host Server -text.hostserver.mobile = Host\nGame +text.hostserver.mobile = Host\nPermainan text.host = Host text.hosting = [accent]Membuka server... text.hosts.refresh = Segarkan @@ -100,34 +100,34 @@ text.hosts.discovering = Mencari game LAN text.server.refreshing = Menyegarkan server text.hosts.none = [lightgray]Tidak ada game LAN yang ditemukan! text.host.invalid = [scarlet]Tidak dapat terhubung ke host. -text.trace = Trace Player -text.trace.playername = Player name: [accent]{0} +text.trace = Lacak Pemain +text.trace.playername = Nama pemain: [accent]{0} text.trace.ip = IP: [accent]{0} -text.trace.id = Unique ID: [accent]{0} -text.trace.android = Android Client: [accent]{0} -text.trace.modclient = Custom Client: [accent]{0} -text.trace.totalblocksbroken = Total blocks broken: [accent]{0} -text.trace.structureblocksbroken = Structure blocks broken: [accent]{0} -text.trace.lastblockbroken = Last block broken: [accent]{0} -text.trace.totalblocksplaced = Total blocks placed: [accent]{0} -text.trace.lastblockplaced = Last block placed: [accent]{0} -text.invalidid = Invalid client ID! Submit a bug report. -text.server.bans = Bans -text.server.bans.none = No banned players found! -text.server.admins = Admins -text.server.admins.none = No admins found! +text.trace.id = ID Unik: [accent]{0} +text.trace.android = Klien Android: [accent]{0} +text.trace.modclient = Klien Khusus: [accent]{0} +text.trace.totalblocksbroken = Jumlah blok dihancurkan: [accent]{0} +text.trace.structureblocksbroken = Blok struktur dihancurkan: [accent]{0} +text.trace.lastblockbroken = Blok terakhir dihancurkan: [accent]{0} +text.trace.totalblocksplaced = Jumlah dipasang: [accent]{0} +text.trace.lastblockplaced = Blok terakhir dipasang: [accent]{0} +text.invalidid = ID klien tidak valid! Kirim laporan bug. +text.server.bans = Ban +text.server.bans.none = Tidak ada pemain di-ban! +text.server.admins = Admin +text.server.admins.none = Tidak ada admin yang ditemukan! text.server.add = Tambahkan Server text.server.delete = Yakin ingin menghapus server ini? text.server.hostname = Host: {0} text.server.edit = Sunting Server -text.server.outdated = [crimson]Outdated Server![] -text.server.outdated.client = [crimson]Outdated Client![] -text.server.version = [lightgray]Version: {0} -text.server.custombuild = [yellow]Custom Build -text.confirmban = Are you sure you want to ban this player? -text.confirmkick = Are you sure you want to kick this player? -text.confirmunban = Are you sure you want to unban this player? -text.confirmadmin = Are you sure you want to make this player an admin? +text.server.outdated = [crimson]Server kedaluarsa![] +text.server.outdated.client = [crimson]Klien kedaluarsa![] +text.server.version = [lightgray]Versi: {0} +text.server.custombuild = [yellow]Bentukan khusus +text.confirmban = Apakah Anda yakin ingin melarang pemain ini? +text.confirmkick = Apakah Anda yakin ingin mengeluarkan pemain ini? +text.confirmunban = Apakah Anda yakin ingin mengizinkan pemain ini? +text.confirmadmin = Apakah Anda yakin ingin menjadikan pemain ini sebagai admin? text.confirmunadmin = Are you sure you want to remove admin status from this player? text.joingame.title = Bermain Bersama text.joingame.ip = IP: diff --git a/core/assets/bundles/bundle_ja.properties b/core/assets/bundles/bundle_ja.properties index b9c8600522..ad32034bc4 100644 --- a/core/assets/bundles/bundle_ja.properties +++ b/core/assets/bundles/bundle_ja.properties @@ -7,9 +7,10 @@ text.link.github.description = ゲームのソースコード text.link.dev-builds.description = 不安定な開発ビルド text.link.trello.description = 公式 Trelloボード の実装予定の機能をチェック text.link.itch.io.description = itch.ioでPC版のダウンロードやweb版をプレイ -text.link.google-play.description = Google Playのストアページ +text.link.google-play.description = Google Playのストア text.link.wiki.description = 公式 Mindustry Wiki -text.linkfail = リンクを開くのに失敗しました!\nURLをクリップボードにコピーしました。 +text.linkfail = リンクを開けませんでした!\nURLをクリップボードにコピーしました。 +text.screenshot = スクリーンショットを {0} に保存しました。 text.gameover = ゲームオーバー text.gameover.pvp = [accent] {0}[] チームの勝利! text.sector.gameover = この区域は敗北しました。 再配備しますか? @@ -21,11 +22,11 @@ text.level.delete.title = 削除の確認 text.map.delete = マップ "[accent]{0}[]" を削除してもよろしいですか? text.level.select = レベル選択 text.level.mode = ゲームモード: -text.construction.desktop = ブロックの選択や建設を止めるには、[accent]スペースを使用してください[]。 +text.construction.desktop = ブロックの選択や建設を止めるには、[accent]スペースを使用[]してください。 text.construction.title = ブロック建設ガイド -text.construction = [accent]ブロック建設モード[]になりました。\n設置するには、機体の近くの設置可能な場所をタップしてください。\nブロックを選択した状態で、チェックボタンを押して確認すると、機体が建設を始めます。\n\n- [accent]ブロックの撤去[]は、タップして範囲を選択してください。\n- [accent]範囲の選択[]は、長押しして、範囲のブロックをドラッグしてください。\n- [accent]一列にブロックを設置[]するには、 タップで空いている場所を長押しして、伸ばしたい方向にドラッグしてください\n- [accent]建設や範囲の選択をキャンセル[]するには、左下の X ボタンを押してください。 +text.construction = [accent]ブロック建設モード[]になりました。\n設置するには、機体の近くの設置可能な場所をタップしてください。\nブロックを選択した状態で、チェックボタンを押して確認すると、機体が建設を始めます。\n\n- [accent]ブロックを撤去[]するには、タップして範囲を選択してください。\n- [accent]範囲を選択[]するには、長押しして、範囲のブロックをドラッグしてください。\n- [accent]一列にブロックを設置[]するには、 タップで空いている場所を長押しして、伸ばしたい方向にドラッグしてください\n- [accent]建設や範囲の選択をキャンセル[]するには、左下の X ボタンを押してください。 text.deconstruction.title = ブロック撤去ガイド -text.deconstruction = [accent]ブロック撤去モード[]になりました。\n\nブロックを撤去するには、機体の近くのブロックをタップしてください。\nブロックを選択した状態で、チェックボタンを押して確認すると、機体がブロックの撤去を始めます。\n\n- [accent]ブロックの破壊[]は、タップで範囲を選択してください。\n- [accent]範囲を選択してブロックを撤去[]するには、 タップで空いている場所を長押しして、伸ばしたい方向にドラッグしてください\n- [accent]撤去や範囲選択をキャンセル[]するには、左下の X ボタンを押してください。 +text.deconstruction = [accent]ブロック撤去モード[]になりました。\n\nブロックを撤去するには、機体の近くのブロックをタップしてください。\nブロックを選択した状態で、チェックボタンを押して確認すると、機体がブロックの撤去を始めます。\n\n- [accent]ブロックを撤去[]するには、タップして範囲を選択してください。\n- [accent]範囲を選択してブロックを撤去[]するには、 タップで空いている場所を長押しして、伸ばしたい方向にドラッグしてください\n- [accent]撤去や範囲選択をキャンセル[]するには、左下の X ボタンを押してください。 text.showagain = 次回以降表示しない text.coreattack = < コアが攻撃を受けています! > text.unlocks = アンロック @@ -132,7 +133,7 @@ text.confirmunban = このプレイヤーの Ban を解除しますか? text.confirmadmin = このプレイヤーを管理者にしますか? text.confirmunadmin = このプレイヤーを管理者から削除しますか? text.joingame.title = サーバーに参加 -text.joingame.ip = IP: +text.joingame.ip = アドレス: text.disconnect = 接続が切断されました。 text.disconnect.data = ワールドデータの読み込みに失敗しました! text.connecting = [accent]接続中... @@ -293,7 +294,7 @@ text.blocks.blockinfo = ブロック情報 text.blocks.powercapacity = 電力容量 text.blocks.powershot = 電力/ショット text.blocks.targetsair = 対空攻撃 -text.blocks.itemspeed = ユニットの移動速度 +text.blocks.itemspeed = 輸送速度 text.blocks.shootrange = 範囲 text.blocks.size = 大きさ text.blocks.liquidcapacity = 液体容量 @@ -324,7 +325,7 @@ text.blocks.liquidfueluse = 液体燃料使用量 text.blocks.boostitem = 加速アイテム text.blocks.boostliquid = 加速液体 text.blocks.health = 耐久値 -text.blocks.inaccuracy = 不正確 +text.blocks.inaccuracy = 精度のずれ text.blocks.shots = ショット text.blocks.reload = ショット/秒 text.blocks.inputfuel = 燃料 @@ -348,6 +349,7 @@ text.category.items = アイテム text.category.crafting = 製作速度 text.category.shooting = 攻撃速度 text.category.optional = 機能強化オプション +setting.indicators.name = 味方の方角表示 setting.autotarget.name = 自動ターゲット setting.fpscap.name = 最大FPS setting.fpscap.none = なし @@ -379,9 +381,12 @@ category.view.name = 表示 category.multiplayer.name = マルチプレイ command.attack = 攻撃 command.retreat = 退却 -command.patrol = 警戒 +command.patrol = 巡回 +keybind.gridMode.name = ブロック選択 +keybind.gridModeShift.name = カテゴリー選択 keybind.press = キーを押してください... keybind.press.axis = 軸またはキーを押してください... +keybind.screenshot.name = スクリーンショット keybind.move_x.name = 左右移動 keybind.move_y.name = 上下移動 keybind.select.name = 選択/ショット @@ -405,13 +410,15 @@ keybind.drop_unit.name = ドロップユニット keybind.zoom_minimap.name = ミニマップのズーム mode.text.help.title = モード説明 mode.waves.name = ウェーブ -mode.waves.description = ノーマルモードです。限られた資源でウェーブが自動的に始まります。 +mode.waves.description = 通常モードです。限られた資源の中でウェーブが自動的に進行します。 mode.sandbox.name = サンドボックス -mode.sandbox.description = 無限の資源でウェーブを自由に始められます。 +mode.sandbox.description = 無限の資源でウェーブを自由に進行できます。 mode.freebuild.name = フリービルド -mode.freebuild.description = 限られた資源でウェーブを自由に始められます。 +mode.freebuild.description = 限られた資源の中でウェーブを自由に進行できます。 mode.pvp.name = PvP -mode.pvp.description = ローカルで他のプレイヤー戦います。 +mode.pvp.description = ローカル内で他のプレイヤーと戦います。 +mode.attack.name = アタック +mode.attack.descrption = ウェーブはなく、敵基地の破壊を目指します。 content.item.name = アイテム content.liquid.name = 液体 content.unit.name = ユニット @@ -426,27 +433,27 @@ item.lead.description = 一般的で手軽な鉱石です。機械や液体輸 item.coal.name = 石炭 item.coal.description = 一般的で有用な燃料です。 item.dense-alloy.name = 高密度合金 -item.dense-alloy.description = 銅と鉛でできた丈夫な合金です。高性能な戦争ブロックやドリルに使われます。 +item.dense-alloy.description = 銅と鉛でできた丈夫な合金です。高性能な輸送ブロックやドリルに使われます。 item.titanium.name = チタン -item.titanium.description = 希少で超軽量な金属です。液体輸送やドリル、航空機などで使われます。 +item.titanium.description = 希少で非常に軽量な金属です。液体輸送やドリル、航空機などで使われます。 item.thorium.name = トリウム -item.thorium.description = 高密度で放射性の金属です。構造的な支援や核燃料に使われます。 +item.thorium.description = 放射性を持つ高密度な金属です。建物の補強や核燃料として使われます。 item.silicon.name = シリコン item.silicon.description = 非常に有用な半導体でソーラーパネルや多くの複雑な機械に応用できます。 item.plastanium.name = プラスタニウム -item.plastanium.description = 軽量で伸縮性のある材料です。飛行機や弾薬に使用されます。 +item.plastanium.description = 軽量で伸縮性のある材料です。機体や弾薬に使用されます。 item.phase-fabric.name = フェーズファイバー -item.phase-fabric.description = 軽くない物質です。高度な機械や自己修復技術に使用されます。 +item.phase-fabric.description = 極めて軽量な素材です。高度な機械や自己修復技術に使用されます。 item.surge-alloy.name = サージ合金 -item.surge-alloy.description = 独特な電気的特性を持った特殊合金です。 +item.surge-alloy.description = 電気的特性を持った特殊な合金です。 item.biomatter.name = バイオメター -item.biomatter.description = 有機物の混ざったの塊です。石油への転換や燃料として使われます。 +item.biomatter.description = 有機物を含んだ塊です。石油への転換や燃料として使われます。 item.sand.name = 砂 item.sand.description = 合金や融剤など広く使用されている一般的な材料です。 item.blast-compound.name = 爆発性化合物 -item.blast-compound.description = 爆弾や爆発物に使われる揮発性化合物です。燃料として燃やすこともできますが、推奨されません。 +item.blast-compound.description = 爆弾や爆発物に使われる揮発性の化合物です。燃料として燃やすこともできますが、お勧めしません。 item.pyratite.name = ピラタイト -item.pyratite.description = 兵器に使われる非常に燃えやすい物質です。 +item.pyratite.description = 兵器などに使われる非常に燃えやすい物質です。 liquid.water.name = 水 liquid.lava.name = 溶岩 liquid.oil.name = 石油 @@ -454,31 +461,31 @@ liquid.cryofluid.name = 冷却水 mech.alpha-mech.name = アルファ mech.alpha-mech.weapon = 重武装機関砲 mech.alpha-mech.ability = ドローン部隊 -mech.alpha-mech.description = 一般的な機体です。標準的な速度と攻撃力を持っています。攻撃力を高めるために最大3体のドローンを作成することができます。 +mech.alpha-mech.description = 一般的な機体です。標準的な速度と攻撃力を持っています。攻撃力を高めるために最大3体のドローン機を持っています。 mech.delta-mech.name = デルタ mech.delta-mech.weapon = 電撃砲 -mech.delta-mech.ability = 電撃チャージ -mech.delta-mech.description = 高速に移動する敵のために素早く軽装化された機体です。建造物にはほとんどダメージを与えませんが、電撃を使って、たくさんの敵を素早く倒すことができます。 +mech.delta-mech.ability = 放電 +mech.delta-mech.description = 高速移動する敵のために素早く軽量化された機体です。建物にはほとんどダメージを与えられませんが、電撃でたくさんの敵を攻撃することができます。 mech.tau-mech.name = タウ mech.tau-mech.weapon = 修復レーザー mech.tau-mech.ability = リペアバースト -mech.tau-mech.description = 支援型機体です。ダメージを受けたブロックを修復や火災の消火、半径内の味方を治療を行います。 +mech.tau-mech.description = 支援型機体です。ダメージを受けたブロックを修復や火災の消火、半径内の味方の治療を行います。 mech.omega-mech.name = オメガ mech.omega-mech.weapon = ロケット弾 -mech.omega-mech.ability = 重装備 -mech.omega-mech.description = 最前線での攻撃向けに作られた大型機体です。重装備によってダメージの90%を防ぐことができます。 -mech.dart-ship.name = ダート +mech.omega-mech.ability = プロテクター +mech.omega-mech.description = 最前線での攻撃向けに作られた大型機体です。プロテクターによってダメージの90%を防ぐことができます。 +mech.dart-ship.name = ダーツ mech.dart-ship.weapon = 機関砲 -mech.dart-ship.description = 一般的な機体です。高速で軽く使いやすいですが、攻撃能力はほとんどなく採掘速度が遅いのが欠点です。 +mech.dart-ship.description = 一般的な機体です。軽く高速で使いやすいですが、攻撃能力はほとんどなく採掘速度も遅いのが難点です。 mech.javelin-ship.name = ジャベリン -mech.javelin-ship.description = 最初は遅いですが、敵の基地では速度と飛行能力が飛躍的に高まり、電撃やミサイルで多量のダメージを与えることができます。 +mech.javelin-ship.description = 高速移動ができる機体です。最初は遅いですが、敵の基地で飛行能力が飛躍的に高まり、電撃やミサイルで多量のダメージを与えることができます。 mech.javelin-ship.weapon = バーストミサイル mech.javelin-ship.ability = 放電ブースター mech.trident-ship.name = トライデント -mech.trident-ship.description = 強力な爆撃機です。頑丈な装甲です。 +mech.trident-ship.description = 強力な爆撃機です。強固な装甲を有しています。 mech.trident-ship.weapon = 爆弾 mech.glaive-ship.name = グライブ -mech.glaive-ship.description = 大きく、重武装された攻撃機です。焼夷弾が装備され、優れた加速と最高速度を保有しています。 +mech.glaive-ship.description = 重武装された大型攻撃機です。焼夷弾が装備され、機体の中でも優れた加速と最高速度を有しています。 mech.glaive-ship.weapon = 焼夷弾 text.item.explosiveness = [LIGHT_GRAY]爆発性: {0}% text.item.flammability = [LIGHT_GRAY]可燃性: {0}% @@ -495,7 +502,7 @@ text.mech.ability = [LIGHT_GRAY]能力: {0} text.liquid.heatcapacity = [LIGHT_GRAY]熱容量: {0} text.liquid.viscosity = [LIGHT_GRAY]粘度: {0} text.liquid.temperature = [LIGHT_GRAY]温度: {0} -block.constructing = {0}\n[LIGHT_GRAY](Constructing) +block.constructing = {0}\n[LIGHT_GRAY](建設中) block.spawn.name = エネミースポーン block.core.name = コア block.metalfloor.name = 金属製の床 @@ -534,7 +541,7 @@ block.junction.name = ジャンクション block.router.name = ルーター block.distributor.name = ディストリビューター block.sorter.name = ソーター -block.sorter.description = アイテムを分別します。設定されたアイテムを通します。異なるアイテムの場合、左右に搬出します。 +block.sorter.description = アイテムを分別して搬出します。設定されたアイテムは通過させ、異なるアイテムの場合、左右に搬出します。 block.overflow-gate.name = オーバーフローゲート block.overflow-gate.description = 搬出先がいっぱいの場合に左右にアイテムを搬出します。 block.smelter.name = 溶鉱炉 @@ -560,7 +567,7 @@ block.laser-drill.name = レーザードリル block.water-extractor.name = ウォーターポンプ block.cultivator.name = 耕作機 block.alpha-mech-pad.name = アルファパッド -block.dart-ship-pad.name = ダートパッド +block.dart-ship-pad.name = ダーツパッド block.delta-mech-pad.name = デルタパッド block.javelin-ship-pad.name = ジャベリンパッド block.trident-ship-pad.name = トライデントパッド @@ -582,7 +589,7 @@ block.salvo.name = サルボー block.ripple.name = リップル block.phase-conveyor.name = フェーズコンベアー block.bridge-conveyor.name = ブリッジコンベアー -block.plastanium-compressor.name = プラスタニウムコンプレッサー +block.plastanium-compressor.name = プラスタニウム圧縮機 block.pyratite-mixer.name = ピラタイトミキサー block.blast-mixer.name = 化合物ミキサー block.solidifer.name = 冷却機 @@ -608,7 +615,7 @@ block.rotary-pump.name = ロータリーポンプ block.thorium-reactor.name = トリウムリアクター block.command-center.name = コマンドセンター block.mass-driver.name = マスドライバー -block.blast-drill.name = エアブラシドリル +block.blast-drill.name = エアブラストドリル block.thermal-pump.name = サーマルポンプ block.thermal-generator.name = サーマル発電機 block.alloy-smelter.name = 合金溶鉱炉 @@ -669,7 +676,7 @@ tutorial.silicon = シリコン溶鉱炉で製造したシリコンを回収し tutorial.daggerfactory = [accent]ダガーユニット製造機[]を作りましょう。\n\nこれを使うと攻撃ユニットを作ってくれます。 tutorial.router = 生産機には電力が必要です。\nコンベアーから資源を分けるためにルーターを作りましょう。 tutorial.dagger = 電源ノードを生産機に接続しましょう。\n要件が揃うと、ユニットを作り始めます。\n\n必要に応じて、ドリルや発電機、コンベアーを増やしましょう。 -tutorial.battle = [LIGHT_GRAY]敵[]のコアが見つかりました。\nユニットやダガーで破壊しましょう。 +tutorial.battle = [LIGHT_GRAY]敵[]のコアが見つかりました。\nユニットやダガー機で敵の基地を破壊しましょう。 block.copper-wall.description = 安価な防壁ブロックです。\n最初のウェーブでコアやターレットを保護するのに便利です。 block.copper-wall-large.description = 安価な大型防壁ブロックです。\n最初のウェーブでコアやターレットを保護するのに便利です。 block.dense-alloy-wall.description = 標準的な防壁ブロックです。\n敵からの保護に最適です。 @@ -678,64 +685,64 @@ block.thorium-wall.description = 強化された防壁ブロックです。\n敵 block.thorium-wall-large.description = 強化された大型防壁ブロックです。\n敵からの保護により強固です。 block.phase-wall.description = トリウムの壁ほど強固ではないが、強力な弾でなければ弾き返すことができます。 block.phase-wall-large.description = トリウムの壁ほど強固ではないが、強力な弾でなければ弾き返すことができます。 -block.surge-wall.description = 最も硬い防壁ブロックです。\n偶に攻撃されると敵に電撃を与えます。 -block.surge-wall-large.description = 最も硬い大型防壁ブロックです。\n偶に攻撃されると敵に電撃を与えます。 -block.door.description = 小さなドアです。タップすることで開閉することができます。\nただし、ドアが開いている場合、弾や敵も通過できます。 -block.door-large.description = 大きなドアです。タップすることで開閉することができます。\nただし、ドアが開いている場合、弾や敵も通過できます。 -block.mend-projector.description = 周辺のブロックを修復します。 -block.overdrive-projector.description = ドリルやコンベアなどの近くの施設の速度を向上させます。 -block.force-projector.description = 六角形の力場を作り出し、内部の建造物やユニットなどを守ります。 +block.surge-wall.description = 最も硬い防壁ブロックです。\nたまに攻撃されると敵に電撃を与えます。 +block.surge-wall-large.description = 最も硬い大型防壁ブロックです。\nたまに攻撃されると敵に電撃を与えます。 +block.door.description = 小さなドアブロックです。タップすることで開閉することができます。\nただし、ドアが開いている場合、弾や敵も通過できます。 +block.door-large.description = 大きなドアブロックです。タップすることで開閉することができます。\nただし、ドアが開いている場合、弾や敵も通過できます。 +block.mend-projector.description = 定期的に周辺のブロックを修復します。 +block.overdrive-projector.description = ドリルやコンベアなど、近くの施設の効率を向上させます。 +block.force-projector.description = 周囲に六角形の力場を作り出し、内部の建造物やユニットなどを守ります。 block.shock-mine.description = 敵が踏むと、ダメージを与えます。敵には見えません。 block.duo.description = 小さく安価なターレットです。 -block.arc.description = 小さな電撃ターレットです。敵に向かってランダムな半円状に電撃を放ちます。 -block.hail.description = 小さな砲撃ターレットです。 +block.arc.description = 小型の電撃ターレットです。敵に向かってランダムな半円状に電撃を放ちます。 +block.hail.description = 小型の砲撃ターレットです。 block.lancer.description = チャージビームを放つ中型ターレットです。 block.wave.description = バブルの連射攻撃をする中型ターレットです。 block.salvo.description = 一斉に攻撃を行う中型のターレットです。 block.swarmer.description = バーストミサイルで攻撃する中型ターレットです。 block.ripple.description = 同時に複数ショットを発射する大型ターレットです。 block.cyclone.description = 大型連射ターレットです。 -block.fuse.description = 短距離攻撃をする大型ターレットです。 -block.spectre.description = 一度に2発の強力な弾を撃つ大型ターレットです。 -block.meltdown.description = 強力な長距離攻撃をする大型ターレットです。 -block.conveyor.description = 一般的なアイテム輸送ブロックです。アイテムを前方に移動し、自動的にターレットや製造機などに入れます。回転できます。 -block.titanium-conveyor.description = 強化されたアイテム輸送ブロックです。通常のコンベアーよりも速くアイテムを移動します。 -block.phase-conveyor.description = 強化されたアイテム転送ブロックです。電力を使用して、離れた場所にあるフェーズコンベアーにアイテムを転送することができます。 -block.junction.description = 交差している2つのコンベアーをブリッジします。2つの異なるコンベアーが異なる場所に異なる材料を運んでいるときに便利です。 -block.mass-driver.description = 長距離の輸送が可能なアイテム輸送ブロックです。離れた別のマスドライバーにアイテムを発射します。 +block.fuse.description = 短距離攻撃が得意な大型ターレットです。 +block.spectre.description = 一度に2発の強力な弾を放つ大型ターレットです。 +block.meltdown.description = 強力な長距離攻撃が可能な大型ターレットです。 +block.conveyor.description = 一般的なアイテム輸送ブロックです。アイテムを前方に移動し、自動的にターレットや機械などに搬入します。回転させることができます。 +block.titanium-conveyor.description = 改良されたアイテム輸送ブロックです。通常のコンベアーよりも速くアイテムを輸送します。 +block.phase-conveyor.description = 改良されたアイテム転送ブロックです。電力を使用して、離れた場所にあるフェーズコンベアーにアイテムを転送することができます。 +block.junction.description = 十字に交差したコンベアーをそれぞれ前方に搬出します。コンベアーで複雑な構造を組み立てるときに便利です。 +block.mass-driver.description = 長距離の輸送が可能なアイテム上位輸送ブロックです。離れた別のマスドライバーにアイテムを発射します。 block.smelter.description = 石炭を燃やして、銅と鉛から高密度合金を製錬します。 block.arc-smelter.description = 電力を使用して銅と鉛から高密度合金を製錬します。 block.silicon-smelter.description = 石炭と砂からシリコンを製造します。 -block.plastanium-compressor.description = オイルとチタンからプラスチナニウムを製造します。 +block.plastanium-compressor.description = オイルとチタンからプラスタニウムを製造します。 block.phase-weaver.description = 放射性トリウムと多量の砂からフェーズファイバーを作り出します。 block.alloy-smelter.description = チタンや鉛、シリコン、銅からサージ合金を製造します。 -block.pulverizer.description = 石を砕いて砂にします。自然の砂がない時に便利です。 -block.pyratite-mixer.description = 石炭、鉛、砂から燃えやすいピラタイトを作成します。 +block.pulverizer.description = 石を砕いて砂にします。自然の砂がない場合に便利です。 +block.pyratite-mixer.description = 石炭、鉛、砂から燃えやすいピラタイトを製造します。 block.blast-mixer.description = 可燃性のピラタイトを石油を使用してさらに爆発性化合物にします。 -block.cryofluidmixer.description = 水とチタンから冷却に効率的な冷却水を生成します。 -block.solidifer.description = 溶岩から急速に冷やして石を生成します。 -block.melter.description = 石を高温にして溶岩を生成します。 +block.cryofluidmixer.description = 水とチタンから冷却に効率的な冷却水を製造します。 +block.solidifer.description = 溶岩を急速に冷却し、石を生成します。 +block.melter.description = 石を熱で溶かして溶岩を生成します。 block.incinerator.description = 不要なアイテムや液体を焼却します。 -block.biomattercompressor.description = バイオメターを圧縮し、石油を回収します。 -block.separator.description = 石に水圧をかけて、石に含まれる様々な鉱石を回収します。 -block.centrifuge.description = 分離機よりも効率的ですが、建設費が高価で電力が必要です。 -block.power-node.description = 他のノードに接続して電気を送ります。最大で4つの電力源やノードなどに接続できます。隣接するブロックから電力を受け取ったり、電力の供給を行います。 -block.power-node-large.description = 電源ノードよりも大きく、最大で6つの電力源やノードなどに接続できます。 -block.battery.description = 電源ノード間で電力が余っていれば充電し、不足していれば供給します。 -block.battery-large.description = 通常のバッテリーより多くの電力を貯めて置くことができます。 +block.biomattercompressor.description = バイオメターを圧縮して、石油を回収します。 +block.separator.description = 石を水圧で砕き、石に含まれる様々な鉱石を回収します。 +block.centrifuge.description = 建設費が高価で電力も必要ですが、分離機よりも効率的に回収できます。 +block.power-node.description = 電力ノード間で電力の送電を行います。最大で4つの電力源やノードなどに接続できます。隣接するブロックから電力の送電や供給を行います。 +block.power-node-large.description = 巨大な電力ノードです。最大で6つの電力源やノードに接続できます。 +block.battery.description = 余分な電力の充電して、貯めておくことができます。必要があれば、溜まった電力を供給します。 +block.battery-large.description = 通常のバッテリーよりもたくさんの電力を溜めておくことができます block.combustion-generator.description = 石油や可燃性の物質を燃やして発電します。 -block.turbine-generator.description = 火力発電機より効率的ですが、水が必要です。 +block.turbine-generator.description = 水を使って火力発電機より効率的に発電します。 block.thermal-generator.description = 溶岩から大量の電力を発電します。 block.solar-panel.description = 太陽光から少量の電力を発電します。 -block.solar-panel-large.description = 通常のソーラーパネルより大量の電力を発電できますが、建設費が高価です。 -block.thorium-reactor.description = 高放射性のトリウムから大量の電力を発電します。これには一定の冷却が必要です。冷却が不十分な場合大きな爆発が発生します。 +block.solar-panel-large.description = 建設費が高価ですが、通常のソーラーパネルより大量の電力を発電することができます。 +block.thorium-reactor.description = 高い放射性を持ったトリウムから大量の電力を発電します。これには一定の冷却が必要です。冷却が不十分な場合、大きな爆発が発生します。 block.rtg-generator.description = トリウムリアクターよりも発電量は少ないですが、冷却を必要としない放射性同位体熱発電機(RTG)です。 block.unloader.description = コンテナやボールト、コアからアイテムをコンベアーか隣接するブロックに搬出します。アンローダーをタップすると搬出するアイテムを変更することができます。 block.container.description = 各種類のアイテムを少量ずつ保管します。隣接するコンテナーやボール卜、コアは一つのストレージユニットとして扱われます。 [LIGHT_GRAY]アンローダー[]を使って、コンテナーからアイテムを搬出できます。 block.vault.description = 各種類のアイテムを大量に保管します。隣接するコンテナーやボール卜、コアは一つのストレージユニットとして扱われます。[LIGHT_GRAY]アンローダー[]を使って、ボールトからアイテムを搬出できます。 block.mechanical-drill.description = 安価なドリルです。採掘可能な鉱脈に設置すると、アイテムを採掘して搬出します。 block.pneumatic-drill.description = 速く採掘できるように改善されたドリルです。また、より硬い鉱石も採掘することができます。 -block.laser-drill.description = 電力を使用して、レーザー技術でより速く採掘することができます。また、このドリルで放射性トリウムを回収することができます。 +block.laser-drill.description = 電力を使用して、レーザー技術でより速く採掘することができます。また、放射性のトリウムを回収することができます。 block.blast-drill.description = 高級ドリルです。大量の電力が必要です。 block.water-extractor.description = 地面から水を汲み上げます。近くに湖がない場合に便利です。 block.cultivator.description = 水で土壌を耕して、バイオメターを回収します。 @@ -748,7 +755,7 @@ block.tau-mech-pad.description = 今使っている機体から仲間の建物 block.delta-mech-pad.description = 今使っている機体から速く突撃攻撃に向いた軽装備の戦闘機に乗り換えます。\nパッドに乗って、パッドをダブルタップすることで使用できます。 block.omega-mech-pad.description = 今使っている機体から最前線での戦いに向けた重装備の大型機体に乗り換えます。\nパッドに乗って、パッドをダブルタップすることで使用できます。 block.spirit-factory.description = 鉱石の採掘やブロックの修復を行う軽いドローンを製造します。 -block.phantom-factory.description = スピリットドローンより効率的な強化されたドローンユニットを製造します。 +block.phantom-factory.description = スピリットドローンより効率的な上位ドローンユニットを製造します。 block.wraith-factory.description = 素速く、突撃攻撃が得意な戦闘ユニットを製造します。 block.ghoul-factory.description = 重爆撃機を製造します。 block.dagger-factory.description = 一般的な地上ユニットを製造します。 @@ -756,27 +763,27 @@ block.titan-factory.description = 強化され武装した地上ユニットを block.fortress-factory.description = 地上砲撃ユニットを製造します。 block.revenant-factory.description = 航空レーザーユニットを製造します。 block.repair-point.description = 近くの負傷したユニットを修復します。 -block.command-center.description = 仲間のAIの動作を変更できるようにします。現在は攻撃、撤退、警戒に対応しています。 +block.command-center.description = 味方のAIの動作を変更できるようにします。現在は攻撃、撤退、巡回に対応しています。 block.conduit.description = 一般的な液体輸送ブロックです。液体版のコンベアーです。ポンプや他のパイプに使うことができます。 -block.pulse-conduit.description = 強化された液体輸送ブロックです。通常のパイプより速く多くのアイテムを輸送することができます。 -block.phase-conduit.description = 強化された液体転送ブロックです。電力を使用して、液体を他の離れたフューズコンベアーに転送することができます。 +block.pulse-conduit.description = 改良された液体輸送ブロックです。通常のパイプより速く、たくさんのアイテムを輸送することができます。 +block.phase-conduit.description = 改良された液体転送ブロックです。電力を使用して、液体を他の離れたフューズコンベアーに転送することができます。 block.liquid-router.description = 一つの方向から受け取った液体を他の3方向に搬出します。一定の量の液体を貯めておくこともできます。一つの資源から複数に分ける際に便利です。 -block.liquid-tank.description = たくさんの量の水を保管できます。需要が安定しない素材の製造時や重要な施設の冷却水の予備として使えます。 -block.liquid-junction.description = 交差している2つのコンベアーをブリッジします。2つの異なるパイプが異なる場所に異なる材料を運んでいるときに便利です。 -block.bridge-conduit.description = 高度な液体輸送ブロックです。地形や建物を超えて、3ブロック離れた場所に輸送することができます。 -block.mechanical-pump.description = 安価で性能の低いポンプです。電力が必要ありません。 -block.rotary-pump.description = 強化されたポンプです。電力を使用して2倍速く搬出します。 +block.liquid-tank.description = たくさんの量の水を貯めておくことができます。需要が不安定な製造設備や重要な施設の冷却水の予備として使えます。 +block.liquid-junction.description = 十字に交差したパイプをそれぞれ前方に搬出します。パイプで複雑な構造を組み立てるときに便利です。 +block.bridge-conduit.description = 高度な液体輸送ブロックです。地形や建物を超えて、3ブロック離れた場所に液体を輸送することができます。 +block.mechanical-pump.description = 安価なポンプです。性能はよくありませんが、電力なしで使うことができます。 +block.rotary-pump.description = 改良されたポンプです。電力を使用して2倍速く搬出することができます。 block.thermal-pump.description = 高級ポンプです。機械ポンプより3倍速く、唯一溶岩を採取できるポンプです。 block.router.description = 一つの方向から受け取ったアイテムを他の3方向に搬出します。一つの資源から複数に分ける際に便利です。 block.distributor.description = 高度なルーターです。アイテムを7方向に均等に分けて搬出します。 -block.bridge-conveyor.description = 高度な輸送ブロックです。地形や建物を超えて、3ブロック離れた場所に輸送することができます。 -block.alpha-mech-pad.description = 電力を使用して、機体を[accent]アルファ[]機体に作り直します。 +block.bridge-conveyor.description = 高度な輸送ブロックです。地形や建物を超えて、3ブロック離れた場所にアイテムを輸送することができます。 +block.alpha-mech-pad.description = 電力を使用して、機体を[accent]アルファ[]機体に作り替えます。 block.itemsource.description = アイテムを無限に搬出します。サンドボックスのみ。 block.liquidsource.description = 液体を無限に搬出します。サンドボックスのみ。 block.itemvoid.description = 電力なしでアイテムを廃棄します。サンドボックスのみ。 block.powerinfinite.description = 無限に電力を搬出します。サンドボックスのみ。 block.powervoid.description = 入力されたすべての電力を破棄します。サンドボックスのみ。 -liquid.water.description = 機械の冷却や廃棄物の処理に一般的に使用されます。 +liquid.water.description = 一般的に機械の冷却や廃棄物の処理などに使用されます。 liquid.lava.description = 冷却して石にしたり、発電や一部ターレットの弾薬として使用することができます。 -liquid.oil.description = 燃焼させたり、爆発させたり、冷却水しても使えます。 +liquid.oil.description = 燃焼させたり、爆発させたり、冷却水としても使われます。 liquid.cryofluid.description = 冷却させるのに最も効率的な液体です。 diff --git a/core/assets/bundles/bundle_ko.properties b/core/assets/bundles/bundle_ko.properties index e72a97601e..00d11c78d8 100644 --- a/core/assets/bundles/bundle_ko.properties +++ b/core/assets/bundles/bundle_ko.properties @@ -11,7 +11,7 @@ text.link.wiki.description = 공식 Mindustry 위키 (영어) text.linkfail = 링크를 여는데 실패했습니다! URL이 기기의 클립보드에 복사되었습니다. text.gameover = 코어가 터졌습니다. 게임 오버! text.gameover.pvp = [accent]{0}[] 팀이 승리했습니다! -text.sector.gameover = 이 지역을 공략하는데 실패했습니다. 포기 하시겠습니까? +text.sector.gameover = 이 지역을 공략하는데 실패했습니다. 다시 시도하시겠습니까? text.sector.retry = 아니오 text.highscore = [YELLOW]최고점수 달성! text.wave.lasted = [accent]{0}[] 까지 버티셨습니다. @@ -84,11 +84,12 @@ text.server.kicked.sectorComplete.text = 임무 성공.\n서버가 다음지역 text.server.kicked.clientOutdated = 오래된 버전의 클라이언트 입니다! 게임을 업데이트 하세요! text.server.kicked.serverOutdated = 오래된 버전의 서버입니다! 서버 호스트 관리자에게 문의하세요! text.server.kicked.banned = 뭘 하셨는지는 모르겠지만, 이제 영원히 서버에 접속할 수 없습니다. -text.server.kicked.recentKick = 방금 추방처리 되었습니다. 잠시 기다린 후에 접속 해 주세요. +text.server.kicked.recentKick = 방금 추방처리 되었습니다.\n잠시 기다린 후에 접속 해 주세요.\n참고 : [accent]계속해서 접속을 시도하면 강퇴 시간이 길어집니다. text.server.kicked.nameInUse = 이 닉네임이 이미 서버에서 사용중입니다. text.server.kicked.nameEmpty = 닉네임에는 반드시 영어 또는 숫자가 있어야 합니다. text.server.kicked.idInUse = 이미 서버에 접속중입니다! 다중 계정은 허용되지 않습니다. text.server.kicked.customClient = 이 서버는 직접 빌드한 버전을 지원하지 않습니다. 공식 버전을 사용하세요. +text.server.kicked.gameover = 게임 오버로 인해 서버에서 추방되었습니다. text.host.info = [accent]호스트[] 버튼은 현재 네트워크의 [scarlet]6567[] 포트를 사용합니다.\n[LIGHY_GRAY]같은 Wi-Fi 또는 로컬 네트워크[] 에서 서버 목록을 볼 수 있습니다.\n\n만약 플레이어들이 이 IP를 통해 어디에서나 연결할 수 있게 하고 싶다면, 공유기 설정에서 [accent]포트 포워딩[]을 해야 합니다.\n\n[LIGHT_GRAY]참고 : LAN 게임 연결에 문제가 있는 사람이 있다면, 방화벽 설정에서 Mindustry 가 로컬 네트워크에 액세스하도록 허용했는지 확인 해 주세요. text.join.info = 여기서 [accent]서버 IP[]를 입력하여 다른 서버에 접속할 수 있습니다.\n또는 [accent]로컬 네트워크(LAN)[] 서버를 검색하여 접속할 수 있습니다.\nLAN 및 WAN 멀티 플레이어 모두 지원됩니다.\n\n[LIGHT_GRAY]참고:여기에서는 자동으로 글로벌 서버를 추가하지 않습니다. IP로 다른 사람의 서버에 접속할려면 서버장에게 IP를 요청해야 합니다. text.hostserver = 서버 열기 @@ -345,7 +346,7 @@ text.category.liquids = 액체 text.category.items = 아이템 text.category.crafting = 제작 text.category.shooting = 사격 -text.category.optional = 선택적 향상 +text.category.optional = 선택적 가속 setting.autotarget.name = 자동 조준 setting.fpscap.name = 최대 FPS setting.fpscap.none = 없음 @@ -378,6 +379,8 @@ category.multiplayer.name = 멀티플레이 command.attack = 공격 command.retreat = 후퇴 command.patrol = 순찰 +keybind.gridMode.name = 블록 선택 +keybind.gridModeShift.name = 카테고리 선택 keybind.press = 키를 누르세요... keybind.press.axis = 축 또는 키를 누르세요... keybind.move_x.name = 오른쪽/왼쪽 이동 @@ -418,7 +421,7 @@ content.mech.name = 기체 item.stone.name = 돌 item.stone.description = 주로 용암을 사용하여 얻을 수 있는 자원입니다. item.copper.name = 구리 -item.copper.description = 모든 유형의 블록에서 광범위하게 사용되는 자원입니다. +item.copper.description = 모든 종류의 블록에서 광범위하게 사용되는 자원입니다. item.lead.name = 납 item.lead.description = 쉽게 구할 수 있으며, 전자 및 액체 수송 블록에서 광범위하게 사용되는 자원입니다. item.coal.name = 석탄 @@ -430,17 +433,17 @@ item.titanium.description = 파이프 재료나 고급 드릴, 비행기/기체 item.thorium.name = 토륨 item.thorium.description = 건물의 재료, 포탑의 탄약 또는 핵연료로 사용되는 방사성 금속입니다. item.silicon.name = 실리콘 -item.silicon.description = 매우 유용한 반도체로, 태양 전지판과 복잡한 전자 제품에 사용할 수 있습니다. +item.silicon.description = 매우 유용한 반도체로, 기체를 만들거나 태양 전지판 등 전자 건물에 사용할 수 있습니다. item.plastanium.name = 플라스터늄 item.plastanium.description = 고급 항공기 및 분열 탄약에 사용되는 가벼운 연성 재료. item.phase-fabric.name = 메타 item.phase-fabric.description = 최첨단 전자 제품과 자기수리 기술에 사용되는 거의 무중력에 가까운 물질입니다. item.surge-alloy.name = 설금 -item.surge-alloy.description = 주로 건물의 재료로 사용되는 자원입니다 +item.surge-alloy.description = 독특한 전기 특성을 가진 고급 합금입니다. item.biomatter.name = 바이오메터 item.biomatter.description = 이것은 유기농 덤불입니다!\n압축기에 넣어 석유로 바꿀 수 있습니다. item.sand.name = 모래 -item.sand.description = 고밀도 합금이나 플럭스 등에서 제련시 광범위하게 사용되는 일반적인 재료입니다. +item.sand.description = 고밀도 합금 제작이나 제련시 이 광물을 사용하여 소모 재료를 줄이는 등 광범위하게 사용되는 일반적인 재료입니다. item.blast-compound.name = 폭발물 item.blast-compound.description = 포탑 및 건설의 재료로 사용되는 휘발성 폭발물.\n연료로도 사용할 수 있지만, 별로 추천하지는 않습니다. item.pyratite.name = 피라테 @@ -464,24 +467,24 @@ mech.tau-mech.description = 지원형 기체.\n총을 발사하여 건물을 치 mech.omega-mech.name = 오메가 mech.omega-mech.weapon = 전방 유도미사일 mech.omega-mech.ability = 방어모드 -mech.omega-mech.description = 지상 기체 최종판이자 건물 파괴용으로 적합한 부피가 크고 튼튼한 기체. 방어 모드는 최대 90% 의 피해를 줄일 수 있습니다. +mech.omega-mech.description = 지상 기체 최종판이자 건물 파괴용으로 적합한 부피가 크고 튼튼한 기체.\n방어 모드는 최대 90% 의 피해를 줄일 수 있습니다. mech.dart-ship.name = 다트 mech.dart-ship.weapon = 소총 -mech.dart-ship.description = 표준 비행선. 빠르고 가볍지만 공격력이 거의 없고 채광 속도가 느립니다. +mech.dart-ship.description = 표준 비행선.\n빠르고 가볍지만 공격력이 거의 없고 채광 속도가 느립니다. mech.javelin-ship.name = 자비린 -mech.javelin-ship.description = 치고 빠지는 공격을 위한 비행선. 처음에는 느리지만, 가속도가 붙어 엄청난 속도로 미사일 피해를 입힐 수 있으며, 전격 능력을 사용할 수 있습니다. +mech.javelin-ship.description = 치고 빠지는 공격을 위한 비행선.\n처음에는 느리지만, 가속도가 붙어 엄청난 속도로 미사일 피해를 입힐 수 있으며, 전격 능력을 사용할 수 있습니다. mech.javelin-ship.weapon = 유도 미사일 mech.javelin-ship.ability = 가속 전격 생성기 mech.trident-ship.name = 삼지창 -mech.trident-ship.description = 대형 공중 폭격기. 당연하게도 엄청 단단합니다. +mech.trident-ship.description = 대형 공중 폭격기.\n당연하게도 엄청 단단합니다. mech.trident-ship.weapon = 폭탄 저장고 mech.glaive-ship.name = 글레브 -mech.glaive-ship.description = 크고 잘 무장된 총을 가진 비행선. 방화용 리피터가 장착되어 있으며, 가속도와 최대속도가 높습니다. +mech.glaive-ship.description = 크고 잘 무장된 총을 가진 비행선.\n방화용 리피터가 장착되어 있으며, 가속도와 최대속도가 높습니다. mech.glaive-ship.weapon = 방화총 -text.item.explosiveness = [LIGHT_GRAY]폭발력 : {0} +text.item.explosiveness = [LIGHT_GRAY]폭발성 : {0} text.item.flammability = [LIGHT_GRAY]인화성 : {0} text.item.radioactivity = [LIGHT_GRAY]방사능 : {0} -text.item.fluxiness = [LIGHT_GRAY]플럭스 파워 : {0} +text.item.fluxiness = [LIGHT_GRAY]유동성 : {0} text.unit.health = [LIGHT_GRAY]체력 : {0} text.unit.speed = [LIGHT_GRAY]속도 : {0} text.mech.weapon = [LIGHT_GRAY]무기 : {0} @@ -605,7 +608,7 @@ block.bridge-conduit.name = 다리 파이프 block.rotary-pump.name = 동력 펌프 block.thorium-reactor.name = 토륨 원자로 block.command-center.name = 명령 본부 -block.mass-driver.name = 물질 이동기 +block.mass-driver.name = 자원 발사기 block.blast-drill.name = 고속 발열 드릴 block.thermal-pump.name = 화력 펌프 block.thermal-generator.name = 열발전기 @@ -618,7 +621,7 @@ block.fuse.name = 퓨즈 block.shock-mine.name = 전격 지뢰 block.overdrive-projector.name = 오버드라이브 프로젝터 block.force-projector.name = 보호막 프로젝터 -block.arc.name = Arc +block.arc.name = 아크 block.rtg-generator.name = 토륨 발전소 block.spectre.name = 스펙터 block.meltdown.name = 멜트다운 @@ -631,21 +634,21 @@ team.green.name = 그린팀 team.purple.name = 보라색팀 unit.alpha-drone.name = 알파 드론 unit.spirit.name = 스피릿 드론 -unit.spirit.description = 기본 드론 유닛. 기본적으로 코어에서 1개가 스폰됩니다. 자동으로 채광하며 아이템을 수집하고, 블록을 수리합니다. +unit.spirit.description = 기본 드론 유닛. 기본적으로 코어에서 1개가 스폰됩니다.\n자동으로 채광하며 아이템을 수집하고, 블록을 수리합니다. unit.phantom.name = 팬텀 드론 -unit.phantom.description = 첨단 드론 유닛. 광석을 자동으로 채광하며, 아이템을 수집하고 블록을 수리합니다. 일반 드론보다 훨씬 효과적입니다. +unit.phantom.description = 첨단 드론 유닛.\n광석을 자동으로 채광하며, 아이템을 수집하고 블록을 수리합니다. 일반 드론보다 훨씬 효과적입니다. unit.dagger.name = 디거 -unit.dagger.description = 기본 지상 유닛입니다. 스웜과 같이 쓰면 유용합니다. +unit.dagger.description = 기본 지상 유닛입니다.\n플레이어 기체처럼 드론을 소환하지는 않습니다. unit.titan.name = 타이탄 -unit.titan.description = 고급 지상 유닛입니다. 고밀도 합금을 탄약으로 사용하며 지상과 공중 둘다 공격할 수 있습니다. +unit.titan.description = 고급 지상 유닛입니다.\n원거리 총 대신에 근접 화염 방사기를 가지고 있으며, 지상과 공중 둘다 공격할 수 있습니다. unit.ghoul.name = 구울 폭격기 -unit.ghoul.description = 무거운 지상 폭격기 입니다. 폭발물 또는 피라테를 탄약으로 사용합니다. +unit.ghoul.description = 무겁고 튼튼한 지상 폭격기 입니다.\n주로 적 건물로 이동하여 엄청난 폭격을 가합니다. unit.wraith.name = 유령 전투기 -unit.wraith.description = 코어를 집중적으로 공격하는 방식을 사용하는 전투기 입니다. +unit.wraith.description = 적 핵심 건물 및 유닛을 집중적으로 공격하는 방식을 사용하는 전투기 입니다. unit.fortress.name = 포트리스 -unit.fortress.description = 중포 지상 유닛. 높은 공격력과 체력을 가지고 있습니다. +unit.fortress.description = 중포 지상 유닛.\n높은 공격력을 가진 총과 높은 체력을 가지고 있습니다. unit.revenant.name = 레비던트 -unit.revenant.description = 대형 레이저를 발사하는 공중 유닛입니다. +unit.revenant.description = 튼튼하고 강력한 대형 레이저를 발사하는 공중 유닛입니다. tutorial.begin = 플레이어의 주요 목표는 [LIGHT_GRAY]적군[]을 제거하는 것입니다.\n\n이 게임은 [accent]구리를 채광[]하는 것으로 시작합니다.\n이것을 하기 위해 플레이어의 중심부 근처에 있는 구리 광맥을 누르세요. tutorial.drill = 수동으로 채광하는 것은 효율이 낮습니다.\n[accent]드릴[]은 자동으로 채광 작업을 합니다.\n구리 광맥에 표시된 영역에 드릴을 하나를 놓으세요. tutorial.conveyor = [accent]컨베이어[]를 사용하여 아이템을 코어로 운반합니다.\n드릴에서 코어까지 컨베이어 라인을 만드세요. @@ -667,38 +670,38 @@ tutorial.daggerfactory = 이[accent] 디거 기체 공장[]은\n\n공격하는 tutorial.router = 공장을 작동시키기 위해 자원이 필요합니다.\n컨베이어에 운반되고 있는 자원을 분할할 분배기를 만드세요. tutorial.dagger = 전력 노드를 공장에 연결하세요.\n일단 요구 사항이 충족되면 기체 생산을 시작합니다.\n\n필요에 따라 드릴 및 발전기, 컨베이어를 더 많이 만들 수 있습니다. tutorial.battle = [LIGHT_GRAY]적[]의 코어가 드러났습니다.\n당신의 부대와 디거를 사용하여 파괴하세요. -block.core.description = 게임에서 가장 중요한 건물.\n파괴되면 게임이 끝납니다. -block.copper-wall.description = 구리로 만든 벽. -block.copper-wall-large.description = 구리로 만든 큰 벽. -block.dense-alloy-wall.description = 고밀도 합금으로 만든 벽. 구리벽보다 체력이 높습니다. -block.dense-alloy-wall-large.description = 고밀도 합금으로 만든 큰 벽. -block.thorium-wall.description = 토륨으로 만든 벽. -block.thorium-wall-large.description = 토륨으로 만든 큰 벽. -block.phase-wall.description = 날라오는 모든 총알을 튕겨내고 데미지를 입는 특수한 벽입니다. -block.phase-wall-large.description = 메타로 제작한 큰 벽. 날라오는 총알을 모두 튕겨냅니다. +block.core.description = 게임에서 가장 중요한 건물.\n코어가 1개밖에 없을때 파괴되면 게임에서 패배합니다. +block.copper-wall.description = 구리로 만든 방어벽.\n가장 약한 방어벽입니다. +block.copper-wall-large.description = 구리로 만든 큰 방어벽.\n일반 구리벽의 4개를 합쳐놓은 벽이며, 가장 약한 방어벽입니다. +block.dense-alloy-wall.description = 고밀도 합금으로 만든 방어벽.\n구리벽보다 체력이 높습니다. +block.dense-alloy-wall-large.description = 고밀도 합금으로 만든 큰 방어벽.\n일반 고밀도 합금 벽을 4개 합쳐놓은 벽이며, 내구성이 좋습니다. +block.thorium-wall.description = 토륨으로 만든 방어벽.\n아무 기능이 없는 튼튼한 방어벽입니다. +block.thorium-wall-large.description = 토륨으로 만든 큰 방어벽.\n토륨벽을 4개 합쳐놓은 벽이며, 내구성이 뛰어납니다. +block.phase-wall.description = 메타로 제작하는 방어벽.날라오는 모든 총알을 튕겨내고 데미지를 입는 특수한 벽입니다. +block.phase-wall-large.description = 메타로 제작한 큰 방어벽.\n날라오는 총알을 모두 튕겨냅니다. block.surge-wall.description = 데미지를 입으면 번개를 일으켜 대상에게 피해를 입히는 특수한 벽입니다. -block.surge-wall-large.description = 설금을 재료로 한 큰 벽.\n데미지를 입으면 번개를 일으켜 대상에게 피해를 입힙니다. -block.door.description = 유닛이 지나갈 수 있도록 만든 문. 클릭하면 열고 닫습니다. -block.door-large.description = 유닛이 자나갈 수 있도록 만든 큰 문. 클릭하면 열고 닫습니다. -block.mend-projector.description = 주위 건물을 치료하는 건물입니다. -block.overdrive-projector.description = 범위 내 모든 행동의 속도를 높여주는 보조형 건물입니다. +block.surge-wall-large.description = 설금을 재료로 한 큰 방어벽.\n데미지를 입으면 번개를 일으켜 대상에게 피해를 입힙니다. +block.door.description = 유닛이 지나갈 수 있도록 만든 문.\n클릭하면 열고 닫습니다. +block.door-large.description = 유닛이 자나갈 수 있도록 만든 큰 문.\n클릭하면 열고 닫습니다. +block.mend-projector.description = 주위 건물을 넓은 범위로 치료하는 건물입니다. +block.overdrive-projector.description = 범위 내 모든 행동의 속도를 2배 높여주는 보조형 건물입니다. block.force-projector.description = 보호막을 생성하는 건물.\n기본적으로 전력만 있으면 작동하지만, 메타를 넣어 보호막의 범위를 크게 확장시킬 수 있습니다. block.shock-mine.description = 적이 이 블록을 지나가면 전격 공격을 하는 함정형 방어 건물입니다. -block.duo.description = 범용성을 가진 터렛.\n지상 및 공중공격을 하며, 초중반에 유용합니다. +block.duo.description = 범용성을 가진 터렛.\n지상 및 공중공격을 하며, 초반에 유용합니다. block.arc.description = 목표 방향으로 전격 공격을 하는 포탑입니다. -block.hail.description = 장거리 지상 공격을 하는 터렛입니다.\n적이 오기 전에 쓸어버릴 수 있습니다. +block.hail.description = 장거리 지상 공격을 하는 터렛입니다.\n적이 공격하기 전에 쓸어버릴 수 있습니다. block.lancer.description = 중거리 레이져 포탑입니다.\n적을 관통하기 때문에 뭉쳐있는 적들에게 매우 효과적입니다. -block.wave.description = 적이 있는 자리에 액체를 뿌립니다.\n이 포탑을 활용하여 액체를 뿌린 곳에 불을 붙이거나 적을 느리게 할 수 있습니다. +block.wave.description = 적이 있는 자리에 액체를 뿌립니다.\n이 포탑을 활용하여 액체를 뿌린 곳에 불을 붙이거나 적을 느리게 할 수 있습니다. block.salvo.description = 명중률이 높고, 3발씩 끊어 발사하는 포탑입니다. block.swarmer.description = 4발씩 끊어서 유도체를 발사하는 포탑입니다 block.ripple.description = 4개의 탄약으로 나눠 발사하여 명중률이 낮지만, 사거리가 매우 긴 포탑입니다. -block.cyclone.description = 낮은 명중률과 높은 RPM 을 가진 포탑입니다.\n탄약이 남아있는 한 멈추지 않고 계속 연사합니다. +block.cyclone.description = 낮은 명중률과 높은 RPM 을 가진 포탑입니다.\n사격하는데 쿨타임이 거의 없습니다. block.fuse.description = 단거리에서 범위형 레이저를 발사하는 포탑입니다. block.spectre.description = 높은 명중률과 RPM 을 가진 포탑입니다.\n탄약이 남아있는 한 멈추지 않고 계속 연사합니다. -block.meltdown.description = 목표를 따라 초대형 레이져를 발사하는 포탑입니다.\n뭉쳐있는 몹에게 매우 효과가 좋습니다. +block.meltdown.description = 목표를 따라 초대형 레이져를 발사하는 포탑입니다.\n조준 시간이 길어 공중에는 적합하지 않지만 뭉쳐있는 몹에게 매우 효과가 좋습니다. block.conveyor.description = 느린 속도로 자원을 수송할 수 있는 컨베이어. block.titanium-conveyor.description = 빠른 속도로 자원을 수송할 수 있는 컨베이어. -block.phase-conveyor.description = 자원을 순간이동 시켜 주는 컨베이어 입니다. +block.phase-conveyor.description = 자원을 지정된 방향으로 바로 이동시켜 주는 컨베이어 입니다. block.junction.description = 컨베이어를 교차시켜 자원을 수송할 때 사용할 수 있는 블록입니다. block.mass-driver.description = 자원을 받아서 다른 물질 이동기로 전달할 수 있는 블록입니다.\n엄청난 사거리를 가지고 있으며, 주로 컨베이어가 접근할 수 없는 곳에 유용하게 사용됩니다. block.smelter.description = 고밀도 합금을 제작할 수 있는 건물입니다. @@ -714,8 +717,8 @@ block.cryofluidmixer.description = 냉각수를 제작할 수 있는 건물입 block.solidifer.description = 용암을 돌로 만들 수 있는 건물입니다. block.melter.description = 돌로 용암을 만들 수 있는 건물입니다. block.incinerator.description = 불필요한 아이템을 소각시켜 줄 수 있는 건물입니다. -block.biomattercompressor.description = 잔디밭에서 바이오메터를 추출할 수 있는 건물입니다. -block.separator.description = 돌을 분해하여 각종 자원으로 재활용 할 수 있게 해 주는 건물입니다. +block.biomattercompressor.description = 잔디밭에서 바이오메터를 추출할 수 있는 건물입니다. +block.separator.description = 돌을 분해하여 각종 자원으로 재활용 할 수 있게 해 주는 건물입니다. block.centrifuge.description = 돌을 분해하여 각종 자원으로 재활용 할 수 있게 해 주는 건물이지만, 이 건물은 좀 더 다양한 자원을 얻을 수 있게 해 줍니다. block.power-node.description = 생성된 전력를 다른 건물로 전달하기 위한 전력 노드입니다. block.power-node-large.description = 생성된 전력를 다른 건물로 전달하기 위한 건물이며, 일반 노드보다 더 많은 전력을 이동시킬 수 있습니다. @@ -729,33 +732,33 @@ block.solar-panel-large.description = 태양열을 받아 자기 스스로 전 block.thorium-reactor.description = 토륨을 원료로 하는 토륨 원자로 입니다.\n많은 전력을 생산하지만 엄청난 열을 발생시키기 때문에, 많은 량의 물 또는 냉각수가 있어야 터지지 않고 작동합니다. block.rtg-generator.description = 냉각은 필요 없지만 토륨 원자로보다 적은량의 전력을 생산하는 방사선 동위원소 열전자 발전기. block.unloader.description = 해당 창고 및 코어에서 자원을 빼내는데 사용됩니다. -block.container.description = 아이템을 임시로 저장할 수 있는 소형 창고입니다. -block.vault.description = 아이템을 임시로 저장할 수 있는 대형 창고입니다. +block.container.description = 아이템을 저장할 수 있는 소형 창고입니다. +block.vault.description = 아이템을 저장할 수 있는 대형 창고입니다. block.mechanical-drill.description = 구리로 제작할 수 있는 기본 드릴입니다. block.pneumatic-drill.description = 돌, 티타늄을 채광할 수 있는 고급 드릴입니다. block.laser-drill.description = 토륨을 채광할 수 있는 최고급 드릴입니다.\n전력과 물을 공급하여 빠른 속도로 채광할 수 있습니다. -block.blast-drill.description = 최상위 드릴입니다. 엄청난 양의 전력과 물을 소모하는 대신, 매우 빠른 속도로 채광합니다. +block.blast-drill.description = 최상위 드릴입니다.\n엄청난 양의 전력과 물을 소모하는 대신, 매우 빠른 속도로 채광합니다. block.water-extractor.description = 바닥에서 물을 추출하여 건물에 공급할 수 있는 건물입니다. block.cultivator.description = 잔디에서 바이오메터를 추출할 수 있는 건물입니다. block.oil-extractor.description = 석유를 추출 해 주는 건물입니다. -block.dart-ship-pad.description = 다트 비행선으로 바꿀 수 있는 패드입니다. -block.trident-ship-pad.description = 삼지창 비행선으로 바꿀 수 있는 패드입니다. -block.javelin-ship-pad.description = 자비린 비행선으로 바꿀 수 있는 패드입니다. -block.glaive-ship-pad.description = 글레브 비행선으로 바꿀 수 있는 패드입니다. -block.tau-mech-pad.description = 타우 기체로 바꿀 수 있는 패드 -block.delta-mech-pad.description = 델타 기체로 바꿀 수 있는 패드입니다. -block.omega-mech-pad.description = 오메가 기체로 바꿀 수 있는 패드 -block.spirit-factory.description = 스피릿 유닛을 생산하는 공장입니다. -block.phantom-factory.description = 유닛 팬텀을 생산하는 공장입니다. -block.wraith-factory.description = 유닛 유령 전투기를 소환하는 공장입니다. -block.ghoul-factory.description = 구울 유닛을 생산하는 공장입니다. -block.dagger-factory.description = 디거를 생산하는 공장입니다. -block.titan-factory.description = 타이탄 유닛을 생산할 수 있는 공장입니다. -block.fortress-factory.description = 포트리스를 생산하는 공장입니다. -block.revenant-factory.description = 레비던트 유닛을 생산할 수 있는 공장입니다. -block.repair-point.description = 근처 유닛들을 수리하는 건물입니다. +block.dart-ship-pad.description = 다트 비행선으로 바꿀 수 있는 패드입니다.\n\n누르거나 클릭하여 이 기체로 바꿉니다. +block.trident-ship-pad.description = 대형 폭격기 역할을 하는 삼지창 비행선으로 바꿀 수 있는 패드입니다.\n\n누르거나 클릭하여 이 기체로 바꿉니다. +block.javelin-ship-pad.description = 처음에는 느리지만 가속도가 붙어 다른 비행선보다 5배 이상 빠르게 움직일 수 있으며, 적에게 부딛쳐서 공격할 수 있는 자비린 패드입니다.\n\n누르거나 클릭하여 이 기체로 바꿉니다. +block.glaive-ship-pad.description = 글레브 비행선으로 바꿀 수 있는 패드입니다.\n\n누르거나 클릭하여 이 기체로 바꿉니다. +block.tau-mech-pad.description = 주위 건물이나 기체를 치료하는 타우 기체로 바꿀 수 있는 패드입니다.\n\n누르거나 클릭하여 이 기체로 바꿉니다. +block.delta-mech-pad.description = 전방에 전격 공격을 하는 델타 기체로 바꿀 수 있는 패드입니다.\n\n누르거나 클릭하여 이 기체로 바꿉니다. +block.omega-mech-pad.description = 건물 파괴용 기체의 끝판왕이며, 공격시 방어모드로 전환되어 최대 90% 피해를 줄일 수 있는 오메가 기체로 바꿀 수 있는 패드입니다.\n\n누르거나 클릭하여 이 기체로 바꿉니다. +block.spirit-factory.description = 코어에 기본적으로 스폰되는 드론인 스피릿 유닛을 생산하는 공장입니다. +block.phantom-factory.description = 일반 드론보다 좀 더 효율적이며 빠른 새 드론인 팬텀을 생산하는 공장입니다. +block.wraith-factory.description = 지상 및 공중을 공격할 수 있으며, 공격후 빠지고 다시 공격하는 방식을 사용하는 유령 전투기를 소환하는 공장입니다. +block.ghoul-factory.description = 지상만 공격할 수 있으며, 건물을 집중 폭격하는데 목적이 있는 구울 비행선 유닛을 생산하는 공장입니다. +block.dagger-factory.description = 지상 및 공중을 공격할 수 있으며, 플레이어 기본 기체인 디거를 생산하는 공장입니다. +block.titan-factory.description = 지상 및 공중을 공격할 수 있으며, 총알 대신 근접 화염 방사기를 가진 타이탄 유닛을 생산할 수 있는 공장입니다. +block.fortress-factory.description = 지상 유닛의 최종판이며, 강력한 총을 가진 포트리스를 생산하는 공장입니다. +block.revenant-factory.description = 공중 유닛의 최종판이며, 강력한 레이저 총을 가진 레비던트 유닛을 생산할 수 있는 공장입니다. +block.repair-point.description = 근처 유닛들을 수리하는 건물입니다.\n커맨드 센터에서 후퇴 명령시 공중 유닛이 이 건물로 이동하여 수리를 받습니다. block.command-center.description = 생산된 유닛들을 제어할 수 있는 건물.\n첫번째 버튼은 적 기지로 공격하며, 두번째는 대기 상태, 세번째는 기지 근처를 돌며 정찰합니다. -block.conduit.description = 일반 파이프. 액체가 지나갈 수 있도록 해 줍니다. +block.conduit.description = 일반 파이프.\n액체가 지나갈 수 있도록 해 줍니다. block.pulse-conduit.description = 티타늄으로 만들어 졌으며, 일반 파이프보다 액체 수용량이 높습니다. block.phase-conduit.description = 물을 먼거리로 순간이동 시켜 주는 장치입니다. block.liquid-router.description = 물펌프를 다른 방향으로 분배할 수 있게 하는 블럭입니다. @@ -767,7 +770,7 @@ block.rotary-pump.description = 일반 물 펌프보다 더 빠른 속도로 물 block.thermal-pump.description = 기계식 펌프보다 3배 빠른 속도로 액체를 퍼올릴 수 있는 펌프이며, 용암도 퍼올릴 수 있는 유일한 펌프입니다. block.router.description = 한 방향에서 아이템을 받은 후 최대 3개의 다른 방향으로 동일하게 출력합니다.\n재료를 한곳에서 여러 대상으로 분할하여 운반하는데 유용합니다. block.distributor.description = 아이템을 최대 7개의 다른 방향으로 똑같이 분할하는 고급 분배기. -block.bridge-conveyor.description = 고급 자원 수송 블록.\n지형이나 건물을 넘어 최대 3개 타일을 건너뛰고 자원을 운송할 수 있습니다. +block.bridge-conveyor.description = 고급 자원 수송 블록.\n지형이나 건물을 넘어 최대 3개 타일을 건너뛰고 자원을 운송할 수 있습니다. block.alpha-mech-pad.description = 알파 기체로 바꿀 수 있는 패드입니다. block.itemsource.description = 자원을 선택하면 그 자원이 무한하게 생성되는 블록입니다. block.liquidsource.description = 무한한 액체를 출력해냅니다. @@ -778,3 +781,5 @@ liquid.water.description = 지상 유닛이 이 위를 지나가면 이동속도 liquid.lava.description = 지상 유닛이 이 위를 지나가면 이동속도가 매우 느려지고, 지속적으로 데미지를 입습니다. liquid.oil.description = 일부 조합 블록에서 사용되는 자원입니다. liquid.cryofluid.description = 포탑 및 토륨 원자로에서 사용되는 자원입니다. + +setting.indicators.name = 인디게이터 표시 diff --git a/core/assets/bundles/bundle_pl.properties b/core/assets/bundles/bundle_pl.properties index 93a78942b5..5c602156e2 100644 --- a/core/assets/bundles/bundle_pl.properties +++ b/core/assets/bundles/bundle_pl.properties @@ -1,6 +1,6 @@ text.credits.text = Created by [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[]\n\n[GRAY](In case you can't tell, this text is currently unfinished.\nTranslators, don't edit it yet!) text.credits = Zasłużeni -text.discord = Odwiedź nasz serwer Discord +text.discord = Odwiedź nasz serwer Discord! text.link.discord.description = Oficjalny serwer Discord Mindustry text.link.github.description = Kod Gry text.link.dev-builds.description = Niestabilne wersje gry @@ -12,9 +12,9 @@ text.linkfail = Nie udało się otworzyć linku!\nURL został skopiowany. text.gameover = Rdzeń został zniszczony. text.gameover.pvp = The[accent] {0}[] team is victorious! text.sector.gameover = This sector has been lost. Re-deploy? -text.sector.retry = Retry +text.sector.retry = Spróbuj ponownie text.highscore = [YELLOW] Nowy rekord! -text.wave.lasted = You lasted until wave [accent]{0}[]. +text.wave.lasted = Wytrwałeś do [accent]{0}[] fali. text.level.highscore = Rekord: [accent]{0} text.level.delete.title = Potwierdź usuwanie text.map.delete = Jesteś pewny, że chcesz usunąć "[accent]{0}[]"? @@ -26,7 +26,7 @@ text.construction = Wybrałeś [accent]tryb tworzenia bloków[].\n\nAby zacząć text.deconstruction.title = Poradnik niszczenia bloków text.deconstruction = Wybrałeś [accent]tryb niszczenia bloków[].\n\nAby zacząć niszczenie, po prostu kliknij na blok obok twojego statku.\nKiedy wybrałeś kilka bloków, kliknij ptaszek i twój statek zacznie niszczyć bloki.\n\n- [accent]Anuluj bloki[] z twojej kolekcji przez klikanie ich(?)\n- [accent]Usuwaj bloki na obszrze[] przez zaznacznie ich.\n- [accent]Anuluj niszcznie [] przez kliknięcie X w lewym dolnym rogu. text.showagain = Nie pokazuj tego więcej -text.coreattack = < Core is under attack! > +text.coreattack = < Rdzeń jest atakowany! > text.unlocks = Lista przedmiotów text.savegame = Zapisz Grę text.loadgame = Wczytaj grę @@ -37,37 +37,37 @@ text.sectors = Sektory text.sector = Wybrany Sektor: [LIGHT_GRAY]{0} text.sector.time = Czas: [LIGHT_GRAY]{0} text.sector.deploy = Wejdź -text.sector.abandon = Abandon -text.sector.abandon.confirm = Are you sure you want to abandon all progress at this sector?\nThis cannot be undone! +text.sector.abandon = Opuść +text.sector.abandon.confirm = Czy jesteś pewien, że chcesz porzucić cały postęp w tym sektorze?\nProces jest nieodwracalny! text.sector.resume = Wznów text.sector.locked = [scarlet][[Niegotowy] text.sector.unexplored = [accent][[Nieodkryty] -text.missions = Missions:[LIGHT_GRAY] {0} -text.mission = Mission:[LIGHT_GRAY] {0} -text.mission.main = Main Mission:[LIGHT_GRAY] {0} -text.mission.info = Mission Info -text.mission.complete = Mission complete! -text.mission.complete.body = Sector {0},{1} has been conquered. -text.mission.wave = Survive[accent] {0}/{1} []waves\nWave in {2} -text.mission.wave.enemies = Survive[accent] {0}/{1} []waves\n{2} Enemies -text.mission.wave.enemy = Survive[accent] {0}/{1} []waves\n{2} Enemy -text.mission.wave.menu = Survive[accent] {0} []waves -text.mission.battle = Destroy the enemy base. -text.mission.resource.menu = Obtain {0} x{1} -text.mission.resource = Obtain {0}:\n[accent]{1}/{2}[] -text.mission.block = Create {0} -text.mission.unit = Create {0} Unit -text.mission.command = Send Command {0} To Units -text.mission.linknode = Link Power Node -text.mission.display = [accent]Mission:\n[LIGHT_GRAY]{0} +text.missions = Misje:[LIGHT_GRAY] {0} +text.mission = Misja:[LIGHT_GRAY] {0} +text.mission.main = Główna misja:[LIGHT_GRAY] {0} +text.mission.info = Informacje o misji +text.mission.complete = Misja zakończona sukcesem! +text.mission.complete.body = Sektor {0},{1} został podbity. +text.mission.wave = Przetrwaj[accent] {0}/{1} []fal\nNastępna fala w {2} +text.mission.wave.enemies = Przetrwaj[accent] {0}/{1} []fal\nPozostało {2} przeciwników +text.mission.wave.enemy = Przetrwaj[accent] {0}/{1} []fal\nPozostał{2} przeciwnik +text.mission.wave.menu = Przetrwaj[accent] {0} []fal +text.mission.battle = Zniszcz bazę przeciwnika +text.mission.resource.menu = Wydobądź {0} x{1} +text.mission.resource = Wydobądź {0}:\n[accent]{1}/{2}[] +text.mission.block = Stwórz {0} +text.mission.unit = Utwórz {0} jednostkę +text.mission.command = Wyślij komendę {0} do Jednostek +text.mission.linknode = Połącz Węzeł prądu +text.mission.display = [accent]Misja:\n[LIGHT_GRAY]{0} text.mission.mech = Switch to mech[accent] {0}[] -text.mission.create = Create[accent] {0}[] +text.mission.create = Utwórz[accent] {0}[] text.none = text.close = Zamknij text.quit = Wyjdź text.maps = Mapy -text.continue = Continue -text.nextmission = Next Mission +text.continue = Kontynuuj +text.nextmission = Następna misja text.maps.none = [LIGHT_GRAY]Nie znaleziono żadnych map! text.about.button = O grze text.name = Nazwa: @@ -78,9 +78,9 @@ text.players = {0} graczy online text.players.single = {0} gracz online text.server.closing = [accent] Zamykanie serwera... text.server.kicked.kick = Zostałeś wyrzucony z serwera! -text.server.kicked.serverClose = Server closed. -text.server.kicked.sectorComplete = Sector completed. -text.server.kicked.sectorComplete.text = Your mission is complete.\nThe server will now continue at the next sector. +text.server.kicked.serverClose = Serwer został zamknięty. +text.server.kicked.sectorComplete = Sektor ukończony. +text.server.kicked.sectorComplete.text = Twoja misja została ukończona.\nSerwer kontynuuje w następnym sektorze. text.server.kicked.clientOutdated = Nieaktualna gra! Zaktualizują ją! text.server.kicked.serverOutdated = Nieaktualny serwer! text.server.kicked.banned = Zostałeś zbanowany na tym serwerze. @@ -92,7 +92,7 @@ text.server.kicked.customClient = Ten serwer nie wspomaga wersji deweloperskich. text.host.info = Przycisk [accent]host[] hostuje serwer na porcie [scarlet]6567[] i [scarlet]6568.[]\nKtokolwiek z tym samym [LIGHT_GRAY]wifi lub hotspotem[] powinien zobaczyć twój serwer.\n\nJeśli chcesz, aby każdy z twoim IP mógł dołączyć, [accent]przekierowywanie portów[] jest potrzebne.\n\n[LIGHT_GRAY]Notka:Jeśli ktokolwiek ma problem z dołączeniem do gry, upewnij się, że udostępniłeś Mindustry dostęp do sieci. text.join.info = Tutaj możesz wpisać [accent]IP serwera[], aby dołączyć lub wyszukaj [accent]serwery wifi[], do których chcesz dołączyć .\nGra wieloosobowa na LAN i WAN jest wspomagana.\n\n[LIGHT_GRAY]Notka: Nie ma automatycznej listy wszystkich serwerów; jeśli chcesz dołączyć przez IP, musisz zapytać się hosta o IP. text.hostserver = Stwórz Serwer -text.hostserver.mobile = Host\nGame +text.hostserver.mobile = Hostuj\ngrę text.host = Host text.hosting = [accent] Otwieranie serwera... text.hosts.refresh = Odśwież @@ -103,7 +103,7 @@ text.host.invalid = [scarlet] Nie można połączyć się z hostem. text.trace = Zlokalizuj gracza text.trace.playername = Nazwa gracza: [accent]{0} text.trace.ip = IP: [accent]{0} -text.trace.id = Wyjątkowae ID: [accent]{0} +text.trace.id = Wyjątkowe ID: [accent]{0} text.trace.android = Klient Androida: [accent]{0} text.trace.modclient = Zmodowany klient: [accent]{0} text.trace.totalblocksbroken = Łączna liczba zniszczonych bloków: [accent]{0} @@ -111,7 +111,7 @@ text.trace.structureblocksbroken = Zniszczone bloki struktur: [accent]{0} text.trace.lastblockbroken = Ostatni zniszczony blok: [accent]{0} text.trace.totalblocksplaced = Łączna liczba zbudowanych bloków: [accent]{0} text.trace.lastblockplaced = Ostatni postawiony blok: [accent]{0} -text.invalidid = Złe ID klienta! Udostępnij report błędu. +text.invalidid = Złe ID klienta! Udostępnij raport błędu. text.server.bans = Bany text.server.bans.none = Nie znaleziono zbanowanych osób! text.server.admins = Admini @@ -125,7 +125,7 @@ text.server.outdated.client = [crimson]Przestarzały klient![] text.server.version = [lightgray]Wersja: {0} text.server.custombuild = [yellow]Zmodowany klient text.confirmban = Jesteś pewny, że chcesz zbanować tego gracza? -text.confirmkick = Are you sure you want to kick this player? +text.confirmkick = Jesteś pewny, że chcesz wyrzucić tego gracza? text.confirmunban = Jesteś pewny, że chcesz odbanować tego gracza? text.confirmadmin = Jesteś pewny, że chcesz dać rangę admina temu graczowi? text.confirmunadmin = Jesteś pewny, że chcesz zabrać rangę admina temu graczowi? @@ -159,7 +159,7 @@ text.save.rename.text = Zmień nazwę text.selectslot = Wybierz zapis. text.slot = [accent]Slot {0} text.save.corrupted = [accent]Zapis gry jest uszkodzony lub nieprawidłowy! -text.sector.corrupted = [accent]A save file for this sector was found, but loading failed.\nA new one has been created. +text.sector.corrupted = [accent]Zapis sektora został znaleziony, ale nie można go otworzyć.\nNowy sektor został utworzony. text.empty = text.on = Włączone text.off = Wyłączone @@ -190,9 +190,9 @@ text.saving = [accent]Zapisywanie... text.wave = [accent]Fala {0} text.wave.waiting = Fala za {0} text.waiting = Oczekiwanie... -text.waiting.players = Waiting for players... -text.wave.enemies = [LIGHT_GRAY]{0} Enemies Remaining -text.wave.enemy = [LIGHT_GRAY]{0} Enemy Remaining +text.waiting.players = Oczekiwanie na graczy... +text.wave.enemies = Pozostało [LIGHT_GRAY]{0} wrogów +text.wave.enemy = Pozostał [LIGHT_GRAY]{0} wróg text.loadimage = Załaduj obraz text.saveimage = Zapisz obraz text.unknown = Nieznane @@ -201,8 +201,8 @@ text.builtin = Wbudowane text.map.delete.confirm = Jesteś pewny, że chcesz usunąć tę mapę? Nie będzie można jej przywrócić. text.map.random = [accent]Losowa mapa text.map.nospawn = Ta mapa nie zawiera żadnego rdzenia! Musisz dodać [ROYAL]niebieski[] rdzeń do tej mapy. -text.map.nospawn.pvp = This map does not have any enemy cores for player to spawn into! Add[SCARLET] red[] cores to this map in the editor. -text.map.invalid = Error loading map: corrupted or invalid map file. +text.map.nospawn.pvp = Ta mapa nie ma żadnego rdzenia przeciwnika, aby mogli się zrespić przeciwnicy! Dodaj[SCARLET] czerwony[] rdzeń do mapy w edytorze. +text.map.invalid = Error podczas ładowania mapy: uszkodzony lub niepoprawny plik mapy. text.editor.brush = Pędzel text.editor.slope = \\ text.editor.openin = Otwórz w edytorze @@ -260,13 +260,13 @@ text.editor = Edytor text.mapeditor = Edytor map text.donate = Wspomóż nas text.connectfail = [crimson]Nie można połączyć się z serwerem: [accent] {0} -text.error.unreachable = Server unreachable. -text.error.invalidaddress = Invalid address. -text.error.timedout = Timed out!\nMake sure the host has port forwarding set up, and that the address is correct! -text.error.mismatch = Packet error:\npossible client/server version mismatch.\nMake sure you and the host have the latest version of Mindustry! -text.error.alreadyconnected = Already connected. -text.error.mapnotfound = Map file not found! -text.error.any = Unkown network error. +text.error.unreachable = Serwer niedostępny. +text.error.invalidaddress = Niepoprawny adres. +text.error.timedout = Przekroczono limit czasu!/nUpewnij się, że host ma ustawione przekierowanie portu oraz, czy adres jest poprawny! +text.error.mismatch = Błąd pakietu:\nprawdopodobne niedopasowanie klienta/serwera.\nUpewnij się, że ty i host macie najnowszą wersję Mindustry! +text.error.alreadyconnected = Jesteś już połączony. +text.error.mapnotfound = Plik mapy nie został znaleziony! +text.error.any = Nieznany błąd sieci. text.settings.language = Język text.settings.reset = Przywróć domyślne text.settings.rebind = Zmień przyciski @@ -274,12 +274,12 @@ text.settings.controls = Sterowanie text.settings.game = Gra text.settings.sound = Dźwięk text.settings.graphics = Grafika -text.settings.cleardata = Clear Game Data... +text.settings.cleardata = Wyczyść dane gry... text.settings.clear.confirm = Are you sure you want to clear this data?\nWhat is done cannot be undone! text.settings.clearall.confirm = [scarlet]WARNING![]\nThis will clear all data, including saves, maps, unlocks and keybinds.\nOnce you press 'ok' the game will wipe all data and automatically exit. -text.settings.clearsectors = Clear Sectors -text.settings.clearunlocks = Clear Unlocks -text.settings.clearall = Clear All +text.settings.clearsectors = Wyczyść sektory +text.settings.clearunlocks = Wyczyść listę przedmiotów +text.settings.clearall = Wyczyść wszystko text.paused = Wstrzymano text.yes = Jasne! text.no = Nie ma mowy! @@ -298,7 +298,7 @@ text.blocks.liquidcapacity = Pojemność cieczy text.blocks.maxitemssecond = Maksymalna liczba przedmiotów / Sekunda text.blocks.powerrange = Zakres mocy text.blocks.poweruse = Zużycie prądu -text.blocks.powerdamage = Power/Damage +text.blocks.powerdamage = Moc/Zniszczenia text.blocks.inputitemcapacity = Pojemność materiałów text.blocks.outputitemcapacity = Pojemność produktów text.blocks.itemcapacity = Pojemność przedmiotów @@ -313,7 +313,7 @@ text.blocks.outputitem = Produkty text.blocks.drilltier = Co może wykopać text.blocks.drillspeed = Postawowa szybkość kopania text.blocks.liquidoutput = Wyprodukowany płyn -text.blocks.liquidoutputspeed = Liquid Output Speed +text.blocks.liquidoutputspeed = Prędkość odpływu cieczy text.blocks.liquiduse = Zużycie płynów text.blocks.coolant = Płyn chłodzący text.blocks.coolantuse = Zużycie płynu chłodzącego @@ -350,7 +350,7 @@ setting.autotarget.name = Auto-Target setting.fpscap.name = Max FPS setting.fpscap.none = None setting.fpscap.text = {0} FPS -setting.difficulty.training = training +setting.difficulty.training = trening setting.difficulty.easy = łatwy setting.difficulty.normal = normalny setting.difficulty.hard = trudny @@ -370,16 +370,16 @@ setting.musicvol.name = Głośność muzyki setting.mutemusic.name = Wycisz muzykę setting.sfxvol.name = Głośność dźwięków setting.mutesound.name = Wycisz dźwięki -setting.crashreport.name = Send Anonymous Crash Reports +setting.crashreport.name = Wysyłaj anonimowo dane o crashu gry text.keybind.title = Zmień ustawienia przycisków category.general.name = General -category.view.name = View +category.view.name = Wyświetl category.multiplayer.name = Multiplayer -command.attack = Attack -command.retreat = Retreat +command.attack = Atakuj +command.retreat = Wycofaj command.patrol = Patrol -keybind.press = Press a key... -keybind.press.axis = Press an axis or key... +keybind.press = Naciśnij wybrany klawisz... +keybind.press.axis = Naciśnij oś lub klawisz... keybind.move_x.name = Poruszanie w poziomie keybind.move_y.name = Poruszanie w pionie keybind.select.name = Wybieranie @@ -388,9 +388,9 @@ keybind.deselect.name = Deselect keybind.shoot.name = Strzelanie keybind.zoom_hold.name = Inicjator przybliżania keybind.zoom.name = Przybliżanie -keybind.menu.name = menu -keybind.pause.name = pauza -keybind.dash.name = przyśpieszenie +keybind.menu.name = Menu +keybind.pause.name = Pauza +keybind.dash.name = Przyspieszenie keybind.chat.name = Chat keybind.player_list.name = Lista graczy keybind.console.name = Konsola @@ -399,35 +399,35 @@ keybind.toggle_menus.name = Toggle menus keybind.chat_history_prev.name = Chat history prev keybind.chat_history_next.name = Chat history next keybind.chat_scroll.name = Chat scroll -keybind.drop_unit.name = drop unit -keybind.zoom_minimap.name = Zoom minimap +keybind.drop_unit.name = Wyrzuć przedmiot +keybind.zoom_minimap.name = Powiększenie mapy mode.text.help.title = Opis trybów mode.waves.name = Fale mode.waves.description = Normalny tryb. Normalne surowce i fale. -mode.sandbox.name = sandbox +mode.sandbox.name = Sandbox mode.sandbox.description = Nieskończone surowce i fale bez odliczania. Dla przedszkolaków! -mode.freebuild.name = budowanie +mode.freebuild.name = Budowanie mode.freebuild.description = Normalne surowce i fale bez odliczania. mode.pvp.name = PvP -mode.pvp.description = fight against other players locally. +mode.pvp.description = Walcz lokalnie przeciwko innym graczom. content.item.name = Przedmioty content.liquid.name = Płyny -content.unit.name = Units +content.unit.name = Jednostki content.recipe.name = Bloki content.mech.name = Mechs -item.stone.name = kamień +item.stone.name = Kamień item.stone.description = Zwkły surowy materiał. Używany do separacji i zamiany w inne surowce lub lawę. Już jaskiniowcy go używali. item.copper.name = Copper item.copper.description = A useful structure material. Used extensively in all types of blocks. item.lead.name = Ołów item.lead.description = Podstawowy matriał. Używany w przesyle przemiotów i płynów. Nie jest on przypadkiem szkodliwy? -item.coal.name = węgiel +item.coal.name = Węgiel item.coal.description = Zwykły i łatwo dostępny materiał energetyczny. item.dense-alloy.name = Dense Alloy item.dense-alloy.description = A tough alloy made with lead and copper. Used in advanced transportation blocks and high-tier drills. -item.titanium.name = tytan +item.titanium.name = Tytan item.titanium.description = Rzadki i bardzo lekki materiał. Używany w bardzo zaawansowanym przewodnictwie, wiertłach i samolotach. Poczuj się jak Tytan! -item.thorium.name = uran +item.thorium.name = Uran item.thorium.description = Zwarty i radioaktywny materiał używany w struktucrach i paliwie nuklearnym. Nie trzymaj go w rękach! item.silicon.name = Krzem item.silicon.description = Niesamowicie przydatny półprzewodnk uźywany w panelach słonecznych i skomplikowanej elektronice. Nie, w Dolinie Krzemowej już nie ma krzemu. @@ -439,7 +439,7 @@ item.surge-alloy.name = Niezwykły Stop item.surge-alloy.description = An advanced alloy with unique electrical properties. item.biomatter.name = Biomateria item.biomatter.description = Zbita organiczna papka używana jako materiał do ropy lub jako podstawowy materiał energetyczny. Wegańska! -item.sand.name = piasek +item.sand.name = Piasek item.sand.description = Zwykły materiał używany pospolicie w przepalaniu, stopach i jako topnik. Dostanie piaskiem po oczach nie jest przyjemne. item.blast-compound.name = Wybuchowy związek item.blast-compound.description = Lotny związek używany w pirotechnice. Może być używany jako materiał energetyczny, ale nie polecam. BOOOM! @@ -482,52 +482,52 @@ text.item.explosiveness = [LIGHT_GRAY]Wybuchowość: {0} text.item.flammability = [LIGHT_GRAY]Palność: {0} text.item.radioactivity = [LIGHT_GRAY]Promieniotwórczość: {0} text.item.fluxiness = [LIGHT_GRAY]Moc topnika: {0} -text.unit.health = [LIGHT_GRAY]Health: {0} -text.unit.speed = [LIGHT_GRAY]Speed: {0} -text.mech.weapon = [LIGHT_GRAY]Weapon: {0} -text.mech.armor = [LIGHT_GRAY]Armor: {0} -text.mech.itemcapacity = [LIGHT_GRAY]Item Capacity: {0} -text.mech.minespeed = [LIGHT_GRAY]Mining Speed: {0} -text.mech.minepower = [LIGHT_GRAY]Mining Power: {0} -text.mech.ability = [LIGHT_GRAY]Ability: {0} +text.unit.health = [LIGHT_GRAY]Zdrowie: {0} +text.unit.speed = [LIGHT_GRAY]Prędkość: {0} +text.mech.weapon = [LIGHT_GRAY]Broń: {0} +text.mech.armor = [LIGHT_GRAY]Uzbrojenie: {0} +text.mech.itemcapacity = [LIGHT_GRAY]Pojemność przedmiotów: {0} +text.mech.minespeed = [LIGHT_GRAY]Prędkość kopania: {0} +text.mech.minepower = [LIGHT_GRAY]Moc kopania: {0} +text.mech.ability = [LIGHT_GRAY]Umiejętność: {0} text.liquid.heatcapacity = [LIGHT_GRAY]Wytrzymałość na przegrzewanie: {0} text.liquid.viscosity = [LIGHT_GRAY]Lepkość: {0} text.liquid.temperature = [LIGHT_GRAY]Temperatura: {0} -block.constructing = {0}\n[LIGHT_GRAY](Constructing) -block.spawn.name = Enemy Spawn -block.core.name = Core -block.metalfloor.name = Metal Floor -block.deepwater.name = deepwater -block.water.name = water -block.lava.name = lava -block.tar.name = Tar -block.blackstone.name = blackstone -block.stone.name = stone -block.dirt.name = dirt -block.sand.name = sand -block.ice.name = ice -block.snow.name = snow -block.grass.name = grass -block.shrub.name = shrub -block.rock.name = rock -block.blackrock.name = blackrock -block.icerock.name = icerock -block.copper-wall.name = Copper Wall -block.copper-wall-large.name = Large Copper Wall +block.constructing = {0}\n[LIGHT_GRAY](Budowa) +block.spawn.name = Spawn wrogów +block.core.name = Rdzeń +block.metalfloor.name = Podłoga metalowa +block.deepwater.name = Głęboka woda +block.water.name = Woda +block.lava.name = Lawa +block.tar.name = Smoła +block.blackstone.name = Czarny kamień +block.stone.name = Kamień +block.dirt.name = Ziemia +block.sand.name = Piasek +block.ice.name = Lód +block.snow.name = Śnieg +block.grass.name = Trawa +block.shrub.name = Krzak +block.rock.name = Skała +block.blackrock.name = Czarna skała +block.icerock.name = Lodowa skała +block.copper-wall.name = Miedziana ściana +block.copper-wall-large.name = Duża miedziana ściana block.dense-alloy-wall.name = Dense Alloy Wall block.dense-alloy-wall-large.name = Large Dense Alloy Wall block.phase-wall.name = Phase Wall block.phase-wall-large.name = Large Phase Wall block.thorium-wall.name = Torowa Ściana block.thorium-wall-large.name = Duża Torowa Ściana -block.door.name = drzwi -block.door-large.name = duże drzwi +block.door.name = Drzwi +block.door-large.name = Duże drzwi block.duo.name = Podwójne działko block.scorch.name = Ogniste działko block.hail.name = Święte działko block.lancer.name = Lancer block.conveyor.name = Przenośnik -block.titanium-conveyor.name = Tytanowy Transporter +block.titanium-conveyor.name = Tytanowy przenośnik block.junction.name = Węzeł block.router.name = Rozdzielacz block.distributor.name = Dystrybutor @@ -552,10 +552,10 @@ block.battery.name = Bateria block.battery-large.name = Duża Bateria block.combustion-generator.name = Generator Spalinowy block.turbine-generator.name = Generator Turbinowy -block.mechanical-drill.name = Mechanical Drill -block.pneumatic-drill.name = Pneumatic Drill -block.laser-drill.name = Laserowe Wiertło -block.water-extractor.name = Ekstraktor wody +block.mechanical-drill.name = Wiertło Mechaniczne +block.pneumatic-drill.name = Wiertło Pneumatyczne +block.laser-drill.name = Wiertło Laserowe +block.water-extractor.name = Ekstraktor Wody block.cultivator.name = Spluchniacz block.alpha-mech-pad.name = Alpha Mech Pad block.dart-ship-pad.name = Dart Ship Pad @@ -567,11 +567,11 @@ block.omega-mech-pad.name = Omega Mech Pad block.tau-mech-pad.name = Tau Mech Pad block.conduit.name = Rura block.mechanical-pump.name = Mechaniczna Pompa -block.itemsource.name = DEBUG Źródło przedmiotów -block.itemvoid.name = Item Void -block.liquidsource.name = DEBUG Źródło płynów -block.powervoid.name = Power Void -block.powerinfinite.name = DEBUG Nieskończony Prąd +block.itemsource.name = Źródło przedmiotów +block.itemvoid.name = Próżnia przedmiotów +block.liquidsource.name = Źródło płynów +block.powervoid.name = Próżnia prądu +block.powerinfinite.name = Nieskończony Prąd block.unloader.name = Wyciągacz block.vault.name = Magazyn block.wave.name = Działo Płynowe @@ -603,33 +603,33 @@ block.liquid-tank.name = Zbiornik Płynów block.liquid-junction.name = Łącznik Płynów block.bridge-conduit.name = Most Płynów block.rotary-pump.name = Wirowa Pompa -block.thorium-reactor.name = Thorium Reactor -block.command-center.name = Command Center +block.thorium-reactor.name = Reaktor Torowy +block.command-center.name = Centrum dowodzenia block.mass-driver.name = Mass Driver block.blast-drill.name = Blast Drill -block.thermal-pump.name = Thermal Pump -block.thermal-generator.name = Thermal Generator +block.thermal-pump.name = Pompa Termalna +block.thermal-generator.name = Generator Termalny block.alloy-smelter.name = Alloy Smtler block.mend-projector.name = Mend Projector block.surge-wall.name = Surge Wall block.surge-wall-large.name = Large Surge Wall block.cyclone.name = Cyclone block.fuse.name = Fuse -block.shock-mine.name = Shock Mine +block.shock-mine.name = Mina block.overdrive-projector.name = Overdrive Projector block.force-projector.name = Force Projector block.arc.name = Arc -block.rtg-generator.name = RTG Generator +block.rtg-generator.name = Generator RTG block.spectre.name = Spectre block.meltdown.name = Meltdown block.container.name = Container -block.core.description = The most important building in the game. -team.blue.name = blue -team.red.name = red -team.orange.name = orange -team.none.name = gray -team.green.name = green -team.purple.name = purple +block.core.description = Najważniejszy budynek w grze. +team.blue.name = niebieski +team.red.name = czerwony +team.orange.name = pomarańczowy +team.none.name = szary +team.green.name = zielony +team.purple.name = fioletowy unit.alpha-drone.name = Alpha Drone unit.spirit.name = Spirit Drone unit.spirit.description = The starter drone unit. Spawns in the core by default. Automatically mines ores, collects items and repairs blocks. @@ -756,25 +756,25 @@ block.revenant-factory.description = Produces heavy laser ground units. block.repair-point.description = Continuously heals the closest damaged unit in its vicinity. block.command-center.description = Allows changing friendly AI behavior. Currently, attack, retreat and patrol commands are supported. block.conduit.description = Basic liquid transport block. Works like a conveyor, but with liquids. Best used with extractors, pumps or other conduits. -block.pulse-conduit.description = Advanced liquid transport block. Transports liquids faster and stores more than standard conduits. -block.phase-conduit.description = Advanced liquid transport block. Uses power to teleport liquids to a connected phase conduit over several tiles. +block.pulse-conduit.description = Zaawansowany blok do przenoszenia cieczy. Transports liquids faster and stores more than standard conduits. +block.phase-conduit.description = Zaawansowany blok do przenoszenia cieczy. Używa prądu, aby przenieść ciecz do połączonego phase conduit przez kilka bloków. block.liquid-router.description = Accepts liquids from one direction and outputs them to up to 3 other directions equally. Can also store a certain amount of liquid. Useful for splitting the liquids from one source to multiple targets. block.liquid-tank.description = Stores a large amount of liquids. Use it for creating buffers when there is a non-constant demand of materials or as a safeguard for cooling vital blocks. -block.liquid-junction.description = Acts as a bridge for two crossing conduits. Useful in situations with two different conduits carrying different liquids to different locations. -block.bridge-conduit.description = Advanced liquid transport block. Allows transporting liquids over up to 3 tiles of any terrain or building. -block.mechanical-pump.description = A cheap pump with slow output, but no power consumption. -block.rotary-pump.description = An advanced pump which doubles up speed by using power. +block.liquid-junction.description = Działa jak most dla dwóch krzyżujących się rur. Przydatne w sytuacjach, kiedy dwie rury mają różne ciecze do różnych lokacji. +block.bridge-conduit.description = Zaawansowany blok przenoszący ciecze. Pozwala na przenoszenie cieczy nawet do 3 bloków na każdym terenie, przez każdy budynek. +block.mechanical-pump.description = Tania pompa o niskiej przepustowości. Nie wymaga prądu. +block.rotary-pump.description = Zaawansowana pompa, dwukrotnie większa przepustowość od mechanicznej pompy. Wymaga prądu. block.thermal-pump.description = The ultimate pump. Three times as fast as a mechanical pump and the only pump which is able to retrieve lava. -block.router.description = Accepts items from one direction and outputs them to up to 3 other directions equally. Useful for splitting the materials from one source to multiple targets. -block.distributor.description = An advanced router which splits items to up to 7 other directions equally. -block.bridge-conveyor.description = Advanced item transport block. Allows transporting items over up to 3 tiles of any terrain or building. +block.router.description = Akceptuje przedmioty z jednego miejsca i rozdziela je do trzech innych kierunków. Przydatne w rozdzielaniu materiałów z jednego źródła do wielu celów. +block.distributor.description = Zaawansowany rozdzielacz, rozdzielający przedmioty do 7 innych kierunków. +block.bridge-conveyor.description = Zaawansowany blok transportujący. Pozwala na przenoszenie przedmiotów nawet do 3 bloków na każdym terenie, przez każdy budynek. block.alpha-mech-pad.description = When given enough power, rebuilds your ship into the[accent] Alpha[] mech. -block.itemsource.description = Infinitely outputs items. Sandbox only. -block.liquidsource.description = Infinitely outputs liquids. Sandbox only. -block.itemvoid.description = Destroys any items which go into it without using power. Sandbox only. -block.powerinfinite.description = Infinitely outputs power. Sandbox only. -block.powervoid.description = Voids all power inputted into it. Sandbox only. -liquid.water.description = Commonly used for cooling machines and waste processing. -liquid.lava.description = Can be transformed into[LIGHT_GRAY] stone[], used for generating power or used as ammo for certain turrets. -liquid.oil.description = Can be burnt, exploded or used as a coolant. -liquid.cryofluid.description = The most efficient liquid for cooling things down. +block.itemsource.description = Wydziela przedmioty w nieskończoność. Dostępny tylko w trybie sandbox. +block.liquidsource.description = Wydziela ciecz w nieskończoność. Dostępny tylko w trybie sandbox. +block.itemvoid.description = Niszczy wszystkie przedmioty, które idą do tego bloku, który nie wymaga prądu. Dostępny tylko w trybie sandbox. +block.powerinfinite.description = Wydziela prąd w nieskończoność. Dostępny tylko w trybie sandbox. +block.powervoid.description = Niszczy całą energię wprowadzoną do tego bloku. Dostępny tylko w trybie sandbox. +liquid.water.description = Powszechnie używana do schładzania budowli i przetwarzania odpadów. +liquid.lava.description = Może być przekształcona w [LIGHT_GRAY] kamień[]; używana do generowania prądu lub używana jako amunicja dla niektórych działek. +liquid.oil.description = Może się palić, eksplodować lub być używana do schładzania. +liquid.cryofluid.description = Najefektywniejsza ciecz do schładzania budowli. diff --git a/core/assets/bundles/bundle_ru.properties b/core/assets/bundles/bundle_ru.properties index fa1d1c3e04..000b995f43 100644 --- a/core/assets/bundles/bundle_ru.properties +++ b/core/assets/bundles/bundle_ru.properties @@ -1,4 +1,4 @@ -text.credits.text = Создатель [ROYAL] Anuken. - [SKY]anukendev@gmail.com[][]\n\nЕсть недоработки в переводе?\nПишите в офф. discord-сервер mindustry в канал #русский.\n\nПереводчики на русский язык:\n[YELLOW]Prosta4ok_ua\n[GREEN]xga\n[BLACK]XZimur +text.credits.text = Создатель [ROYAL] Anuken. - [SKY]anukendev@gmail.com[][]\n\nЕсть недоработки в переводе?\nПишите в офф. discord-сервер mindustry в канал #русский.\n\nПереводчики на русский язык:\n[YELLOW]Prosta4ok_ua\n[GREEN]xga\n[BLACK]XZimur\n[BLUE]Beryllium text.credits = Авторы text.contributors = Переводчики и контрибьюторы text.discord = Присоединяйтесь к нашему Discord! @@ -23,9 +23,9 @@ text.level.select = Выбор карты text.level.mode = Режим игры: text.construction.desktop = Чтобы отменить выбор блока или остановить строительство, [accent] используйте пробел[]. text.construction.title = Руководство по размещению блоков -text.construction = Вы только что перешли в режим размещения[accent]блоков[].\n\nЧтобы начать размещение, просто коснитесь подходящего места рядом с вашим мехом.\nПосле того, как вы поставили несколько блоков, нажмите на галочку, чтобы подтвердить, и ваш мех начнет их строительство.\n\n- [accent]Удалите блоки [] из вашего плана строительства, нажав на них.n- [accent]Нажав Shift [] и, удерживая, перетащите любой выбранный блок.\n- [accent]Поместите блоки в линию [], нажимая и удерживая на пустое место, а затем перетаскивая в любом направлении.\n- [accent]Отмените размещение блоков [], нажав X в левом нижнем углу. +text.construction = Вы только что перешли в режим размещения[accent]блоков[].\n\nЧтобы начать размещение, просто коснитесь подходящего места рядом с вашим мехом.\nПосле того, как вы поставили несколько блоков, нажмите на галочку, чтобы подтвердить, и ваш мех начнет их строительство.\n\n- [accent]Удалите блоки [] из вашего плана строительства, нажав на них.n- [accent]Нажав Shift [] и, удерживая, перетащите любой выбранный блок.\n- [accent]Поместите блоки в линию [], нажимая и удерживая на пустое место, а затем перетаскивая в любом направлении.\n- [accent]Отмените размещение блоков [], нажав X в нижнем правом углу. text.deconstruction.title = Руководство по разрушению блоков -text.deconstruction = Вы только что перешли в режим сноса[accent] блоков.[].\n\nЧтобы начать удалять, просто нажмите на блок рядом с вашим мехом.\nПосле того как вы выбрали несколько блоков, нажмите на галочку, чтобы подтвердить, и ваш мех начнёт их сносить.\n\n- [accent]Уберите блоки [] из вашего выбора, нажав на них.\n- [accent]Удалите блоки в области [], нажав и удерживая на пустом месте, а затем перетаскивая в нужном направлении.\n- [accent]Отменить снос или выбор [] можно нажав X в левом нижнем углу. +text.deconstruction = Вы только что перешли в режим сноса[accent] блоков.[].\n\nЧтобы начать удалять, просто нажмите на блок рядом с вашим мехом.\nПосле того как вы выбрали несколько блоков, нажмите на галочку, чтобы подтвердить, и ваш мех начнёт их сносить.\n\n- [accent]Уберите блоки [] из вашего выбора, нажав на них.\n- [accent]Удалите блоки в области [], нажав и удерживая на пустом месте, а затем перетаскивая в нужном направлении.\n- [accent]Отменить снос или выбор [] можно нажав X в нижнем правом углу. text.showagain = Не показывать снова до следующей сессии text.coreattack = < Ядро находится под атакой! > text.unlocks = Разблокированные @@ -39,13 +39,13 @@ text.sector = Выбранный сектор: [LIGHT_GRAY]{0} text.sector.time = Время: [LIGHT_GRAY]{0} text.sector.deploy = Высадиться text.sector.abandon = Отступить -text.sector.abandon.confirm = Вы уверены, что хотите отступить?\nЭто не может быть отменено! +text.sector.abandon.confirm = Вы уверены, что хотите отступить?\nПрогресс на секторе нельзя восстановить! text.sector.resume = Продолжить text.sector.locked = [scarlet][[Не завершён] text.sector.unexplored = [accent][[Неисследованный] text.missions = Миссий:[LIGHT_GRAY] {0} text.mission = Миссия:[LIGHT_GRAY] {0} -text.mission.main = Главная мисия:[LIGHT_GRAY] {0} +text.mission.main = Главная миссия:[LIGHT_GRAY] {0} text.mission.info = Информация о миссии text.mission.complete = Миссия выполнена! text.mission.complete.body = Сектор {0},{1} был завоёван. @@ -430,12 +430,12 @@ item.titanium.name = Титан item.titanium.description = Редкий сверхлёгкий металл широко используется в производстве: транспорта, буров и самолётов. item.thorium.name = Торий item.thorium.description = Плотный радиоактивный металл используется в качестве структурной поддержки и ядерного топлива. -item.silicon.name = Кремень +item.silicon.name = Кремний item.silicon.description = Очень полезный полупроводник с применениями в солнечных батареях и множестве сложной электроники. item.plastanium.name = Пластиний item.plastanium.description = Легкий, пластичный материал, используемый в современных самолетах и боеприпасах для фрагментации. item.phase-fabric.name = Фазовая ткань -item.phase-fabric.description = Невесомое вещество, используемое в современной электронике и технологии самовосстановления. Непригодна для вышивания. +item.phase-fabric.description = Невесомое вещество, используемое в современной электронике и технологии самовосстановления. Не для вышивания. item.surge-alloy.name = Высокопрочный сплав item.surge-alloy.description = Передовой сплав с уникальными электрическими свойствами. item.biomatter.name = Биоматерия @@ -463,7 +463,7 @@ mech.tau-mech.weapon = Восстановительный лазер mech.tau-mech.ability = Регенирирующая вспышка mech.tau-mech.description = Мех поддержки. Чинит союзные блоки, стреляя в них. Может исцелить союзников радиусом с его способностью восстанавления. mech.omega-mech.name = Омега -mech.omega-mech.weapon = Ракетомётный пулемётконфигурация +mech.omega-mech.weapon = Ракетомётный пулемёт mech.omega-mech.ability = Защитная mech.omega-mech.description = Громоздкий и хорошо бронированный мех, сделанный для фронтовых нападений. Его способность брони может блокировать до 90% входящего урона. mech.dart-ship.name = Дротик @@ -655,7 +655,7 @@ tutorial.conveyor = [accent]Конвейеры[] используются для tutorial.morecopper = Требуется больше меди.\n\nЛибо добудьте её вручную, либо разместите больше буров. tutorial.turret = Оборонительные сооружения должны быть созданы, чтобы отразить[LIGHT_GRAY] атаку противника[].Постройте двойную турель рядом с вашей базой. tutorial.drillturret = Двойные турели требуют[accent] патронов из меди[] для стрельбы.\nРазместите бур рядом с турелью, чтобы снабдить её добытой медью. -tutorial.waves = [LIGHT_GRAY]Враг[] приближается.\n\nЗащитите своё ядро от 2-ух волн. Вам может понадобится больше турелей. +tutorial.waves = [LIGHT_GRAY]Враг[] приближается.\n\nЗащитите своё ядро от двух волн. Вам может понадобится больше турелей. tutorial.lead = Осмотритесь! Магическим образом появились новые руды. Добудьте [accent] свинец[].\n\nПеретащите ресурс из своего устройства(юнита) в ядро для переноса ресурсов. tutorial.smelter = Медь и свинец являются мягкими металлами.\nПревосходный[accent] плотный сплав[] может быть создан в плавильном заводе.\n\nПостройте один плавильный завод. tutorial.densealloy = Теперь плавильный завод производит плотный сплав.\nСоздайте немного.\nУлучшите производство, если это необходимо. @@ -664,7 +664,7 @@ tutorial.silicondrill = Для производства кремния треб tutorial.generator = Эта технология требует энергии.\nПостройте [accent] генератор внутреннего сгорания[] для того, чтобы запитать устройство энергией. tutorial.generatordrill = Генератор внутреннего сгорания нуждается в топливе.\nЗаправьте его углём. tutorial.node = Энергия требует транспортировки.\nСоздайте [accent] силовой узел[] рядом с генератором внутреннего сгорания для передачи энергии. -tutorial.nodelink = Энергия может быть передана посредством соприкосновения блоков питания и генераторов или связанных силовых узлов.\n\nСоедините их энергией, нажав на силовой узел и выбрав генератор, а затем кремниевый завод. +tutorial.nodelink = Энергия может быть передана посредством соприкосновения блоков питания и генераторов или связанных силовых узлов.\n\nСоедините их, нажав на силовой узел и выбрав генератор, а затем кремниевый завод. tutorial.silicon = Производство кремния началось. Получите немного.\nРекомендуется улучшить эту систему. tutorial.daggerfactory = Постройте[accent] завод по производству "разведчиков".[]\n\nОн будет производить атакуюших мехов. tutorial.router = Заводы нуждаются в ресурсах для работы.\nСоздайте маршрутизатор для разделения ресурсов конвейера. @@ -773,8 +773,8 @@ block.bridge-conveyor.description = Улучшенный транспортны block.alpha-mech-pad.description = Превращает вас в мех [accent] Альфа[]. Требует энергию. block.itemsource.description = Бесконечно выводит предметы. Работает только в песочнице. block.liquidsource.description = Бесконечно выводит жидкости. Работает только в песочнице. -block.itemvoid.description = Уничтожает любые предметы, которые входят в него, без использования энергии. Работает только в песочнице. -block.powerinfinite.description = Бесконечность — не предел. Бесконечно выводит энергию. Доступен только в песочнице. +block.itemvoid.description = Уничтожает любые предметы, которые входят в него, без использования энергии. Работает только в режиме песочницы. +block.powerinfinite.description = Бесконечность — не предел. Бесконечно выводит энергию. Доступен только в режиме песочницы. block.powervoid.description = Энергия просто уходит в пустоту. Присутствует только в песочнице. liquid.water.description = Намного лучше чем [BLUE]монооксид дигидрогена[].\n\n Для получения воды используйте помпу(насос) на источнике(блоке) или экстрактор воды.\n\n Эту жидкость можно подвести к бурам для ускорения скорости добычи или к турелям для ускорения стрельбы. liquid.lava.description = [accent]Горячо...\nВещество расплавленное из горно-каменных пород. diff --git a/core/assets/bundles/bundle_tr.properties b/core/assets/bundles/bundle_tr.properties index d4e7a788b7..616b2c03b4 100644 --- a/core/assets/bundles/bundle_tr.properties +++ b/core/assets/bundles/bundle_tr.properties @@ -8,67 +8,69 @@ text.link.trello.description = Planlanan özellikler için resmi Trello Bülteni text.link.itch.io.description = PC yüklemeleri ve web sürümü ile itch.io sayfası text.link.google-play.description = Google Play mağaza sayfası text.link.wiki.description = Resmi Mindustry Wikipedi'si -text.linkfail = Bağlantı açılamadı! URL, yazı tahtanıza kopyalandı. +text.linkfail = Bağlantı açılamadı\! URL, yazı tahtanıza kopyalandı. +text.editor.web = Web sürümü editörü desteklemiyor\! Editörü kullanmak için oyunu indirin. +text.web.unsupported = Site versiyonu bunu desteklemiyor\! Oyunu indirip dene. text.gameover = Çekirdek yok edildi. -text.gameover.pvp = The[accent] {0}[] team is victorious! -text.sector.gameover = This sector has been lost. Re-deploy? -text.sector.retry = Retry -text.highscore = [SARI] Yeni yüksek puan! -text.wave.lasted = You lasted until wave [accent]{0}[]. -text.level.highscore = Yüksek Puan: [accent] {0} +text.gameover.pvp = [accent] {0}[] takimi kazandi \! +text.sector.gameover = Sektor kaybedildi. +text.sector.retry = Tekrar dene +text.highscore = [SARI] Yeni yüksek puan\! +text.wave.lasted = Su dalgaya kadar yasadin: [accent]{0}[]. +text.level.highscore = Yüksek Puan\: [accent] {0} text.level.delete.title = Silmeyi onaylayın -text.map.delete = Are you sure you want to delete the map "[accent]{0}[]"? +text.map.delete = Su haritayi silmek istedigine emin misin? "[orange]{0}[]"? text.level.select = Seviye Seç text.level.mode = Oyun Modu -text.construction.desktop = Desktop controls have been changed.\nTo deselect a block or stop building, [accent]use space[]. -text.construction.title = Block Construction Guide -text.construction = You've just selected [accent]block construction mode[].\n\nTo begin placing, simply tap a valid location near your ship.\nOnce you have selected some blocks, press the checkbox to confirm, and your ship will begin constructing them.\n\n- [accent]Remove blocks[] from your selection by tapping them.\n- [accent]Shift the selection[] by holding and dragging any block in the selection.\n- [accent]Place blocks in a line[] by tapping and holding an empty spot, then dragging in a direction.\n- [accent]Cancel construction or selection[] by pressing the X at the bottom left. -text.deconstruction.title = Block Deconstruction Guide -text.deconstruction = You've just selected [accent]block deconstruction mode[].\n\nTo begin breaking, simply tap a block near your ship.\nOnce you have selected some blocks, press the checkbox to confirm, and your ship will begin de-constructing them.\n\n- [accent]Remove blocks[] from your selection by tapping them.\n- [accent]Remove blocks in an area[] by tapping and holding an empty spot, then dragging in a direction.\n- [accent]Cancel deconstruction or selection[] by pressing the X at the bottom left. -text.showagain = Don't show again next session -text.coreattack = < Core is under attack! > -text.unlocks = Unlocks +text.construction.desktop = Masaustu kontrolleri degisti.\nSecmeyi birakip yapmayi kesmek icin, [accent]bosluga bas[]. +text.construction.title = Blok Yapma Ogreticisi +text.construction = Sen su anda [accent]blok yapma moduna gectin[].\n\nYapmaya baslamak icin, geminin cevresinde uygun bir yere tikla.\nBiraz blok sectikten sonra, onaylamak icin "tik" tusuna bas, ve gemin onlari yapmaya baslayacaktir.\n\n- [accent]Blok kaldirmak[] icin onlari secme yerine gene tikla\n- [accent]Blok secmek icin[] onlara secme yerinde tikla.\n- [accent]Cizgi biciminde koymak icin[] bos bir yere bas, ve bir yere dogru surukle.\n- [accent]Yapma modundan cikmak icin[] alt kosedeki X tusuna bas +text.deconstruction.title = Blok Yikim Ogreticisi +text.deconstruction = Sen su anda [accent]blok yikim moduna gectin[].\n\nKirmaya baslamak icin, geminin cevresinde bir bloga tikla\nBiraz blok sectikten sonra, "tik" tusuna basarak onayla, ve gemin onlari yikmaya baslayacaktir.\n\n- [accent]Blok kaldirmak[] icin onlari secme yerine gene tikla\n- [accent]Bir alanin icinde blok kirmak icin[] bos bir yere tikla, ve surukle\n- [accent]Yikma modundan cikmak icin[] Kosedeki X tusuna bas +text.showagain = Bunu gene gosterme +text.coreattack = < Cekirdek saldiri altinda\! > +text.unlocks = Koleksiyon text.savegame = Oyunu Kaydet text.loadgame = Oyunu yükle text.joingame = Oyuna katıl -text.addplayers = Add/Remove Players -text.customgame = Custom Game -text.sectors = Sectors -text.sector = Selected Sector: [LIGHT_GRAY]{0} -text.sector.time = Time: [LIGHT_GRAY]{0} -text.sector.deploy = Deploy -text.sector.abandon = Abandon -text.sector.abandon.confirm = Are you sure you want to abandon all progress at this sector?\nThis cannot be undone! -text.sector.resume = Resume -text.sector.locked = [scarlet][[Incomplete] -text.sector.unexplored = [accent][[Unexplored] -text.missions = Missions:[LIGHT_GRAY] {0} -text.mission = Mission:[LIGHT_GRAY] {0} -text.mission.main = Main Mission:[LIGHT_GRAY] {0} -text.mission.info = Mission Info -text.mission.complete = Mission complete! -text.mission.complete.body = Sector {0},{1} has been conquered. -text.mission.wave = Survive[accent] {0}/{1} []waves\nWave in {2} -text.mission.wave.enemies = Survive[accent] {0}/{1} []waves\n{2} Enemies -text.mission.wave.enemy = Survive[accent] {0}/{1} []waves\n{2} Enemy -text.mission.wave.menu = Survive[accent] {0} []waves -text.mission.battle = Destroy the enemy base. -text.mission.resource.menu = Obtain {0} x{1} -text.mission.resource = Obtain {0}:\n[accent]{1}/{2}[] -text.mission.block = Create {0} -text.mission.unit = Create {0} Unit -text.mission.command = Send Command {0} To Units -text.mission.linknode = Link Power Node -text.mission.display = [accent]Mission:\n[LIGHT_GRAY]{0} -text.mission.mech = Switch to mech[accent] {0}[] -text.mission.create = Create[accent] {0}[] +text.addplayers = Oyuncu ekle/cikar +text.customgame = Ozel oyun +text.sectors = Sektorler +text.sector = Su sektoru sectin\: [LIGHT_GRAY]{0} +text.sector.time = Zaman\: [LIGHT_GRAY]{0} +text.sector.deploy = Basla +text.sector.abandon = Terk et +text.sector.abandon.confirm = Buradaki ilerlemeni silmek istedigine emin misin\nBu geri alinamaz\! +text.sector.resume = Devam et +text.sector.locked = [scarlet][[Bitirilmedi] +text.sector.unexplored = [accent][[Kesvedilmedş] +text.missions = Gorevler\:[LIGHT_GRAY] {0} +text.mission = Gorev\:[LIGHT_GRAY] {0} +text.mission.main = Ana gorev\:[LIGHT_GRAY] {0} +text.mission.info = Gorev bilgisi +text.mission.complete = Gorev tamamlandi\! +text.mission.complete.body = Sektor {0},{1} ele gecirildi +text.mission.wave = [accent]{0}[] dalga hayatta kal +text.mission.wave.enemies = [accent] {0}/{1} []dalga hayatta kal\n{2} Dusman oldur +text.mission.wave.enemy = [accent] {0}/{1} []dalga hayatta kal\n{2} Dusman oldur +text.mission.wave.menu = [accent] {0} []dalga hayatta kal +text.mission.battle = Dusman temelini yok et +text.mission.resource.menu = Sunlari ele gecir {0} x{1} +text.mission.resource = Sunlari ele gecir {0}\:\n[accent]{1}/{2}[] +text.mission.block = Su kadar yarat {0} +text.mission.unit = {0} Kadar unit yarat +text.mission.command = {0} Unite komut yolla +text.mission.linknode = Guc nodu bagla +text.mission.display = [accent]Gorev\:\n[LIGHT_GRAY]{0} +text.mission.mech = Su gemiye degis[accent] {0}[] +text.mission.create = Su kadar yarat[accent] {0}[] text.none = -text.close = Close +text.close = Kapat text.quit = Çık -text.maps = Maps -text.continue = Continue -text.nextmission = Next Mission -text.maps.none = [LIGHT_GRAY]No maps found! +text.maps = Haritalar +text.continue = Devam et +text.nextmission = Siradaki gorev +text.maps.none = [LIGHT_GRAY]Harita bulunamadi\! text.about.button = Hakkında text.name = Adı: text.filename = File Name: diff --git a/core/assets/bundles/bundle_uk_UA.properties b/core/assets/bundles/bundle_uk_UA.properties index 6bc5700d53..c78427623f 100644 --- a/core/assets/bundles/bundle_uk_UA.properties +++ b/core/assets/bundles/bundle_uk_UA.properties @@ -1,6 +1,6 @@ text.credits.text = Створив [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[]\n\nЄ питання по грі або проблеми с перекладом? Іди в офіційний сервер discord Mindustry в канал #український. text.credits = Автори -text.contributors = Перекладачі та Контриб'ютори +text.contributors = Перекладачі та Помічники text.discord = Приєднуйтесь до нашого Discord! text.link.discord.description = Офіційний discord-сервер Mindustry text.link.github.description = Код гри @@ -10,6 +10,7 @@ text.link.itch.io.description = Itch.io сторінка з веб-версіє text.link.google-play.description = Скачати з Google Play для Android text.link.wiki.description = Офіційна Mindustry вікі (англ.) text.linkfail = Не вдалося відкрити посилання!\nURL-адреса скопійовано у ваш буфер обміну. +text.screenshot = Скріншот збережено в {0} text.gameover = Гру закінчено text.gameover.pvp = [accent] {0}[] команда перемогла! text.sector.gameover = Цей сектор було втрачено. Повторно висадитися? @@ -23,15 +24,15 @@ text.level.select = Вибір мапи text.level.mode = Режим гри: text.construction.desktop = Щоб скасувати вибір блоку або припинити будівництво, [accent] скористайтеся пробілом[]. text.construction.title = Інструкція з будівництва блоків -text.construction = Ви тільки що перейшли в режим будівництва[accent] блоків[].\n\nЩоб розпочати розміщення, просто торкніться підходящого місця поруч із вашим кораблем.\nПісля вибору деяких блоків натисніть прапорець, щоб підтвердити, і ваш корабель почне будувати їх.\n\n- [accent]Вилучіть блоки[] з вашого вибору, торкнувшись їх.\n- [accent]Перемістіть виділення[] утримуючи та перетягнувши будь-який блок у виділенні.\n- [accent]Розташуйте блоки у лінію[], торкнувшись і утримуючи порожнє місце, а потім перетягуючи в потрібному напрямку.\n- [accent]Скасуйте розміщення блоків[] натиснувши X внизу ліворуч. +text.construction = Ви тільки що перейшли в режим будівництва[accent] блоків[].\n\nЩоб розпочати розміщення, просто торкніться підходящого місця поруч із вашим кораблем.\nПісля вибору деяких блоків натисніть прапорець, щоб підтвердити, і ваш корабель почне будувати їх.\n\n- [accent]Вилучіть блоки[] з вашого вибору, торкнувшись їх.\n- [accent]Перемістіть виділення[] утримуючи та перетягнувши будь-який блок у виділенні.\n- [accent]Розташуйте блоки у лінію[], торкнувшись і утримуючи порожнє місце, а потім перетягуючи в потрібному напрямку.\n- [accent]Скасуйте розміщення блоків[] натиснувши X внизу праворуч. text.deconstruction.title = Інструкція з деконструкції блоків -text.deconstruction = Ви тільки що перешли в [accent] режим деконструкції блоків[].\n\nЩоб почати руйнувати, просто торкніться блоку поруч із вашим кораблем.\nПісля вибору деяких блоків натисніть прапорець, щоб підтвердити, і ваш корабель почне їх деконструювати.\n\n- [accent]Вилучіть блоки[] з вашого вибору, торкнувшись їх.\n- [accent]Вилучіть блоки в зоні[] , торкнувшись і утримуючи порожнє місце, потім перетягніть у потрібному напрямку.\n- [accent]Скасуйте деконструкцію або виділення[] натиснувши X внизу ліворуч. +text.deconstruction = Ви тільки що перешли в [accent] режим деконструкції блоків[].\n\nЩоб почати руйнувати, просто торкніться блоку поруч із вашим кораблем.\nПісля вибору деяких блоків натисніть прапорець, щоб підтвердити, і ваш корабель почне їх деконструювати.\n\n- [accent]Вилучіть блоки[] з вашого вибору, торкнувшись їх.\n- [accent]Вилучіть блоки в зоні[] , торкнувшись і утримуючи порожнє місце, потім перетягніть у потрібному напрямку.\n- [accent]Скасуйте деконструкцію або виділення[] натиснувши X внизу праворуч. text.showagain = Не показувати знову до наступного сеансу text.coreattack = < Ядро під атакою! > text.unlocks = Розблоковане text.savegame = Зберегти гру text.loadgame = Завантажити гру -text.joingame = Приєднатися +text.joingame = Мережева гра text.addplayers = Дод/Видалити гравців text.customgame = Користувальницька гра text.sectors = Сектори @@ -39,7 +40,7 @@ text.sector = Обраний сектор: [LIGHT_GRAY]{0} text.sector.time = Час: [LIGHT_GRAY]{0} text.sector.deploy = Висадитися text.sector.abandon = Відступити -text.sector.abandon.confirm = Ви впевнені, що хочете відступити?\nЦе не може бути скасовано! +text.sector.abandon.confirm = Ви впевнені, що хочете відступити?\nПрогрес в секторі не можна відновити! text.sector.resume = Продовжити text.sector.locked = [scarlet][[Незавершений] text.sector.unexplored = [accent][[Недосліджений] @@ -72,6 +73,7 @@ text.nextmission = Наступна місія text.maps.none = [LIGHT_GRAY]Карт не знайдено! text.about.button = Про гру text.name = Нік: +text.noname = Спочатку придумайте[accent] собі нікнейм[]. text.filename = Ім'я файлу: text.unlocked = Новий блок розблоковано! text.unlocked.plural = Нові блоки розблоковано! @@ -84,12 +86,14 @@ text.server.kicked.sectorComplete = Сектор завойовано. text.server.kicked.sectorComplete.text = Ваша місія завершена. \nСервер продовжить роботу і висадить Вас в наступному секторі. text.server.kicked.clientOutdated = Застарілий клієнт! Оновіть свою гру! text.server.kicked.serverOutdated = Застарілий сервер! Попросіть адміністратора серверу оновити сервер/гру! +text.server.kicked.commitMismatch = Номер збірки серверу не співпадає з номером вашої збірки клієнта. Скачайте підходящу версію. text.server.kicked.banned = Ви були заблоковані на цьому сервері. text.server.kicked.recentKick = Нещодавно Вас вигнали(кікнули). \nПочекайте трохи перед наступним підключенням. text.server.kicked.nameInUse = На цьому сервері є хтось \nз таким ніком. text.server.kicked.nameEmpty = Ваш нікнейм має містити принаймні один символ або цифру. text.server.kicked.idInUse = Ви вже на цьому сервері! Підключення двох облікових записів не допускається. text.server.kicked.customClient = Цей сервер не підтримує користувальницькі збірки. Завантажте офіційну версію. +text.server.kicked.gameover = Гра завершена! text.host.info = Кнопка [accent]Сервер[] розміщує сервер на порті [scarlet]6567[]. \nКористувачі, які знаходяться у тій же [LIGHT_GRAY] WiFi або локальній мережі[] повинні бачити ваш сервер у своєму списку серверів.\n\nЯкщо ви хочете, щоб люди могли приєднуватися з будь-якої точки через IP, то [accent] переадресація порту [] обов'язкова.\n\n[LIGHT_GRAY] Примітка. Якщо у вас виникли проблеми з підключенням до вашої локальної гри, переконайтеся, що ви дозволили Mindustry доступ до вашої локальної мережі в налаштуваннях брандмауера. text.join.info = Тут ви можете ввести [accent]IP серверу[] для підключення або знайти сервери у [accent]локальній мережі[] для підключення до них.\nПідтримується локальна мережа(LAN) і широкосмугова мережа(WAN).\n\n[LIGHT_GRAY] Примітка. Тут немає автоматичного глобального списку серверів; якщо ви хочете підключитися до когось через IP, вам доведеться попросити створювача серверу дати свій ip. text.hostserver = Запустити сервер @@ -182,7 +186,7 @@ text.quit.confirm = Ви впевнені що хочете вийти? text.changelog.title = Журнал змін text.changelog.loading = Отримання журналу змін... text.changelog.error.android = [accent]Зверніть увагу, що іноді журнал змін не працює на ОС Android 4.4 або на нижчій версії!\nЦе пов'язано з внутрішньою помилкою Android. -text.changelog.error.ios = [accent]В настоящее время журнал изменений не поддерживается iOS. +text.changelog.error.ios = [accent]Журнал змін наразі не підтримується iOS. text.changelog.error = [scarlet]Помилка отримання журналу змін!\nПеревірте підключення до Інтернету. text.changelog.current = [yellow][[Поточна версія] text.changelog.latest = [accent][[Остання версія] @@ -264,8 +268,10 @@ text.connectfail = [crimson]Не вдалося підключитися до с text.error.unreachable = Сервер не доступний. text.error.invalidaddress = Некоректна адреса. text.error.timedout = Час очікувування вийшов.\nПереконайтеся, що адреса коректна і що власник сервера налаштував переадресацію порту! -text.error.mismatch = Ошибка пакету:\nможливе невідповідність версії клієнта / сервера.\nПереконайтеся, що у Вас та у володара сервера встановлена остання версія Mindustry! +text.error.mismatch = Помилка пакету:\nможливе невідповідність версії клієнта / сервера.\nПереконайтеся, що у Вас та у володара сервера встановлена остання версія Mindustry! text.error.alreadyconnected = Ви вже підключилися. +text.error.mapnotfound = Файл мапи не знайдено +text.error.io = Мережева помилка введення-виведення text.error.any = Невідома мережева помилка text.settings.language = Мова text.settings.reset = Скинути за замовчуванням @@ -290,7 +296,7 @@ text.blocks.unknown = [LIGHT_GRAY]??? text.blocks.blockinfo = Інформація про блок text.blocks.powercapacity = Місткість енергії text.blocks.powershot = Енергія/постріл -text.blocks.targetsair = Атакуе повітряних ворогів? +text.blocks.targetsair = Атакуе повітряних ворогів text.blocks.itemspeed = Швидкість переміщення ресурсів text.blocks.shootrange = Діапазон дії text.blocks.size = Розмір @@ -346,6 +352,7 @@ text.category.items = Предмети text.category.crafting = Створення text.category.shooting = Стрільба text.category.optional = Додаткові поліпшення +setting.indicators.name = Показувати у сторону союзників setting.autotarget.name = Авто-ціль setting.fpscap.name = Макс. FPS setting.fpscap.none = Необмежений @@ -374,12 +381,15 @@ setting.crashreport.name = Надіслати анонімні звіти про text.keybind.title = Налаштування управління category.general.name = Основне category.view.name = Перегляд -category.multiplayer.name = Мультиплеєр +category.multiplayer.name = Мережева гра command.attack = Атакувати command.retreat = Відступити command.patrol = Патрулювати +keybind.gridMode.name = Вибрати блок +keybind.gridModeShift.name = Вибрати категорію keybind.press = Натисніть клавішу... keybind.press.axis = Натисніть клавішу... +keybind.screenshot.name = Скріншот мапи keybind.move_x.name = Рух по осі x keybind.move_y.name = Рух по осі x keybind.select.name = ВибратиПостріл @@ -410,6 +420,8 @@ mode.freebuild.name = Вільне\nбудівництво mode.freebuild.description = В режимі "Пісочниця" треба самим добувати ресурси та хвилі йдуть за вашим бажанням. mode.pvp.name = PVP mode.pvp.description = боріться проти інших гравців. +mode.attack.name = Атака +mode.attack.descrption = Немає хвиль, мета - знищити базу противника. content.item.name = Предмети content.liquid.name = Рідини content.unit.name = Бойові одиниці @@ -424,18 +436,18 @@ item.lead.description = Базовий стартовий матеріал. Ши item.coal.name = Вугілля item.coal.description = Загальне та легкодоступне паливо. item.dense-alloy.name = Щільний сплав -item.dense-alloy.description = Жорсткий сплав вироблений зі свинця та міді. Використовується в передових транспортних блоках та високорівневих свердлах. +item.dense-alloy.description = Сплав, котрий вироблений зі свинця та міді. Використовується в передових транспортних блоках та високорівневих свердлах. item.titanium.name = Титан item.titanium.description = Рідкий суперлегкий метал широко використовується в рідкому транспорті, свердлах та літальних апаратах. item.thorium.name = Торій item.thorium.description = Густий, радіоактивний метал, що використовується як структурна підтримка та ядерне паливо. -item.silicon.name = Кремень +item.silicon.name = Кремній item.silicon.description = Надзвичайно корисний напівпровідник з застосуванням в сонячних батареях та складній електроніці. item.plastanium.name = Пластиній item.plastanium.description = Легкий, пластичний матеріал, що використовується в сучасних літальних апаратах та у боєприпасах для фрагментації. item.phase-fabric.name = Фазова тканина -item.phase-fabric.description = Невагоме речовина, що використовується в сучасній електроніці і технології самовідновлення. -item.surge-alloy.name = Високоміцний сплав +item.phase-fabric.description = Невагоме речовина, що використовується в сучасній електроніці і технології самовідновлення. Не для вишивання. +item.surge-alloy.name = Кінетичний сплав item.surge-alloy.description = Передовий сплав з унікальними електричними властивостями. item.biomatter.name = Біоматерія item.biomatter.description = Скупчення органічної муси; використовується для перетворення в нафту або як паливо. @@ -450,7 +462,7 @@ liquid.lava.name = Лава liquid.oil.name = Нафта liquid.cryofluid.name = Кріогенна рідина mech.alpha-mech.name = Альфа -mech.alpha-mech.weapon = Звичайний кулемет +mech.alpha-mech.weapon = Тяжкий кулемет mech.alpha-mech.ability = Виклик дронів mech.alpha-mech.description = Стандартний мех для настільних пристроїв. Має пристойну швидкість і урон; може створити до 3-х дронів для збільшення можливості перемоги. mech.delta-mech.name = Дельта @@ -460,10 +472,10 @@ mech.delta-mech.description = Швидкий, легкоброньований mech.tau-mech.name = Тау mech.tau-mech.weapon = Відновлювальний лазер mech.tau-mech.ability = Відновлювальний спалах -mech.tau-mech.description = Мех підтримки. Зцілює союзницькі блоки, стріляючи в них. Може зцілити союзників у радіусі зі своєю здатністю для ремонту. +mech.tau-mech.description = Мех підтримки. Лагодить союзницькі блоки, стріляючи в них. Може зцілити союзників у радіусі зі своєю здатністю для ремонту. mech.omega-mech.name = Омега -mech.omega-mech.weapon = Купа ракет -mech.omega-mech.ability = Захисна конфігурація +mech.omega-mech.weapon = Ракометний пулемет +mech.omega-mech.ability = Поглинання урона mech.omega-mech.description = Громіздкий і добре броньований мех, зроблений для фронтових нападів. Його здатність може блокувати до 90% вхідного урона. mech.dart-ship.name = Дротик mech.dart-ship.weapon = Ретранслятор @@ -474,7 +486,7 @@ mech.javelin-ship.weapon = Вибухові ракети mech.javelin-ship.ability = Генератор дуг mech.trident-ship.name = Тризубець mech.trident-ship.description = Важкий бомбардувальник. Досить добре броньований. -mech.trident-ship.weapon = Вантажний відсік з бомбами +mech.trident-ship.weapon = Бомби mech.glaive-ship.name = Спис mech.glaive-ship.description = Великий, добре броньований бойовий корабель. Оснащений запальним ретранслятором. Гарне прискорення і максимальна швидкість. mech.glaive-ship.weapon = Вогняний кулемет @@ -493,11 +505,11 @@ text.mech.ability = [LIGHT_GRAY]Здібність: {0} text.liquid.heatcapacity = [LIGHT_GRAY]Теплоємність: {0} text.liquid.viscosity = [LIGHT_GRAY]В'язкість: {0} text.liquid.temperature = [LIGHT_GRAY]Температура: {0} -block.constructing = {0}[LIGHT_GRAY](В процесі) +block.constructing = {0}\n[LIGHT_GRAY](В процесі) block.spawn.name = Місце появи ворога block.core.name = Ядро block.space.name = Пустота -block.metalfloor.name = Металічна підлога +block.metalfloor.name = Металева плитка block.deepwater.name = Глибоководдя block.water.name = Вода block.lava.name = Лава @@ -591,10 +603,10 @@ block.oil-extractor.name = Екстрактор нафти block.spirit-factory.name = Завод дронов "Призрак" block.phantom-factory.name = Завод дронов "Фантом" block.wraith-factory.name = Завод винищувачів "Примара" -block.ghoul-factory.name = Завод бомбардувальників "Ґуль" -block.dagger-factory.name = Завод мехов "Разведчик" -block.titan-factory.name = Завод мехов "Титан" -block.fortress-factory.name = Завод мехов "Крепость" +block.ghoul-factory.name = Завод бомбардувальників-винищувачів "Ґуль" +block.dagger-factory.name = Завод мехів "Кинджал" +block.titan-factory.name = Завод мехів "Титан" +block.fortress-factory.name = Завод мехів "Крепость" block.revenant-factory.name = Завод бомбардировщиков "Потусторонний убийца" block.repair-point.name = Ремонтний пункт block.pulse-conduit.name = Імпульсний водовід @@ -635,7 +647,7 @@ unit.spirit.name = Дрон-привид unit.spirit.description = Початковий дрон. З'являється в ядрі за замовчуванням. Автоматично добуває руди та ремонтує блоки. unit.phantom.name = Фантом unit.phantom.description = Покращений дрон. Автоматично добуває руди та ремонтує блоки. -unit.dagger.name = Розвідник +unit.dagger.name = Кинджал unit.dagger.description = Базова наземна бойова одиниця. Корисен у купі. unit.titan.name = Титан unit.titan.description = Улучшенная бронированная наземная боевая единица. Атакует наземные и воздушные цели. @@ -646,7 +658,7 @@ unit.wraith.description = Швидка бойова одиниця, котрий unit.fortress.name = Фортеця unit.fortress.description = Тяжка артилерійна наземна бойова одиниця. unit.revenant.name = Потойбічний вбивця -unit.revenant.description = Бойова одиниця з важкою лазерною зброєю. +unit.revenant.description = Важка бойова одиниця з лазерною зброєю. tutorial.begin = Ваша місія тут полягає в ліквідації[LIGHT_GRAY] противника[].\n\nПочнімо з[accent] видобутку міді[]. Щоб зробити це, торкніться мідної рудної жили біля вашого ядра. tutorial.drill = Ручна робота не ефективна\n[accent]Бури []можуть копати автоматично.\nПоставте один на мідній жилі. tutorial.conveyor = [accent]Конвейери[] використовуються для транспортування предметів в ядра.\nЗробіть лінію конвейерів від бурів до ядра. @@ -662,9 +674,9 @@ tutorial.silicondrill = Кремній потребує[accent] вугілляl[ tutorial.generator = Ця технологія потребує енергії.\nЗробіть[accent] генератор внутрішнього згорання[] для цього. tutorial.generatordrill = Генератор потребує вугілля.\nПобудуйте бур на вугільній жилі. tutorial.node = Енергії потребує транспортування\nСоздайте[accent] силовий вузол[] поруч з вашим генератором згорання, щоб передавати його енергію. -tutorial.nodelink = Енергія може бути передана через контактні енергетичні блоки та генератори, або з'єднані силові вузли.\n\nЗ'єднайте живлення, торкнувшись вузла та вибравши генератор і кремнієвий завод. +tutorial.nodelink = Енергія може бути передана через контактні енергетичні блоки та генератори, або з'єднані силові вузли.\n\nЗ'єднайте їх, торкнувшись вузла та вибравши генератор і кремнієвий завод. tutorial.silicon = Кремній почався створюватися. Отримайте трохи.\n\nРекомендується вдосконалити виробничу систему. -tutorial.daggerfactory = Побудуйте[accent] завод "Розвідник".[]\n\nЦе буде використано для створення мехів атаки. +tutorial.daggerfactory = Побудуйте[accent] завод "Кинджал".[]\n\nЦе буде використано для створення мехів атаки. tutorial.router = Фабрики потребують ресурсів для функціонування.\nСтворіть маршрутизатор для розподілення ресурсів з конвейера. tutorial.dagger = Зв'яжіть силовий вузол з заводом.\nЯк тільки вимоги будуть виконані, буде створено мех.\n\nЯкщо необхідно, то створіть ще бурів, генераторів та конвейерів tutorial.battle = [LIGHT_GRAY] Супротивник[] показав своє ядро.\nЗнищьте його з вашим мехом та бойовою одиницею. @@ -703,11 +715,11 @@ block.phase-conveyor.description = Поки гра знаходиться в 2D, block.junction.description = Назва говорить сама за себе. За допомогою нього можна зробити дві конвеєрні стрічки, які проходять через один одного і не змішуються. block.mass-driver.description = При наявності енергії передають ресурси на відстань 100 блоків, стріляючи в один-одного. block.smelter.description = Виробляє щільний сплав з міді і свинцю. Можна підвести пісок для прискорення виробництва. -block.arc-smelter.description = Покращена версія плавильного заводу. Вимагає енергію. Виробляє щільний сплав зміді і свинця.\nМожно підвести пісок для прискорення виробництва. +block.arc-smelter.description = Покращена версія плавильного заводу. Вимагає енергію. Виробляє щільний сплав з міді і свинця.\nМожно підвести пісок для прискорення виробництва. block.silicon-smelter.description = За допомогою піску, вугілля і енергії виробляє кремній. block.plastanium-compressor.description = Створює пластинійи з титану і нафти. Вимагає енергії. Для прискорення виробництва можна додати в компресор пісок. block.phase-weaver.description = Виробляє фазову тканину торію і піску. Вимагає багато енергії. -block.alloy-smelter.description = Створює високоміцний сплав з титану, кременя, міді і свинця. Вимагає енергію. +block.alloy-smelter.description = Створює кінетичний сплав з титану, кременя, міді і свинця. Вимагає енергію. block.pulverizer.description = Подрібнює камінь в пісок. Вимагає енергії. block.pyratite-mixer.description = Створює піротит з вугілля, свинцю і піску. Вимагає енергії. block.blast-mixer.description = Створює вибухонебезпечне з'єднання з нафти і піротіта. Для прискорення виробництва можна додати в мішалку пісок. @@ -770,12 +782,12 @@ block.router.description = Приймає елементи з одного на block.distributor.description = Розширений маршрутизатор, який рівномірно розбиває елементи на 7 різних напрямків. block.bridge-conveyor.description = Покращений блок транспортування предметів. Дозволяє транспортувати предмети понад 3 блоки над будь-якої місцевостю або будівлеє. block.alpha-mech-pad.description = Коли ви отримаєте достатньо енергії, перебудовує ваш корабель у [accent] Альфа[] мех. -block.itemsource.description = Безліченно виводить предмети. Лише пісочниця. -block.liquidsource.description = Безліченно виводить рідини. Лише пісочниця. -block.itemvoid.description = Знищує будь-які предмети, які входять, без використання енергії. Працює тільки в пісочниці. -block.powerinfinite.description = Нескінченність не межа. Безмежно виводить енергію. Лише пісочниця. -block.powervoid.description = Енергія просто йде в порожнечу. Лише пісочниця. -liquid.water.description = Зазвичай використовується для охолодження машин та переробки відходів. -liquid.lava.description = Можна перетворити в[LIGHT_GRAY] камінь[], який використовується для генерації енергії або використовуати як боєприпаси для певних турелей. -liquid.oil.description = Можна спалити, взірвати або використовувати як теплоносій. -liquid.cryofluid.description = Найефективніша рідина для охолодження. Рідина з температурою нижче ніж -273 градусів за Цельсієм. Може бути використана для прискорення стрільби турелей або для охолодження чогось. +block.itemsource.description = Безліченно виводить предмети. +block.liquidsource.description = Безліченно виводить рідини. +block.itemvoid.description = Знищує будь-які предмети, які входять, без використання енергії. +block.powerinfinite.description = Нескінченність не межа. Безмежно виводить енергію. +block.powervoid.description = Енергія просто йде в порожнечу. +liquid.water.description = Цю рідину можно підвести до бурів для прискорення швидкості видобутку або к турелям для прискорення стрілянини. +liquid.lava.description = Можна перетворити в[LIGHT_GRAY] камінь[]. +liquid.oil.description = Можна спалити, взірвати або використовувати для охолодження. +liquid.cryofluid.description = Рідина з температурою нижче ніж -273 градусів за Цельсієм. Може бути використана для прискорення стрільби турелей або для охолодження чогось. diff --git a/core/assets/bundles/bundle_zh_TW.properties b/core/assets/bundles/bundle_zh_TW.properties index 7800279a14..d7f8aaf123 100644 --- a/core/assets/bundles/bundle_zh_TW.properties +++ b/core/assets/bundles/bundle_zh_TW.properties @@ -384,6 +384,8 @@ category.multiplayer.name = 多人 command.attack = 攻擊 command.retreat = 撤退 command.patrol = 巡邏 +keybind.gridMode.name = 方塊選取 +keybind.gridModeShift.name = 類別選取 keybind.press = 按一下鍵…… keybind.press.axis = 按一下軸心或鍵…… keybind.screenshot.name = 地圖截圖 diff --git a/core/assets/cursors/ibar.png b/core/assets/cursors/ibeam.png similarity index 100% rename from core/assets/cursors/ibar.png rename to core/assets/cursors/ibeam.png diff --git a/core/assets/shaders/blockbuild.fragment b/core/assets/shaders/blockbuild.fragment index f79b58b3c0..e683997ba4 100644 --- a/core/assets/shaders/blockbuild.fragment +++ b/core/assets/shaders/blockbuild.fragment @@ -29,10 +29,6 @@ bool cont(vec2 T, vec2 v){ id(T + vec2(step, 0) * v, base) || id(T + vec2(-step, 0) * v, base)); } -float rand(vec2 co){ - return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); -} - void main() { vec2 t = v_texCoord.xy; @@ -51,11 +47,11 @@ void main() { chance = 1.0-(u_progress-0.8)*5.0; } - if((mod(u_time / 1.5 + value, 20.0) < 5.0 && cont(t, v)) && rand(coords) < chance){ + if((mod(u_time / 1.5 + value, 20.0) < 5.0 && cont(t, v))){ gl_FragColor = u_color; }else if(dst > (1.0-u_progress) * (center.x)){ gl_FragColor = color; - }else if((dst + 1.0 > (1.0-u_progress) * (center.x)) && color.a > 0.1 && rand(coords) < chance){ + }else if((dst + 1.0 > (1.0-u_progress) * (center.x)) && color.a > 0.1){ gl_FragColor = u_color; }else{ gl_FragColor = vec4(0.0); diff --git a/core/assets/shaders/build.fragment b/core/assets/shaders/build.fragment index 1762a407be..a5bd5c05f1 100644 --- a/core/assets/shaders/build.fragment +++ b/core/assets/shaders/build.fragment @@ -29,18 +29,11 @@ void main() { vec4 c = texture2D(u_texture, v_texCoord.xy); - vec2 v = vec2(1.0/u_texsize.x, 1.0/u_texsize.y); - float step = 1.0; - - bool outline = texture2D(u_texture, t).a < 0.1 && - (id(texture2D(u_texture, t + vec2(0, step) * v)) || id(texture2D(u_texture, t + vec2(0, -step) * v)) || - id(texture2D(u_texture, t + vec2(step, 0) * v)) || id(texture2D(u_texture, t + vec2(-step, 0) * v))); - if(1.0-abs(coords.x - 0.5)*2.0 < 1.0-u_progress){ c = vec4(0.0); } - if(c.a > 0.01 || outline){ + if(c.a > 0.01){ float f = abs(sin(coords.x*2.0 + u_time)); if(f > 0.9 ) f = 1.0; diff --git a/core/assets/shaders/menu.fragment b/core/assets/shaders/menu.fragment index 397cf6dbc9..1d793559ca 100644 --- a/core/assets/shaders/menu.fragment +++ b/core/assets/shaders/menu.fragment @@ -7,6 +7,7 @@ precision mediump int; #define p2 vec3(234.0,182.0,120.0)/255.0 #define p3 vec3(212.0,129.0,107.0)/255.0 #define p4 vec3(142.0,77.0,72.0)/255.0 +#define roundm 0.2 uniform sampler2D u_texture; uniform vec2 u_resolution; @@ -21,12 +22,11 @@ varying vec2 v_texCoord; void main() { ivec2 coords = ivec2((gl_FragCoord.xy - u_resolution/2.0)/u_scl); - int roundx = 8; - int roundy = roundx; - float roundm = 0.2; + //int roundx = 8; + //int roundy = roundx; - coords.x = (coords.x / roundx) * roundx; - coords.y = (coords.y / roundy) * roundy; + //coords.x = (coords.x / roundx) * roundx; + //coords.y = (coords.y / roundy) * roundy; float d = (abs(float(coords.x)) - abs(float(coords.y))); diff --git a/core/assets/shaders/outline.fragment b/core/assets/shaders/outline.fragment index 46f6f6872d..1e3870d953 100644 --- a/core/assets/shaders/outline.fragment +++ b/core/assets/shaders/outline.fragment @@ -3,12 +3,13 @@ precision mediump float; precision mediump int; #endif -#define SPACE 1.0 +#define SPACE 2.0 uniform sampler2D u_texture; uniform vec4 u_color; uniform vec2 u_texsize; +uniform float u_scl; varying vec4 v_color; varying vec2 v_texCoord; @@ -17,11 +18,27 @@ void main() { vec2 v = vec2(1.0/u_texsize.x, 1.0/u_texsize.y); vec4 c = texture2D(u_texture, v_texCoord.xy); + float spacing = SPACE * u_scl; gl_FragColor = mix(c * v_color, u_color, (1.0-step(0.1, texture2D(u_texture, v_texCoord.xy).a)) * - step(0.1, texture2D(u_texture, v_texCoord.xy + vec2(0, SPACE) * v).a + - texture2D(u_texture, v_texCoord.xy + vec2(0, -SPACE) * v).a + - texture2D(u_texture, v_texCoord.xy + vec2(SPACE, 0) * v).a + - texture2D(u_texture, v_texCoord.xy + vec2(-SPACE, 0) * v).a)); + step(0.1, + //cardinals + texture2D(u_texture, v_texCoord.xy + vec2(0, spacing) * v).a + + texture2D(u_texture, v_texCoord.xy + vec2(0, -spacing) * v).a + + texture2D(u_texture, v_texCoord.xy + vec2(spacing, 0) * v).a + + texture2D(u_texture, v_texCoord.xy + vec2(-spacing, 0) * v).a + + + //cardinal edges + texture2D(u_texture, v_texCoord.xy + vec2(spacing, spacing) * v).a + + texture2D(u_texture, v_texCoord.xy + vec2(spacing, -spacing) * v).a + + texture2D(u_texture, v_texCoord.xy + vec2(-spacing, spacing) * v).a + + texture2D(u_texture, v_texCoord.xy + vec2(-spacing, -spacing) * v).a + + + //cardinals * 2 + texture2D(u_texture, v_texCoord.xy + vec2(0, spacing) * v*2.0).a + + texture2D(u_texture, v_texCoord.xy + vec2(0, -spacing) * v*2.0).a + + texture2D(u_texture, v_texCoord.xy + vec2(spacing, 0) * v*2.0).a + + texture2D(u_texture, v_texCoord.xy + vec2(-spacing, 0) * v*2.0).a + )); } diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 9a52df3e11..d5145aeba9 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -1,5283 +1,5192 @@ sprites.png -size: 1024,512 +size: 2048,2048 format: RGBA8888 filter: Nearest,Nearest repeat: none force-projector-top rotate: false - xy: 392, 312 - size: 24, 24 - orig: 24, 24 + xy: 359, 949 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 mend-projector-top rotate: false - xy: 530, 378 - size: 16, 16 - orig: 16, 16 + xy: 719, 1587 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 overdrive-projector-top rotate: false - xy: 512, 342 - size: 16, 16 - orig: 16, 16 + xy: 785, 1653 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +bridge-conveyor + rotate: false + xy: 869, 999 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 bridge-conveyor-bridge rotate: false - xy: 84, 108 - size: 8, 8 - orig: 8, 8 + xy: 869, 965 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 bridge-conveyor-end rotate: false - xy: 124, 138 - size: 8, 8 - orig: 8, 8 + xy: 879, 931 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-0-1 rotate: false - xy: 124, 98 - size: 8, 8 - orig: 8, 8 + xy: 1273, 1660 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-0-2 rotate: false - xy: 174, 138 - size: 8, 8 - orig: 8, 8 + xy: 739, 850 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-0-3 rotate: false - xy: 164, 128 - size: 8, 8 - orig: 8, 8 + xy: 1041, 1487 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-1-0 rotate: false - xy: 154, 118 - size: 8, 8 - orig: 8, 8 + xy: 1041, 1453 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-1-1 rotate: false - xy: 144, 108 - size: 8, 8 - orig: 8, 8 + xy: 1075, 1495 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-1-2 rotate: false - xy: 134, 98 - size: 8, 8 - orig: 8, 8 + xy: 1075, 1461 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-1-3 rotate: false - xy: 184, 138 - size: 8, 8 - orig: 8, 8 + xy: 1115, 1561 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-2-0 rotate: false - xy: 174, 128 - size: 8, 8 - orig: 8, 8 + xy: 1149, 1561 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-2-1 rotate: false - xy: 164, 118 - size: 8, 8 - orig: 8, 8 + xy: 1980, 1949 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-2-2 rotate: false - xy: 154, 108 - size: 8, 8 - orig: 8, 8 + xy: 1980, 1915 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-2-3 rotate: false - xy: 144, 98 - size: 8, 8 - orig: 8, 8 + xy: 1980, 1881 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-3-0 rotate: false - xy: 184, 128 - size: 8, 8 - orig: 8, 8 + xy: 2014, 1957 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-3-1 rotate: false - xy: 174, 118 - size: 8, 8 - orig: 8, 8 + xy: 2014, 1923 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-3-2 rotate: false - xy: 164, 108 - size: 8, 8 - orig: 8, 8 + xy: 2014, 1889 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-3-3 rotate: false - xy: 154, 98 - size: 8, 8 - orig: 8, 8 + xy: 913, 1321 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-4-0 rotate: false - xy: 184, 118 - size: 8, 8 - orig: 8, 8 + xy: 913, 1287 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-4-1 rotate: false - xy: 174, 108 - size: 8, 8 - orig: 8, 8 + xy: 913, 1253 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-4-2 rotate: false - xy: 164, 98 - size: 8, 8 - orig: 8, 8 + xy: 913, 1219 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-4-3 rotate: false - xy: 184, 108 - size: 8, 8 - orig: 8, 8 + xy: 913, 1185 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-0-1 rotate: false - xy: 93, 39 - size: 8, 8 - orig: 8, 8 + xy: 829, 788 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-0-2 rotate: false - xy: 103, 38 - size: 8, 8 - orig: 8, 8 + xy: 795, 720 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-0-3 rotate: false - xy: 113, 38 - size: 8, 8 - orig: 8, 8 + xy: 829, 754 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-1-0 rotate: false - xy: 123, 38 - size: 8, 8 - orig: 8, 8 + xy: 795, 686 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-1-1 rotate: false - xy: 133, 38 - size: 8, 8 - orig: 8, 8 + xy: 829, 720 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-1-2 rotate: false - xy: 143, 38 - size: 8, 8 - orig: 8, 8 + xy: 795, 652 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-1-3 rotate: false - xy: 153, 38 - size: 8, 8 - orig: 8, 8 + xy: 829, 686 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-2-0 rotate: false - xy: 163, 38 - size: 8, 8 - orig: 8, 8 + xy: 795, 618 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-2-1 rotate: false - xy: 173, 38 - size: 8, 8 - orig: 8, 8 + xy: 829, 652 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-2-2 rotate: false - xy: 183, 38 - size: 8, 8 - orig: 8, 8 + xy: 795, 584 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-2-3 rotate: false - xy: 91, 29 - size: 8, 8 - orig: 8, 8 + xy: 829, 618 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-3-0 rotate: false - xy: 91, 19 - size: 8, 8 - orig: 8, 8 + xy: 795, 550 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-3-1 rotate: false - xy: 91, 9 - size: 8, 8 - orig: 8, 8 + xy: 829, 584 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-3-2 rotate: false - xy: 101, 28 - size: 8, 8 - orig: 8, 8 + xy: 795, 516 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-3-3 rotate: false - xy: 101, 18 - size: 8, 8 - orig: 8, 8 + xy: 829, 550 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-4-0 rotate: false - xy: 111, 28 - size: 8, 8 - orig: 8, 8 + xy: 795, 482 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-4-1 rotate: false - xy: 111, 18 - size: 8, 8 - orig: 8, 8 + xy: 829, 516 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-4-2 rotate: false - xy: 121, 28 - size: 8, 8 - orig: 8, 8 + xy: 829, 482 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-4-3 rotate: false - xy: 121, 18 - size: 8, 8 - orig: 8, 8 + xy: 863, 788 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +junction + rotate: false + xy: 1049, 853 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 mass-driver-turret rotate: false - xy: 778, 427 - size: 24, 24 - orig: 24, 24 + xy: 359, 655 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 phase-conveyor-arrow rotate: false - xy: 457, 220 - size: 8, 8 - orig: 8, 8 + xy: 637, 286 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 phase-conveyor-bridge rotate: false - xy: 467, 240 - size: 8, 8 - orig: 8, 8 + xy: 637, 252 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 phase-conveyor-end rotate: false - xy: 467, 230 - size: 8, 8 - orig: 8, 8 + xy: 637, 218 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 warp-gate rotate: false - xy: 934, 427 - size: 24, 24 - orig: 24, 24 + xy: 555, 1439 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 warp-gate-top rotate: false - xy: 960, 453 - size: 24, 24 - orig: 24, 24 + xy: 555, 1341 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 blast-drill rotate: false - xy: 39, 17 - size: 24, 24 - orig: 24, 24 + xy: 131, 148 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 blast-drill-rim rotate: false - xy: 622, 458 - size: 24, 24 - orig: 24, 24 + xy: 131, 50 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 blast-drill-rotator rotate: false - xy: 648, 461 - size: 24, 24 - orig: 24, 24 + xy: 261, 1733 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 blast-drill-top rotate: false - xy: 288, 372 - size: 24, 24 - orig: 24, 24 + xy: 261, 1635 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 laser-drill rotate: false - xy: 531, 252 - size: 16, 16 - orig: 16, 16 + xy: 785, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 laser-drill-rotator rotate: false - xy: 512, 396 - size: 16, 16 - orig: 16, 16 + xy: 653, 1587 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 laser-drill-top rotate: false - xy: 512, 378 - size: 16, 16 - orig: 16, 16 + xy: 719, 1653 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 mechanical-drill rotate: false - xy: 530, 396 - size: 16, 16 - orig: 16, 16 + xy: 785, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 mechanical-drill-rotator rotate: false - xy: 512, 360 - size: 16, 16 - orig: 16, 16 + xy: 851, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 mechanical-drill-top rotate: false - xy: 548, 396 - size: 16, 16 - orig: 16, 16 + xy: 653, 1521 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 oil-extractor rotate: false - xy: 804, 453 - size: 24, 24 - orig: 24, 24 + xy: 457, 753 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 oil-extractor-liquid rotate: false - xy: 804, 427 - size: 24, 24 - orig: 24, 24 + xy: 261, 459 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 oil-extractor-rotator rotate: false - xy: 830, 453 - size: 24, 24 - orig: 24, 24 + xy: 359, 557 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 oil-extractor-top rotate: false - xy: 830, 427 - size: 24, 24 - orig: 24, 24 + xy: 457, 655 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 plasma-drill rotate: false - xy: 269, 398 - size: 32, 32 - orig: 32, 32 + xy: 131, 1368 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 plasma-drill-rim rotate: false - xy: 303, 435 - size: 32, 32 - orig: 32, 32 + xy: 131, 1238 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 plasma-drill-rotator rotate: false - xy: 303, 401 - size: 32, 32 - orig: 32, 32 + xy: 131, 1108 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 plasma-drill-top rotate: false - xy: 254, 364 - size: 32, 32 - orig: 32, 32 + xy: 131, 978 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 pneumatic-drill rotate: false - xy: 566, 378 - size: 16, 16 - orig: 16, 16 + xy: 917, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 pneumatic-drill-rotator rotate: false - xy: 548, 360 - size: 16, 16 - orig: 16, 16 + xy: 983, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 pneumatic-drill-top rotate: false - xy: 602, 396 - size: 16, 16 - orig: 16, 16 + xy: 653, 1389 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 water-extractor rotate: false - xy: 554, 270 - size: 16, 16 - orig: 16, 16 + xy: 1115, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 water-extractor-liquid rotate: false - xy: 549, 252 - size: 16, 16 - orig: 16, 16 + xy: 1181, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 water-extractor-rotator rotate: false - xy: 584, 324 - size: 16, 16 - orig: 16, 16 + xy: 851, 1389 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 water-extractor-top rotate: false - xy: 582, 306 - size: 16, 16 - orig: 16, 16 + xy: 917, 1455 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 blackrock1 rotate: false - xy: 672, 353 - size: 8, 8 - orig: 8, 8 + xy: 879, 1237 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-blackrock rotate: false - xy: 672, 353 - size: 8, 8 - orig: 8, 8 + xy: 879, 1237 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 blackrockshadow1 rotate: false - xy: 684, 365 - size: 8, 8 - orig: 8, 8 + xy: 879, 1203 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 blackstone1 rotate: false - xy: 708, 389 - size: 8, 8 - orig: 8, 8 + xy: 879, 1169 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-blackstone rotate: false - xy: 708, 389 - size: 8, 8 - orig: 8, 8 + xy: 879, 1169 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 blackstone2 rotate: false - xy: 672, 343 - size: 8, 8 - orig: 8, 8 + xy: 879, 1135 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 blackstone3 rotate: false - xy: 1012, 437 - size: 8, 8 - orig: 8, 8 + xy: 129, 16 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 blackstoneedge rotate: false - xy: 288, 332 - size: 12, 12 - orig: 12, 12 + xy: 1848, 1801 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 coal1 rotate: false - xy: 114, 128 - size: 8, 8 - orig: 8, 8 + xy: 879, 897 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 coal2 rotate: false - xy: 104, 118 - size: 8, 8 - orig: 8, 8 + xy: 915, 1033 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 coal3 rotate: false - xy: 94, 108 - size: 8, 8 - orig: 8, 8 + xy: 903, 999 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 copper1 rotate: false - xy: 174, 98 - size: 8, 8 - orig: 8, 8 + xy: 913, 1151 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 copper2 rotate: false - xy: 184, 98 - size: 8, 8 - orig: 8, 8 + xy: 947, 1329 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 copper3 rotate: false - xy: 84, 88 - size: 8, 8 - orig: 8, 8 + xy: 947, 1295 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dirt2 rotate: false - xy: 154, 88 - size: 8, 8 - orig: 8, 8 + xy: 981, 1295 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dirt3 rotate: false - xy: 164, 88 - size: 8, 8 - orig: 8, 8 + xy: 981, 1261 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dirtedge rotate: false - xy: 634, 278 - size: 12, 12 - orig: 12, 12 + xy: 629, 1189 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 generic-cliff-edge rotate: false - xy: 103, 78 - size: 8, 8 - orig: 8, 8 + xy: 1998, 1817 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ice-cliff-edge rotate: false - xy: 103, 78 - size: 8, 8 - orig: 8, 8 + xy: 1998, 1817 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 generic-cliff-edge-1 rotate: false - xy: 83, 48 - size: 8, 8 - orig: 8, 8 + xy: 1998, 1783 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ice-cliff-edge-1 rotate: false - xy: 83, 48 - size: 8, 8 - orig: 8, 8 + xy: 1998, 1783 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 generic-cliff-edge-2 rotate: false - xy: 93, 59 - size: 8, 8 - orig: 8, 8 + xy: 947, 1125 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ice-cliff-edge-2 rotate: false - xy: 93, 59 - size: 8, 8 - orig: 8, 8 + xy: 947, 1125 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 generic-cliff-side rotate: false - xy: 103, 68 - size: 8, 8 - orig: 8, 8 + xy: 981, 1125 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ice-cliff-side rotate: false - xy: 103, 68 - size: 8, 8 - orig: 8, 8 + xy: 981, 1125 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 grass-cliff-edge rotate: false - xy: 103, 58 - size: 8, 8 - orig: 8, 8 + xy: 983, 1057 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 grass-cliff-edge-1 rotate: false - xy: 113, 68 - size: 8, 8 - orig: 8, 8 + xy: 1017, 1057 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 grass-cliff-edge-2 rotate: false - xy: 123, 78 - size: 8, 8 - orig: 8, 8 + xy: 1005, 1023 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 grass-cliff-side rotate: false - xy: 113, 58 - size: 8, 8 - orig: 8, 8 + xy: 1005, 989 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 grass2 rotate: false - xy: 113, 78 - size: 8, 8 - orig: 8, 8 + xy: 965, 1091 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 grass3 rotate: false - xy: 93, 49 - size: 8, 8 - orig: 8, 8 + xy: 999, 1091 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 grassedge rotate: false - xy: 585, 256 - size: 12, 12 - orig: 12, 12 + xy: 679, 1189 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 ice2 rotate: false - xy: 133, 78 - size: 8, 8 - orig: 8, 8 + xy: 1039, 989 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ice3 rotate: false - xy: 123, 58 - size: 8, 8 - orig: 8, 8 + xy: 1015, 955 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 iceedge rotate: false - xy: 620, 264 - size: 12, 12 - orig: 12, 12 + xy: 779, 1289 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 icerock2 rotate: false - xy: 133, 68 - size: 8, 8 - orig: 8, 8 + xy: 1015, 921 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 icerockshadow1 rotate: false - xy: 143, 78 - size: 8, 8 - orig: 8, 8 + xy: 1049, 955 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 rockshadow1 rotate: false - xy: 143, 78 - size: 8, 8 - orig: 8, 8 + xy: 1049, 955 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 icerockshadow2 rotate: false - xy: 133, 58 - size: 8, 8 - orig: 8, 8 + xy: 1049, 921 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 rockshadow2 rotate: false - xy: 133, 58 - size: 8, 8 - orig: 8, 8 + xy: 1049, 921 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 lavaedge rotate: false - xy: 585, 242 - size: 12, 12 - orig: 12, 12 + xy: 779, 1239 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 lead1 rotate: false - xy: 183, 48 - size: 8, 8 - orig: 8, 8 + xy: 1509, 1725 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 lead2 rotate: false - xy: 1004, 395 - size: 8, 8 - orig: 8, 8 + xy: 777, 856 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 lead3 rotate: false - xy: 1004, 385 - size: 8, 8 - orig: 8, 8 + xy: 811, 856 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor2 rotate: false - xy: 694, 365 - size: 8, 8 - orig: 8, 8 + xy: 263, 288 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor3 rotate: false - xy: 708, 379 - size: 8, 8 - orig: 8, 8 + xy: 263, 254 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor4 rotate: false - xy: 740, 379 - size: 8, 8 - orig: 8, 8 + xy: 263, 220 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor5 rotate: false - xy: 682, 353 - size: 8, 8 - orig: 8, 8 + xy: 263, 186 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor6 rotate: false - xy: 682, 343 - size: 8, 8 - orig: 8, 8 + xy: 263, 152 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalflooredge rotate: false - xy: 641, 250 - size: 12, 12 - orig: 12, 12 + xy: 729, 1139 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 rock2 rotate: false - xy: 497, 222 - size: 8, 8 - orig: 8, 8 + xy: 659, 706 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 sand2 rotate: false - xy: 517, 232 - size: 8, 8 - orig: 8, 8 + xy: 659, 638 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 sand3 rotate: false - xy: 507, 222 - size: 8, 8 - orig: 8, 8 + xy: 659, 604 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 sandedge rotate: false - xy: 599, 236 - size: 12, 12 - orig: 12, 12 + xy: 779, 1189 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 shrubshadow rotate: false - xy: 557, 232 - size: 8, 8 - orig: 8, 8 + xy: 659, 502 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 snow2 rotate: false - xy: 547, 222 - size: 8, 8 - orig: 8, 8 + xy: 693, 497 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 snow3 rotate: false - xy: 567, 242 - size: 8, 8 - orig: 8, 8 + xy: 739, 816 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 snowedge rotate: false - xy: 627, 236 - size: 12, 12 - orig: 12, 12 + xy: 629, 989 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 spaceedge rotate: false - xy: 641, 236 - size: 12, 12 - orig: 12, 12 + xy: 679, 1039 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 stone-cliff-edge rotate: false - xy: 204, 122 - size: 8, 8 - orig: 8, 8 + xy: 727, 510 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 stone-cliff-edge-1 rotate: false - xy: 204, 112 - size: 8, 8 - orig: 8, 8 + xy: 727, 476 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 stone-cliff-edge-2 rotate: false - xy: 204, 102 - size: 8, 8 - orig: 8, 8 + xy: 761, 782 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 stone-cliff-side rotate: false - xy: 204, 92 - size: 8, 8 - orig: 8, 8 + xy: 761, 748 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 stone2 rotate: false - xy: 205, 142 - size: 8, 8 - orig: 8, 8 + xy: 727, 578 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 stone3 rotate: false - xy: 204, 132 - size: 8, 8 - orig: 8, 8 + xy: 727, 544 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 stoneedge rotate: false - xy: 655, 236 - size: 12, 12 - orig: 12, 12 + xy: 779, 1139 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 taredge rotate: false - xy: 998, 433 - size: 12, 12 - orig: 12, 12 + xy: 629, 939 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 thorium1 rotate: false - xy: 203, 72 - size: 8, 8 - orig: 8, 8 + xy: 761, 578 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 thorium2 rotate: false - xy: 193, 52 - size: 8, 8 - orig: 8, 8 + xy: 761, 544 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 thorium3 rotate: false - xy: 203, 62 - size: 8, 8 - orig: 8, 8 + xy: 761, 510 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium1 rotate: false - xy: 203, 52 - size: 8, 8 - orig: 8, 8 + xy: 761, 476 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium2 rotate: false - xy: 193, 42 - size: 8, 8 - orig: 8, 8 + xy: 795, 788 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium3 rotate: false - xy: 203, 42 - size: 8, 8 - orig: 8, 8 + xy: 795, 754 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 water-cliff-edge rotate: false - xy: 131, 18 - size: 8, 8 - orig: 8, 8 + xy: 863, 720 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 water-cliff-edge-1 rotate: false - xy: 141, 28 - size: 8, 8 - orig: 8, 8 + xy: 863, 686 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 water-cliff-edge-2 rotate: false - xy: 141, 18 - size: 8, 8 - orig: 8, 8 + xy: 863, 652 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 water-cliff-side rotate: false - xy: 151, 28 - size: 8, 8 - orig: 8, 8 + xy: 863, 618 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 wateredge rotate: false - xy: 1000, 349 - size: 12, 12 - orig: 12, 12 + xy: 679, 939 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 block-border rotate: false - xy: 672, 323 - size: 8, 8 - orig: 8, 8 + xy: 621, 422 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-elevation rotate: false - xy: 662, 317 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -combustion-generator-top - rotate: false - xy: 662, 317 - size: 8, 8 - orig: 8, 8 + xy: 245, 424 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-middle rotate: false - xy: 104, 138 - size: 8, 8 - orig: 8, 8 + xy: 743, 884 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pump-liquid rotate: false - xy: 104, 138 - size: 8, 8 - orig: 8, 8 + xy: 743, 884 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-slope rotate: false - xy: 94, 128 - size: 8, 8 - orig: 8, 8 + xy: 777, 890 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 border rotate: false - xy: 84, 118 - size: 8, 8 - orig: 8, 8 + xy: 811, 890 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-liquid rotate: false - xy: 144, 128 - size: 8, 8 - orig: 8, 8 + xy: 551, 333 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 cross-1 rotate: false - xy: 94, 88 - size: 8, 8 - orig: 8, 8 + xy: 947, 1261 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 cross-2 rotate: false - xy: 950, 361 - size: 16, 16 - orig: 16, 16 + xy: 1254, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 cross-3 rotate: false - xy: 340, 312 - size: 24, 24 - orig: 24, 24 + xy: 457, 1145 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 cross-4 rotate: false - xy: 949, 479 - size: 32, 32 - orig: 32, 32 - offset: 0, 0 - index: -1 -nuclearreactor-shadow - rotate: false - xy: 499, 416 - size: 26, 26 - orig: 26, 26 + xy: 1, 978 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 place-arrow rotate: false - xy: 467, 220 - size: 8, 8 - orig: 8, 8 + xy: 637, 184 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ripples rotate: false - xy: 684, 387 - size: 10, 10 - orig: 10, 10 + xy: 629, 897 + size: 40, 40 + orig: 40, 40 offset: 0, 0 index: -1 rubble-1-0 rotate: false - xy: 528, 306 - size: 16, 16 - orig: 16, 16 + xy: 851, 1587 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 rubble-1-1 rotate: false - xy: 584, 378 - size: 16, 16 - orig: 16, 16 + xy: 917, 1653 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 rubble-2-0 rotate: false - xy: 548, 342 - size: 16, 16 - orig: 16, 16 + xy: 983, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 rubble-2-1 rotate: false - xy: 566, 360 - size: 16, 16 - orig: 16, 16 + xy: 1049, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 rubble-3-0 rotate: false - xy: 882, 453 - size: 24, 24 - orig: 24, 24 + xy: 457, 459 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 rubble-3-1 rotate: false - xy: 882, 453 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 -shadow-1 - rotate: false - xy: 684, 375 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -shadow-2 - rotate: false - xy: 418, 316 - size: 18, 18 - orig: 18, 18 - offset: 0, 0 - index: -1 -shadow-3 - rotate: false - xy: 39, 71 - size: 26, 26 - orig: 26, 26 - offset: 0, 0 - index: -1 -shadow-4 - rotate: false - xy: 53, 204 - size: 34, 34 - orig: 34, 34 - offset: 0, 0 - index: -1 -shadow-5 - rotate: false - xy: 290, 469 - size: 42, 42 - orig: 42, 42 - offset: 0, 0 - index: -1 -shadow-6 - rotate: false - xy: 1, 188 - size: 50, 50 - orig: 50, 50 - offset: 0, 0 - index: -1 -shadow-corner - rotate: false - xy: 672, 363 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -shadow-round-1 - rotate: false - xy: 696, 387 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -shadow-round-2 - rotate: false - xy: 438, 390 - size: 18, 18 - orig: 18, 18 - offset: 0, 0 - index: -1 -shadow-round-3 - rotate: false - xy: 39, 43 - size: 26, 26 - orig: 26, 26 - offset: 0, 0 - index: -1 -shadow-round-4 - rotate: false - xy: 675, 477 - size: 34, 34 - orig: 34, 34 - offset: 0, 0 - index: -1 -shadow-rounded-2 - rotate: false - xy: 438, 370 - size: 18, 18 - orig: 18, 18 - offset: 0, 0 - index: -1 -shadow-shock-mine - rotate: false - xy: 537, 222 - size: 8, 8 - orig: 8, 8 + xy: 457, 459 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 bridge-conduit-arrow rotate: false - xy: 114, 138 - size: 8, 8 - orig: 8, 8 + xy: 845, 890 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 bridge-conveyor-arrow rotate: false - xy: 114, 138 - size: 8, 8 - orig: 8, 8 + xy: 845, 890 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 bridge-conduit-bridge rotate: false - xy: 104, 128 - size: 8, 8 - orig: 8, 8 + xy: 847, 1033 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 bridge-conduit-end rotate: false - xy: 94, 118 - size: 8, 8 - orig: 8, 8 + xy: 881, 1033 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-bottom rotate: false - xy: 104, 108 - size: 8, 8 - orig: 8, 8 + xy: 937, 999 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-bottom-0 rotate: false - xy: 94, 98 - size: 8, 8 - orig: 8, 8 + xy: 937, 965 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-bottom-1 rotate: false - xy: 144, 138 - size: 8, 8 - orig: 8, 8 + xy: 947, 931 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-bottom-2 rotate: false - xy: 134, 128 - size: 8, 8 - orig: 8, 8 + xy: 947, 897 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-bottom-3 rotate: false - xy: 124, 118 - size: 8, 8 - orig: 8, 8 + xy: 971, 999 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-bottom-4 rotate: false - xy: 114, 108 - size: 8, 8 - orig: 8, 8 + xy: 971, 965 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-bottom-5 rotate: false - xy: 104, 98 - size: 8, 8 - orig: 8, 8 + xy: 981, 931 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-bottom-6 rotate: false - xy: 154, 138 - size: 8, 8 - orig: 8, 8 + xy: 981, 897 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-top-0 rotate: false - xy: 134, 118 - size: 8, 8 - orig: 8, 8 + xy: 585, 333 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-top-1 rotate: false - xy: 124, 108 - size: 8, 8 - orig: 8, 8 + xy: 619, 320 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-top-2 rotate: false - xy: 114, 98 - size: 8, 8 - orig: 8, 8 + xy: 231, 38 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-top-3 rotate: false - xy: 164, 138 - size: 8, 8 - orig: 8, 8 + xy: 231, 4 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-top-4 rotate: false - xy: 154, 128 - size: 8, 8 - orig: 8, 8 + xy: 1247, 1694 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-top-5 rotate: false - xy: 144, 118 - size: 8, 8 - orig: 8, 8 + xy: 1239, 1660 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conduit-top-6 rotate: false - xy: 134, 108 - size: 8, 8 - orig: 8, 8 + xy: 1281, 1694 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-router-bottom rotate: false - xy: 1014, 367 - size: 8, 8 - orig: 8, 8 + xy: 1015, 819 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-router-liquid rotate: false - xy: 1014, 357 - size: 8, 8 - orig: 8, 8 + xy: 1049, 819 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-router-top rotate: false - xy: 1014, 347 - size: 8, 8 - orig: 8, 8 + xy: 263, 322 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-tank-bottom rotate: false - xy: 726, 401 - size: 24, 24 - orig: 24, 24 + xy: 359, 753 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 liquid-tank-liquid rotate: false - xy: 752, 411 - size: 24, 24 - orig: 24, 24 + xy: 457, 851 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 liquid-tank-top rotate: false - xy: 778, 453 - size: 24, 24 - orig: 24, 24 + xy: 261, 557 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 phase-conduit-arrow rotate: false - xy: 457, 240 - size: 8, 8 - orig: 8, 8 + xy: 603, 184 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 phase-conduit-bridge rotate: false - xy: 447, 220 - size: 8, 8 - orig: 8, 8 + xy: 603, 150 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 phase-conduit-end rotate: false - xy: 457, 230 - size: 8, 8 - orig: 8, 8 + xy: 603, 116 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pulse-conduit-top-0 rotate: false - xy: 477, 242 - size: 8, 8 - orig: 8, 8 + xy: 605, 48 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pulse-conduit-top-1 rotate: false - xy: 477, 232 - size: 8, 8 - orig: 8, 8 + xy: 639, 82 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pulse-conduit-top-2 rotate: false - xy: 487, 242 - size: 8, 8 - orig: 8, 8 + xy: 639, 48 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pulse-conduit-top-3 rotate: false - xy: 487, 232 - size: 8, 8 - orig: 8, 8 + xy: 605, 14 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pulse-conduit-top-4 rotate: false - xy: 477, 222 - size: 8, 8 - orig: 8, 8 + xy: 639, 14 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pulse-conduit-top-5 rotate: false - xy: 497, 242 - size: 8, 8 - orig: 8, 8 + xy: 671, 842 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pulse-conduit-top-6 rotate: false - xy: 497, 232 - size: 8, 8 - orig: 8, 8 + xy: 705, 837 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 alpha-mech-pad rotate: false - xy: 796, 409 - size: 16, 16 - orig: 16, 16 + xy: 555, 699 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-alpha-mech-pad rotate: false - xy: 796, 409 - size: 16, 16 - orig: 16, 16 + xy: 555, 699 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 battery rotate: false - xy: 302, 312 - size: 8, 8 - orig: 8, 8 + xy: 879, 1271 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-battery rotate: false - xy: 302, 312 - size: 8, 8 - orig: 8, 8 + xy: 879, 1271 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 battery-large rotate: false - xy: 43, 162 - size: 24, 24 - orig: 24, 24 + xy: 131, 246 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-battery-large rotate: false - xy: 43, 162 - size: 24, 24 - orig: 24, 24 + xy: 131, 246 + size: 96, 96 + orig: 96, 96 + offset: 0, 0 + index: -1 +combustion-generator-top + rotate: false + xy: 903, 965 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 fusion-reactor rotate: false - xy: 92, 276 - size: 32, 32 - orig: 32, 32 + xy: 1, 848 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 fusion-reactor-bottom rotate: false - xy: 126, 276 - size: 32, 32 - orig: 32, 32 + xy: 1, 718 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 fusion-reactor-light rotate: false - xy: 160, 276 - size: 32, 32 - orig: 32, 32 + xy: 1, 588 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 fusion-reactor-plasma-0 rotate: false - xy: 87, 242 - size: 32, 32 - orig: 32, 32 + xy: 1, 458 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 fusion-reactor-plasma-1 rotate: false - xy: 121, 242 - size: 32, 32 - orig: 32, 32 + xy: 1, 328 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 fusion-reactor-plasma-2 rotate: false - xy: 155, 242 - size: 32, 32 - orig: 32, 32 + xy: 1, 198 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 fusion-reactor-plasma-3 rotate: false - xy: 89, 208 - size: 32, 32 - orig: 32, 32 + xy: 1, 68 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 fusion-reactor-top rotate: false - xy: 123, 208 + xy: 464, 1831 + size: 128, 128 + orig: 128, 128 + offset: 0, 0 + index: -1 +power-node + rotate: false + xy: 637, 150 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +power-node-large + rotate: false + xy: 719, 1455 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +powerinfinite + rotate: false + xy: 637, 116 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +powervoid + rotate: false + xy: 605, 82 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 rtg-generator-top rotate: false - xy: 517, 242 - size: 8, 8 - orig: 8, 8 + xy: 659, 672 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 thorium-reactor-center rotate: false - xy: 908, 453 - size: 24, 24 - orig: 24, 24 + xy: 555, 1733 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 thorium-reactor-lights rotate: false - xy: 908, 427 - size: 24, 24 - orig: 24, 24 + xy: 555, 1635 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 turbine-generator-top rotate: false - xy: 554, 288 - size: 16, 16 - orig: 16, 16 + xy: 917, 1521 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 alloy-smelter rotate: false - xy: 438, 332 - size: 16, 16 - orig: 16, 16 + xy: 555, 831 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-alloy-smelter rotate: false - xy: 438, 332 - size: 16, 16 - orig: 16, 16 + xy: 555, 831 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 alloy-smelter-top rotate: false - xy: 778, 409 - size: 16, 16 - orig: 16, 16 + xy: 555, 765 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 arc-smelter rotate: false - xy: 814, 409 - size: 16, 16 - orig: 16, 16 + xy: 555, 633 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-arc-smelter rotate: false - xy: 814, 409 - size: 16, 16 - orig: 16, 16 + xy: 555, 633 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 arc-smelter-top rotate: false - xy: 832, 409 - size: 16, 16 - orig: 16, 16 + xy: 555, 567 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 silicon-smelter-top rotate: false - xy: 832, 409 - size: 16, 16 - orig: 16, 16 + xy: 555, 567 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 biomattercompressor rotate: false - xy: 850, 409 - size: 16, 16 - orig: 16, 16 + xy: 555, 501 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 biomattercompressor-frame0 rotate: false - xy: 438, 314 - size: 16, 16 - orig: 16, 16 + xy: 668, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 biomattercompressor-frame1 rotate: false - xy: 908, 409 - size: 16, 16 - orig: 16, 16 + xy: 734, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 biomattercompressor-frame2 rotate: false - xy: 926, 409 - size: 16, 16 - orig: 16, 16 + xy: 800, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 biomattercompressor-liquid rotate: false - xy: 944, 409 - size: 16, 16 - orig: 16, 16 + xy: 866, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 biomattercompressor-top rotate: false - xy: 962, 415 - size: 16, 16 - orig: 16, 16 + xy: 932, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 blast-mixer rotate: false - xy: 1006, 461 - size: 16, 16 - orig: 16, 16 + xy: 998, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-blast-mixer rotate: false - xy: 1006, 461 - size: 16, 16 - orig: 16, 16 + xy: 998, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 centrifuge-liquid rotate: false - xy: 968, 379 - size: 16, 16 - orig: 16, 16 + xy: 1188, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 cryofluidmixer-bottom rotate: false - xy: 968, 361 - size: 16, 16 - orig: 16, 16 + xy: 1320, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 cryofluidmixer-liquid rotate: false - xy: 986, 363 - size: 16, 16 - orig: 16, 16 + xy: 1386, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 cryofluidmixer-top rotate: false - xy: 189, 258 - size: 16, 16 - orig: 16, 16 + xy: 1452, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 cultivator rotate: false - xy: 207, 260 - size: 16, 16 - orig: 16, 16 + xy: 1518, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 cultivator-middle rotate: false - xy: 225, 260 - size: 16, 16 - orig: 16, 16 + xy: 1584, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 cultivator-top rotate: false - xy: 243, 260 - size: 16, 16 - orig: 16, 16 + xy: 1650, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 lavasmelter rotate: false - xy: 173, 48 - size: 8, 8 - orig: 8, 8 + xy: 1475, 1725 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 oilrefinery rotate: false - xy: 682, 293 - size: 8, 8 - orig: 8, 8 + xy: 297, 289 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 phase-weaver rotate: false - xy: 530, 360 - size: 16, 16 - orig: 16, 16 + xy: 653, 1455 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 phase-weaver-bottom rotate: false - xy: 548, 378 - size: 16, 16 - orig: 16, 16 + xy: 719, 1521 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 phase-weaver-weave rotate: false - xy: 584, 396 - size: 16, 16 - orig: 16, 16 + xy: 785, 1587 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 plastanium-compressor-top rotate: false - xy: 530, 342 - size: 16, 16 - orig: 16, 16 + xy: 851, 1653 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 pulverizer rotate: false - xy: 487, 222 - size: 8, 8 - orig: 8, 8 + xy: 659, 808 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 pulverizer-rotator rotate: false - xy: 507, 242 - size: 8, 8 - orig: 8, 8 + xy: 659, 774 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 separator-liquid rotate: false - xy: 547, 232 - size: 8, 8 - orig: 8, 8 + xy: 693, 565 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 core-open rotate: false - xy: 392, 338 - size: 24, 24 - orig: 24, 24 + xy: 261, 949 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 core-top rotate: false - xy: 314, 323 - size: 24, 24 - orig: 24, 24 + xy: 359, 1047 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 sortedunloader rotate: false - xy: 194, 132 - size: 8, 8 - orig: 8, 8 + xy: 727, 748 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-1 rotate: false - xy: 752, 383 - size: 8, 8 - orig: 8, 8 + xy: 767, 958 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-1-top rotate: false - xy: 662, 327 - size: 8, 8 - orig: 8, 8 + xy: 829, 1076 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-2 rotate: false - xy: 458, 392 - size: 16, 16 - orig: 16, 16 + xy: 1064, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-2-top rotate: false - xy: 458, 374 - size: 16, 16 - orig: 16, 16 + xy: 1130, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-3 rotate: false - xy: 314, 375 - size: 24, 24 - orig: 24, 24 + xy: 359, 1733 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-3-top rotate: false - xy: 674, 451 - size: 24, 24 - orig: 24, 24 + xy: 261, 1537 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-4 rotate: false - xy: 711, 479 - size: 32, 32 - orig: 32, 32 + xy: 1, 1628 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 block-4-top rotate: false - xy: 745, 479 - size: 32, 32 - orig: 32, 32 + xy: 204, 1831 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 arc rotate: false - xy: 194, 300 - size: 8, 8 - orig: 8, 8 + xy: 621, 456 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 arc-heat rotate: false - xy: 256, 312 - size: 8, 8 - orig: 8, 8 + xy: 879, 1305 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 cyclone rotate: false - xy: 366, 312 - size: 24, 24 - orig: 24, 24 + xy: 261, 851 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 duo rotate: false - xy: 83, 58 - size: 8, 8 - orig: 8, 8 + xy: 1173, 1619 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 fuse rotate: false - xy: 726, 453 - size: 24, 24 - orig: 24, 24 + xy: 457, 949 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 hail rotate: false - xy: 123, 68 - size: 8, 8 - orig: 8, 8 + xy: 1039, 1023 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 hail-heat rotate: false - xy: 242, 339 - size: 10, 10 - orig: 10, 10 + xy: 87, 26 + size: 40, 40 + orig: 40, 40 offset: 0, 0 index: -1 lancer rotate: false - xy: 495, 252 - size: 16, 16 - orig: 16, 16 + xy: 653, 1653 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 lancer-heat rotate: false - xy: 513, 252 - size: 16, 16 - orig: 16, 16 + xy: 719, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 meltdown rotate: false - xy: 157, 208 - size: 32, 32 - orig: 32, 32 + xy: 131, 1628 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 meltdown-heat rotate: false - xy: 269, 432 - size: 32, 32 - orig: 32, 32 + xy: 131, 1498 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 ripple rotate: false - xy: 856, 453 - size: 24, 24 - orig: 24, 24 + xy: 359, 459 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 ripple-heat rotate: false - xy: 856, 427 - size: 24, 24 - orig: 24, 24 + xy: 457, 557 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 salvo rotate: false - xy: 602, 378 - size: 16, 16 - orig: 16, 16 + xy: 719, 1389 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 salvo-heat rotate: false - xy: 548, 324 - size: 16, 16 - orig: 16, 16 + xy: 785, 1455 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 salvo-panel-left rotate: false - xy: 546, 306 - size: 16, 16 - orig: 16, 16 + xy: 851, 1521 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 salvo-panel-right rotate: false - xy: 536, 288 - size: 16, 16 - orig: 16, 16 + xy: 917, 1587 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 scatter rotate: false - xy: 537, 232 - size: 8, 8 - orig: 8, 8 + xy: 693, 735 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 scorch rotate: false - xy: 527, 222 - size: 8, 8 - orig: 8, 8 + xy: 693, 701 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 scorch-shoot rotate: false - xy: 547, 242 - size: 8, 8 - orig: 8, 8 + xy: 693, 667 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 spectre rotate: false - xy: 405, 416 - size: 32, 32 - orig: 32, 32 + xy: 131, 458 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 swarmer rotate: false - xy: 584, 360 - size: 16, 16 - orig: 16, 16 + xy: 1115, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 wave rotate: false - xy: 572, 288 - size: 16, 16 - orig: 16, 16 + xy: 983, 1521 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 wave-liquid rotate: false - xy: 602, 342 - size: 16, 16 - orig: 16, 16 + xy: 1049, 1587 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 dagger-factory-top rotate: false - xy: 494, 396 - size: 16, 16 - orig: 16, 16 + xy: 1716, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 dagger-factory-top-open rotate: false - xy: 494, 378 - size: 16, 16 - orig: 16, 16 + xy: 1782, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 fortress-factory rotate: false - xy: 700, 451 - size: 24, 24 - orig: 24, 24 + xy: 457, 1047 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 fortress-factory-top rotate: false - xy: 700, 425 - size: 24, 24 - orig: 24, 24 + xy: 261, 753 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 ghoul-factory-top rotate: false - xy: 700, 425 - size: 24, 24 - orig: 24, 24 + xy: 261, 753 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 titan-factory-top rotate: false - xy: 700, 425 - size: 24, 24 - orig: 24, 24 + xy: 261, 753 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 fortress-factory-top-open rotate: false - xy: 700, 399 - size: 24, 24 - orig: 24, 24 + xy: 359, 851 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 ghoul-factory-top-open rotate: false - xy: 700, 399 - size: 24, 24 - orig: 24, 24 + xy: 359, 851 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 titan-factory-top-open rotate: false - xy: 700, 399 - size: 24, 24 - orig: 24, 24 + xy: 359, 851 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 ghoul-factory rotate: false - xy: 726, 427 - size: 24, 24 - orig: 24, 24 + xy: 261, 655 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 phantom-factory-top rotate: false - xy: 512, 324 - size: 16, 16 - orig: 16, 16 + xy: 851, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 phantom-factory-top-open rotate: false - xy: 566, 396 - size: 16, 16 - orig: 16, 16 + xy: 917, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 reconstructor-open rotate: false - xy: 530, 324 - size: 16, 16 - orig: 16, 16 + xy: 785, 1521 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 repair-point-turret rotate: false - xy: 507, 232 - size: 8, 8 - orig: 8, 8 + xy: 659, 740 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 revenant-factory rotate: false - xy: 337, 450 - size: 32, 32 - orig: 32, 32 + xy: 131, 848 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 revenant-factory-top rotate: false - xy: 337, 416 - size: 32, 32 - orig: 32, 32 + xy: 131, 718 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 revenant-factory-top-open rotate: false - xy: 371, 450 - size: 32, 32 - orig: 32, 32 + xy: 131, 588 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 spirit-factory-top rotate: false - xy: 536, 270 - size: 16, 16 - orig: 16, 16 + xy: 983, 1653 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 spirit-factory-top-open rotate: false - xy: 566, 342 - size: 16, 16 - orig: 16, 16 + xy: 1049, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 titan-factory rotate: false - xy: 934, 453 - size: 24, 24 - orig: 24, 24 + xy: 555, 1537 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 wraith-factory-top rotate: false - xy: 572, 270 - size: 16, 16 - orig: 16, 16 + xy: 1115, 1653 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 wraith-factory-top-open rotate: false - xy: 567, 252 - size: 16, 16 - orig: 16, 16 + xy: 1181, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 deflector-wall rotate: false - xy: 144, 88 - size: 8, 8 - orig: 8, 8 + xy: 981, 1329 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 deflector-wall-large rotate: false - xy: 494, 360 - size: 16, 16 - orig: 16, 16 + xy: 1848, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 door-large-open rotate: false - xy: 494, 342 - size: 16, 16 - orig: 16, 16 + xy: 1914, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 door-open rotate: false - xy: 93, 78 - size: 8, 8 - orig: 8, 8 + xy: 1075, 1427 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 beam rotate: false - xy: 334, 470 - size: 1, 12 - orig: 1, 12 + xy: 1107, 1537 + size: 4, 48 + orig: 4, 48 offset: 0, 0 index: -1 beam-end rotate: false - xy: 418, 396 - size: 18, 18 - orig: 18, 18 - offset: 0, 0 - index: -1 -blank - rotate: false - xy: 290, 466 - size: 1, 1 - orig: 1, 1 + xy: 555, 1267 + size: 72, 72 + orig: 72, 72 offset: 0, 0 index: -1 bullet rotate: false - xy: 197, 195 - size: 13, 13 - orig: 13, 13 + xy: 204, 1777 + size: 52, 52 + orig: 52, 52 offset: 0, 0 index: -1 bullet-back rotate: false - xy: 197, 180 - size: 13, 13 - orig: 13, 13 + xy: 1544, 1797 + size: 52, 52 + orig: 52, 52 offset: 0, 0 index: -1 casing rotate: false - xy: 85, 198 - size: 2, 4 - orig: 2, 4 - offset: 0, 0 - index: -1 -clear - rotate: false - xy: 254, 398 - size: 1, 1 - orig: 1, 1 + xy: 1005, 971 + size: 8, 16 + orig: 8, 16 offset: 0, 0 index: -1 command-attack rotate: false - xy: 84, 98 - size: 8, 8 - orig: 8, 8 + xy: 913, 931 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 command-idle rotate: false - xy: 134, 138 - size: 8, 8 - orig: 8, 8 + xy: 913, 897 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 command-patrol rotate: false - xy: 124, 128 - size: 8, 8 - orig: 8, 8 + xy: 931, 1067 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 command-retreat rotate: false - xy: 114, 118 - size: 8, 8 - orig: 8, 8 + xy: 949, 1033 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 enemyarrow rotate: false - xy: 93, 69 - size: 8, 7 - orig: 8, 7 + xy: 1980, 1851 + size: 32, 28 + orig: 32, 28 offset: 0, 0 index: -1 error rotate: false - xy: 642, 306 - size: 12, 12 - orig: 12, 12 + xy: 679, 1239 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 laser rotate: false - xy: 337, 402 - size: 1, 12 - orig: 1, 12 + xy: 975, 1405 + size: 4, 48 + orig: 4, 48 offset: 0, 0 index: -1 laser-end rotate: false - xy: 418, 376 - size: 18, 18 - orig: 18, 18 + xy: 555, 1119 + size: 72, 72 + orig: 72, 72 offset: 0, 0 index: -1 laserfull rotate: false - xy: 418, 356 - size: 18, 18 - orig: 18, 18 + xy: 555, 1045 + size: 72, 72 + orig: 72, 72 offset: 0, 0 index: -1 minelaser rotate: false - xy: 414, 298 - size: 1, 12 - orig: 1, 12 + xy: 689, 105 + size: 4, 48 + orig: 4, 48 offset: 0, 0 index: -1 minelaser-end rotate: false - xy: 418, 336 - size: 18, 18 - orig: 18, 18 + xy: 555, 971 + size: 72, 72 + orig: 72, 72 offset: 0, 0 index: -1 missile rotate: false - xy: 868, 416 - size: 9, 9 - orig: 9, 9 + xy: 621, 746 + size: 36, 36 + orig: 36, 36 offset: 0, 0 index: -1 missile-back rotate: false - xy: 314, 312 - size: 9, 9 - orig: 9, 9 + xy: 621, 708 + size: 36, 36 + orig: 36, 36 + offset: 0, 0 + index: -1 +scale_marker + rotate: false + xy: 965, 1067 + size: 4, 4 + orig: 4, 4 offset: 0, 0 index: -1 scorch1 rotate: false - xy: 702, 338 - size: 7, 25 - orig: 7, 25 + xy: 897, 659 + size: 28, 100 + orig: 28, 100 offset: 0, 0 index: -1 scorch2 rotate: false - xy: 702, 311 - size: 7, 25 - orig: 7, 25 + xy: 927, 693 + size: 28, 100 + orig: 28, 100 offset: 0, 0 index: -1 scorch3 rotate: false - xy: 702, 284 - size: 7, 25 - orig: 7, 25 + xy: 957, 693 + size: 28, 100 + orig: 28, 100 offset: 0, 0 index: -1 scorch4 rotate: false - xy: 699, 238 - size: 7, 25 - orig: 7, 25 + xy: 653, 320 + size: 28, 100 + orig: 28, 100 offset: 0, 0 index: -1 scorch5 rotate: false - xy: 211, 153 - size: 7, 25 - orig: 7, 25 + xy: 671, 218 + size: 28, 100 + orig: 28, 100 offset: 0, 0 index: -1 shell rotate: false - xy: 325, 312 - size: 9, 9 - orig: 9, 9 + xy: 621, 612 + size: 36, 36 + orig: 36, 36 offset: 0, 0 index: -1 shell-back rotate: false - xy: 696, 376 - size: 9, 9 - orig: 9, 9 + xy: 621, 574 + size: 36, 36 + orig: 36, 36 offset: 0, 0 index: -1 shot rotate: false - xy: 557, 242 - size: 8, 8 - orig: 8, 8 + xy: 693, 531 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 transfer rotate: false - xy: 1020, 447 - size: 1, 12 - orig: 1, 12 + xy: 1005, 695 + size: 4, 48 + orig: 4, 48 offset: 0, 0 index: -1 transfer-arrow rotate: false - xy: 131, 28 - size: 8, 8 - orig: 8, 8 + xy: 863, 754 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 transfer-end rotate: false - xy: 438, 350 - size: 18, 18 - orig: 18, 18 + xy: 555, 897 + size: 72, 72 + orig: 72, 72 offset: 0, 0 index: -1 blackstone-cliff-edge rotate: false - xy: 1012, 427 - size: 8, 8 - orig: 8, 8 + xy: 163, 16 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 blackstone-cliff-edge-1 rotate: false - xy: 1012, 417 - size: 8, 8 - orig: 8, 8 + xy: 197, 16 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 blackstone-cliff-edge-2 rotate: false - xy: 1012, 407 - size: 8, 8 - orig: 8, 8 + xy: 779, 1026 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 blackstone-cliff-side rotate: false - xy: 672, 333 - size: 8, 8 - orig: 8, 8 + xy: 767, 992 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-arc rotate: false - xy: 672, 313 - size: 8, 8 - orig: 8, 8 + xy: 245, 390 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-biomattercompressor rotate: false - xy: 458, 356 - size: 16, 16 - orig: 16, 16 + xy: 1196, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-blast-drill rotate: false - xy: 254, 338 - size: 24, 24 - orig: 24, 24 + xy: 359, 1635 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-bridge-conduit rotate: false - xy: 656, 307 - size: 8, 8 - orig: 8, 8 + xy: 245, 356 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 bridge-conduit rotate: false - xy: 656, 307 - size: 8, 8 - orig: 8, 8 + xy: 245, 356 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-bridge-conveyor rotate: false - xy: 662, 297 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -bridge-conveyor - rotate: false - xy: 662, 297 - size: 8, 8 - orig: 8, 8 + xy: 279, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-centrifuge rotate: false - xy: 476, 396 - size: 16, 16 - orig: 16, 16 + xy: 1262, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 centrifuge rotate: false - xy: 476, 396 - size: 16, 16 - orig: 16, 16 + xy: 1262, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-combustion-generator rotate: false - xy: 662, 287 - size: 8, 8 - orig: 8, 8 + xy: 313, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 combustion-generator rotate: false - xy: 662, 287 - size: 8, 8 - orig: 8, 8 + xy: 313, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-command-center rotate: false - xy: 476, 378 - size: 16, 16 - orig: 16, 16 + xy: 1328, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 command-center rotate: false - xy: 476, 378 - size: 16, 16 - orig: 16, 16 + xy: 1328, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-conduit rotate: false - xy: 662, 277 - size: 8, 8 - orig: 8, 8 + xy: 279, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-container rotate: false - xy: 476, 360 - size: 16, 16 - orig: 16, 16 + xy: 1394, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 container rotate: false - xy: 476, 360 - size: 16, 16 - orig: 16, 16 + xy: 1394, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-conveyor rotate: false - xy: 662, 267 - size: 8, 8 - orig: 8, 8 + xy: 347, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 conveyor-0-0 rotate: false - xy: 662, 267 - size: 8, 8 - orig: 8, 8 + xy: 347, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-copper-wall rotate: false - xy: 672, 303 - size: 8, 8 - orig: 8, 8 + xy: 279, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 copper-wall rotate: false - xy: 672, 303 - size: 8, 8 - orig: 8, 8 + xy: 279, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-copper-wall-large rotate: false - xy: 752, 393 - size: 16, 16 - orig: 16, 16 + xy: 1460, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 copper-wall-large rotate: false - xy: 752, 393 - size: 16, 16 - orig: 16, 16 + xy: 1460, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-core rotate: false - xy: 648, 435 - size: 24, 24 - orig: 24, 24 + xy: 457, 1733 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 core rotate: false - xy: 648, 435 - size: 24, 24 - orig: 24, 24 + xy: 457, 1733 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-cryofluidmixer rotate: false - xy: 194, 278 - size: 16, 16 - orig: 16, 16 + xy: 1526, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-cultivator rotate: false - xy: 212, 278 - size: 16, 16 - orig: 16, 16 + xy: 1592, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-cyclone rotate: false - xy: 622, 432 - size: 24, 24 - orig: 24, 24 + xy: 261, 1439 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-dagger-factory rotate: false - xy: 230, 278 - size: 16, 16 - orig: 16, 16 + xy: 1658, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-dart-ship-pad rotate: false - xy: 770, 391 - size: 16, 16 - orig: 16, 16 + xy: 1724, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 dart-ship-pad rotate: false - xy: 770, 391 - size: 16, 16 - orig: 16, 16 + xy: 1724, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-deepwater rotate: false - xy: 672, 293 - size: 8, 8 - orig: 8, 8 + xy: 313, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 deepwater rotate: false - xy: 672, 293 - size: 8, 8 - orig: 8, 8 + xy: 313, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-delta-mech-pad rotate: false - xy: 788, 391 - size: 16, 16 - orig: 16, 16 + xy: 1790, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 delta-mech-pad rotate: false - xy: 788, 391 - size: 16, 16 - orig: 16, 16 + xy: 1790, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-dense-alloy-wall rotate: false - xy: 672, 283 - size: 8, 8 - orig: 8, 8 + xy: 381, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dense-alloy-wall rotate: false - xy: 672, 283 - size: 8, 8 - orig: 8, 8 + xy: 381, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-dense-alloy-wall-large rotate: false - xy: 806, 391 - size: 16, 16 - orig: 16, 16 + xy: 1856, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 dense-alloy-wall-large rotate: false - xy: 806, 391 - size: 16, 16 - orig: 16, 16 + xy: 1856, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-dirt rotate: false - xy: 672, 273 - size: 8, 8 - orig: 8, 8 + xy: 313, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dirt1 rotate: false - xy: 672, 273 - size: 8, 8 - orig: 8, 8 + xy: 313, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-distributor rotate: false - xy: 824, 391 - size: 16, 16 - orig: 16, 16 + xy: 1922, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 distributor rotate: false - xy: 824, 391 - size: 16, 16 - orig: 16, 16 + xy: 1922, 1983 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-door rotate: false - xy: 672, 263 - size: 8, 8 - orig: 8, 8 + xy: 347, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 door rotate: false - xy: 672, 263 - size: 8, 8 - orig: 8, 8 + xy: 347, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-door-large rotate: false - xy: 842, 391 - size: 16, 16 - orig: 16, 16 + xy: 555, 435 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 door-large rotate: false - xy: 842, 391 - size: 16, 16 - orig: 16, 16 + xy: 555, 435 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-duo rotate: false - xy: 669, 253 - size: 8, 8 - orig: 8, 8 + xy: 415, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-force-projector rotate: false - xy: 674, 425 - size: 24, 24 - orig: 24, 24 + xy: 359, 1537 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 force-projector rotate: false - xy: 674, 425 - size: 24, 24 - orig: 24, 24 + xy: 359, 1537 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-fortress-factory rotate: false - xy: 648, 409 - size: 24, 24 - orig: 24, 24 + xy: 457, 1635 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-fuse rotate: false - xy: 674, 399 - size: 24, 24 - orig: 24, 24 + xy: 261, 1341 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-fusion-reactor rotate: false - xy: 779, 479 - size: 32, 32 - orig: 32, 32 + xy: 1, 1498 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 block-icon-ghoul-factory rotate: false - xy: 204, 296 - size: 24, 24 - orig: 24, 24 + xy: 359, 1439 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-glaive-ship-pad rotate: false - xy: 230, 296 - size: 24, 24 - orig: 24, 24 + xy: 457, 1537 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 glaive-ship-pad rotate: false - xy: 230, 296 - size: 24, 24 - orig: 24, 24 + xy: 457, 1537 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-grass rotate: false - xy: 669, 243 - size: 8, 8 - orig: 8, 8 + xy: 347, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 grass1 rotate: false - xy: 669, 243 - size: 8, 8 - orig: 8, 8 + xy: 347, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-hail rotate: false - xy: 669, 233 - size: 8, 8 - orig: 8, 8 + xy: 381, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-ice rotate: false - xy: 679, 253 - size: 8, 8 - orig: 8, 8 + xy: 449, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ice1 rotate: false - xy: 679, 253 - size: 8, 8 - orig: 8, 8 + xy: 449, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-icerock rotate: false - xy: 679, 243 - size: 8, 8 - orig: 8, 8 + xy: 381, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 icerock1 rotate: false - xy: 679, 243 - size: 8, 8 - orig: 8, 8 + xy: 381, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-incinerator rotate: false - xy: 679, 233 - size: 8, 8 - orig: 8, 8 + xy: 415, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 incinerator rotate: false - xy: 679, 233 - size: 8, 8 - orig: 8, 8 + xy: 415, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-itemsource rotate: false - xy: 205, 248 - size: 8, 8 - orig: 8, 8 + xy: 483, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 itemsource rotate: false - xy: 205, 248 - size: 8, 8 - orig: 8, 8 + xy: 483, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-itemvoid rotate: false - xy: 215, 250 - size: 8, 8 - orig: 8, 8 + xy: 415, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 itemvoid rotate: false - xy: 215, 250 - size: 8, 8 - orig: 8, 8 + xy: 415, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-javelin-ship-pad rotate: false - xy: 248, 278 - size: 16, 16 - orig: 16, 16 + xy: 594, 1936 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 javelin-ship-pad rotate: false - xy: 248, 278 - size: 16, 16 - orig: 16, 16 + xy: 594, 1936 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-junction rotate: false - xy: 225, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -junction - rotate: false - xy: 225, 250 - size: 8, 8 - orig: 8, 8 + xy: 449, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-lancer rotate: false - xy: 860, 391 - size: 16, 16 - orig: 16, 16 + xy: 594, 1870 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-laser-drill rotate: false - xy: 878, 398 - size: 16, 16 - orig: 16, 16 + xy: 660, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-lava rotate: false - xy: 235, 250 - size: 8, 8 - orig: 8, 8 + xy: 517, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 lava rotate: false - xy: 235, 250 - size: 8, 8 - orig: 8, 8 + xy: 517, 425 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-liquid-junction rotate: false - xy: 245, 250 - size: 8, 8 - orig: 8, 8 + xy: 449, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-junction rotate: false - xy: 245, 250 - size: 8, 8 - orig: 8, 8 + xy: 449, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-liquid-router rotate: false - xy: 255, 250 - size: 8, 8 - orig: 8, 8 + xy: 483, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-liquid-tank rotate: false - xy: 340, 390 - size: 24, 24 - orig: 24, 24 + xy: 261, 1243 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-liquidsource rotate: false - xy: 265, 250 - size: 8, 8 - orig: 8, 8 + xy: 483, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquidsource rotate: false - xy: 265, 250 - size: 8, 8 - orig: 8, 8 + xy: 483, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-mass-driver rotate: false - xy: 366, 390 - size: 24, 24 - orig: 24, 24 + xy: 359, 1341 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 mass-driver rotate: false - xy: 366, 390 - size: 24, 24 - orig: 24, 24 + xy: 359, 1341 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-mechanical-drill rotate: false - xy: 878, 380 - size: 16, 16 - orig: 16, 16 + xy: 726, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-mechanical-pump rotate: false - xy: 275, 250 - size: 8, 8 - orig: 8, 8 + xy: 517, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 mechanical-pump rotate: false - xy: 275, 250 - size: 8, 8 - orig: 8, 8 + xy: 517, 391 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-meltdown rotate: false - xy: 813, 479 - size: 32, 32 - orig: 32, 32 + xy: 334, 1831 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 block-icon-melter rotate: false - xy: 285, 250 - size: 8, 8 - orig: 8, 8 + xy: 517, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 melter rotate: false - xy: 285, 250 - size: 8, 8 - orig: 8, 8 + xy: 517, 357 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-mend-projector rotate: false - xy: 532, 432 - size: 16, 16 - orig: 16, 16 + xy: 792, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 mend-projector rotate: false - xy: 532, 432 - size: 16, 16 - orig: 16, 16 + xy: 792, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-metalfloor rotate: false - xy: 295, 250 - size: 8, 8 - orig: 8, 8 + xy: 551, 401 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor1 rotate: false - xy: 295, 250 - size: 8, 8 - orig: 8, 8 + xy: 551, 401 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-oil-extractor rotate: false - xy: 392, 390 - size: 24, 24 - orig: 24, 24 + xy: 457, 1439 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-omega-mech-pad rotate: false - xy: 340, 364 - size: 24, 24 - orig: 24, 24 + xy: 261, 1145 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 omega-mech-pad rotate: false - xy: 340, 364 - size: 24, 24 - orig: 24, 24 + xy: 261, 1145 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-overdrive-projector rotate: false - xy: 550, 432 - size: 16, 16 - orig: 16, 16 + xy: 858, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 overdrive-projector rotate: false - xy: 550, 432 - size: 16, 16 - orig: 16, 16 + xy: 858, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-overflow-gate rotate: false - xy: 305, 250 - size: 8, 8 - orig: 8, 8 + xy: 585, 401 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 overflow-gate rotate: false - xy: 305, 250 - size: 8, 8 - orig: 8, 8 + xy: 585, 401 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-phantom-factory rotate: false - xy: 568, 432 - size: 16, 16 - orig: 16, 16 + xy: 924, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-phase-conduit rotate: false - xy: 315, 250 - size: 8, 8 - orig: 8, 8 + xy: 551, 367 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 phase-conduit rotate: false - xy: 315, 250 - size: 8, 8 - orig: 8, 8 + xy: 551, 367 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-phase-conveyor rotate: false - xy: 325, 250 - size: 8, 8 - orig: 8, 8 + xy: 585, 367 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 phase-conveyor rotate: false - xy: 325, 250 - size: 8, 8 - orig: 8, 8 + xy: 585, 367 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-phase-wall rotate: false - xy: 335, 250 - size: 8, 8 - orig: 8, 8 + xy: 619, 388 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 phase-wall rotate: false - xy: 335, 250 - size: 8, 8 - orig: 8, 8 + xy: 619, 388 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-phase-wall-large rotate: false - xy: 586, 432 - size: 16, 16 - orig: 16, 16 + xy: 990, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 phase-wall-large rotate: false - xy: 586, 432 - size: 16, 16 - orig: 16, 16 + xy: 990, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-phase-weaver rotate: false - xy: 604, 432 - size: 16, 16 - orig: 16, 16 + xy: 1056, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-plasma-drill rotate: false - xy: 847, 479 - size: 32, 32 - orig: 32, 32 + xy: 1, 1368 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 block-icon-plastanium-compressor rotate: false - xy: 527, 414 - size: 16, 16 - orig: 16, 16 + xy: 1122, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 plastanium-compressor rotate: false - xy: 527, 414 - size: 16, 16 - orig: 16, 16 + xy: 1122, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-pneumatic-drill rotate: false - xy: 545, 414 - size: 16, 16 - orig: 16, 16 + xy: 1188, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-power-node rotate: false - xy: 345, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -power-node - rotate: false - xy: 345, 250 - size: 8, 8 - orig: 8, 8 + xy: 619, 354 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-power-node-large rotate: false - xy: 563, 414 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -power-node-large - rotate: false - xy: 563, 414 - size: 16, 16 - orig: 16, 16 + xy: 1254, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-powerinfinite rotate: false - xy: 355, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -powerinfinite - rotate: false - xy: 355, 250 - size: 8, 8 - orig: 8, 8 + xy: 229, 310 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-powervoid rotate: false - xy: 365, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -powervoid - rotate: false - xy: 365, 250 - size: 8, 8 - orig: 8, 8 + xy: 229, 276 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-pulse-conduit rotate: false - xy: 375, 250 - size: 8, 8 - orig: 8, 8 + xy: 229, 242 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-pulverizer rotate: false - xy: 385, 250 - size: 8, 8 - orig: 8, 8 + xy: 229, 208 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-pyratite-mixer rotate: false - xy: 581, 414 - size: 16, 16 - orig: 16, 16 + xy: 1320, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 pyratite-mixer rotate: false - xy: 581, 414 - size: 16, 16 - orig: 16, 16 + xy: 1320, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-reconstructor rotate: false - xy: 599, 414 - size: 16, 16 - orig: 16, 16 + xy: 1386, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 dagger-factory rotate: false - xy: 599, 414 - size: 16, 16 - orig: 16, 16 + xy: 1386, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 phantom-factory rotate: false - xy: 599, 414 - size: 16, 16 - orig: 16, 16 + xy: 1386, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 reconstructor rotate: false - xy: 599, 414 - size: 16, 16 - orig: 16, 16 + xy: 1386, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 spirit-factory rotate: false - xy: 599, 414 - size: 16, 16 - orig: 16, 16 + xy: 1386, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 wraith-factory rotate: false - xy: 599, 414 - size: 16, 16 - orig: 16, 16 + xy: 1386, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-repair-point rotate: false - xy: 395, 250 - size: 8, 8 - orig: 8, 8 + xy: 229, 174 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 repair-point rotate: false - xy: 395, 250 - size: 8, 8 - orig: 8, 8 + xy: 229, 174 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-revenant-factory rotate: false - xy: 881, 479 - size: 32, 32 - orig: 32, 32 + xy: 1, 1238 + size: 128, 128 + orig: 128, 128 offset: 0, 0 index: -1 block-icon-ripple rotate: false - xy: 366, 364 - size: 24, 24 - orig: 24, 24 + xy: 359, 1243 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-rock rotate: false - xy: 405, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -rock1 - rotate: false - xy: 405, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-rotary-pump - rotate: false - xy: 617, 414 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -rotary-pump - rotate: false - xy: 617, 414 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -block-icon-router - rotate: false - xy: 415, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -router - rotate: false - xy: 415, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-rtg-generator - rotate: false - xy: 980, 435 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -rtg-generator - rotate: false - xy: 980, 435 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -block-icon-salvo - rotate: false - xy: 980, 417 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -block-icon-sand - rotate: false - xy: 425, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -sand1 - rotate: false - xy: 425, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-scorch - rotate: false - xy: 435, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-separator - rotate: false - xy: 445, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -separator - rotate: false - xy: 445, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-shock-mine - rotate: false - xy: 455, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -shock-mine - rotate: false - xy: 455, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-shrub - rotate: false - xy: 465, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -shrub - rotate: false - xy: 465, 250 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-silicon-smelter - rotate: false - xy: 962, 397 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -silicon-smelter - rotate: false - xy: 962, 397 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 -block-icon-smelter - rotate: false - xy: 85, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -smelter - rotate: false - xy: 85, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-snow - rotate: false - xy: 95, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -snow1 - rotate: false - xy: 95, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-solar-panel - rotate: false - xy: 105, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -solar-panel - rotate: false - xy: 105, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-solar-panel-large - rotate: false - xy: 392, 364 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 -solar-panel-large - rotate: false - xy: 392, 364 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 -block-icon-solidifer - rotate: false - xy: 115, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -solidifer - rotate: false - xy: 115, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-sorter - rotate: false - xy: 125, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -sorter - rotate: false - xy: 125, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-space - rotate: false - xy: 135, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -space - rotate: false - xy: 135, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-spawn - rotate: false - xy: 145, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -spawn - rotate: false - xy: 145, 148 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-spectre - rotate: false - xy: 915, 479 + xy: 229, 140 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 +rock1 + rotate: false + xy: 229, 140 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-rotary-pump + rotate: false + xy: 1452, 1917 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +rotary-pump + rotate: false + xy: 1452, 1917 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +block-icon-router + rotate: false + xy: 229, 106 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +router + rotate: false + xy: 229, 106 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-rtg-generator + rotate: false + xy: 1518, 1917 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +rtg-generator + rotate: false + xy: 1518, 1917 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +block-icon-salvo + rotate: false + xy: 1584, 1917 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +block-icon-sand + rotate: false + xy: 229, 72 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +sand1 + rotate: false + xy: 229, 72 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-scorch + rotate: false + xy: 709, 905 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-separator + rotate: false + xy: 903, 1355 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +separator + rotate: false + xy: 903, 1355 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-shock-mine + rotate: false + xy: 937, 1363 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +shock-mine + rotate: false + xy: 937, 1363 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-shrub + rotate: false + xy: 867, 1101 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +shrub + rotate: false + xy: 867, 1101 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-silicon-smelter + rotate: false + xy: 1650, 1917 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +silicon-smelter + rotate: false + xy: 1650, 1917 + size: 64, 64 + orig: 64, 64 + offset: 0, 0 + index: -1 +block-icon-smelter + rotate: false + xy: 863, 1067 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +smelter + rotate: false + xy: 863, 1067 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-snow + rotate: false + xy: 671, 876 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +snow1 + rotate: false + xy: 671, 876 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-solar-panel + rotate: false + xy: 705, 871 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +solar-panel + rotate: false + xy: 705, 871 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-solar-panel-large + rotate: false + xy: 457, 1341 + size: 96, 96 + orig: 96, 96 + offset: 0, 0 + index: -1 +solar-panel-large + rotate: false + xy: 457, 1341 + size: 96, 96 + orig: 96, 96 + offset: 0, 0 + index: -1 +block-icon-solidifer + rotate: false + xy: 801, 992 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +solidifer + rotate: false + xy: 801, 992 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-sorter + rotate: false + xy: 801, 958 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +sorter + rotate: false + xy: 801, 958 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-space + rotate: false + xy: 813, 1026 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +space + rotate: false + xy: 813, 1026 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-spawn + rotate: false + xy: 901, 1101 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +spawn + rotate: false + xy: 901, 1101 + size: 32, 32 + orig: 32, 32 + offset: 0, 0 + index: -1 +block-icon-spectre + rotate: false + xy: 1, 1108 + size: 128, 128 + orig: 128, 128 + offset: 0, 0 + index: -1 block-icon-spirit-factory rotate: false - xy: 980, 399 - size: 16, 16 - orig: 16, 16 + xy: 1716, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-stone rotate: false - xy: 155, 148 - size: 8, 8 - orig: 8, 8 + xy: 897, 1067 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 stone1 rotate: false - xy: 155, 148 - size: 8, 8 - orig: 8, 8 + xy: 897, 1067 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-surge-wall rotate: false - xy: 165, 148 - size: 8, 8 - orig: 8, 8 + xy: 835, 992 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 surge-wall rotate: false - xy: 165, 148 - size: 8, 8 - orig: 8, 8 + xy: 835, 992 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-surge-wall-large rotate: false - xy: 458, 338 - size: 16, 16 - orig: 16, 16 + xy: 1782, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 surge-wall-large rotate: false - xy: 458, 338 - size: 16, 16 - orig: 16, 16 + xy: 1782, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-swarmer rotate: false - xy: 476, 342 - size: 16, 16 - orig: 16, 16 + xy: 1848, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-tar rotate: false - xy: 175, 148 - size: 8, 8 - orig: 8, 8 + xy: 835, 958 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 tar rotate: false - xy: 175, 148 - size: 8, 8 - orig: 8, 8 + xy: 835, 958 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-tau-mech-pad rotate: false - xy: 456, 320 - size: 16, 16 - orig: 16, 16 + xy: 1914, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 tau-mech-pad rotate: false - xy: 456, 320 - size: 16, 16 - orig: 16, 16 + xy: 1914, 1917 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-thermal-generator rotate: false - xy: 896, 391 - size: 16, 16 - orig: 16, 16 + xy: 660, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 thermal-generator rotate: false - xy: 896, 391 - size: 16, 16 - orig: 16, 16 + xy: 660, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-thermal-pump rotate: false - xy: 914, 391 - size: 16, 16 - orig: 16, 16 + xy: 726, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 thermal-pump rotate: false - xy: 914, 391 - size: 16, 16 - orig: 16, 16 + xy: 726, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-thorium-reactor rotate: false - xy: 314, 349 - size: 24, 24 - orig: 24, 24 + xy: 261, 1047 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 thorium-reactor rotate: false - xy: 314, 349 - size: 24, 24 - orig: 24, 24 + xy: 261, 1047 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-thorium-wall rotate: false - xy: 185, 148 - size: 8, 8 - orig: 8, 8 + xy: 743, 918 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 thorium-wall rotate: false - xy: 185, 148 - size: 8, 8 - orig: 8, 8 + xy: 743, 918 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-thorium-wall-large rotate: false - xy: 932, 391 - size: 16, 16 - orig: 16, 16 + xy: 792, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 thorium-wall-large rotate: false - xy: 932, 391 - size: 16, 16 - orig: 16, 16 + xy: 792, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-titan-factory rotate: false - xy: 288, 346 - size: 24, 24 - orig: 24, 24 + xy: 359, 1145 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-titanium-conveyor rotate: false - xy: 84, 138 - size: 8, 8 - orig: 8, 8 + xy: 777, 924 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 titanium-conveyor-0-0 rotate: false - xy: 84, 138 - size: 8, 8 - orig: 8, 8 + xy: 777, 924 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-trident-ship-pad rotate: false - xy: 896, 373 - size: 16, 16 - orig: 16, 16 + xy: 858, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 trident-ship-pad rotate: false - xy: 896, 373 - size: 16, 16 - orig: 16, 16 + xy: 858, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-turbine-generator rotate: false - xy: 914, 373 - size: 16, 16 - orig: 16, 16 + xy: 924, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 turbine-generator rotate: false - xy: 914, 373 - size: 16, 16 - orig: 16, 16 + xy: 924, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-unloader rotate: false - xy: 94, 138 - size: 8, 8 - orig: 8, 8 + xy: 811, 924 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 unloader rotate: false - xy: 94, 138 - size: 8, 8 - orig: 8, 8 + xy: 811, 924 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-vault rotate: false - xy: 340, 338 - size: 24, 24 - orig: 24, 24 + xy: 457, 1243 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 vault rotate: false - xy: 340, 338 - size: 24, 24 - orig: 24, 24 + xy: 457, 1243 + size: 96, 96 + orig: 96, 96 offset: 0, 0 index: -1 block-icon-water rotate: false - xy: 84, 128 - size: 8, 8 - orig: 8, 8 + xy: 845, 924 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 water rotate: false - xy: 84, 128 - size: 8, 8 - orig: 8, 8 + xy: 845, 924 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 block-icon-water-extractor rotate: false - xy: 932, 373 - size: 16, 16 - orig: 16, 16 + xy: 990, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-wave rotate: false - xy: 456, 302 - size: 16, 16 - orig: 16, 16 + xy: 1056, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 block-icon-wraith-factory rotate: false - xy: 950, 379 - size: 16, 16 - orig: 16, 16 + xy: 1122, 1851 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 deepwater-cliff-edge rotate: false - xy: 104, 88 - size: 8, 8 - orig: 8, 8 + xy: 947, 1227 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 deepwater-cliff-edge-1 rotate: false - xy: 114, 88 - size: 8, 8 - orig: 8, 8 + xy: 947, 1193 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 deepwater-cliff-edge-2 rotate: false - xy: 124, 88 - size: 8, 8 - orig: 8, 8 + xy: 947, 1159 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 deepwater-cliff-side rotate: false - xy: 134, 88 - size: 8, 8 - orig: 8, 8 + xy: 971, 1363 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dirt-cliff-edge rotate: false - xy: 174, 88 - size: 8, 8 - orig: 8, 8 + xy: 981, 1227 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dirt-cliff-edge-1 rotate: false - xy: 184, 88 - size: 8, 8 - orig: 8, 8 + xy: 981, 1193 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dirt-cliff-edge-2 rotate: false - xy: 83, 78 - size: 8, 8 - orig: 8, 8 + xy: 981, 1159 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 dirt-cliff-side rotate: false - xy: 83, 68 - size: 8, 8 - orig: 8, 8 + xy: 1307, 1660 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 lava-cliff-edge rotate: false - xy: 133, 48 - size: 8, 8 - orig: 8, 8 + xy: 1339, 1725 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 lava-cliff-edge-1 rotate: false - xy: 143, 48 - size: 8, 8 - orig: 8, 8 + xy: 1373, 1725 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 lava-cliff-edge-2 rotate: false - xy: 153, 48 - size: 8, 8 - orig: 8, 8 + xy: 1407, 1725 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 lava-cliff-side rotate: false - xy: 163, 48 - size: 8, 8 - orig: 8, 8 + xy: 1441, 1725 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-icon-cryofluid rotate: false - xy: 1004, 365 - size: 8, 8 - orig: 8, 8 + xy: 879, 829 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-icon-lava rotate: false - xy: 1014, 397 - size: 8, 8 - orig: 8, 8 + xy: 913, 829 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-icon-oil rotate: false - xy: 1014, 387 - size: 8, 8 - orig: 8, 8 + xy: 947, 829 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-icon-water rotate: false - xy: 1014, 377 - size: 8, 8 - orig: 8, 8 + xy: 981, 829 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 mech-icon-alpha-mech rotate: false - xy: 599, 250 - size: 12, 12 - orig: 12, 12 + xy: 829, 1289 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 mech-icon-dart-ship rotate: false - xy: 613, 250 - size: 12, 12 - orig: 12, 12 + xy: 629, 1039 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 mech-icon-delta-mech rotate: false - xy: 627, 250 - size: 12, 12 - orig: 12, 12 + xy: 679, 1089 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 mech-icon-omega-mech rotate: false - xy: 165, 158 - size: 14, 14 - orig: 14, 14 + xy: 917, 1397 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 mech-icon-tau-mech rotate: false - xy: 181, 158 - size: 14, 14 - orig: 14, 14 + xy: 983, 1463 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 mech-icon-trident-ship rotate: false - xy: 68, 140 - size: 14, 14 - orig: 14, 14 + xy: 1049, 1529 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 trident-ship rotate: false - xy: 68, 140 - size: 14, 14 - orig: 14, 14 + xy: 1049, 1529 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 metalfloor-cliff-edge rotate: false - xy: 682, 333 - size: 8, 8 - orig: 8, 8 + xy: 263, 118 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor-cliff-edge-1 rotate: false - xy: 682, 323 - size: 8, 8 - orig: 8, 8 + xy: 263, 84 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor-cliff-edge-2 rotate: false - xy: 682, 313 - size: 8, 8 - orig: 8, 8 + xy: 297, 323 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 metalfloor-cliff-side rotate: false - xy: 682, 303 - size: 8, 8 - orig: 8, 8 + xy: 331, 323 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-blackstone1 rotate: false - xy: 682, 283 - size: 8, 8 - orig: 8, 8 + xy: 365, 323 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-blackstone2 rotate: false - xy: 682, 273 - size: 8, 8 - orig: 8, 8 + xy: 297, 255 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-blackstone3 rotate: false - xy: 682, 263 - size: 8, 8 - orig: 8, 8 + xy: 331, 289 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-grass1 rotate: false - xy: 692, 355 - size: 8, 8 - orig: 8, 8 + xy: 399, 323 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-grass2 rotate: false - xy: 692, 345 - size: 8, 8 - orig: 8, 8 + xy: 297, 221 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-grass3 rotate: false - xy: 692, 335 - size: 8, 8 - orig: 8, 8 + xy: 331, 255 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-ice1 rotate: false - xy: 692, 325 - size: 8, 8 - orig: 8, 8 + xy: 365, 289 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-ice2 rotate: false - xy: 692, 315 - size: 8, 8 - orig: 8, 8 + xy: 433, 323 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-ice3 rotate: false - xy: 692, 305 - size: 8, 8 - orig: 8, 8 + xy: 297, 187 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-sand1 rotate: false - xy: 692, 295 - size: 8, 8 - orig: 8, 8 + xy: 331, 221 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-sand2 rotate: false - xy: 692, 285 - size: 8, 8 - orig: 8, 8 + xy: 365, 255 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-sand3 rotate: false - xy: 692, 275 - size: 8, 8 - orig: 8, 8 + xy: 399, 289 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-snow1 rotate: false - xy: 692, 265 - size: 8, 8 - orig: 8, 8 + xy: 467, 323 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-snow2 rotate: false - xy: 689, 253 - size: 8, 8 - orig: 8, 8 + xy: 297, 153 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-snow3 rotate: false - xy: 689, 243 - size: 8, 8 - orig: 8, 8 + xy: 331, 187 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-stone1 rotate: false - xy: 689, 233 - size: 8, 8 - orig: 8, 8 + xy: 365, 221 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-stone2 rotate: false - xy: 207, 238 - size: 8, 8 - orig: 8, 8 + xy: 399, 255 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-coal-stone3 rotate: false - xy: 207, 228 - size: 8, 8 - orig: 8, 8 + xy: 433, 289 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-blackstone1 rotate: false - xy: 207, 218 - size: 8, 8 - orig: 8, 8 + xy: 501, 323 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-blackstone2 rotate: false - xy: 217, 240 - size: 8, 8 - orig: 8, 8 + xy: 297, 119 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-blackstone3 rotate: false - xy: 217, 230 - size: 8, 8 - orig: 8, 8 + xy: 331, 153 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-grass1 rotate: false - xy: 227, 240 - size: 8, 8 - orig: 8, 8 + xy: 365, 187 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-grass2 rotate: false - xy: 217, 220 - size: 8, 8 - orig: 8, 8 + xy: 399, 221 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-grass3 rotate: false - xy: 227, 230 - size: 8, 8 - orig: 8, 8 + xy: 433, 255 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-ice1 rotate: false - xy: 237, 240 - size: 8, 8 - orig: 8, 8 + xy: 467, 289 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-ice2 rotate: false - xy: 227, 220 - size: 8, 8 - orig: 8, 8 + xy: 297, 85 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-ice3 rotate: false - xy: 237, 230 - size: 8, 8 - orig: 8, 8 + xy: 331, 119 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-sand1 rotate: false - xy: 247, 240 - size: 8, 8 - orig: 8, 8 + xy: 365, 153 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-sand2 rotate: false - xy: 237, 220 - size: 8, 8 - orig: 8, 8 + xy: 399, 187 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-sand3 rotate: false - xy: 247, 230 - size: 8, 8 - orig: 8, 8 + xy: 433, 221 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-snow1 rotate: false - xy: 257, 240 - size: 8, 8 - orig: 8, 8 + xy: 467, 255 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-snow2 rotate: false - xy: 247, 220 - size: 8, 8 - orig: 8, 8 + xy: 501, 289 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-snow3 rotate: false - xy: 257, 230 - size: 8, 8 - orig: 8, 8 + xy: 331, 85 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-stone1 rotate: false - xy: 267, 240 - size: 8, 8 - orig: 8, 8 + xy: 365, 119 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-stone2 rotate: false - xy: 257, 220 - size: 8, 8 - orig: 8, 8 + xy: 399, 153 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-copper-stone3 rotate: false - xy: 267, 230 - size: 8, 8 - orig: 8, 8 + xy: 433, 187 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-blackstone1 rotate: false - xy: 277, 240 - size: 8, 8 - orig: 8, 8 + xy: 467, 221 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-blackstone2 rotate: false - xy: 267, 220 - size: 8, 8 - orig: 8, 8 + xy: 501, 255 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-blackstone3 rotate: false - xy: 277, 230 - size: 8, 8 - orig: 8, 8 + xy: 365, 85 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-grass1 rotate: false - xy: 287, 240 - size: 8, 8 - orig: 8, 8 + xy: 399, 119 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-grass2 rotate: false - xy: 277, 220 - size: 8, 8 - orig: 8, 8 + xy: 433, 153 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-grass3 rotate: false - xy: 287, 230 - size: 8, 8 - orig: 8, 8 + xy: 467, 187 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-ice1 rotate: false - xy: 297, 240 - size: 8, 8 - orig: 8, 8 + xy: 501, 221 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-ice2 rotate: false - xy: 287, 220 - size: 8, 8 - orig: 8, 8 + xy: 399, 85 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-ice3 rotate: false - xy: 297, 230 - size: 8, 8 - orig: 8, 8 + xy: 433, 119 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-sand1 rotate: false - xy: 307, 240 - size: 8, 8 - orig: 8, 8 + xy: 467, 153 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-sand2 rotate: false - xy: 297, 220 - size: 8, 8 - orig: 8, 8 + xy: 501, 187 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-sand3 rotate: false - xy: 307, 230 - size: 8, 8 - orig: 8, 8 + xy: 433, 85 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-snow1 rotate: false - xy: 317, 240 - size: 8, 8 - orig: 8, 8 + xy: 467, 119 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-snow2 rotate: false - xy: 307, 220 - size: 8, 8 - orig: 8, 8 + xy: 501, 153 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-snow3 rotate: false - xy: 317, 230 - size: 8, 8 - orig: 8, 8 + xy: 467, 85 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-stone1 rotate: false - xy: 327, 240 - size: 8, 8 - orig: 8, 8 + xy: 501, 119 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-stone2 rotate: false - xy: 317, 220 - size: 8, 8 - orig: 8, 8 + xy: 501, 85 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-lead-stone3 rotate: false - xy: 327, 230 - size: 8, 8 - orig: 8, 8 + xy: 265, 50 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-blackstone1 rotate: false - xy: 337, 240 - size: 8, 8 - orig: 8, 8 + xy: 265, 16 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-blackstone2 rotate: false - xy: 327, 220 - size: 8, 8 - orig: 8, 8 + xy: 299, 51 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-blackstone3 rotate: false - xy: 337, 230 - size: 8, 8 - orig: 8, 8 + xy: 299, 17 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-grass1 rotate: false - xy: 347, 240 - size: 8, 8 - orig: 8, 8 + xy: 333, 51 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-grass2 rotate: false - xy: 337, 220 - size: 8, 8 - orig: 8, 8 + xy: 333, 17 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-grass3 rotate: false - xy: 347, 230 - size: 8, 8 - orig: 8, 8 + xy: 367, 51 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-ice1 rotate: false - xy: 357, 240 - size: 8, 8 - orig: 8, 8 + xy: 367, 17 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-ice2 rotate: false - xy: 347, 220 - size: 8, 8 - orig: 8, 8 + xy: 401, 51 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-ice3 rotate: false - xy: 357, 230 - size: 8, 8 - orig: 8, 8 + xy: 401, 17 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-sand1 rotate: false - xy: 367, 240 - size: 8, 8 - orig: 8, 8 + xy: 435, 51 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-sand2 rotate: false - xy: 357, 220 - size: 8, 8 - orig: 8, 8 + xy: 435, 17 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-sand3 rotate: false - xy: 367, 230 - size: 8, 8 - orig: 8, 8 + xy: 469, 51 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-snow1 rotate: false - xy: 377, 240 - size: 8, 8 - orig: 8, 8 + xy: 469, 17 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-snow2 rotate: false - xy: 367, 220 - size: 8, 8 - orig: 8, 8 + xy: 503, 51 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-snow3 rotate: false - xy: 377, 230 - size: 8, 8 - orig: 8, 8 + xy: 503, 17 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-stone1 rotate: false - xy: 387, 240 - size: 8, 8 - orig: 8, 8 + xy: 535, 299 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-stone2 rotate: false - xy: 377, 220 - size: 8, 8 - orig: 8, 8 + xy: 569, 299 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-thorium-stone3 rotate: false - xy: 387, 230 - size: 8, 8 - orig: 8, 8 + xy: 535, 265 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-blackstone1 rotate: false - xy: 397, 240 - size: 8, 8 - orig: 8, 8 + xy: 535, 231 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-blackstone2 rotate: false - xy: 387, 220 - size: 8, 8 - orig: 8, 8 + xy: 569, 265 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-blackstone3 rotate: false - xy: 397, 230 - size: 8, 8 - orig: 8, 8 + xy: 535, 197 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-grass1 rotate: false - xy: 407, 240 - size: 8, 8 - orig: 8, 8 + xy: 569, 231 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-grass2 rotate: false - xy: 397, 220 - size: 8, 8 - orig: 8, 8 + xy: 535, 163 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-grass3 rotate: false - xy: 407, 230 - size: 8, 8 - orig: 8, 8 + xy: 569, 197 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-ice1 rotate: false - xy: 417, 240 - size: 8, 8 - orig: 8, 8 + xy: 535, 129 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-ice2 rotate: false - xy: 407, 220 - size: 8, 8 - orig: 8, 8 + xy: 569, 163 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-ice3 rotate: false - xy: 417, 230 - size: 8, 8 - orig: 8, 8 + xy: 535, 95 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-sand1 rotate: false - xy: 427, 240 - size: 8, 8 - orig: 8, 8 + xy: 569, 129 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-sand2 rotate: false - xy: 417, 220 - size: 8, 8 - orig: 8, 8 + xy: 569, 95 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-sand3 rotate: false - xy: 427, 230 - size: 8, 8 - orig: 8, 8 + xy: 537, 61 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-snow1 rotate: false - xy: 437, 240 - size: 8, 8 - orig: 8, 8 + xy: 537, 27 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-snow2 rotate: false - xy: 427, 220 - size: 8, 8 - orig: 8, 8 + xy: 571, 61 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-snow3 rotate: false - xy: 437, 230 - size: 8, 8 - orig: 8, 8 + xy: 571, 27 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-stone1 rotate: false - xy: 447, 240 - size: 8, 8 - orig: 8, 8 + xy: 603, 286 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-stone2 rotate: false - xy: 437, 220 - size: 8, 8 - orig: 8, 8 + xy: 603, 252 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 ore-titanium-stone3 rotate: false - xy: 447, 230 - size: 8, 8 - orig: 8, 8 + xy: 603, 218 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 sand-cliff-edge rotate: false - xy: 527, 242 - size: 8, 8 - orig: 8, 8 + xy: 659, 570 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 sand-cliff-edge-1 rotate: false - xy: 527, 232 - size: 8, 8 - orig: 8, 8 + xy: 659, 536 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 sand-cliff-edge-2 rotate: false - xy: 517, 222 - size: 8, 8 - orig: 8, 8 + xy: 693, 803 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 sand-cliff-side rotate: false - xy: 537, 242 - size: 8, 8 - orig: 8, 8 + xy: 693, 769 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 snow-cliff-edge rotate: false - xy: 567, 232 - size: 8, 8 - orig: 8, 8 + xy: 773, 822 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 snow-cliff-edge-1 rotate: false - xy: 557, 222 - size: 8, 8 - orig: 8, 8 + xy: 807, 822 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 snow-cliff-edge-2 rotate: false - xy: 567, 222 - size: 8, 8 - orig: 8, 8 + xy: 841, 822 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 snow-cliff-side rotate: false - xy: 195, 142 - size: 8, 8 - orig: 8, 8 + xy: 727, 782 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 space-cliff-edge rotate: false - xy: 194, 122 - size: 8, 8 - orig: 8, 8 + xy: 727, 714 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 space-cliff-edge-1 rotate: false - xy: 194, 112 - size: 8, 8 - orig: 8, 8 + xy: 727, 680 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 space-cliff-edge-2 rotate: false - xy: 194, 102 - size: 8, 8 - orig: 8, 8 + xy: 727, 646 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 space-cliff-side rotate: false - xy: 194, 92 - size: 8, 8 - orig: 8, 8 + xy: 727, 612 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 tar-cliff-edge rotate: false - xy: 194, 82 - size: 8, 8 - orig: 8, 8 + xy: 761, 714 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 tar-cliff-edge-1 rotate: false - xy: 204, 82 - size: 8, 8 - orig: 8, 8 + xy: 761, 680 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 tar-cliff-edge-2 rotate: false - xy: 193, 72 - size: 8, 8 - orig: 8, 8 + xy: 761, 646 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 tar-cliff-side rotate: false - xy: 193, 62 - size: 8, 8 - orig: 8, 8 + xy: 761, 612 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 unit-icon-dagger rotate: false - xy: 726, 387 - size: 12, 12 - orig: 12, 12 + xy: 779, 1089 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 unit-icon-fortress rotate: false - xy: 584, 342 - size: 16, 16 - orig: 16, 16 + xy: 983, 1587 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 unit-icon-titan rotate: false - xy: 602, 360 - size: 16, 16 - orig: 16, 16 + xy: 1049, 1653 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 unit-icon-wraith rotate: false - xy: 986, 349 - size: 12, 12 - orig: 12, 12 + xy: 829, 1139 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 wraith rotate: false - xy: 986, 349 - size: 12, 12 - orig: 12, 12 + xy: 829, 1139 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 item-biomatter rotate: false - xy: 143, 58 - size: 8, 8 - orig: 8, 8 + xy: 1015, 887 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-blast-compound rotate: false - xy: 153, 68 - size: 8, 8 - orig: 8, 8 + xy: 1049, 887 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-coal rotate: false - xy: 163, 78 - size: 8, 8 - orig: 8, 8 + xy: 983, 1429 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-copper rotate: false - xy: 153, 58 - size: 8, 8 - orig: 8, 8 + xy: 1305, 1752 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-dense-alloy rotate: false - xy: 163, 68 - size: 8, 8 - orig: 8, 8 + xy: 1339, 1759 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-lead rotate: false - xy: 173, 78 - size: 8, 8 - orig: 8, 8 + xy: 1373, 1759 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-phase-fabric rotate: false - xy: 163, 58 - size: 8, 8 - orig: 8, 8 + xy: 1407, 1759 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-plastanium rotate: false - xy: 173, 68 - size: 8, 8 - orig: 8, 8 + xy: 1441, 1759 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-pyratite rotate: false - xy: 183, 78 - size: 8, 8 - orig: 8, 8 + xy: 1475, 1759 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-sand rotate: false - xy: 173, 58 - size: 8, 8 - orig: 8, 8 + xy: 1509, 1759 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-silicon rotate: false - xy: 183, 68 - size: 8, 8 - orig: 8, 8 + xy: 879, 863 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-stone rotate: false - xy: 183, 58 - size: 8, 8 - orig: 8, 8 + xy: 913, 863 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-surge-alloy rotate: false - xy: 103, 48 - size: 8, 8 - orig: 8, 8 + xy: 947, 863 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-thorium rotate: false - xy: 113, 48 - size: 8, 8 - orig: 8, 8 + xy: 981, 863 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 item-titanium rotate: false - xy: 123, 48 - size: 8, 8 - orig: 8, 8 + xy: 1015, 853 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 liquid-icon rotate: false - xy: 1004, 375 - size: 8, 8 - orig: 8, 8 + xy: 845, 856 + size: 32, 32 + orig: 32, 32 offset: 0, 0 index: -1 alpha-mech rotate: false - xy: 197, 166 - size: 12, 12 - orig: 12, 12 + xy: 1648, 1801 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 alpha-mech-base rotate: false - xy: 197, 152 - size: 12, 12 - orig: 12, 12 + xy: 1698, 1801 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 alpha-mech-leg rotate: false - xy: 274, 324 - size: 12, 12 - orig: 12, 12 + xy: 1748, 1801 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 delta-mech rotate: false - xy: 628, 306 - size: 12, 12 - orig: 12, 12 + xy: 629, 1289 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 delta-mech-base rotate: false - xy: 632, 320 - size: 12, 12 - orig: 12, 12 + xy: 629, 1239 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 delta-mech-leg rotate: false - xy: 634, 292 - size: 12, 12 - orig: 12, 12 + xy: 679, 1289 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 omega-mech rotate: false - xy: 68, 124 - size: 14, 14 - orig: 14, 14 + xy: 1115, 1595 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 omega-mech-armor rotate: false - xy: 68, 108 - size: 14, 14 - orig: 14, 14 + xy: 1181, 1661 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 omega-mech-base rotate: false - xy: 68, 92 - size: 14, 14 - orig: 14, 14 + xy: 1247, 1728 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 omega-mech-leg rotate: false - xy: 67, 76 - size: 14, 14 - orig: 14, 14 + xy: 1312, 1793 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 tau-mech rotate: false - xy: 620, 334 - size: 14, 14 - orig: 14, 14 + xy: 1486, 1793 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 tau-mech-base rotate: false - xy: 998, 419 - size: 12, 12 - orig: 12, 12 + xy: 679, 989 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 tau-mech-leg rotate: false - xy: 998, 405 - size: 12, 12 - orig: 12, 12 + xy: 729, 1039 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 dart-ship rotate: false - xy: 620, 278 - size: 12, 12 - orig: 12, 12 + xy: 1948, 1801 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 glaive-ship rotate: false - xy: 1, 1 - size: 14, 14 - orig: 14, 14 + xy: 1988, 1991 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 mech-icon-glaive-ship rotate: false - xy: 1, 1 - size: 14, 14 - orig: 14, 14 + xy: 1988, 1991 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 javelin-ship rotate: false - xy: 634, 264 - size: 12, 12 - orig: 12, 12 + xy: 679, 1139 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 mech-icon-javelin-ship rotate: false - xy: 634, 264 - size: 12, 12 - orig: 12, 12 + xy: 679, 1139 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 javelin-ship-shield rotate: false - xy: 648, 264 - size: 12, 12 - orig: 12, 12 + xy: 729, 1189 + size: 48, 48 + orig: 48, 48 + offset: 0, 0 + index: -1 +blank + rotate: false + xy: 258, 1828 + size: 1, 1 + orig: 1, 1 offset: 0, 0 index: -1 circle rotate: false - xy: 1, 310 + xy: 1, 1758 size: 201, 201 orig: 201, 201 offset: 0, 0 index: -1 +clear + rotate: false + xy: 2046, 2046 + size: 1, 1 + orig: 1, 1 + offset: 0, 0 + index: -1 shape-3 rotate: false - xy: 204, 401 + xy: 1247, 1786 size: 63, 63 orig: 63, 63 offset: 0, 0 index: -1 button rotate: false - xy: 486, 484 + xy: 621, 784 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5285,7 +5194,7 @@ button index: -1 button-down rotate: false - xy: 204, 322 + xy: 594, 1841 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5293,7 +5202,7 @@ button-down index: -1 button-edge-1 rotate: false - xy: 334, 484 + xy: 729, 1010 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5301,7 +5210,7 @@ button-edge-1 index: -1 button-edge-2 rotate: false - xy: 1, 133 + xy: 779, 1060 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5309,7 +5218,7 @@ button-edge-2 index: -1 button-edge-3 rotate: false - xy: 372, 484 + xy: 829, 1110 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5317,7 +5226,7 @@ button-edge-3 index: -1 button-edge-4 rotate: false - xy: 1, 104 + xy: 671, 910 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5325,7 +5234,7 @@ button-edge-4 index: -1 button-over rotate: false - xy: 410, 484 + xy: 621, 842 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5333,7 +5242,7 @@ button-over index: -1 button-right rotate: false - xy: 1, 46 + xy: 729, 952 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5341,7 +5250,7 @@ button-right index: -1 button-right-down rotate: false - xy: 1, 75 + xy: 729, 981 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5349,7 +5258,7 @@ button-right-down index: -1 button-right-over rotate: false - xy: 448, 484 + xy: 621, 813 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -5357,7 +5266,7 @@ button-right-over index: -1 button-select rotate: false - xy: 366, 338 + xy: 537, 1 size: 24, 24 split: 4, 4, 4, 4 orig: 24, 24 @@ -5365,868 +5274,868 @@ button-select index: -1 check-off rotate: false - xy: 532, 450 + xy: 897, 795 size: 28, 32 orig: 28, 32 offset: 0, 0 index: -1 check-on rotate: false - xy: 562, 450 + xy: 927, 795 size: 28, 32 orig: 28, 32 offset: 0, 0 index: -1 check-on-over rotate: false - xy: 592, 450 + xy: 897, 761 size: 28, 32 orig: 28, 32 offset: 0, 0 index: -1 check-over rotate: false - xy: 439, 410 + xy: 957, 795 size: 28, 32 orig: 28, 32 offset: 0, 0 index: -1 clear rotate: false - xy: 950, 397 + xy: 582, 1990 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 cursor rotate: false - xy: 998, 399 + xy: 773, 816 size: 4, 4 orig: 4, 4 offset: 0, 0 index: -1 discord-banner rotate: false - xy: 204, 466 + xy: 582, 2002 size: 84, 45 orig: 84, 45 offset: 0, 0 index: -1 empty-sector rotate: false - xy: 983, 479 + xy: 2014, 1855 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 icon-crafting rotate: false - xy: 266, 278 + xy: 927, 675 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-defense rotate: false - xy: 279, 260 + xy: 671, 137 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-distribution rotate: false - xy: 284, 278 + xy: 563, 9 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-effect rotate: false - xy: 297, 260 + xy: 987, 727 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-liquid rotate: false - xy: 374, 278 + xy: 963, 675 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-power rotate: false - xy: 459, 260 + xy: 1013, 747 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-production rotate: false - xy: 476, 324 + xy: 1031, 765 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-turret rotate: false - xy: 510, 306 + xy: 927, 657 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-units rotate: false - xy: 482, 270 + xy: 963, 657 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-upgrade rotate: false - xy: 518, 270 + xy: 1067, 801 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 controller-cursor rotate: false - xy: 986, 381 + xy: 965, 1073 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-about rotate: false - xy: 53, 188 + xy: 913, 1135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-add rotate: false - xy: 17, 1 + xy: 535, 341 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-admin rotate: false - xy: 33, 1 + xy: 1323, 1736 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-admin-small rotate: false - xy: 1017, 505 + xy: 660, 1994 size: 6, 6 orig: 6, 6 offset: 0, 0 index: -1 icon-areaDelete rotate: false - xy: 302, 334 + xy: 767, 1027 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow rotate: false - xy: 125, 190 + xy: 204, 1759 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-arrow-16 rotate: false - xy: 125, 190 + xy: 204, 1759 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-arrow-down rotate: false - xy: 302, 322 + xy: 245, 344 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-left rotate: false - xy: 740, 389 + xy: 727, 825 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-right rotate: false - xy: 274, 312 + xy: 817, 1077 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-up rotate: false - xy: 635, 420 + xy: 582, 1978 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-back rotate: false - xy: 143, 190 + xy: 632, 1852 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-ban rotate: false - xy: 49, 1 + xy: 929, 1135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-break rotate: false - xy: 161, 190 + xy: 1173, 1601 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-cancel rotate: false - xy: 179, 190 + xy: 983, 1039 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-chat rotate: false - xy: 636, 408 + xy: 582, 1966 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-check rotate: false - xy: 418, 298 + xy: 1017, 1445 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-copy rotate: false - xy: 436, 296 + xy: 1305, 1734 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-cursor rotate: false - xy: 636, 396 + xy: 935, 1123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-dev-builds rotate: false - xy: 242, 322 + xy: 817, 1060 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-discord rotate: false - xy: 189, 242 + xy: 299, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-donate rotate: false - xy: 69, 188 + xy: 315, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-dots rotate: false - xy: 256, 296 + xy: 331, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-editor rotate: false - xy: 602, 326 + xy: 347, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-egg rotate: false - xy: 69, 172 + xy: 363, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-elevation rotate: false - xy: 302, 278 + xy: 21, 3 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-eraser rotate: false - xy: 315, 260 + xy: 222, 1759 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-exit rotate: false - xy: 272, 296 + xy: 379, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-file rotate: false - xy: 320, 278 + xy: 945, 675 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-file-image rotate: false - xy: 333, 260 + xy: 671, 119 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-file-text rotate: false - xy: 258, 322 + xy: 395, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-fill rotate: false - xy: 338, 278 + xy: 581, 9 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-floppy rotate: false - xy: 288, 296 + xy: 411, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-floppy-16 rotate: false - xy: 351, 260 + xy: 987, 709 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-folder rotate: false - xy: 304, 296 + xy: 427, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder-parent rotate: false - xy: 320, 296 + xy: 443, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-generated rotate: false - xy: 204, 351 + xy: 629, 1089 size: 48, 48 orig: 48, 48 offset: 0, 0 index: -1 icon-github rotate: false - xy: 336, 296 + xy: 459, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-google-play rotate: false - xy: 352, 296 + xy: 475, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-grid rotate: false - xy: 356, 278 + xy: 39, 3 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-hold rotate: false - xy: 648, 397 + xy: 659, 859 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-holdDelete rotate: false - xy: 636, 384 + xy: 659, 847 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-home rotate: false - xy: 368, 296 + xy: 491, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-host rotate: false - xy: 384, 296 + xy: 507, 1 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-info rotate: false - xy: 660, 397 + xy: 729, 940 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-itch.io rotate: false - xy: 620, 398 + xy: 1067, 767 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-item rotate: false - xy: 648, 385 + xy: 603, 321 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-items-none rotate: false - xy: 143, 68 + xy: 594, 1831 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-line rotate: false - xy: 369, 260 + xy: 240, 1759 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-link rotate: false - xy: 620, 382 + xy: 1067, 751 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-liquid-small rotate: false - xy: 636, 372 + xy: 833, 1064 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-load rotate: false - xy: 620, 366 + xy: 673, 103 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-load-image rotate: false - xy: 387, 260 + xy: 57, 3 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-load-map rotate: false - xy: 392, 278 + xy: 863, 480 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-loading rotate: false - xy: 410, 280 + xy: 1013, 801 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-locked rotate: false - xy: 428, 278 + xy: 1013, 783 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-logic rotate: false - xy: 660, 385 + xy: 265, 4 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-map rotate: false - xy: 620, 350 + xy: 673, 87 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-menu rotate: false - xy: 648, 373 + xy: 523, 5 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu-large rotate: false - xy: 446, 278 + xy: 1031, 801 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-missing rotate: false - xy: 636, 360 + xy: 935, 1111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-mission-background rotate: false - xy: 986, 459 + xy: 1, 1 size: 18, 18 orig: 18, 18 offset: 0, 0 index: -1 icon-mission-battle rotate: false - xy: 648, 361 + xy: 947, 1113 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-mission-defense rotate: false - xy: 660, 373 + xy: 947, 1101 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-mission-done rotate: false - xy: 636, 348 + xy: 277, 4 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-none rotate: false - xy: 648, 349 + xy: 658, 490 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-nullitem rotate: false - xy: 153, 78 + xy: 903, 1345 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-paste rotate: false - xy: 405, 260 + xy: 1013, 765 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-pause rotate: false - xy: 660, 361 + xy: 655, 478 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pencil rotate: false - xy: 423, 260 + xy: 1031, 783 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-pencil-small rotate: false - xy: 191, 226 + xy: 673, 71 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-pick rotate: false - xy: 441, 260 + xy: 1049, 801 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-play rotate: false - xy: 636, 336 + xy: 670, 490 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-play-2 rotate: false - xy: 191, 210 + xy: 673, 55 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-players rotate: false - xy: 648, 337 + xy: 655, 466 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-power-small rotate: false - xy: 660, 349 + xy: 667, 478 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-quit rotate: false - xy: 85, 174 + xy: 673, 39 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-redo rotate: false - xy: 494, 324 + xy: 1049, 783 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-refresh rotate: false - xy: 101, 174 + xy: 673, 23 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rename rotate: false - xy: 117, 174 + xy: 881, 482 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-resize rotate: false - xy: 474, 306 + xy: 1031, 747 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-rotate rotate: false - xy: 133, 174 + xy: 1323, 1720 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-arrow rotate: false - xy: 149, 174 + xy: 2032, 1839 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-left rotate: false - xy: 165, 174 + xy: 2032, 1823 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-right rotate: false - xy: 181, 174 + xy: 2032, 1807 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save rotate: false - xy: 590, 290 + xy: 2032, 1791 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save-image rotate: false - xy: 492, 306 + xy: 1049, 765 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-save-map rotate: false - xy: 464, 284 + xy: 1049, 747 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-settings rotate: false - xy: 660, 337 + xy: 655, 454 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-terrain rotate: false - xy: 482, 288 + xy: 1191, 1601 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-tools rotate: false - xy: 590, 274 + xy: 75, 5 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-touch rotate: false - xy: 672, 387 + xy: 667, 466 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-touchDelete rotate: false - xy: 672, 375 + xy: 655, 442 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-trash rotate: false - xy: 69, 156 + xy: 923, 641 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-trash-16 rotate: false - xy: 500, 288 + xy: 1017, 1427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-trello rotate: false - xy: 85, 158 + xy: 923, 625 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-tutorial rotate: false - xy: 101, 158 + xy: 939, 641 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-undo rotate: false - xy: 518, 288 + xy: 945, 657 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-unlocked rotate: false - xy: 500, 270 + xy: 987, 691 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-unlocks rotate: false - xy: 117, 158 + xy: 939, 625 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-wiki rotate: false - xy: 133, 158 + xy: 955, 641 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-zoom rotate: false - xy: 477, 252 + xy: 1067, 783 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-zoom-small rotate: false - xy: 149, 158 + xy: 955, 625 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 info-banner rotate: false - xy: 1, 240 + xy: 1, 21 size: 84, 45 orig: 84, 45 offset: 0, 0 index: -1 inventory rotate: false - xy: 752, 437 + xy: 987, 787 size: 24, 40 split: 10, 10, 10, 14 orig: 24, 40 @@ -6234,14 +6143,14 @@ inventory index: -1 logotext rotate: false - xy: 1, 287 - size: 89, 21 - orig: 89, 21 + xy: 1, 1961 + size: 579, 86 + orig: 579, 86 offset: 0, 0 index: -1 pane rotate: false - xy: 524, 484 + xy: 621, 650 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -6249,7 +6158,7 @@ pane index: -1 pane-2 rotate: false - xy: 1, 17 + xy: 621, 679 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -6257,7 +6166,7 @@ pane-2 index: -1 scroll rotate: false - xy: 882, 416 + xy: 897, 622 size: 24, 35 split: 10, 10, 6, 5 orig: 24, 35 @@ -6265,7 +6174,7 @@ scroll index: -1 scroll-horizontal rotate: false - xy: 638, 487 + xy: 621, 490 size: 35, 24 split: 6, 5, 10, 10 orig: 35, 24 @@ -6273,7 +6182,7 @@ scroll-horizontal index: -1 scroll-knob-horizontal-black rotate: false - xy: 1, 162 + xy: 621, 871 size: 40, 24 split: 11, 10, 10, 10 orig: 40, 24 @@ -6281,7 +6190,7 @@ scroll-knob-horizontal-black index: -1 scroll-knob-vertical-black rotate: false - xy: 65, 1 + xy: 987, 745 size: 24, 40 split: 10, 10, 6, 10 orig: 24, 40 @@ -6289,63 +6198,63 @@ scroll-knob-vertical-black index: -1 sector-edge rotate: false - xy: 371, 416 + xy: 693, 633 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 sector-select rotate: false - xy: 405, 450 + xy: 693, 599 size: 32, 32 orig: 32, 32 offset: 0, 0 index: -1 selection rotate: false - xy: 303, 398 + xy: 767, 952 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 slider rotate: false - xy: 879, 417 + xy: 258, 1818 size: 1, 8 orig: 1, 8 offset: 0, 0 index: -1 slider-knob rotate: false - xy: 439, 444 + xy: 863, 578 size: 29, 38 orig: 29, 38 offset: 0, 0 index: -1 slider-knob-down rotate: false - xy: 470, 444 + xy: 863, 538 size: 29, 38 orig: 29, 38 offset: 0, 0 index: -1 slider-knob-over rotate: false - xy: 501, 444 + xy: 863, 498 size: 29, 38 orig: 29, 38 offset: 0, 0 index: -1 slider-vertical rotate: false - xy: 638, 484 + xy: 767, 955 size: 8, 1 orig: 8, 1 offset: 0, 0 index: -1 underline rotate: false - xy: 600, 484 + xy: 621, 516 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -6353,7 +6262,7 @@ underline index: -1 underline-2 rotate: false - xy: 562, 484 + xy: 621, 545 size: 36, 27 split: 12, 12, 12, 12 orig: 36, 27 @@ -6361,14 +6270,14 @@ underline-2 index: -1 white rotate: false - xy: 87, 282 + xy: 693, 837 size: 3, 3 orig: 3, 3 offset: 0, 0 index: -1 window-empty rotate: false - xy: 39, 99 + xy: 671, 155 size: 27, 61 split: 8, 8, 44, 11 orig: 27, 61 @@ -6376,211 +6285,204 @@ window-empty index: -1 alpha-drone rotate: false - xy: 400, 298 - size: 12, 12 - orig: 12, 12 - offset: 0, 0 - index: -1 -unit-icon-alpha-drone - rotate: false - xy: 400, 298 - size: 12, 12 - orig: 12, 12 + xy: 1598, 1801 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 dagger rotate: false - xy: 606, 292 - size: 12, 12 - orig: 12, 12 + xy: 753, 1339 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 dagger-base rotate: false - xy: 606, 278 - size: 12, 12 - orig: 12, 12 + xy: 803, 1339 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 dagger-leg rotate: false - xy: 620, 292 - size: 12, 12 - orig: 12, 12 + xy: 853, 1339 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 fortress rotate: false - xy: 261, 260 - size: 16, 16 - orig: 16, 16 + xy: 653, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 fortress-base rotate: false - xy: 89, 190 - size: 16, 16 - orig: 16, 16 + xy: 653, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 titan-base rotate: false - xy: 89, 190 - size: 16, 16 - orig: 16, 16 + xy: 653, 1719 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 fortress-leg rotate: false - xy: 107, 190 - size: 16, 16 - orig: 16, 16 + xy: 719, 1785 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 ghoul rotate: false - xy: 960, 433 - size: 18, 18 - orig: 18, 18 + xy: 555, 1193 + size: 72, 72 + orig: 72, 72 offset: 0, 0 index: -1 unit-icon-ghoul rotate: false - xy: 960, 433 - size: 18, 18 - orig: 18, 18 + xy: 555, 1193 + size: 72, 72 + orig: 72, 72 offset: 0, 0 index: -1 phantom rotate: false - xy: 67, 60 - size: 14, 14 - orig: 14, 14 + xy: 1370, 1793 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 unit-icon-phantom rotate: false - xy: 67, 60 - size: 14, 14 - orig: 14, 14 + xy: 1370, 1793 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 power-cell rotate: false - xy: 67, 44 - size: 14, 14 - orig: 14, 14 + xy: 1428, 1793 + size: 56, 56 + orig: 56, 56 offset: 0, 0 index: -1 revenant rotate: false - xy: 469, 414 - size: 28, 28 - orig: 28, 28 + xy: 131, 344 + size: 112, 112 + orig: 112, 112 offset: 0, 0 index: -1 unit-icon-revenant rotate: false - xy: 469, 414 - size: 28, 28 - orig: 28, 28 + xy: 131, 344 + size: 112, 112 + orig: 112, 112 offset: 0, 0 index: -1 spirit rotate: false - xy: 655, 250 - size: 12, 12 - orig: 12, 12 + xy: 729, 1089 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 unit-icon-spirit rotate: false - xy: 655, 250 - size: 12, 12 - orig: 12, 12 + xy: 729, 1089 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 titan rotate: false - xy: 566, 324 - size: 16, 16 - orig: 16, 16 + xy: 785, 1389 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 titan-leg rotate: false - xy: 564, 306 - size: 16, 16 - orig: 16, 16 + xy: 851, 1455 + size: 64, 64 + orig: 64, 64 offset: 0, 0 index: -1 artillery-equip rotate: false - xy: 618, 320 - size: 12, 12 - orig: 12, 12 + xy: 1798, 1801 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 blaster-equip rotate: false - xy: 288, 318 - size: 12, 12 - orig: 12, 12 + xy: 1898, 1801 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 bomber-equip rotate: false - xy: 600, 306 - size: 12, 12 - orig: 12, 12 + xy: 653, 1339 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 missiles-equip rotate: false - xy: 600, 306 - size: 12, 12 - orig: 12, 12 + xy: 653, 1339 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 chain-blaster-equip rotate: false - xy: 614, 306 - size: 12, 12 - orig: 12, 12 + xy: 703, 1339 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 flakgun-equip rotate: false - xy: 648, 292 - size: 12, 12 - orig: 12, 12 + xy: 729, 1289 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 flamethrower-equip rotate: false - xy: 648, 278 - size: 12, 12 - orig: 12, 12 + xy: 629, 1139 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 heal-blaster-equip rotate: false - xy: 606, 264 - size: 12, 12 - orig: 12, 12 + xy: 729, 1239 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 shockgun-equip rotate: false - xy: 613, 236 - size: 12, 12 - orig: 12, 12 + xy: 829, 1239 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 swarmer-equip rotate: false - xy: 1006, 447 - size: 12, 12 - orig: 12, 12 + xy: 829, 1189 + size: 48, 48 + orig: 48, 48 offset: 0, 0 index: -1 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 83413e6262..eb3273ed02 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/assets/ui/uiskin.json b/core/assets/ui/uiskin.json index 6ca21b566a..c2420b9fcb 100644 --- a/core/assets/ui/uiskin.json +++ b/core/assets/ui/uiskin.json @@ -26,7 +26,7 @@ TextButtonStyle: { default: {over: button-over, disabled: button, font: default-font, fontColor: white, disabledFontColor: gray, down: button-down, up: button}, right: {over: button-right-over, font: default-font, fontColor: white, disabledFontColor: gray, down: button-right-down, up: button-right}, wave: {font: default-font, fontColor: white, disabledFontColor: gray, up: button-edge-4}, - clear: {over: flat-over, font: default-font, fontColor: white, disabledFontColor: gray, down: pane, up: flat}, + clear: {over: flat-over, font: default-font, fontColor: white, disabledFontColor: gray, down: flat-over, up: flat}, discord: {font: default-font, fontColor: white, up: discord-banner}, info: {font: default-font, fontColor: white, up: info-banner}, clear-partial: {down: white, up: button-select, over: flat-down, font: default-font, fontColor: white, disabledFontColor: gray }, diff --git a/core/build.gradle b/core/build.gradle index abcec6d8f6..f4c5695bbb 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,4 +1,8 @@ apply plugin: "java" sourceCompatibility = 1.8 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' -sourceSets.main.java.srcDirs = ["src/"] \ No newline at end of file +sourceSets.main.java.srcDirs = ["src/"] + +compileJava{ + options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" +} \ No newline at end of file diff --git a/core/src/io/anuke/mindustry/Mindustry.java b/core/src/io/anuke/mindustry/Mindustry.java index ce5c64e8bb..c00058a403 100644 --- a/core/src/io/anuke/mindustry/Mindustry.java +++ b/core/src/io/anuke/mindustry/Mindustry.java @@ -1,20 +1,26 @@ package io.anuke.mindustry; +import io.anuke.arc.ApplicationCore; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Time; import io.anuke.mindustry.core.*; import io.anuke.mindustry.game.EventType.GameLoadEvent; import io.anuke.mindustry.io.BundleLoader; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.modules.ModuleCore; -import io.anuke.ucore.util.Log; import static io.anuke.mindustry.Vars.*; -public class Mindustry extends ModuleCore{ +public class Mindustry extends ApplicationCore{ @Override - public void init(){ - Timers.mark(); + public void setup(){ + Time.setDeltaProvider(() -> { + float result = Core.graphics.getDeltaTime() * 60f; + return Float.isNaN(result) || Float.isInfinite(result) ? 1f : Math.min(result, 60f / 10f); + }); + + Time.mark(); Vars.init(); @@ -22,26 +28,42 @@ public class Mindustry extends ModuleCore{ BundleLoader.load(); content.load(); - module(logic = new Logic()); - module(world = new World()); - module(control = new Control()); - module(renderer = new Renderer()); - module(ui = new UI()); - module(netServer = new NetServer()); - module(netClient = new NetClient()); + add(logic = new Logic()); + add(world = new World()); + add(control = new Control()); + add(renderer = new Renderer()); + add(ui = new UI()); + add(netServer = new NetServer()); + add(netClient = new NetClient()); } @Override - public void postInit(){ - Log.info("Time to load [total]: {0}", Timers.elapsed()); + public void init(){ + super.init(); + + Log.info("Time to load [total]: {0}", Time.elapsed()); Events.fire(new GameLoadEvent()); } @Override - public void render(){ - threads.handleBeginRender(); - super.render(); - threads.handleEndRender(); + public void update(){ + long lastFrameTime = Time.millis(); + + super.update(); + + int fpsCap = Core.settings.getInt("fpscap", 125); + + if(fpsCap <= 120){ + long target = 1000/fpsCap; + long elapsed = Time.timeSinceMillis(lastFrameTime); + if(elapsed < target){ + try{ + Thread.sleep(target - elapsed); + }catch(InterruptedException e){ + e.printStackTrace(); + } + } + } } } diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index 14636b4abd..f6926b3eb3 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -1,9 +1,13 @@ package io.anuke.mindustry; -import com.badlogic.gdx.Application.ApplicationType; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.Application.ApplicationType; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Entities; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.EffectEntity; +import io.anuke.arc.entities.trait.DrawTrait; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.core.*; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; @@ -17,42 +21,45 @@ import io.anuke.mindustry.game.Version; import io.anuke.mindustry.gen.Serialization; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.world.blocks.defense.ForceProjector.ShieldEntity; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.entities.Entities; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.EffectEntity; -import io.anuke.ucore.entities.trait.DrawTrait; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.util.Translator; import java.util.Arrays; import java.util.Locale; @SuppressWarnings("unchecked") public class Vars{ + /**main application name, capitalized*/ public static final String appName = "Mindustry"; + /**URL for discord invite.*/ public static final String discordURL = "https://discord.gg/mindustry"; + /**URL for Github API for releases*/ public static final String releasesURL = "https://api.github.com/repos/Anuken/Mindustry/releases"; + /**URL for Github API for contributors*/ public static final String contributorsURL = "https://api.github.com/repos/Anuken/Mindustry/contributors"; + /**URL for sending crash reports to*/ public static final String crashReportURL = "http://mindustry.us.to/report"; - //time between waves in frames (on normal mode) + /**time between waves in ticks (on normal mode)*/ public static final float wavespace = 60 * 60 * 1.5f; - + /**maximum distance between mine and core that supports automatic transferring*/ public static final float mineTransferRange = 220f; - //set ridiculously high for now + /**maximum distance from core that the player can be before it is no longer used for building*/ public static final float coreBuildRange = 999999f; - //team of the player by default + /**team of the player by default*/ public static final Team defaultTeam = Team.blue; - //team of the enemy in waves + /**team of the enemy in waves/sectors*/ public static final Team waveTeam = Team.red; - public static final float unlockResourceScaling = 1f; + /**max chat message length*/ public static final int maxTextLength = 150; + /**max player name length in bytes*/ public static final int maxNameLength = 40; + /**displayed item size when ingame, TODO remove.*/ public static final float itemSize = 5f; + /**size of tiles in units*/ public static final int tilesize = 8; + /**size of sectors in tiles*/ public static final int sectorSize = 256; + /**specific number indicating 'invalid' sector*/ public static final int invalidSector = Integer.MAX_VALUE; - public static Locale[] locales; + /**all choosable player colors in join/host dialog*/ public static final Color[] playerColors = { Color.valueOf("82759a"), Color.valueOf("c0c1c5"), @@ -71,36 +78,38 @@ public class Vars{ Color.valueOf("4b5ef1"), Color.valueOf("2cabfe"), }; - //server port + /**default server port*/ public static final int port = 6567; + /**if true, UI is not drawn*/ public static boolean disableUI; + /**if true, game is set up in mobile mode, even on desktop. used for debugging*/ public static boolean testMobile; - //shorthand for whether or not this is running on android or ios + /**whether the game is running on a mobile device*/ public static boolean mobile; + /**whether the game is running on an iOS device*/ public static boolean ios; + /**whether the game is running on an Android device*/ public static boolean android; - //main data directory + /**whether the game is running on a headless server*/ + public static boolean headless; + /**application data directory, equivalent to {@link io.anuke.arc.Settings#getDataDirectory()}*/ public static FileHandle dataDirectory; - //subdirectory for screenshots + /**data subdirectory used for screenshots*/ public static FileHandle screenshotDirectory; - //directory for user-created map data + /**data subdirectory used for custom mmaps*/ public static FileHandle customMapDirectory; - //save file directory + /**data subdirectory used for saves*/ public static FileHandle saveDirectory; - public static String mapExtension = "mmap"; - public static String saveExtension = "msav"; - //camera zoom displayed on startup - public static int baseCameraScale; - public static boolean showBlockDebug = false; - public static boolean showFog = true; - public static boolean headless = false; - public static float controllerMin = 0.25f; - public static float baseControllerSpeed = 11f; - public static boolean snapCamera = true; + /**map file extension*/ + public static final String mapExtension = "mmap"; + /**save file extension*/ + public static final String saveExtension = "msav"; + + /**list of all locales that can be switched to*/ + public static Locale[] locales; public static ContentLoader content; public static GameState state; - public static ThreadHandler threads; public static Control control; public static Logic logic; @@ -110,8 +119,6 @@ public class Vars{ public static NetServer netServer; public static NetClient netClient; - public static Player[] players = {}; - public static EntityGroup playerGroup; public static EntityGroup tileGroup; public static EntityGroup bulletGroup; @@ -122,13 +129,14 @@ public class Vars{ public static EntityGroup fireGroup; public static EntityGroup[] unitGroups; - public static final Translator[] tmptr = new Translator[]{new Translator(), new Translator(), new Translator(), new Translator()}; + /**all local players, currently only has one player. may be used for local co-op in the future*/ + public static Player[] players = {}; public static void init(){ Serialization.init(); //load locales - String[] stra = Gdx.files.internal("locales").readString().split("\n"); + String[] stra = Core.files.internal("locales").readString().split("\n"); locales = new Locale[stra.length]; for(int i = 0; i < locales.length; i++){ String code = stra[i]; @@ -167,16 +175,16 @@ public class Vars{ } state = new GameState(); - threads = new ThreadHandler(); - mobile = Gdx.app.getType() == ApplicationType.Android || Gdx.app.getType() == ApplicationType.iOS || testMobile; - ios = Gdx.app.getType() == ApplicationType.iOS; - android = Gdx.app.getType() == ApplicationType.Android; + mobile = Core.app.getType() == ApplicationType.Android || Core.app.getType() == ApplicationType.iOS || testMobile; + ios = Core.app.getType() == ApplicationType.iOS; + android = Core.app.getType() == ApplicationType.Android; - dataDirectory = Settings.getDataDirectory(appName); + Core.settings.setAppName(appName); + + dataDirectory = Core.settings.getDataDirectory(); screenshotDirectory = dataDirectory.child("screenshots/"); customMapDirectory = dataDirectory.child("maps/"); saveDirectory = dataDirectory.child("saves/"); - baseCameraScale = Math.round(Unit.dp.scl(4)); } } diff --git a/core/src/io/anuke/mindustry/ai/BlockIndexer.java b/core/src/io/anuke/mindustry/ai/BlockIndexer.java index 8bc2d080d9..9269a205bc 100644 --- a/core/src/io/anuke/mindustry/ai/BlockIndexer.java +++ b/core/src/io/anuke/mindustry/ai/BlockIndexer.java @@ -1,7 +1,10 @@ package io.anuke.mindustry.ai; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.*; +import io.anuke.arc.Events; +import io.anuke.arc.collection.*; +import io.anuke.arc.function.Predicate; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.game.EventType.TileChangeEvent; @@ -11,12 +14,6 @@ import io.anuke.mindustry.game.Teams.TeamData; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockFlag; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.function.Predicate; -import io.anuke.ucore.util.EnumSet; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.ThreadArray; import static io.anuke.mindustry.Vars.*; @@ -47,7 +44,7 @@ public class BlockIndexer{ /**Empty set used for returning.*/ private ObjectSet emptySet = new ObjectSet<>(); /**Array used for returning and reusing.*/ - private Array returnArray = new ThreadArray<>(); + private Array returnArray = new Array<>(); public BlockIndexer(){ Events.on(TileChangeEvent.class, event -> { @@ -176,7 +173,7 @@ public class BlockIndexer{ TileEntity e = other.entity; - float ndst = Vector2.dst(x, y, e.x, e.y); + float ndst = Mathf.dst(x, y, e.x, e.y); if(ndst < range && (closest == null || ndst < dst)){ dst = ndst; closest = e; diff --git a/core/src/io/anuke/mindustry/ai/Pathfinder.java b/core/src/io/anuke/mindustry/ai/Pathfinder.java index 0de1e8c7cd..958911ccba 100644 --- a/core/src/io/anuke/mindustry/ai/Pathfinder.java +++ b/core/src/io/anuke/mindustry/ai/Pathfinder.java @@ -1,9 +1,12 @@ package io.anuke.mindustry.ai; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.IntArray; -import com.badlogic.gdx.utils.Queue; -import com.badlogic.gdx.utils.TimeUtils; +import io.anuke.arc.Events; +import io.anuke.arc.collection.IntArray; +import io.anuke.arc.collection.Queue; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.util.Structs; +import io.anuke.arc.util.Time; import io.anuke.mindustry.game.EventType.TileChangeEvent; import io.anuke.mindustry.game.EventType.WorldLoadEvent; import io.anuke.mindustry.game.Team; @@ -11,16 +14,12 @@ import io.anuke.mindustry.game.Teams.TeamData; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockFlag; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Structs; import static io.anuke.mindustry.Vars.state; import static io.anuke.mindustry.Vars.world; public class Pathfinder{ - private long maxUpdate = TimeUtils.millisToNanos(4); + private long maxUpdate = Time.millisToNanos(4); private PathData[] paths; private IntArray blocked = new IntArray(); @@ -63,7 +62,7 @@ public class Pathfinder{ Tile target = null; float tl = 0f; - for(GridPoint2 point : Geometry.d8){ + for(Point2 point : Geometry.d8){ int dx = tile.x + point.x, dy = tile.y + point.y; Tile other = world.tile(dx, dy); @@ -105,7 +104,7 @@ public class Pathfinder{ //increment search, clear frontier path.search++; path.frontier.clear(); - path.lastSearchTime = TimeUtils.millis(); + path.lastSearchTime = Time.millis(); //add all targets to the frontier for(Tile other : world.indexer.getEnemy(team, BlockFlag.target)){ @@ -144,14 +143,14 @@ public class Pathfinder{ private void updateFrontier(Team team, long nsToRun){ PathData path = paths[team.ordinal()]; - long start = TimeUtils.nanoTime(); + long start = Time.nanoTime(); - while(path.frontier.size > 0 && (nsToRun < 0 || TimeUtils.timeSinceNanos(start) <= nsToRun)){ + while(path.frontier.size > 0 && (nsToRun < 0 || Time.timeSinceNanos(start) <= nsToRun)){ Tile tile = path.frontier.removeLast(); float cost = path.weights[tile.x][tile.y]; if(cost < Float.MAX_VALUE){ - for(GridPoint2 point : Geometry.d4){ + for(Point2 point : Geometry.d4){ int dx = tile.x + point.x, dy = tile.y + point.y; Tile other = world.tile(dx, dy); @@ -168,7 +167,7 @@ public class Pathfinder{ } private void clear(){ - Timers.mark(); + Time.mark(); paths = new PathData[Team.all.length]; blocked.clear(); diff --git a/core/src/io/anuke/mindustry/ai/WaveSpawner.java b/core/src/io/anuke/mindustry/ai/WaveSpawner.java index 897cdcda3f..414daba785 100644 --- a/core/src/io/anuke/mindustry/ai/WaveSpawner.java +++ b/core/src/io/anuke/mindustry/ai/WaveSpawner.java @@ -1,6 +1,10 @@ package io.anuke.mindustry.ai; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.GridBits; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Structs; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.Squad; @@ -9,10 +13,6 @@ import io.anuke.mindustry.game.SpawnGroup; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Waves; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.util.GridBits; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Structs; import java.io.DataInput; import java.io.DataOutput; @@ -32,7 +32,7 @@ public class WaveSpawner{ private Array groundSpawns = new Array<>(); public WaveSpawner(){ - Events.on(WorldLoadEvent.class, this::reset); + Events.on(WorldLoadEvent.class, e -> reset()); } public void write(DataOutput output) throws IOException{ @@ -115,8 +115,8 @@ public class WaveSpawner{ FlyerSpawn spawn = flySpawns.get(flyCount); float margin = 40f; //how far away from the edge flying units spawn - spawnX = world.width() * tilesize / 2f + Mathf.sqrwavex(spawn.angle) * (world.width() / 2f * tilesize + margin); - spawnY = world.height() * tilesize / 2f + Mathf.sqrwavey(spawn.angle) * (world.height() / 2f * tilesize + margin); + spawnX = world.width() * tilesize / 2f + sqrwavex(spawn.angle) * (world.width() / 2f * tilesize + margin); + spawnY = world.height() * tilesize / 2f + sqrwavey(spawn.angle) * (world.height() / 2f * tilesize + margin); spread = margin / 1.5f; flyCount++; @@ -172,7 +172,7 @@ public class WaveSpawner{ } } - private void reset(WorldLoadEvent event){ + private void reset(){ dynamicSpawn = false; flySpawns.clear(); groundSpawns.clear(); @@ -223,7 +223,7 @@ public class WaveSpawner{ int shellWidth = quadWidth() * 2 + quadHeight() * 2 * 6; shellWidth = Math.min(quadWidth() * quadHeight() / 4, shellWidth); - Mathf.traverseSpiral(quadWidth(), quadHeight(), Mathf.random(shellWidth), (x, y) -> { + traverseSpiral(quadWidth(), quadHeight(), Mathf.random(shellWidth), (x, y) -> { if(getQuad(x, y)){ spawn.x = x; spawn.y = y; @@ -256,4 +256,57 @@ public class WaveSpawner{ //quadrant spawn coordinates int x, y; } + + //utility methods + + float sqrwavex(float degrees){ + degrees = Mathf.mod(degrees, 360f); + if(degrees < 45){ + return 1; + }else if(degrees < 135){ + return 1f - (degrees - 45f) / 90f; + }else if(degrees < 225){ + return -1f; + }else if(degrees < 315){ + return (degrees - 225) / 90f; + }else{ + return 1f; + } + } + + float sqrwavey(float degrees){ + return sqrwavex(degrees + 90f); + } + + void traverseSpiral(int width, int height, int offset, SpiralTraverser con){ + int directionIdx = 0; + int curRow = 0, curCol = 0; + for(int i = 0; i < height * width; i++){ + + if(i >= offset && con.accept(curCol, curRow)) break; + + int same = 1, row = curRow, col = curCol; + if(row > height - 1 - row){ + row = height - 1 - row; + same = 0; + } + if(col >= width - 1 - col){ + col = width - 1 - col; + same = 0; + } + row -= same; + + if(row == col){ + directionIdx = (directionIdx + 1) % 4; + } + curRow += directions[directionIdx][0]; + curCol += directions[directionIdx][1]; + } + } + + interface SpiralTraverser{ + boolean accept(int x, int y); + } + + private static int[][] directions = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}}; } diff --git a/core/src/io/anuke/mindustry/content/Items.java b/core/src/io/anuke/mindustry/content/Items.java index 8c1d7064db..5dd7220a32 100644 --- a/core/src/io/anuke/mindustry/content/Items.java +++ b/core/src/io/anuke/mindustry/content/Items.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Item; diff --git a/core/src/io/anuke/mindustry/content/Liquids.java b/core/src/io/anuke/mindustry/content/Liquids.java index fc8bb44bfb..9ff4a489ea 100644 --- a/core/src/io/anuke/mindustry/content/Liquids.java +++ b/core/src/io/anuke/mindustry/content/Liquids.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Liquid; diff --git a/core/src/io/anuke/mindustry/content/Mechs.java b/core/src/io/anuke/mindustry/content/Mechs.java index 589ef08b95..bb3f266f65 100644 --- a/core/src/io/anuke/mindustry/content/Mechs.java +++ b/core/src/io/anuke/mindustry/content/Mechs.java @@ -1,30 +1,24 @@ package io.anuke.mindustry.content; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.Rectangle; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.graphics.Blending; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.content.fx.UnitFx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.effect.Lightning; -import io.anuke.mindustry.entities.units.BaseUnit; -import io.anuke.mindustry.entities.units.types.AlphaDrone; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.Shaders; -import io.anuke.mindustry.maps.TutorialSector; -import io.anuke.mindustry.net.Net; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Mech; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.Mathf; - -import static io.anuke.mindustry.Vars.unitGroups; public class Mechs implements ContentList{ public static Mech alpha, delta, tau, omega, dart, javelin, trident, glaive; @@ -36,8 +30,6 @@ public class Mechs implements ContentList{ public void load(){ alpha = new Mech("alpha-mech", false){ - int maxDrones = 3; - float buildTime = 20f; { drillPower = 1; @@ -53,28 +45,6 @@ public class Mechs implements ContentList{ @Override public void updateAlt(Player player){ - if(player.isShooting && getDrones(player) < maxDrones && !TutorialSector.supressDrone()){ - player.timer.get(Player.timerAbility, buildTime); - - if(player.timer.getTime(Player.timerAbility) > buildTime/2f){ - if(!Net.client()){ - AlphaDrone drone = (AlphaDrone) UnitTypes.alphaDrone.create(player.getTeam()); - drone.leader = player; - drone.set(player.x, player.y); - drone.add(); - - Effects.effect(UnitFx.unitLand, player); - } - } - } - } - - int getDrones(Player player){ - int sum = 0; - for(BaseUnit unit : unitGroups[player.getTeam().ordinal()].all()){ - if(unit instanceof AlphaDrone && ((AlphaDrone) unit).leader == player) sum ++; - } - return sum; } }; @@ -100,7 +70,7 @@ public class Mechs implements ContentList{ Effects.shake(1f, 1f, player); Effects.effect(UnitFx.landShock, player); for(int i = 0; i < 8; i++){ - Timers.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), Palette.lancerLaser, 17f, player.x, player.y, Mathf.random(360f), 14)); + Time.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), Palette.lancerLaser, 17f, player.x, player.y, Mathf.random(360f), 14)); } } } @@ -137,7 +107,7 @@ public class Mechs implements ContentList{ rect.setSize(healRange*2f).setCenter(player.x, player.y); Units.getNearby(player.getTeam(), rect, unit -> { - if(unit.distanceTo(player) <= healRange){ + if(unit.dst(player) <= healRange){ if(unit.health < unit.maxHealth()){ Effects.effect(UnitFx.heal, unit); wasHealed = true; @@ -184,7 +154,7 @@ public class Mechs implements ContentList{ @Override public void load(){ super.load(); - armorRegion = Draw.region(name + "-armor"); + armorRegion = Core.atlas.find(name + "-armor"); } @Override @@ -202,15 +172,15 @@ public class Mechs implements ContentList{ public void draw(Player player){ if(player.shootHeat <= 0.01f) return; - float alpha = Core.batch.getColor().a; + float alpha = Draw.getColor().a; Shaders.build.progress = player.shootHeat; Shaders.build.region = armorRegion; - Shaders.build.time = Timers.time() / 10f; + Shaders.build.time = Time.time() / 10f; Shaders.build.color.set(Palette.accent).a = player.shootHeat; - Graphics.shader(Shaders.build); + Draw.shader(Shaders.build); Draw.alpha(1f); - Draw.rect(armorRegion, player.snappedX(), player.snappedY(), player.rotation); - Graphics.shader(Shaders.mix); + Draw.rect(armorRegion, player.x, player.y, player.rotation); + Draw.shader(Shaders.mix); Draw.color(1f, 1f, 1f, alpha); } }; @@ -246,7 +216,7 @@ public class Mechs implements ContentList{ @Override public void load(){ super.load(); - shield = Draw.region(name + "-shield"); + shield = Core.atlas.find(name + "-shield"); } @Override @@ -257,7 +227,7 @@ public class Mechs implements ContentList{ @Override public void updateAlt(Player player){ float scl = scld(player); - if(Mathf.chance(Timers.delta() * (0.15*scl))){ + if(Mathf.chance(Time.delta() * (0.15*scl))){ Effects.effect(BulletFx.hitLancer, Palette.lancerLaser, player.x, player.y); Lightning.create(player.getTeam(), Palette.lancerLaser, 10f, player.x + player.getVelocity().x, player.y + player.getVelocity().y, player.rotation, 14); @@ -268,14 +238,14 @@ public class Mechs implements ContentList{ public void draw(Player player){ float scl = scld(player); if(scl < 0.01f) return; - float alpha = Core.batch.getColor().a; - Graphics.shader(); - Graphics.setAdditiveBlending(); + float alpha = Draw.getColor().a; + Draw.shader(); Draw.color(Palette.lancerLaser); Draw.alpha(scl/2f); - Draw.rect(shield, player.snappedX() + Mathf.range(scl/2f), player.snappedY() + Mathf.range(scl/2f), player.rotation - 90); - Graphics.setNormalBlending(); - Graphics.shader(Shaders.mix); + Draw.blend(Blending.additive); + Draw.rect(shield, player.x + Mathf.range(scl/2f), player.y + Mathf.range(scl/2f), player.rotation - 90); + Draw.blend(); + Draw.shader(Shaders.mix); Draw.color(); Draw.alpha(alpha); } diff --git a/core/src/io/anuke/mindustry/content/Recipes.java b/core/src/io/anuke/mindustry/content/Recipes.java index 5d043690d6..19e30d8037 100644 --- a/core/src/io/anuke/mindustry/content/Recipes.java +++ b/core/src/io/anuke/mindustry/content/Recipes.java @@ -45,10 +45,9 @@ public class Recipes implements ContentList{ new Recipe(effect, StorageBlocks.container, new ItemStack(Items.densealloy, 200)); new Recipe(effect, StorageBlocks.vault, new ItemStack(Items.densealloy, 500), new ItemStack(Items.thorium, 250)); - //core disabled due to being broken new Recipe(effect, StorageBlocks.core, - new ItemStack(Items.copper, 2000), new ItemStack(Items.densealloy, 1500), - new ItemStack(Items.silicon, 1500), new ItemStack(Items.thorium, 500), + new ItemStack(Items.copper, 2000), new ItemStack(Items.densealloy, 2000), + new ItemStack(Items.silicon, 1750), new ItemStack(Items.thorium, 1000), new ItemStack(Items.surgealloy, 500), new ItemStack(Items.phasefabric, 750) ); diff --git a/core/src/io/anuke/mindustry/content/StatusEffects.java b/core/src/io/anuke/mindustry/content/StatusEffects.java index 62e1de504f..9162d9be3a 100644 --- a/core/src/io/anuke/mindustry/content/StatusEffects.java +++ b/core/src/io/anuke/mindustry/content/StatusEffects.java @@ -1,14 +1,14 @@ package io.anuke.mindustry.content; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.fx.EnvironmentFx; import io.anuke.mindustry.entities.StatusController.StatusEntry; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.StatusEffect; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.util.Mathf; public class StatusEffects implements ContentList{ public static StatusEffect none, burning, freezing, wet, melting, tarred, overdrive, shielded, shocked; @@ -38,7 +38,7 @@ public class StatusEffects implements ContentList{ public void update(Unit unit, float time){ unit.damagePeriodic(0.04f); - if(Mathf.chance(Timers.delta() * 0.2f)){ + if(Mathf.chance(Time.delta() * 0.2f)){ Effects.effect(EnvironmentFx.burning, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } @@ -54,7 +54,7 @@ public class StatusEffects implements ContentList{ @Override public void update(Unit unit, float time){ - if(Mathf.chance(Timers.delta() * 0.15f)){ + if(Mathf.chance(Time.delta() * 0.15f)){ Effects.effect(EnvironmentFx.freezing, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } @@ -79,7 +79,7 @@ public class StatusEffects implements ContentList{ @Override public void update(Unit unit, float time){ - if(Mathf.chance(Timers.delta() * 0.15f)){ + if(Mathf.chance(Time.delta() * 0.15f)){ Effects.effect(EnvironmentFx.wet, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } @@ -105,7 +105,7 @@ public class StatusEffects implements ContentList{ public void update(Unit unit, float time){ unit.damagePeriodic(0.3f); - if(Mathf.chance(Timers.delta() * 0.2f)){ + if(Mathf.chance(Time.delta() * 0.2f)){ Effects.effect(EnvironmentFx.melting, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } @@ -118,7 +118,7 @@ public class StatusEffects implements ContentList{ @Override public void update(Unit unit, float time){ - if(Mathf.chance(Timers.delta() * 0.15f)){ + if(Mathf.chance(Time.delta() * 0.15f)){ Effects.effect(EnvironmentFx.oily, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f)); } } @@ -143,9 +143,9 @@ public class StatusEffects implements ContentList{ @Override public void update(Unit unit, float time){ //idle regen boosted - unit.health += 0.01f * Timers.delta(); + unit.health += 0.01f * Time.delta(); - if(Mathf.chance(Timers.delta() * 0.25f)){ + if(Mathf.chance(Time.delta() * 0.25f)){ Effects.effect(EnvironmentFx.overdriven, unit.x + Mathf.range(unit.getSize() / 2f), unit.y + Mathf.range(unit.getSize() / 2f), 0f, unit); } } diff --git a/core/src/io/anuke/mindustry/content/UnitTypes.java b/core/src/io/anuke/mindustry/content/UnitTypes.java index 8029f0ac00..9fcee1977e 100644 --- a/core/src/io/anuke/mindustry/content/UnitTypes.java +++ b/core/src/io/anuke/mindustry/content/UnitTypes.java @@ -1,7 +1,6 @@ package io.anuke.mindustry.content; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.collection.ObjectSet; import io.anuke.mindustry.entities.units.UnitType; import io.anuke.mindustry.entities.units.types.*; import io.anuke.mindustry.game.ContentList; @@ -10,32 +9,11 @@ import io.anuke.mindustry.type.ContentType; public class UnitTypes implements ContentList{ public static UnitType spirit, phantom, - alphaDrone, wraith, ghoul, revenant, dagger, titan, fortress; @Override public void load(){ - alphaDrone = new UnitType("alpha-drone", AlphaDrone.class, AlphaDrone::new){ - { - isFlying = true; - drag = 0.005f; - speed = 0.6f; - maxVelocity = 1.7f; - range = 40f; - health = 45; - hitsize = 4f; - mass = 0.1f; - weapon = Weapons.droneBlaster; - trailColor = Color.valueOf("ffd37f"); - } - - @Override - public boolean isHidden() { - return true; - } - }; - spirit = new UnitType("spirit", Spirit.class, Spirit::new){{ weapon = Weapons.healBlasterDrone; isFlying = true; diff --git a/core/src/io/anuke/mindustry/content/blocks/Blocks.java b/core/src/io/anuke/mindustry/content/blocks/Blocks.java index 101539b893..16618bb039 100644 --- a/core/src/io/anuke/mindustry/content/blocks/Blocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/Blocks.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.blocks; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.StatusEffects; @@ -10,13 +10,14 @@ import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.*; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.util.Time; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Mathf; public class Blocks extends BlockList implements ContentList{ - public static Block air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone, blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock; + public static Block air, blockpart, spawn, space, metalfloor, deepwater, water, lava, tar, stone, + blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock; @Override @@ -40,7 +41,7 @@ public class Blocks extends BlockList implements ContentList{ public void draw(Tile tile){ Draw.color(Color.SCARLET); - Lines.circle(tile.worldx(), tile.worldy(), 4f +Mathf.absin(Timers.time(), 6f, 6f)); + Lines.circle(tile.worldx(), tile.worldy(), 4f +Mathf.absin(Time.time(), 6f, 6f)); Draw.color(); } }; @@ -90,6 +91,7 @@ public class Blocks extends BlockList implements ContentList{ }}; lava = new Floor("lava"){{ + drownTime = 100f; liquidColor = Color.valueOf("ed5334"); speedMultiplier = 0.2f; damageTaken = 0.5f; @@ -103,6 +105,7 @@ public class Blocks extends BlockList implements ContentList{ }}; tar = new Floor("tar"){{ + drownTime = 150f; liquidColor = Color.valueOf("292929"); status = StatusEffects.tarred; statusIntensity = 1f; @@ -157,9 +160,7 @@ public class Blocks extends BlockList implements ContentList{ minimapColor = Color.valueOf("549d5b"); }}; - shrub = new Rock("shrub"){{ - shadow = "shrubshadow"; - }}; + shrub = new Rock("shrub"); rock = new Rock("rock"){{ variants = 2; diff --git a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java index de9b602fe2..0933c8a0fb 100644 --- a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.blocks; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.fx.BlockFx; @@ -23,7 +23,7 @@ public class CraftingBlocks extends BlockList implements ContentList{ burnDuration = 46f; useFlux = true; - consumes.items(new ItemStack[]{new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)}); + consumes.items(new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)); consumes.item(Items.coal).optional(true); }}; @@ -37,7 +37,7 @@ public class CraftingBlocks extends BlockList implements ContentList{ useFlux = true; fluxNeeded = 2; - consumes.items(new ItemStack[]{new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)}); + consumes.items(new ItemStack(Items.copper, 1), new ItemStack(Items.lead, 2)); consumes.power(0.1f); }}; @@ -46,12 +46,11 @@ public class CraftingBlocks extends BlockList implements ContentList{ craftEffect = BlockFx.smeltsmoke; result = Items.silicon; craftTime = 40f; - powerCapacity = 20f; size = 2; hasLiquids = false; flameColor = Color.valueOf("ffef99"); - consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)}); + consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.sand, 2)); consumes.power(0.05f); }}; @@ -61,7 +60,6 @@ public class CraftingBlocks extends BlockList implements ContentList{ craftTime = 60f; output = Items.plastanium; itemCapacity = 30; - powerCapacity = 40f; size = 2; health = 320; hasPower = hasLiquids = true; @@ -77,10 +75,9 @@ public class CraftingBlocks extends BlockList implements ContentList{ craftEffect = BlockFx.smeltsmoke; result = Items.phasefabric; craftTime = 120f; - powerCapacity = 50f; size = 2; - consumes.items(new ItemStack[]{new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)}); + consumes.items(new ItemStack(Items.thorium, 4), new ItemStack(Items.sand, 10)); consumes.power(0.5f); }}; @@ -88,14 +85,13 @@ public class CraftingBlocks extends BlockList implements ContentList{ craftEffect = BlockFx.smeltsmoke; result = Items.surgealloy; craftTime = 75f; - powerCapacity = 60f; size = 2; useFlux = true; fluxNeeded = 3; consumes.power(0.4f); - consumes.items(new ItemStack[]{new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3)}); + consumes.items(new ItemStack(Items.titanium, 2), new ItemStack(Items.lead, 4), new ItemStack(Items.silicon, 3), new ItemStack(Items.copper, 3)); }}; cryofluidmixer = new LiquidMixer("cryofluidmixer"){{ @@ -133,7 +129,7 @@ public class CraftingBlocks extends BlockList implements ContentList{ size = 2; consumes.power(0.02f); - consumes.items(new ItemStack[]{new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)}); + consumes.items(new ItemStack(Items.coal, 1), new ItemStack(Items.lead, 2), new ItemStack(Items.sand, 2)); }}; melter = new PowerCrafter("melter"){{ diff --git a/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java index 53ac78afb1..b3906fb184 100644 --- a/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.blocks; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; import io.anuke.mindustry.content.Liquids; @@ -10,17 +10,16 @@ import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Liquid; -import io.anuke.mindustry.world.BarType; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.PowerBlock; import io.anuke.mindustry.world.blocks.distribution.Sorter; import io.anuke.mindustry.world.blocks.power.PowerNode; import io.anuke.mindustry.world.meta.BlockStat; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.ui.ButtonGroup; -import io.anuke.ucore.scene.ui.ImageButton; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.scene.ui.ButtonGroup; +import io.anuke.arc.scene.ui.ImageButton; +import io.anuke.arc.scene.ui.layout.Table; import java.io.DataInput; import java.io.DataOutput; @@ -40,36 +39,26 @@ public class DebugBlocks extends BlockList implements ContentList{ public void load(){ powerVoid = new PowerBlock("powervoid"){ { - powerCapacity = Float.MAX_VALUE; - shadow = "shadow-round-1"; - } - - @Override - public void setBars(){ - super.setBars(); - bars.remove(BarType.power); + consumes.power(Float.MAX_VALUE); } @Override public void init(){ super.init(); - stats.remove(BlockStat.powerCapacity); + stats.remove(BlockStat.powerUse); } }; powerInfinite = new PowerNode("powerinfinite"){ { - powerCapacity = 10000f; maxNodes = 100; outputsPower = true; consumesPower = false; - shadow = "shadow-round-1"; } @Override - public void update(Tile tile){ - super.update(tile); - tile.entity.power.amount = powerCapacity; + public float getPowerProduction(Tile tile){ + return 10000f; } }; @@ -83,12 +72,6 @@ public class DebugBlocks extends BlockList implements ContentList{ return true; } - @Override - public void setBars(){ - super.setBars(); - bars.remove(BarType.inventory); - } - @Override public void update(Tile tile){ SorterEntity entity = tile.entity(); diff --git a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java index 6a8b586c7b..9f67d7fe7f 100644 --- a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java @@ -71,19 +71,18 @@ public class DefenseBlocks extends BlockList implements ContentList{ }}; mendProjector = new MendProjector("mend-projector"){{ - consumes.power(0.2f); + consumes.power(0.2f, 1.0f); size = 2; consumes.item(Items.phasefabric).optional(true); }}; overdriveProjector = new OverdriveProjector("overdrive-projector"){{ - consumes.power(0.35f); + consumes.power(0.35f, 1.0f); size = 2; consumes.item(Items.phasefabric).optional(true); }}; forceProjector = new ForceProjector("force-projector"){{ - consumes.power(0.2f); size = 3; consumes.item(Items.phasefabric).optional(true); }}; diff --git a/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java index df4ab9ea20..0266642557 100644 --- a/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java @@ -35,7 +35,7 @@ public class DistributionBlocks extends BlockList implements ContentList{ phaseConveyor = new ItemBridge("phase-conveyor"){{ range = 12; hasPower = true; - consumes.power(0.03f); + consumes.power(0.03f, 1.0f); }}; sorter = new Sorter("sorter"); diff --git a/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java b/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java index e4eb6ff040..164f72fa44 100644 --- a/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java @@ -12,29 +12,24 @@ public class LiquidBlocks extends BlockList implements ContentList{ public void load(){ mechanicalPump = new Pump("mechanical-pump"){{ - shadow = "shadow-round-1"; pumpAmount = 0.1f; tier = 0; }}; rotaryPump = new Pump("rotary-pump"){{ - shadow = "shadow-rounded-2"; pumpAmount = 0.2f; consumes.power(0.015f); liquidCapacity = 30f; - powerCapacity = 20f; hasPower = true; size = 2; tier = 1; }}; thermalPump = new Pump("thermal-pump"){{ - shadow = "shadow-rounded-2"; pumpAmount = 0.275f; consumes.power(0.03f); liquidCapacity = 40f; hasPower = true; - powerCapacity = 20f; size = 2; tier = 2; }}; @@ -69,7 +64,7 @@ public class LiquidBlocks extends BlockList implements ContentList{ phaseConduit = new LiquidBridge("phase-conduit"){{ range = 12; hasPower = true; - consumes.power(0.03f); + consumes.power(0.03f, 1.0f); }}; } } diff --git a/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java b/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java index 83f16dc29f..515542e9fd 100644 --- a/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.blocks; -import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.arc.collection.ObjectMap; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.Floor; diff --git a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java index 1101a106e8..843541ca64 100644 --- a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java @@ -4,6 +4,7 @@ import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.power.*; public class PowerBlocks extends BlockList implements ContentList{ @@ -13,48 +14,43 @@ public class PowerBlocks extends BlockList implements ContentList{ @Override public void load(){ combustionGenerator = new BurnerGenerator("combustion-generator"){{ - powerOutput = 0.09f; - powerCapacity = 40f; + powerProduction = 0.09f; itemDuration = 40f; }}; thermalGenerator = new LiquidHeatGenerator("thermal-generator"){{ maxLiquidGenerate = 2f; - powerCapacity = 40f; - powerPerLiquid = 0.35f; + powerProduction = 2f; generateEffect = BlockFx.redgeneratespark; size = 2; }}; turbineGenerator = new TurbineGenerator("turbine-generator"){{ - powerOutput = 0.28f; - powerCapacity = 40f; + powerProduction = 0.28f; itemDuration = 30f; - powerPerLiquid = 0.7f; consumes.liquid(Liquids.water, 0.05f); size = 2; }}; rtgGenerator = new DecayGenerator("rtg-generator"){{ - powerCapacity = 40f; size = 2; - powerOutput = 0.3f; + powerProduction = 0.3f; itemDuration = 220f; }}; solarPanel = new SolarGenerator("solar-panel"){{ - generation = 0.0045f; + powerProduction = 0.0045f; }}; largeSolarPanel = new SolarGenerator("solar-panel-large"){{ size = 3; - generation = 0.055f; + powerProduction = 0.055f; }}; thoriumReactor = new NuclearReactor("thorium-reactor"){{ size = 3; health = 700; - powerMultiplier = 1.1f; + powerProduction = 1.1f; }}; fusionReactor = new FusionReactor("fusion-reactor"){{ @@ -63,16 +59,15 @@ public class PowerBlocks extends BlockList implements ContentList{ }}; battery = new Battery("battery"){{ - powerCapacity = 320f; + consumes.powerBuffered(320f, 1f); }}; batteryLarge = new Battery("battery-large"){{ size = 3; - powerCapacity = 2000f; + consumes.powerBuffered(2000f, 1f); }}; powerNode = new PowerNode("power-node"){{ - shadow = "shadow-round-1"; maxNodes = 4; laserRange = 6; }}; @@ -81,7 +76,6 @@ public class PowerBlocks extends BlockList implements ContentList{ size = 2; maxNodes = 6; laserRange = 9.5f; - shadow = "shadow-round-2"; }}; } diff --git a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java index 389cb425c7..101db89ec7 100644 --- a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.blocks; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.fx.BlockFx; diff --git a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java index 9569fd7826..1652a4bff6 100644 --- a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java @@ -1,16 +1,17 @@ package io.anuke.mindustry.content.blocks; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.mindustry.content.AmmoTypes; import io.anuke.mindustry.content.fx.ShootFx; import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.defense.turrets.*; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; public class TurretBlocks extends BlockList implements ContentList{ public static Block duo, /*scatter,*/ @@ -46,7 +47,7 @@ public class TurretBlocks extends BlockList implements ContentList{ @Override public void load(){ super.load(); - shootRegion = Draw.region(name + "-shoot"); + shootRegion = Core.atlas.find(name + "-shoot"); } { @@ -91,8 +92,8 @@ public class TurretBlocks extends BlockList implements ContentList{ recoil = 2f; reload = 100f; cooldown = 0.03f; - powerUsed = 20f; - powerCapacity = 60f; + powerUsed = 1 / 3f; + consumes.powerBuffered(60f); shootShake = 2f; shootEffect = ShootFx.lancerLaserShoot; smokeEffect = ShootFx.lancerLaserShootSmoke; @@ -110,8 +111,8 @@ public class TurretBlocks extends BlockList implements ContentList{ shootShake = 1f; shootCone = 40f; rotatespeed = 8f; - powerUsed = 10f; - powerCapacity = 30f; + powerUsed = 1f / 3f; + consumes.powerBuffered(30f); range = 150f; shootEffect = ShootFx.lightningShoot; heatColor = Color.RED; @@ -137,8 +138,8 @@ public class TurretBlocks extends BlockList implements ContentList{ @Override public void load() { super.load(); - panels[0] = Draw.region(name + "-panel-left"); - panels[1] = Draw.region(name + "-panel-right"); + panels[0] = Core.atlas.find(name + "-panel-left"); + panels[1] = Core.atlas.find(name + "-panel-right"); } { @@ -157,8 +158,8 @@ public class TurretBlocks extends BlockList implements ContentList{ drawer = (tile, entity) -> { Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); - float offsetx = (int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f); - float offsety = -(int) (Mathf.abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f); + float offsetx = (int) (abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f); + float offsety = -(int) (abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f); for(int i : Mathf.signs){ float rot = entity.rotation + 90 * i; @@ -170,6 +171,11 @@ public class TurretBlocks extends BlockList implements ContentList{ health = 360; } + + /** Converts a value range from 0-1 to a value range 0-1-0. */ + float abscurve(float f){ + return 1f - Math.abs(f - 0.5f) * 2f; + } }; ripple = new ArtilleryTurret("ripple"){{ @@ -243,8 +249,8 @@ public class TurretBlocks extends BlockList implements ContentList{ recoil = 4f; size = 4; shootShake = 2f; - powerUsed = 60f; - powerCapacity = 120f; + powerUsed = 0.5f; + consumes.powerBuffered(120f); range = 160f; reload = 200f; firingMoveFract = 0.1f; diff --git a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java index 7f4a40d602..14ad6cbafa 100644 --- a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java @@ -45,7 +45,6 @@ public class UnitBlocks extends BlockList implements ContentList{ produceTime = 3600; size = 3; consumes.power(0.2f); - shadow = "shadow-round-3"; consumes.items(new ItemStack(Items.silicon, 30), new ItemStack(Items.titanium, 30), new ItemStack(Items.plastanium, 20)); }}; @@ -54,7 +53,6 @@ public class UnitBlocks extends BlockList implements ContentList{ produceTime = 8000; size = 4; consumes.power(0.3f); - shadow = "shadow-round-4"; consumes.items(new ItemStack(Items.silicon, 80), new ItemStack(Items.titanium, 80), new ItemStack(Items.plastanium, 50)); }}; @@ -71,7 +69,6 @@ public class UnitBlocks extends BlockList implements ContentList{ produceTime = 3400; size = 3; consumes.power(0.15f); - shadow = "shadow-round-3"; consumes.items(new ItemStack(Items.silicon, 20), new ItemStack(Items.thorium, 30)); }}; @@ -80,12 +77,10 @@ public class UnitBlocks extends BlockList implements ContentList{ produceTime = 5000; size = 3; consumes.power(0.2f); - shadow = "shadow-round-3"; consumes.items(new ItemStack(Items.silicon, 40), new ItemStack(Items.thorium, 50)); }}; repairPoint = new RepairPoint("repair-point"){{ - shadow = "shadow-round-1"; repairSpeed = 0.1f; }}; diff --git a/core/src/io/anuke/mindustry/content/blocks/UpgradeBlocks.java b/core/src/io/anuke/mindustry/content/blocks/UpgradeBlocks.java index 5e991fd9e7..359033c45e 100644 --- a/core/src/io/anuke/mindustry/content/blocks/UpgradeBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/UpgradeBlocks.java @@ -9,56 +9,53 @@ public class UpgradeBlocks extends BlockList{ @Override public void load(){ + alphaPad = new MechPad("alpha-mech-pad"){{ mech = Mechs.alpha; size = 2; - powerCapacity = 50f; + consumes.powerBuffered(50f); }}; deltaPad = new MechPad("delta-mech-pad"){{ mech = Mechs.delta; size = 2; - powerCapacity = 70f; + consumes.powerBuffered(70f); }}; tauPad = new MechPad("tau-mech-pad"){{ mech = Mechs.tau; size = 2; - powerCapacity = 100f; + consumes.powerBuffered(100f); }}; omegaPad = new MechPad("omega-mech-pad"){{ mech = Mechs.omega; size = 3; - powerCapacity = 120f; + consumes.powerBuffered(120f); }}; dartPad = new MechPad("dart-ship-pad"){{ mech = Mechs.dart; size = 2; - powerCapacity = 50f; - shadow = "shadow-rounded-2"; + consumes.powerBuffered(50f); }}; javelinPad = new MechPad("javelin-ship-pad"){{ mech = Mechs.javelin; size = 2; - powerCapacity = 80f; - shadow = "shadow-rounded-2"; + consumes.powerBuffered(80f); }}; tridentPad = new MechPad("trident-ship-pad"){{ mech = Mechs.trident; size = 2; - powerCapacity = 100f; - shadow = "shadow-rounded-2"; + consumes.powerBuffered(100f); }}; glaivePad = new MechPad("glaive-ship-pad"){{ mech = Mechs.glaive; size = 3; - powerCapacity = 120f; - shadow = "shadow-round-3"; + consumes.powerBuffered(120f); }}; } } diff --git a/core/src/io/anuke/mindustry/content/bullets/FlakBullets.java b/core/src/io/anuke/mindustry/content/bullets/FlakBullets.java index 158c4240fa..c13a5b8409 100644 --- a/core/src/io/anuke/mindustry/content/bullets/FlakBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/FlakBullets.java @@ -7,7 +7,7 @@ import io.anuke.mindustry.entities.bullet.FlakBulletType; import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.game.ContentList; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.math.Mathf; public class FlakBullets extends BulletList implements ContentList{ public static BulletType plastic, explosive, surge; diff --git a/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java b/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java index 0e0dc3a8fb..a61a98c401 100644 --- a/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/MissileBullets.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.bullets; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.BulletType; @@ -8,8 +8,8 @@ import io.anuke.mindustry.entities.bullet.MissileBulletType; import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.game.ContentList; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.util.Time; +import io.anuke.arc.math.Mathf; public class MissileBullets extends BulletList implements ContentList{ public static BulletType explosive, incindiary, surge, javelin, swarm; @@ -92,7 +92,7 @@ public class MissileBullets extends BulletList implements ContentList{ @Override public void update(Bullet b){ super.update(b); - b.getVelocity().rotate(Mathf.sin(Timers.time() + b.id * 4422, 8f, 2f)); + b.getVelocity().rotate(Mathf.sin(Time.time() + b.id * 4422, 8f, 2f)); } }; @@ -117,7 +117,7 @@ public class MissileBullets extends BulletList implements ContentList{ @Override public void update(Bullet b){ super.update(b); - b.getVelocity().rotate(Mathf.sin(Timers.time() + b.id * 4422, 8f, 2f)); + b.getVelocity().rotate(Mathf.sin(Time.time() + b.id * 4422, 8f, 2f)); } }; } diff --git a/core/src/io/anuke/mindustry/content/bullets/StandardBullets.java b/core/src/io/anuke/mindustry/content/bullets/StandardBullets.java index 57c888aa47..b67425b83e 100644 --- a/core/src/io/anuke/mindustry/content/bullets/StandardBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/StandardBullets.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.bullets; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.entities.bullet.BasicBulletType; import io.anuke.mindustry.entities.bullet.BulletType; diff --git a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java index 1ec5252b02..1bce07f371 100644 --- a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java @@ -1,6 +1,14 @@ package io.anuke.mindustry.content.bullets; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.CapStyle; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.content.fx.BlockFx; @@ -15,14 +23,10 @@ import io.anuke.mindustry.entities.effect.Fire; import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.graphics.Palette; +import io.anuke.mindustry.graphics.Shapes; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.BuildBlock; import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.*; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.content; import static io.anuke.mindustry.Vars.world; @@ -105,18 +109,18 @@ public class TurretBullets extends BulletList implements ContentList{ @Override public void update(Bullet b){ - if(Mathf.chance(0.04 * Timers.delta())){ + if(Mathf.chance(0.04 * Time.delta())){ Tile tile = world.tileWorld(b.x, b.y); if(tile != null){ Fire.create(tile); } } - if(Mathf.chance(0.1 * Timers.delta())){ + if(Mathf.chance(0.1 * Time.delta())){ Effects.effect(EnvironmentFx.fireballsmoke, b.x, b.y); } - if(Mathf.chance(0.1 * Timers.delta())){ + if(Mathf.chance(0.1 * Time.delta())){ Effects.effect(EnvironmentFx.ballfire, b.x, b.y); } } @@ -213,10 +217,10 @@ public class TurretBullets extends BulletList implements ContentList{ Lines.lineAngle(b.x, b.y, b.angle(), baseLen); for(int s = 0; s < colors.length; s++){ - Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Timers.time(), 1f, 0.1f))); + Draw.color(tmpColor.set(colors[s]).mul(1f + Mathf.absin(Time.time(), 1f, 0.1f))); for(int i = 0; i < tscales.length; i++){ vector.trns(b.angle() + 180f, (lenscales[i] - 1f) * 35f); - Lines.stroke((9f + Mathf.absin(Timers.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]); + Lines.stroke((9f + Mathf.absin(Time.time(), 0.8f, 1.5f)) * b.fout() * strokes[s] * tscales[i]); Lines.lineAngle(b.x + vector.x, b.y + vector.y, b.angle(), baseLen * lenscales[i], CapStyle.none); } } @@ -367,9 +371,9 @@ public class TurretBullets extends BulletList implements ContentList{ return; } - float baseDst = data.from.distanceTo(data.to); - float dst1 = b.distanceTo(data.from); - float dst2 = b.distanceTo(data.to); + float baseDst = data.from.dst(data.to); + float dst1 = b.dst(data.from); + float dst2 = b.dst(data.to); boolean intersect = false; @@ -379,7 +383,7 @@ public class TurretBullets extends BulletList implements ContentList{ float baseAngle = data.to.angleTo(data.from); //if angles are nearby, then yes, it did - if(Mathf.angNear(angleTo, baseAngle, 2f)){ + if(Angles.near(angleTo, baseAngle, 2f)){ intersect = true; //snap bullet position back; this is used for low-FPS situations b.set(data.to.x + Angles.trnsx(baseAngle, hitDst), data.to.y + Angles.trnsy(baseAngle, hitDst)); diff --git a/core/src/io/anuke/mindustry/content/bullets/WeaponBullets.java b/core/src/io/anuke/mindustry/content/bullets/WeaponBullets.java index 514b6e5a12..86adce6b55 100644 --- a/core/src/io/anuke/mindustry/content/bullets/WeaponBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/WeaponBullets.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.content.bullets; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.content.fx.BulletFx; @@ -12,7 +12,7 @@ import io.anuke.mindustry.entities.effect.Fire; import io.anuke.mindustry.entities.effect.Puddle; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.math.Mathf; import static io.anuke.mindustry.Vars.world; diff --git a/core/src/io/anuke/mindustry/content/fx/BlockFx.java b/core/src/io/anuke/mindustry/content/fx/BlockFx.java index 2319d71586..106582a241 100644 --- a/core/src/io/anuke/mindustry/content/fx/BlockFx.java +++ b/core/src/io/anuke/mindustry/content/fx/BlockFx.java @@ -1,17 +1,16 @@ package io.anuke.mindustry.content.fx; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.game.ContentList; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Hue; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Tmp; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Tmp; import static io.anuke.mindustry.Vars.tilesize; @@ -236,7 +235,7 @@ public class BlockFx extends FxList implements ContentList{ Lines.stroke(e.fout() * 2f); Angles.randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin() * 4f + 1f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); }); Draw.reset(); @@ -247,7 +246,7 @@ public class BlockFx extends FxList implements ContentList{ Lines.circle(e.x, e.y, 7f + e.fout() * 8f); Angles.randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin() * 4f + 1f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); }); Draw.reset(); @@ -258,20 +257,20 @@ public class BlockFx extends FxList implements ContentList{ Lines.circle(e.x, e.y, 7f + e.fin() * 8f); Angles.randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fslope() * 4f + 1f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 4f + 1f); }); Draw.reset(); }); ripple = new GroundEffect(false, 30, e -> { - Draw.color(Hue.shift(Tmp.c1.set(e.color), 2, 0.1f)); + Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f)); Lines.stroke(e.fout() + 0.4f); Lines.circle(e.x, e.y, 2f + e.fin() * 4f); Draw.reset(); }); bubble = new Effect(20, e -> { - Draw.color(Hue.shift(Tmp.c1.set(e.color), 2, 0.1f)); + Draw.color(Tmp.c1.set(e.color).shiftValue(0.1f)); Lines.stroke(e.fout() + 0.2f); Angles.randLenVectors(e.id, 2, 8f, (x, y) -> { Lines.circle(e.x + x, e.y + y, 1f + e.fin() * 3f); @@ -310,7 +309,7 @@ public class BlockFx extends FxList implements ContentList{ healBlockFull = new Effect(20, e -> { Draw.color(e.color); Draw.alpha(e.fout()); - Fill.square(e.x, e.y, e.rotation * tilesize); + Fill.square(e.x, e.y, e.rotation * tilesize / 2f); Draw.color(); }); diff --git a/core/src/io/anuke/mindustry/content/fx/BulletFx.java b/core/src/io/anuke/mindustry/content/fx/BulletFx.java index 5bcfb50a7f..3c6441b876 100644 --- a/core/src/io/anuke/mindustry/content/fx/BulletFx.java +++ b/core/src/io/anuke/mindustry/content/fx/BulletFx.java @@ -1,14 +1,14 @@ package io.anuke.mindustry.content.fx; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.game.ContentList; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; public class BulletFx extends FxList implements ContentList{ public static Effect hitBulletSmall, hitFuse, hitBulletBig, hitFlameSmall, hitLiquid, hitLaser, hitLancer, hitMeltdown, despawn, flakExplosion, blastExplosion, plasticExplosion, @@ -29,7 +29,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(0.5f + e.fout()); Angles.randLenVectors(e.id, 5, e.fin() * 15f, (x, y) -> { - float ang = Mathf.atan2(x, y); + float ang = Mathf.angle(x, y); Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); }); @@ -48,7 +48,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(0.5f + e.fout()); Angles.randLenVectors(e.id, 6, e.fin() * 15f, (x, y) -> { - float ang = Mathf.atan2(x, y); + float ang = Mathf.angle(x, y); Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); }); @@ -60,7 +60,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(0.5f + e.fout() * 1.5f); Angles.randLenVectors(e.id, 8, e.finpow() * 30f, e.rotation, 50f, (x, y) -> { - float ang = Mathf.atan2(x, y); + float ang = Mathf.angle(x, y); Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f); }); @@ -72,7 +72,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(0.5f + e.fout()); Angles.randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 50f, (x, y) -> { - float ang = Mathf.atan2(x, y); + float ang = Mathf.angle(x, y); Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); }); @@ -94,7 +94,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(e.fout() * 1.5f); Angles.randLenVectors(e.id, 8, e.finpow() * 17f, e.rotation, 360f, (x, y) -> { - float ang = Mathf.atan2(x, y); + float ang = Mathf.angle(x, y); Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); }); @@ -106,7 +106,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(e.fout() * 2f); Angles.randLenVectors(e.id, 6, e.finpow() * 18f, e.rotation, 360f, (x, y) -> { - float ang = Mathf.atan2(x, y); + float ang = Mathf.angle(x, y); Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); }); @@ -125,7 +125,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(e.fout()); Angles.randLenVectors(e.id, 7, e.fin() * 7f, e.rotation, 40f, (x, y) -> { - float ang = Mathf.atan2(x, y); + float ang = Mathf.angle(x, y); Lines.lineAngle(e.x + x, e.y + y, ang, e.fout() * 2 + 1f); }); @@ -150,7 +150,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(1f * e.fout()); Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); Draw.reset(); @@ -174,7 +174,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(1f * e.fout()); Angles.randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); Draw.reset(); @@ -198,7 +198,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(1f * e.fout()); Angles.randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); Draw.reset(); @@ -222,7 +222,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(1f * e.fout()); Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); Draw.reset(); @@ -271,7 +271,7 @@ public class BulletFx extends FxList implements ContentList{ Lines.stroke(1f * e.fout()); Angles.randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); Draw.reset(); diff --git a/core/src/io/anuke/mindustry/content/fx/EnvironmentFx.java b/core/src/io/anuke/mindustry/content/fx/EnvironmentFx.java index 6dfb5f5b5c..16b3c5e85a 100644 --- a/core/src/io/anuke/mindustry/content/fx/EnvironmentFx.java +++ b/core/src/io/anuke/mindustry/content/fx/EnvironmentFx.java @@ -1,15 +1,15 @@ package io.anuke.mindustry.content.fx; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.type.Item; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; public class EnvironmentFx extends FxList implements ContentList{ public static Effect burning, fire, smoke, steam, fireballsmoke, ballfire, freezing, melting, wet, oily, overdriven, dropItem; diff --git a/core/src/io/anuke/mindustry/content/fx/ExplosionFx.java b/core/src/io/anuke/mindustry/content/fx/ExplosionFx.java index d6d41c9d66..6d823b0e48 100644 --- a/core/src/io/anuke/mindustry/content/fx/ExplosionFx.java +++ b/core/src/io/anuke/mindustry/content/fx/ExplosionFx.java @@ -1,14 +1,14 @@ package io.anuke.mindustry.content.fx; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.game.ContentList; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; public class ExplosionFx extends FxList implements ContentList{ public static Effect shockwave, bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke; @@ -54,7 +54,7 @@ public class ExplosionFx extends FxList implements ContentList{ Lines.stroke(1.5f * e.fout()); Angles.randLenVectors(e.id + 1, 8, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); Draw.reset(); @@ -77,7 +77,7 @@ public class ExplosionFx extends FxList implements ContentList{ Lines.stroke(1.7f * e.fout()); Angles.randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), 1f + e.fout() * 3f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); Draw.reset(); diff --git a/core/src/io/anuke/mindustry/content/fx/Fx.java b/core/src/io/anuke/mindustry/content/fx/Fx.java index 23ad56d6c9..e544459e79 100644 --- a/core/src/io/anuke/mindustry/content/fx/Fx.java +++ b/core/src/io/anuke/mindustry/content/fx/Fx.java @@ -1,13 +1,13 @@ package io.anuke.mindustry.content.fx; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.game.ContentList; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Angles; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; import static io.anuke.mindustry.Vars.tilesize; diff --git a/core/src/io/anuke/mindustry/content/fx/ShootFx.java b/core/src/io/anuke/mindustry/content/fx/ShootFx.java index 4e82b9a70e..39b96c6161 100644 --- a/core/src/io/anuke/mindustry/content/fx/ShootFx.java +++ b/core/src/io/anuke/mindustry/content/fx/ShootFx.java @@ -1,16 +1,17 @@ package io.anuke.mindustry.content.fx; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect; -import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.game.ContentList; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.graphics.Shapes; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; +import io.anuke.mindustry.graphics.Palette; +import io.anuke.mindustry.graphics.Shapes; public class ShootFx extends FxList implements ContentList{ public static Effect shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot; @@ -108,8 +109,7 @@ public class ShootFx extends FxList implements ContentList{ float len = (2f + e.finpow() * 6f) * i; float lr = rot + e.fin() * 30f * i; - Draw.rect("white", - e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), + Fill.rect(e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), 1f, 2f, rot + e.fin() * 50f * i); @@ -122,7 +122,7 @@ public class ShootFx extends FxList implements ContentList{ for(int i : Mathf.signs){ float len = (2f + e.finpow() * 10f) * i; float lr = rot + e.fin() * 20f * i; - Draw.rect("casing", + Draw.rect(Core.atlas.find("casing"), e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), 2f, 3f, rot); @@ -145,11 +145,11 @@ public class ShootFx extends FxList implements ContentList{ for(int i : Mathf.signs){ float len = (4f + e.finpow() * 8f) * i; float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i; - Draw.rect("casing", + Draw.rect(Core.atlas.find("casing"), e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()), e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()), 2.5f, 4f, - rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin())); + rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin())); } Draw.color(Color.LIGHT_GRAY); @@ -177,7 +177,7 @@ public class ShootFx extends FxList implements ContentList{ Draw.color(Palette.lancerLaser); Angles.randLenVectors(e.id, 7, 80f, e.rotation, 0f, (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fout() * 9f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f); }); Draw.reset(); @@ -187,7 +187,7 @@ public class ShootFx extends FxList implements ContentList{ Draw.color(Palette.lancerLaser); Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fslope() * 3f + 1f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f); }); Draw.reset(); @@ -205,7 +205,7 @@ public class ShootFx extends FxList implements ContentList{ Draw.color(Palette.lancerLaser); Angles.randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { - Shapes.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.atan2(x, y)); + Shapes.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.angle(x, y)); }); Draw.reset(); @@ -216,7 +216,7 @@ public class ShootFx extends FxList implements ContentList{ Lines.stroke(e.fout() * 1.2f + 0.5f); Angles.randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 50f, (x, y) -> { - Lines.lineAngle(e.x + x, e.y + y, Mathf.atan2(x, y), e.fin() * 5f + 2f); + Lines.lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 5f + 2f); }); Draw.reset(); diff --git a/core/src/io/anuke/mindustry/content/fx/UnitFx.java b/core/src/io/anuke/mindustry/content/fx/UnitFx.java index 9efcb08699..e58fba9d8b 100644 --- a/core/src/io/anuke/mindustry/content/fx/UnitFx.java +++ b/core/src/io/anuke/mindustry/content/fx/UnitFx.java @@ -3,12 +3,12 @@ package io.anuke.mindustry.content.fx; import io.anuke.mindustry.entities.effect.GroundEffectEntity.GroundEffect; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.game.ContentList; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; public class UnitFx extends FxList implements ContentList{ public static Effect vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal, landShock; diff --git a/core/src/io/anuke/mindustry/core/ContentLoader.java b/core/src/io/anuke/mindustry/core/ContentLoader.java index 9f32f06c27..dfd6091b00 100644 --- a/core/src/io/anuke/mindustry/core/ContentLoader.java +++ b/core/src/io/anuke/mindustry/core/ContentLoader.java @@ -1,8 +1,10 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.collection.ObjectSet; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.util.Log; import io.anuke.mindustry.content.*; import io.anuke.mindustry.content.blocks.*; import io.anuke.mindustry.content.bullets.*; @@ -24,9 +26,6 @@ import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.ColorMapper; import io.anuke.mindustry.world.LegacyColorMapper; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.ThreadArray; /** * Loads all game content. @@ -114,7 +113,7 @@ public class ContentLoader{ registerTypes(); for(ContentType type : ContentType.values()){ - contentMap[type.ordinal()] = new ThreadArray<>(); + contentMap[type.ordinal()] = new Array<>(); contentNameMap[type.ordinal()] = new ObjectMap<>(); } diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index 415f58b87c..4be937ad94 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -1,10 +1,18 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.audio.Sound; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.TimeUtils; +import io.anuke.arc.ApplicationListener; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.EntityQuery; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.TextureAtlas; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.scene.ui.TextField; +import io.anuke.arc.util.Interval; +import io.anuke.arc.util.Strings; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.Mechs; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; @@ -14,7 +22,7 @@ import io.anuke.mindustry.game.EventType.*; import io.anuke.mindustry.game.Saves; import io.anuke.mindustry.game.Unlocks; import io.anuke.mindustry.gen.Call; -import io.anuke.mindustry.input.DefaultKeybinds; +import io.anuke.mindustry.input.Binding; import io.anuke.mindustry.input.DesktopInput; import io.anuke.mindustry.input.InputHandler; import io.anuke.mindustry.input.MobileInput; @@ -23,16 +31,10 @@ import io.anuke.mindustry.net.Net; import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.ui.dialogs.FloatingDialog; -import io.anuke.ucore.core.*; -import io.anuke.ucore.entities.EntityQuery; -import io.anuke.ucore.modules.Module; -import io.anuke.ucore.util.Atlas; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Strings; -import io.anuke.ucore.util.Timer; import java.io.IOException; +import static io.anuke.arc.Core.scene; import static io.anuke.mindustry.Vars.*; /** @@ -41,51 +43,37 @@ import static io.anuke.mindustry.Vars.*; * Should not handle any logic-critical state. * This class is not created in the headless server. */ -public class Control extends Module{ - /** Minimum period of time between the same sound being played.*/ - private static final long minSoundPeriod = 100; - +public class Control implements ApplicationListener{ public final Saves saves; public final Unlocks unlocks; - private Timer timerRPC= new Timer(), timerUnlock = new Timer(); + private Interval timerRPC = new Interval(), timerUnlock = new Interval(); private boolean hiscore = false; private boolean wasPaused = false; private InputHandler[] inputs = {}; - private ObjectMap soundMap = new ObjectMap<>(); - private Throwable error; public Control(){ saves = new Saves(); unlocks = new Unlocks(); - Inputs.useControllers(true); - - Gdx.input.setCatchBackKey(true); + Core.input.setCatch(KeyCode.BACK, true); Effects.setShakeFalloff(10000f); content.initialize(Content::init); - Core.atlas = new Atlas("sprites.atlas"); - Core.atlas.setErrorRegion("error"); + Core.atlas = new TextureAtlas("sprites/sprites.atlas"); + Draw.scl = 1f / Core.atlas.find("scale_marker").getWidth(); content.initialize(Content::load); + if(Core.atlas.getTextures().size != 1){ + throw new IllegalStateException("Atlas must be exactly one texture. " + + "If more textures are used, the map editor will not display them correctly."); + } + unlocks.load(); - Sounds.setFalloff(9000f); - Sounds.setPlayer((sound, volume) -> { - long time = TimeUtils.millis(); - long value = soundMap.get(sound, 0L); - - if(TimeUtils.timeSinceMillis(value) >= minSoundPeriod){ - threads.runGraphics(() -> sound.play(volume)); - soundMap.put(sound, time); - } - }); - - DefaultKeybinds.load(); - - Settings.defaultList( + Core.settings.setAppName(appName); + Core.settings.defaults( "ip", "localhost", "color-0", Color.rgba8888(playerColors[8]), "color-1", Color.rgba8888(playerColors[11]), @@ -95,15 +83,13 @@ public class Control extends Module{ "lastBuild", 0 ); - KeyBinds.load(); - addPlayer(0); saves.load(); Events.on(StateChangeEvent.class, event -> { if((event.from == State.playing && event.to == State.menu) || (event.from == State.menu && event.to != State.menu)){ - Timers.runTask(5f, Platform.instance::updateRPC); + Time.runTask(5f, Platform.instance::updateRPC); } }); @@ -115,9 +101,9 @@ public class Control extends Module{ state.set(State.playing); }); - Events.on(WorldLoadGraphicsEvent.class, event -> { + Events.on(WorldLoadEvent.class, event -> { if(mobile){ - Gdx.app.postRunnable(() -> Core.camera.position.set(players[0].x, players[0].y, 0)); + Core.app.post(() -> Core.camera.position.set(players[0])); } }); @@ -133,11 +119,11 @@ public class Control extends Module{ Events.on(WaveEvent.class, event -> { - int last = Settings.getInt("hiscore" + world.getMap().name, 0); + int last = Core.settings.getInt("hiscore" + world.getMap().name, 0); if(state.wave > last && !state.mode.infiniteResources && !state.mode.disableWaveTimer && world.getSector() == null){ - Settings.putInt("hiscore" + world.getMap().name, state.wave); - Settings.save(); + Core.settings.put("hiscore" + world.getMap().name, state.wave); + Core.settings.save(); hiscore = true; } @@ -149,12 +135,9 @@ public class Control extends Module{ if(world.getSector() != null && world.getSector().hasSave()){ world.getSector().getSave().delete(); } - - threads.runGraphics(() -> { - Effects.shake(5, 6, Core.camera.position.x, Core.camera.position.y); - //the restart dialog can show info for any number of scenarios - Call.onGameOver(event.winner); - }); + Effects.shake(5, 6, Core.camera.position.x, Core.camera.position.y); + //the restart dialog can show info for any number of scenarios + Call.onGameOver(event.winner); }); //autohost for pvp sectors @@ -164,13 +147,11 @@ public class Control extends Module{ Net.host(port); players[0].isAdmin = true; }catch(IOException e){ - ui.showError(Bundles.format("text.server.error", Strings.parseException(e, false))); - threads.runDelay(() -> state.set(State.menu)); + ui.showError(Core.bundle.format("text.server.error", Strings.parseException(e, false))); + Core.app.post(() -> state.set(State.menu)); } } }); - - Events.on(WorldLoadEvent.class, event -> threads.runGraphics(() -> Events.fire(new WorldLoadGraphicsEvent()))); } public void addPlayer(int index){ @@ -189,9 +170,9 @@ public class Control extends Module{ Player setTo = (index == 0 ? null : players[0]); Player player = new Player(); - player.name = Settings.getString("name"); + player.name = Core.settings.getString("name"); player.mech = mobile ? Mechs.starterMobile : Mechs.starterDesktop; - player.color.set(Settings.getInt("color-" + index)); + player.color.set(Core.settings.getInt("color-" + index)); player.isLocal = true; player.playerIndex = index; player.isMobile = mobile; @@ -214,7 +195,7 @@ public class Control extends Module{ } inputs[index] = input; - Inputs.addProcessor(input); + Core.input.addProcessor(input); } public void removePlayer(){ @@ -230,10 +211,6 @@ public class Control extends Module{ System.arraycopy(oldi, 0, inputs, 0, inputs.length); } - public void setError(Throwable error){ - this.error = error; - } - public InputHandler input(int index){ return inputs[index]; } @@ -266,7 +243,7 @@ public class Control extends Module{ Recipe recipe = content.recipes().get(i); if(!recipe.isHidden() && recipe.requirements != null){ for(ItemStack stack : recipe.requirements){ - if(!entity.items.has(stack.item, Math.min((int) (stack.amount * unlockResourceScaling), 2000))) continue outer; + if(!entity.items.has(stack.item, Math.min((int) (stack.amount), 2000))) continue outer; } if(unlocks.unlockContent(recipe)){ @@ -305,16 +282,16 @@ public class Control extends Module{ Platform.instance.updateRPC(); - if(!Settings.getBool("4.0-warning-2", false)){ + if(!Core.settings.getBool("4.0-warning-2", false)){ - Timers.run(5f, () -> { - FloatingDialog dialog = new FloatingDialog("[accent]WARNING![]"); + Time.run(5f, () -> { + FloatingDialog dialog = new FloatingDialog("WARNING!"); dialog.buttons().addButton("$text.ok", () -> { dialog.hide(); - Settings.putBool("4.0-warning-2", true); - Settings.save(); + Core.settings.put("4.0-warning-2", true); + Core.settings.save(); }).size(100f, 60f); - dialog.content().add("Reminder: The beta version you are about to play is very unstable, and is [accent]not representative of the final 4.0 release.[]\n\n " + + dialog.content().add("Reminder: The alpha version you are about to play is very unstable, and is [accent]not representative of the final 4.0 release.[]\n\n " + "\nThere is currently[scarlet] no sound implemented[]; this is intentional.\n" + "All current art and UI is temporary, and will be re-drawn before release. " + "\n\n[accent]Saves and maps may be corrupted without warning between updates.").wrap().width(400f); @@ -323,18 +300,8 @@ public class Control extends Module{ } } - /** Called from main logic thread.*/ - public void runUpdateLogic(){ - if(!state.is(State.menu)){ - renderer.minimap.updateUnitArray(); - } - } - @Override public void update(){ - if(error != null){ - throw new RuntimeException(error); - } saves.update(); @@ -362,26 +329,26 @@ public class Control extends Module{ } } - if(Inputs.keyTap("pause") && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){ + if(Core.input.keyTap(Binding.pause) && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){ state.set(state.is(State.playing) ? State.paused : State.playing); } - if(Inputs.keyTap("menu") && !ui.restart.isShown()){ + if(Core.input.keyTap(Binding.menu) && !ui.restart.isShown()){ if(ui.chatfrag.chatOpen()){ ui.chatfrag.hide(); - }else if(!ui.paused.isShown() && !ui.hasDialog()){ + }else if(!ui.paused.isShown() && !scene.hasDialog()){ ui.paused.show(); state.set(State.paused); } } - if(!mobile && Inputs.keyTap("screenshot") && !ui.chatfrag.chatOpen()){ + if(!mobile && Core.input.keyTap(Binding.screenshot) && !(scene.getKeyboardFocus() instanceof TextField) && !ui.chatfrag.chatOpen()){ renderer.takeMapScreenshot(); } }else{ if(!state.isPaused()){ - Timers.update(); + Time.update(); } } } diff --git a/core/src/io/anuke/mindustry/core/GameState.java b/core/src/io/anuke/mindustry/core/GameState.java index 96a36fad8a..4d795a46fc 100644 --- a/core/src/io/anuke/mindustry/core/GameState.java +++ b/core/src/io/anuke/mindustry/core/GameState.java @@ -5,7 +5,7 @@ import io.anuke.mindustry.game.EventType.StateChangeEvent; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.Teams; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.core.Events; +import io.anuke.arc.Events; import static io.anuke.mindustry.Vars.unitGroups; import static io.anuke.mindustry.Vars.waveTeam; diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index 5f7035cb7e..c564ed6115 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -1,9 +1,14 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.utils.Array; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; -import io.anuke.mindustry.Vars; +import io.anuke.arc.ApplicationListener; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.entities.Entities; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.EntityQuery; +import io.anuke.arc.util.Time; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.game.EventType.*; @@ -16,12 +21,6 @@ import io.anuke.mindustry.net.Net; import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.Entities; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.EntityQuery; -import io.anuke.ucore.modules.Module; import static io.anuke.mindustry.Vars.*; @@ -33,7 +32,7 @@ import static io.anuke.mindustry.Vars.*; *

* This class should not call any outside methods to change state of modules, but instead fire events. */ -public class Logic extends Module{ +public class Logic implements ApplicationListener{ public Logic(){ Events.on(TileChangeEvent.class, event -> { @@ -85,7 +84,7 @@ public class Logic extends Module{ state.gameOver = false; state.teams = new Teams(); - Timers.clear(); + Time.clear(); Entities.clear(); TileEntity.sleepingEntities = 0; @@ -141,7 +140,7 @@ public class Logic extends Module{ @Remote(called = Loc.both) public static void onGameOver(Team winner){ - threads.runGraphics(() -> ui.restart.show(winner)); + ui.restart.show(winner); netClient.setQuiet(); } @@ -172,17 +171,13 @@ public class Logic extends Module{ @Override public void update(){ - if(Vars.control != null){ - control.runUpdateLogic(); - } - if(!state.is(State.menu)){ if(!state.isPaused()){ - Timers.update(); + Time.update(); if(!state.mode.disableWaveTimer && !state.mode.disableWaves && !state.gameOver){ - state.wavetime -= Timers.delta(); + state.wavetime -= Time.delta(); } if(!Net.client() && state.wavetime <= 0 && !state.mode.disableWaves){ diff --git a/core/src/io/anuke/mindustry/core/NetClient.java b/core/src/io/anuke/mindustry/core/NetClient.java index bf124f9be2..e3e70da110 100644 --- a/core/src/io/anuke/mindustry/core/NetClient.java +++ b/core/src/io/anuke/mindustry/core/NetClient.java @@ -1,14 +1,20 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.Base64Coder; -import com.badlogic.gdx.utils.IntSet; -import com.badlogic.gdx.utils.TimeUtils; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.PacketPriority; import io.anuke.annotations.Annotations.Remote; import io.anuke.annotations.Annotations.Variant; +import io.anuke.arc.ApplicationListener; +import io.anuke.arc.Core; +import io.anuke.arc.collection.IntSet; +import io.anuke.arc.entities.Entities; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.util.Interval; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.io.ReusableByteArrayInputStream; +import io.anuke.arc.util.serialization.Base64Coder; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; @@ -25,16 +31,6 @@ import io.anuke.mindustry.net.Packets.*; import io.anuke.mindustry.net.ValidateException; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.modules.ItemModule; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.Entities; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.io.ReusableByteArrayInputStream; -import io.anuke.ucore.modules.Module; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Timer; import java.io.DataInputStream; import java.io.IOException; @@ -43,12 +39,12 @@ import java.util.zip.InflaterInputStream; import static io.anuke.mindustry.Vars.*; -public class NetClient extends Module{ +public class NetClient implements ApplicationListener{ private final static float dataTimeout = 60 * 18; private final static float playerSyncTime = 2; public final static float viewScale = 2f; - private Timer timer = new Timer(5); + private Interval timer = new Interval(5); /**Whether the client is currently connecting.*/ private boolean connecting = false; /**If true, no message will be shown on disconnect.*/ @@ -58,16 +54,6 @@ public class NetClient extends Module{ /**Last sent client snapshot ID.*/ private int lastSent; - /**Last snapshot ID recieved.*/ - private int lastSnapshotBaseID = -1; - - /**Current snapshot that is being built from chinks.*/ - private byte[] currentSnapshot; - /**Counter of how many chunks have been recieved.*/ - private int recievedChunkCounter; - /**ID of snapshot that is currently being constructed.*/ - private int currentSnapshotID = -1; - /**List of entities that were removed, and need not be added while syncing.*/ private IntSet removed = new IntSet(); /**Byte stream for reading in snapshots.*/ @@ -114,7 +100,7 @@ public class NetClient extends Module{ Net.handleClient(Disconnect.class, packet -> { if(quiet) return; - Timers.runTask(3f, ui.loadfrag::hide); + Time.runTask(3f, ui.loadfrag::hide); state.set(State.menu); @@ -168,21 +154,19 @@ public class NetClient extends Module{ netClient.disconnectQuietly(); state.set(State.menu); - threads.runGraphics(() -> { - if(!reason.quiet){ - if(reason.extraText() != null){ - ui.showText(reason.toString(), reason.extraText()); - }else{ - ui.showText("$text.disconnect", reason.toString()); - } + if(!reason.quiet){ + if(reason.extraText() != null){ + ui.showText(reason.toString(), reason.extraText()); + }else{ + ui.showText("$text.disconnect", reason.toString()); } - ui.loadfrag.hide(); - }); + } + ui.loadfrag.hide(); } @Remote(variants = Variant.both) public static void onInfoMessage(String message){ - threads.runGraphics(() -> ui.showText("", message)); + ui.showText("", message); } @Remote(variants = Variant.both) @@ -193,15 +177,13 @@ public class NetClient extends Module{ ui.chatfrag.clearMessages(); Net.setClientLoaded(false); - threads.runGraphics(() -> { - ui.loadfrag.show("$text.connecting.data"); + ui.loadfrag.show("$text.connecting.data"); - ui.loadfrag.setButton(() -> { - ui.loadfrag.hide(); - netClient.connecting = false; - netClient.quiet = true; - Net.disconnect(); - }); + ui.loadfrag.setButton(() -> { + ui.loadfrag.hide(); + netClient.connecting = false; + netClient.quiet = true; + Net.disconnect(); }); } @@ -217,97 +199,11 @@ public class NetClient extends Module{ } @Remote(variants = Variant.one, priority = PacketPriority.low, unreliable = true) - public static void onSnapshot(byte[] chunk, int snapshotID, short chunkID, int totalLength, int uncompressedLength){ - int totalChunks = Mathf.ceil((float) totalLength / NetServer.maxSnapshotSize); - - if(NetServer.debugSnapshots) - Log.info("Recieved snapshot: len {0} ID {1} chunkID {2} / "+totalChunks+" totalLength {3} bclient-base {4}", chunk.length, snapshotID, chunkID, totalLength, netClient.lastSnapshotBaseID); - - //skip snapshot IDs that have already been recieved OR snapshots that are too far in front - if(snapshotID < netClient.lastSnapshotBaseID){ - if(NetServer.debugSnapshots) Log.info("//SKIP SNAPSHOT"); - return; - } - + public static void onEntitySnapshot(byte groupID, short amount, short dataLen, byte[] data){ try{ - byte[] snapshot; - - //total length exceeds that needed to hold one snapshot, therefore, it is split into chunks - if(totalLength > NetServer.maxSnapshotSize){ - //total amount of chunks to recieve - - //reset status when a new snapshot sending begins - if(netClient.currentSnapshotID != snapshotID || netClient.currentSnapshot == null){ - netClient.currentSnapshotID = snapshotID; - netClient.currentSnapshot = new byte[totalLength]; - netClient.recievedChunkCounter = 0; - } - - netClient.recievedChunkCounter++; //update recieved status - //copy the recieved bytes into the holding array - System.arraycopy(chunk, 0, netClient.currentSnapshot, chunkID * NetServer.maxSnapshotSize, - Math.min(NetServer.maxSnapshotSize, totalLength - chunkID * NetServer.maxSnapshotSize)); - - //when all chunks have been recieved, begin - if(netClient.recievedChunkCounter >= totalChunks && netClient.currentSnapshot != null){ - snapshot = netClient.currentSnapshot; - }else{ - return; - } - }else{ - snapshot = chunk; - } - - if(NetServer.debugSnapshots) - Log.info("Finished recieving snapshot ID {0} length {1}", snapshotID, chunk.length); - - byte[] result = Net.decompressSnapshot(snapshot, uncompressedLength); - int length = result.length; - - netClient.lastSnapshotBaseID = snapshotID; - - //set stream bytes to begin snapshot reading - netClient.byteStream.setBytes(result, 0, length); - - //get data input for reading from the stream + netClient.byteStream.setBytes(Net.decompressSnapshot(data, dataLen)); DataInputStream input = netClient.dataStream; - netClient.readSnapshot(input); - - //confirm that snapshot has been recieved - netClient.lastSnapshotBaseID = snapshotID; - }catch(Exception e){ - throw new RuntimeException(e); - } - } - - public void readSnapshot(DataInputStream input) throws IOException{ - - //read wave info - state.wavetime = input.readFloat(); - state.wave = input.readInt(); - state.enemies = input.readInt(); - - byte cores = input.readByte(); - for(int i = 0; i < cores; i++){ - int pos = input.readInt(); - Tile tile = world.tile(pos); - if(tile != null && tile.entity != null){ - tile.entity.items.read(input); - }else{ - new ItemModule().read(input); - } - } - - long timestamp = input.readLong(); - - byte totalGroups = input.readByte(); - //for each group... - for(int i = 0; i < totalGroups; i++){ - //read group info - byte groupID = input.readByte(); - short amount = input.readShort(); - EntityGroup group = Entities.getGroup(groupID); //go through each entity @@ -328,13 +224,41 @@ public class NetClient extends Module{ } //read the entity - entity.read(input, timestamp); + entity.read(input); if(add){ entity.add(); netClient.addRemovedEntity(entity.getID()); } } + }catch(IOException e){ + throw new RuntimeException(e); + } + } + + @Remote(variants = Variant.one, priority = PacketPriority.low, unreliable = true) + public static void onStateSnapshot(float waveTime, int wave, int enemies, short coreDataLen, byte[] coreData){ + try{ + state.wavetime = waveTime; + state.wave = wave; + state.enemies = enemies; + + netClient.byteStream.setBytes(Net.decompressSnapshot(coreData, coreDataLen)); + DataInputStream input = netClient.dataStream; + + byte cores = input.readByte(); + for(int i = 0; i < cores; i++){ + int pos = input.readInt(); + Tile tile = world.tile(pos); + if(tile != null && tile.entity != null){ + tile.entity.items.read(input); + }else{ + new ItemModule().read(input); + } + } + + }catch(IOException e){ + throw new RuntimeException(e); } } @@ -347,7 +271,7 @@ public class NetClient extends Module{ }else if(!connecting){ Net.disconnect(); }else{ //...must be connecting - timeoutTime += Timers.delta(); + timeoutTime += Time.delta(); if(timeoutTime > dataTimeout){ Log.err("Failed to load data!"); ui.loadfrag.hide(); @@ -369,8 +293,8 @@ public class NetClient extends Module{ ui.loadfrag.hide(); ui.join.hide(); Net.setClientLoaded(true); - Gdx.app.postRunnable(Call::connectConfirm); - Timers.runTask(40f, Platform.instance::updateRPC); + Core.app.post(Call::connectConfirm); + Time.runTask(40f, Platform.instance::updateRPC); } private void reset(){ @@ -380,9 +304,6 @@ public class NetClient extends Module{ connecting = true; quiet = false; lastSent = 0; - currentSnapshot = null; - currentSnapshotID = -1; - lastSnapshotBaseID = -1; Entities.clear(); ui.chatfrag.clearMessages(); @@ -416,19 +337,21 @@ public class NetClient extends Module{ Player player = players[0]; BuildRequest[] requests; + //limit to 10 to prevent buffer overflows + int usedRequests = Math.min(player.getPlaceQueue().size, 10); - requests = new BuildRequest[player.getPlaceQueue().size]; - for(int i = 0; i < requests.length; i++){ + requests = new BuildRequest[usedRequests]; + for(int i = 0; i < usedRequests; i++){ requests[i] = player.getPlaceQueue().get(i); } - Call.onClientShapshot(lastSent++, TimeUtils.millis(), player.x, player.y, + Call.onClientShapshot(lastSent++, Time.millis(), player.x, player.y, player.pointerX, player.pointerY, player.rotation, player.baseRotation, player.getVelocity().x, player.getVelocity().y, player.getMineTile(), player.isBoosting, player.isShooting, requests, Core.camera.position.x, Core.camera.position.y, - Core.camera.viewportWidth * Core.camera.zoom * viewScale, Core.camera.viewportHeight * Core.camera.zoom * viewScale); + Core.camera.width * viewScale, Core.camera.height * viewScale); } if(timer.get(1, 60)){ @@ -437,14 +360,14 @@ public class NetClient extends Module{ } String getUsid(String ip){ - if(Settings.getString("usid-" + ip, null) != null){ - return Settings.getString("usid-" + ip, null); + if(Core.settings.getString("usid-" + ip, null) != null){ + return Core.settings.getString("usid-" + ip, null); }else{ byte[] bytes = new byte[8]; new Random().nextBytes(bytes); String result = new String(Base64Coder.encode(bytes)); - Settings.putString("usid-" + ip, result); - Settings.save(); + Core.settings.put("usid-" + ip, result); + Core.settings.save(); return result; } } diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index a88ea19301..4987df27c4 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -1,15 +1,26 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.Colors; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntMap; -import com.badlogic.gdx.utils.ObjectSet; -import com.badlogic.gdx.utils.TimeUtils; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.ApplicationListener; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.IntMap; +import io.anuke.arc.collection.ObjectSet; +import io.anuke.arc.entities.Entities; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.EntityQuery; +import io.anuke.arc.entities.trait.Entity; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.Colors; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Structs; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.io.ByteBufferOutput; +import io.anuke.arc.util.io.CountableByteArrayOutputStream; import io.anuke.mindustry.content.Mechs; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.core.GameState.State; @@ -21,35 +32,25 @@ import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Version; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.gen.RemoteReadServer; -import io.anuke.mindustry.net.*; +import io.anuke.mindustry.net.Administration; import io.anuke.mindustry.net.Administration.PlayerInfo; +import io.anuke.mindustry.net.Net; +import io.anuke.mindustry.net.NetConnection; +import io.anuke.mindustry.net.NetworkIO; import io.anuke.mindustry.net.Packets.*; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.Entities; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.EntityQuery; -import io.anuke.ucore.entities.trait.Entity; -import io.anuke.ucore.io.ByteBufferOutput; -import io.anuke.ucore.io.CountableByteArrayOutputStream; -import io.anuke.ucore.modules.Module; -import io.anuke.ucore.util.Structs; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Mathf; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.nio.ByteBuffer; -import java.util.Arrays; import java.util.zip.DeflaterOutputStream; import static io.anuke.mindustry.Vars.*; -public class NetServer extends Module{ - public final static int maxSnapshotSize = 2047; +public class NetServer implements ApplicationListener{ + public final static int maxSnapshotSize = 430; public final static boolean debugSnapshots = false; public final static float maxSnapshotDelay = 200; @@ -122,7 +123,7 @@ public class NetServer extends Module{ return; } - if(TimeUtils.millis() - info.lastKicked < kickDuration){ + if(Time.millis() - info.lastKicked < kickDuration){ kick(id, KickReason.recentKick); return; } @@ -224,45 +225,6 @@ public class NetServer extends Module{ }); } - /** Sends a raw byte[] snapshot to a client, splitting up into chunks when needed.*/ - private static void sendSplitSnapshot(int userid, byte[] bytes, int snapshotID, int uncompressedLength){ - if(bytes.length < maxSnapshotSize){ - scheduleSnapshot(() -> Call.onSnapshot(userid, bytes, snapshotID, (short) 0, bytes.length, uncompressedLength)); - }else{ - int remaining = bytes.length; - int offset = 0; - int chunkid = 0; - while(remaining > 0){ - int used = Math.min(remaining, maxSnapshotSize); - byte[] toSend; - //re-use sent byte arrays when possible - if(used == maxSnapshotSize && !debugSnapshots){ - toSend = reusableSnapArray; - System.arraycopy(bytes, offset, toSend, 0, Math.min(offset + maxSnapshotSize, bytes.length) - offset); - }else{ - toSend = Arrays.copyOfRange(bytes, offset, Math.min(offset + maxSnapshotSize, bytes.length)); - } - - short fchunk = (short)chunkid; - scheduleSnapshot(() -> Call.onSnapshot(userid, toSend, snapshotID, fchunk, bytes.length, uncompressedLength)); - - remaining -= used; - offset += used; - chunkid++; - } - } - } - - private static void scheduleSnapshot(Runnable r){ - if(debugSnapshots){ - if(!Mathf.chance(snapshotDropchance)){ - Timers.run(maxSnapshotDelay / 1000f * 60f, r); - } - }else{ - r.run(); - } - } - public void sendWorldData(Player player, int clientID){ ByteArrayOutputStream stream = new ByteArrayOutputStream(); DeflaterOutputStream def = new DeflaterOutputStream(stream); @@ -311,14 +273,14 @@ public class NetServer extends Module{ boolean verifyPosition = !player.isDead() && netServer.admins.getStrict() && headless && player.getCarrier() == null; - if(connection.lastRecievedClientTime == 0) connection.lastRecievedClientTime = TimeUtils.millis() - 16; + if(connection.lastRecievedClientTime == 0) connection.lastRecievedClientTime = Time.millis() - 16; connection.viewX = viewX; connection.viewY = viewY; connection.viewWidth = viewWidth; connection.viewHeight = viewHeight; - long elapsed = TimeUtils.timeSinceMillis(connection.lastRecievedClientTime); + long elapsed = Time.timeSinceMillis(connection.lastRecievedClientTime); float maxSpeed = boosting && !player.mech.flying ? player.mech.boostSpeed : player.mech.speed; float maxMove = elapsed / 1000f * 60f * Math.min(compound(maxSpeed, player.mech.drag) * 1.25f, player.mech.maxSpeed * 1.1f); @@ -357,7 +319,7 @@ public class NetServer extends Module{ player.y = prevy; newx = x; newy = y; - }else if(Vector2.dst(x, y, newx, newy) > correctDist){ + }else if(Mathf.dst(x, y, newx, newy) > correctDist){ Call.onPositionSet(player.con.id, newx, newy); //teleport and correct position when necessary } @@ -370,7 +332,7 @@ public class NetServer extends Module{ player.getVelocity().set(xVelocity, yVelocity); //only for visual calculation purposes, doesn't actually update the player connection.lastRecievedClientSnapshot = snapshotID; - connection.lastRecievedClientTime = TimeUtils.millis(); + connection.lastRecievedClientTime = Time.millis(); } @Remote(targets = Loc.client, called = Loc.server) @@ -436,8 +398,8 @@ public class NetServer extends Module{ if(!headless && !closing && Net.server() && state.is(State.menu)){ closing = true; - threads.runGraphics(() -> ui.loadfrag.show("$text.server.closing")); - Timers.runTask(5f, () -> { + ui.loadfrag.show("$text.server.closing"); + Time.runTask(5f, () -> { Net.closeServer(); ui.loadfrag.hide(); closing = false; @@ -469,45 +431,34 @@ public class NetServer extends Module{ if(player != null && (reason == KickReason.kick || reason == KickReason.banned) && player.uuid != null){ PlayerInfo info = admins.getInfo(player.uuid); info.timesKicked++; - info.lastKicked = TimeUtils.millis(); + info.lastKicked = Time.millis(); } Call.onKick(connection, reason); - Timers.runTask(2f, con::close); + Time.runTask(2f, con::close); admins.save(); } - public void writeSnapshot(Player player, DataOutputStream dataStream) throws IOException{ - viewport.setSize(player.con.viewWidth, player.con.viewHeight).setCenter(player.con.viewX, player.con.viewY); - - //write wave datas - dataStream.writeFloat(state.wavetime); - dataStream.writeInt(state.wave); - dataStream.writeInt(state.enemies()); - + public void writeSnapshot(Player player) throws IOException{ + syncStream.reset(); ObjectSet cores = state.teams.get(player.getTeam()).cores; dataStream.writeByte(cores.size); - //write all core inventory data for(Tile tile : cores){ dataStream.writeInt(tile.pos()); tile.entity.items.write(dataStream); } - //write timestamp - dataStream.writeLong(TimeUtils.millis()); + dataStream.close(); + byte[] stateBytes = syncStream.toByteArray(); - int totalGroups = 0; + //write basic state data. + Call.onStateSnapshot(player.con.id, state.wavetime, state.wave, state.enemies, (short)stateBytes.length, Net.compressSnapshot(stateBytes)); - for(EntityGroup group : Entities.getAllGroups()){ - if(!group.isEmpty() && (group.all().get(0) instanceof SyncTrait)) totalGroups++; - } - - //write total amount of serializable groups - dataStream.writeByte(totalGroups); + viewport.setSize(player.con.viewWidth, player.con.viewHeight).setCenter(player.con.viewX, player.con.viewY); //check for syncable groups for(EntityGroup group : Entities.getAllGroups()){ @@ -535,15 +486,32 @@ public class NetServer extends Module{ } } - //write group ID + group size - dataStream.writeByte(group.getID()); - dataStream.writeShort(returnArray.size); + syncStream.reset(); + + int sent = 0; for(Entity entity : returnArray){ //write all entities now dataStream.writeInt(entity.getID()); //write id dataStream.writeByte(((SyncTrait) entity).getTypeID()); //write type ID ((SyncTrait) entity).write(dataStream); //write entity + + sent ++; + + if(syncStream.position() > maxSnapshotSize){ + dataStream.close(); + byte[] syncBytes = syncStream.toByteArray(); + Call.onEntitySnapshot(player.con.id, (byte)group.getID(), (short)sent, (short)syncBytes.length, Net.compressSnapshot(syncBytes)); + sent = 0; + syncStream.reset(); + } + } + + if(sent > 0){ + dataStream.close(); + + byte[] syncBytes = syncStream.toByteArray(); + Call.onEntitySnapshot(player.con.id, (byte)group.getID(), (short)sent, (short)syncBytes.length, Net.compressSnapshot(syncBytes)); } } } @@ -617,21 +585,7 @@ public class NetServer extends Module{ if(!player.timer.get(Player.timerSync, serverSyncTime) || !connection.hasConnected) continue; - //reset stream to begin writing - Timers.mark(); - syncStream.reset(); - - writeSnapshot(player, dataStream); - - dataStream.close(); - - byte[] bytes = syncStream.toByteArray(); - int uncompressed = bytes.length; - bytes = Net.compressSnapshot(bytes); - int snapid = connection.lastSentSnapshotID ++; - - if(debugSnapshots) Log.info("Sent snapshot: {0} bytes.", bytes.length); - sendSplitSnapshot(connection.id, bytes, snapid, uncompressed); + writeSnapshot(player); } }catch(IOException e){ diff --git a/core/src/io/anuke/mindustry/core/Platform.java b/core/src/io/anuke/mindustry/core/Platform.java index 0064c066c3..049e262da1 100644 --- a/core/src/io/anuke/mindustry/core/Platform.java +++ b/core/src/io/anuke/mindustry/core/Platform.java @@ -1,15 +1,11 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Input.Keys; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.Base64Coder; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.scene.ui.Dialog; -import io.anuke.ucore.scene.ui.TextField; +import io.anuke.arc.Core; +import io.anuke.arc.Input.TextInput; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.scene.ui.TextField; +import io.anuke.arc.util.serialization.Base64Coder; import java.util.Random; @@ -28,40 +24,16 @@ public abstract class Platform { if(!mobile) return; //this is mobile only, desktop doesn't need dialogs field.tapped(() -> { - Dialog dialog = new Dialog("", "dialog"); - dialog.setFillParent(true); - dialog.content().top(); - dialog.content().defaults().height(65f); - - TextField[] use = {null}; - - dialog.content().addImageButton("icon-copy", "clear", 16*3, () -> use[0].copy()) - .visible(() -> !use[0].getSelection().isEmpty()).width(65f); - - dialog.content().addImageButton("icon-paste", "clear", 16*3, () -> - use[0].paste(Gdx.app.getClipboard().getContents(), false)) - .visible(() -> Gdx.app.getClipboard() != null && Gdx.app.getClipboard().getContents() != null && !Gdx.app.getClipboard().getContents().isEmpty()).width(65f); - - TextField to = dialog.content().addField(field.getText(), t-> {}).pad(15).width(250f).get(); - to.setMaxLength(maxLength); - to.keyDown(Keys.ENTER, () -> dialog.content().find("okb").fireClick()); - - use[0] = to; - - dialog.content().addButton("$text.ok", () -> { + TextInput input = new TextInput(); + input.text = field.getText(); + input.maxLength = maxLength; + input.accepted = text -> { field.clearText(); - field.appendText(to.getText()); + field.appendText(text); field.change(); - dialog.hide(); - Gdx.input.setOnscreenKeyboardVisible(false); - }).width(90f).name("okb"); - - dialog.show(); - Timers.runTask(1f, () -> { - to.setCursorPosition(to.getText().length()); - Core.scene.setKeyboardFocus(to); - Gdx.input.setOnscreenKeyboardVisible(true); - }); + Core.input.setOnscreenKeyboardVisible(false); + }; + Core.input.getTextInput(input); }); } /**Update discord RPC.*/ @@ -76,13 +48,13 @@ public abstract class Platform { } /**Must be a base64 string 8 bytes in length.*/ public String getUUID(){ - String uuid = Settings.getString("uuid", ""); + String uuid = Core.settings.getString("uuid", ""); if(uuid.isEmpty()){ byte[] result = new byte[8]; new Random().nextBytes(result); uuid = new String(Base64Coder.encode(result)); - Settings.putString("uuid", uuid); - Settings.save(); + Core.settings.put("uuid", uuid); + Core.settings.save(); return uuid; } return uuid; diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index df097fc0f9..cff7944281 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -1,16 +1,26 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.Pixmap; -import com.badlogic.gdx.graphics.PixmapIO; -import com.badlogic.gdx.graphics.g2d.SpriteBatch; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.BufferUtils; -import com.badlogic.gdx.utils.ScreenUtils; -import com.badlogic.gdx.utils.TimeUtils; +import io.anuke.arc.ApplicationListener; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.EntityDraw; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.EffectEntity; +import io.anuke.arc.entities.trait.DrawTrait; +import io.anuke.arc.entities.trait.Entity; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.function.Predicate; +import io.anuke.arc.graphics.Camera; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.graphics.g2d.SpriteBatch; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.ScreenRecorder; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; @@ -22,62 +32,45 @@ import io.anuke.mindustry.entities.traits.BelowLiquidTrait; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.graphics.*; -import io.anuke.mindustry.world.blocks.defense.ForceProjector.ShieldEntity; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.entities.EntityDraw; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.EffectEntity; -import io.anuke.ucore.entities.trait.DrawTrait; -import io.anuke.ucore.entities.trait.Entity; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.function.Predicate; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.graphics.Surface; -import io.anuke.ucore.modules.RendererModule; -import io.anuke.ucore.scene.utils.Cursors; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Pooling; -import io.anuke.ucore.util.Translator; +import static io.anuke.arc.Core.*; import static io.anuke.mindustry.Vars.*; -import static io.anuke.ucore.core.Core.batch; -import static io.anuke.ucore.core.Core.camera; -public class Renderer extends RendererModule{ - public final Surface effectSurface; +public class Renderer implements ApplicationListener{ public final BlockRenderer blocks = new BlockRenderer(); public final MinimapRenderer minimap = new MinimapRenderer(); public final OverlayRenderer overlays = new OverlayRenderer(); - public final FogRenderer fog = new FogRenderer(); - private int targetscale = baseCameraScale; + private Color clearColor; + private float targetscale = io.anuke.arc.scene.ui.layout.Unit.dp.scl(4); + private float camerascale = targetscale; private Rectangle rect = new Rectangle(), rect2 = new Rectangle(); - private Vector2 avgPosition = new Translator(); + private Vector2 avgPosition = new Vector2(); + private float shakeIntensity, shaketime; public Renderer(){ - Core.batch = new SpriteBatch(4096); - + batch = new SpriteBatch(4096); + camera = new Camera(); Lines.setCircleVertices(14); Shaders.init(); - Core.cameraScale = baseCameraScale; + Effects.setScreenShakeProvider((intensity, duration) -> { + shakeIntensity = Math.max(intensity, shakeIntensity); + shaketime = Math.max(shaketime, duration); + }); + Effects.setEffectProvider((effect, color, x, y, rotation, data) -> { if(effect == Fx.none) return; - if(Settings.getBool("effects")){ - Rectangle view = rect.setSize(camera.viewportWidth, camera.viewportHeight) + if(Core.settings.getBool("effects")){ + Rectangle view = rect.setSize(camera.width, camera.height) .setCenter(camera.position.x, camera.position.y); Rectangle pos = rect2.setSize(effect.size).setCenter(x, y); if(view.overlaps(pos)){ if(!(effect instanceof GroundEffect)){ - EffectEntity entity = Pooling.obtain(EffectEntity.class, EffectEntity::new); + EffectEntity entity = Pools.obtain(EffectEntity.class, EffectEntity::new); entity.effect = effect; entity.color = color; entity.rotation = rotation; @@ -87,9 +80,9 @@ public class Renderer extends RendererModule{ if(data instanceof Entity){ entity.setParent((Entity) data); } - threads.runGraphics(() -> effectGroup.add(entity)); + effectGroup.add(entity); }else{ - GroundEffectEntity entity = Pooling.obtain(GroundEffectEntity.class, GroundEffectEntity::new); + GroundEffectEntity entity = Pools.obtain(GroundEffectEntity.class, GroundEffectEntity::new); entity.effect = effect; entity.color = color; entity.rotation = rotation; @@ -99,30 +92,13 @@ public class Renderer extends RendererModule{ if(data instanceof Entity){ entity.setParent((Entity) data); } - threads.runGraphics(() -> groundEffectGroup.add(entity)); + groundEffectGroup.add(entity); } } } }); - Cursors.cursorScaling = 3; - Cursors.outlineColor = Color.valueOf("444444"); - - Cursors.arrow = Cursors.loadCursor("cursor"); - Cursors.hand = Cursors.loadCursor("hand"); - Cursors.ibeam = Cursors.loadCursor("ibar"); - Cursors.restoreCursor(); - Cursors.loadCustom("drill"); - Cursors.loadCustom("unload"); - clearColor = new Color(0f, 0f, 0f, 1f); - - effectSurface = Graphics.createSurface(Core.cameraScale); - pixelSurface = Graphics.createSurface(Core.cameraScale); - } - - @Override - public void init(){ } @Override @@ -130,113 +106,77 @@ public class Renderer extends RendererModule{ //TODO hack, find source of this bug Color.WHITE.set(1f, 1f, 1f, 1f); - if(Core.cameraScale != targetscale){ - float targetzoom = (float) Core.cameraScale / targetscale; - camera.zoom = Mathf.lerpDelta(camera.zoom, targetzoom, 0.2f); - - if(Mathf.in(camera.zoom, targetzoom, 0.005f)){ - camera.zoom = 1f; - Graphics.setCameraScale(targetscale); - for(Player player : players){ - control.input(player.playerIndex).resetCursor(); - } - } - }else{ - camera.zoom = Mathf.lerpDelta(camera.zoom, 1f, 0.2f); - } + camerascale = Mathf.lerpDelta(camerascale, targetscale, 0.1f); + camera.width = graphics.getWidth() / camerascale; + camera.height = graphics.getHeight() / camerascale; if(state.is(State.menu)){ - Graphics.clear(Color.BLACK); + graphics.clear(Color.BLACK); }else{ Vector2 position = averagePosition(); if(players[0].isDead()){ TileEntity core = players[0].getClosestCore(); if(core != null && players[0].spawner == Unit.noSpawner){ - smoothCamera(core.x, core.y, 0.08f); + camera.position.lerpDelta(core.x, core.y, 0.08f); }else{ - smoothCamera(position.x + 0.0001f, position.y + 0.0001f, 0.08f); + camera.position.lerpDelta(position, 0.08f); } }else if(!mobile){ - setCamera(position.x + 0.0001f, position.y + 0.0001f); + camera.position.lerpDelta(position, 0.08f); } + camera.position.x = Mathf.clamp(camera.position.x, -tilesize / 2f, world.width() * tilesize - tilesize / 2f); camera.position.y = Mathf.clamp(camera.position.y, -tilesize / 2f, world.height() * tilesize - tilesize / 2f); - float prex = camera.position.x, prey = camera.position.y; updateShake(0.75f); - float deltax = camera.position.x - prex, deltay = camera.position.y - prey; - float lastx = camera.position.x, lasty = camera.position.y; - - if(snapCamera){ - camera.position.set((int) camera.position.x, (int) camera.position.y, 0); - } - - if(Gdx.graphics.getHeight() / Core.cameraScale % 2 == 1){ - camera.position.add(0, -0.5f, 0); - } - - if(Gdx.graphics.getWidth() / Core.cameraScale % 2 == 1){ - camera.position.add(-0.5f, 0, 0); - } - draw(); - - camera.position.set(lastx - deltax, lasty - deltay, 0); } if(!ui.chatfrag.chatOpen()){ - renderer.record(); //this only does something if GdxGifRecorder is on the class path, which it usually isn't + ScreenRecorder.record(); //this only does something if CoreGifRecorder is on the class path, which it usually isn't + } + } + + void updateShake(float scale){ + if(shaketime > 0){ + float intensity = shakeIntensity * (settings.getInt("screenshake", 4) / 4f) * scale; + camera.position.add(Mathf.range(intensity), Mathf.range(intensity)); + shakeIntensity -= 0.25f * Time.delta(); + shaketime -= Time.delta(); + shakeIntensity = Mathf.clamp(shakeIntensity, 0f, 100f); + }else{ + shakeIntensity = 0f; } } - @Override public void draw(){ camera.update(); - if(Float.isNaN(Core.camera.position.x) || Float.isNaN(Core.camera.position.y)){ - Core.camera.position.x = players[0].x; - Core.camera.position.y = players[0].y; + + if(Float.isNaN(camera.position.x) || Float.isNaN(camera.position.y)){ + camera.position.x = players[0].x; + camera.position.y = players[0].y; } - Graphics.clear(clearColor); + graphics.clear(clearColor); - batch.setProjectionMatrix(camera.combined); + Draw.proj(camera.projection()); - Graphics.surface(pixelSurface, false); - - Graphics.clear(clearColor); - - blocks.drawFloor(); + blocks.floor.drawFloor(); drawAndInterpolate(groundEffectGroup, e -> e instanceof BelowLiquidTrait); drawAndInterpolate(puddleGroup); drawAndInterpolate(groundEffectGroup, e -> !(e instanceof BelowLiquidTrait)); blocks.processBlocks(); + blocks.drawShadows(); - for(Team team : Team.all){ - if(blocks.isTeamShown(team)){ - boolean outline = team != players[0].getTeam() && team != Team.none; + blocks.drawBlocks(Layer.block); - if(outline){ - Shaders.outline.color.set(team.color); - Shaders.outline.color.a = 0.8f; - Graphics.beginShaders(Shaders.outline); - } - - blocks.drawTeamBlocks(Layer.block, team); - - if(outline){ - Graphics.endShaders(); - } - } - } - blocks.skipLayer(Layer.block); - - Graphics.shader(Shaders.blockbuild, false); + Draw.shader(Shaders.blockbuild, true); blocks.drawBlocks(Layer.placement); - Graphics.shader(); + Draw.shader(); blocks.drawBlocks(Layer.overlay); @@ -255,39 +195,34 @@ public class Renderer extends RendererModule{ overlays.drawBottom(); drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests); - Graphics.beginShaders(Shaders.shield); - EntityDraw.draw(shieldGroup); - EntityDraw.drawWith(shieldGroup, shield -> true, shield -> ((ShieldEntity)shield).drawOver()); - Draw.color(Palette.accent); - Graphics.endShaders(); - Draw.color(); + //TODO shield + /* + if(shieldGroup.size() > 0){ + Graphics.beginShaders(Shaders.shield); + EntityDraw.draw(shieldGroup); + EntityDraw.drawWith(shieldGroup, shield -> true, shield -> ((ShieldEntity)shield).drawOver()); + Draw.color(Palette.accent); + Graphics.endShaders(); + Draw.color(); + } + */ overlays.drawTop(); - if(showFog){ - Graphics.surface(); - }else{ - Graphics.flushSurface(); - } - - batch.end(); - - if(showFog){ - fog.draw(); - } - - Graphics.beginCam(); EntityDraw.setClip(false); drawAndInterpolate(playerGroup, p -> !p.isDead() && !p.isLocal, Player::drawName); EntityDraw.setClip(true); - Graphics.end(); + Draw.color(); + Draw.flush(); } private void drawFlyerShadows(){ - Graphics.surface(effectSurface, true, false); + //TODO fix flyer shadows + //Graphics.surface(effectSurface, true, false); float trnsX = -12, trnsY = -13; + Draw.color(0, 0, 0, 0.15f); for(EntityGroup group : unitGroups){ if(!group.isEmpty()){ @@ -299,8 +234,8 @@ public class Renderer extends RendererModule{ drawAndInterpolate(playerGroup, unit -> unit.isFlying() && !unit.isDead(), player -> player.drawShadow(trnsX, trnsY)); } - Draw.color(0, 0, 0, 0.15f); - Graphics.flushSurface(); + //Draw.color(0, 0, 0, 0.15f); + //Graphics.flushSurface(); Draw.color(); } @@ -317,13 +252,13 @@ public class Renderer extends RendererModule{ Shaders.outline.color.set(team.color); Shaders.mix.color.set(Color.WHITE); - Graphics.beginShaders(Shaders.outline); - Graphics.shader(Shaders.mix, true); + //Graphics.beginShaders(Shaders.outline); + Draw.shader(Shaders.mix, true); drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawAll); drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawAll); - Graphics.shader(); + Draw.shader(); blocks.drawTeamBlocks(Layer.turret, team); - Graphics.endShaders(); + //Graphics.endShaders(); drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawOver); drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawOver); @@ -342,20 +277,8 @@ public class Renderer extends RendererModule{ EntityDraw.drawWith(group, toDraw, drawer); } - @Override - public void resize(int width, int height){ - float lastX = camera.position.x, lastY = camera.position.y; - super.resize(width, height); - for(Player player : players){ - control.input(player.playerIndex).resetCursor(); - } - camera.update(); - camera.position.set(lastX, lastY, 0f); - } - - @Override - public void dispose(){ - fog.dispose(); + public float cameraScale(){ + return camerascale; } public Vector2 averagePosition(){ @@ -367,43 +290,35 @@ public class Renderer extends RendererModule{ return avgPosition; } - public void setCameraScale(int amount){ - targetscale = amount; + public void scaleCamera(float amount){ + targetscale += amount; clampScale(); - //scale up all surfaces in preparation for the zoom - for(Surface surface : Graphics.getSurfaces()){ - surface.setScale(targetscale); - } - } - - public void scaleCamera(int amount){ - setCameraScale(targetscale + amount); } public void clampScale(){ - float s = io.anuke.ucore.scene.ui.layout.Unit.dp.scl(1f); - targetscale = Mathf.clamp(targetscale, Math.round(s * 2), Math.round(s * 5)); + float s = io.anuke.arc.scene.ui.layout.Unit.dp.scl(1f); + targetscale = Mathf.clamp(targetscale, s * 2.5f, Math.round(s * 7)); } public void takeMapScreenshot(){ - float vpW = Core.camera.viewportWidth, vpH = Core.camera.viewportHeight; + //TODO fix/implement + /* + float vpW = camera.width, vpH = camera.height; int w = world.width()*tilesize, h = world.height()*tilesize; int pw = pixelSurface.width(), ph = pixelSurface.height(); - showFog = false; disableUI = true; pixelSurface.setSize(w, h, true); Graphics.getEffectSurface().setSize(w, h, true); - Core.camera.viewportWidth = w; - Core.camera.viewportHeight = h; - Core.camera.position.x = w/2f + tilesize/2f; - Core.camera.position.y = h/2f + tilesize/2f; + camera.width = w; + camera.height = h; + camera.position.x = w/2f + tilesize/2f; + camera.position.y = h/2f + tilesize/2f; draw(); - showFog = true; disableUI = false; - Core.camera.viewportWidth = vpW; - Core.camera.viewportHeight = vpH; + camera.width = vpW; + camera.height = vpH; pixelSurface.getBuffer().begin(); byte[] lines = ScreenUtils.getFrameBufferPixels(0, 0, w, h, true); @@ -415,14 +330,14 @@ public class Renderer extends RendererModule{ Pixmap fullPixmap = new Pixmap(w, h, Pixmap.Format.RGBA8888); BufferUtils.copy(lines, 0, fullPixmap.getPixels(), lines.length); - FileHandle file = screenshotDirectory.child("screenshot-" + TimeUtils.millis() + ".png"); + FileHandle file = screenshotDirectory.child("screenshot-" + Time.millis() + ".png"); PixmapIO.writePNG(file, fullPixmap); fullPixmap.dispose(); pixelSurface.setSize(pw, ph, false); Graphics.getEffectSurface().setSize(pw, ph, false); - ui.showInfoFade(Bundles.format("text.screenshot", file.toString())); + ui.showInfoFade(Core.bundle.format("text.screenshot", file.toString()));*/ } } diff --git a/core/src/io/anuke/mindustry/core/ThreadHandler.java b/core/src/io/anuke/mindustry/core/ThreadHandler.java deleted file mode 100644 index 700b816a92..0000000000 --- a/core/src/io/anuke/mindustry/core/ThreadHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -package io.anuke.mindustry.core; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.utils.TimeUtils; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; - -public class ThreadHandler{ - private long lastFrameTime; - - public ThreadHandler(){ - Timers.setDeltaProvider(() -> { - float result = Gdx.graphics.getDeltaTime() * 60f; - return Float.isNaN(result) || Float.isInfinite(result) ? 1f : Math.min(result, 60f / 10f); - }); - } - - public void run(Runnable r){ - r.run(); - } - - public void runGraphics(Runnable r){ - r.run(); - } - - public void runDelay(Runnable r){ - Gdx.app.postRunnable(r); - } - - public long getFrameID(){ - return Gdx.graphics.getFrameId(); - } - - public void handleBeginRender(){ - lastFrameTime = TimeUtils.millis(); - } - - public void handleEndRender(){ - int fpsCap = Settings.getInt("fpscap", 125); - - if(fpsCap <= 120){ - long target = 1000/fpsCap; - long elapsed = TimeUtils.timeSinceMillis(lastFrameTime); - if(elapsed < target){ - try{ - Thread.sleep(target - elapsed); - }catch(InterruptedException e){ - e.printStackTrace(); - } - } - } - } - -} diff --git a/core/src/io/anuke/mindustry/core/UI.java b/core/src/io/anuke/mindustry/core/UI.java index 27e8fd3569..f1acfeac89 100644 --- a/core/src/io/anuke/mindustry/core/UI.java +++ b/core/src/io/anuke/mindustry/core/UI.java @@ -1,47 +1,50 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Input.Keys; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.Colors; -import com.badlogic.gdx.graphics.g2d.BitmapFont; -import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator; -import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.FreeTypeFontParameter; -import com.badlogic.gdx.math.Interpolation; -import com.badlogic.gdx.utils.Align; +import io.anuke.arc.ApplicationListener; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.Graphics.Cursor; +import io.anuke.arc.Graphics.Cursor.SystemCursor; +import io.anuke.arc.freetype.FreeTypeFontGenerator; +import io.anuke.arc.freetype.FreeTypeFontGenerator.FreeTypeFontParameter; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.Colors; +import io.anuke.arc.graphics.g2d.BitmapFont; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.math.Interpolation; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.Scene; +import io.anuke.arc.scene.Skin; +import io.anuke.arc.scene.actions.Actions; +import io.anuke.arc.scene.ui.Dialog; +import io.anuke.arc.scene.ui.TextField; +import io.anuke.arc.scene.ui.TextField.TextFieldFilter; +import io.anuke.arc.scene.ui.TooltipManager; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.Strings; +import io.anuke.arc.util.Time; import io.anuke.mindustry.editor.MapEditorDialog; import io.anuke.mindustry.game.EventType.ResizeEvent; import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.input.InputHandler; import io.anuke.mindustry.ui.dialogs.*; import io.anuke.mindustry.ui.fragments.*; -import io.anuke.ucore.core.*; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.modules.SceneModule; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.Skin; -import io.anuke.ucore.scene.actions.Actions; -import io.anuke.ucore.scene.ui.Dialog; -import io.anuke.ucore.scene.ui.TextField; -import io.anuke.ucore.scene.ui.TextField.TextFieldFilter; -import io.anuke.ucore.scene.ui.TooltipManager; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.util.Strings; -import static io.anuke.mindustry.Vars.*; -import static io.anuke.ucore.scene.actions.Actions.*; +import static io.anuke.arc.scene.actions.Actions.*; +import static io.anuke.mindustry.Vars.control; +import static io.anuke.mindustry.Vars.disableUI; -public class UI extends SceneModule{ +public class UI implements ApplicationListener{ private FreeTypeFontGenerator generator; - public final MenuFragment menufrag = new MenuFragment(); - public final HudFragment hudfrag = new HudFragment(); - public final ChatFragment chatfrag = new ChatFragment(); - public final PlayerListFragment listfrag = new PlayerListFragment(); - public final BackgroundFragment backfrag = new BackgroundFragment(); - public final LoadingFragment loadfrag = new LoadingFragment(); + public MenuFragment menufrag; + public HudFragment hudfrag; + public ChatFragment chatfrag; + public PlayerListFragment listfrag; + public BackgroundFragment backfrag; + public LoadingFragment loadfrag; public AboutDialog about; public RestartDialog restart; @@ -66,11 +69,24 @@ public class UI extends SceneModule{ public SectorsDialog sectors; public MissionDialog missions; + public Cursor drillCursor, unloadCursor; + public UI(){ + Skin skin = new Skin(Core.atlas); + generateFonts(skin); + skin.load(Core.files.internal("ui/uiskin.json")); + + for(BitmapFont font : skin.getAll(BitmapFont.class).values()){ + font.setUseIntegerPositions(true); + } + + Core.scene = new Scene(skin); + Core.input.addProcessor(Core.scene); + Dialog.setShowAction(() -> sequence( alpha(0f), originCenter(), - moveToAligned(Gdx.graphics.getWidth() / 2f, Gdx.graphics.getHeight() / 2f, Align.center), + moveToAligned(Core.graphics.getWidth() / 2f, Core.graphics.getHeight() / 2f, Align.center), scaleTo(0.0f, 1f), parallel( scaleTo(1f, 1f, 0.1f, Interpolation.fade), @@ -87,16 +103,31 @@ public class UI extends SceneModule{ TooltipManager.getInstance().animations = false; - Settings.setErrorHandler(() -> Timers.run(1f, () -> showError("[crimson]Failed to access local storage.\nSettings will not be saved."))); - - Dialog.closePadR = -1; - Dialog.closePadT = 5; + Core.settings.setErrorHandler(e -> { + e.printStackTrace(); + Core.app.post(() -> showError("Failed to access local storage.\nSettings will not be saved.")); + }); Colors.put("accent", Palette.accent); + + loadCursors(); + } + + void loadCursors(){ + int cursorScaling = 3; + Color outlineColor = Color.valueOf("444444"); + + drillCursor = Core.graphics.newCursor("drill", cursorScaling, outlineColor); + unloadCursor = Core.graphics.newCursor("unload", cursorScaling, outlineColor); + SystemCursor.arrow.set(Core.graphics.newCursor("cursor", cursorScaling, outlineColor)); + SystemCursor.hand.set(Core.graphics.newCursor("hand", cursorScaling, outlineColor)); + SystemCursor.ibeam.set(Core.graphics.newCursor("ibeam", cursorScaling, outlineColor)); + + Core.graphics.restoreCursor(); } - void generateFonts(){ - generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/pixel.ttf")); + void generateFonts(Skin skin){ + generator = new FreeTypeFontGenerator(Core.files.internal("fonts/pixel.ttf")); FreeTypeFontParameter param = new FreeTypeFontParameter(); param.size = (int)(14*2 * Math.max(Unit.dp.scl(1f), 0.5f)); param.shadowColor = Color.DARK_GRAY; @@ -109,46 +140,23 @@ public class UI extends SceneModule{ skin.getFont("default-font").setOwnsTexture(false); } - @Override - protected void loadSkin(){ - skin = new Skin(Core.atlas); - generateFonts(); - skin.load(Gdx.files.internal("ui/uiskin.json")); - - for(BitmapFont font : skin.getAll(BitmapFont.class).values()){ - font.setUseIntegerPositions(true); - //font.getData().setScale(Vars.fontScale); - } - } - @Override public void update(){ if(disableUI) return; - if(Graphics.drawing()) Graphics.end(); - - act(); - - Graphics.begin(); - - for(int i = 0; i < players.length; i++){ - InputHandler input = control.input(i); - - if(input.isCursorVisible()){ - Draw.color(); - - float scl = Unit.dp.scl(3f); - - Draw.rect("controller-cursor", input.getMouseX(), Gdx.graphics.getHeight() - input.getMouseY(), 16 * scl, 16 * scl); - } - } - - Graphics.end(); - Draw.color(); + Core.scene.act(); + Core.scene.draw(); } @Override public void init(){ + menufrag = new MenuFragment(); + hudfrag = new HudFragment(); + chatfrag = new ChatFragment(); + listfrag = new PlayerListFragment(); + backfrag = new BackgroundFragment(); + loadfrag = new LoadingFragment(); + editor = new MapEditorDialog(); controls = new ControlsDialog(); restart = new RestartDialog(); @@ -172,10 +180,10 @@ public class UI extends SceneModule{ sectors = new SectorsDialog(); missions = new MissionDialog(); - Group group = Core.scene.getRoot(); + Group group = Core.scene.root; backfrag.build(group); - control.input(0).getFrag().build(Core.scene.getRoot()); + control.input(0).getFrag().build(group); hudfrag.build(group); menufrag.build(group); chatfrag.container().build(group); @@ -185,14 +193,12 @@ public class UI extends SceneModule{ @Override public void resize(int width, int height){ - super.resize(width, height); - + Core.scene.resize(width, height); Events.fire(new ResizeEvent()); } @Override public void dispose(){ - super.dispose(); generator.dispose(); } @@ -202,7 +208,7 @@ public class UI extends SceneModule{ public void loadGraphics(String text, Runnable call){ loadfrag.show(text); - Timers.runTask(7f, () -> { + Time.runTask(7f, () -> { call.run(); loadfrag.hide(); }); @@ -214,10 +220,10 @@ public class UI extends SceneModule{ public void loadLogic(String text, Runnable call){ loadfrag.show(text); - Timers.runTask(7f, () -> - threads.run(() -> { + Time.runTask(7f, () -> + Core.app.post(() -> { call.run(); - threads.runGraphics(loadfrag::hide); + loadfrag.hide(); })); } @@ -292,8 +298,8 @@ public class UI extends SceneModule{ dialog.hide(); confirmed.run(); }); - dialog.keyDown(Keys.ESCAPE, dialog::hide); - dialog.keyDown(Keys.BACK, dialog::hide); + dialog.keyDown(KeyCode.ESCAPE, dialog::hide); + dialog.keyDown(KeyCode.BACK, dialog::hide); dialog.show(); } diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index 58dedd6e2a..490ac28612 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -1,8 +1,17 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.arc.ApplicationListener; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.entities.EntityQuery; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Structs; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.Tmp; import io.anuke.mindustry.ai.BlockIndexer; import io.anuke.mindustry.ai.Pathfinder; import io.anuke.mindustry.ai.WaveSpawner; @@ -18,15 +27,10 @@ import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Pos; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.OreBlock; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.EntityQuery; -import io.anuke.ucore.modules.Module; -import io.anuke.ucore.util.*; import static io.anuke.mindustry.Vars.*; -public class World extends Module{ +public class World implements ApplicationListener{ public final Maps maps = new Maps(); public final Sectors sectors = new Sectors(); public final WorldGenerator generator = new WorldGenerator(); @@ -38,7 +42,7 @@ public class World extends Module{ private Sector currentSector; private Tile[][] tiles; - private Array tempTiles = new ThreadArray<>(); + private Array tempTiles = new Array<>(); private boolean generating, invalidMap; public World(){ @@ -121,11 +125,11 @@ public class World extends Module{ } public Tile tileWorld(float x, float y){ - return tile(Mathf.scl2(x, tilesize), Mathf.scl2(y, tilesize)); + return tile(Math.round(x / tilesize), Math.round(y / tilesize)); } public int toTile(float coord){ - return Mathf.scl2(coord, tilesize); + return Math.round(coord / tilesize); } public Tile[][] getTiles(){ @@ -209,8 +213,8 @@ public class World extends Module{ currentSector = sector; state.difficulty = sectors.getDifficulty(sector); state.mode = sector.currentMission().getMode(); - Timers.mark(); - Timers.mark(); + Time.mark(); + Time.mark(); logic.reset(); @@ -247,7 +251,7 @@ public class World extends Module{ Log.err(e); if(!headless){ ui.showError("$text.map.invalid"); - threads.runDelay(() -> state.set(State.menu)); + Core.app.post(() -> state.set(State.menu)); invalidMap = true; } generating = false; @@ -277,13 +281,13 @@ public class World extends Module{ invalidMap = false; } - if(invalidMap) threads.runDelay(() -> state.set(State.menu)); + if(invalidMap) Core.app.post(() -> state.set(State.menu)); } public void notifyChanged(Tile tile){ if(!generating){ - threads.runDelay(() -> Events.fire(new TileChangeEvent(tile))); + Core.app.post(() -> Events.fire(new TileChangeEvent(tile))); } } @@ -334,9 +338,9 @@ public class World extends Module{ /** * Raycast, but with world coordinates. */ - public GridPoint2 raycastWorld(float x, float y, float x2, float y2){ - return raycast(Mathf.scl2(x, tilesize), Mathf.scl2(y, tilesize), - Mathf.scl2(x2, tilesize), Mathf.scl2(y2, tilesize)); + public Point2 raycastWorld(float x, float y, float x2, float y2){ + return raycast(Math.round(x / tilesize), Math.round(y / tilesize), + Math.round(x2 / tilesize), Math.round(y2 / tilesize)); } /** @@ -344,7 +348,7 @@ public class World extends Module{ * * @return null if no collisions found, block position otherwise. */ - public GridPoint2 raycast(int x0f, int y0f, int x1, int y1){ + public Point2 raycast(int x0f, int y0f, int x1, int y1){ int x0 = x0f; int y0 = y0f; int dx = Math.abs(x1 - x0); diff --git a/core/src/io/anuke/mindustry/editor/DrawOperation.java b/core/src/io/anuke/mindustry/editor/DrawOperation.java index d2b434e21f..b6b7d13f76 100755 --- a/core/src/io/anuke/mindustry/editor/DrawOperation.java +++ b/core/src/io/anuke/mindustry/editor/DrawOperation.java @@ -1,10 +1,10 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntSet; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.IntSet; +import io.anuke.arc.util.Pack; import io.anuke.mindustry.maps.MapTileData; import io.anuke.mindustry.maps.MapTileData.TileDataMarker; -import io.anuke.ucore.util.Bits; public class DrawOperation{ /** @@ -29,7 +29,7 @@ public class DrawOperation{ } public boolean checkDuplicate(short x, short y){ - int i = Bits.packInt(x, y); + int i = Pack.shortInt(x, y); if(checks.contains(i)) return true; checks.add(i); diff --git a/core/src/io/anuke/mindustry/editor/EditorTool.java b/core/src/io/anuke/mindustry/editor/EditorTool.java index 6eca7e8fd4..3693f03266 100644 --- a/core/src/io/anuke/mindustry/editor/EditorTool.java +++ b/core/src/io/anuke/mindustry/editor/EditorTool.java @@ -1,15 +1,15 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.utils.IntArray; +import io.anuke.arc.collection.IntArray; +import io.anuke.arc.function.IntPositionConsumer; +import io.anuke.arc.util.Pack; +import io.anuke.arc.util.Structs; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.maps.MapTileData; import io.anuke.mindustry.maps.MapTileData.DataPosition; import io.anuke.mindustry.maps.MapTileData.TileDataMarker; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.Floor; -import io.anuke.ucore.function.IntPositionConsumer; -import io.anuke.ucore.util.Structs; -import io.anuke.ucore.util.Bits; import static io.anuke.mindustry.Vars.content; import static io.anuke.mindustry.Vars.ui; @@ -24,8 +24,8 @@ public enum EditorTool{ byte link = editor.getMap().read(x, y, DataPosition.link); if(link != 0){ - x -= (Bits.getLeftByte(link) - 8); - y -= (Bits.getRightByte(link) - 8); + x -= (Pack.leftByte(link) - 8); + y -= (Pack.rightByte(link) - 8); bf = editor.getMap().read(x, y, DataPosition.floor); bw = editor.getMap().read(x, y, DataPosition.wall); } @@ -101,7 +101,7 @@ public enum EditorTool{ byte bw = data.read(x, y, DataPosition.wall); be = data.read(x, y, DataPosition.elevation); boolean synth = editor.getDrawBlock().synthetic(); - byte brt = Bits.packByte((byte) editor.getDrawRotation(), (byte) editor.getDrawTeam().ordinal()); + byte brt = Pack.byteByte((byte) editor.getDrawRotation(), (byte) editor.getDrawTeam().ordinal()); dest = floor ? bf : bw; byte draw = editor.getDrawBlock().id; diff --git a/core/src/io/anuke/mindustry/editor/MapEditor.java b/core/src/io/anuke/mindustry/editor/MapEditor.java index 532e720622..369f9f6682 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditor.java +++ b/core/src/io/anuke/mindustry/editor/MapEditor.java @@ -1,6 +1,9 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Pack; +import io.anuke.arc.util.Structs; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.editor.DrawOperation.TileOperation; @@ -10,10 +13,9 @@ import io.anuke.mindustry.maps.MapTileData.DataPosition; import io.anuke.mindustry.maps.MapTileData.TileDataMarker; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.Floor; -import io.anuke.ucore.util.Structs; -import io.anuke.ucore.util.Bits; -import io.anuke.ucore.util.Mathf; + import static io.anuke.mindustry.Vars.content; + public class MapEditor{ public static final int[] brushSizes = {1, 2, 3, 4, 5, 9, 15}; @@ -103,7 +105,7 @@ public class MapEditor{ byte writeID = drawBlock.id; byte partID = Blocks.blockpart.id; - byte rotationTeam = Bits.packByte(drawBlock.rotate ? (byte) rotation : 0, drawBlock.synthetic() ? (byte) drawTeam.ordinal() : 0); + byte rotationTeam = Pack.byteByte(drawBlock.rotate ? (byte)rotation : 0, drawBlock.synthetic() ? (byte)drawTeam.ordinal() : 0); boolean isfloor = drawBlock instanceof Floor && drawBlock != Blocks.air; @@ -126,13 +128,13 @@ public class MapEditor{ if(i == 1){ map.write(worldx, worldy, DataPosition.wall, partID); map.write(worldx, worldy, DataPosition.rotationTeam, rotationTeam); - map.write(worldx, worldy, DataPosition.link, Bits.packByte((byte) (dx + offsetx + 8), (byte) (dy + offsety + 8))); + map.write(worldx, worldy, DataPosition.link, Pack.byteByte((byte) (dx + offsetx + 8), (byte) (dy + offsety + 8))); }else{ byte link = map.read(worldx, worldy, DataPosition.link); byte block = map.read(worldx, worldy, DataPosition.wall); if(link != 0){ - removeLinked(worldx - (Bits.getLeftByte(link) - 8), worldy - (Bits.getRightByte(link) - 8)); + removeLinked(worldx - (Pack.leftByte(link) - 8), worldy - (Pack.rightByte(link) - 8)); }else if(content.block(block).isMultiblock()){ removeLinked(worldx, worldy); } @@ -170,7 +172,7 @@ public class MapEditor{ if(content.block(map.read(wx, wy, DataPosition.wall)).isMultiblock()){ removeLinked(wx, wy); }else if(link != 0){ - removeLinked(wx - (Bits.getLeftByte(link) - 8), wy - (Bits.getRightByte(link) - 8)); + removeLinked(wx - (Pack.leftByte(link) - 8), wy - (Pack.rightByte(link) - 8)); } } diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index 90d18ac61e..8f3818e5f1 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -1,15 +1,22 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.Pixmap; -import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.Disposable; -import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.arc.Core; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.Pixmap; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.scene.actions.Actions; +import io.anuke.arc.scene.ui.*; +import io.anuke.arc.scene.ui.layout.Stack; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.scene.utils.UIUtils; +import io.anuke.arc.util.*; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.blocks.StorageBlocks; import io.anuke.mindustry.core.Platform; @@ -21,26 +28,8 @@ import io.anuke.mindustry.maps.MapTileData; import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.ui.dialogs.FloatingDialog; import io.anuke.mindustry.world.Block; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Inputs; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.input.Input; -import io.anuke.ucore.scene.actions.Actions; -import io.anuke.ucore.scene.ui.*; -import io.anuke.ucore.scene.ui.layout.Stack; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.scene.utils.UIUtils; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Strings; import java.io.DataInputStream; -import java.io.IOException; import java.io.InputStream; import static io.anuke.mindustry.Vars.*; @@ -96,26 +85,24 @@ public class MapEditorDialog extends Dialog implements Disposable{ t.addImageTextButton("$text.editor.import", "icon-load-map", isize, () -> createDialog("$text.editor.import", "$text.editor.importmap", "$text.editor.importmap.description", "icon-load-map", (Runnable) loadDialog::show, - "$text.editor.importfile", "$text.editor.importfile.description", "icon-file", (Runnable) () -> { - Platform.instance.showFileChooser("$text.loadimage", "Map Files", file -> { - ui.loadGraphics(() -> { - try{ - DataInputStream stream = new DataInputStream(file.read()); + "$text.editor.importfile", "$text.editor.importfile.description", "icon-file", (Runnable) () -> + Platform.instance.showFileChooser("$text.loadimage", "Map Files", file -> ui.loadGraphics(() -> { + try{ + DataInputStream stream = new DataInputStream(file.read()); - MapMeta meta = MapIO.readMapMeta(stream); - MapTileData data = MapIO.readTileData(stream, meta, false); + MapMeta meta = MapIO.readMapMeta(stream); + MapTileData data = MapIO.readTileData(stream, meta, false); - editor.beginEdit(data, meta.tags, false); - view.clearStack(); - }catch(Exception e){ - ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false))); - Log.err(e); - } - }); - }, true, mapExtension); - }, - "$text.editor.importimage", "$text.editor.importimage.description", "icon-file-image", (Runnable)() -> { - Platform.instance.showFileChooser("$text.loadimage", "Image Files", file -> { + editor.beginEdit(data, meta.tags, false); + view.clearStack(); + }catch(Exception e){ + ui.showError(Core.bundle.format("text.editor.errorimageload", Strings.parseException(e, false))); + Log.err(e); + } + }), true, mapExtension), + + "$text.editor.importimage", "$text.editor.importimage.description", "icon-file-image", (Runnable)() -> + Platform.instance.showFileChooser("$text.loadimage", "Image Files", file -> ui.loadGraphics(() -> { try{ MapTileData data = MapIO.readLegacyPixmap(new Pixmap(file)); @@ -123,15 +110,14 @@ public class MapEditorDialog extends Dialog implements Disposable{ editor.beginEdit(data, editor.getTags(), false); view.clearStack(); }catch (Exception e){ - ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.editor.errorimageload", Strings.parseException(e, false))); Log.err(e); } - }); - }, true, "png"); - })); + }), true, "png") + )); t.addImageTextButton("$text.editor.export", "icon-save-map", isize, () -> createDialog("$text.editor.export", - "$text.editor.exportfile", "$text.editor.exportfile.description", "icon-file", (Runnable) () -> { + "$text.editor.exportfile", "$text.editor.exportfile.description", "icon-file", (Runnable) () -> Platform.instance.showFileChooser("$text.saveimage", "Map Files", file -> { file = file.parent().child(file.nameWithoutExtension() + "." + mapExtension); FileHandle result = file; @@ -143,12 +129,11 @@ public class MapEditorDialog extends Dialog implements Disposable{ } MapIO.writeMap(result.write(false), editor.getTags(), editor.getMap()); }catch(Exception e){ - ui.showError(Bundles.format("text.editor.errorimagesave", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.editor.errorimagesave", Strings.parseException(e, false))); Log.err(e); } }); - }, false, mapExtension); - })); + }, false, mapExtension))); t.row(); @@ -171,8 +156,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ } }); - loadDialog = new MapLoadDialog(map -> { - + loadDialog = new MapLoadDialog(map -> ui.loadGraphics(() -> { try(DataInputStream stream = new DataInputStream(map.stream.get())){ MapMeta meta = MapIO.readMapMeta(stream); @@ -180,12 +164,11 @@ public class MapEditorDialog extends Dialog implements Disposable{ editor.beginEdit(data, meta.tags, false); view.clearStack(); - }catch(IOException e){ - ui.showError(Bundles.format("text.editor.errormapload", Strings.parseException(e, false))); + }catch(Exception e){ + ui.showError(Core.bundle.format("text.editor.errormapload", Strings.parseException(e, false))); Log.err(e); } - }); - }); + })); setFillParent(true); @@ -198,7 +181,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ return; } - Vector2 v = pane.stageToLocalCoordinates(Graphics.mouse()); + Vector2 v = pane.stageToLocalCoordinates(Core.input.mouse()); if(v.x >= 0 && v.y >= 0 && v.x <= pane.getWidth() && v.y <= pane.getHeight()){ Core.scene.setScrollFocus(pane); @@ -221,7 +204,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ } shownWithMap = false; - Timers.runTask(10f, Platform.instance::updateRPC); + Time.runTask(10f, Platform.instance::updateRPC); }); hidden(() -> { @@ -231,8 +214,8 @@ public class MapEditorDialog extends Dialog implements Disposable{ } @Override - protected void drawBackground(Batch batch, float parentAlpha, float x, float y){ - drawDefaultBackground(batch, parentAlpha, x, y); + protected void drawBackground(float x, float y){ + drawDefaultBackground(x, y); } private void save(){ @@ -261,7 +244,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ * 2) icon name * 3) listener */ - private FloatingDialog createDialog(String title, Object... arguments){ + private void createDialog(String title, Object... arguments){ FloatingDialog dialog = new FloatingDialog(title); float h = 90f; @@ -278,18 +261,15 @@ public class MapEditorDialog extends Dialog implements Disposable{ listenable.run(); dialog.hide(); menu.hide(); - }).left().get(); + }).left().margin(0).get(); button.clearChildren(); - button.table("button", t -> { - t.addImage(iconname).size(16 * 3); - t.update(() -> t.background(button.getClickListener().isOver() ? "button-over" : "button")); - }).padLeft(-10).padBottom(-3).size(h); + button.addImage(iconname).size(16 * 3).padLeft(10); button.table(t -> { t.add(name).growX().wrap(); t.row(); t.add(description).color(Color.GRAY).growX().wrap(); - }).growX().padLeft(8); + }).growX().pad(10f).padLeft(5); button.row(); @@ -298,8 +278,6 @@ public class MapEditorDialog extends Dialog implements Disposable{ dialog.addCloseButton(); dialog.show(); - - return dialog; } @Override @@ -323,7 +301,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ show(); }catch(Exception e){ Log.err(e); - ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.editor.errorimageload", Strings.parseException(e, false))); } }); } @@ -353,8 +331,8 @@ public class MapEditorDialog extends Dialog implements Disposable{ public void build(){ float amount = 10f, baseSize = 60f; - float size = mobile ? (int) (Math.min(Gdx.graphics.getHeight(), Gdx.graphics.getWidth()) / amount / Unit.dp.scl(1f)) : - Math.min(Gdx.graphics.getDisplayMode().height / amount, baseSize); + float size = mobile ? (int) (Math.min(Core.graphics.getHeight(), Core.graphics.getWidth()) / amount / Unit.dp.scl(1f)) : + Math.min(Core.graphics.getDisplayMode().height / amount, baseSize); clearChildren(); table(cont -> { @@ -421,7 +399,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ tools.row(); tools.table("underline", t -> t.add("$text.editor.teams")) - .colspan(3).height(40).width(size * 3f).padBottom(3); + .colspan(3).height(40).width(size * 3f + 3f).padBottom(3); tools.row(); @@ -459,7 +437,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ mid.row(); mid.table("underline", t -> t.add("$text.editor.elevation")) - .colspan(3).height(40).width(size * 3f); + .colspan(3).height(40).width(size * 3f + 3f); mid.row(); @@ -472,8 +450,8 @@ public class MapEditorDialog extends Dialog implements Disposable{ .size(size).get().setAlignment(Align.center, Align.center); t.addImageButton("icon-arrow-right", "clear-partial", 16 * 2f, () -> editor.setDrawElevation(editor.getDrawElevation() + 1)) - .disabled(b -> editor.getDrawElevation() >= 63).size(size); - }).colspan(3).height(size).width(size * 3f); + .disabled(b -> editor.getDrawElevation() >= 63).size(size).name("aaaaa"); + }).colspan(3).height(size).width(size * 3f + 3f); }).margin(0).left().growY(); @@ -488,35 +466,35 @@ public class MapEditorDialog extends Dialog implements Disposable{ private void doInput(){ //tool select for(int i = 0; i < EditorTool.values().length; i++){ - if(Inputs.keyTap(Input.valueOf("NUM_" + (i + 1)))){ + if(Core.input.keyTap(KeyCode.valueOf("NUM_" + (i + 1)))){ view.setTool(EditorTool.values()[i]); break; } } - if(Inputs.keyTap(Input.R)){ + if(Core.input.keyTap(KeyCode.R)){ editor.setDrawRotation((editor.getDrawRotation() + 1) % 4); } - if(Inputs.keyTap(Input.E)){ + if(Core.input.keyTap(KeyCode.E)){ editor.setDrawRotation(Mathf.mod((editor.getDrawRotation() + 1), 4)); } //ctrl keys (undo, redo, save) if(UIUtils.ctrl()){ - if(Inputs.keyTap(Input.Z)){ + if(Core.input.keyTap(KeyCode.Z)){ view.undo(); } - if(Inputs.keyTap(Input.Y)){ + if(Core.input.keyTap(KeyCode.Y)){ view.redo(); } - if(Inputs.keyTap(Input.S)){ + if(Core.input.keyTap(KeyCode.S)){ save(); } - if(Inputs.keyTap(Input.G)){ + if(Core.input.keyTap(KeyCode.G)){ view.setGrid(!view.isGrid()); } } @@ -551,7 +529,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ continue; } - if(regions.length == 0 || regions[0] == Draw.region("jjfgj")) continue; + if(regions.length == 0 || regions[0] == Core.atlas.find("jjfgj")) continue; Stack stack = new Stack(); @@ -562,9 +540,7 @@ public class MapEditorDialog extends Dialog implements Disposable{ ImageButton button = new ImageButton("white", "clear-toggle"); button.clicked(() -> editor.setDrawBlock(block)); button.resizeImage(8 * 4f); - button.getImageCell().setActor(stack); - button.addChild(stack); - button.getImage().remove(); + button.replaceImage(stack); button.update(() -> button.setChecked(editor.getDrawBlock() == block)); group.add(button); content.add(button).size(50f); diff --git a/core/src/io/anuke/mindustry/editor/MapInfoDialog.java b/core/src/io/anuke/mindustry/editor/MapInfoDialog.java index 6f4a046d45..25e8002a54 100644 --- a/core/src/io/anuke/mindustry/editor/MapInfoDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapInfoDialog.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.arc.Core; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.scene.ui.TextArea; +import io.anuke.arc.scene.ui.TextField; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.ui.dialogs.FloatingDialog; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.scene.ui.TextArea; -import io.anuke.ucore.scene.ui.TextField; public class MapInfoDialog extends FloatingDialog{ private final MapEditor editor; @@ -53,10 +53,10 @@ public class MapInfoDialog extends FloatingDialog{ content().add("$text.editor.author").padRight(8).left(); - author = content().addField(tags.get("author", Settings.getString("mapAuthor", "")), text -> { + author = content().addField(tags.get("author", Core.settings.getString("mapAuthor", "")), text -> { tags.put("author", text); - Settings.putString("mapAuthor", text); - Settings.save(); + Core.settings.put("mapAuthor", text); + Core.settings.save(); }).size(400, 55f).get(); author.setMessageText("$text.unknown"); diff --git a/core/src/io/anuke/mindustry/editor/MapLoadDialog.java b/core/src/io/anuke/mindustry/editor/MapLoadDialog.java index c819cd0a3a..cd6881901e 100644 --- a/core/src/io/anuke/mindustry/editor/MapLoadDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapLoadDialog.java @@ -1,14 +1,14 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.utils.Scaling; +import io.anuke.arc.util.Scaling; import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.ui.BorderImage; import io.anuke.mindustry.ui.dialogs.FloatingDialog; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.scene.ui.ButtonGroup; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.scene.ui.ButtonGroup; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.layout.Table; import static io.anuke.mindustry.Vars.world; diff --git a/core/src/io/anuke/mindustry/editor/MapRenderer.java b/core/src/io/anuke/mindustry/editor/MapRenderer.java index bd4b7b8f43..9d7547ff0d 100644 --- a/core/src/io/anuke/mindustry/editor/MapRenderer.java +++ b/core/src/io/anuke/mindustry/editor/MapRenderer.java @@ -1,21 +1,20 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.Disposable; -import com.badlogic.gdx.utils.IntSet; -import com.badlogic.gdx.utils.IntSet.IntSetIterator; +import io.anuke.arc.Core; +import io.anuke.arc.collection.IntSet; +import io.anuke.arc.collection.IntSet.IntSetIterator; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.util.Disposable; +import io.anuke.arc.util.Pack; +import io.anuke.arc.util.Structs; import io.anuke.mindustry.game.Team; +import io.anuke.mindustry.graphics.IndexedRenderer; import io.anuke.mindustry.maps.MapTileData.DataPosition; import io.anuke.mindustry.world.Block; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.IndexedRenderer; -import io.anuke.ucore.util.Structs; -import io.anuke.ucore.util.Bits; -import io.anuke.ucore.util.Geometry; import static io.anuke.mindustry.Vars.content; import static io.anuke.mindustry.Vars.tilesize; @@ -56,7 +55,7 @@ public class MapRenderer implements Disposable{ public void draw(float tx, float ty, float tw, float th){ - Graphics.end(); + Draw.flush(); IntSetIterator it = updates.iterator(); while(it.hasNext){ @@ -79,15 +78,12 @@ public class MapRenderer implements Disposable{ mesh = chunks[x][y]; } - mesh.getTransformMatrix().setToTranslation(tx, ty, 0).scl(tw / (width * tilesize), - th / (height * tilesize), 1f); - mesh.setProjectionMatrix(Core.batch.getProjectionMatrix()); + mesh.getTransformMatrix().setToTranslation(tx, ty).scale(tw / (width * tilesize), th / (height * tilesize)); + mesh.setProjectionMatrix(Draw.proj()); mesh.render(Core.atlas.getTextures().first()); } } - - Graphics.begin(); } public void updatePoint(int x, int y){ @@ -111,8 +107,8 @@ public class MapRenderer implements Disposable{ byte bw = editor.getMap().read(wx, wy, DataPosition.wall); byte btr = editor.getMap().read(wx, wy, DataPosition.rotationTeam); byte elev = editor.getMap().read(wx, wy, DataPosition.elevation); - byte rotation = Bits.getLeftByte(btr); - Team team = Team.all[Bits.getRightByte(btr)]; + byte rotation = Pack.leftByte(btr); + Team team = Team.all[Pack.rightByte(btr)]; Block floor = content.block(bf); Block wall = content.block(bw); @@ -125,12 +121,12 @@ public class MapRenderer implements Disposable{ if(wall.rotate){ mesh.draw((wx % chunksize) + (wy % chunksize) * chunksize, region, wx * tilesize + wall.offset(), wy * tilesize + wall.offset(), - region.getRegionWidth(), region.getRegionHeight(), rotation * 90 - 90); + region.getWidth() * Draw.scl, region.getHeight() * Draw.scl, rotation * 90 - 90); }else{ mesh.draw((wx % chunksize) + (wy % chunksize) * chunksize, region, - wx * tilesize + wall.offset() + (tilesize - region.getRegionWidth())/2f, - wy * tilesize + wall.offset() + (tilesize - region.getRegionHeight())/2f, - region.getRegionWidth(), region.getRegionHeight()); + wx * tilesize + wall.offset() + (tilesize - region.getWidth() * Draw.scl)/2f, + wy * tilesize + wall.offset() + (tilesize - region.getHeight() * Draw.scl)/2f, + region.getWidth() * Draw.scl, region.getHeight() * Draw.scl); } }else{ region = floor.getEditorIcon(); @@ -142,24 +138,24 @@ public class MapRenderer implements Disposable{ if(wall.update || wall.destructible){ mesh.setColor(team.color); - region = Draw.region("block-border"); + region = Core.atlas.find("block-border"); }else if(elev > 0 && check){ mesh.setColor(tmpColor.fromHsv((360f * elev / 127f * 4f) % 360f, 0.5f + (elev / 4f) % 0.5f, 1f)); - region = Draw.region("block-elevation"); + region = Core.atlas.find("block-elevation"); }else if(elev == -1){ - region = Draw.region("block-slope"); + region = Core.atlas.find("block-slope"); }else{ - region = Draw.region("clear"); + region = Core.atlas.find("clear"); } mesh.draw((wx % chunksize) + (wy % chunksize) * chunksize + chunksize * chunksize, region, wx * tilesize - (wall.size/3) * tilesize, wy * tilesize - (wall.size/3) * tilesize, - region.getRegionWidth(), region.getRegionHeight()); + region.getWidth() * Draw.scl, region.getHeight() * Draw.scl); mesh.setColor(Color.WHITE); } private boolean checkElevation(byte elev, int x, int y){ - for(GridPoint2 p : Geometry.d4){ + for(Point2 p : Geometry.d4){ int wx = x + p.x, wy = y + p.y; if(!Structs.inBounds(wx, wy, editor.getMap().width(), editor.getMap().height())){ return true; diff --git a/core/src/io/anuke/mindustry/editor/MapResizeDialog.java b/core/src/io/anuke/mindustry/editor/MapResizeDialog.java index 84f2ae4d51..1b493f5daf 100644 --- a/core/src/io/anuke/mindustry/editor/MapResizeDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapResizeDialog.java @@ -2,11 +2,11 @@ package io.anuke.mindustry.editor; import io.anuke.mindustry.maps.MapTileData; import io.anuke.mindustry.ui.dialogs.FloatingDialog; -import io.anuke.ucore.function.BiConsumer; -import io.anuke.ucore.scene.ui.ButtonGroup; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.function.BiConsumer; +import io.anuke.arc.scene.ui.ButtonGroup; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.math.Mathf; public class MapResizeDialog extends FloatingDialog{ int[] validMapSizes = {200, 300, 400, 500}; diff --git a/core/src/io/anuke/mindustry/editor/MapSaveDialog.java b/core/src/io/anuke/mindustry/editor/MapSaveDialog.java index a8a377b921..1b2f2de543 100644 --- a/core/src/io/anuke/mindustry/editor/MapSaveDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapSaveDialog.java @@ -3,9 +3,9 @@ package io.anuke.mindustry.editor; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.ui.dialogs.FloatingDialog; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.TextField; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.TextField; import static io.anuke.mindustry.Vars.ui; import static io.anuke.mindustry.Vars.world; diff --git a/core/src/io/anuke/mindustry/editor/MapView.java b/core/src/io/anuke/mindustry/editor/MapView.java index baa0edca5c..fa250bc3f4 100644 --- a/core/src/io/anuke/mindustry/editor/MapView.java +++ b/core/src/io/anuke/mindustry/editor/MapView.java @@ -1,32 +1,27 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.Input.Buttons; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.input.GestureDetector; -import com.badlogic.gdx.input.GestureDetector.GestureListener; -import com.badlogic.gdx.math.Bresenham2; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.graphics.g2d.ScissorStack; +import io.anuke.arc.input.GestureDetector; +import io.anuke.arc.input.GestureDetector.GestureListener; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.*; +import io.anuke.arc.scene.Element; +import io.anuke.arc.scene.event.InputEvent; +import io.anuke.arc.scene.event.InputListener; +import io.anuke.arc.scene.event.Touchable; +import io.anuke.arc.scene.ui.TextField; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.util.Tmp; import io.anuke.mindustry.editor.DrawOperation.TileOperation; import io.anuke.mindustry.graphics.Palette; +import io.anuke.mindustry.input.Binding; import io.anuke.mindustry.ui.GridImage; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Inputs; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.scene.Element; -import io.anuke.ucore.scene.event.InputEvent; -import io.anuke.ucore.scene.event.InputListener; -import io.anuke.ucore.scene.event.Touchable; -import io.anuke.ucore.scene.ui.TextField; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Tmp; import static io.anuke.mindustry.Vars.mobile; import static io.anuke.mindustry.Vars.ui; @@ -57,11 +52,11 @@ public class MapView extends Element implements GestureListener{ for(int i = 0; i < MapEditor.brushSizes.length; i++){ float size = MapEditor.brushSizes[i]; - brushPolygons[i] = Geometry.pixelCircle(size, (index, x, y) -> Vector2.dst(x, y, index, index) <= index - 0.5f); + brushPolygons[i] = Geometry.pixelCircle(size, (index, x, y) -> Mathf.dst(x, y, index, index) <= index - 0.5f); } - Inputs.addProcessor(0, new GestureDetector(20, 0.5f, 2, 0.15f, this)); - setTouchable(Touchable.enabled); + Core.input.getInputProcessors().insert(0, new GestureDetector(20, 0.5f, 2, 0.15f, this)); + touchable(Touchable.enabled); addListener(new InputListener(){ @@ -74,16 +69,16 @@ public class MapView extends Element implements GestureListener{ } @Override - public boolean touchDown(InputEvent event, float x, float y, int pointer, int button){ + public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){ if(pointer != 0){ return false; } - if(!mobile && button != Buttons.LEFT && button != Buttons.MIDDLE){ + if(!mobile && button != KeyCode.MOUSE_LEFT && button != KeyCode.MOUSE_MIDDLE){ return true; } - if(button == Buttons.MIDDLE){ + if(button == KeyCode.MOUSE_MIDDLE){ lastTool = tool; tool = EditorTool.zoom; } @@ -95,7 +90,7 @@ public class MapView extends Element implements GestureListener{ updated = false; - GridPoint2 p = project(x, y); + Point2 p = project(x, y); lastx = p.x; lasty = p.y; startx = p.x; @@ -112,19 +107,19 @@ public class MapView extends Element implements GestureListener{ } @Override - public void touchUp(InputEvent event, float x, float y, int pointer, int button){ - if(!mobile && button != Buttons.LEFT && button != Buttons.MIDDLE){ + public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){ + if(!mobile && button != KeyCode.MOUSE_LEFT && button != KeyCode.MOUSE_MIDDLE){ return; } drawing = false; - GridPoint2 p = project(x, y); + Point2 p = project(x, y); if(tool == EditorTool.line){ ui.editor.resetSaved(); - Array points = br.line(startx, starty, p.x, p.y); - for(GridPoint2 point : points){ + Array points = br.line(startx, starty, p.x, p.y); + for(Point2 point : points){ editor.draw(point.x, point.y); } updated = true; @@ -149,12 +144,12 @@ public class MapView extends Element implements GestureListener{ mousex = x; mousey = y; - GridPoint2 p = project(x, y); + Point2 p = project(x, y); if(drawing && tool.draggable){ ui.editor.resetSaved(); - Array points = br.line(lastx, lasty, p.x, p.y); - for(GridPoint2 point : points){ + Array points = br.line(lastx, lasty, p.x, p.y); + for(Point2 point : points){ tool.touched(editor, point.x, point.y); } updated = true; @@ -214,16 +209,16 @@ public class MapView extends Element implements GestureListener{ super.act(delta); if(Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField) && - !Inputs.keyDown(io.anuke.ucore.input.Input.CONTROL_LEFT)){ - float ax = Inputs.getAxis("move_x"); - float ay = Inputs.getAxis("move_y"); + !Core.input.keyDown(KeyCode.CONTROL_LEFT)){ + float ax = Core.input.axis(Binding.move_x); + float ay = Core.input.axis(Binding.move_y); offsetx -= ax * 15f / zoom; offsety -= ay * 15f / zoom; } if(ui.editor.hasPane()) return; - zoom += Inputs.scroll() / 10f * zoom; + zoom += Core.input.axis(KeyCode.SCROLL) / 10f * zoom; clampZoom(); } @@ -231,7 +226,7 @@ public class MapView extends Element implements GestureListener{ zoom = Mathf.clamp(zoom, 0.2f, 12f); } - private GridPoint2 project(float x, float y){ + private Point2 project(float x, float y){ float ratio = 1f / ((float) editor.getMap().width() / editor.getMap().height()); float size = Math.min(width, height); float sclwidth = size * zoom; @@ -258,7 +253,7 @@ public class MapView extends Element implements GestureListener{ } @Override - public void draw(Batch batch, float alpha){ + public void draw(){ float ratio = 1f / ((float) editor.getMap().width() / editor.getMap().height()); float size = Math.min(width, height); float sclwidth = size * zoom; @@ -268,7 +263,9 @@ public class MapView extends Element implements GestureListener{ image.setImageSize(editor.getMap().width(), editor.getMap().height()); - Graphics.beginClip(x, y, width, height); + if(!ScissorStack.pushScissors(rect.set(x, y, width, height))){ + return; + } Draw.color(Palette.remove); Lines.stroke(2f); @@ -279,7 +276,7 @@ public class MapView extends Element implements GestureListener{ if(grid){ Draw.color(Color.GRAY); image.setBounds(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight); - image.draw(batch, alpha); + image.draw(); Draw.color(); } @@ -307,13 +304,13 @@ public class MapView extends Element implements GestureListener{ } if(tool.edit && (!mobile || drawing)){ - GridPoint2 p = project(mousex, mousey); + Point2 p = project(mousex, mousey); Vector2 v = unproject(p.x, p.y).add(x, y); Lines.poly(brushPolygons[index], v.x, v.y, scaling); } }else{ if((tool.edit || tool == EditorTool.line) && (!mobile || drawing)){ - GridPoint2 p = project(mousex, mousey); + Point2 p = project(mousex, mousey); Vector2 v = unproject(p.x, p.y).add(x, y); float offset = (editor.getDrawBlock().size % 2 == 0 ? scaling / 2f : 0f); Lines.square( @@ -323,51 +320,26 @@ public class MapView extends Element implements GestureListener{ } } - Graphics.endClip(); - Draw.color(Palette.accent); Lines.stroke(Unit.dp.scl(3f)); Lines.rect(x, y, width, height); Draw.reset(); + + ScissorStack.popScissors(); } private boolean active(){ return Core.scene.getKeyboardFocus() != null && Core.scene.getKeyboardFocus().isDescendantOf(ui.editor) && ui.editor.isShown() && tool == EditorTool.zoom && - Core.scene.hit(Graphics.mouse().x, Graphics.mouse().y, true) == this; - } - - @Override - public boolean touchDown(float x, float y, int pointer, int button){ - return false; - } - - @Override - public boolean tap(float x, float y, int count, int button){ - return false; - } - - @Override - public boolean longPress(float x, float y){ - return false; - } - - @Override - public boolean fling(float velocityX, float velocityY, int button){ - return false; + Core.scene.hit(Core.input.mouse().x, Core.input.mouse().y, true) == this; } @Override public boolean pan(float x, float y, float deltaX, float deltaY){ if(!active()) return false; offsetx += deltaX / zoom; - offsety -= deltaY / zoom; - return false; - } - - @Override - public boolean panStop(float x, float y, int pointer, int button){ + offsety += deltaY / zoom; return false; } diff --git a/core/src/io/anuke/mindustry/editor/OperationStack.java b/core/src/io/anuke/mindustry/editor/OperationStack.java index 402da3cf5e..aa53bb3afa 100755 --- a/core/src/io/anuke/mindustry/editor/OperationStack.java +++ b/core/src/io/anuke/mindustry/editor/OperationStack.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.editor; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; public class OperationStack{ private final static int maxSize = 10; @@ -22,7 +22,7 @@ public class OperationStack{ stack.add(action); if(stack.size > maxSize){ - stack.removeIndex(0); + stack.remove(0); } } diff --git a/core/src/io/anuke/mindustry/entities/Damage.java b/core/src/io/anuke/mindustry/entities/Damage.java index 23f00d7e10..7df2455bc6 100644 --- a/core/src/io/anuke/mindustry/entities/Damage.java +++ b/core/src/io/anuke/mindustry/entities/Damage.java @@ -1,11 +1,17 @@ package io.anuke.mindustry.entities; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.function.Predicate; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.bullets.TurretBullets; import io.anuke.mindustry.content.fx.ExplosionFx; -import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.effect.Fire; import io.anuke.mindustry.entities.effect.Lightning; @@ -13,14 +19,6 @@ import io.anuke.mindustry.game.Team; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.function.Predicate; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Physics; -import io.anuke.ucore.util.Translator; import static io.anuke.mindustry.Vars.*; @@ -28,26 +26,26 @@ import static io.anuke.mindustry.Vars.*; public class Damage{ private static Rectangle rect = new Rectangle(); private static Rectangle hitrect = new Rectangle(); - private static Translator tr = new Translator(); + private static Vector2 tr = new Vector2(); /**Creates a dynamic explosion based on specified parameters.*/ public static void dynamicExplosion(float x, float y, float flammability, float explosiveness, float power, float radius, Color color){ for(int i = 0; i < Mathf.clamp(power / 20, 0, 6); i++){ int branches = 5 + Mathf.clamp((int) (power / 30), 1, 20); - Timers.run(i * 2f + Mathf.random(4f), () -> Lightning.create(Team.none, Palette.power, 3, + Time.run(i * 2f + Mathf.random(4f), () -> Lightning.create(Team.none, Palette.power, 3, x, y, Mathf.random(360f), branches + Mathf.range(2))); } for(int i = 0; i < Mathf.clamp(flammability / 4, 0, 30); i++){ - Timers.run(i / 2f, () -> Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f))); + Time.run(i / 2f, () -> Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f))); } int waves = Mathf.clamp((int) (explosiveness / 4), 0, 30); for(int i = 0; i < waves; i++){ int f = i; - Timers.run(i * 2f, () -> { - threads.run(() -> Damage.damage(x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), explosiveness / 2f)); + Time.run(i * 2f, () -> { + Damage.damage(x, y, Mathf.clamp(radius + explosiveness, 0, 50f) * ((f + 1f) / waves), explosiveness / 2f); Effects.effect(ExplosionFx.blockExplosionSmoke, x + Mathf.range(radius), y + Mathf.range(radius)); }); } @@ -119,7 +117,7 @@ public class Damage{ other.width += expand * 2; other.height += expand * 2; - Vector2 vec = Physics.raycastRect(x, y, x2, y2, other); + Vector2 vec = Geometry.raycastRect(x, y, x2, y2, other); if(vec != null){ Effects.effect(effect, vec.x, vec.y); @@ -160,7 +158,7 @@ public class Damage{ /**Damages all entities and blocks in a radius that are enemies of the team.*/ public static void damage(Team team, float x, float y, float radius, float damage){ Consumer cons = entity -> { - if(entity.team == team || entity.distanceTo(x, y) > radius){ + if(entity.team == team || entity.dst(x, y) > radius){ return; } float amount = calculateDamage(x, y, entity.x, entity.y, radius, damage); @@ -180,8 +178,8 @@ public class Damage{ int trad = (int) (radius / tilesize); for(int dx = -trad; dx <= trad; dx++){ for(int dy = -trad; dy <= trad; dy++){ - Tile tile = world.tile(Mathf.scl2(x, tilesize) + dx, Mathf.scl2(y, tilesize) + dy); - if(tile != null && tile.entity != null && (team == null || state.teams.areEnemies(team, tile.getTeam())) && Vector2.dst(dx, dy, 0, 0) <= trad){ + Tile tile = world.tile(Math.round(x / tilesize) + dx, Math.round(y / tilesize) + dy); + if(tile != null && tile.entity != null && (team == null || state.teams.areEnemies(team, tile.getTeam())) && Mathf.dst(dx, dy, 0, 0) <= trad){ float amount = calculateDamage(x, y, tile.worldx(), tile.worldy(), radius, damage); tile.entity.damage(amount); } @@ -191,7 +189,7 @@ public class Damage{ } private static float calculateDamage(float x, float y, float tx, float ty, float radius, float damage){ - float dist = Vector2.dst(x, y, tx, ty); + float dist = Mathf.dst(x, y, tx, ty); float falloff = 0.4f; float scaled = Mathf.lerp(1f - dist / radius, 1f, falloff); return damage * scaled; diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index c4708c9951..a6c073c61e 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -1,13 +1,24 @@ package io.anuke.mindustry.entities; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.GlyphLayout; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Queue; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Queue; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.EntityQuery; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.*; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.Interval; +import io.anuke.arc.util.Pack; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.content.Mechs; import io.anuke.mindustry.content.fx.UnitFx; import io.anuke.mindustry.entities.effect.ScorchDecal; @@ -15,7 +26,7 @@ import io.anuke.mindustry.entities.traits.*; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.graphics.Palette; -import io.anuke.mindustry.graphics.Trail; +import io.anuke.mindustry.input.Binding; import io.anuke.mindustry.io.TypeIO; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetConnection; @@ -24,13 +35,6 @@ import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.Floor; import io.anuke.mindustry.world.blocks.storage.CoreBlock.CoreEntity; -import io.anuke.ucore.core.*; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.EntityQuery; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Hue; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.*; import java.io.DataInput; import java.io.DataOutput; @@ -63,7 +67,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra public NetConnection con; public int playerIndex = 0; public boolean isLocal = false; - public Timer timer = new Timer(4); + public Interval timer = new Interval(4); public TargetTrait target; public TargetTrait moveTarget; @@ -71,8 +75,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra private Queue placeQueue = new Queue<>(); private Tile mining; private CarriableTrait carrying; - private Trail trail = new Trail(12); - private Vector2 movement = new Translator(); + private Vector2 movement = new Vector2(); private boolean moved; //endregion @@ -112,7 +115,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } @Override - public Timer getTimer(){ + public Interval getTimer(){ return timer; } @@ -150,7 +153,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } if(interpolator.target.dst(interpolator.last) > 1f){ - walktime += Timers.delta(); + walktime += Time.delta(); } } @@ -282,18 +285,15 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra @Override public void drawShadow(float offsetX, float offsetY){ - float x = snappedX(), y = snappedY(); - float scl = mech.flying ? 1f : boostHeat/2f; + float scl = mech.flying ? 1f : boostHeat / 2f; - Draw.rect(mech.iconRegion, x + offsetX*scl, y + offsetY*scl, rotation - 90); + Draw.rect(mech.iconRegion, x + offsetX * scl, y + offsetY * scl, rotation - 90); } @Override public void draw(){ if(dead) return; - float x = snappedX(), y = snappedY(); - if(!movement.isZero() && moved && !state.isPaused()){ walktime += movement.len() / 0.7f * getFloorOn().speedMultiplier; baseRotation = Mathf.slerpDelta(baseRotation, movement.angle(), 0.13f); @@ -317,9 +317,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra for(int i : Mathf.signs){ Draw.rect(mech.legRegion, - x + Angles.trnsx(baseRotation, ft * i + boostTrnsY, -boostTrnsX * i), - y + Angles.trnsy(baseRotation, ft * i + boostTrnsY, -boostTrnsX * i), - mech.legRegion.getRegionWidth() * i, mech.legRegion.getRegionHeight() - Mathf.clamp(ft * i, 0, 2), baseRotation - 90 + boostAng * i); + x + Angles.trnsx(baseRotation, ft * i + boostTrnsY, -boostTrnsX * i), + y + Angles.trnsy(baseRotation, ft * i + boostTrnsY, -boostTrnsX * i), + mech.legRegion.getWidth() * i * Draw.scl, + (mech.legRegion.getHeight() - Mathf.clamp(ft * i, 0, 2)) * Draw.scl, + baseRotation - 90 + boostAng * i); } Draw.rect(mech.baseRegion, x, y, baseRotation - 90); @@ -337,10 +339,13 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra for(int i : Mathf.signs){ float tra = rotation - 90, trY = -mech.weapon.getRecoil(this, i > 0) + mech.weaponOffsetY; - float w = i > 0 ? -mech.weapon.equipRegion.getRegionWidth() : mech.weapon.equipRegion.getRegionWidth(); + float w = i > 0 ? -mech.weapon.equipRegion.getWidth() : mech.weapon.equipRegion.getWidth(); Draw.rect(mech.weapon.equipRegion, - x + Angles.trnsx(tra, (mech.weaponOffsetX + mech.spreadX(this)) * i, trY), - y + Angles.trnsy(tra, (mech.weaponOffsetX + mech.spreadX(this)) * i, trY), w, mech.weapon.equipRegion.getRegionHeight(), rotation - 90); + x + Angles.trnsx(tra, (mech.weaponOffsetX + mech.spreadX(this)) * i, trY), + y + Angles.trnsy(tra, (mech.weaponOffsetX + mech.spreadX(this)) * i, trY), + w * Draw.scl, + mech.weapon.equipRegion.getHeight() * Draw.scl, + rotation - 90); } float backTrns = 4f, itemSize = 5f; @@ -352,9 +357,9 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra float angT = i == 0 ? 0 : Mathf.randomSeedRange(i + 1, 60f); float lenT = i == 0 ? 0 : Mathf.randomSeedRange(i + 2, 1f) - 1f; Draw.rect(stack.item.region, - x + Angles.trnsx(rotation + 180f + angT, backTrns + lenT), - y + Angles.trnsy(rotation + 180f + angT, backTrns + lenT), - itemSize, itemSize, rotation); + x + Angles.trnsx(rotation + 180f + angT, backTrns + lenT), + y + Angles.trnsy(rotation + 180f + angT, backTrns + lenT), + itemSize, itemSize, rotation); } } @@ -363,9 +368,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra @Override public void drawStats(){ - float x = snappedX(), y = snappedY(); - - Draw.color(Color.BLACK, team.color, healthf() + Mathf.absin(Timers.time(), healthf()*5f, 1f - healthf())); + Draw.color(Color.BLACK, team.color, healthf() + Mathf.absin(Time.time(), healthf() * 5f, 1f - healthf())); Draw.alpha(hitTime / hitDuration); Draw.rect(getPowerCellRegion(), x + Angles.trnsx(rotation, mech.cellTrnsY, 0f), y + Angles.trnsy(rotation, mech.cellTrnsY, 0f), rotation - 90); Draw.color(); @@ -376,53 +379,38 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra if(dead) return; drawBuilding(this); - - if(mech.flying || boostHeat > 0.001f){ - float wobblyness = 0.6f; - if(!state.isPaused()) trail.update(x + Angles.trnsx(rotation + 180f, 5f) + Mathf.range(wobblyness), - y + Angles.trnsy(rotation + 180f, 5f) + Mathf.range(wobblyness)); - trail.draw(Hue.mix(mech.trailColor, mech.trailColorTo, mech.flying ? 0f : boostHeat, Tmp.c1), 5f * (isFlying() ? 1f : boostHeat)); - }else{ - trail.clear(); - } - } - - public float snappedX(){ - return snapCamera && isLocal ? (int) (x + 0.0001f) : x; - } - - public float snappedY(){ - return snapCamera && isLocal ? (int) (y + 0.0001f) : y; } public void drawName(){ - GlyphLayout layout = Pooling.obtain(GlyphLayout.class, GlyphLayout::new); + BitmapFont font = Core.scene.skin.getFont("default-font"); + GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new); - boolean ints = Core.font.usesIntegerPositions(); - Core.font.setUseIntegerPositions(false); - Draw.tscl(0.25f / io.anuke.ucore.scene.ui.layout.Unit.dp.scl(1f)); - layout.setText(Core.font, name); + boolean ints = font.usesIntegerPositions(); + font.setUseIntegerPositions(false); + font.getData().setScale(0.25f / io.anuke.arc.scene.ui.layout.Unit.dp.scl(1f)); + layout.setText(font, name); Draw.color(0f, 0f, 0f, 0.3f); - Draw.rect("blank", x, y + 8 - layout.height / 2, layout.width + 2, layout.height + 3); + Fill.rect(x, y + 8 - layout.height / 2, layout.width + 2, layout.height + 3); Draw.color(); - Draw.tcolor(color); - Draw.text(name, x, y + 8); + font.setColor(color); + + font.draw(name, x, y + 8, 0, Align.center, false); if(isAdmin){ float s = 3f; Draw.color(color.r * 0.5f, color.g * 0.5f, color.b * 0.5f, 1f); - Draw.rect("icon-admin-small", x + layout.width / 2f + 2 + 1, y + 6.5f, s, s); + Draw.rect(Core.atlas.find("icon-admin-small"), x + layout.width / 2f + 2 + 1, y + 6.5f, s, s); Draw.color(color); - Draw.rect("icon-admin-small", x + layout.width / 2f + 2 + 1, y + 7f, s, s); + Draw.rect(Core.atlas.find("icon-admin-small"), x + layout.width / 2f + 2 + 1, y + 7f, s, s); } Draw.reset(); - Pooling.free(layout); - Draw.tscl(1f); - Core.font.setUseIntegerPositions(ints); + Pools.free(layout); + font.getData().setScale(1f); + font.setUseIntegerPositions(ints); } - /**Draw all current build requests. Does not draw the beam effect, only the positions.*/ + /** Draw all current build requests. Does not draw the beam effect, only the positions. */ public void drawBuildRequests(){ for(BuildRequest request : getPlaceQueue()){ if(getCurrentRequest() == request) continue; @@ -431,42 +419,38 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra Block block = world.tile(request.x, request.y).target().block(); //draw removal request - Lines.stroke(2f); + Lines.stroke(2f, Palette.removeBack); - Draw.color(Palette.removeBack); - - float rad = Mathf.absin(Timers.time(), 7f, 1f) + block.size * tilesize / 2f - 1; + float rad = Mathf.absin(Time.time(), 7f, 1f) + block.size * tilesize / 2f - 1; Lines.square( - request.x * tilesize + block.offset(), - request.y * tilesize + block.offset() - 1, - rad); + request.x * tilesize + block.offset(), + request.y * tilesize + block.offset() - 1, + rad); Draw.color(Palette.remove); Lines.square( - request.x * tilesize + block.offset(), - request.y * tilesize + block.offset(), - rad); + request.x * tilesize + block.offset(), + request.y * tilesize + block.offset(), + rad); }else{ //draw place request - Lines.stroke(2f); + Lines.stroke(2f, Palette.accentBack); - Draw.color(Palette.accentBack); - - float rad = Mathf.absin(Timers.time(), 7f, 1f) - 2f + request.recipe.result.size * tilesize / 2f; + float rad = Mathf.absin(Time.time(), 7f, 1f) - 2f + request.recipe.result.size * tilesize / 2f; Lines.square( - request.x * tilesize + request.recipe.result.offset(), - request.y * tilesize + request.recipe.result.offset() - 1, - rad); + request.x * tilesize + request.recipe.result.offset(), + request.y * tilesize + request.recipe.result.offset() - 1, + rad); Draw.color(Palette.accent); Lines.square( - request.x * tilesize + request.recipe.result.offset(), - request.y * tilesize + request.recipe.result.offset(), - rad); + request.x * tilesize + request.recipe.result.offset(), + request.y * tilesize + request.recipe.result.offset(), + rad); } } @@ -479,7 +463,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra @Override public void update(){ - hitTime -= Timers.delta(); + hitTime -= Time.delta(); if(Float.isNaN(x) || Float.isNaN(y)){ velocity.set(0f, 0f); @@ -552,14 +536,14 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra updateBuilding(this); - x = Mathf.clamp(x, tilesize, world.width() * tilesize - tilesize); - y = Mathf.clamp(y, tilesize, world.height() * tilesize - tilesize); + x = Mathf.clamp(x, 0, world.width() * tilesize - tilesize); + y = Mathf.clamp(y, 0, world.height() * tilesize - tilesize); } protected void updateMech(){ Tile tile = world.tileWorld(x, y); - isBoosting = Inputs.keyDown("dash") && !mech.flying; + isBoosting = Core.input.keyDown(Binding.dash) && !mech.flying; //if player is in solid block if(tile != null && tile.solid()){ @@ -579,7 +563,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } //drop from carrier on key press - if(!ui.chatfrag.chatOpen() && Inputs.keyTap("drop_unit")){ + if(!ui.chatfrag.chatOpen() && Core.input.keyTap(Binding.drop_unit)){ if(!mech.flying){ if(getCarrier() != null){ Call.dropSelf(this); @@ -597,20 +581,19 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra movement.setZero(); - String section = control.input(playerIndex).section; + float xa = Core.input.axis(Binding.move_x); + float ya = Core.input.axis(Binding.move_y); + if(!Core.input.keyDown(Binding.gridMode)){ + movement.y += ya * speed; + movement.x += xa * speed; + } - float xa = Inputs.getAxis(section, "move_x"); - float ya = Inputs.getAxis(section, "move_y"); - - movement.y += ya * speed; - movement.x += xa * speed; - - Vector2 vec = Graphics.world(control.input(playerIndex).getMouseX(), control.input(playerIndex).getMouseY()); + Vector2 vec = Core.input.mouseWorld(control.input(playerIndex).getMouseX(), control.input(playerIndex).getMouseY()); pointerX = vec.x; pointerY = vec.y; updateShooting(); - movement.limit(speed).scl(Timers.delta()); + movement.limit(speed).scl(Time.delta()); if(getCarrier() == null){ if(!ui.chatfrag.chatOpen()){ @@ -618,7 +601,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } float prex = x, prey = y; updateVelocityStatus(); - moved = distanceTo(prex, prey) > 0.001f; + moved = dst(prex, prey) > 0.001f; }else{ velocity.setZero(); x = Mathf.lerpDelta(x, getCarrier().getX(), 0.1f); @@ -646,7 +629,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra protected void updateFlying(){ if(Units.invalidateTarget(target, this) && !(target instanceof TileEntity && ((TileEntity) target).damaged() && target.getTeam() == team && - mech.canHeal && distanceTo(target) < getWeapon().getAmmo().getRange())){ + mech.canHeal && dst(target) < getWeapon().getAmmo().getRange())){ target = null; } @@ -663,7 +646,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra velocity.setAngle(Mathf.slerpDelta(velocity.angle(), angleTo(moveTarget), 0.1f)); } - if(distanceTo(moveTarget) < 2f){ + if(dst(moveTarget) < 2f){ if(moveTarget instanceof CarriableTrait){ carry((CarriableTrait) moveTarget); }else if(tapping){ @@ -686,7 +669,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra movement.set(targetX - x, targetY - y).limit(isBoosting && !mech.flying ? mech.boostSpeed : mech.speed); movement.setAngle(Mathf.slerp(movement.angle(), velocity.angle(), 0.05f)); - if(distanceTo(targetX, targetY) < attractDst){ + if(dst(targetX, targetY) < attractDst){ movement.setZero(); } @@ -695,27 +678,27 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra getHitbox(rect); rect.x -= expansion; rect.y -= expansion; - rect.width += expansion*2f; - rect.height += expansion*2f; + rect.width += expansion * 2f; + rect.height += expansion * 2f; - isBoosting = EntityQuery.collisions().overlapsTile(rect) || distanceTo(targetX, targetY) > 85f; + isBoosting = EntityQuery.collisions().overlapsTile(rect) || dst(targetX, targetY) > 85f; - velocity.add(movement.scl(Timers.delta())); + velocity.add(movement.scl(Time.delta())); if(velocity.len() <= 0.2f && mech.flying){ - rotation += Mathf.sin(Timers.time() + id * 99, 10f, 1f); + rotation += Mathf.sin(Time.time() + id * 99, 10f, 1f); }else if(target == null){ rotation = Mathf.slerpDelta(rotation, velocity.angle(), velocity.len() / 10f); } float lx = x, ly = y; updateVelocityStatus(); - moved = distanceTo(lx, ly) > 0.001f && !isCarried(); + moved = dst(lx, ly) > 0.001f && !isCarried(); if(mech.flying){ //hovering effect - x += Mathf.sin(Timers.time() + id * 999, 25f, 0.08f); - y += Mathf.cos(Timers.time() + id * 999, 25f, 0.08f); + x += Mathf.sin(Time.time() + id * 999, 25f, 0.08f); + y += Mathf.cos(Time.time() + id * 999, 25f, 0.08f); } //update shooting if not building, not mining and there's ammo left @@ -725,15 +708,15 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra if(mobile){ if(target == null){ isShooting = false; - if(Settings.getBool("autotarget")){ + if(Core.settings.getBool("autotarget")){ target = Units.getClosestTarget(team, x, y, getWeapon().getAmmo().getRange()); if(mech.canHeal && target == null){ target = Geometry.findClosest(x, y, world.indexer.getDamaged(Team.blue)); - if(target != null && distanceTo(target) > getWeapon().getAmmo().getRange()){ + if(target != null && dst(target) > getWeapon().getAmmo().getRange()){ target = null; }else if(target != null){ - target = ((Tile)target).entity; + target = ((Tile) target).entity; } } @@ -742,14 +725,14 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } } }else if(target.isValid() || (target instanceof TileEntity && ((TileEntity) target).damaged() && target.getTeam() == team && - mech.canHeal && distanceTo(target) < getWeapon().getAmmo().getRange())){ + mech.canHeal && dst(target) < getWeapon().getAmmo().getRange())){ //rotate toward and shoot the target if(mech.turnCursor){ rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.2f); } Vector2 intercept = - Predict.intercept(x, y, target.getX(), target.getY(), target.getVelocity().x - velocity.x, target.getVelocity().y - velocity.y, getWeapon().getAmmo().bullet.speed); + Predict.intercept(x, y, target.getX(), target.getY(), target.getVelocity().x - velocity.x, target.getVelocity().y - velocity.y, getWeapon().getAmmo().bullet.speed); pointerX = intercept.x; pointerY = intercept.y; @@ -759,8 +742,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } }else if(isShooting()){ - Vector2 vec = Graphics.world(control.input(playerIndex).getMouseX(), - control.input(playerIndex).getMouseY()); + Vector2 vec = Core.input.mouseWorld(control.input(playerIndex).getMouseX(), + control.input(playerIndex).getMouseY()); pointerX = vec.x; pointerY = vec.y; @@ -773,7 +756,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra //region utility methods - /** Resets all values of the player.*/ + /** Resets all values of the player. */ public void reset(){ resetNoAdd(); @@ -786,7 +769,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra inventory.clear(); placeQueue.clear(); dead = true; - trail.clear(); + target = null; + moveTarget = null; carrier = null; health = maxHealth(); boostHeat = drownTime = hitTime = 0f; @@ -869,7 +853,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra public void write(DataOutput buffer) throws IOException{ super.writeSave(buffer, !isLocal); TypeIO.writeStringData(buffer, name); //TODO writing strings is very inefficient - buffer.writeByte(Bits.toByte(isAdmin) | (Bits.toByte(dead) << 1) | (Bits.toByte(isBoosting) << 2)); + buffer.writeByte(Pack.byteValue(isAdmin) | (Pack.byteValue(dead) << 1) | (Pack.byteValue(isBoosting) << 2)); buffer.writeInt(Color.rgba8888(color)); buffer.writeByte(mech.id); buffer.writeInt(mining == null ? -1 : mining.pos()); @@ -880,7 +864,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra } @Override - public void read(DataInput buffer, long time) throws IOException{ + public void read(DataInput buffer) throws IOException{ float lastx = x, lasty = y, lastrot = rotation; super.readSave(buffer); name = TypeIO.readStringData(buffer); @@ -896,7 +880,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra readBuilding(buffer, !isLocal); - interpolator.read(lastx, lasty, x, y, time, rotation, baseRotation); + interpolator.read(lastx, lasty, x, y, rotation, baseRotation); rotation = lastrot; if(isLocal){ diff --git a/core/src/io/anuke/mindustry/entities/Predict.java b/core/src/io/anuke/mindustry/entities/Predict.java index 09d589bffd..d4a935c173 100644 --- a/core/src/io/anuke/mindustry/entities/Predict.java +++ b/core/src/io/anuke/mindustry/entities/Predict.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.entities; -import com.badlogic.gdx.math.Vector2; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; import io.anuke.mindustry.entities.traits.TargetTrait; -import io.anuke.ucore.util.Mathf; /** * Class for predicting shoot angles based on velocities of targets. diff --git a/core/src/io/anuke/mindustry/entities/StatusController.java b/core/src/io/anuke/mindustry/entities/StatusController.java index 2df186d4c8..a324e71ab4 100644 --- a/core/src/io/anuke/mindustry/entities/StatusController.java +++ b/core/src/io/anuke/mindustry/entities/StatusController.java @@ -1,15 +1,14 @@ package io.anuke.mindustry.entities; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.Tmp; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.entities.traits.Saveable; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.StatusEffect; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.util.Pooling; -import io.anuke.ucore.util.ThreadArray; -import io.anuke.ucore.util.Tmp; import java.io.DataInput; import java.io.DataOutput; @@ -21,9 +20,9 @@ import static io.anuke.mindustry.Vars.content; */ public class StatusController implements Saveable{ private static final StatusEntry globalResult = new StatusEntry(); - private static final Array removals = new ThreadArray<>(); + private static final Array removals = new Array<>(); - private Array statuses = new ThreadArray<>(); + private Array statuses = new Array<>(); private float speedMultiplier; private float damageMultiplier; @@ -57,7 +56,7 @@ public class StatusController implements Saveable{ } //otherwise, no opposites found, add direct effect - StatusEntry entry = Pooling.obtain(StatusEntry.class, StatusEntry::new); + StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new); entry.set(effect, newTime); statuses.add(entry); } @@ -88,10 +87,10 @@ public class StatusController implements Saveable{ removals.clear(); for(StatusEntry entry : statuses){ - entry.time = Math.max(entry.time - Timers.delta(), 0); + entry.time = Math.max(entry.time - Time.delta(), 0); if(entry.time <= 0){ - Pooling.free(entry); + Pools.free(entry); removals.add(entry); }else{ speedMultiplier *= entry.effect.speedMultiplier; @@ -137,7 +136,7 @@ public class StatusController implements Saveable{ @Override public void readSave(DataInput stream) throws IOException{ for(StatusEntry effect : statuses){ - Pooling.free(effect); + Pools.free(effect); } statuses.clear(); @@ -146,7 +145,7 @@ public class StatusController implements Saveable{ for(int i = 0; i < amount; i++){ byte id = stream.readByte(); float time = stream.readShort() / 2f; - StatusEntry entry = Pooling.obtain(StatusEntry.class, StatusEntry::new); + StatusEntry entry = Pools.obtain(StatusEntry.class, StatusEntry::new); entry.set(content.getByID(ContentType.status, id), time); statuses.add(entry); } diff --git a/core/src/io/anuke/mindustry/entities/TileEntity.java b/core/src/io/anuke/mindustry/entities/TileEntity.java index 6207154dd1..c3dc293f95 100644 --- a/core/src/io/anuke/mindustry/entities/TileEntity.java +++ b/core/src/io/anuke/mindustry/entities/TileEntity.java @@ -1,11 +1,18 @@ package io.anuke.mindustry.entities; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectSet; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.ObjectSet; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.BaseEntity; +import io.anuke.arc.entities.trait.HealthTrait; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Interval; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.traits.TargetTrait; @@ -20,13 +27,6 @@ import io.anuke.mindustry.world.modules.ConsumeModule; import io.anuke.mindustry.world.modules.ItemModule; import io.anuke.mindustry.world.modules.LiquidModule; import io.anuke.mindustry.world.modules.PowerModule; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.BaseEntity; -import io.anuke.ucore.entities.trait.HealthTrait; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Timer; import java.io.DataInput; import java.io.DataOutput; @@ -42,7 +42,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ public static int sleepingEntities = 0; public Tile tile; - public Timer timer; + public Interval timer; public float health; public float timeScale = 1f, timeScaleDuration; @@ -78,7 +78,7 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ health = tile.block().health; - timer = new Timer(tile.block().timers); + timer = new Interval(tile.block().timers); if(shouldAdd){ add(); @@ -89,12 +89,12 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ /**Scaled delta.*/ public float delta(){ - return Timers.delta() * timeScale; + return Time.delta() * timeScale; } /**Call when nothing is happening to the entity. This increments the internal sleep timer.*/ public void sleep(){ - sleepTime += Timers.delta(); + sleepTime += Time.delta(); if(!sleeping && sleepTime >= timeToSleep){ remove(); sleeping = true; @@ -169,8 +169,8 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ public void removeFromProximity(){ tile.block().onProximityRemoved(tile); - GridPoint2[] nearby = Edges.getEdges(tile.block().size); - for(GridPoint2 point : nearby){ + Point2[] nearby = Edges.getEdges(tile.block().size); + for(Point2 point : nearby){ Tile other = world.tile(tile.x + point.x, tile.y + point.y); //remove this tile from all nearby tile's proximities if(other != null){ @@ -187,8 +187,8 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ tmpTiles.clear(); proximity.clear(); - GridPoint2[] nearby = Edges.getEdges(tile.block().size); - for(GridPoint2 point : nearby){ + Point2[] nearby = Edges.getEdges(tile.block().size); + for(Point2 point : nearby){ Tile other = world.tile(tile.x + point.x, tile.y + point.y); if(other == null) continue; @@ -258,19 +258,19 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{ @Override public Vector2 getVelocity(){ - return Vector2.Zero; + return Vector2.ZERO; } @Override public void update(){ //TODO better smoke effect, this one is awful if(health != 0 && health < tile.block().health && !(tile.block() instanceof Wall) && - Mathf.chance(0.009f * Timers.delta() * (1f - health / tile.block().health))){ + Mathf.chance(0.009f * Time.delta() * (1f - health / tile.block().health))){ Effects.effect(Fx.smoke, x + Mathf.range(4), y + Mathf.range(4)); } - timeScaleDuration -= Timers.delta(); + timeScaleDuration -= Time.delta(); if(timeScaleDuration <= 0f || !tile.block().canOverdrive){ timeScale = 1f; } diff --git a/core/src/io/anuke/mindustry/entities/Unit.java b/core/src/io/anuke/mindustry/entities/Unit.java index 198d44b283..1c3d4c6660 100644 --- a/core/src/io/anuke/mindustry/entities/Unit.java +++ b/core/src/io/anuke/mindustry/entities/Unit.java @@ -1,9 +1,20 @@ package io.anuke.mindustry.entities; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.impl.DestructibleEntity; +import io.anuke.arc.entities.trait.DamageTrait; +import io.anuke.arc.entities.trait.DrawTrait; +import io.anuke.arc.entities.trait.SolidTrait; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.entities.traits.*; import io.anuke.mindustry.game.Team; @@ -15,16 +26,6 @@ import io.anuke.mindustry.type.Weapon; import io.anuke.mindustry.world.Pos; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.Floor; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.impl.DestructibleEntity; -import io.anuke.ucore.entities.trait.DamageTrait; -import io.anuke.ucore.entities.trait.DrawTrait; -import io.anuke.ucore.entities.trait.SolidTrait; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; import java.io.DataInput; import java.io.DataOutput; @@ -194,7 +195,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ Units.getNearby(queryRect, t -> { if(t == this || t.getCarrier() == this || getCarrier() == t || t.isFlying() != isFlying()) return; - float dst = distanceTo(t); + float dst = dst(t); moveVector.set(x, y).sub(t.getX(), t.getY()).setLength(1f * (1f - (dst / queryRect.getWidth()))); applyImpulse(moveVector.x, moveVector.y); }); @@ -235,11 +236,11 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ status.update(this); - velocity.limit(getMaxVelocity()).scl(1f + (status.getSpeedMultiplier()-1f) * Timers.delta()); + velocity.limit(getMaxVelocity()).scl(1f + (status.getSpeedMultiplier()-1f) * Time.delta()); if(isFlying()){ - x += velocity.x * Timers.delta(); - y += velocity.y * Timers.delta(); + x += velocity.x * Time.delta(); + y += velocity.y * Time.delta(); }else{ boolean onLiquid = floor.isLiquid; @@ -255,7 +256,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } } - if(onLiquid && velocity.len() > 0.4f && Mathf.chance((velocity.len() * floor.speedMultiplier) * 0.06f * Timers.delta())){ + if(onLiquid && velocity.len() > 0.4f && Mathf.chance((velocity.len() * floor.speedMultiplier) * 0.06f * Time.delta())){ Effects.effect(floor.walkEffect, floor.liquidColor, x, y); } @@ -268,8 +269,8 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } if(onLiquid && floor.drownTime > 0){ - drownTime += Timers.delta() * 1f / floor.drownTime; - if(Mathf.chance(Timers.delta() * 0.05f)){ + drownTime += Time.delta() * 1f / floor.drownTime; + if(Mathf.chance(Time.delta() * 0.05f)){ Effects.effect(floor.drownUpdateEffect, floor.liquidColor, x, y); } }else{ @@ -283,12 +284,12 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } float px = x, py = y; - move(velocity.x * floor.speedMultiplier * Timers.delta(), velocity.y * floor.speedMultiplier * Timers.delta()); + move(velocity.x * floor.speedMultiplier * Time.delta(), velocity.y * floor.speedMultiplier * Time.delta()); if(Math.abs(px - x) <= 0.0001f) velocity.x = 0f; if(Math.abs(py - y) <= 0.0001f) velocity.y = 0f; } - velocity.scl(Mathf.clamp(1f - getDrag() * (isFlying() ? 1f : floor.dragMultiplier) * Timers.delta())); + velocity.scl(Mathf.clamp(1f - getDrag() * (isFlying() ? 1f : floor.dragMultiplier) * Time.delta())); } public void applyEffect(StatusEffect effect, float intensity){ @@ -297,7 +298,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } public void damagePeriodic(float amount){ - damage(amount * Timers.delta(), hitTime <= -20 + hitDuration); + damage(amount * Time.delta(), hitTime <= -20 + hitDuration); } public void damage(float amount, boolean withEffect){ @@ -317,14 +318,14 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ } public void drawStats(){ - Draw.color(Color.BLACK, team.color, healthf() + Mathf.absin(Timers.time(), healthf()*5f, 1f - healthf())); + Draw.color(Color.BLACK, team.color, healthf() + Mathf.absin(Time.time(), healthf()*5f, 1f - healthf())); Draw.alpha(hitTime); Draw.rect(getPowerCellRegion(), x, y, rotation - 90); Draw.color(); } public TextureRegion getPowerCellRegion(){ - return Draw.region("power-cell"); + return Core.atlas.find("power-cell"); } public void drawAll(){ diff --git a/core/src/io/anuke/mindustry/entities/Units.java b/core/src/io/anuke/mindustry/entities/Units.java index 0d0584371c..95e16842da 100644 --- a/core/src/io/anuke/mindustry/entities/Units.java +++ b/core/src/io/anuke/mindustry/entities/Units.java @@ -1,18 +1,18 @@ package io.anuke.mindustry.entities; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; +import io.anuke.arc.collection.EnumSet; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.EntityQuery; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.function.Predicate; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Rectangle; import io.anuke.mindustry.entities.traits.TargetTrait; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.EntityQuery; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.function.Predicate; -import io.anuke.ucore.util.EnumSet; -import io.anuke.ucore.util.Geometry; import static io.anuke.mindustry.Vars.*; @@ -38,7 +38,7 @@ public class Units{ * @return whether the target is invalid */ public static boolean invalidateTarget(TargetTrait target, Team team, float x, float y, float range){ - return target == null || (range != Float.MAX_VALUE && target.distanceTo(x, y) > range) || target.getTeam() == team || !target.isValid(); + return target == null || (range != Float.MAX_VALUE && target.dst(x, y) > range) || target.getTeam() == team || !target.isValid(); } /**See {@link #invalidateTarget(TargetTrait, Team, float, float, float)}*/ @@ -165,7 +165,7 @@ public class Units{ if(e.isDead() || !predicate.test(e)) return; - float dist = Vector2.dst(e.x, e.y, x, y); + float dist = Mathf.dst(e.x, e.y, x, y); if(dist < range){ if(result == null || dist < cdist){ result = e; @@ -188,7 +188,7 @@ public class Units{ if(!predicate.test(e)) return; - float dist = Vector2.dst(e.x, e.y, x, y); + float dist = Mathf.dst(e.x, e.y, x, y); if(dist < range){ if(result == null || dist < cdist){ result = e; @@ -221,7 +221,7 @@ public class Units{ EntityGroup group = unitGroups[team.ordinal()]; if(!group.isEmpty()){ EntityQuery.getNearby(group, rect, entity -> { - if(entity.distanceTo(x, y) <= radius){ + if(entity.dst(x, y) <= radius){ cons.accept((Unit) entity); } }); @@ -229,7 +229,7 @@ public class Units{ //now check all players EntityQuery.getNearby(playerGroup, rect, player -> { - if(((Unit) player).team == team && player.distanceTo(x, y) <= radius){ + if(((Unit) player).team == team && player.dst(x, y) <= radius){ cons.accept((Unit) player); } }); diff --git a/core/src/io/anuke/mindustry/entities/bullet/ArtilleryBulletType.java b/core/src/io/anuke/mindustry/entities/bullet/ArtilleryBulletType.java index e0c9af0c27..6a317f0882 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/ArtilleryBulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/ArtilleryBulletType.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.entities.bullet; import io.anuke.mindustry.content.fx.BulletFx; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.g2d.Draw; //TODO scale velocity depending on fslope() public class ArtilleryBulletType extends BasicBulletType{ diff --git a/core/src/io/anuke/mindustry/entities/bullet/BasicBulletType.java b/core/src/io/anuke/mindustry/entities/bullet/BasicBulletType.java index d130585cae..7f3ca88aeb 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/BasicBulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/BasicBulletType.java @@ -1,16 +1,17 @@ package io.anuke.mindustry.entities.bullet; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; import io.anuke.mindustry.entities.Damage; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.traits.TargetTrait; import io.anuke.mindustry.graphics.Palette; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; /** * A BulletType for most ammo-based bullets shot from turrets and units. @@ -47,8 +48,8 @@ public class BasicBulletType extends BulletType{ @Override public void load(){ - backRegion = Draw.region(bulletSprite + "-back"); - frontRegion = Draw.region(bulletSprite); + backRegion = Core.atlas.find(bulletSprite + "-back"); + frontRegion = Core.atlas.find(bulletSprite); } @Override @@ -69,7 +70,7 @@ public class BasicBulletType extends BulletType{ if(homingPower > 0.0001f){ TargetTrait target = Units.getClosestTarget(b.getTeam(), b.x, b.y, homingRange); if(target != null){ - b.getVelocity().setAngle(Angles.moveToward(b.getVelocity().angle(), b.angleTo(target), homingPower * Timers.delta())); + b.getVelocity().setAngle(Angles.moveToward(b.getVelocity().angle(), b.angleTo(target), homingPower * Time.delta())); } } } diff --git a/core/src/io/anuke/mindustry/entities/bullet/Bullet.java b/core/src/io/anuke/mindustry/entities/bullet/Bullet.java index f918d6ce8b..b2d10aeac6 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/Bullet.java +++ b/core/src/io/anuke/mindustry/entities/bullet/Bullet.java @@ -1,8 +1,17 @@ package io.anuke.mindustry.entities.bullet; -import com.badlogic.gdx.math.Vector2; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.BulletEntity; +import io.anuke.arc.entities.trait.Entity; +import io.anuke.arc.entities.trait.SolidTrait; +import io.anuke.arc.entities.trait.VelocityTrait; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Interval; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.effect.Lightning; import io.anuke.mindustry.entities.traits.AbsorbTrait; @@ -10,15 +19,6 @@ import io.anuke.mindustry.entities.traits.SyncTrait; import io.anuke.mindustry.entities.traits.TeamTrait; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.BulletEntity; -import io.anuke.ucore.entities.trait.Entity; -import io.anuke.ucore.entities.trait.SolidTrait; -import io.anuke.ucore.entities.trait.VelocityTrait; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Pooling; -import io.anuke.ucore.util.Timer; import java.io.DataInput; import java.io.DataOutput; @@ -28,7 +28,7 @@ import static io.anuke.mindustry.Vars.*; public class Bullet extends BulletEntity implements TeamTrait, SyncTrait, AbsorbTrait{ private static Vector2 vector = new Vector2(); - public Timer timer = new Timer(3); + public Interval timer = new Interval(3); private float lifeScl; private Team team; private Object data; @@ -55,21 +55,21 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT } public static Bullet create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl, Object data){ - Bullet bullet = Pooling.obtain(Bullet.class, Bullet::new); + Bullet bullet = Pools.obtain(Bullet.class, Bullet::new); bullet.type = type; bullet.owner = owner; bullet.data = data; bullet.velocity.set(0, type.speed).setAngle(angle).scl(velocityScl); if(type.keepVelocity){ - bullet.velocity.add(owner instanceof VelocityTrait ? ((VelocityTrait) owner).getVelocity() : Vector2.Zero); + bullet.velocity.add(owner instanceof VelocityTrait ? ((VelocityTrait) owner).getVelocity() : Vector2.ZERO); } bullet.team = team; bullet.type = type; bullet.lifeScl = lifetimeScl; - bullet.set(x - bullet.velocity.x * Timers.delta(), y - bullet.velocity.y * Timers.delta()); + bullet.set(x - bullet.velocity.x * Time.delta(), y - bullet.velocity.y * Time.delta()); bullet.add(); return bullet; @@ -158,7 +158,7 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT } @Override - public void read(DataInput data, long time) throws IOException{ + public void read(DataInput data) throws IOException{ x = data.readFloat(); y = data.readFloat(); velocity.x = data.readFloat(); @@ -236,7 +236,7 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT @Override protected void updateLife(){ - time += Timers.delta() * 1f/(lifeScl); + time += Time.delta() * 1f/(lifeScl); time = Mathf.clamp(time, 0, type.lifetime()); if(time >= type.lifetime){ @@ -259,7 +259,7 @@ public class Bullet extends BulletEntity implements TeamTrait, SyncT @Override public void removed(){ - Pooling.free(this); + Pools.free(this); } @Override diff --git a/core/src/io/anuke/mindustry/entities/bullet/BulletType.java b/core/src/io/anuke/mindustry/entities/bullet/BulletType.java index b6220dd9dd..0c2cbc7c94 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/BulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/BulletType.java @@ -1,15 +1,15 @@ package io.anuke.mindustry.entities.bullet; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.entities.impl.BaseBulletType; +import io.anuke.arc.math.geom.Vector2; import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.game.Content; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.entities.impl.BaseBulletType; -import io.anuke.ucore.util.Translator; public abstract class BulletType extends Content implements BaseBulletType{ public float lifetime; @@ -45,7 +45,7 @@ public abstract class BulletType extends Content implements BaseBulletType { if(b.getData() instanceof Float) return; - if(unit.distanceTo(b) < explodeRange){ + if(unit.dst(b) < explodeRange){ b.setData(0); - Timers.run(5f, () -> { + Time.run(5f, () -> { if(b.getData() instanceof Integer){ b.time(b.lifetime()); } diff --git a/core/src/io/anuke/mindustry/entities/bullet/LiquidBulletType.java b/core/src/io/anuke/mindustry/entities/bullet/LiquidBulletType.java index fa8b7164ee..4c60fcadf4 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/LiquidBulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/LiquidBulletType.java @@ -1,18 +1,18 @@ package io.anuke.mindustry.entities.bullet; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.GridPoint2; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.entities.effect.Fire; import io.anuke.mindustry.entities.effect.Puddle; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.world; @@ -60,7 +60,7 @@ public class LiquidBulletType extends BulletType{ if(liquid.temperature <= 0.5f && liquid.flammability < 0.3f){ float intensity = 400f; Fire.extinguish(world.tileWorld(hitx, hity), intensity); - for(GridPoint2 p : Geometry.d4){ + for(Point2 p : Geometry.d4){ Fire.extinguish(world.tileWorld(hitx + p.x * tilesize, hity + p.y * tilesize), intensity); } } diff --git a/core/src/io/anuke/mindustry/entities/bullet/MissileBulletType.java b/core/src/io/anuke/mindustry/entities/bullet/MissileBulletType.java index 7e75370183..d27e2f222f 100644 --- a/core/src/io/anuke/mindustry/entities/bullet/MissileBulletType.java +++ b/core/src/io/anuke/mindustry/entities/bullet/MissileBulletType.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.entities.bullet; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.content.fx.BulletFx; import io.anuke.mindustry.graphics.Palette; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.util.Time; +import io.anuke.arc.math.Mathf; public class MissileBulletType extends BasicBulletType{ protected Color trailColor = Palette.missileYellowBack; @@ -21,7 +21,7 @@ public class MissileBulletType extends BasicBulletType{ public void update(Bullet b){ super.update(b); - if(Mathf.chance(Timers.delta() * 0.2)){ + if(Mathf.chance(Time.delta() * 0.2)){ Effects.effect(BulletFx.missileTrail, trailColor, b.x, b.y, 2f); } } diff --git a/core/src/io/anuke/mindustry/entities/effect/Decal.java b/core/src/io/anuke/mindustry/entities/effect/Decal.java index 64c9facba6..4181cec8f7 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Decal.java +++ b/core/src/io/anuke/mindustry/entities/effect/Decal.java @@ -1,12 +1,12 @@ package io.anuke.mindustry.entities.effect; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.entities.traits.BelowLiquidTrait; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.TimedEntity; -import io.anuke.ucore.entities.trait.DrawTrait; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.TimedEntity; +import io.anuke.arc.entities.trait.DrawTrait; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.math.Mathf; import static io.anuke.mindustry.Vars.groundEffectGroup; diff --git a/core/src/io/anuke/mindustry/entities/effect/Fire.java b/core/src/io/anuke/mindustry/entities/effect/Fire.java index bf6e58c698..36e2f03ac5 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Fire.java +++ b/core/src/io/anuke/mindustry/entities/effect/Fire.java @@ -1,10 +1,18 @@ package io.anuke.mindustry.entities.effect; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.IntMap; -import com.badlogic.gdx.utils.Pool.Poolable; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.collection.IntMap; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.TimedEntity; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.util.Structs; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.pooling.Pool.Poolable; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.content.bullets.TurretBullets; import io.anuke.mindustry.content.fx.EnvironmentFx; @@ -16,14 +24,6 @@ import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.TimedEntity; -import io.anuke.ucore.util.Structs; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Pooling; import java.io.DataInput; import java.io.DataOutput; @@ -51,7 +51,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ Fire fire = map.get(tile.pos()); if(fire == null){ - fire = Pooling.obtain(Fire.class, Fire::new); + fire = Pools.obtain(Fire.class, Fire::new); fire.tile = tile; fire.lifetime = baseLifetime; fire.set(tile.worldx(), tile.worldy()); @@ -76,7 +76,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ */ public static void extinguish(Tile tile, float intensity){ if(tile != null && map.containsKey(tile.pos())){ - map.get(tile.pos()).time += intensity * Timers.delta(); + map.get(tile.pos()).time += intensity * Time.delta(); } } @@ -92,11 +92,11 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ @Override public void update(){ - if(Mathf.chance(0.1 * Timers.delta())){ + if(Mathf.chance(0.1 * Time.delta())){ Effects.effect(EnvironmentFx.fire, x + Mathf.range(4f), y + Mathf.range(4f)); } - if(Mathf.chance(0.05 * Timers.delta())){ + if(Mathf.chance(0.05 * Time.delta())){ Effects.effect(EnvironmentFx.smoke, x + Mathf.range(4f), y + Mathf.range(4f)); } @@ -104,7 +104,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ return; } - time = Mathf.clamp(time + Timers.delta(), 0, lifetime()); + time = Mathf.clamp(time + Time.delta(), 0, lifetime()); if(time >= lifetime() || tile == null){ Call.onFireRemoved(getID()); @@ -118,7 +118,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ float flammability = baseFlammability + puddleFlammability; if(!damage && flammability <= 0){ - time += Timers.delta() * 8; + time += Time.delta() * 8; } if(baseFlammability < 0 || block != tile.block()){ @@ -127,20 +127,20 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ } if(damage){ - lifetime += Mathf.clamp(flammability / 8f, 0f, 0.6f) * Timers.delta(); + lifetime += Mathf.clamp(flammability / 8f, 0f, 0.6f) * Time.delta(); } - if(flammability > 1f && Mathf.chance(spreadChance * Timers.delta() * Mathf.clamp(flammability / 5f, 0.3f, 2f))){ - GridPoint2 p = Mathf.select(Geometry.d4); + if(flammability > 1f && Mathf.chance(spreadChance * Time.delta() * Mathf.clamp(flammability / 5f, 0.3f, 2f))){ + Point2 p = Geometry.d4[Mathf.random(3)]; Tile other = world.tile(tile.x + p.x, tile.y + p.y); create(other); - if(Mathf.chance(fireballChance * Timers.delta() * Mathf.clamp(flammability / 10.0))){ + if(Mathf.chance(fireballChance * Time.delta() * Mathf.clamp(flammability / 10f))){ Call.createBullet(TurretBullets.fireball, x, y, Mathf.random(360f)); } } - if(Mathf.chance(0.1 * Timers.delta())){ + if(Mathf.chance(0.1 * Time.delta())){ Puddle p = Puddle.getPuddle(tile); if(p != null){ puddleFlammability = p.getFlammability() / 3f; @@ -177,7 +177,7 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ } @Override - public void read(DataInput data, long time) throws IOException{ + public void read(DataInput data) throws IOException{ x = data.readFloat(); y = data.readFloat(); } diff --git a/core/src/io/anuke/mindustry/entities/effect/GroundEffectEntity.java b/core/src/io/anuke/mindustry/entities/effect/GroundEffectEntity.java index ceaceb8ba7..812cbd0db4 100644 --- a/core/src/io/anuke/mindustry/entities/effect/GroundEffectEntity.java +++ b/core/src/io/anuke/mindustry/entities/effect/GroundEffectEntity.java @@ -1,13 +1,13 @@ package io.anuke.mindustry.entities.effect; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.entities.Effects.EffectRenderer; +import io.anuke.arc.entities.impl.EffectEntity; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.impl.EffectEntity; -import io.anuke.ucore.core.Effects.EffectRenderer; -import io.anuke.ucore.util.Mathf; /** * A ground effect contains an effect that is rendered on the ground layer as opposed to the top layer. @@ -20,7 +20,7 @@ public class GroundEffectEntity extends EffectEntity{ GroundEffect effect = (GroundEffect) this.effect; if(effect.isStatic){ - time += Timers.delta(); + time += Time.delta(); time = Mathf.clamp(time, 0, effect.staticLife); diff --git a/core/src/io/anuke/mindustry/entities/effect/ItemTransfer.java b/core/src/io/anuke/mindustry/entities/effect/ItemTransfer.java index 90e35dd496..bc0dfaaf5e 100644 --- a/core/src/io/anuke/mindustry/entities/effect/ItemTransfer.java +++ b/core/src/io/anuke/mindustry/entities/effect/ItemTransfer.java @@ -1,26 +1,25 @@ package io.anuke.mindustry.entities.effect; -import com.badlogic.gdx.math.Interpolation; -import com.badlogic.gdx.math.Vector2; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.TimedEntity; +import io.anuke.arc.entities.trait.DrawTrait; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Interpolation; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Position; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.TimedEntity; -import io.anuke.ucore.entities.trait.DrawTrait; -import io.anuke.ucore.entities.trait.PosTrait; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Pooling; import static io.anuke.mindustry.Vars.effectGroup; -import static io.anuke.mindustry.Vars.threads; public class ItemTransfer extends TimedEntity implements DrawTrait{ private Vector2 from = new Vector2(); @@ -28,7 +27,7 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{ private Vector2 tovec = new Vector2(); private Item item; private float seed; - private PosTrait to; + private Position to; private Runnable done; public ItemTransfer(){ @@ -51,14 +50,14 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{ public static void transferItemTo(Item item, int amount, float x, float y, Tile tile){ if(tile == null || tile.entity == null || tile.entity.items == null) return; for(int i = 0; i < Mathf.clamp(amount / 3, 1, 8); i++){ - Timers.run(i * 3, () -> create(item, x, y, tile, () -> { + Time.run(i * 3, () -> create(item, x, y, tile, () -> { })); } tile.entity.items.add(item, amount); } - public static void create(Item item, float fromx, float fromy, PosTrait to, Runnable done){ - ItemTransfer tr = Pooling.obtain(ItemTransfer.class, ItemTransfer::new); + public static void create(Item item, float fromx, float fromy, Position to, Runnable done){ + ItemTransfer tr = Pools.obtain(ItemTransfer.class, ItemTransfer::new); tr.item = item; tr.from.set(fromx, fromy); tr.to = to; @@ -86,9 +85,9 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{ @Override public void removed(){ if(done != null){ - threads.run(done); + done.run(); } - Pooling.free(this); + Pools.free(this); } @Override @@ -108,8 +107,7 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{ public void draw(){ float length = fslope() * 6f; float angle = current.set(x, y).sub(from).angle(); - Draw.color(Palette.accent); - Lines.stroke(fslope() * 2f); + Lines.stroke(fslope() * 2f, Palette.accent); Lines.circle(x, y, fslope() * 2f); Lines.lineAngleCenter(x, y, angle, length); diff --git a/core/src/io/anuke/mindustry/entities/effect/Lightning.java b/core/src/io/anuke/mindustry/entities/effect/Lightning.java index 1cf162f286..a26ce41eea 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Lightning.java +++ b/core/src/io/anuke/mindustry/entities/effect/Lightning.java @@ -1,11 +1,24 @@ package io.anuke.mindustry.entities.effect; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntSet; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.IntSet; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.TimedEntity; +import io.anuke.arc.entities.trait.DrawTrait; +import io.anuke.arc.entities.trait.TimeTrait; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.RandomXS128; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Position; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.content.bullets.TurretBullets; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Units; @@ -14,14 +27,6 @@ import io.anuke.mindustry.entities.traits.SyncTrait; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.graphics.Palette; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.TimedEntity; -import io.anuke.ucore.entities.trait.DrawTrait; -import io.anuke.ucore.entities.trait.PosTrait; -import io.anuke.ucore.entities.trait.TimeTrait; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.*; import java.io.DataInput; import java.io.DataOutput; @@ -31,7 +36,7 @@ import static io.anuke.mindustry.Vars.bulletGroup; public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, TimeTrait{ public static final float lifetime = 10f; - private static final SeedRandom random = new SeedRandom(); + private static final RandomXS128 random = new RandomXS128(); private static final Rectangle rect = new Rectangle(); private static final Array entities = new Array<>(); private static final IntSet hit = new IntSet(); @@ -39,7 +44,7 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time private static final float hitRange = 30f; private static int lastSeed = 0; - private Array lines = new Array<>(); + private Array lines = new Array<>(); private Color color = Palette.lancerLaser; /**For pooling use only. Do not call directly!*/ @@ -55,7 +60,7 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time @Remote(called = Loc.server) public static void createLighting(int seed, Team team, Color color, float damage, float x, float y, float rotation, int length){ - Lightning l = Pooling.obtain(Lightning.class, Lightning::new); + Lightning l = Pools.obtain(Lightning.class, Lightning::new); Float dmg = damage; l.x = x; @@ -68,7 +73,7 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time for (int i = 0; i < length/2; i++) { Bullet.create(TurretBullets.damageLightning, l, team, x, y, 0f, 1f, 1f, dmg); - l.lines.add(new Translator(x + Mathf.range(3f), y + Mathf.range(3f))); + l.lines.add(new Vector2(x + Mathf.range(3f), y + Mathf.range(3f))); rect.setSize(hitRange).setCenter(x, y); entities.clear(); @@ -103,7 +108,7 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time public void write(DataOutput data){} @Override - public void read(DataInput data, long time){} + public void read(DataInput data){} @Override public float lifetime(){ @@ -120,15 +125,17 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time @Override public void removed(){ super.removed(); - Pooling.free(this); + Pools.free(this); } @Override public void draw(){ float lx = x, ly = y; Draw.color(color, Color.WHITE, fin()); + //TODO this is really, really bad rendering + /* for(int i = 0; i < lines.size; i++){ - PosTrait v = lines.get(i); + Position v = lines.get(i); float f = (float) i / lines.size; @@ -143,11 +150,10 @@ public class Lightning extends TimedEntity implements DrawTrait, SyncTrait, Time Lines.line(lx, ly, v.getX(), v.getY()); Lines.stroke(3f * fout() * (1f - f)); - // Lines.lineAngleCenter(lx, ly, Angles.angle(lx, ly, v.getX(), v.getY()) + 90f, 20f); lx = v.getX(); ly = v.getY(); - } + }*/ Draw.color(); } diff --git a/core/src/io/anuke/mindustry/entities/effect/Puddle.java b/core/src/io/anuke/mindustry/entities/effect/Puddle.java index ce9dfc4926..b97dbc2f38 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Puddle.java +++ b/core/src/io/anuke/mindustry/entities/effect/Puddle.java @@ -1,12 +1,23 @@ package io.anuke.mindustry.entities.effect; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.utils.IntMap; -import com.badlogic.gdx.utils.Pool.Poolable; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.collection.IntMap; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.impl.SolidEntity; +import io.anuke.arc.entities.trait.DrawTrait; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.pooling.Pool.Poolable; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.bullets.TurretBullets; @@ -19,18 +30,6 @@ import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.impl.SolidEntity; -import io.anuke.ucore.entities.trait.DrawTrait; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Hue; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Pooling; import java.io.DataInput; import java.io.DataOutput; @@ -85,10 +84,10 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai Puddle p = map.get(tile.pos()); - if(generation == 0 && p != null && p.lastRipple <= Timers.time() - 40f){ + if(generation == 0 && p != null && p.lastRipple <= Time.time() - 40f){ Effects.effect(BlockFx.ripple, tile.floor().liquidDrop.color, (tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f); - p.lastRipple = Timers.time(); + p.lastRipple = Time.time(); } return; } @@ -97,7 +96,7 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai if(p == null){ if(Net.client()) return; //not clientside. - Puddle puddle = Pooling.obtain(Puddle.class, Puddle::new); + Puddle puddle = Pools.obtain(Puddle.class, Puddle::new); puddle.tile = tile; puddle.liquid = liquid; puddle.amount = amount; @@ -108,9 +107,9 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai }else if(p.liquid == liquid){ p.accepting = Math.max(amount, p.accepting); - if(generation == 0 && p.lastRipple <= Timers.time() - 40f && p.amount >= maxLiquid / 2f){ + if(generation == 0 && p.lastRipple <= Time.time() - 40f && p.amount >= maxLiquid / 2f){ Effects.effect(BlockFx.ripple, p.liquid.color, (tile.worldx() + source.worldx()) / 2f, (tile.worldy() + source.worldy()) / 2f); - p.lastRipple = Timers.time(); + p.lastRipple = Time.time(); } }else{ p.amount += reactPuddle(p.liquid, liquid, amount, p.tile, p.x, p.y); @@ -176,14 +175,14 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai //update code float addSpeed = accepting > 0 ? 3f : 0f; - amount -= Timers.delta() * (1f - liquid.viscosity) / (5f + addSpeed); + amount -= Time.delta() * (1f - liquid.viscosity) / (5f + addSpeed); amount += accepting; accepting = 0f; if(amount >= maxLiquid / 1.5f && generation < maxGeneration){ - float deposited = Math.min((amount - maxLiquid / 1.5f) / 4f, 0.3f) * Timers.delta(); - for(GridPoint2 point : Geometry.d4){ + float deposited = Math.min((amount - maxLiquid / 1.5f) / 4f, 0.3f) * Time.delta(); + for(Point2 point : Geometry.d4){ Tile other = world.tile(tile.x + point.x, tile.y + point.y); if(other != null && other.block() == Blocks.air && !other.hasCliffs()){ deposit(other, tile, liquid, deposited, generation + 1); @@ -214,14 +213,14 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai } }); - if(liquid.temperature > 0.7f && tile.entity != null && Mathf.chance(0.3 * Timers.delta())){ + if(liquid.temperature > 0.7f && tile.entity != null && Mathf.chance(0.3 * Time.delta())){ Fire.create(tile); } updateTime = 20f; } - updateTime -= Timers.delta(); + updateTime -= Time.delta(); } @Override @@ -232,11 +231,11 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai float smag = onLiquid ? 0.8f : 0f; float sscl = 20f; - Draw.color(Hue.shift(tmp.set(liquid.color), 2, -0.05f)); - Fill.circle(x + Mathf.sin(Timers.time() + seeds * 532, sscl, smag), y + Mathf.sin(Timers.time() + seeds * 53, sscl, smag), f * 8f); + Draw.color(tmp.set(liquid.color).shiftValue(-0.05f)); + Fill.circle(x + Mathf.sin(Time.time() + seeds * 532, sscl, smag), y + Mathf.sin(Time.time() + seeds * 53, sscl, smag), f * 8f); Angles.randLenVectors(id, 3, f * 6f, (ex, ey) -> { - Fill.circle(x + ex + Mathf.sin(Timers.time() + seeds * 532, sscl, smag), - y + ey + Mathf.sin(Timers.time() + seeds * 53, sscl, smag), f * 5f); + Fill.circle(x + ex + Mathf.sin(Time.time() + seeds * 532, sscl, smag), + y + ey + Mathf.sin(Time.time() + seeds * 53, sscl, smag), f * 5f); seeds++; }); Draw.color(); @@ -302,7 +301,7 @@ public class Puddle extends SolidEntity implements SaveTrait, Poolable, DrawTrai } @Override - public void read(DataInput data, long time) throws IOException{ + public void read(DataInput data) throws IOException{ x = data.readFloat(); y = data.readFloat(); liquid = content.liquid(data.readByte()); diff --git a/core/src/io/anuke/mindustry/entities/effect/RubbleDecal.java b/core/src/io/anuke/mindustry/entities/effect/RubbleDecal.java index 8fb5dedf98..51dda93718 100644 --- a/core/src/io/anuke/mindustry/entities/effect/RubbleDecal.java +++ b/core/src/io/anuke/mindustry/entities/effect/RubbleDecal.java @@ -1,7 +1,8 @@ package io.anuke.mindustry.entities.effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.math.Mathf; public class RubbleDecal extends Decal{ private int size; @@ -20,7 +21,7 @@ public class RubbleDecal extends Decal{ public void drawDecal(){ String region = "rubble-" + size + "-" + Mathf.randomSeed(id, 0, 1); - if(!Draw.hasRegion(region)){ + if(!Core.atlas.has(region)){ remove(); return; } diff --git a/core/src/io/anuke/mindustry/entities/effect/ScorchDecal.java b/core/src/io/anuke/mindustry/entities/effect/ScorchDecal.java index 7bfc3e369e..ced259f6e9 100644 --- a/core/src/io/anuke/mindustry/entities/effect/ScorchDecal.java +++ b/core/src/io/anuke/mindustry/entities/effect/ScorchDecal.java @@ -1,10 +1,11 @@ package io.anuke.mindustry.entities.effect; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.world; @@ -15,7 +16,7 @@ public class ScorchDecal extends Decal{ public static void create(float x, float y){ if(regions[0] == null){ for(int i = 0; i < regions.length; i++){ - regions[i] = Draw.region("scorch" + (i + 1)); + regions[i] = Core.atlas.find("scorch" + (i + 1)); } } @@ -35,7 +36,7 @@ public class ScorchDecal extends Decal{ TextureRegion region = regions[Mathf.randomSeed(id - i, 0, scorches - 1)]; float rotation = Mathf.randomSeed(id + i, 0, 360); float space = 1.5f + Mathf.randomSeed(id + i + 1, 0, 20) / 10f; - Draw.grect(region, x + Angles.trnsx(rotation, space), y + Angles.trnsy(rotation, space), rotation - 90); + Draw.rect(region, x + Angles.trnsx(rotation, space), y + Angles.trnsy(rotation, space) + region.getHeight()/2f, region.getWidth()/2f, 0, rotation - 90); } } } diff --git a/core/src/io/anuke/mindustry/entities/traits/AbsorbTrait.java b/core/src/io/anuke/mindustry/entities/traits/AbsorbTrait.java index 445533dda3..7c6520364c 100644 --- a/core/src/io/anuke/mindustry/entities/traits/AbsorbTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/AbsorbTrait.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.entities.traits; -import io.anuke.ucore.entities.trait.DamageTrait; -import io.anuke.ucore.entities.trait.Entity; +import io.anuke.arc.entities.trait.DamageTrait; +import io.anuke.arc.entities.trait.Entity; public interface AbsorbTrait extends Entity, TeamTrait, DamageTrait{ void absorb(); diff --git a/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java b/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java index 926f033fc9..9a3b6e174d 100644 --- a/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/BuilderTrait.java @@ -1,9 +1,19 @@ package io.anuke.mindustry.entities.traits; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.Queue; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.Queue; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.trait.Entity; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.fx.BlockFx; @@ -13,6 +23,7 @@ import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.game.EventType.BuildSelectEvent; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.graphics.Palette; +import io.anuke.mindustry.graphics.Shapes; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Recipe; @@ -21,16 +32,6 @@ import io.anuke.mindustry.world.Pos; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.BuildBlock; import io.anuke.mindustry.world.blocks.BuildBlock.BuildEntity; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.trait.Entity; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.graphics.Shapes; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; import java.io.DataInput; import java.io.DataOutput; @@ -44,6 +45,7 @@ import static io.anuke.mindustry.Vars.*; */ public interface BuilderTrait extends Entity{ //these are not instance variables! + Vector2[] tmptr = new Vector2[]{new Vector2(), new Vector2(), new Vector2(), new Vector2()}; float placeDistance = 150f; float mineDistance = 70f; Array removal = new Array<>(); @@ -173,15 +175,19 @@ public interface BuilderTrait extends Entity{ default void updateBuilding(Unit unit){ //remove already completed build requests removal.clear(); - for(BuildRequest request : getPlaceQueue()){ - if((request.breaking && world.tile(request.x, request.y).block() == Blocks.air) || - (!request.breaking && world.tile(request.x, request.y).block() == request.recipe.result)){ - removal.add(request); - } + for(BuildRequest req : getPlaceQueue()){ + removal.add(req); } - for(BuildRequest req : removal){ - getPlaceQueue().removeValue(req, true); + getPlaceQueue().clear(); + + for(BuildRequest request : removal){ + if(!((request.breaking && world.tile(request.x, request.y).block() == Blocks.air) || + (!request.breaking && + (world.tile(request.x, request.y).getRotation() == request.rotation || !request.recipe.result.rotate) + && world.tile(request.x, request.y).block() == request.recipe.result))){ + getPlaceQueue().addLast(request); + } } BuildRequest current = getCurrentRequest(); @@ -198,7 +204,7 @@ public interface BuilderTrait extends Entity{ Tile tile = world.tile(current.x, current.y); - if(unit.distanceTo(tile) > placeDistance){ + if(unit.dst(tile) > placeDistance){ return; } @@ -228,7 +234,7 @@ public interface BuilderTrait extends Entity{ return; } - if(unit.distanceTo(tile) <= placeDistance){ + if(unit.dst(tile) <= placeDistance){ unit.rotation = Mathf.slerpDelta(unit.rotation, unit.angleTo(entity), 0.4f); } @@ -236,9 +242,9 @@ public interface BuilderTrait extends Entity{ if(!Net.client()){ //deconstructing is 2x as fast if(current.breaking){ - entity.deconstruct(unit, core, 2f / entity.buildCost * Timers.delta() * getBuildPower(tile)); + entity.deconstruct(unit, core, 2f / entity.buildCost * Time.delta() * getBuildPower(tile)); }else{ - entity.construct(unit, core, 1f / entity.buildCost * Timers.delta() * getBuildPower(tile)); + entity.construct(unit, core, 1f / entity.buildCost * Time.delta() * getBuildPower(tile)); } current.progress = entity.progress(); @@ -247,7 +253,7 @@ public interface BuilderTrait extends Entity{ } if(!current.initialized){ - Gdx.app.postRunnable(() -> Events.fire(new BuildSelectEvent(tile, unit.getTeam(), this, current.breaking))); + Core.app.post(() -> Events.fire(new BuildSelectEvent(tile, unit.getTeam(), this, current.breaking))); current.initialized = true; } } @@ -257,16 +263,16 @@ public interface BuilderTrait extends Entity{ Tile tile = getMineTile(); TileEntity core = unit.getClosestCore(); - if(core == null || tile.block() != Blocks.air || unit.distanceTo(tile.worldx(), tile.worldy()) > mineDistance + if(core == null || tile.block() != Blocks.air || unit.dst(tile.worldx(), tile.worldy()) > mineDistance || tile.floor().drops == null || !unit.inventory.canAcceptItem(tile.floor().drops.item) || !canMine(tile.floor().drops.item)){ setMineTile(null); }else{ Item item = tile.floor().drops.item; unit.rotation = Mathf.slerpDelta(unit.rotation, unit.angleTo(tile.worldx(), tile.worldy()), 0.4f); - if(Mathf.chance(Timers.delta() * (0.06 - item.hardness * 0.01) * getMinePower())){ + if(Mathf.chance(Time.delta() * (0.06 - item.hardness * 0.01) * getMinePower())){ - if(unit.distanceTo(core) < mineTransferRange && core.tile.block().acceptStack(item, 1, core.tile, unit) == 1){ + if(unit.dst(core) < mineTransferRange && core.tile.block().acceptStack(item, 1, core.tile, unit) == 1){ Call.transferItemTo(item, 1, tile.worldx() + Mathf.range(tilesize / 2f), tile.worldy() + Mathf.range(tilesize / 2f), core.tile); @@ -278,7 +284,7 @@ public interface BuilderTrait extends Entity{ } } - if(Mathf.chance(0.06 * Timers.delta())){ + if(Mathf.chance(0.06 * Time.delta())){ Effects.effect(BlockFx.pulverizeSmall, tile.worldx() + Mathf.range(tilesize / 2f), tile.worldy() + Mathf.range(tilesize / 2f), 0f, item.color); @@ -300,12 +306,12 @@ public interface BuilderTrait extends Entity{ Tile tile = world.tile(request.x, request.y); - if(unit.distanceTo(tile) > placeDistance){ + if(unit.dst(tile) > placeDistance){ return; } - Draw.color(Palette.accent); - float focusLen = 3.8f + Mathf.absin(Timers.time(), 1.1f, 0.6f); + Lines.stroke(1f, Palette.accent); + float focusLen = 3.8f + Mathf.absin(Time.time(), 1.1f, 0.6f); float px = unit.x + Angles.trnsx(unit.rotation, focusLen); float py = unit.y + Angles.trnsy(unit.rotation, focusLen); @@ -318,7 +324,7 @@ public interface BuilderTrait extends Entity{ tmptr[3].set(tile.drawx() + sz, tile.drawy() + sz); Arrays.sort(tmptr, (a, b) -> -Float.compare(Angles.angleDist(Angles.angle(unit.x, unit.y, a.x, a.y), ang), - Angles.angleDist(Angles.angle(unit.x, unit.y, b.x, b.y), ang))); + Angles.angleDist(Angles.angle(unit.x, unit.y, b.x, b.y), ang))); float x1 = tmptr[0].x, y1 = tmptr[0].y, x3 = tmptr[1].x, y3 = tmptr[1].y; @@ -328,7 +334,7 @@ public interface BuilderTrait extends Entity{ Lines.line(px, py, x1, y1); Lines.line(px, py, x3, y3); - Fill.circle(px, py, 1.6f + Mathf.absin(Timers.time(), 0.8f, 1.5f)); + Fill.circle(px, py, 1.6f + Mathf.absin(Time.time(), 0.8f, 1.5f)); Draw.color(); } @@ -339,22 +345,23 @@ public interface BuilderTrait extends Entity{ if(tile == null) return; - float focusLen = 4f + Mathf.absin(Timers.time(), 1.1f, 0.5f); + float focusLen = 4f + Mathf.absin(Time.time(), 1.1f, 0.5f); float swingScl = 12f, swingMag = tilesize / 8f; float flashScl = 0.3f; float px = unit.x + Angles.trnsx(unit.rotation, focusLen); float py = unit.y + Angles.trnsy(unit.rotation, focusLen); - float ex = tile.worldx() + Mathf.sin(Timers.time() + 48, swingScl, swingMag); - float ey = tile.worldy() + Mathf.sin(Timers.time() + 48, swingScl + 2f, swingMag); + float ex = tile.worldx() + Mathf.sin(Time.time() + 48, swingScl, swingMag); + float ey = tile.worldy() + Mathf.sin(Time.time() + 48, swingScl + 2f, swingMag); + + Draw.color(Color.LIGHT_GRAY, Color.WHITE, 1f - flashScl + Mathf.absin(Time.time(), 0.5f, flashScl)); - Draw.color(Color.LIGHT_GRAY, Color.WHITE, 1f - flashScl + Mathf.absin(Timers.time(), 0.5f, flashScl)); Shapes.laser("minelaser", "minelaser-end", px, py, ex, ey); if(unit instanceof Player && ((Player) unit).isLocal){ - Draw.color(Palette.accent); - Lines.poly(tile.worldx(), tile.worldy(), 4, tilesize / 2f * Mathf.sqrt2, Timers.time()); + Lines.stroke(1f, Palette.accent); + Lines.poly(tile.worldx(), tile.worldy(), 4, tilesize / 2f * Mathf.sqrt2, Time.time()); } Draw.color(); diff --git a/core/src/io/anuke/mindustry/entities/traits/CarriableTrait.java b/core/src/io/anuke/mindustry/entities/traits/CarriableTrait.java index 296b782154..3755245e8e 100644 --- a/core/src/io/anuke/mindustry/entities/traits/CarriableTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/CarriableTrait.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.entities.traits; -import io.anuke.ucore.entities.trait.SolidTrait; +import io.anuke.arc.entities.trait.SolidTrait; public interface CarriableTrait extends TeamTrait, TargetTrait, SolidTrait{ diff --git a/core/src/io/anuke/mindustry/entities/traits/CarryTrait.java b/core/src/io/anuke/mindustry/entities/traits/CarryTrait.java index fdc052f787..b63ce195cd 100644 --- a/core/src/io/anuke/mindustry/entities/traits/CarryTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/CarryTrait.java @@ -5,8 +5,8 @@ import io.anuke.annotations.Annotations.Remote; import io.anuke.mindustry.content.fx.UnitFx; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.gen.Call; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.entities.trait.SolidTrait; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.trait.SolidTrait; public interface CarryTrait extends TeamTrait, SolidTrait, TargetTrait{ diff --git a/core/src/io/anuke/mindustry/entities/traits/SaveTrait.java b/core/src/io/anuke/mindustry/entities/traits/SaveTrait.java index 4e7009771e..bcf357f4e5 100644 --- a/core/src/io/anuke/mindustry/entities/traits/SaveTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/SaveTrait.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.entities.traits; -import io.anuke.ucore.entities.trait.Entity; +import io.anuke.arc.entities.trait.Entity; /** * Marks an entity as serializable. diff --git a/core/src/io/anuke/mindustry/entities/traits/ShooterTrait.java b/core/src/io/anuke/mindustry/entities/traits/ShooterTrait.java index 12df85dda1..22072cfd64 100644 --- a/core/src/io/anuke/mindustry/entities/traits/ShooterTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/ShooterTrait.java @@ -1,12 +1,12 @@ package io.anuke.mindustry.entities.traits; +import io.anuke.arc.entities.trait.VelocityTrait; +import io.anuke.arc.util.Interval; import io.anuke.mindustry.type.Weapon; -import io.anuke.ucore.entities.trait.VelocityTrait; -import io.anuke.ucore.util.Timer; public interface ShooterTrait extends VelocityTrait, TeamTrait, InventoryTrait{ - Timer getTimer(); + Interval getTimer(); int getShootTimer(boolean left); diff --git a/core/src/io/anuke/mindustry/entities/traits/SyncTrait.java b/core/src/io/anuke/mindustry/entities/traits/SyncTrait.java index 9509e4eb68..38bbe23088 100644 --- a/core/src/io/anuke/mindustry/entities/traits/SyncTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/SyncTrait.java @@ -2,9 +2,9 @@ package io.anuke.mindustry.entities.traits; import io.anuke.mindustry.core.NetClient; import io.anuke.mindustry.net.Interpolator; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.entities.trait.Entity; -import io.anuke.ucore.util.Tmp; +import io.anuke.arc.Core; +import io.anuke.arc.entities.trait.Entity; +import io.anuke.arc.util.Tmp; import java.io.DataInput; import java.io.DataOutput; @@ -33,8 +33,7 @@ public interface SyncTrait extends Entity, TypeTrait{ if(isClipped()){ //move off screen when no longer in bounds - Tmp.r1.setSize(Core.camera.viewportWidth * Core.camera.zoom * NetClient.viewScale, - Core.camera.viewportHeight * Core.camera.zoom * NetClient.viewScale) + Tmp.r1.setSize(Core.camera.width * NetClient.viewScale, Core.camera.height * NetClient.viewScale) .setCenter(Core.camera.position.x, Core.camera.position.y); if(!Tmp.r1.contains(getX(), getY()) && !Tmp.r1.contains(getInterpolator().last.x, getInterpolator().last.y)){ @@ -67,5 +66,5 @@ public interface SyncTrait extends Entity, TypeTrait{ //Read and write sync data, usually position void write(DataOutput data) throws IOException; - void read(DataInput data, long time) throws IOException; + void read(DataInput data) throws IOException; } diff --git a/core/src/io/anuke/mindustry/entities/traits/TargetTrait.java b/core/src/io/anuke/mindustry/entities/traits/TargetTrait.java index bdeea6ea33..68eac61412 100644 --- a/core/src/io/anuke/mindustry/entities/traits/TargetTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/TargetTrait.java @@ -1,14 +1,14 @@ package io.anuke.mindustry.entities.traits; +import io.anuke.arc.entities.trait.SolidTrait; +import io.anuke.arc.entities.trait.VelocityTrait; +import io.anuke.arc.math.geom.Position; import io.anuke.mindustry.game.Team; -import io.anuke.ucore.entities.trait.PosTrait; -import io.anuke.ucore.entities.trait.SolidTrait; -import io.anuke.ucore.entities.trait.VelocityTrait; /** * Base interface for targetable entities. */ -public interface TargetTrait extends PosTrait, VelocityTrait{ +public interface TargetTrait extends Position, VelocityTrait{ boolean isDead(); diff --git a/core/src/io/anuke/mindustry/entities/traits/TeamTrait.java b/core/src/io/anuke/mindustry/entities/traits/TeamTrait.java index 3c7cbf7dd3..6954258423 100644 --- a/core/src/io/anuke/mindustry/entities/traits/TeamTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/TeamTrait.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.entities.traits; import io.anuke.mindustry.game.Team; -import io.anuke.ucore.entities.trait.Entity; +import io.anuke.arc.entities.trait.Entity; public interface TeamTrait extends Entity{ Team getTeam(); diff --git a/core/src/io/anuke/mindustry/entities/traits/TypeTrait.java b/core/src/io/anuke/mindustry/entities/traits/TypeTrait.java index 774b2b4143..663575bb5f 100644 --- a/core/src/io/anuke/mindustry/entities/traits/TypeTrait.java +++ b/core/src/io/anuke/mindustry/entities/traits/TypeTrait.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.entities.traits; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectIntMap; -import io.anuke.ucore.function.Supplier; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.ObjectIntMap; +import io.anuke.arc.function.Supplier; public interface TypeTrait{ int[] lastRegisteredID = {0}; diff --git a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java index f40e21c2c2..840aaf19de 100644 --- a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java @@ -1,9 +1,18 @@ package io.anuke.mindustry.entities.units; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.Rectangle; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.util.Interval; +import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.fx.ExplosionFx; import io.anuke.mindustry.entities.Damage; @@ -24,11 +33,6 @@ import io.anuke.mindustry.type.Weapon; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.units.CommandCenter.CommandCenterEntity; import io.anuke.mindustry.world.meta.BlockFlag; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.*; import java.io.DataInput; import java.io.DataOutput; @@ -46,7 +50,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ protected static final int timerShootRight = timerIndex++; protected UnitType type; - protected Timer timer = new Timer(5); + protected Interval timer = new Interval(5); protected StateMachine state = new StateMachine(); protected TargetTrait target; @@ -77,7 +81,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ Effects.shake(2f, 2f, unit); //must run afterwards so the unit's group is not null when sending the removal packet - threads.runDelay(unit::remove); + Core.app.post(unit::remove); } @Override @@ -222,7 +226,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ } @Override - public Timer getTimer(){ + public Interval getTimer(){ return timer; } @@ -282,7 +286,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ @Override public void update(){ - hitTime -= Timers.delta(); + hitTime -= Time.delta(); if(isDead()){ updateRespawning(); @@ -393,12 +397,12 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{ } @Override - public void read(DataInput data, long time) throws IOException{ + public void read(DataInput data) throws IOException{ float lastx = x, lasty = y, lastrot = rotation; super.readSave(data); this.type = content.getByID(ContentType.unit, data.readByte()); - interpolator.read(lastx, lasty, x, y, time, rotation); + interpolator.read(lastx, lasty, x, y, rotation); rotation = lastrot; } diff --git a/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java b/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java index e72390c51e..f2b00660d9 100644 --- a/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java @@ -1,26 +1,25 @@ package io.anuke.mindustry.entities.units; -import com.badlogic.gdx.math.Vector2; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Time; import io.anuke.mindustry.entities.Predict; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.traits.CarriableTrait; import io.anuke.mindustry.entities.traits.CarryTrait; -import io.anuke.mindustry.graphics.Trail; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.type.AmmoType; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.meta.BlockFlag; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.*; import static io.anuke.mindustry.Vars.world; public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ - protected static Translator vec = new Translator(); - protected static float wobblyness = 0.6f; + protected static Vector2 vec = new Vector2(); - protected Trail trail = new Trail(8); protected CarriableTrait carrying; protected final UnitState @@ -75,8 +74,8 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ }else{ attack(150f); - if((Mathf.angNear(angleTo(target), rotation, 15f) || !getWeapon().getAmmo().bullet.keepVelocity) //bombers don't care about rotation - && distanceTo(target) < Math.max(getWeapon().getAmmo().getRange(), type.range)){ + if((Angles.near(angleTo(target), rotation, 15f) || !getWeapon().getAmmo().bullet.keepVelocity) //bombers don't care about rotation + && dst(target) < Math.max(getWeapon().getAmmo().getRange(), type.range)){ AmmoType ammo = getWeapon().getAmmo(); Vector2 to = Predict.intercept(FlyingUnit.this, target, ammo.bullet.speed); @@ -99,7 +98,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ }); if(target != null){ - circle(60f + Mathf.absin(Timers.time() + id * 23525, 70f, 1200f)); + circle(60f + Mathf.absin(Time.time() + id * 23525, 70f, 1200f)); } } }, @@ -153,9 +152,6 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ updateRotation(); wobble(); } - - trail.update(x + Angles.trnsx(rotation + 180f, 6f) + Mathf.range(wobblyness), - y + Angles.trnsy(rotation + 180f, 6f) + Mathf.range(wobblyness)); } @Override @@ -169,11 +165,6 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ Draw.alpha(1f); } - @Override - public void drawOver(){ - trail.draw(type.trailColor, 5f); - } - @Override public void behavior(){ if(health <= health * type.retreatPercent && !isCommanded() && @@ -200,11 +191,11 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ protected void wobble(){ if(Net.client()) return; - x += Mathf.sin(Timers.time() + id * 999, 25f, 0.08f)*Timers.delta(); - y += Mathf.cos(Timers.time() + id * 999, 25f, 0.08f)*Timers.delta(); + x += Mathf.sin(Time.time() + id * 999, 25f, 0.08f)*Time.delta(); + y += Mathf.cos(Time.time() + id * 999, 25f, 0.08f)*Time.delta(); if(velocity.len() <= 0.05f){ - rotation += Mathf.sin(Timers.time() + id * 99, 10f, 2.5f)*Timers.delta(); + rotation += Mathf.sin(Time.time() + id * 99, 10f, 2.5f)*Time.delta(); } } @@ -225,7 +216,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ vec.rotate((circleLength - vec.len()) / circleLength * 180f); } - vec.setLength(speed * Timers.delta()); + vec.setLength(speed * Time.delta()); velocity.add(vec); } @@ -235,9 +226,9 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ vec.set(target.getX() - x, target.getY() - y); - float length = circleLength <= 0.001f ? 1f : Mathf.clamp((distanceTo(target) - circleLength) / 100f, -1f, 1f); + float length = circleLength <= 0.001f ? 1f : Mathf.clamp((dst(target) - circleLength) / 100f, -1f, 1f); - vec.setLength(type.speed * Timers.delta() * length); + vec.setLength(type.speed * Time.delta() * length); if(length < 0) vec.rotate(180f); velocity.add(vec); @@ -255,7 +246,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{ vec.setAngle(Mathf.slerpDelta(velocity.angle(), vec.angle(), 0.44f)); } - vec.setLength(type.speed * Timers.delta()); + vec.setLength(type.speed * Time.delta()); velocity.add(vec); } diff --git a/core/src/io/anuke/mindustry/entities/units/GroundUnit.java b/core/src/io/anuke/mindustry/entities/units/GroundUnit.java index db01ba1ab1..ba73b95f43 100644 --- a/core/src/io/anuke/mindustry/entities/units/GroundUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/GroundUnit.java @@ -1,7 +1,11 @@ package io.anuke.mindustry.entities.units; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.Vector2; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.Predict; import io.anuke.mindustry.entities.TileEntity; @@ -12,11 +16,6 @@ import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Weapon; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.Floor; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Translator; import java.io.DataInput; import java.io.DataOutput; @@ -26,7 +25,7 @@ import static io.anuke.mindustry.Vars.content; import static io.anuke.mindustry.Vars.world; public abstract class GroundUnit extends BaseUnit{ - protected static Translator vec = new Translator(); + protected static Vector2 vec = new Vector2(); protected float walkTime; protected float stuckTime; @@ -42,7 +41,7 @@ public abstract class GroundUnit extends BaseUnit{ public void update(){ TileEntity core = getClosestEnemyCore(); - float dst = core == null ? 0 : distanceTo(core); + float dst = core == null ? 0 : dst(core); if(core != null && dst < getWeapon().getAmmo().getRange() / 1.1f){ target = core; @@ -57,7 +56,7 @@ public abstract class GroundUnit extends BaseUnit{ public void update(){ TileEntity target = getClosestCore(); if(target != null){ - if(distanceTo(target) > 400f){ + if(dst(target) > 400f){ moveAwayFromCore(); }else{ patrol(); @@ -105,7 +104,7 @@ public abstract class GroundUnit extends BaseUnit{ @Override public void move(float x, float y){ if(Mathf.dst(x, y) > 0.01f){ - baseRotation = Mathf.slerpDelta(baseRotation, Mathf.atan2(x, y), type.baseRotateSpeed); + baseRotation = Mathf.slerpDelta(baseRotation, Mathf.angle(x, y), type.baseRotateSpeed); } super.move(x, y); } @@ -119,14 +118,14 @@ public abstract class GroundUnit extends BaseUnit{ public void update(){ super.update(); - stuckTime = !vec.set(x, y).sub(lastPosition()).isZero(0.0001f) ? 0f : stuckTime + Timers.delta(); + stuckTime = !vec.set(x, y).sub(lastPosition()).isZero(0.0001f) ? 0f : stuckTime + Time.delta(); if(!velocity.isZero()){ baseRotation = Mathf.slerpDelta(baseRotation, velocity.angle(), 0.05f); } if(stuckTime < 1f){ - walkTime += Timers.delta(); + walkTime += Time.delta(); } } @@ -188,10 +187,10 @@ public abstract class GroundUnit extends BaseUnit{ } if(!Units.invalidateTarget(target, this)){ - if(distanceTo(target) < getWeapon().getAmmo().getRange()){ + if(dst(target) < getWeapon().getAmmo().getRange()){ rotate(angleTo(target)); - if(Mathf.angNear(angleTo(target), rotation, 13f)){ + if(Angles.near(angleTo(target), rotation, 13f)){ AmmoType ammo = getWeapon().getAmmo(); Vector2 to = Predict.intercept(GroundUnit.this, target, ammo.bullet.speed); @@ -220,8 +219,8 @@ public abstract class GroundUnit extends BaseUnit{ } @Override - public void read(DataInput data, long time) throws IOException{ - super.read(data, time); + public void read(DataInput data) throws IOException{ + super.read(data); weapon = content.getByID(ContentType.weapon, data.readByte()); } @@ -238,12 +237,12 @@ public abstract class GroundUnit extends BaseUnit{ } protected void patrol(){ - vec.trns(baseRotation, type.speed * Timers.delta()); + vec.trns(baseRotation, type.speed * Time.delta()); velocity.add(vec.x, vec.y); vec.trns(baseRotation, type.hitsizeTile); Tile tile = world.tileWorld(x + vec.x, y + vec.y); if((tile == null || tile.solid() || tile.floor().drownTime > 0) || stuckTime > 10f){ - baseRotation += Mathf.sign(id % 2 - 0.5f) * Timers.delta() * 3f; + baseRotation += Mathf.sign(id % 2 - 0.5f) * Time.delta() * 3f; } rotation = Mathf.slerpDelta(rotation, velocity.angle(), type.rotatespeed); @@ -258,7 +257,7 @@ public abstract class GroundUnit extends BaseUnit{ vec.rotate((circleLength - vec.len()) / circleLength * 180f); } - vec.setLength(type.speed * Timers.delta()); + vec.setLength(type.speed * Time.delta()); velocity.add(vec); } @@ -272,7 +271,7 @@ public abstract class GroundUnit extends BaseUnit{ float angle = angleTo(targetTile); - velocity.add(vec.trns(angleTo(targetTile), type.speed*Timers.delta())); + velocity.add(vec.trns(angleTo(targetTile), type.speed*Time.delta())); rotation = Mathf.slerpDelta(rotation, angle, type.rotatespeed); } @@ -292,11 +291,11 @@ public abstract class GroundUnit extends BaseUnit{ Tile targetTile = world.pathfinder.getTargetTile(enemy, tile); TileEntity core = getClosestCore(); - if(tile == targetTile || core == null || distanceTo(core) < 90f) return; + if(tile == targetTile || core == null || dst(core) < 90f) return; float angle = angleTo(targetTile); - velocity.add(vec.trns(angleTo(targetTile), type.speed*Timers.delta())); + velocity.add(vec.trns(angleTo(targetTile), type.speed*Time.delta())); rotation = Mathf.slerpDelta(rotation, angle, type.rotatespeed); } } diff --git a/core/src/io/anuke/mindustry/entities/units/Squad.java b/core/src/io/anuke/mindustry/entities/units/Squad.java index 1068de0a6b..ef5d2b6e01 100644 --- a/core/src/io/anuke/mindustry/entities/units/Squad.java +++ b/core/src/io/anuke/mindustry/entities/units/Squad.java @@ -1,24 +1,22 @@ package io.anuke.mindustry.entities.units; -import com.badlogic.gdx.math.Vector2; -import io.anuke.ucore.util.Translator; - -import static io.anuke.mindustry.Vars.threads; +import io.anuke.arc.Core; +import io.anuke.arc.math.geom.Vector2; /** * Used to group entities together, for formations and such. * Usually, squads are used by units spawned in the same wave. */ public class Squad{ - public Vector2 direction = new Translator(); + public Vector2 direction = new Vector2(); public int units; private long lastUpdated; protected void update(){ - if(threads.getFrameID() != lastUpdated){ + if(Core.graphics.getFrameId() != lastUpdated){ direction.setZero(); - lastUpdated = threads.getFrameID(); + lastUpdated = Core.graphics.getFrameId(); } } } diff --git a/core/src/io/anuke/mindustry/entities/units/UnitCommand.java b/core/src/io/anuke/mindustry/entities/units/UnitCommand.java index a6e8c2a005..5939ec3aff 100644 --- a/core/src/io/anuke/mindustry/entities/units/UnitCommand.java +++ b/core/src/io/anuke/mindustry/entities/units/UnitCommand.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.entities.units; -import io.anuke.ucore.util.Bundles; +import io.anuke.arc.Core; public enum UnitCommand{ attack, retreat, patrol; @@ -8,7 +8,7 @@ public enum UnitCommand{ private final String localized; UnitCommand(){ - localized = Bundles.get("command." + name()); + localized = Core.bundle.get("command." + name()); } public String localized(){ diff --git a/core/src/io/anuke/mindustry/entities/units/UnitDrops.java b/core/src/io/anuke/mindustry/entities/units/UnitDrops.java index 3780465876..25a20a5e45 100644 --- a/core/src/io/anuke/mindustry/entities/units/UnitDrops.java +++ b/core/src/io/anuke/mindustry/entities/units/UnitDrops.java @@ -5,7 +5,7 @@ import io.anuke.mindustry.content.Items; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.type.Item; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.math.Mathf; public class UnitDrops{ private static Item[] dropTable; diff --git a/core/src/io/anuke/mindustry/entities/units/UnitType.java b/core/src/io/anuke/mindustry/entities/units/UnitType.java index c18928262b..9552a786cc 100644 --- a/core/src/io/anuke/mindustry/entities/units/UnitType.java +++ b/core/src/io/anuke/mindustry/entities/units/UnitType.java @@ -1,8 +1,13 @@ package io.anuke.mindustry.entities.units; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.Core; +import io.anuke.arc.collection.ObjectSet; +import io.anuke.arc.function.Supplier; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Strings; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Weapons; import io.anuke.mindustry.entities.traits.TypeTrait; @@ -12,12 +17,6 @@ import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Weapon; import io.anuke.mindustry.ui.ContentDisplay; -import io.anuke.ucore.function.Supplier; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Strings; public class UnitType extends UnlockableContent{ protected final Supplier constructor; @@ -51,11 +50,11 @@ public class UnitType extends UnlockableContent{ public UnitType(String name, Class type, Supplier mainConstructor){ this.name = name; this.constructor = mainConstructor; - this.description = Bundles.getOrNull("unit." + name + ".description"); + this.description = Core.bundle.getOrNull("unit." + name + ".description"); TypeTrait.registerType(type, mainConstructor); - if(!Bundles.has("unit." + this.name + ".name")){ + if(!Core.bundle.has("unit." + this.name + ".name")){ Log.err("Warning: unit '" + name + "' is missing a localized name. Add the follow to bundle.properties:"); Log.err("unit." + this.name + ".name=" + Strings.capitalize(name.replace('-', '_'))); } @@ -68,7 +67,7 @@ public class UnitType extends UnlockableContent{ @Override public String localizedName(){ - return Bundles.get("unit." + name + ".name"); + return Core.bundle.get("unit." + name + ".name"); } @Override @@ -78,12 +77,12 @@ public class UnitType extends UnlockableContent{ @Override public void load(){ - iconRegion = Draw.region("unit-icon-" + name); - region = Draw.region(name); + iconRegion = Core.atlas.find("unit-icon-" + name); + region = Core.atlas.find(name); if(!isFlying){ - legRegion = Draw.region(name + "-leg"); - baseRegion = Draw.region(name + "-base"); + legRegion = Core.atlas.find(name + "-leg"); + baseRegion = Core.atlas.find(name + "-base"); } } diff --git a/core/src/io/anuke/mindustry/entities/units/types/AlphaDrone.java b/core/src/io/anuke/mindustry/entities/units/types/AlphaDrone.java deleted file mode 100644 index 478854cfc0..0000000000 --- a/core/src/io/anuke/mindustry/entities/units/types/AlphaDrone.java +++ /dev/null @@ -1,113 +0,0 @@ -package io.anuke.mindustry.entities.units.types; - -import com.badlogic.gdx.math.Vector2; -import io.anuke.annotations.Annotations.Loc; -import io.anuke.annotations.Annotations.Remote; -import io.anuke.mindustry.Vars; -import io.anuke.mindustry.content.fx.UnitFx; -import io.anuke.mindustry.entities.Player; -import io.anuke.mindustry.entities.Predict; -import io.anuke.mindustry.entities.traits.TargetTrait; -import io.anuke.mindustry.entities.units.BaseUnit; -import io.anuke.mindustry.entities.units.FlyingUnit; -import io.anuke.mindustry.entities.units.UnitCommand; -import io.anuke.mindustry.entities.units.UnitState; -import io.anuke.mindustry.gen.Call; -import io.anuke.mindustry.net.Net; -import io.anuke.mindustry.type.AmmoType; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.util.Mathf; - -import java.io.DataInput; -import java.io.DataOutput; -import java.io.IOException; - -import static io.anuke.mindustry.Vars.*; - -public class AlphaDrone extends FlyingUnit { - static final float followDistance = 80f; - - public Player leader; - - public final UnitState attack = new UnitState() { - @Override - public void update() { - if(leader == null || leader.isDead() || !leader.isAdded()){ - damage(99999f); - return; - } - TargetTrait last = target; - target = leader; - - if(last == null){ - circle(leader.isShooting ? 60f : 0f); - } - - target = last; - if(distanceTo(leader) < followDistance){ - targetClosest(); - }else{ - target = null; - } - - if(target != null){ - attack(50f); - - if((Mathf.angNear(angleTo(target), rotation, 15f) && distanceTo(target) < getWeapon().getAmmo().getRange())){ - AmmoType ammo = getWeapon().getAmmo(); - - Vector2 to = Predict.intercept(AlphaDrone.this, target, ammo.bullet.speed); - getWeapon().update(AlphaDrone.this, to.x, to.y); - } - } - - if(!leader.isShooting && distanceTo(leader) < 7f){ - Call.onAlphaDroneFade(AlphaDrone.this); - } - } - }; - - @Remote(called = Loc.server) - public static void onAlphaDroneFade(BaseUnit drone){ - if(drone == null) return; - Effects.effect(UnitFx.pickup, drone); - //must run afterwards so the unit's group is not null when sending the removal packet - threads.runDelay(drone::remove); - } - - @Override - public void onCommand(UnitCommand command){ - //nuh - } - - @Override - public void behavior(){ - //nope - } - - @Override - public UnitState getStartState() { - return attack; - } - - @Override - public void write(DataOutput stream) throws IOException { - super.write(stream); - stream.writeInt(leader == null ? -1 : leader.id); - } - - @Override - public void read(DataInput stream, long time) throws IOException { - super.read(stream, time); - leader = Vars.playerGroup.getByID(stream.readInt()); - } - - @Override - public void readSave(DataInput stream) throws IOException{ - super.readSave(stream); - - if(!Net.active() && !headless){ - leader = players[0]; - } - } -} diff --git a/core/src/io/anuke/mindustry/entities/units/types/Drone.java b/core/src/io/anuke/mindustry/entities/units/types/Drone.java index b47215d4ea..7d6ffb133a 100644 --- a/core/src/io/anuke/mindustry/entities/units/types/Drone.java +++ b/core/src/io/anuke/mindustry/entities/units/types/Drone.java @@ -1,6 +1,11 @@ package io.anuke.mindustry.entities.units.types; -import com.badlogic.gdx.utils.Queue; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Queue; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.util.Structs; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.TileEntity; @@ -12,7 +17,6 @@ import io.anuke.mindustry.entities.units.UnitCommand; import io.anuke.mindustry.entities.units.UnitState; import io.anuke.mindustry.game.EventType.BuildSelectEvent; import io.anuke.mindustry.gen.Call; -import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.ItemType; @@ -20,11 +24,6 @@ import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.BuildBlock; import io.anuke.mindustry.world.blocks.BuildBlock.BuildEntity; import io.anuke.mindustry.world.meta.BlockFlag; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Structs; import java.io.DataInput; import java.io.DataOutput; @@ -63,7 +62,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{ if(core == null) return; if((entity.progress() < 1f || entity.progress() > 0f) && entity.tile.block() instanceof BuildBlock){ //building is valid - if(!isBuilding() && distanceTo(target) < placeDistance * 0.9f){ //within distance, begin placing + if(!isBuilding() && dst(target) < placeDistance * 0.9f){ //within distance, begin placing if(isBreaking){ getPlaceQueue().addLast(new BuildRequest(entity.tile.x, entity.tile.y)); }else{ @@ -108,7 +107,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{ if(target == null) return; - if(target.distanceTo(Drone.this) > type.range){ + if(target.dst(Drone.this) > type.range){ circle(type.range*0.9f); }else{ getWeapon().update(Drone.this, target.getX(), target.getY()); @@ -158,7 +157,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{ if(target instanceof Tile){ moveTo(type.range / 1.5f); - if(distanceTo(target) < type.range && mineTile != target){ + if(dst(target) < type.range && mineTile != target){ setMineTile((Tile) target); } @@ -196,7 +195,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{ TileEntity tile = (TileEntity) target; - if(distanceTo(target) < type.range){ + if(dst(target) < type.range){ if(tile.tile.block().acceptStack(inventory.getItem().item, inventory.getItem().amount, tile.tile, Drone.this) == inventory.getItem().amount){ Call.transferItemTo(inventory.getItem().item, inventory.getItem().amount, x, y, tile.tile); inventory.clearItem(); @@ -254,7 +253,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{ } private void notifyPlaced(BuildEntity entity, boolean isBreaking){ - float dist = Math.min(entity.distanceTo(x, y) - placeDistance, 0); + float dist = Math.min(entity.dst(x, y) - placeDistance, 0); if(!state.is(build) && dist / type.maxVelocity < entity.buildCost * 0.9f){ target = entity; @@ -311,7 +310,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{ @Override protected void updateRotation(){ - if(target != null && ((state.is(repair) && target.distanceTo(this) < type.range) || state.is(mine))){ + if(target != null && ((state.is(repair) && target.dst(this) < type.range) || state.is(mine))){ rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.3f); }else{ rotation = Mathf.slerpDelta(rotation, velocity.angle(), 0.3f); @@ -333,7 +332,6 @@ public class Drone extends FlyingUnit implements BuilderTrait{ @Override public void drawOver(){ - trail.draw(Palette.lightTrail, 3f); drawBuilding(this); } @@ -364,8 +362,8 @@ public class Drone extends FlyingUnit implements BuilderTrait{ } @Override - public void read(DataInput data, long time) throws IOException{ - super.read(data, time); + public void read(DataInput data) throws IOException{ + super.read(data); int mined = data.readInt(); int repairing = data.readInt(); diff --git a/core/src/io/anuke/mindustry/game/Difficulty.java b/core/src/io/anuke/mindustry/game/Difficulty.java index bfbbdd1e90..c533e1b1a6 100644 --- a/core/src/io/anuke/mindustry/game/Difficulty.java +++ b/core/src/io/anuke/mindustry/game/Difficulty.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.game; -import io.anuke.ucore.util.Bundles; +import io.anuke.arc.Core; public enum Difficulty{ training(3f, 3f), @@ -24,7 +24,7 @@ public enum Difficulty{ @Override public String toString(){ if(value == null){ - value = Bundles.get("setting.difficulty." + name()); + value = Core.bundle.get("setting.difficulty." + name()); } return value; } diff --git a/core/src/io/anuke/mindustry/game/EventType.java b/core/src/io/anuke/mindustry/game/EventType.java index 0724be398a..32e680e4ae 100644 --- a/core/src/io/anuke/mindustry/game/EventType.java +++ b/core/src/io/anuke/mindustry/game/EventType.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.game; +import io.anuke.arc.Events.Event; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.traits.BuilderTrait; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Events.Event; public class EventType{ @@ -11,6 +11,7 @@ public class EventType{ } + /**Called when the game is first loaded.*/ public static class GameLoadEvent implements Event{ } @@ -35,22 +36,11 @@ public class EventType{ } } - /** - * This event is called from the logic thread. - * DO NOT INITIALIZE GRAPHICS HERE. - */ + /**Called when a game begins and the world is loaded.*/ public static class WorldLoadEvent implements Event{ } - /** - * Called after the WorldLoadEvent is, and all logic has been loaded. - * It is safe to intialize graphics here. - */ - public static class WorldLoadGraphicsEvent implements Event{ - - } - /**Called from the logic thread. Do not access graphics here!*/ public static class TileChangeEvent implements Event{ public final Tile tile; diff --git a/core/src/io/anuke/mindustry/game/GameMode.java b/core/src/io/anuke/mindustry/game/GameMode.java index cd4057012a..43a6b5c851 100644 --- a/core/src/io/anuke/mindustry/game/GameMode.java +++ b/core/src/io/anuke/mindustry/game/GameMode.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.game; -import io.anuke.ucore.util.Bundles; +import io.anuke.arc.Core; public enum GameMode{ waves, @@ -33,12 +33,12 @@ public enum GameMode{ public float respawnTime = 60 * 4; public String description(){ - return Bundles.get("mode." + name() + ".description"); + return Core.bundle.get("mode." + name() + ".description"); } @Override public String toString(){ - return Bundles.get("mode." + name() + ".name"); + return Core.bundle.get("mode." + name() + ".name"); } } diff --git a/core/src/io/anuke/mindustry/game/Saves.java b/core/src/io/anuke/mindustry/game/Saves.java index 0a2f2fcf28..d1c42703f4 100644 --- a/core/src/io/anuke/mindustry/game/Saves.java +++ b/core/src/io/anuke/mindustry/game/Saves.java @@ -1,28 +1,28 @@ package io.anuke.mindustry.game; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntArray; -import com.badlogic.gdx.utils.IntMap; -import com.badlogic.gdx.utils.TimeUtils; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.IntArray; +import io.anuke.arc.collection.IntMap; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.util.Strings; +import io.anuke.arc.util.Time; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.EventType.StateChangeEvent; import io.anuke.mindustry.io.SaveIO; import io.anuke.mindustry.io.SaveMeta; import io.anuke.mindustry.maps.Map; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.util.Strings; -import io.anuke.ucore.util.ThreadArray; import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; import static io.anuke.mindustry.Vars.*; public class Saves{ private int nextSlot; - private Array saves = new ThreadArray<>(); + private Array saves = new Array<>(); private IntMap saveMap = new IntMap<>(); private SaveSlot current; private boolean saving; @@ -34,18 +34,16 @@ public class Saves{ public Saves(){ Events.on(StateChangeEvent.class, event -> { if(event.to == State.menu){ - threads.run(() -> { - totalPlaytime = 0; - lastTimestamp = 0; - current = null; - }); + totalPlaytime = 0; + lastTimestamp = 0; + current = null; } }); } public void load(){ saves.clear(); - IntArray slots = Settings.getObject("save-slots", IntArray.class, IntArray::new); + IntArray slots = Core.settings.getObject("save-slots", IntArray.class, IntArray::new); for(int i = 0; i < slots.size; i ++){ int index = slots.get(i); @@ -67,19 +65,19 @@ public class Saves{ SaveSlot current = this.current; if(current != null && !state.is(State.menu) - && !(state.isPaused() && ui.hasDialog())){ + && !(state.isPaused() && Core.scene.hasDialog())){ if(lastTimestamp != 0){ - totalPlaytime += TimeUtils.timeSinceMillis(lastTimestamp); + totalPlaytime += Time.timeSinceMillis(lastTimestamp); } - lastTimestamp = TimeUtils.millis(); + lastTimestamp = Time.millis(); } if(!state.is(State.menu) && !state.gameOver && current != null && current.isAutosave()){ - time += Timers.delta(); - if(time > Settings.getInt("saveinterval") * 60){ + time += Time.delta(); + if(time > Core.settings.getInt("saveinterval") * 60){ saving = true; - Timers.runTask(2f, () -> { + Time.runTask(2f, () -> { try{ current.save(); }catch(Exception e){ @@ -144,8 +142,8 @@ public class Saves{ IntArray result = new IntArray(saves.size); for(int i = 0; i < saves.size; i++) result.add(saves.get(i).index); - Settings.putObject("save-slots", result); - Settings.save(); + Core.settings.putObject("save-slots", result); + Core.settings.save(); } public class SaveSlot{ @@ -165,7 +163,6 @@ public class Saves{ public void save(){ long time = totalPlaytime; - renderer.fog.writeFog(); long prev = totalPlaytime; totalPlaytime = time; @@ -186,8 +183,12 @@ public class Saves{ return Strings.formatMillis(current == this ? totalPlaytime : meta.timePlayed); } + public long getTimestamp(){ + return meta.timestamp; + } + public String getDate(){ - return meta.date; + return SimpleDateFormat.getDateTimeInstance().format(new Date(meta.timestamp)); } public Map getMap(){ @@ -195,12 +196,12 @@ public class Saves{ } public String getName(){ - return Settings.getString("save-" + index + "-name", "untittled"); + return Core.settings.getString("save-" + index + "-name", "untittled"); } public void setName(String name){ - Settings.putString("save-" + index + "-name", name); - Settings.save(); + Core.settings.put("save-" + index + "-name", name); + Core.settings.save(); } public int getBuild(){ @@ -220,12 +221,12 @@ public class Saves{ } public boolean isAutosave(){ - return Settings.getBool("save-" + index + "-autosave", true); + return Core.settings.getBool("save-" + index + "-autosave", true); } public void setAutosave(boolean save){ - Settings.putBool("save-" + index + "-autosave", save); - Settings.save(); + Core.settings.put("save-" + index + "-autosave", save); + Core.settings.save(); } public void importFile(FileHandle file) throws IOException{ diff --git a/core/src/io/anuke/mindustry/game/Team.java b/core/src/io/anuke/mindustry/game/Team.java index 2bace764e2..429e6e970a 100644 --- a/core/src/io/anuke/mindustry/game/Team.java +++ b/core/src/io/anuke/mindustry/game/Team.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.game; -import com.badlogic.gdx.graphics.Color; -import io.anuke.ucore.util.Bundles; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; public enum Team{ none(Color.valueOf("4d4e58")), @@ -21,6 +21,6 @@ public enum Team{ } public String localized(){ - return Bundles.get("team." + name() + ".name"); + return Core.bundle.get("team." + name() + ".name"); } } diff --git a/core/src/io/anuke/mindustry/game/Teams.java b/core/src/io/anuke/mindustry/game/Teams.java index 7b004b37d2..65ff687e76 100644 --- a/core/src/io/anuke/mindustry/game/Teams.java +++ b/core/src/io/anuke/mindustry/game/Teams.java @@ -1,14 +1,11 @@ package io.anuke.mindustry.game; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.collection.EnumSet; +import io.anuke.arc.collection.ObjectSet; import io.anuke.mindustry.Vars; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.util.EnumSet; -import io.anuke.ucore.util.ThreadSet; -/** - * Class for various team-based utilities. - */ +/**Class for various team-based utilities.*/ public class Teams{ private TeamData[] map = new TeamData[Team.all.length]; @@ -52,7 +49,7 @@ public class Teams{ } public class TeamData{ - public final ObjectSet cores = new ThreadSet<>(); + public final ObjectSet cores = new ObjectSet<>(); public final EnumSet enemies; public final Team team; diff --git a/core/src/io/anuke/mindustry/game/UnlockableContent.java b/core/src/io/anuke/mindustry/game/UnlockableContent.java index fc90949927..cd8e068af4 100644 --- a/core/src/io/anuke/mindustry/game/UnlockableContent.java +++ b/core/src/io/anuke/mindustry/game/UnlockableContent.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.game; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.scene.ui.layout.Table; import static io.anuke.mindustry.Vars.control; diff --git a/core/src/io/anuke/mindustry/game/Unlocks.java b/core/src/io/anuke/mindustry/game/Unlocks.java index 7b624263b9..61aeca7339 100644 --- a/core/src/io/anuke/mindustry/game/Unlocks.java +++ b/core/src/io/anuke/mindustry/game/Unlocks.java @@ -1,19 +1,20 @@ package io.anuke.mindustry.game; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.Core; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.collection.ObjectSet; import io.anuke.mindustry.game.EventType.UnlockEvent; import io.anuke.mindustry.type.ContentType; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Settings; +import io.anuke.arc.Events; +import io.anuke.arc.Settings; /**Stores player unlocks. Clientside only.*/ public class Unlocks{ private ObjectMap> unlocked = new ObjectMap<>(); private boolean dirty; - static{ - Settings.setSerializer(ContentType.class, (stream, t) -> stream.writeInt(t.ordinal()), stream -> ContentType.values()[stream.readInt()]); + public Unlocks(){ + Core.settings.setSerializer(ContentType.class, (stream, t) -> stream.writeInt(t.ordinal()), stream -> ContentType.values()[stream.readInt()]); } /** Returns whether or not this piece of content is unlocked yet.*/ @@ -65,13 +66,14 @@ public class Unlocks{ save(); } + @SuppressWarnings("unchecked") public void load(){ - unlocked = Settings.getObject("unlockset", ObjectMap.class, ObjectMap::new); + unlocked = Core.settings.getObject("unlockset", ObjectMap.class, ObjectMap::new); } public void save(){ - Settings.putObject("unlockset", unlocked); - Settings.save(); + Core.settings.putObject("unlockset", unlocked); + Core.settings.save(); } } diff --git a/core/src/io/anuke/mindustry/game/Version.java b/core/src/io/anuke/mindustry/game/Version.java index 44d4aac4b1..276dd04354 100644 --- a/core/src/io/anuke/mindustry/game/Version.java +++ b/core/src/io/anuke/mindustry/game/Version.java @@ -1,10 +1,10 @@ package io.anuke.mindustry.game; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.PropertiesUtils; -import io.anuke.ucore.util.Strings; +import io.anuke.arc.Core; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.util.Strings; +import io.anuke.arc.util.io.PropertiesUtils; import java.io.IOException; @@ -22,7 +22,7 @@ public class Version{ public static void init(){ try{ - FileHandle file = Gdx.files.internal("version.properties"); + FileHandle file = Core.files.internal("version.properties"); ObjectMap map = new ObjectMap<>(); PropertiesUtils.load(map, file.reader()); diff --git a/core/src/io/anuke/mindustry/game/Waves.java b/core/src/io/anuke/mindustry/game/Waves.java index 12fe04c959..d05a2f9aa3 100644 --- a/core/src/io/anuke/mindustry/game/Waves.java +++ b/core/src/io/anuke/mindustry/game/Waves.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.game; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.content.UnitTypes; diff --git a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java index 5b679ccdf4..680c007cfa 100644 --- a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java @@ -1,103 +1,100 @@ package io.anuke.mindustry.graphics; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntSet; -import com.badlogic.gdx.utils.Sort; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.Sort; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.glutils.FrameBuffer; +import io.anuke.arc.util.Tmp; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.game.EventType.TileChangeEvent; -import io.anuke.mindustry.game.EventType.WorldLoadGraphicsEvent; +import io.anuke.mindustry.game.EventType.WorldLoadEvent; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Surface; -import io.anuke.ucore.util.Mathf; +import static io.anuke.arc.Core.camera; import static io.anuke.mindustry.Vars.*; -import static io.anuke.ucore.core.Core.camera; public class BlockRenderer{ private final static int initialRequests = 32 * 32; private final static int expandr = 6; - private FloorRenderer floorRenderer; + public final FloorRenderer floor = new FloorRenderer(); private Array requests = new Array<>(true, initialRequests, BlockRequest.class); - private IntSet teamChecks = new IntSet(); private int lastCamX, lastCamY, lastRangeX, lastRangeY; - private Layer lastLayer; private int requestidx = 0; private int iterateidx = 0; - private Surface shadows = Graphics.createSurface().setSize(2, 2); + private FrameBuffer shadows = new FrameBuffer(1, 1); public BlockRenderer(){ - floorRenderer = new FloorRenderer(); for(int i = 0; i < requests.size; i++){ requests.set(i, new BlockRequest()); } - Events.on(WorldLoadGraphicsEvent.class, event -> { + Events.on(WorldLoadEvent.class, event -> { lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated }); Events.on(TileChangeEvent.class, event -> { - threads.runGraphics(() -> { - int avgx = Mathf.scl(camera.position.x, tilesize); - int avgy = Mathf.scl(camera.position.y, tilesize); - int rangex = (int) (camera.viewportWidth * camera.zoom / tilesize / 2) + 2; - int rangey = (int) (camera.viewportHeight * camera.zoom / tilesize / 2) + 2; + int avgx = (int)(camera.position.x / tilesize); + int avgy = (int)(camera.position. y/ tilesize); + int rangex = (int) (camera.width / tilesize / 2) + 2; + int rangey = (int) (camera.height / tilesize / 2) + 2; - if(Math.abs(avgx - event.tile.x) <= rangex && Math.abs(avgy - event.tile.y) <= rangey){ - lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated - } - }); + if(Math.abs(avgx - event.tile.x) <= rangex && Math.abs(avgy - event.tile.y) <= rangey){ + lastCamY = lastCamX = -99; //invalidate camera position so blocks get updated + } }); } public void drawShadows(){ - Draw.color(0, 0, 0, 0.15f); - Draw.rect(shadows.texture(), - Core.camera.position.x - Core.camera.position.x % tilesize, - Core.camera.position.y - Core.camera.position.y % tilesize, - shadows.width(), -shadows.height()); - Draw.color(); - } + if(shadows.getWidth() != Core.graphics.getWidth() || shadows.getHeight() != Core.graphics.getHeight()){ + shadows.resize(Core.graphics.getWidth(), Core.graphics.getHeight()); + } - public boolean isTeamShown(Team team){ - return teamChecks.contains(team.ordinal()); + Tmp.tr1.set(shadows.getTexture()); + Shaders.outline.color.set(0, 0, 0, 0.15f); + Shaders.outline.scl = renderer.cameraScale()/3f; + Shaders.outline.region = Tmp.tr1; + + Draw.flush(); + shadows.begin(); + Core.graphics.clear(Color.CLEAR); + Draw.color(Color.BLACK); + drawBlocks(Layer.shadow); + Draw.color(); + Draw.flush(); + shadows.end(); + + Draw.shader(Shaders.outline); + Draw.rect(Draw.wrap(shadows.getTexture()), + camera.position.x, + camera.position.y, + camera.width, -camera.height); + Draw.shader(); } /**Process all blocks to draw, simultaneously updating the block shadow framebuffer.*/ public void processBlocks(){ iterateidx = 0; - lastLayer = null; - int avgx = Mathf.scl(camera.position.x, tilesize); - int avgy = Mathf.scl(camera.position.y, tilesize); + int avgx = (int)(camera.position.x / tilesize); + int avgy = (int)(camera.position.y / tilesize); - int rangex = (int) (camera.viewportWidth * camera.zoom / tilesize / 2) + 2; - int rangey = (int) (camera.viewportHeight * camera.zoom / tilesize / 2) + 2; + int rangex = (int) (camera.width / tilesize / 2) + 2; + int rangey = (int) (camera.height / tilesize / 2) + 2; if(avgx == lastCamX && avgy == lastCamY && lastRangeX == rangex && lastRangeY == rangey){ return; } - int shadowW = rangex * tilesize*2, shadowH = rangey * tilesize*2; - - teamChecks.clear(); requestidx = 0; - Graphics.end(); - if(shadows.width() != shadowW || shadows.height() != shadowH){ - shadows.setSize(shadowW, shadowH); - } - Core.batch.getProjectionMatrix().setToOrtho2D(Mathf.round(Core.camera.position.x, tilesize)-shadowW/2f, Mathf.round(Core.camera.position.y, tilesize)-shadowH/2f, shadowW, shadowH); - Graphics.surface(shadows); - int minx = Math.max(avgx - rangex - expandr, 0); int miny = Math.max(avgy - rangey - expandr, 0); int maxx = Math.min(world.width() - 1, avgx + rangex + expandr); @@ -118,8 +115,8 @@ public class BlockRenderer{ if(block != Blocks.air){ if(!expanded){ + addRequest(tile, Layer.shadow); addRequest(tile, Layer.block); - teamChecks.add(team.ordinal()); } if(block.expanded || !expanded){ @@ -136,10 +133,7 @@ public class BlockRenderer{ } } - Graphics.surface(); - Graphics.end(); - Core.batch.setProjectionMatrix(camera.combined); - Graphics.begin(); + Draw.proj(camera.projection()); Sort.instance().sort(requests.items, 0, requestidx); @@ -149,10 +143,6 @@ public class BlockRenderer{ lastRangeY = rangey; } - public int getRequests(){ - return requestidx; - } - public void drawBlocks(Layer stopAt){ for(; iterateidx < requestidx; iterateidx++){ @@ -162,23 +152,17 @@ public class BlockRenderer{ } BlockRequest req = requests.get(iterateidx); - - if(req.layer != lastLayer){ - if(lastLayer != null) layerEnds(lastLayer); - layerBegins(req.layer); - } - Block block = req.tile.block(); - if(req.layer == Layer.block){ + if(req.layer == Layer.shadow){ + block.drawShadow(req.tile); + }else if(req.layer == Layer.block){ block.draw(req.tile); }else if(req.layer == block.layer){ block.drawLayer(req.tile); }else if(req.layer == block.layer2){ block.drawLayer2(req.tile); } - - lastLayer = req.layer; } } @@ -216,24 +200,6 @@ public class BlockRenderer{ } } - public void beginFloor(){ - floorRenderer.beginDraw(); - } - - public void endFloor(){ - floorRenderer.endDraw(); - } - - public void drawFloor(){ - floorRenderer.drawFloor(); - } - - private void layerBegins(Layer layer){ - } - - private void layerEnds(Layer layer){ - } - private void addRequest(Tile tile, Layer layer){ if(requestidx >= requests.size){ requests.add(new BlockRequest()); diff --git a/core/src/io/anuke/mindustry/graphics/CacheLayer.java b/core/src/io/anuke/mindustry/graphics/CacheLayer.java index 4a13487541..bd1d1a88c9 100644 --- a/core/src/io/anuke/mindustry/graphics/CacheLayer.java +++ b/core/src/io/anuke/mindustry/graphics/CacheLayer.java @@ -1,57 +1,13 @@ package io.anuke.mindustry.graphics; -import com.badlogic.gdx.graphics.Color; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Shader; - -import static io.anuke.mindustry.Vars.renderer; - public enum CacheLayer{ water{ - @Override - public void begin(){ - beginShader(); - } - - @Override - public void end(){ - endShader(Shaders.water); - } }, lava{ - @Override - public void begin(){ - beginShader(); - } - - @Override - public void end(){ - endShader(Shaders.lava); - } }, oil{ - @Override - public void begin(){ - beginShader(); - } - - @Override - public void end(){ - endShader(Shaders.oil); - } }, space{ - @Override - public void begin(){ - beginShader(); - } - - @Override - public void end(){ - endShader(Shaders.space); - } }, normal; @@ -64,25 +20,9 @@ public enum CacheLayer{ } protected void beginShader(){ - //renderer.getBlocks().endFloor(); - renderer.effectSurface.getBuffer().begin(); - Graphics.clear(Color.CLEAR); - //renderer.getBlocks().beginFloor(); + } - public void endShader(Shader shader){ - renderer.blocks.endFloor(); - - //renderer.effectSurface.getBuffer().end(); - - renderer.pixelSurface.getBuffer().begin(); - - Graphics.shader(shader); - Graphics.begin(); - Draw.rect(renderer.effectSurface.texture(), Core.camera.position.x, Core.camera.position.y, - Core.camera.viewportWidth * Core.camera.zoom, -Core.camera.viewportHeight * Core.camera.zoom); - Graphics.end(); - Graphics.shader(); - renderer.blocks.beginFloor(); + public void endShader(){ } } diff --git a/core/src/io/anuke/mindustry/graphics/FloorRenderer.java b/core/src/io/anuke/mindustry/graphics/FloorRenderer.java index 36510734d7..461756141f 100644 --- a/core/src/io/anuke/mindustry/graphics/FloorRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/FloorRenderer.java @@ -1,32 +1,27 @@ package io.anuke.mindustry.graphics; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.OrthographicCamera; -import com.badlogic.gdx.utils.IntArray; -import com.badlogic.gdx.utils.IntSet; -import com.badlogic.gdx.utils.IntSet.IntSetIterator; -import com.badlogic.gdx.utils.ObjectSet; -import io.anuke.mindustry.game.EventType.WorldLoadGraphicsEvent; -import io.anuke.mindustry.maps.Sector; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.collection.IntArray; +import io.anuke.arc.collection.IntSet; +import io.anuke.arc.collection.IntSet.IntSetIterator; +import io.anuke.arc.collection.ObjectSet; +import io.anuke.arc.graphics.Camera; +import io.anuke.arc.graphics.GL20; +import io.anuke.arc.graphics.g2d.CacheBatch; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.SpriteBatch; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Structs; +import io.anuke.arc.util.Time; +import io.anuke.mindustry.game.EventType.WorldLoadEvent; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.Floor; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.CacheBatch; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Structs; import java.util.Arrays; -import static io.anuke.mindustry.Vars.tilesize; -import static io.anuke.mindustry.Vars.world; +import static io.anuke.mindustry.Vars.*; public class FloorRenderer{ private final static int chunksize = 64; @@ -37,7 +32,7 @@ public class FloorRenderer{ private IntArray drawnLayers = new IntArray(); public FloorRenderer(){ - Events.on(WorldLoadGraphicsEvent.class, event -> clearTiles()); + Events.on(WorldLoadEvent.class, event -> clearTiles()); } public void drawFloor(){ @@ -45,13 +40,13 @@ public class FloorRenderer{ return; } - OrthographicCamera camera = Core.camera; + Camera camera = Core.camera; - int crangex = (int) (camera.viewportWidth * camera.zoom / (chunksize * tilesize)) + 1; - int crangey = (int) (camera.viewportHeight * camera.zoom / (chunksize * tilesize)) + 1; + int crangex = (int) (camera.width / (chunksize * tilesize)) + 1; + int crangey = (int) (camera.height / (chunksize * tilesize)) + 1; - int camx = Mathf.scl(camera.position.x, chunksize * tilesize); - int camy = Mathf.scl(camera.position.y, chunksize * tilesize); + int camx = (int)(camera.position.x / (chunksize * tilesize)); + int camy = (int)(camera.position.y / (chunksize * tilesize)); int layers = CacheLayer.values().length; @@ -85,7 +80,7 @@ public class FloorRenderer{ drawnLayers.sort(); - Graphics.end(); + Draw.flush(); beginDraw(); for(int i = 0; i < drawnLayers.size; i++){ @@ -95,7 +90,6 @@ public class FloorRenderer{ } endDraw(); - Graphics.begin(); } public void beginDraw(){ @@ -103,10 +97,10 @@ public class FloorRenderer{ return; } - cbatch.setProjectionMatrix(Core.camera.combined); + cbatch.setProjection(Core.camera.projection()); cbatch.beginDraw(); - Gdx.gl.glEnable(GL20.GL_BLEND); + Core.gl.glEnable(GL20.GL_BLEND); } public void endDraw(){ @@ -122,17 +116,17 @@ public class FloorRenderer{ return; } - OrthographicCamera camera = Core.camera; + Camera camera = Core.camera; - int crangex = (int) (camera.viewportWidth * camera.zoom / (chunksize * tilesize)) + 1; - int crangey = (int) (camera.viewportHeight * camera.zoom / (chunksize * tilesize)) + 1; + int crangex = (int) (camera.width / (chunksize * tilesize)) + 1; + int crangey = (int) (camera.height / (chunksize * tilesize)) + 1; layer.begin(); for(int x = -crangex; x <= crangex; x++){ for(int y = -crangey; y <= crangey; y++){ - int worldx = Mathf.scl(camera.position.x, chunksize * tilesize) + x; - int worldy = Mathf.scl(camera.position.y, chunksize * tilesize) + y; + int worldx = (int)(camera.position.x / (chunksize * tilesize)) + x; + int worldy = (int)(camera.position.y / (chunksize * tilesize)) + y; if(!Structs.inBounds(worldx, worldy, cache)){ continue; @@ -147,19 +141,11 @@ public class FloorRenderer{ layer.end(); } - private void fillChunk(float x, float y){ - Draw.color(Color.BLACK); - Fill.crect(x, y, chunksize * tilesize, chunksize * tilesize); - Draw.color(); - } - private void cacheChunk(int cx, int cy){ Chunk chunk = cache[cx][cy]; ObjectSet used = new ObjectSet<>(); - Sector sector = world.getSector(); - for(int tilex = cx * chunksize; tilex < (cx + 1) * chunksize; tilex++){ for(int tiley = cy * chunksize; tiley < (cy + 1) * chunksize; tiley++){ Tile tile = world.tile(tilex, tiley); @@ -176,11 +162,10 @@ public class FloorRenderer{ } private void cacheChunkLayer(int cx, int cy, Chunk chunk, CacheLayer layer){ + SpriteBatch current = Core.batch; + Core.batch = cbatch; - Graphics.useBatch(cbatch); - cbatch.begin(); - - Sector sector = world.getSector(); + cbatch.beginCache(); for(int tilex = cx * chunksize; tilex < (cx + 1) * chunksize; tilex++){ for(int tiley = cy * chunksize; tiley < (cy + 1) * chunksize; tiley++){ @@ -200,21 +185,19 @@ public class FloorRenderer{ } } } - - cbatch.end(); - Graphics.popBatch(); - chunk.caches[layer.ordinal()] = cbatch.getLastCache(); + Core.batch = current; + chunk.caches[layer.ordinal()] = cbatch.endCache(); } public void clearTiles(){ if(cbatch != null) cbatch.dispose(); int chunksx = Mathf.ceil((float) (world.width()) / chunksize), - chunksy = Mathf.ceil((float) (world.height()) / chunksize) ; + chunksy = Mathf.ceil((float) (world.height()) / chunksize) ; cache = new Chunk[chunksx][chunksy]; cbatch = new CacheBatch(world.width() * world.height() * 4 * 4); - Timers.mark(); + Time.mark(); for(int x = 0; x < chunksx; x++){ for(int y = 0; y < chunksy; y++){ @@ -225,7 +208,7 @@ public class FloorRenderer{ } } - Log.info("Time to cache: {0}", Timers.elapsed()); + Log.info("Time to cache: {0}", Time.elapsed()); } private class Chunk{ diff --git a/core/src/io/anuke/mindustry/graphics/FogRenderer.java b/core/src/io/anuke/mindustry/graphics/FogRenderer.java deleted file mode 100644 index 7c920c78b0..0000000000 --- a/core/src/io/anuke/mindustry/graphics/FogRenderer.java +++ /dev/null @@ -1,177 +0,0 @@ -package io.anuke.mindustry.graphics; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.GL20; -import com.badlogic.gdx.graphics.Pixmap.Format; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.graphics.glutils.FrameBuffer; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.Disposable; -import io.anuke.mindustry.entities.Unit; -import io.anuke.mindustry.game.EventType.TileChangeEvent; -import io.anuke.mindustry.game.EventType.WorldLoadGraphicsEvent; -import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.entities.EntityDraw; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; - -import java.nio.ByteBuffer; - -import static io.anuke.mindustry.Vars.*; - -/**Used for rendering fog of war. A framebuffer is used for this.*/ -public class FogRenderer implements Disposable{ - private TextureRegion region = new TextureRegion(); - private FrameBuffer buffer; - private ByteBuffer pixelBuffer; - private Array changeQueue = new Array<>(); - private int shadowPadding; - private boolean dirty; - - public FogRenderer(){ - Events.on(WorldLoadGraphicsEvent.class, event -> { - dispose(); - - shadowPadding = -1; - - buffer = new FrameBuffer(Format.RGBA8888, world.width(), world.height(), false); - changeQueue.clear(); - - //clear buffer to black - buffer.begin(); - Graphics.clear(0, 0, 0, 1f); - buffer.end(); - - for(int x = 0; x < world.width(); x++){ - for(int y = 0; y < world.height(); y++){ - Tile tile = world.tile(x, y); - if(tile.getTeam() == players[0].getTeam() && tile.block().synthetic() && tile.block().viewRange > 0){ - changeQueue.add(tile); - } - } - } - - pixelBuffer = ByteBuffer.allocateDirect(world.width() * world.height() * 4); - dirty = true; - }); - - Events.on(TileChangeEvent.class, event -> threads.runGraphics(() -> { - if(event.tile.getTeam() == players[0].getTeam() && event.tile.block().synthetic() && event.tile.block().viewRange > 0){ - changeQueue.add(event.tile); - } - })); - } - - public void writeFog(){ - if(buffer == null) return; - - buffer.begin(); - pixelBuffer.position(0); - Gdx.gl.glPixelStorei(GL20.GL_PACK_ALIGNMENT, 1); - Gdx.gl.glReadPixels(0, 0, world.width(), world.height(), GL20.GL_RGBA, GL20.GL_UNSIGNED_BYTE, pixelBuffer); - - pixelBuffer.position(0); - for(int i = 0; i < world.width() * world.height(); i++){ - int x = i % world.width(); - int y = i / world.width(); - byte r = pixelBuffer.get(); - if(r != 0){ - world.tile(x, y).setVisibility((byte)1); - } - pixelBuffer.position(pixelBuffer.position() + 3); - } - buffer.end(); - } - - public int getPadding(){ - return -shadowPadding; - } - - public void draw(){ - if(buffer == null) return; - - float vw = Core.camera.viewportWidth * Core.camera.zoom; - float vh = Core.camera.viewportHeight * Core.camera.zoom; - - float px = Core.camera.position.x - vw / 2f; - float py = Core.camera.position.y - vh / 2f; - - float u = (px / tilesize) / buffer.getWidth(); - float v = (py / tilesize) / buffer.getHeight(); - - float u2 = ((px + vw) / tilesize) / buffer.getWidth(); - float v2 = ((py + vh) / tilesize) / buffer.getHeight(); - - Core.batch.getProjectionMatrix().setToOrtho2D(0, 0, buffer.getWidth() * tilesize, buffer.getHeight() * tilesize); - - Draw.color(Color.WHITE); - - buffer.begin(); - - Graphics.beginClip((-shadowPadding), (-shadowPadding), (world.width() + shadowPadding*2), (world.height() + shadowPadding*2)); - - Graphics.begin(); - EntityDraw.setClip(false); - - renderer.drawAndInterpolate(playerGroup, player -> !player.isDead() && player.getTeam() == players[0].getTeam(), Unit::drawView); - renderer.drawAndInterpolate(unitGroups[players[0].getTeam().ordinal()], unit -> !unit.isDead(), Unit::drawView); - - for(Tile tile : changeQueue){ - float viewRange = tile.block().viewRange; - if(viewRange < 0) continue; - Fill.circle(tile.drawx(), tile.drawy(), tile.block().viewRange); - } - - changeQueue.clear(); - - if(dirty){ - for(int x = 0; x < world.width(); x++){ - for(int y = 0; y < world.height(); y++){ - Tile tile = world.tile(x, y); - if(tile.discovered()){ - Fill.rect(tile.worldx(), tile.worldy(), tilesize, tilesize); - } - } - } - dirty = false; - } - - EntityDraw.setClip(true); - Graphics.end(); - buffer.end(); - - Graphics.endClip(); - - region.setTexture(buffer.getColorBufferTexture()); - region.setRegion(u, v2, u2, v); - - Core.batch.setProjectionMatrix(Core.camera.combined); - Graphics.shader(Shaders.fog); - renderer.pixelSurface.getBuffer().begin(); - Graphics.begin(); - - Core.batch.draw(region, px, py, vw, vh); - - Graphics.end(); - renderer.pixelSurface.getBuffer().end(); - Graphics.shader(); - - Graphics.setScreen(); - Core.batch.draw(renderer.pixelSurface.texture(), 0, Gdx.graphics.getHeight(), Gdx.graphics.getWidth(), -Gdx.graphics.getHeight()); - Graphics.end(); - } - - public Texture getTexture(){ - return buffer.getColorBufferTexture(); - } - - @Override - public void dispose(){ - if(buffer != null) buffer.dispose(); - } -} diff --git a/core/src/io/anuke/mindustry/graphics/IndexedRenderer.java b/core/src/io/anuke/mindustry/graphics/IndexedRenderer.java new file mode 100644 index 0000000000..a05bec2c6d --- /dev/null +++ b/core/src/io/anuke/mindustry/graphics/IndexedRenderer.java @@ -0,0 +1,222 @@ +package io.anuke.mindustry.graphics; + +import io.anuke.arc.Core; +import io.anuke.arc.graphics.*; +import io.anuke.arc.graphics.VertexAttributes.Usage; +import io.anuke.arc.graphics.g2d.BatchShader; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.graphics.glutils.Shader; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.Matrix3; +import io.anuke.arc.util.Disposable; + +//TODO this class is a trainwreck, remove it +public class IndexedRenderer implements Disposable{ + private final static int vsize = 5; + + private Shader program = BatchShader.create(); + private Mesh mesh; + private float[] tmpVerts = new float[vsize * 6]; + private float[] vertices; + + private Matrix3 projMatrix = new Matrix3(); + private Matrix3 transMatrix = new Matrix3(); + private Matrix3 combined = new Matrix3(); + private float color = Color.WHITE.toFloatBits(); + + public IndexedRenderer(int sprites){ + resize(sprites); + } + + public void render(Texture texture){ + Core.gl.glEnable(GL20.GL_BLEND); + + updateMatrix(); + + program.begin(); + + texture.bind(); + + program.setUniformMatrix4("u_projTrans", BatchShader.copyTransform(combined)); + program.setUniformi("u_texture", 0); + + mesh.render(program, GL20.GL_TRIANGLES, 0, vertices.length / 5); + + program.end(); + } + + public void setColor(Color color){ + this.color = color.toFloatBits(); + } + + public void draw(int index, TextureRegion region, float x, float y, float w, float h){ + final float fx2 = x + w; + final float fy2 = y + h; + final float u = region.getU(); + final float v = region.getV2(); + final float u2 = region.getU2(); + final float v2 = region.getV(); + + float[] vertices = tmpVerts; + + int idx = 0; + vertices[idx++] = x; + vertices[idx++] = y; + vertices[idx++] = color; + vertices[idx++] = u; + vertices[idx++] = v; + + vertices[idx++] = x; + vertices[idx++] = fy2; + vertices[idx++] = color; + vertices[idx++] = u; + vertices[idx++] = v2; + + vertices[idx++] = fx2; + vertices[idx++] = fy2; + vertices[idx++] = color; + vertices[idx++] = u2; + vertices[idx++] = v2; + + //tri2 + vertices[idx++] = x; + vertices[idx++] = y; + vertices[idx++] = color; + vertices[idx++] = u; + vertices[idx++] = v; + + vertices[idx++] = fx2; + vertices[idx++] = y; + vertices[idx++] = color; + vertices[idx++] = u2; + vertices[idx++] = v; + + vertices[idx++] = fx2; + vertices[idx++] = fy2; + vertices[idx++] = color; + vertices[idx++] = u2; + vertices[idx++] = v2; + + mesh.updateVertices(index * vsize * 6, vertices); + } + + public void draw(int index, TextureRegion region, float x, float y, float w, float h, float rotation){ + final float u = region.getU(); + final float v = region.getV2(); + final float u2 = region.getU2(); + final float v2 = region.getV(); + + final float originX = w / 2, originY = h / 2; + + final float cos = Mathf.cosDeg(rotation); + final float sin = Mathf.sinDeg(rotation); + + float fx = -originX; + float fy = -originY; + float fx2 = w - originX; + float fy2 = h - originY; + + final float worldOriginX = x + originX; + final float worldOriginY = y + originY; + + float x1 = cos * fx - sin * fy; + float y1 = sin * fx + cos * fy; + + float x2 = cos * fx - sin * fy2; + float y2 = sin * fx + cos * fy2; + + float x3 = cos * fx2 - sin * fy2; + float y3 = sin * fx2 + cos * fy2; + + float x4 = x1 + (x3 - x2); + float y4 = y3 - (y2 - y1); + + x1 += worldOriginX; + y1 += worldOriginY; + x2 += worldOriginX; + y2 += worldOriginY; + x3 += worldOriginX; + y3 += worldOriginY; + x4 += worldOriginX; + y4 += worldOriginY; + + float[] vertices = tmpVerts; + + int idx = 0; + vertices[idx++] = x1; + vertices[idx++] = y1; + vertices[idx++] = color; + vertices[idx++] = u; + vertices[idx++] = v; + + vertices[idx++] = x3; + vertices[idx++] = y3; + vertices[idx++] = color; + vertices[idx++] = u2; + vertices[idx++] = v2; + + vertices[idx++] = x4; + vertices[idx++] = y4; + vertices[idx++] = color; + vertices[idx++] = u; + vertices[idx++] = v2; + + //tri2 + vertices[idx++] = x1; + vertices[idx++] = y1; + vertices[idx++] = color; + vertices[idx++] = u; + vertices[idx++] = v; + + vertices[idx++] = x2; + vertices[idx++] = y2; + vertices[idx++] = color; + vertices[idx++] = u2; + vertices[idx++] = v; + + vertices[idx++] = x3; + vertices[idx++] = y3; + vertices[idx++] = color; + vertices[idx++] = u2; + vertices[idx++] = v2; + + mesh.updateVertices(index * vsize * 6, vertices); + } + + public Matrix3 getTransformMatrix(){ + return transMatrix; + } + + public void setTransformMatrix(Matrix3 matrix){ + transMatrix = matrix; + } + + public Matrix3 getProjectionMatrix(){ + return projMatrix; + } + + public void setProjectionMatrix(Matrix3 matrix){ + projMatrix = matrix; + } + + public void resize(int sprites){ + if(mesh != null) mesh.dispose(); + + mesh = new Mesh(true, 6 * sprites, 0, + new VertexAttribute(Usage.Position, 2, "a_position"), + new VertexAttribute(Usage.ColorPacked, 4, "a_color"), + new VertexAttribute(Usage.TextureCoordinates, 2, "a_texCoord0")); + vertices = new float[6 * sprites * vsize]; + mesh.setVertices(vertices); + } + + private void updateMatrix(){ + combined.set(projMatrix).mul(transMatrix); + } + + @Override + public void dispose(){ + mesh.dispose(); + program.dispose(); + } +} diff --git a/core/src/io/anuke/mindustry/graphics/Layer.java b/core/src/io/anuke/mindustry/graphics/Layer.java index f04144a2cd..493a13deba 100644 --- a/core/src/io/anuke/mindustry/graphics/Layer.java +++ b/core/src/io/anuke/mindustry/graphics/Layer.java @@ -1,28 +1,18 @@ package io.anuke.mindustry.graphics; public enum Layer{ - /** - * Base block layer. - */ + /**Drawn under everything.*/ + shadow, + /**Base block layer.*/ block, - /** - * for placement - */ + /**for placement*/ placement, - /** - * First overlay. Stuff like conveyor items. - */ + /**First overlay. Stuff like conveyor items.*/ overlay, - /** - * "High" blocks, like turrets. - */ + /**"High" blocks, like turrets.*/ turret, - /** - * Power lasers. - */ + /**Power lasers.*/ power, - /** - * Extra lasers, like healing turrets. - */ + /**Extra lasers, like healing turrets.*/ laser } diff --git a/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java b/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java index e900b2feef..8c5d198d24 100644 --- a/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java @@ -1,54 +1,53 @@ package io.anuke.mindustry.graphics; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Pixmap; -import com.badlogic.gdx.graphics.Pixmap.Format; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.Disposable; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.Pixmap; +import io.anuke.arc.graphics.Pixmap.Format; +import io.anuke.arc.graphics.Pixmaps; +import io.anuke.arc.graphics.Texture; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.ScissorStack; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.util.Disposable; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.game.EventType.TileChangeEvent; -import io.anuke.mindustry.game.EventType.WorldLoadGraphicsEvent; +import io.anuke.mindustry.game.EventType.WorldLoadEvent; import io.anuke.mindustry.world.ColorMapper; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Pixmaps; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.ThreadArray; import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.world; public class MinimapRenderer implements Disposable{ private static final int baseSize = 16; - private final Array units = new ThreadArray<>(); + private final Array units = new Array<>(); private Pixmap pixmap; private Texture texture; private TextureRegion region; - private Rectangle rect = new Rectangle(); + private Rectangle rect = new Rectangle(), scissor = new Rectangle(); private int zoom = 4; public MinimapRenderer(){ - Events.on(WorldLoadGraphicsEvent.class, event -> { + Events.on(WorldLoadEvent.class, event -> { reset(); updateAll(); }); //make sure to call on the graphics thread - Events.on(TileChangeEvent.class, event -> Gdx.app.postRunnable(() -> update(event.tile))); + Events.on(TileChangeEvent.class, event -> Core.app.post(() -> update(event.tile))); } public Texture getTexture(){ return texture; } - public void zoomBy(int amount){ + public void zoomBy(float amount){ zoom += amount; zoom = Mathf.clamp(zoom, 1, Math.min(world.width(), world.height()) / baseSize / 2); } @@ -68,24 +67,27 @@ public class MinimapRenderer implements Disposable{ } public void drawEntities(float x, float y, float w, float h){ + updateUnitArray(); + int sz = baseSize * zoom; float dx = (Core.camera.position.x / tilesize); float dy = (Core.camera.position.y / tilesize); dx = Mathf.clamp(dx, sz, world.width() - sz); dy = Mathf.clamp(dy, sz, world.height() - sz); + if(!ScissorStack.pushScissors(scissor.set(x, y, w, h))){ + return; + } + rect.set((dx - sz) * tilesize, (dy - sz) * tilesize, sz * 2 * tilesize, sz * 2 * tilesize); - Graphics.beginClip(x, y, w, h); for(Unit unit : units){ float rx = (unit.x - rect.x) / rect.width * w, ry = (unit.y - rect.y) / rect.width * h; Draw.color(unit.getTeam().color); - Draw.crect(Draw.getBlankRegion(), x + rx, y + ry, w / (sz * 2), h / (sz * 2)); + Fill.crect(x + rx, y + ry, w / (sz * 2), h / (sz * 2)); } Draw.color(); - - Graphics.endClip(); } public TextureRegion getRegion(){ @@ -99,7 +101,7 @@ public class MinimapRenderer implements Disposable{ float invTexWidth = 1f / texture.getWidth(); float invTexHeight = 1f / texture.getHeight(); float x = dx - sz, y = world.height() - dy - sz, width = sz * 2, height = sz * 2; - region.setRegion(x * invTexWidth, y * invTexHeight, (x + width) * invTexWidth, (y + height) * invTexHeight); + region.set(x * invTexWidth, y * invTexHeight, (x + width) * invTexWidth, (y + height) * invTexHeight); return region; } diff --git a/core/src/io/anuke/mindustry/graphics/OverlayRenderer.java b/core/src/io/anuke/mindustry/graphics/OverlayRenderer.java index 3c070132fa..ed56e89b1c 100644 --- a/core/src/io/anuke/mindustry/graphics/OverlayRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/OverlayRenderer.java @@ -1,27 +1,19 @@ package io.anuke.mindustry.graphics; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.MathUtils; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.Tmp; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.entities.Player; -import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.input.InputHandler; -import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.meta.BlockBar; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Tmp; import static io.anuke.mindustry.Vars.*; @@ -41,25 +33,25 @@ public class OverlayRenderer{ if(!input.isDrawing() || player.isDead()) continue; Shaders.outline.color.set(Palette.accent); - Graphics.beginShaders(Shaders.outline); + //TODO draw outlined version + //Graphics.beginShaders(Shaders.outline); input.drawOutlined(); - Graphics.endShaders(); + //Graphics.endShaders(); } } public void drawTop(){ for(Player player : playerGroup.all()){ - if(Settings.getBool("indicators") && player != players[0] && player.getTeam() == players[0].getTeam()){ - if(!rect.setSize(Core.camera.viewportWidth * Core.camera.zoom * 0.9f, Core.camera.viewportHeight * Core.camera.zoom * 0.9f) + if(Core.settings.getBool("indicators") && player != players[0] && player.getTeam() == players[0].getTeam()){ + if(!rect.setSize(Core.camera.width * 0.9f, Core.camera.height * 0.9f) .setCenter(Core.camera.position.x, Core.camera.position.y).contains(player.x, player.y)){ Tmp.v1.set(player.x, player.y).sub(Core.camera.position.x, Core.camera.position.y).setLength(indicatorLength); - Draw.color(player.getTeam().color); - Lines.stroke(2f); + Lines.stroke(2f, player.getTeam().color); Lines.lineAngle(Core.camera.position.x + Tmp.v1.x, Core.camera.position.y + Tmp.v1.y, Tmp.v1.angle(), 4f); Draw.reset(); } @@ -87,11 +79,11 @@ public class OverlayRenderer{ if(buildFadeTime > 0.005f){ for(Team enemy : state.teams.enemiesOf(player.getTeam())){ for(Tile core : state.teams.get(enemy).cores){ - float dst = Vector2.dst(player.x, player.y, core.drawx(), core.drawy()); + float dst = Mathf.dst(player.x, player.y, core.drawx(), core.drawy()); if(dst < state.mode.enemyCoreBuildRadius * 1.5f){ Draw.color(Color.DARK_GRAY); Lines.poly(core.drawx(), core.drawy() - 2, 200, state.mode.enemyCoreBuildRadius); - Draw.color(Palette.accent, enemy.color, 0.5f + Mathf.absin(Timers.time(), 10f, 0.5f)); + Draw.color(Palette.accent, enemy.color, 0.5f + Mathf.absin(Time.time(), 10f, 0.5f)); Lines.poly(core.drawx(), core.drawy(), 200, state.mode.enemyCoreBuildRadius); } } @@ -101,129 +93,32 @@ public class OverlayRenderer{ Draw.reset(); //draw selected block bars and info - if(input.recipe == null && !ui.hasMouse()){ - Vector2 vec = Graphics.world(input.getMouseX(), input.getMouseY()); + if(input.recipe == null && !Core.scene.hasMouse()){ + Vector2 vec = Core.input.mouseWorld(input.getMouseX(), input.getMouseY()); Tile tile = world.tileWorld(vec.x, vec.y); if(tile != null && tile.block() != Blocks.air && tile.target().getTeam() == players[0].getTeam()){ Tile target = tile.target(); - - if(showBlockDebug && target.entity != null){ - Draw.color(Color.RED); - Lines.crect(target.drawx(), target.drawy(), target.block().size * tilesize, target.block().size * tilesize); - Vector2 v = new Vector2(); - - Draw.tcolor(Color.YELLOW); - Draw.tscl(0.25f); - Array arr = target.block().getDebugInfo(target); - StringBuilder result = new StringBuilder(); - for(int i = 0; i < arr.size / 2; i++){ - result.append(arr.get(i * 2)); - result.append(": "); - result.append(arr.get(i * 2 + 1)); - result.append("\n"); - } - Draw.textc(result.toString(), target.drawx(), target.drawy(), v); - Draw.color(0f, 0f, 0f, 0.5f); - Fill.rect(target.drawx(), target.drawy(), v.x, v.y); - Draw.textc(result.toString(), target.drawx(), target.drawy(), v); - Draw.tscl(1f); - Draw.reset(); - } - - Block block = target.block(); - TileEntity entity = target.entity; - - if(entity != null){ - int[] values = {0, 0}; - boolean[] doDraw = {false}; - - Runnable drawbars = () -> { - for(BlockBar bar : block.bars.list()){ - float offset = Mathf.sign(bar.top) * (block.size / 2f * tilesize + 2f + (bar.top ? values[0] : values[1])); - - float value = bar.value.get(target); - - if(MathUtils.isEqual(value, -1f)) continue; - - if(doDraw[0]){ - drawBar(bar.type.color, target.drawx(), target.drawy() + offset, value); - } - - if(bar.top) - values[0]++; - else - values[1]++; - } - }; - - drawbars.run(); - - if(values[0] > 0){ - drawEncloser(target.drawx(), target.drawy() + block.size * tilesize / 2f + 2f, values[0]); - } - - if(values[1] > 0){ - drawEncloser(target.drawx(), target.drawy() - block.size * tilesize / 2f - 2f - values[1], values[1]); - } - - doDraw[0] = true; - values[0] = 0; - values[1] = 1; - - drawbars.run(); - } - - target.block().drawSelect(target); - } } if(input.isDroppingItem()){ - Vector2 v = Graphics.world(input.getMouseX(), input.getMouseY()); + Vector2 v = Core.input.mouseWorld(input.getMouseX(), input.getMouseY()); float size = 8; Draw.rect(player.inventory.getItem().item.region, v.x, v.y, size, size); Draw.color(Palette.accent); - Lines.circle(v.x, v.y, 6 + Mathf.absin(Timers.time(), 5f, 1f)); + Lines.circle(v.x, v.y, 6 + Mathf.absin(Time.time(), 5f, 1f)); Draw.reset(); Tile tile = world.tileWorld(v.x, v.y); if(tile != null) tile = tile.target(); if(tile != null && tile.getTeam() == player.getTeam() && tile.block().acceptStack(player.inventory.getItem().item, player.inventory.getItem().amount, tile, player) > 0){ Draw.color(Palette.place); - Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f + 1 + Mathf.absin(Timers.time(), 5f, 1f)); + Lines.square(tile.drawx(), tile.drawy(), tile.block().size * tilesize / 2f + 1 + Mathf.absin(Time.time(), 5f, 1f)); Draw.color(); } } } } - - void drawBar(Color color, float x, float y, float finion){ - if(finion > 0.9f) finion = 1f; //fixes precision errors - finion = Mathf.clamp(finion); - - if(finion > 0.001f) finion = Mathf.clamp(finion, 0.24f, 1f); - - float len = 3; - - float w = (int) (len * 2 * finion); - - Draw.color(Color.BLACK); - Fill.crect(x - len, y, len * 2f, 1); - if(finion > 0){ - Draw.color(color); - Fill.crect(x - len, y, Math.max(1, w), 1); - } - Draw.color(); - } - - void drawEncloser(float x, float y, float height){ - - float len = 4; - - Draw.color(Palette.bar); - Fill.crect(x - len, y - 1, len * 2f, height + 2f); - Draw.color(); - } } diff --git a/core/src/io/anuke/mindustry/graphics/Palette.java b/core/src/io/anuke/mindustry/graphics/Palette.java index 437a36034c..0ffcf551be 100644 --- a/core/src/io/anuke/mindustry/graphics/Palette.java +++ b/core/src/io/anuke/mindustry/graphics/Palette.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.graphics; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; public class Palette{ public static final Color diff --git a/core/src/io/anuke/mindustry/graphics/Shaders.java b/core/src/io/anuke/mindustry/graphics/Shaders.java index 254234f419..2853013ecc 100644 --- a/core/src/io/anuke/mindustry/graphics/Shaders.java +++ b/core/src/io/anuke/mindustry/graphics/Shaders.java @@ -1,13 +1,11 @@ package io.anuke.mindustry.graphics; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Shader; -import io.anuke.ucore.scene.ui.layout.Unit; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.graphics.glutils.Shader; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.util.Time; import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.world; @@ -39,11 +37,11 @@ public class Shaders{ build = new UnitBuild(); mix = new MixShader(); fog = new FogShader(); - fullMix = new Shader("fullmix", "default"); + fullMix = new LoadShader("fullmix", "default"); menu = new MenuShader(); } - public static class MenuShader extends Shader{ + public static class MenuShader extends LoadShader{ float time = 0f; public MenuShader(){ @@ -54,21 +52,21 @@ public class Shaders{ public void apply(){ time = time % 158; - shader.setUniformf("u_resolution", Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); - shader.setUniformi("u_time", (int)(time += Gdx.graphics.getDeltaTime() * 60f)); - shader.setUniformf("u_uv", Draw.getBlankRegion().getU(), Draw.getBlankRegion().getV()); - shader.setUniformf("u_scl", Unit.dp.scl(1f)); - shader.setUniformf("u_uv2", Draw.getBlankRegion().getU2(), Draw.getBlankRegion().getV2()); + setUniformf("u_resolution", Core.graphics.getWidth(), Core.graphics.getHeight()); + setUniformi("u_time", (int)(time += Core.graphics.getDeltaTime() * 60f)); + setUniformf("u_uv", Core.atlas.white().getU(), Core.atlas.white().getV()); + setUniformf("u_scl", Unit.dp.scl(1f)); + setUniformf("u_uv2", Core.atlas.white().getU2(), Core.atlas.white().getV2()); } } - public static class FogShader extends Shader{ + public static class FogShader extends LoadShader{ public FogShader(){ super("fog", "default"); } } - public static class MixShader extends Shader{ + public static class MixShader extends LoadShader{ public Color color = new Color(Color.WHITE); public MixShader(){ @@ -78,7 +76,7 @@ public class Shaders{ @Override public void apply(){ super.apply(); - shader.setUniformf("u_color", color); + setUniformf("u_color", color); } } @@ -91,11 +89,11 @@ public class Shaders{ @Override public void apply(){ super.apply(); - shader.setUniformf("u_center", world.width() * tilesize / 2f, world.height() * tilesize / 2f); + setUniformf("u_center", world.width() * tilesize / 2f, world.height() * tilesize / 2f); } } - public static class UnitBuild extends Shader{ + public static class UnitBuild extends LoadShader{ public float progress, time; public Color color = new Color(); public TextureRegion region; @@ -106,17 +104,19 @@ public class Shaders{ @Override public void apply(){ - shader.setUniformf("u_time", time); - shader.setUniformf("u_color", color); - shader.setUniformf("u_progress", progress); - shader.setUniformf("u_uv", region.getU(), region.getV()); - shader.setUniformf("u_uv2", region.getU2(), region.getV2()); - shader.setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight()); + setUniformf("u_time", time); + setUniformf("u_color", color); + setUniformf("u_progress", progress); + setUniformf("u_uv", region.getU(), region.getV()); + setUniformf("u_uv2", region.getU2(), region.getV2()); + setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight()); } } - public static class Outline extends Shader{ + public static class Outline extends LoadShader{ public Color color = new Color(); + public TextureRegion region = new TextureRegion(); + public float scl; public Outline(){ super("outline", "default"); @@ -124,14 +124,16 @@ public class Shaders{ @Override public void apply(){ - shader.setUniformf("u_color", color); - shader.setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight()); + setUniformf("u_color", color); + setUniformf("u_scl", scl); + setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight()); } } - public static class BlockBuild extends Shader{ + public static class BlockBuild extends LoadShader{ public Color color = new Color(); public float progress; + public TextureRegion region = new TextureRegion(); public BlockBuild(){ super("blockbuild", "default"); @@ -139,17 +141,18 @@ public class Shaders{ @Override public void apply(){ - shader.setUniformf("u_progress", progress); - shader.setUniformf("u_color", color); - shader.setUniformf("u_uv", region.getU(), region.getV()); - shader.setUniformf("u_uv2", region.getU2(), region.getV2()); - shader.setUniformf("u_time", Timers.time()); - shader.setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight()); + setUniformf("u_progress", progress); + setUniformf("u_color", color); + setUniformf("u_uv", region.getU(), region.getV()); + setUniformf("u_uv2", region.getU2(), region.getV2()); + setUniformf("u_time", Time.time()); + setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight()); } } - public static class BlockPreview extends Shader{ + public static class BlockPreview extends LoadShader{ public Color color = new Color(); + public TextureRegion region = new TextureRegion(); public BlockPreview(){ super("blockpreview", "default"); @@ -157,14 +160,14 @@ public class Shaders{ @Override public void apply(){ - shader.setUniformf("u_color", color); - shader.setUniformf("u_uv", region.getU(), region.getV()); - shader.setUniformf("u_uv2", region.getU2(), region.getV2()); - shader.setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight()); + setUniformf("u_color", color); + setUniformf("u_uv", region.getU(), region.getV()); + setUniformf("u_uv2", region.getU2(), region.getV2()); + setUniformf("u_texsize", region.getTexture().getWidth(), region.getTexture().getHeight()); } } - public static class Shield extends Shader{ + public static class Shield extends LoadShader{ public Shield(){ super("shield", "default"); @@ -172,17 +175,17 @@ public class Shaders{ @Override public void apply(){ - shader.setUniformf("u_dp", Unit.dp.scl(1f)); - shader.setUniformf("u_time", Timers.time() / Unit.dp.scl(1f)); - shader.setUniformf("u_offset", - Core.camera.position.x - Core.camera.viewportWidth / 2 * Core.camera.zoom, - Core.camera.position.y - Core.camera.viewportHeight / 2 * Core.camera.zoom); - shader.setUniformf("u_texsize", Core.camera.viewportWidth * Core.camera.zoom, - Core.camera.viewportHeight * Core.camera.zoom); + setUniformf("u_dp", Unit.dp.scl(1f)); + setUniformf("u_time", Time.time() / Unit.dp.scl(1f)); + setUniformf("u_offset", + Core.camera.position.x - Core.camera.width / 2 , + Core.camera.position.y - Core.camera.height / 2 ); + setUniformf("u_texsize", Core.camera.width , + Core.camera.height ); } } - public static class SurfaceShader extends Shader{ + public static class SurfaceShader extends LoadShader{ public SurfaceShader(String frag){ super(frag, "default"); @@ -190,12 +193,18 @@ public class Shaders{ @Override public void apply(){ - shader.setUniformf("camerapos", - Core.camera.position.x - Core.camera.viewportWidth / 2 * Core.camera.zoom, - Core.camera.position.y - Core.camera.viewportHeight / 2 * Core.camera.zoom); - shader.setUniformf("screensize", Core.camera.viewportWidth* Core.camera.zoom, - Core.camera.viewportHeight * Core.camera.zoom); - shader.setUniformf("time", Timers.time()); + setUniformf("camerapos", + Core.camera.position.x - Core.camera.width / 2 , + Core.camera.position.y - Core.camera.height / 2 ); + setUniformf("screensize", Core.camera.width, + Core.camera.height ); + setUniformf("time", Time.time()); + } + } + + public static class LoadShader extends Shader{ + public LoadShader(String frag, String vert){ + super(Core.files.internal("shaders/" + vert + ".vertex"), Core.files.internal("shaders/" + frag + ".fragment")); } } } diff --git a/core/src/io/anuke/mindustry/graphics/Shapes.java b/core/src/io/anuke/mindustry/graphics/Shapes.java new file mode 100644 index 0000000000..5d87feaefd --- /dev/null +++ b/core/src/io/anuke/mindustry/graphics/Shapes.java @@ -0,0 +1,38 @@ +package io.anuke.mindustry.graphics; + +import io.anuke.arc.Core; +import io.anuke.arc.graphics.g2d.CapStyle; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Mathf; + +//TODO remove +public class Shapes{ + + public static void laser(String line, String edge, float x, float y, float x2, float y2, float scale){ + laser(line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), scale); + } + + public static void laser(String line, String edge, float x, float y, float x2, float y2){ + laser(line, edge, x, y, x2, y2, Mathf.angle(x2 - x, y2 - y), 1f); + } + + public static void laser(String line, String edge, float x, float y, float x2, float y2, float rotation, float scale){ + + Lines.stroke(12f * scale); + Lines.line(Core.atlas.find(line), x, y, x2, y2, CapStyle.none, 0f); + Lines.stroke(1f); + + TextureRegion region = Core.atlas.find(edge); + + Draw.rect(Core.atlas.find(edge), x, y, region.getWidth() * Draw.scl, region.getHeight() * scale * Draw.scl, rotation + 180); + + Draw.rect(Core.atlas.find(edge), x2, y2, region.getWidth() * Draw.scl, region.getHeight() * scale * Draw.scl, rotation); + } + + public static void tri(float x, float y, float width, float length, float rotation){ + float oy = 17f / 63f * length; + Draw.rect(Core.atlas.find("shape-3"), x, y - oy + length/2f, width, length, width / 2f, oy, rotation - 90); + } +} diff --git a/core/src/io/anuke/mindustry/graphics/Trail.java b/core/src/io/anuke/mindustry/graphics/Trail.java deleted file mode 100644 index bd34dc7002..0000000000 --- a/core/src/io/anuke/mindustry/graphics/Trail.java +++ /dev/null @@ -1,66 +0,0 @@ -package io.anuke.mindustry.graphics; - -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.FloatArray; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Mathf; - -/** - * Class that renders a colored trail. - */ -public class Trail{ - private final static float maxJump = 15f; - private final int length; - private final FloatArray points = new FloatArray(); - private float lastX, lastY; - - public Trail(int length){ - this.length = length; - } - - public void update(float curx, float cury){ - if(Vector2.dst(curx, cury, lastX, lastY) >= maxJump){ - points.clear(); - } - - points.add(curx, cury); - - while(points.size > (int)(length * 2 / Math.min(Timers.delta(), 1f))){ - float[] items = points.items; - System.arraycopy(items, 2, items, 0, points.size - 2); - points.size -= 2; - } - - lastX = curx; - lastY = cury; - } - - public void clear(){ - points.clear(); - } - - public void draw(Color color, float stroke){ - Draw.color(color); - - for(int i = 0; i < points.size - 2; i += 2){ - float x = points.get(i); - float y = points.get(i + 1); - float x2 = points.get(i + 2); - float y2 = points.get(i + 3); - float s = Mathf.clamp((float) (i) / points.size); - - Lines.stroke(s * stroke); - Lines.line(x, y, x2, y2); - } - - if(points.size >= 2){ - Fill.circle(points.get(points.size - 2), points.get(points.size - 1), stroke / 2f); - } - - Draw.reset(); - } -} diff --git a/core/src/io/anuke/mindustry/input/Binding.java b/core/src/io/anuke/mindustry/input/Binding.java new file mode 100644 index 0000000000..40396ad9b1 --- /dev/null +++ b/core/src/io/anuke/mindustry/input/Binding.java @@ -0,0 +1,44 @@ +package io.anuke.mindustry.input; + +import io.anuke.arc.Application.ApplicationType; +import io.anuke.arc.Core; +import io.anuke.arc.KeyBinds.Axis; +import io.anuke.arc.KeyBinds.KeyBind; +import io.anuke.arc.KeyBinds.KeybindValue; +import io.anuke.arc.input.InputDevice.DeviceType; +import io.anuke.arc.input.KeyCode; + +public enum Binding implements KeyBind{ + move_x(new Axis(KeyCode.A, KeyCode.D), "general"), + move_y(new Axis(KeyCode.S, KeyCode.W)), + select(KeyCode.MOUSE_LEFT), + deselect(KeyCode.MOUSE_RIGHT), + break_block(KeyCode.MOUSE_RIGHT), + rotate(new Axis(KeyCode.SCROLL)), + dash(KeyCode.SHIFT_LEFT), + drop_unit(KeyCode.SHIFT_LEFT), + gridMode(KeyCode.SPACE), + gridModeShift(KeyCode.SHIFT_LEFT), + zoom_hold(KeyCode.CONTROL_LEFT, "view"), + zoom(new Axis(KeyCode.SCROLL)), + zoom_minimap(new Axis(KeyCode.MINUS, KeyCode.PLUS)), + menu(Core.app.getType() == ApplicationType.Android ? KeyCode.BACK : KeyCode.ESCAPE), + pause(KeyCode.SPACE), + toggle_menus(KeyCode.C), + screenshot(KeyCode.P), + player_list(KeyCode.TAB, "multiplayer"), + chat(KeyCode.ENTER), + chat_history_prev(KeyCode.UP), + chat_history_next(KeyCode.DOWN), + chat_scroll(new Axis(KeyCode.SCROLL)) + ; + + private final KeybindValue defaultValue; + private final String category; + + Binding(KeybindValue defaultValue, String category){ this.defaultValue = defaultValue; this.category = category; } + Binding(KeybindValue defaultValue){ this(defaultValue, null); } + + @Override public KeybindValue defaultValue(DeviceType type){ return defaultValue; } + @Override public String category(){ return category; } +} diff --git a/core/src/io/anuke/mindustry/input/CursorType.java b/core/src/io/anuke/mindustry/input/CursorType.java deleted file mode 100644 index fa26e5f0e9..0000000000 --- a/core/src/io/anuke/mindustry/input/CursorType.java +++ /dev/null @@ -1,26 +0,0 @@ -package io.anuke.mindustry.input; - -import io.anuke.ucore.scene.utils.Cursors; - -/** - * Type of cursor for displaying on desktop. - */ -public enum CursorType{ - normal(Cursors::restoreCursor), - hand(Cursors::setHand), - drill(() -> Cursors.set("drill")), - unload(() -> Cursors.set("unload")); - - private final Runnable call; - - CursorType(Runnable call){ - this.call = call; - } - - /** - * Sets the current system cursor to this. - */ - void set(){ - call.run(); - } -} diff --git a/core/src/io/anuke/mindustry/input/DefaultKeybinds.java b/core/src/io/anuke/mindustry/input/DefaultKeybinds.java deleted file mode 100644 index 8f0117abf9..0000000000 --- a/core/src/io/anuke/mindustry/input/DefaultKeybinds.java +++ /dev/null @@ -1,69 +0,0 @@ -package io.anuke.mindustry.input; - -import com.badlogic.gdx.Application.ApplicationType; -import com.badlogic.gdx.Gdx; -import io.anuke.ucore.core.Inputs.Axis; -import io.anuke.ucore.core.Inputs.DeviceType; -import io.anuke.ucore.core.KeyBinds; -import io.anuke.ucore.core.KeyBinds.Category; -import io.anuke.ucore.input.Input; - -public class DefaultKeybinds{ - - public static void load(){ - String[] sections = {"player_1"}; - - for(String section : sections){ - - KeyBinds.defaultSection(section, DeviceType.keyboard, - new Category("general"), - "move_x", new Axis(Input.A, Input.D), - "move_y", new Axis(Input.S, Input.W), - "select", Input.MOUSE_LEFT, - "deselect", Input.MOUSE_RIGHT, - "break", Input.MOUSE_RIGHT, - "rotate", new Axis(Input.SCROLL), - "dash", Input.SHIFT_LEFT, - "drop_unit", Input.SHIFT_LEFT, - new Category("view"), - "zoom_hold", Input.CONTROL_LEFT, - "zoom", new Axis(Input.SCROLL), - "zoom_minimap", new Axis(Input.MINUS, Input.PLUS), - "menu", Gdx.app.getType() == ApplicationType.Android ? Input.BACK : Input.ESCAPE, - "pause", Input.SPACE, - "toggle_menus", Input.C, - "screenshot", Input.P, - new Category("multiplayer"), - "player_list", Input.TAB, - "chat", Input.ENTER, - "chat_history_prev", Input.UP, - "chat_history_next", Input.DOWN, - "chat_scroll", new Axis(Input.SCROLL) - ); - - KeyBinds.defaultSection(section, DeviceType.controller, - new Category("general"), - "move_x", new Axis(Input.CONTROLLER_L_STICK_HORIZONTAL_AXIS), - "move_y", new Axis(Input.CONTROLLER_L_STICK_VERTICAL_AXIS), - "cursor_x", new Axis(Input.CONTROLLER_R_STICK_HORIZONTAL_AXIS), - "cursor_y", new Axis(Input.CONTROLLER_R_STICK_VERTICAL_AXIS), - //"select", Input.CONTROLLER_R_BUMPER, - //"break", Input.CONTROLLER_L_BUMPER, - //"shoot", Input.CONTROLLER_R_TRIGGER, - "dash", Input.CONTROLLER_Y, - "rotate_alt", new Axis(Input.CONTROLLER_DPAD_RIGHT, Input.CONTROLLER_DPAD_LEFT), - "rotate", new Axis(Input.CONTROLLER_A, Input.CONTROLLER_B), - new Category("view"), - "zoom_hold", Input.ANY_KEY, - "zoom", new Axis(Input.CONTROLLER_DPAD_DOWN, Input.CONTROLLER_DPAD_UP), - "menu", Input.CONTROLLER_X, - "pause", Input.CONTROLLER_L_TRIGGER, - new Category("multiplayer"), - "player_list", Input.CONTROLLER_START - ); - - } - - KeyBinds.setSectionAlias("default", "player_1"); - } -} diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index d6881fc58a..034a896272 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -1,7 +1,12 @@ package io.anuke.mindustry.input; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.Core; +import io.anuke.arc.Graphics.Cursor; +import io.anuke.arc.Graphics.Cursor.SystemCursor; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Mathf; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; @@ -11,18 +16,8 @@ import io.anuke.mindustry.input.PlaceUtils.NormalizeResult; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Inputs; -import io.anuke.ucore.core.Inputs.DeviceType; -import io.anuke.ucore.core.KeyBinds; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.*; -import static io.anuke.mindustry.input.CursorType.*; import static io.anuke.mindustry.input.PlaceMode.*; public class DesktopInput extends InputHandler{ @@ -31,7 +26,7 @@ public class DesktopInput extends InputHandler{ private float controlx, controly; private boolean controlling; /**Current cursor type.*/ - private CursorType cursorType = normal; + private Cursor cursorType = SystemCursor.arrow; /**Position where the player started dragging a line.*/ private int selectX, selectY; @@ -54,7 +49,8 @@ public class DesktopInput extends InputHandler{ for(TextureRegion region : regions){ Draw.rect(region, x * tilesize + block.offset(), y * tilesize + block.offset(), - region.getRegionWidth() * selectScale, region.getRegionHeight() * selectScale, block.rotate ? rotation * 90 : 0); + region.getWidth() * selectScale * Draw.scl, + region.getHeight() * selectScale * Draw.scl, block.rotate ? rotation * 90 : 0); } }else{ Draw.color(Palette.removeBack); @@ -71,21 +67,24 @@ public class DesktopInput extends InputHandler{ @Override public void drawOutlined(){ - int cursorX = tileX(Gdx.input.getX()); - int cursorY = tileY(Gdx.input.getY()); + Lines.stroke(1f); + int cursorX = tileX(Core.input.mouseX()); + int cursorY = tileY(Core.input.mouseY()); //draw selection(s) if(mode == placing && recipe != null){ NormalizeResult result = PlaceUtils.normalizeArea(selectX, selectY, cursorX, cursorY, rotation, true, maxLength); for(int i = 0; i <= result.getLength(); i += recipe.result.size){ - int x = selectX + i * Mathf.sign(cursorX - selectX) * Mathf.bool(result.isX()); - int y = selectY + i * Mathf.sign(cursorY - selectY) * Mathf.bool(!result.isX()); + int x = selectX + i * Mathf.sign(cursorX - selectX) * Mathf.num(result.isX()); + int y = selectY + i * Mathf.sign(cursorY - selectY) * Mathf.num(!result.isX()); if(i + recipe.result.size > result.getLength() && recipe.result.rotate){ Draw.color(!validPlace(x, y, recipe.result, result.rotation) ? Palette.remove : Palette.placeRotate); - Draw.grect("place-arrow", x * tilesize + recipe.result.offset(), - y * tilesize + recipe.result.offset(), result.rotation * 90 - 90); + Draw.rect(Core.atlas.find("place-arrow"), x * tilesize + recipe.result.offset(), + y * tilesize + recipe.result.offset(), + Core.atlas.find("place-arrow").getWidth() * Draw.scl, Core.atlas.find("place-arrow").getHeight() * Draw.scl, + x * tilesize + recipe.result.offset()/2f, 0f, result.rotation * 90 - 90); } drawPlace(x, y, recipe.result, result.rotation); @@ -116,8 +115,11 @@ public class DesktopInput extends InputHandler{ }else if(isPlacing()){ if(recipe.result.rotate){ Draw.color(!validPlace(cursorX, cursorY, recipe.result, rotation) ? Palette.remove : Palette.placeRotate); - Draw.grect("place-arrow", cursorX * tilesize + recipe.result.offset(), - cursorY * tilesize + recipe.result.offset(), rotation * 90 - 90); + Draw.rect(Core.atlas.find("place-arrow"), cursorX * tilesize + recipe.result.offset(), + cursorY * tilesize + recipe.result.offset(), + Core.atlas.find("place-arrow").getWidth() * Draw.scl, + Core.atlas.find("place-arrow").getHeight() * Draw.scl, + cursorX * tilesize + recipe.result.offset()/2f, 0, rotation * 90 - 90); } drawPlace(cursorX, cursorY, recipe.result, rotation); recipe.result.drawPlace(cursorX, cursorY, rotation, validPlace(cursorX, cursorY, recipe.result, rotation)); @@ -128,24 +130,22 @@ public class DesktopInput extends InputHandler{ @Override public void update(){ - if(Net.active() && Inputs.keyTap("player_list")){ + if(Net.active() && Core.input.keyTap(Binding.player_list)){ ui.listfrag.toggle(); } - if(Inputs.keyRelease(section, "select")){ + if(Core.input.keyRelease(Binding.select)){ player.isShooting = false; } - if(state.is(State.menu) || ui.hasDialog()) return; - - boolean controller = KeyBinds.getSection(section).device.type == DeviceType.controller; + if(state.is(State.menu) || Core.scene.hasDialog()) return; //zoom and rotate things - if(Inputs.getAxisActive("zoom") && (Inputs.keyDown(section, "zoom_hold") || controller)){ - renderer.scaleCamera((int) Inputs.getAxisTapped(section, "zoom")); + if(Math.abs(Core.input.axisTap(Binding.zoom)) > 0 && (Core.input.keyDown(Binding.zoom_hold))){ + renderer.scaleCamera(Core.input.axisTap(Binding.zoom)); } - renderer.minimap.zoomBy(-(int) Inputs.getAxisTapped(section, "zoom_minimap")); + renderer.minimap.zoomBy(-Core.input.axisTap(Binding.zoom_minimap)); if(player.isDead()) return; @@ -161,90 +161,90 @@ public class DesktopInput extends InputHandler{ } if(isPlacing()){ - cursorType = hand; + cursorType = SystemCursor.hand; selectScale = Mathf.lerpDelta(selectScale, 1f, 0.2f); }else{ selectScale = 0f; } - rotation = Mathf.mod(rotation + (int) Inputs.getAxisTapped(section, "rotate"), 4); + rotation = Mathf.mod(rotation + (int) Core.input.axis(Binding.rotate), 4); - Tile cursor = tileAt(Gdx.input.getX(), Gdx.input.getY()); + Tile cursor = tileAt(Core.input.mouseX(), Core.input.mouseY()); if(player.isDead()){ - cursorType = normal; + cursorType = SystemCursor.arrow; }else if(cursor != null){ cursor = cursor.target(); cursorType = cursor.block().getCursor(cursor); if(isPlacing()){ - cursorType = hand; + cursorType = SystemCursor.hand; } if(!isPlacing() && canMine(cursor)){ - cursorType = drill; + cursorType = ui.drillCursor; } - if(canTapPlayer(Graphics.mouseWorld().x, Graphics.mouseWorld().y)){ - cursorType = unload; + if(canTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y)){ + cursorType = ui.unloadCursor; } } - if(!ui.hasMouse()){ - cursorType.set(); + if(!Core.scene.hasMouse()){ + Core.graphics.cursor(cursorType); } - cursorType = normal; + cursorType = SystemCursor.arrow; } void pollInput(){ - Tile selected = tileAt(Gdx.input.getX(), Gdx.input.getY()); - int cursorX = tileX(Gdx.input.getX()); - int cursorY = tileY(Gdx.input.getY()); + Tile selected = tileAt(Core.input.mouseX(), Core.input.mouseY()); + int cursorX = tileX(Core.input.mouseX()); + int cursorY = tileY(Core.input.mouseY()); - if(Inputs.keyTap(section, "deselect")){ + if(Core.input.keyTap(Binding.deselect)){ player.setMineTile(null); } - if(Inputs.keyTap(section, "select") && !ui.hasMouse()){ + if(Core.input.keyTap(Binding.select) && !Core.scene.hasMouse()){ if(isPlacing()){ selectX = cursorX; selectY = cursorY; mode = placing; }else if(selected != null){ //only begin shooting if there's no cursor event - if (!tileTapped(selected) && !tryTapPlayer(Graphics.mouseWorld().x, Graphics.mouseWorld().y) && player.getPlaceQueue().size == 0 && !droppingItem && + if (!tileTapped(selected) && !tryTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y) && player.getPlaceQueue().size == 0 && !droppingItem && !tryBeginMine(selected) && player.getMineTile() == null && !ui.chatfrag.chatOpen()) { player.isShooting = true; } }else if(!ui.chatfrag.chatOpen()){ //if it's out of bounds, shooting is just fine player.isShooting = true; } - }else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding()) && - !(player.getCurrentRequest() != null && player.getCurrentRequest().breaking && KeyBinds.get(section, "deselect") == KeyBinds.get(section, "break"))){ + }else if(Core.input.keyTap(Binding.deselect) && (recipe != null || mode != none || player.isBuilding()) && + !(player.getCurrentRequest() != null && player.getCurrentRequest().breaking && Core.keybinds.get(Binding.deselect) == Core.keybinds.get(Binding.break_block))){ if(recipe == null){ player.clearBuilding(); } recipe = null; mode = none; - }else if(Inputs.keyTap(section, "break") && !ui.hasMouse()){ + }else if(Core.input.keyTap(Binding.break_block) && !Core.scene.hasMouse()){ //is recalculated because setting the mode to breaking removes potential multiblock cursor offset mode = breaking; - selectX = tileX(Gdx.input.getX()); - selectY = tileY(Gdx.input.getY()); + selectX = tileX(Core.input.mouseX()); + selectY = tileY(Core.input.mouseY()); } - if(Inputs.keyRelease(section, "break") || Inputs.keyRelease(section, "select")){ + if(Core.input.keyRelease(Binding.break_block) || Core.input.keyRelease(Binding.select)){ - if(mode == placing){ //touch up while placing, place everything in selection + if(mode == placing && recipe != null){ //touch up while placing, place everything in selection NormalizeResult result = PlaceUtils.normalizeArea(selectX, selectY, cursorX, cursorY, rotation, true, maxLength); for(int i = 0; i <= result.getLength(); i += recipe.result.size){ - int x = selectX + i * Mathf.sign(cursorX - selectX) * Mathf.bool(result.isX()); - int y = selectY + i * Mathf.sign(cursorY - selectY) * Mathf.bool(!result.isX()); + int x = selectX + i * Mathf.sign(cursorX - selectX) * Mathf.num(result.isX()); + int y = selectY + i * Mathf.sign(cursorY - selectY) * Mathf.num(!result.isX()); rotation = result.rotation; @@ -263,7 +263,7 @@ public class DesktopInput extends InputHandler{ } if(selected != null){ - tryDropItems(selected.target(), Graphics.mouseWorld().x, Graphics.mouseWorld().y); + tryDropItems(selected.target(), Core.input.mouseWorld().x, Core.input.mouseWorld().y); } mode = none; @@ -278,12 +278,12 @@ public class DesktopInput extends InputHandler{ @Override public float getMouseX(){ - return !controlling ? Gdx.input.getX() : controlx; + return !controlling ? Core.input.mouseX() : controlx; } @Override public float getMouseY(){ - return !controlling ? Gdx.input.getY() : controly; + return !controlling ? Core.input.mouseY() : controly; } @Override @@ -293,46 +293,10 @@ public class DesktopInput extends InputHandler{ @Override public void updateController(){ - //TODO no controller support - //TODO move controller input to new class, ControllerInput - boolean mousemove = Gdx.input.getDeltaX() > 1 || Gdx.input.getDeltaY() > 1; if(state.is(State.menu)){ droppingItem = false; } - - if(KeyBinds.getSection(section).device.type == DeviceType.controller && (!mousemove || player.playerIndex > 0)){ - if(player.playerIndex > 0){ - controlling = true; - } - - float xa = Inputs.getAxis(section, "cursor_x"); - float ya = Inputs.getAxis(section, "cursor_y"); - - if(Math.abs(xa) > controllerMin || Math.abs(ya) > controllerMin){ - float scl = Settings.getInt("sensitivity", 100) / 100f * Unit.dp.scl(1f); - controlx += xa * baseControllerSpeed * scl; - controly -= ya * baseControllerSpeed * scl; - controlling = true; - - if(player.playerIndex == 0){ - Gdx.input.setCursorCatched(true); - } - - Inputs.getProcessor().touchDragged((int) getMouseX(), (int) getMouseY(), player.playerIndex); - } - - controlx = Mathf.clamp(controlx, 0, Gdx.graphics.getWidth()); - controly = Mathf.clamp(controly, 0, Gdx.graphics.getHeight()); - }else{ - controlling = false; - Gdx.input.setCursorCatched(false); - } - - if(!controlling){ - controlx = Gdx.input.getX(); - controly = Gdx.input.getY(); - } } } diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index ac8007737c..36b1fab2ef 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -1,11 +1,16 @@ package io.anuke.mindustry.input; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.InputAdapter; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.Vector2; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.input.InputProcessor; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.fx.EnvironmentFx; import io.anuke.mindustry.entities.Player; @@ -21,28 +26,19 @@ import io.anuke.mindustry.ui.fragments.OverlayFragment; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Build; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Inputs; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Translator; import static io.anuke.mindustry.Vars.*; -public abstract class InputHandler extends InputAdapter{ +public abstract class InputHandler implements InputProcessor{ /**Used for dropping items.*/ final static float playerSelectRange = mobile ? 17f : 11f; /**Maximum line length.*/ final static int maxLength = 100; - final static Translator stackTrns = new Translator(); + final static Vector2 stackTrns = new Vector2(); /**Distance on the back from where items originate.*/ final static float backTrns = 3f; public final Player player; - public final String section; public final OverlayFragment frag = new OverlayFragment(this); public Recipe recipe; @@ -51,7 +47,6 @@ public abstract class InputHandler extends InputAdapter{ public InputHandler(Player player){ this.player = player; - this.section = "player_" + (player.playerIndex + 1); } //methods to override @@ -72,47 +67,45 @@ public abstract class InputHandler extends InputAdapter{ throw new ValidateException(player, "Player cannot transfer an item."); } - threads.run(() -> { - if(player == null || tile.entity == null) return; + if(player == null || tile.entity == null) return; - player.isTransferring = true; + player.isTransferring = true; - Item item = player.inventory.getItem().item; - int amount = player.inventory.getItem().amount; - int accepted = tile.block().acceptStack(item, amount, tile, player); - player.inventory.getItem().amount -= accepted; + Item item = player.inventory.getItem().item; + int amount = player.inventory.getItem().amount; + int accepted = tile.block().acceptStack(item, amount, tile, player); + player.inventory.getItem().amount -= accepted; - int sent = Mathf.clamp(accepted / 4, 1, 8); - int removed = accepted / sent; - int[] remaining = {accepted, accepted}; - Block block = tile.block(); + int sent = Mathf.clamp(accepted / 4, 1, 8); + int removed = accepted / sent; + int[] remaining = {accepted, accepted}; + Block block = tile.block(); - for(int i = 0; i < sent; i++){ - boolean end = i == sent - 1; - Timers.run(i * 3, () -> { - tile.block().getStackOffset(item, tile, stackTrns); + for(int i = 0; i < sent; i++){ + boolean end = i == sent - 1; + Time.run(i * 3, () -> { + tile.block().getStackOffset(item, tile, stackTrns); - ItemTransfer.create(item, - player.x + Angles.trnsx(player.rotation + 180f, backTrns), player.y + Angles.trnsy(player.rotation + 180f, backTrns), - new Translator(tile.drawx() + stackTrns.x, tile.drawy() + stackTrns.y), () -> { - if(tile.block() != block || tile.entity == null || tile.entity.items == null) return; + ItemTransfer.create(item, + player.x + Angles.trnsx(player.rotation + 180f, backTrns), player.y + Angles.trnsy(player.rotation + 180f, backTrns), + new Vector2(tile.drawx() + stackTrns.x, tile.drawy() + stackTrns.y), () -> { + if(tile.block() != block || tile.entity == null || tile.entity.items == null) return; - tile.block().handleStack(item, removed, tile, player); - remaining[1] -= removed; + tile.block().handleStack(item, removed, tile, player); + remaining[1] -= removed; - if(end && remaining[1] > 0){ - tile.block().handleStack(item, remaining[1], tile, player); - } - }); + if(end && remaining[1] > 0){ + tile.block().handleStack(item, remaining[1], tile, player); + } + }); - remaining[0] -= removed; + remaining[0] -= removed; - if(end){ - player.isTransferring = false; - } - }); - } - }); + if(end){ + player.isTransferring = false; + } + }); + } } @Remote(targets = Loc.both, called = Loc.server, forward = true) @@ -130,11 +123,11 @@ public abstract class InputHandler extends InputAdapter{ } public float getMouseX(){ - return Gdx.input.getX(); + return Core.input.mouseX(); } public float getMouseY(){ - return Gdx.input.getY(); + return Core.input.mouseY(); } public void resetCursor(){ @@ -231,7 +224,7 @@ public abstract class InputHandler extends InputAdapter{ } boolean canTapPlayer(float x, float y){ - return Vector2.dst(x, y, player.x, player.y) <= playerSelectRange && player.inventory.hasItem(); + return Mathf.dst(x, y, player.x, player.y) <= playerSelectRange && player.inventory.hasItem(); } /**Tries to begin mining a tile, returns true if successful.*/ @@ -245,11 +238,11 @@ public abstract class InputHandler extends InputAdapter{ } boolean canMine(Tile tile){ - return !ui.hasMouse() + return !Core.scene.hasMouse() && tile.floor().drops != null && tile.floor().drops.item.hardness <= player.mech.drillPower && !tile.floor().playerUnmineable && player.inventory.canAcceptItem(tile.floor().drops.item) - && tile.block() == Blocks.air && player.distanceTo(tile.worldx(), tile.worldy()) <= Player.mineDistance; + && tile.block() == Blocks.air && player.dst(tile.worldx(), tile.worldy()) <= Player.mineDistance; } /**Returns the tile at the specified MOUSE coordinates.*/ @@ -258,7 +251,7 @@ public abstract class InputHandler extends InputAdapter{ } int tileX(float cursorX){ - Vector2 vec = Graphics.world(cursorX, 0); + Vector2 vec = Core.input.mouseWorld(cursorX, 0); if(selectedBlock()){ vec.sub(recipe.result.offset(), recipe.result.offset()); } @@ -266,7 +259,7 @@ public abstract class InputHandler extends InputAdapter{ } int tileY(float cursorY){ - Vector2 vec = Graphics.world(0, cursorY); + Vector2 vec = Core.input.mouseWorld(0, cursorY); if(selectedBlock()){ vec.sub(recipe.result.offset(), recipe.result.offset()); } @@ -282,16 +275,16 @@ public abstract class InputHandler extends InputAdapter{ } public float mouseAngle(float x, float y){ - return Graphics.world(getMouseX(), getMouseY()).sub(x, y).angle(); + return Core.input.mouseWorld(getMouseX(), getMouseY()).sub(x, y).angle(); } public void remove(){ - Inputs.removeProcessor(this); + Core.input.removeProcessor(this); frag.remove(); } public boolean canShoot(){ - return recipe == null && !ui.hasMouse() && !onConfigurable() && !isDroppingItem(); + return recipe == null && !Core.scene.hasMouse() && !onConfigurable() && !isDroppingItem(); } public boolean onConfigurable(){ @@ -337,9 +330,9 @@ public abstract class InputHandler extends InputAdapter{ public boolean validPlace(int x, int y, Block type, int rotation){ for(Tile tile : state.teams.get(player.getTeam()).cores){ - if(tile.distanceTo(x * tilesize, y * tilesize) < coreBuildRange){ + if(tile.dst(x * tilesize, y * tilesize) < coreBuildRange){ return Build.validPlace(player.getTeam(), x, y, type, rotation) && - Vector2.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance; + Mathf.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance; } } @@ -347,7 +340,7 @@ public abstract class InputHandler extends InputAdapter{ } public boolean validBreak(int x, int y){ - return Build.validBreak(player.getTeam(), x, y) && Vector2.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance; + return Build.validBreak(player.getTeam(), x, y) && Mathf.dst(player.x, player.y, x * tilesize, y * tilesize) < Player.placeDistance; } public void placeBlock(int x, int y, Recipe recipe, int rotation){ diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index f4272a40cb..4ac8d2f761 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -1,16 +1,23 @@ package io.anuke.mindustry.input; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.input.GestureDetector; -import com.badlogic.gdx.input.GestureDetector.GestureListener; -import com.badlogic.gdx.math.Interpolation; -import com.badlogic.gdx.math.Rectangle; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.ObjectSet; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.input.GestureDetector; +import io.anuke.arc.input.GestureDetector.GestureListener; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.math.Interpolation; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Rectangle; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.core.GameState.State; @@ -27,11 +34,6 @@ import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.ui.dialogs.FloatingDialog; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.*; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.*; import static io.anuke.mindustry.input.PlaceMode.*; @@ -41,12 +43,12 @@ public class MobileInput extends InputHandler implements GestureListener{ private static final float maxPanSpeed = 1.3f; private static Rectangle r1 = new Rectangle(), r2 = new Rectangle(); /** Distance to edge of screen to start panning. */ - private final float edgePan = io.anuke.ucore.scene.ui.layout.Unit.dp.scl(60f); + private final float edgePan = io.anuke.arc.scene.ui.layout.Unit.dp.scl(60f); //gesture data private Vector2 vector = new Vector2(); + private float lastDistance = -1f; private boolean canPan; - private boolean zoomed = false; /** Set of completed guides. */ private ObjectSet guides = new ObjectSet<>(); @@ -76,7 +78,7 @@ public class MobileInput extends InputHandler implements GestureListener{ public MobileInput(Player player){ super(player); - Inputs.addProcessor(new GestureDetector(20, 0.5f, 0.4f, 0.15f, this)); + Core.input.addProcessor(new GestureDetector(20, 0.5f, 0.4f, 0.15f, this)); } //region utility methods @@ -176,8 +178,9 @@ public class MobileInput extends InputHandler implements GestureListener{ for(TextureRegion region : regions){ Draw.rect(region, tile.worldx() + offset, tile.worldy() + offset, - region.getRegionWidth() * request.scale, region.getRegionHeight() * request.scale, - request.recipe.result.rotate ? request.rotation * 90 : 0); + region.getWidth() * request.scale * Draw.scl, + region.getHeight() * request.scale * Draw.scl, + request.recipe.result.rotate ? request.rotation * 90 : 0); } }else{ float rad = (tile.block().size * tilesize / 2f - 1) * request.scale; @@ -191,15 +194,15 @@ public class MobileInput extends InputHandler implements GestureListener{ } void showGuide(String type){ - if(!guides.contains(type) && !Settings.getBool(type, false)){ + if(!guides.contains(type) && !Core.settings.getBool(type, false)){ FloatingDialog dialog = new FloatingDialog("$text." + type + ".title"); dialog.addCloseButton(); dialog.content().left(); dialog.content().add("$text." + type).growX().wrap(); dialog.content().row(); dialog.content().addCheck("$text.showagain", false, checked -> { - Settings.putBool(type, checked); - Settings.save(); + Core.settings.put(type, checked); + Core.settings.save(); }).growX().left().get().left(); dialog.show(); guides.add(type); @@ -277,7 +280,7 @@ public class MobileInput extends InputHandler implements GestureListener{ Lines.stroke(1f); Shaders.mix.color.set(Palette.accent); - Graphics.shader(Shaders.mix); + Draw.shader(Shaders.mix); //draw removals for(PlaceRequest request : removals){ @@ -315,14 +318,14 @@ public class MobileInput extends InputHandler implements GestureListener{ } } - Graphics.shader(); + Draw.shader(); Draw.color(Palette.accent); //Draw lines if(lineMode){ - int tileX = tileX(Gdx.input.getX()); - int tileY = tileY(Gdx.input.getY()); + int tileX = tileX(Core.input.mouseX()); + int tileY = tileY(Core.input.mouseY()); //draw placing if(mode == placing && recipe != null){ @@ -334,8 +337,8 @@ public class MobileInput extends InputHandler implements GestureListener{ //go through each cell and draw the block to place if valid for(int i = 0; i <= result.getLength(); i += recipe.result.size){ - int x = lineStartX + i * Mathf.sign(tileX - lineStartX) * Mathf.bool(result.isX()); - int y = lineStartY + i * Mathf.sign(tileY - lineStartY) * Mathf.bool(!result.isX()); + int x = lineStartX + i * Mathf.sign(tileX - lineStartX) * Mathf.num(result.isX()); + int y = lineStartY + i * Mathf.sign(tileY - lineStartY) * Mathf.num(!result.isX()); if(!checkOverlapPlacement(x, y, recipe.result) && validPlace(x, y, recipe.result, result.rotation)){ Draw.color(); @@ -344,7 +347,9 @@ public class MobileInput extends InputHandler implements GestureListener{ for(TextureRegion region : regions){ Draw.rect(region, x * tilesize + recipe.result.offset(), y * tilesize + recipe.result.offset(), - region.getRegionWidth() * lineScale, region.getRegionHeight() * lineScale, recipe.result.rotate ? result.rotation * 90 : 0); + region.getWidth() * lineScale * Draw.scl, + region.getHeight() * lineScale * Draw.scl, + recipe.result.rotate ? result.rotation * 90 : 0); } }else{ Draw.color(Palette.removeBack); @@ -397,8 +402,8 @@ public class MobileInput extends InputHandler implements GestureListener{ float radius = Interpolation.swingIn.apply(crosshairScale); - Lines.poly(target.getX(), target.getY(), 4, 7f * radius, Timers.time() * 1.5f); - Lines.spikes(target.getX(), target.getY(), 3f * radius, 6f * radius, 4, Timers.time() * 1.5f); + Lines.poly(target.getX(), target.getY(), 4, 7f * radius, Time.time() * 1.5f); + Lines.spikes(target.getX(), target.getY(), 3f * radius, 6f * radius, 4, Time.time() * 1.5f); } Draw.reset(); @@ -409,16 +414,16 @@ public class MobileInput extends InputHandler implements GestureListener{ //region input events @Override - public boolean touchDown(int screenX, int screenY, int pointer, int button){ + public boolean touchDown(int screenX, int screenY, int pointer, KeyCode button){ if(state.is(State.menu) || player.isDead()) return false; //get tile on cursor Tile cursor = tileAt(screenX, screenY); - float worldx = Graphics.world(screenX, screenY).x, worldy = Graphics.world(screenX, screenY).y; + float worldx = Core.input.mouseWorld(screenX, screenY).x, worldy = Core.input.mouseWorld(screenX, screenY).y; //ignore off-screen taps - if(cursor == null || ui.hasMouse(screenX, screenY)) return false; + if(cursor == null || Core.scene.hasMouse(screenX, screenY)) return false; //only begin selecting if the tapped block is a request selecting = hasRequest(cursor) && isPlacing() && mode == placing; @@ -432,7 +437,7 @@ public class MobileInput extends InputHandler implements GestureListener{ } @Override - public boolean touchUp(int screenX, int screenY, int pointer, int button){ + public boolean touchUp(int screenX, int screenY, int pointer, KeyCode button){ //place down a line if in line mode if(lineMode){ @@ -448,8 +453,8 @@ public class MobileInput extends InputHandler implements GestureListener{ //place blocks on line for(int i = 0; i <= result.getLength(); i += recipe.result.size){ - int x = lineStartX + i * Mathf.sign(tileX - lineStartX) * Mathf.bool(result.isX()); - int y = lineStartY + i * Mathf.sign(tileY - lineStartY) * Mathf.bool(!result.isX()); + int x = lineStartX + i * Mathf.sign(tileX - lineStartX) * Mathf.num(result.isX()); + int y = lineStartY + i * Mathf.sign(tileY - lineStartY) * Mathf.num(!result.isX()); if(!checkOverlapPlacement(x, y, recipe.result) && validPlace(x, y, recipe.result, result.rotation)){ PlaceRequest request = new PlaceRequest(x * tilesize + recipe.result.offset(), y * tilesize + recipe.result.offset(), recipe, result.rotation); @@ -492,7 +497,7 @@ public class MobileInput extends InputHandler implements GestureListener{ if(tile == null) return false; - tryDropItems(tile.target(), Graphics.world(screenX, screenY).x, Graphics.world(screenX, screenY).y); + tryDropItems(tile.target(), Core.input.mouseWorld(screenX, screenY).x, Core.input.mouseWorld(screenX, screenY).y); } return false; } @@ -505,7 +510,7 @@ public class MobileInput extends InputHandler implements GestureListener{ Tile cursor = tileAt(x, y); //ignore off-screen taps - if(cursor == null || ui.hasMouse(x, y)) return false; + if(cursor == null || Core.scene.hasMouse(x, y)) return false; //remove request if it's there //long pressing enables line mode otherwise @@ -523,16 +528,16 @@ public class MobileInput extends InputHandler implements GestureListener{ } @Override - public boolean tap(float x, float y, int count, int button){ + public boolean tap(float x, float y, int count, KeyCode button){ if(state.is(State.menu) || lineMode) return false; - float worldx = Graphics.world(x, y).x, worldy = Graphics.world(x, y).y; + float worldx = Core.input.mouseWorld(x, y).x, worldy = Core.input.mouseWorld(x, y).y; //get tile on cursor Tile cursor = tileAt(x, y); //ignore off-screen taps - if(cursor == null || ui.hasMouse(x, y)) return false; + if(cursor == null || Core.scene.hasMouse(x, y)) return false; checkTargets(worldx, worldy); @@ -554,7 +559,7 @@ public class MobileInput extends InputHandler implements GestureListener{ consumed = true; player.dropCarry(); //drop off unit }else{ - Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight); + Unit unit = Units.getClosest(player.getTeam(), Core.input.mouseWorld(x, y).x, Core.input.mouseWorld(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight); if(unit != null){ consumed = true; @@ -615,8 +620,8 @@ public class MobileInput extends InputHandler implements GestureListener{ lineScale = Mathf.lerpDelta(lineScale, 1f, 0.1f); //When in line mode, pan when near screen edges automatically - if(Gdx.input.isTouched(0) && lineMode){ - float screenX = Graphics.mouse().x, screenY = Graphics.mouse().y; + if(Core.input.isTouched(0) && lineMode){ + float screenX = Core.input.mouseX(), screenY = Core.input.mouseY(); float panX = 0, panY = 0; @@ -624,19 +629,19 @@ public class MobileInput extends InputHandler implements GestureListener{ panX = -(edgePan - screenX); } - if(screenX >= Gdx.graphics.getWidth() - edgePan){ - panX = (screenX - Gdx.graphics.getWidth()) + edgePan; + if(screenX >= Core.graphics.getWidth() - edgePan){ + panX = (screenX - Core.graphics.getWidth()) + edgePan; } if(screenY <= edgePan){ panY = -(edgePan - screenY); } - if(screenY >= Gdx.graphics.getHeight() - edgePan){ - panY = (screenY - Gdx.graphics.getHeight()) + edgePan; + if(screenY >= Core.graphics.getHeight() - edgePan){ + panY = (screenY - Core.graphics.getHeight()) + edgePan; } - vector.set(panX, panY).scl((Core.camera.viewportWidth * Core.camera.zoom) / Gdx.graphics.getWidth()); + vector.set(panX, panY).scl((Core.camera.width ) / Core.graphics.getWidth()); vector.limit(maxPanSpeed); //pan view @@ -652,7 +657,7 @@ public class MobileInput extends InputHandler implements GestureListener{ PlaceRequest request = removals.get(i); if(request.scale <= 0.0001f){ - removals.removeIndex(i); + removals.remove(i); i--; } } @@ -661,65 +666,48 @@ public class MobileInput extends InputHandler implements GestureListener{ @Override public boolean pan(float x, float y, float deltaX, float deltaY){ if(!canPan) return false; + float scale = Core.camera.width / Core.graphics.getWidth(); + deltaX *= scale; + deltaY *= scale; //can't pan in line mode with one finger or while dropping items! - if((lineMode && !Gdx.input.isTouched(1)) || droppingItem){ + if((lineMode && !Core.input.isTouched(1)) || droppingItem){ return false; } - float dx = deltaX * Core.camera.zoom / Core.cameraScale, dy = deltaY * Core.camera.zoom / Core.cameraScale; - if(selecting){ //pan all requests for(PlaceRequest req : selection){ if(req.remove) continue; //don't shift removal requests - req.x += dx; - req.y -= dy; + req.x += deltaX; + req.y += deltaY; } }else{ //pan player - Core.camera.position.x -= dx; - Core.camera.position.y += dy; + Core.camera.position.x -= deltaX; + Core.camera.position.y -= deltaY; } return false; } - @Override - public boolean panStop(float x, float y, int pointer, int button){ - return false; - } - - @Override - public boolean pinch(Vector2 initialPointer1, Vector2 initialPointer2, Vector2 pointer1, Vector2 pointer2){ - return false; - } - @Override public boolean zoom(float initialDistance, float distance){ + if(lastDistance == -1) lastDistance = initialDistance; - if(Math.abs(distance - initialDistance) > io.anuke.ucore.scene.ui.layout.Unit.dp.scl(100f) && !zoomed){ - int amount = (distance > initialDistance ? 1 : -1); - renderer.scaleCamera(Math.round(io.anuke.ucore.scene.ui.layout.Unit.dp.scl(amount))); - zoomed = true; - return true; - } + float amount = (distance > lastDistance ? 0.07f : -0.07f) * Time.delta(); + renderer.scaleCamera(io.anuke.arc.scene.ui.layout.Unit.dp.scl(amount)); + lastDistance = distance; + return true; + } + @Override + public boolean touchDown(float x, float y, int pointer, KeyCode button){ + canPan = !Core.scene.hasMouse(); return false; } @Override - public void pinchStop(){ - zoomed = false; - } - - @Override - public boolean touchDown(float x, float y, int pointer, int button){ - canPan = !ui.hasMouse(); - return false; - } - - @Override - public boolean fling(float velocityX, float velocityY, int button){ + public boolean fling(float velocityX, float velocityY, KeyCode button){ return false; } @@ -753,4 +741,4 @@ public class MobileInput extends InputHandler implements GestureListener{ return world.tileWorld(x - (recipe == null ? 0 : recipe.result.offset()), y - (recipe == null ? 0 : recipe.result.offset())); } } -} \ No newline at end of file +} diff --git a/core/src/io/anuke/mindustry/input/PlaceUtils.java b/core/src/io/anuke/mindustry/input/PlaceUtils.java index b74b5b31a8..c2e3370eed 100644 --- a/core/src/io/anuke/mindustry/input/PlaceUtils.java +++ b/core/src/io/anuke/mindustry/input/PlaceUtils.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.input; import io.anuke.mindustry.world.Block; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.math.Mathf; import static io.anuke.mindustry.Vars.tilesize; diff --git a/core/src/io/anuke/mindustry/io/BundleLoader.java b/core/src/io/anuke/mindustry/io/BundleLoader.java index 53643dc81f..497d7f14cb 100644 --- a/core/src/io/anuke/mindustry/io/BundleLoader.java +++ b/core/src/io/anuke/mindustry/io/BundleLoader.java @@ -1,13 +1,12 @@ package io.anuke.mindustry.io; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.I18NBundle; +import io.anuke.arc.Core; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.util.I18NBundle; import io.anuke.mindustry.Vars; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.util.Log; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.Log; +import io.anuke.mindustry.input.Binding; import java.util.Locale; @@ -16,13 +15,14 @@ import static io.anuke.mindustry.Vars.headless; public class BundleLoader{ public static void load(){ - Settings.defaults("locale", "default"); - Settings.load(Vars.appName, headless ? "io.anuke.mindustry.server" : "io.anuke.mindustry"); + Core.settings.defaults("locale", "default"); + Core.keybinds.setDefaults(Binding.values()); + Core.settings.load(); loadBundle(); } private static Locale getLocale(){ - String loc = Settings.getString("locale"); + String loc = Core.settings.getString("locale"); if(loc.equals("default")){ return Locale.getDefault(); }else{ @@ -39,22 +39,21 @@ public class BundleLoader{ } private static void loadBundle(){ - I18NBundle.setExceptionOnMissingKey(false); try{ //try loading external bundle - FileHandle handle = Gdx.files.local("bundle"); + FileHandle handle = Core.files.local("bundle"); Locale locale = Locale.ENGLISH; Core.bundle = I18NBundle.createBundle(handle, locale); Log.info("NOTE: external translation bundle has been loaded."); if(!headless){ - Timers.run(10f, () -> Vars.ui.showInfo("Note: You have successfully loaded an external translation bundle.")); + Time.run(10f, () -> Vars.ui.showInfo("Note: You have successfully loaded an external translation bundle.")); } }catch(Throwable e){ //no external bundle found - FileHandle handle = Gdx.files.internal("bundles/bundle"); + FileHandle handle = Core.files.internal("bundles/bundle"); Locale locale = getLocale(); Locale.setDefault(locale); diff --git a/core/src/io/anuke/mindustry/io/Changelogs.java b/core/src/io/anuke/mindustry/io/Changelogs.java index e1b28c71ed..6dfcf6ce3c 100644 --- a/core/src/io/anuke/mindustry/io/Changelogs.java +++ b/core/src/io/anuke/mindustry/io/Changelogs.java @@ -1,10 +1,10 @@ package io.anuke.mindustry.io; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.JsonReader; -import com.badlogic.gdx.utils.JsonValue; +import io.anuke.arc.collection.Array; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.util.serialization.JsonReader; +import io.anuke.arc.util.serialization.JsonValue; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.function.Consumer; import static io.anuke.mindustry.Vars.releasesURL; diff --git a/core/src/io/anuke/mindustry/io/Contributors.java b/core/src/io/anuke/mindustry/io/Contributors.java index f7c6e0f4b1..9924e8e44c 100644 --- a/core/src/io/anuke/mindustry/io/Contributors.java +++ b/core/src/io/anuke/mindustry/io/Contributors.java @@ -1,10 +1,10 @@ package io.anuke.mindustry.io; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.JsonReader; -import com.badlogic.gdx.utils.JsonValue; +import io.anuke.arc.collection.Array; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.util.serialization.JsonReader; +import io.anuke.arc.util.serialization.JsonValue; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.function.Consumer; import static io.anuke.mindustry.Vars.contributorsURL; diff --git a/core/src/io/anuke/mindustry/io/MapIO.java b/core/src/io/anuke/mindustry/io/MapIO.java index 7dea904ef3..87e8c228ec 100644 --- a/core/src/io/anuke/mindustry/io/MapIO.java +++ b/core/src/io/anuke/mindustry/io/MapIO.java @@ -1,11 +1,13 @@ package io.anuke.mindustry.io; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.Pixmap; -import com.badlogic.gdx.graphics.Pixmap.Format; -import com.badlogic.gdx.utils.IntIntMap; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.ObjectMap.Entry; +import io.anuke.arc.collection.IntIntMap; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.collection.ObjectMap.Entry; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.Pixmap; +import io.anuke.arc.graphics.Pixmap.Format; +import io.anuke.arc.util.Pack; +import io.anuke.arc.util.Structs; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.StorageBlocks; import io.anuke.mindustry.game.Team; @@ -19,8 +21,6 @@ import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.ColorMapper; import io.anuke.mindustry.world.LegacyColorMapper; import io.anuke.mindustry.world.LegacyColorMapper.LegacyBlock; -import io.anuke.ucore.util.Bits; -import io.anuke.ucore.util.Structs; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -90,14 +90,14 @@ public class MapIO{ if(Structs.inBounds(worldx, worldy, pixmap.getWidth(), pixmap.getHeight())){ data.write(worldx, worldy, DataPosition.wall, Blocks.blockpart.id); - data.write(worldx, worldy, DataPosition.rotationTeam, Bits.packByte((byte)0, (byte)Team.blue.ordinal())); - data.write(worldx, worldy, DataPosition.link, Bits.packByte((byte) (dx - 1 + 8), (byte) (dy - 1 + 8))); + data.write(worldx, worldy, DataPosition.rotationTeam, Pack.byteByte((byte)0, (byte)Team.blue.ordinal())); + data.write(worldx, worldy, DataPosition.link, Pack.byteByte((byte) (dx - 1 + 8), (byte) (dy - 1 + 8))); } } } data.write(x, y, DataPosition.wall, StorageBlocks.core.id); - data.write(x, y, DataPosition.rotationTeam, Bits.packByte((byte)0, (byte)Team.blue.ordinal())); + data.write(x, y, DataPosition.rotationTeam, Pack.byteByte((byte)0, (byte)Team.blue.ordinal())); } } } diff --git a/core/src/io/anuke/mindustry/io/SaveFileVersion.java b/core/src/io/anuke/mindustry/io/SaveFileVersion.java index 0b4b40f5d2..73ad0f5ddb 100644 --- a/core/src/io/anuke/mindustry/io/SaveFileVersion.java +++ b/core/src/io/anuke/mindustry/io/SaveFileVersion.java @@ -1,6 +1,10 @@ package io.anuke.mindustry.io; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; +import io.anuke.arc.entities.Entities; +import io.anuke.arc.entities.EntityGroup; +import io.anuke.arc.entities.trait.Entity; +import io.anuke.arc.util.Pack; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.StorageBlocks; import io.anuke.mindustry.entities.traits.SaveTrait; @@ -13,10 +17,6 @@ import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.BlockPart; -import io.anuke.ucore.entities.Entities; -import io.anuke.ucore.entities.EntityGroup; -import io.anuke.ucore.entities.trait.Entity; -import io.anuke.ucore.util.Bits; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -59,7 +59,7 @@ public abstract class SaveFileVersion{ if(tile.block() instanceof BlockPart){ stream.writeByte(tile.link); }else if(tile.entity != null){ - stream.writeByte(Bits.packByte(tile.getTeamID(), tile.getRotation())); //team + rotation + stream.writeByte(Pack.byteByte(tile.getTeamID(), tile.getRotation())); //team + rotation stream.writeShort((short) tile.entity.health); //health if(tile.entity.items != null) tile.entity.items.write(stream); @@ -86,28 +86,6 @@ public abstract class SaveFileVersion{ i += consecutives; } } - - //write visibility, length-run encoded - for(int i = 0; i < world.width() * world.height(); i++){ - Tile tile = world.tile(i % world.width(), i / world.width()); - boolean discovered = tile.discovered(); - - int consecutives = 0; - - for(int j = i + 1; j < world.width() * world.height() && consecutives < 32767*2-1; j++){ - Tile nextTile = world.tile(j % world.width(), j / world.width()); - - if(nextTile.discovered() != discovered){ - break; - } - - consecutives++; - } - - stream.writeBoolean(discovered); - stream.writeShort(consecutives); - i += consecutives; - } } public void readMap(DataInputStream stream) throws IOException{ @@ -139,8 +117,8 @@ public abstract class SaveFileVersion{ byte tr = stream.readByte(); short health = stream.readShort(); - byte team = Bits.getLeftByte(tr); - byte rotation = Bits.getRightByte(tr); + byte team = Pack.leftByte(tr); + byte rotation = Pack.rightByte(tr); Team t = Team.all[team]; @@ -175,18 +153,6 @@ public abstract class SaveFileVersion{ tiles[x][y] = tile; } - for(int i = 0; i < width * height; i++){ - boolean discovered = stream.readBoolean(); - int consecutives = stream.readUnsignedShort(); - if(discovered){ - for(int j = i + 1; j < i + 1 + consecutives; j++){ - int newx = j % width, newy = j / width; - tiles[newx][newy].setVisibility((byte) 1); - } - } - i += consecutives; - } - content.setTemporaryMapper(null); world.endMapLoad(); } diff --git a/core/src/io/anuke/mindustry/io/SaveIO.java b/core/src/io/anuke/mindustry/io/SaveIO.java index c13fe96662..2248d056c4 100644 --- a/core/src/io/anuke/mindustry/io/SaveIO.java +++ b/core/src/io/anuke/mindustry/io/SaveIO.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.io; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntArray; -import com.badlogic.gdx.utils.IntMap; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.IntArray; +import io.anuke.arc.collection.IntMap; +import io.anuke.arc.files.FileHandle; import io.anuke.mindustry.Vars; import io.anuke.mindustry.io.versions.Save16; @@ -13,6 +13,7 @@ import java.util.zip.InflaterInputStream; import static io.anuke.mindustry.Vars.*; +//TODO load backup meta if possible public class SaveIO{ public static final IntArray breakingVersions = IntArray.with(47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 63); public static final IntMap versions = new IntMap<>(); @@ -65,9 +66,7 @@ public class SaveIO{ public static boolean isSaveValid(DataInputStream stream){ try{ - int version = stream.readInt(); - SaveFileVersion ver = versions.get(version); - ver.getData(stream); + getData(stream); return true; }catch(Exception e){ e.printStackTrace(); diff --git a/core/src/io/anuke/mindustry/io/SaveMeta.java b/core/src/io/anuke/mindustry/io/SaveMeta.java index 1abe1816e6..61e035a356 100644 --- a/core/src/io/anuke/mindustry/io/SaveMeta.java +++ b/core/src/io/anuke/mindustry/io/SaveMeta.java @@ -4,15 +4,12 @@ import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.maps.Map; -import java.text.SimpleDateFormat; -import java.util.Date; - import static io.anuke.mindustry.Vars.world; public class SaveMeta{ public int version; public int build; - public String date; + public long timestamp; public long timePlayed; public int sector; public GameMode mode; @@ -20,10 +17,10 @@ public class SaveMeta{ public int wave; public Difficulty difficulty; - public SaveMeta(int version, long date, long timePlayed, int build, int sector, int mode, String map, int wave, Difficulty difficulty){ + public SaveMeta(int version, long timestamp, long timePlayed, int build, int sector, int mode, String map, int wave, Difficulty difficulty){ this.version = version; this.build = build; - this.date = SimpleDateFormat.getDateTimeInstance().format(new Date(date)); + this.timestamp = timestamp; this.timePlayed = timePlayed; this.sector = sector; this.mode = GameMode.values()[mode]; diff --git a/core/src/io/anuke/mindustry/io/TypeIO.java b/core/src/io/anuke/mindustry/io/TypeIO.java index 2d0f9feb08..d2bcbb1270 100644 --- a/core/src/io/anuke/mindustry/io/TypeIO.java +++ b/core/src/io/anuke/mindustry/io/TypeIO.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.io; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.graphics.Color; import io.anuke.annotations.Annotations.ReadClass; import io.anuke.annotations.Annotations.WriteClass; import io.anuke.mindustry.entities.Player; @@ -20,9 +20,9 @@ import io.anuke.mindustry.type.*; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Pos; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.entities.Entities; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.entities.Entities; import java.io.DataInput; import java.io.DataOutput; diff --git a/core/src/io/anuke/mindustry/io/versions/Save16.java b/core/src/io/anuke/mindustry/io/versions/Save16.java index 7a4fc1e79e..551e3e798b 100644 --- a/core/src/io/anuke/mindustry/io/versions/Save16.java +++ b/core/src/io/anuke/mindustry/io/versions/Save16.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.io.versions; -import com.badlogic.gdx.utils.TimeUtils; +import io.anuke.arc.util.Time; import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.Version; @@ -56,7 +56,7 @@ public class Save16 extends SaveFileVersion{ public void write(DataOutputStream stream) throws IOException{ //--META-- stream.writeInt(version); //version id - stream.writeLong(TimeUtils.millis()); //last saved + stream.writeLong(Time.millis()); //last saved stream.writeLong(headless ? 0 : control.saves.getTotalPlaytime()); //playtime stream.writeInt(Version.build); //build stream.writeInt(world.getSector() == null ? invalidSector : world.getSector().pos()); //sector ID diff --git a/core/src/io/anuke/mindustry/maps/Map.java b/core/src/io/anuke/mindustry/maps/Map.java index 1ad60c0e1d..2481d42344 100644 --- a/core/src/io/anuke/mindustry/maps/Map.java +++ b/core/src/io/anuke/mindustry/maps/Map.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.maps; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.utils.ObjectMap; -import io.anuke.ucore.function.Supplier; +import io.anuke.arc.graphics.Texture; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.function.Supplier; import java.io.InputStream; diff --git a/core/src/io/anuke/mindustry/maps/MapMeta.java b/core/src/io/anuke/mindustry/maps/MapMeta.java index 2f13ee59b9..741bafada1 100644 --- a/core/src/io/anuke/mindustry/maps/MapMeta.java +++ b/core/src/io/anuke/mindustry/maps/MapMeta.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.maps; -import com.badlogic.gdx.utils.IntIntMap; -import com.badlogic.gdx.utils.ObjectMap; -import io.anuke.ucore.util.Bundles; +import io.anuke.arc.Core; +import io.anuke.arc.collection.IntIntMap; +import io.anuke.arc.collection.ObjectMap; public class MapMeta{ public final int version; @@ -31,7 +31,7 @@ public class MapMeta{ } public String tag(String name){ - return tags.containsKey(name) && !tags.get(name).trim().isEmpty() ? tags.get(name): Bundles.get("text.unknown"); + return tags.containsKey(name) && !tags.get(name).trim().isEmpty() ? tags.get(name): Core.bundle.get("text.unknown"); } public boolean hasOreGen(){ diff --git a/core/src/io/anuke/mindustry/maps/MapTileData.java b/core/src/io/anuke/mindustry/maps/MapTileData.java index e48b902032..25398e561b 100644 --- a/core/src/io/anuke/mindustry/maps/MapTileData.java +++ b/core/src/io/anuke/mindustry/maps/MapTileData.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.maps; -import com.badlogic.gdx.utils.IntIntMap; +import io.anuke.arc.collection.IntIntMap; +import io.anuke.arc.util.Pack; +import io.anuke.arc.util.Structs; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.world.Block; -import io.anuke.ucore.util.Bits; -import io.anuke.ucore.util.Structs; import java.nio.ByteBuffer; @@ -73,7 +73,7 @@ public class MapTileData{ if(Structs.inBounds(worldx, worldy, width, height) && !(dx + offsetx == 0 && dy + offsety == 0)){ write(worldx, worldy, DataPosition.wall, Blocks.blockpart.id); - write(worldx, worldy, DataPosition.link, Bits.packByte((byte) (dx + offsetx + 8), (byte) (dy + offsety + 8))); + write(worldx, worldy, DataPosition.link, Pack.byteByte((byte) (dx + offsetx + 8), (byte) (dy + offsety + 8))); } } } @@ -154,8 +154,8 @@ public class MapTileData{ link = buffer.get(); byte rt = buffer.get(); elevation = buffer.get(); - rotation = Bits.getLeftByte(rt); - team = Bits.getRightByte(rt); + rotation = Pack.leftByte(rt); + team = Pack.rightByte(rt); if(map != null){ floor = (byte) map.get(floor, Blocks.stone.id); @@ -168,7 +168,7 @@ public class MapTileData{ buffer.put(floor); buffer.put(wall); buffer.put(link); - buffer.put(Bits.packByte(rotation, team)); + buffer.put(Pack.byteByte(rotation, team)); buffer.put(elevation); } } diff --git a/core/src/io/anuke/mindustry/maps/Maps.java b/core/src/io/anuke/mindustry/maps/Maps.java index 74936f00f8..678920aa51 100644 --- a/core/src/io/anuke/mindustry/maps/Maps.java +++ b/core/src/io/anuke/mindustry/maps/Maps.java @@ -1,15 +1,14 @@ package io.anuke.mindustry.maps; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.Disposable; -import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.arc.Core; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.graphics.Texture; +import io.anuke.arc.collection.Array; +import io.anuke.arc.util.Disposable; +import io.anuke.arc.collection.ObjectMap; import io.anuke.mindustry.io.MapIO; -import io.anuke.ucore.function.Supplier; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.ThreadArray; +import io.anuke.arc.function.Supplier; +import io.anuke.arc.util.Log; import java.io.DataInputStream; import java.io.IOException; @@ -26,9 +25,9 @@ public class Maps implements Disposable{ /**Maps map names to the real maps.*/ private ObjectMap maps = new ObjectMap<>(); /**All maps stored in an ordered array.*/ - private Array allMaps = new ThreadArray<>(); + private Array allMaps = new Array<>(); /**Temporary array used for returning things.*/ - private Array returnArray = new ThreadArray<>(); + private Array returnArray = new Array<>(); /**Returns a list of all maps, including custom ones.*/ public Array all(){ @@ -62,7 +61,7 @@ public class Maps implements Disposable{ public void load(){ try { for (String name : defaultMapNames) { - FileHandle file = Gdx.files.internal("maps/" + name + "." + mapExtension); + FileHandle file = Core.files.internal("maps/" + name + "." + mapExtension); loadMap(file.nameWithoutExtension(), file::read, false); } }catch (IOException e){ diff --git a/core/src/io/anuke/mindustry/maps/Sector.java b/core/src/io/anuke/mindustry/maps/Sector.java index e184409ae1..e9d62a1d55 100644 --- a/core/src/io/anuke/mindustry/maps/Sector.java +++ b/core/src/io/anuke/mindustry/maps/Sector.java @@ -1,13 +1,13 @@ package io.anuke.mindustry.maps; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.utils.Array; import io.anuke.annotations.Annotations.Serialize; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.Texture; +import io.anuke.arc.util.Pack; import io.anuke.mindustry.game.Saves.SaveSlot; import io.anuke.mindustry.game.SpawnGroup; import io.anuke.mindustry.maps.missions.*; import io.anuke.mindustry.type.ItemStack; -import io.anuke.ucore.util.Bits; import static io.anuke.mindustry.Vars.control; import static io.anuke.mindustry.Vars.headless; @@ -56,7 +56,7 @@ public class Sector{ } public int getSeed(){ - return Bits.packInt(x, y); + return pos(); } public SaveSlot getSave(){ @@ -68,6 +68,6 @@ public class Sector{ } public int pos(){ - return Bits.packInt(x, y); + return Pack.shortInt(x, y); } } diff --git a/core/src/io/anuke/mindustry/maps/SectorPresets.java b/core/src/io/anuke/mindustry/maps/SectorPresets.java index 08fa7f1b19..c60115e2e2 100644 --- a/core/src/io/anuke/mindustry/maps/SectorPresets.java +++ b/core/src/io/anuke/mindustry/maps/SectorPresets.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.maps; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.GridMap; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.Mechs; @@ -12,8 +13,6 @@ import io.anuke.mindustry.content.blocks.UpgradeBlocks; import io.anuke.mindustry.entities.units.UnitCommand; import io.anuke.mindustry.maps.missions.*; import io.anuke.mindustry.type.Item; -import io.anuke.ucore.util.GridMap; -import io.anuke.ucore.util.Structs; import static io.anuke.mindustry.Vars.mobile; @@ -30,7 +29,7 @@ public class SectorPresets{ //command center mission add(new SectorPreset(0, 1, - Structs.array( + Array.ofRecursive( Missions.blockRecipe(UnitBlocks.daggerFactory), new UnitMission(UnitTypes.dagger), Missions.blockRecipe(UnitBlocks.commandCenter), @@ -42,7 +41,7 @@ public class SectorPresets{ //pad mission add(new SectorPreset(0, -2, - Structs.array( + Array.ofRecursive( Missions.blockRecipe(mobile ? UpgradeBlocks.alphaPad : UpgradeBlocks.dartPad), new MechMission(mobile ? Mechs.alpha : Mechs.dart), new WaveMission(15) @@ -51,7 +50,7 @@ public class SectorPresets{ //oil mission add(new SectorPreset(-2, 0, - Structs.array( + Array.ofRecursive( Missions.blockRecipe(ProductionBlocks.cultivator), Missions.blockRecipe(ProductionBlocks.waterExtractor), new ContentMission(Items.biomatter), diff --git a/core/src/io/anuke/mindustry/maps/Sectors.java b/core/src/io/anuke/mindustry/maps/Sectors.java index 0d94ff6d6b..98ca76e9b5 100644 --- a/core/src/io/anuke/mindustry/maps/Sectors.java +++ b/core/src/io/anuke/mindustry/maps/Sectors.java @@ -1,13 +1,18 @@ package io.anuke.mindustry.maps; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Pixmap; -import com.badlogic.gdx.graphics.Pixmap.Format; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.Array.ArrayIterable; -import com.badlogic.gdx.utils.async.AsyncExecutor; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.Array.ArrayIterable; +import io.anuke.arc.collection.GridMap; +import io.anuke.arc.graphics.Pixmap; +import io.anuke.arc.graphics.Pixmap.Format; +import io.anuke.arc.graphics.Texture; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Pack; +import io.anuke.arc.util.async.AsyncExecutor; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.Difficulty; @@ -27,8 +32,6 @@ import io.anuke.mindustry.type.Recipe.RecipeVisibility; import io.anuke.mindustry.world.ColorMapper; import io.anuke.mindustry.world.blocks.Floor; import io.anuke.mindustry.world.blocks.defense.Wall; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.util.*; import static io.anuke.mindustry.Vars.*; @@ -72,7 +75,7 @@ public class Sectors{ playSector(sector); if(!headless){ - threads.runGraphics(() -> ui.showError("$text.sector.corrupted")); + ui.showError("$text.sector.corrupted"); } } } @@ -83,7 +86,11 @@ public class Sectors{ } public Sector get(int position){ - return grid.get(Bits.getLeftShort(position), Bits.getRightShort(position)); + return grid.get(Pack.leftShort(position), Pack.rightShort(position)); + } + + public Iterable getSectors(){ + return grid.values(); } public Difficulty getDifficulty(Sector sector){ @@ -108,7 +115,7 @@ public class Sectors{ Sector sector = get(x, y); sector.complete = true; - for(GridPoint2 g : Geometry.d4){ + for(Point2 g : Geometry.d4){ createSector(x + g.x, y + g.y); } } @@ -127,7 +134,7 @@ public class Sectors{ grid.put(sector.x, sector.y, sector); if(sector.texture == null){ - threads.runGraphics(() -> createTexture(sector)); + createTexture(sector); } if(sector.missions.size == 0){ @@ -145,18 +152,19 @@ public class Sectors{ grid.put(sector.x, sector.y, sector); - threads.runGraphics(() -> createTexture(sector)); + createTexture(sector); save(); } + @SuppressWarnings("unchecked") public void load(){ for(Sector sector : grid.values()){ sector.texture.dispose(); } grid.clear(); - Array out = Settings.getObject("sector-data-2", Array.class, Array::new); + Array out = Core.settings.getObject("sector-data-2", Array.class, Array::new); for(Sector sector : out){ @@ -185,8 +193,8 @@ public class Sectors{ } } - Settings.putObject("sector-data-2", out); - Settings.save(); + Core.settings.putObject("sector-data-2", out); + Core.settings.save(); } private void initSector(Sector sector){ @@ -241,14 +249,14 @@ public class Sectors{ Generation gen = new Generation(sector, null, sectorSize, sectorSize, null); - Array points = new Array<>(); + Array points = new Array<>(); for(Mission mission : sector.missions){ points.addAll(mission.getSpawnPoints(gen)); } GenResult result = new GenResult(); - for(GridPoint2 point : new ArrayIterable<>(points)){ + for(Point2 point : new ArrayIterable<>(points)){ world.generator.generateTile(result, sector.x, sector.y, point.x, point.y, true, null, null); if(((Floor)result.floor).isLiquid || result.wall.solid){ sector.missions.clear(); @@ -302,7 +310,7 @@ public class Sectors{ } } - Gdx.app.postRunnable(() -> { + Core.app.post(() -> { sector.texture = new Texture(pixmap); pixmap.dispose(); }); diff --git a/core/src/io/anuke/mindustry/maps/TutorialSector.java b/core/src/io/anuke/mindustry/maps/TutorialSector.java index b597cc9ec0..436f0678c2 100644 --- a/core/src/io/anuke/mindustry/maps/TutorialSector.java +++ b/core/src/io/anuke/mindustry/maps/TutorialSector.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.maps; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.blocks.CraftingBlocks; import io.anuke.mindustry.content.blocks.ProductionBlocks; @@ -62,7 +62,7 @@ public class TutorialSector{ new BlockMission(ProductionBlocks.mechanicalDrill).setMessage("$tutorial.generatordrill"), new BlockMission(PowerBlocks.powerNode).setMessage("$tutorial.node"), //TODO fix positions - new ConditionMission(Bundles.get("text.mission.linknode"), () -> world.tile(54, 52).entity != null && world.tile(54, 52).entity.power != null && world.tile(54, 52).entity.power.amount >= 0.01f) + new ConditionMission(Core.bundle.get("text.mission.linknode"), () -> world.tile(54, 52).entity != null && world.tile(54, 52).entity.power != null && world.tile(54, 52).entity.power.amount >= 0.01f) .setMessage("$tutorial.nodelink"), new ItemMission(Items.silicon, 70).setMessage("$tutorial.silicon"), diff --git a/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java b/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java index def5cf1e0c..0b122d1f36 100644 --- a/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generation/FortressGenerator.java @@ -1,10 +1,14 @@ package io.anuke.mindustry.maps.generation; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntIntMap; -import com.badlogic.gdx.utils.Predicate; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.IntIntMap; +import io.anuke.arc.function.BiFunction; +import io.anuke.arc.function.IntPositionConsumer; +import io.anuke.arc.function.Predicate; +import io.anuke.arc.function.TriFunction; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.content.blocks.*; @@ -29,11 +33,6 @@ import io.anuke.mindustry.world.blocks.power.SolarGenerator; import io.anuke.mindustry.world.blocks.storage.CoreBlock; import io.anuke.mindustry.world.blocks.storage.StorageBlock; import io.anuke.mindustry.world.blocks.units.UnitFactory; -import io.anuke.ucore.function.BiFunction; -import io.anuke.ucore.function.IntPositionConsumer; -import io.anuke.ucore.function.TriFunction; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.content; @@ -83,11 +82,11 @@ public class FortressGenerator{ } TriFunction, Boolean> checker = (current, block, pred) -> { - for(GridPoint2 point : Edges.getEdges(block.size)){ + for(Point2 point : Edges.getEdges(block.size)){ Tile tile = gen.tile(current.x + point.x, current.y + point.y); if(tile != null){ tile = tile.target(); - if(tile.getTeamID() == team.ordinal() && pred.evaluate(tile)){ + if(tile.getTeamID() == team.ordinal() && pred.test(tile)){ return true; } } @@ -160,7 +159,7 @@ public class FortressGenerator{ (x, y) -> { if(!gen.canPlace(x, y, wall)) return; - for(GridPoint2 point : Geometry.d8){ + for(Point2 point : Geometry.d8){ Tile tile = gen.tile(x + point.x, y + point.y); if(tile != null){ tile = tile.target(); @@ -181,7 +180,7 @@ public class FortressGenerator{ Block block = tile.block(); if(block instanceof PowerTurret){ - tile.entity.power.amount = block.powerCapacity; + tile.entity.power.satisfaction = 1.0f; }else if(block instanceof ItemTurret){ ItemTurret turret = (ItemTurret)block; AmmoType[] type = turret.getAmmoTypes(); @@ -198,7 +197,7 @@ public class FortressGenerator{ for(IntPositionConsumer i : passes){ for(int x = 0; x < gen.width; x++){ for(int y = 0; y < gen.height; y++){ - if(Vector2.dst(x, y, enemyX, enemyY) > coreDst){ + if(Mathf.dst(x, y, enemyX, enemyY) > coreDst){ continue; } @@ -211,7 +210,7 @@ public class FortressGenerator{ Array find(Predicate pred){ Array out = new Array<>(); for(Block block : content.blocks()){ - if(pred.evaluate(block) && Recipe.getByResult(block) != null){ + if(pred.test(block) && Recipe.getByResult(block) != null){ out.add(block); } } diff --git a/core/src/io/anuke/mindustry/maps/generation/Generation.java b/core/src/io/anuke/mindustry/maps/generation/Generation.java index 3929a160ad..9b94229acb 100644 --- a/core/src/io/anuke/mindustry/maps/generation/Generation.java +++ b/core/src/io/anuke/mindustry/maps/generation/Generation.java @@ -1,21 +1,21 @@ package io.anuke.mindustry.maps.generation; +import io.anuke.arc.math.RandomXS128; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.Sector; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.production.Drill; -import io.anuke.ucore.util.Structs; -import io.anuke.ucore.util.SeedRandom; +import io.anuke.arc.util.Structs; public class Generation{ public final Sector sector; public final Tile[][] tiles; public final int width, height; - public final SeedRandom random; + public final RandomXS128 random; - public Generation(Sector sector, Tile[][] tiles, int width, int height, SeedRandom random){ + public Generation(Sector sector, Tile[][] tiles, int width, int height, RandomXS128 random){ this.sector = sector; this.tiles = tiles; this.width = width; diff --git a/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java b/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java index 8686b6c80d..d397cd83c5 100644 --- a/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java @@ -1,10 +1,15 @@ package io.anuke.mindustry.maps.generation; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntArray; -import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.IntArray; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.RandomXS128; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.util.Structs; +import io.anuke.arc.util.noise.RidgedPerlin; +import io.anuke.arc.util.noise.Simplex; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.content.blocks.OreBlocks; @@ -21,12 +26,6 @@ import io.anuke.mindustry.world.Pos; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.Floor; import io.anuke.mindustry.world.blocks.OreBlock; -import io.anuke.ucore.noise.RidgedPerlin; -import io.anuke.ucore.noise.Simplex; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.SeedRandom; -import io.anuke.ucore.util.Structs; import static io.anuke.mindustry.Vars.*; @@ -39,13 +38,13 @@ public class WorldGenerator{ private Simplex sim2 = new Simplex(baseSeed + 1); private Simplex sim3 = new Simplex(baseSeed + 2); private RidgedPerlin rid = new RidgedPerlin(baseSeed + 4, 1); - private SeedRandom random = new SeedRandom(baseSeed + 3); + private RandomXS128 random = new RandomXS128(baseSeed + 3); private GenResult result = new GenResult(); private ObjectMap decoration; public WorldGenerator(){ - decoration = Structs.map( + decoration = ObjectMap.of( Blocks.grass, Blocks.shrub, Blocks.stone, Blocks.rock, Blocks.ice, Blocks.icerock, @@ -149,15 +148,15 @@ public class WorldGenerator{ int sy = (short)Mathf.range(Short.MAX_VALUE/2); int width = 380; int height = 380; - Array spawns = new Array<>(); + Array spawns = new Array<>(); Array ores = Item.getAllOres(); if(state.mode.isPvp){ int scaling = 10; - spawns.add(new GridPoint2(width/scaling, height/scaling)); - spawns.add(new GridPoint2(width - 1 - width/scaling, height - 1 - height/scaling)); + spawns.add(new Point2(width/scaling, height/scaling)); + spawns.add(new Point2(width - 1 - width/scaling, height - 1 - height/scaling)); }else{ - spawns.add(new GridPoint2(width/2, height/2)); + spawns.add(new Point2(width/2, height/2)); } Tile[][] tiles = world.createTiles(width, height); @@ -179,7 +178,7 @@ public class WorldGenerator{ byte elevation = tile.getElevation(); - for(GridPoint2 point : Geometry.d4){ + for(Point2 point : Geometry.d4){ if(!Structs.inBounds(x + point.x, y + point.y, width, height)) continue; if(tiles[x + point.x][y + point.y].getElevation() < elevation){ @@ -220,7 +219,7 @@ public class WorldGenerator{ ores.addAll(baseOres); }else{ for(Item item : usedOres){ - ores.add(baseOres.select(entry -> entry.item == item).iterator().next()); + ores.add(baseOres.find(entry -> entry.item == item)); } } @@ -249,9 +248,9 @@ public class WorldGenerator{ public void generateMap(Tile[][] tiles, Sector sector){ int width = tiles.length, height = tiles[0].length; - SeedRandom rnd = new SeedRandom(sector.getSeed()); + RandomXS128 rnd = new RandomXS128(sector.getSeed()); Generation gena = new Generation(sector, tiles, tiles.length, tiles[0].length, rnd); - Array spawnpoints = sector.currentMission().getSpawnPoints(gena); + Array spawnpoints = sector.currentMission().getSpawnPoints(gena); Array ores = world.sectors.getOres(sector.x, sector.y); for(int x = 0; x < width; x++){ @@ -268,7 +267,7 @@ public class WorldGenerator{ byte elevation = tile.getElevation(); - for(GridPoint2 point : Geometry.d4){ + for(Point2 point : Geometry.d4){ if(!Structs.inBounds(x + point.x, y + point.y, width, height)) continue; if(tiles[x + point.x][y + point.y].getElevation() < elevation){ @@ -317,7 +316,7 @@ public class WorldGenerator{ * @param spawnpoints list of player spawnpoints, can be null * @return the GenResult passed in with its values modified */ - public GenResult generateTile(GenResult result, int sectorX, int sectorY, int localX, int localY, boolean detailed, Array spawnpoints, Array ores){ + public GenResult generateTile(GenResult result, int sectorX, int sectorY, int localX, int localY, boolean detailed, Array spawnpoints, Array ores){ int x = sectorX * sectorSize + localX + Short.MAX_VALUE; int y = sectorY * sectorSize + localY + Short.MAX_VALUE; @@ -338,8 +337,8 @@ public class WorldGenerator{ float minDst = Float.MAX_VALUE; if(detailed && spawnpoints != null){ - for(GridPoint2 p : spawnpoints){ - float dst = Vector2.dst2(p.x, p.y, localX, localY); + for(Point2 p : spawnpoints){ + float dst = Mathf.dst2(p.x, p.y, localX, localY); minDst = Math.min(minDst, dst); if(dst < lerpDst){ diff --git a/core/src/io/anuke/mindustry/maps/missions/ActionMission.java b/core/src/io/anuke/mindustry/maps/missions/ActionMission.java index 55710aa1ff..8b89eabd1e 100644 --- a/core/src/io/anuke/mindustry/maps/missions/ActionMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/ActionMission.java @@ -1,8 +1,6 @@ package io.anuke.mindustry.maps.missions; -import io.anuke.ucore.util.Bundles; - -import static io.anuke.mindustry.Vars.threads; +import io.anuke.arc.Core; /**A mission which simply runs a single action and is completed instantly.*/ public class ActionMission extends Mission{ @@ -17,7 +15,7 @@ public class ActionMission extends Mission{ @Override public void onComplete(){ - threads.run(runner); + runner.run(); } @Override @@ -27,6 +25,6 @@ public class ActionMission extends Mission{ @Override public String displayString(){ - return Bundles.get("text.loading"); + return Core.bundle.get("text.loading"); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/BattleMission.java b/core/src/io/anuke/mindustry/maps/missions/BattleMission.java index e1f5bc5614..dd3f0c84ee 100644 --- a/core/src/io/anuke/mindustry/maps/missions/BattleMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/BattleMission.java @@ -1,16 +1,17 @@ package io.anuke.mindustry.maps.missions; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.math.geom.Point2; import io.anuke.mindustry.Vars; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.generation.FortressGenerator; import io.anuke.mindustry.maps.generation.Generation; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.util.Bundles; -import static io.anuke.mindustry.Vars.*; +import static io.anuke.mindustry.Vars.defaultTeam; +import static io.anuke.mindustry.Vars.state; public class BattleMission extends MissionWithStartingCore{ final int spacing = 30; @@ -43,12 +44,12 @@ public class BattleMission extends MissionWithStartingCore{ @Override public String displayString(){ - return Bundles.get("text.mission.battle"); + return Core.bundle.get("text.mission.battle"); } @Override - public Array getSpawnPoints(Generation gen){ - return Array.with(new GridPoint2(50, 50), new GridPoint2(gen.width - 1 - spacing, gen.height - 1 - spacing)); + public Array getSpawnPoints(Generation gen){ + return Array.with(new Point2(50, 50), new Point2(gen.width - 1 - spacing, gen.height - 1 - spacing)); } @Override diff --git a/core/src/io/anuke/mindustry/maps/missions/BlockLocMission.java b/core/src/io/anuke/mindustry/maps/missions/BlockLocMission.java index 00a596e81a..2929e86e4a 100644 --- a/core/src/io/anuke/mindustry/maps/missions/BlockLocMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/BlockLocMission.java @@ -1,17 +1,15 @@ package io.anuke.mindustry.maps.missions; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Time; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.world.Block; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Mathf; -import static io.anuke.mindustry.Vars.players; -import static io.anuke.mindustry.Vars.tilesize; -import static io.anuke.mindustry.Vars.world; +import static io.anuke.mindustry.Vars.*; public class BlockLocMission extends Mission{ private final Block block; @@ -36,26 +34,26 @@ public class BlockLocMission extends Mission{ Lines.stroke(2f); Draw.color(Palette.accentBack); - Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset() - 1f, block.size * tilesize/2f + 1f+ Mathf.absin(Timers.time(), 6f, 2f)); + Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset() - 1f, block.size * tilesize/2f + 1f+ Mathf.absin(Time.time(), 6f, 2f)); Draw.color(Palette.accent); - Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset(), block.size * tilesize/2f + 1f+ Mathf.absin(Timers.time(), 6f, 2f)); + Lines.square(x * tilesize + block.offset(), y * tilesize + block.offset(), block.size * tilesize/2f + 1f+ Mathf.absin(Time.time(), 6f, 2f)); if(block.rotate){ Draw.colorl(0.4f); - Draw.rect("icon-arrow", x * tilesize + block.offset(), y * tilesize + block.offset() - 1f, rotation*90); + Draw.rect(Core.atlas.find("icon-arrow"), x * tilesize + block.offset(), y * tilesize + block.offset() - 1f, rotation*90); Draw.colorl(0.6f); - Draw.rect("icon-arrow", x * tilesize + block.offset(), y * tilesize + block.offset(), rotation*90); + Draw.rect(Core.atlas.find("icon-arrow"), x * tilesize + block.offset(), y * tilesize + block.offset(), rotation*90); } float rot = players[0].angleTo(x * tilesize + block.offset(), y * tilesize + block.offset()); float len = 12f; Draw.color(Palette.accentBack); - Draw.rect("icon-arrow", players[0].x + Angles.trnsx(rot, len), players[0].y + Angles.trnsy(rot, len), rot); + Draw.rect(Core.atlas.find("icon-arrow"), players[0].x + Angles.trnsx(rot, len), players[0].y + Angles.trnsy(rot, len), rot); Draw.color(Palette.accent); - Draw.rect("icon-arrow", players[0].x + Angles.trnsx(rot, len), players[0].y + Angles.trnsy(rot, len) + 1f, rot); + Draw.rect(Core.atlas.find("icon-arrow"), players[0].x + Angles.trnsx(rot, len), players[0].y + Angles.trnsy(rot, len) + 1f, rot); Draw.reset(); } @@ -67,6 +65,6 @@ public class BlockLocMission extends Mission{ @Override public String displayString(){ - return Bundles.format("text.mission.block", block.formalName); + return Core.bundle.format("text.mission.block", block.formalName); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/CommandMission.java b/core/src/io/anuke/mindustry/maps/missions/CommandMission.java index a25f5e04f5..51fdb65831 100644 --- a/core/src/io/anuke/mindustry/maps/missions/CommandMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/CommandMission.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.maps.missions; +import io.anuke.arc.Core; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.UnitCommand; -import io.anuke.ucore.util.Bundles; public class CommandMission extends Mission{ private final UnitCommand command; @@ -24,6 +24,6 @@ public class CommandMission extends Mission{ @Override public String displayString(){ - return Bundles.format("text.mission.command", command.localized()); + return Core.bundle.format("text.mission.command", command.localized()); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/ConditionMission.java b/core/src/io/anuke/mindustry/maps/missions/ConditionMission.java index 68e141633b..1926b44229 100644 --- a/core/src/io/anuke/mindustry/maps/missions/ConditionMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/ConditionMission.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.maps.missions; -import io.anuke.ucore.function.BooleanProvider; +import io.anuke.arc.function.BooleanProvider; public class ConditionMission extends Mission{ private final BooleanProvider complete; diff --git a/core/src/io/anuke/mindustry/maps/missions/ContentMission.java b/core/src/io/anuke/mindustry/maps/missions/ContentMission.java index c4a85afd26..9b78064802 100644 --- a/core/src/io/anuke/mindustry/maps/missions/ContentMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/ContentMission.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.maps.missions; +import io.anuke.arc.Core; import io.anuke.mindustry.game.UnlockableContent; -import io.anuke.ucore.util.Bundles; public class ContentMission extends Mission { private final UnlockableContent content; @@ -30,6 +30,6 @@ public class ContentMission extends Mission { @Override public String displayString() { - return Bundles.format("text.mission.create", content.localizedName()); + return Core.bundle.format("text.mission.create", content.localizedName()); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/ItemMission.java b/core/src/io/anuke/mindustry/maps/missions/ItemMission.java index a65eb4bc31..071e3ca447 100644 --- a/core/src/io/anuke/mindustry/maps/missions/ItemMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/ItemMission.java @@ -1,10 +1,10 @@ package io.anuke.mindustry.maps.missions; +import io.anuke.arc.Core; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.util.Bundles; import static io.anuke.mindustry.Vars.state; @@ -32,11 +32,11 @@ public class ItemMission extends Mission{ public String displayString(){ TileEntity core = Vars.players[0].getClosestCore(); if(core == null) return "imminent doom"; - return Bundles.format("text.mission.resource", item.localizedName(), core.items.get(item), amount); + return Core.bundle.format("text.mission.resource", item.localizedName(), core.items.get(item), amount); } @Override public String menuDisplayString(){ - return Bundles.format("text.mission.resource.menu", item.localizedName(), amount); + return Core.bundle.format("text.mission.resource.menu", item.localizedName(), amount); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/LineBlockMission.java b/core/src/io/anuke/mindustry/maps/missions/LineBlockMission.java index 918788b55c..83a8f99822 100644 --- a/core/src/io/anuke/mindustry/maps/missions/LineBlockMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/LineBlockMission.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.maps.missions; -import com.badlogic.gdx.math.Bresenham2; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; +import io.anuke.arc.math.geom.Bresenham2; +import io.anuke.arc.math.geom.Point2; import io.anuke.mindustry.world.Block; public class LineBlockMission extends Mission{ @@ -10,8 +10,8 @@ public class LineBlockMission extends Mission{ private int completeIndex; public LineBlockMission(Block block, int x1, int y1, int x2, int y2, int rotation){ - Array points = new Bresenham2().line(x1, y1, x2, y2); - for(GridPoint2 point : points){ + Array points = new Bresenham2().line(x1, y1, x2, y2); + for(Point2 point : points){ this.points.add(new BlockLocMission(block, point.x, point.y, rotation)); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/MechMission.java b/core/src/io/anuke/mindustry/maps/missions/MechMission.java index f59710a698..36bfe0a952 100644 --- a/core/src/io/anuke/mindustry/maps/missions/MechMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/MechMission.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.maps.missions; +import io.anuke.arc.Core; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.type.Mech; -import io.anuke.ucore.util.Bundles; public class MechMission extends Mission{ private final Mech mech; @@ -24,6 +24,6 @@ public class MechMission extends Mission{ @Override public String displayString(){ - return Bundles.format("text.mission.mech", mech.localizedName()); + return Core.bundle.format("text.mission.mech", mech.localizedName()); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/Mission.java b/core/src/io/anuke/mindustry/maps/missions/Mission.java index eba443be21..ebf91d81ab 100644 --- a/core/src/io/anuke/mindustry/maps/missions/Mission.java +++ b/core/src/io/anuke/mindustry/maps/missions/Mission.java @@ -1,17 +1,18 @@ package io.anuke.mindustry.maps.missions; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Time; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.SpawnGroup; import io.anuke.mindustry.game.UnlockableContent; import io.anuke.mindustry.maps.Sector; import io.anuke.mindustry.maps.generation.Generation; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; -import static io.anuke.mindustry.Vars.*; +import static io.anuke.mindustry.Vars.headless; +import static io.anuke.mindustry.Vars.ui; public abstract class Mission{ private String extraMessage; @@ -76,12 +77,12 @@ public abstract class Mission{ } public void onBegin(){ - Timers.runTask(60f, this::showMessage); + Time.runTask(60f, this::showMessage); } public void onComplete(){ if(showComplete && !headless){ - threads.runGraphics(() -> ui.hudfrag.showToast("[LIGHT_GRAY]"+menuDisplayString() + ":\n" + Bundles.get("text.mission.complete"))); + ui.hudfrag.showToast("[LIGHT_GRAY]"+menuDisplayString() + ":\n" + Core.bundle.get("text.mission.complete")); } } @@ -93,7 +94,7 @@ public abstract class Mission{ return new Array<>(); } - public Array getSpawnPoints(Generation gen){ + public Array getSpawnPoints(Generation gen){ return Array.with(); } diff --git a/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java b/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java index a134891329..24a086d02a 100644 --- a/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java +++ b/core/src/io/anuke/mindustry/maps/missions/MissionWithStartingCore.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.maps.missions; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.collection.Array; import io.anuke.mindustry.content.blocks.StorageBlocks; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.generation.Generation; @@ -11,7 +11,7 @@ import static io.anuke.mindustry.Vars.state; public abstract class MissionWithStartingCore extends Mission{ /** Stores a custom starting location for the core, or null if the default calculation (map center) shall be used. */ - private final GridPoint2 customStartingPoint; + private final Point2 customStartingPoint; /** Default constructor. Missions created this way will have a player starting core in the center of the map. */ MissionWithStartingCore(){ @@ -24,7 +24,7 @@ public abstract class MissionWithStartingCore extends Mission{ * @param yCorePos The y coordinate of the custom core position. */ MissionWithStartingCore(int xCorePos, int yCorePos){ - this.customStartingPoint = new GridPoint2(xCorePos, yCorePos); + this.customStartingPoint = new Point2(xCorePos, yCorePos); } /** @@ -33,7 +33,7 @@ public abstract class MissionWithStartingCore extends Mission{ * @param team The team to generate the core for. */ public void generateCoreAtFirstSpawnPoint(Generation gen, Team team){ - Array spawnPoints = getSpawnPoints(gen); + Array spawnPoints = getSpawnPoints(gen); if(spawnPoints == null || spawnPoints.size == 0){ throw new IllegalArgumentException("A MissionWithStartingCore subclass did not provide a spawn point in getSpawnPoints(). However, at least one point must always be provided."); } @@ -58,9 +58,9 @@ public abstract class MissionWithStartingCore extends Mission{ * @implNote Must return an array with at least one entry. */ @Override - public Array getSpawnPoints(Generation gen){ + public Array getSpawnPoints(Generation gen){ if(this.customStartingPoint == null){ - return Array.with(new GridPoint2(gen.width / 2, gen.height / 2)); + return Array.with(new Point2(gen.width / 2, gen.height / 2)); }else{ return Array.with(this.customStartingPoint); } diff --git a/core/src/io/anuke/mindustry/maps/missions/Missions.java b/core/src/io/anuke/mindustry/maps/missions/Missions.java index bc0b139185..871422a528 100644 --- a/core/src/io/anuke/mindustry/maps/missions/Missions.java +++ b/core/src/io/anuke/mindustry/maps/missions/Missions.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.maps.missions; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.world.Block; diff --git a/core/src/io/anuke/mindustry/maps/missions/UnitMission.java b/core/src/io/anuke/mindustry/maps/missions/UnitMission.java index efe097a687..8e63dd98d9 100644 --- a/core/src/io/anuke/mindustry/maps/missions/UnitMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/UnitMission.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.maps.missions; +import io.anuke.arc.Core; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.UnitType; -import io.anuke.ucore.util.Bundles; public class UnitMission extends Mission{ private final UnitType type; @@ -24,6 +24,6 @@ public class UnitMission extends Mission{ @Override public String displayString(){ - return Bundles.format("text.mission.unit", type.localizedName()); + return Core.bundle.format("text.mission.unit", type.localizedName()); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/VictoryMission.java b/core/src/io/anuke/mindustry/maps/missions/VictoryMission.java index 46b6153dff..8a4851190b 100644 --- a/core/src/io/anuke/mindustry/maps/missions/VictoryMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/VictoryMission.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.maps.missions; import io.anuke.mindustry.game.GameMode; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.layout.Table; public class VictoryMission extends Mission{ @Override diff --git a/core/src/io/anuke/mindustry/maps/missions/WaveMission.java b/core/src/io/anuke/mindustry/maps/missions/WaveMission.java index e31120af00..545422f4df 100644 --- a/core/src/io/anuke/mindustry/maps/missions/WaveMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/WaveMission.java @@ -1,13 +1,13 @@ package io.anuke.mindustry.maps.missions; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.SpawnGroup; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.game.Waves; import io.anuke.mindustry.maps.Sector; import io.anuke.mindustry.maps.generation.Generation; -import io.anuke.ucore.util.Bundles; import static io.anuke.mindustry.Vars.*; @@ -59,16 +59,16 @@ public class WaveMission extends MissionWithStartingCore{ @Override public String displayString(){ return state.wave > target ? - Bundles.format( + Core.bundle.format( state.enemies() > 1 ? "text.mission.wave.enemies" : "text.mission.wave.enemy", target, target, state.enemies()) : - Bundles.format("text.mission.wave", state.wave, target, (int)(state.wavetime/60)); + Core.bundle.format("text.mission.wave", state.wave, target, (int)(state.wavetime/60)); } @Override public String menuDisplayString(){ - return Bundles.format("text.mission.wave.menu", target); + return Core.bundle.format("text.mission.wave.menu", target); } @Override diff --git a/core/src/io/anuke/mindustry/net/Administration.java b/core/src/io/anuke/mindustry/net/Administration.java index 73164c91fe..5d6745699b 100644 --- a/core/src/io/anuke/mindustry/net/Administration.java +++ b/core/src/io/anuke/mindustry/net/Administration.java @@ -1,10 +1,10 @@ package io.anuke.mindustry.net; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.ObjectSet; import io.anuke.annotations.Annotations.Serialize; -import io.anuke.ucore.core.Settings; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.collection.ObjectSet; import static io.anuke.mindustry.Vars.headless; @@ -15,7 +15,7 @@ public class Administration{ private Array bannedIPs = new Array<>(); public Administration(){ - Settings.defaultList( + Core.settings.defaults( "strict", true ); @@ -23,21 +23,21 @@ public class Administration{ } public void setStrict(boolean on){ - Settings.putBool("strict", on); - Settings.save(); + Core.settings.put("strict", on); + Core.settings.save(); } public boolean getStrict(){ - return Settings.getBool("strict"); + return Core.settings.getBool("strict"); } public boolean allowsCustomClients(){ - return Settings.getBool("allow-custom", !headless); + return Core.settings.getBool("allow-custom", !headless); } public void setCustomClients(boolean allowed){ - Settings.putBool("allow-custom", allowed); - Settings.save(); + Core.settings.put("allow-custom", allowed); + Core.settings.save(); } /**Call when a player joins to update their information here.*/ @@ -256,14 +256,15 @@ public class Administration{ } public void save(){ - Settings.putObject("player-info", playerInfo); - Settings.putObject("banned-ips", bannedIPs); - Settings.save(); + Core.settings.putObject("player-info", playerInfo); + Core.settings.putObject("banned-ips", bannedIPs); + Core.settings.save(); } + @SuppressWarnings("unchecked") private void load(){ - playerInfo = Settings.getObject("player-info", ObjectMap.class, ObjectMap::new); - bannedIPs = Settings.getObject("banned-ips", Array.class, Array::new); + playerInfo = Core.settings.getObject("player-info", ObjectMap.class, ObjectMap::new); + bannedIPs = Core.settings.getObject("banned-ips", Array.class, Array::new); } @Serialize diff --git a/core/src/io/anuke/mindustry/net/Interpolator.java b/core/src/io/anuke/mindustry/net/Interpolator.java index b184875d88..d4590ecec3 100644 --- a/core/src/io/anuke/mindustry/net/Interpolator.java +++ b/core/src/io/anuke/mindustry/net/Interpolator.java @@ -1,9 +1,8 @@ package io.anuke.mindustry.net; - -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.TimeUtils; -import io.anuke.ucore.util.Mathf; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.util.Time; public class Interpolator{ //used for movement @@ -16,10 +15,10 @@ public class Interpolator{ public Vector2 pos = new Vector2(); public float[] values = {}; - public void read(float cx, float cy, float x, float y, long sent, float... target1ds){ - if(lastUpdated != 0) updateSpacing = TimeUtils.timeSinceMillis(lastUpdated); + public void read(float cx, float cy, float x, float y, float... target1ds){ + if(lastUpdated != 0) updateSpacing = Time.timeSinceMillis(lastUpdated); - lastUpdated = TimeUtils.millis(); + lastUpdated = Time.millis(); targets = target1ds; last.set(cx, cy); @@ -46,10 +45,10 @@ public class Interpolator{ }*/ if(lastUpdated != 0 && updateSpacing != 0){ - float timeSinceUpdate = TimeUtils.timeSinceMillis(lastUpdated); + float timeSinceUpdate = Time.timeSinceMillis(lastUpdated); float alpha = Math.min(timeSinceUpdate / updateSpacing, 2f); - Mathf.lerp2(pos.set(last), target, alpha); + pos.set(last).lerpPast(target, alpha); if(values.length != targets.length){ values = new float[targets.length]; diff --git a/core/src/io/anuke/mindustry/net/Net.java b/core/src/io/anuke/mindustry/net/Net.java index 0e152cb18e..3fa7b6ce8d 100644 --- a/core/src/io/anuke/mindustry/net/Net.java +++ b/core/src/io/anuke/mindustry/net/Net.java @@ -1,35 +1,36 @@ package io.anuke.mindustry.net; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Net.HttpRequest; -import com.badlogic.gdx.Net.HttpResponse; -import com.badlogic.gdx.Net.HttpResponseListener; -import com.badlogic.gdx.net.HttpRequestBuilder; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.IntMap; -import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.arc.Core; +import io.anuke.arc.Net.HttpRequest; +import io.anuke.arc.Net.HttpResponse; +import io.anuke.arc.Net.HttpResponseListener; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.IntMap; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.function.BiConsumer; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.net.HttpRequestBuilder; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.net.Packets.KickReason; import io.anuke.mindustry.net.Packets.StreamBegin; import io.anuke.mindustry.net.Packets.StreamChunk; import io.anuke.mindustry.net.Streamable.StreamBuilder; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.function.BiConsumer; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Pooling; import java.io.IOException; +import java.nio.BufferOverflowException; +import java.nio.BufferUnderflowException; import static io.anuke.mindustry.Vars.*; +@SuppressWarnings("unchecked") public class Net{ private static boolean server; private static boolean active; private static boolean clientLoaded; - private static String lastIP; private static Array packetQueue = new Array<>(); private static ObjectMap, Consumer> clientListeners = new ObjectMap<>(); private static ObjectMap, BiConsumer> serverListeners = new ObjectMap<>(); @@ -59,21 +60,23 @@ public class Net{ String error = t.getMessage() == null ? "" : t.getMessage().toLowerCase(); String type = t.getClass().toString().toLowerCase(); - if(error.equals("mismatch")){ - error = Bundles.get("text.error.mismatch"); + if(e instanceof BufferUnderflowException || e instanceof BufferOverflowException){ + error = Core.bundle.get("text.error.io"); + }else if(error.equals("mismatch")){ + error = Core.bundle.get("text.error.mismatch"); }else if(error.contains("port out of range") || error.contains("invalid argument") || (error.contains("invalid") && error.contains("address"))){ - error = Bundles.get("text.error.invalidaddress"); + error = Core.bundle.get("text.error.invalidaddress"); }else if(error.contains("connection refused") || error.contains("route to host") || type.contains("unknownhost")){ - error = Bundles.get("text.error.unreachable"); + error = Core.bundle.get("text.error.unreachable"); }else if(type.contains("timeout")){ - error = Bundles.get("text.error.timedout"); + error = Core.bundle.get("text.error.timedout"); }else if(error.equals("alreadyconnected")){ - error = Bundles.get("text.error.alreadyconnected"); + error = Core.bundle.get("text.error.alreadyconnected"); }else if(!error.isEmpty()){ - error = Bundles.get("text.error.any"); + error = Core.bundle.get("text.error.any"); } - ui.showText("", Bundles.format("text.connectfail", error)); + ui.showText("", Core.bundle.format("text.connectfail", error)); ui.loadfrag.hide(); if(Net.client()){ @@ -106,7 +109,6 @@ public class Net{ */ public static void connect(String ip, int port, Runnable success){ try{ - lastIP = ip + ":" + port; if(!active){ clientProvider.connect(ip, port, success); active = true; @@ -119,11 +121,6 @@ public class Net{ } } - /**Returns the last IP connected to.*/ - public static String getLastIP() { - return lastIP; - } - /** * Host a server at an address. */ @@ -132,7 +129,7 @@ public class Net{ active = true; server = true; - Timers.runTask(60f, Platform.instance::updateRPC); + Time.runTask(60f, Platform.instance::updateRPC); } /** @@ -268,12 +265,12 @@ public class Net{ if(clientLoaded || ((object instanceof Packet) && ((Packet) object).isImportant())){ if(clientListeners.get(object.getClass()) != null) clientListeners.get(object.getClass()).accept(object); - Pooling.free(object); + Pools.free(object); }else if(!((object instanceof Packet) && ((Packet) object).isUnimportant())){ packetQueue.add(object); Log.info("Queuing packet {0}", object); }else{ - Pooling.free(object); + Pools.free(object); } }else{ Log.err("Unhandled packet type: '{0}'!", object); @@ -288,7 +285,7 @@ public class Net{ if(serverListeners.get(object.getClass()) != null){ if(serverListeners.get(object.getClass()) != null) serverListeners.get(object.getClass()).accept(connection, object); - Pooling.free(object); + Pools.free(object); }else{ Log.err("Unhandled packet type: '{0}'!", object.getClass()); } @@ -353,7 +350,7 @@ public class Net{ HttpRequest req = new HttpRequestBuilder().newRequest() .method(method).url(url).content(body).build(); - Gdx.net.sendHttpRequest(req, new HttpResponseListener(){ + Core.net.sendHttpRequest(req, new HttpResponseListener(){ @Override public void handleHttpResponse(HttpResponse httpResponse){ listener.accept(httpResponse.getResultAsString()); diff --git a/core/src/io/anuke/mindustry/net/NetworkIO.java b/core/src/io/anuke/mindustry/net/NetworkIO.java index f8a9a5ddbe..dc16abf908 100644 --- a/core/src/io/anuke/mindustry/net/NetworkIO.java +++ b/core/src/io/anuke/mindustry/net/NetworkIO.java @@ -1,8 +1,11 @@ package io.anuke.mindustry.net; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.ObjectMap.Entry; -import com.badlogic.gdx.utils.TimeUtils; +import io.anuke.arc.Core; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.collection.ObjectMap.Entry; +import io.anuke.arc.entities.Entities; +import io.anuke.arc.util.Pack; +import io.anuke.arc.util.Time; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.game.GameMode; @@ -14,10 +17,6 @@ import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.maps.MapMeta; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.BlockPart; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.entities.Entities; -import io.anuke.ucore.util.Bits; import java.io.*; import java.nio.ByteBuffer; @@ -66,7 +65,7 @@ public class NetworkIO{ if(tile.block() instanceof BlockPart){ stream.writeByte(tile.link); }else if(tile.entity != null){ - stream.writeByte(Bits.packByte(tile.getTeamID(), tile.getRotation())); //team + rotation + stream.writeByte(Pack.byteByte(tile.getTeamID(), tile.getRotation())); //team + rotation stream.writeShort((short) tile.entity.health); //health if(tile.entity.items != null) tile.entity.items.write(stream); @@ -94,28 +93,6 @@ public class NetworkIO{ } } - //write visibility, length-run encoded - for(int i = 0; i < world.width() * world.height(); i++){ - Tile tile = world.tile(i % world.width(), i / world.width());; - boolean discovered = tile.discovered(); - - int consecutives = 0; - - for(int j = i + 1; j < world.width() * world.height() && consecutives < 32767*2-1; j++){ - Tile nextTile = world.tile(j % world.width(), j / world.width());; - - if(nextTile.discovered() != discovered){ - break; - } - - consecutives++; - } - - stream.writeBoolean(discovered); - stream.writeShort(consecutives); - i += consecutives; - } - stream.write(Team.all.length); //write team data @@ -134,13 +111,6 @@ public class NetworkIO{ } } - //now write a snapshot. - player.con.viewX = world.width() * tilesize/2f; - player.con.viewY = world.height() * tilesize/2f; - player.con.viewWidth = world.width() * tilesize; - player.con.viewHeight = world.height() * tilesize; - netServer.writeSnapshot(player, stream); - }catch(IOException e){ throw new RuntimeException(e); } @@ -151,7 +121,7 @@ public class NetworkIO{ Player player = players[0]; try(DataInputStream stream = new DataInputStream(is)){ - Timers.clear(); + Time.clear(); //general state byte mode = stream.readByte(); @@ -160,7 +130,7 @@ public class NetworkIO{ int missions = stream.readInt(); if(sector != invalidSector){ - world.sectors.createSector(Bits.getLeftShort(sector), Bits.getRightShort(sector)); + world.sectors.createSector(Pack.leftShort(sector), Pack.rightShort(sector)); world.setSector(world.sectors.get(sector)); world.getSector().completedMissions = missions; }else{ @@ -186,7 +156,7 @@ public class NetworkIO{ Entities.clear(); int id = stream.readInt(); player.resetNoAdd(); - player.read(stream, TimeUtils.millis()); + player.read(stream); player.resetID(id); player.add(); @@ -218,8 +188,8 @@ public class NetworkIO{ byte tr = stream.readByte(); short health = stream.readShort(); - byte team = Bits.getLeftByte(tr); - byte rotation = Bits.getRightByte(tr); + byte team = Pack.leftByte(tr); + byte rotation = Pack.rightByte(tr); tile.setTeam(Team.all[team]); tile.entity.health = health; @@ -248,18 +218,6 @@ public class NetworkIO{ tiles[x][y] = tile; } - for(int i = 0; i < width * height; i++){ - boolean discovered = stream.readBoolean(); - int consecutives = stream.readUnsignedShort(); - if(discovered){ - for(int j = i + 1; j < i + 1 + consecutives; j++){ - int newx = j % width, newy = j / width; - tiles[newx][newy].setVisibility((byte) 1); - } - } - i += consecutives; - } - state.teams = new Teams(); byte teams = stream.readByte(); @@ -281,15 +239,12 @@ public class NetworkIO{ } if(team == players[0].getTeam() && cores > 0){ - Core.camera.position.set(state.teams.get(team).cores.first().drawx(), state.teams.get(team).cores.first().drawy(), 0); + Core.camera.position.set(state.teams.get(team).cores.first().drawx(), state.teams.get(team).cores.first().drawy()); } } world.endMapLoad(); - //read raw snapshot - netClient.readSnapshot(stream); - }catch(IOException e){ throw new RuntimeException(e); } diff --git a/core/src/io/anuke/mindustry/net/Packet.java b/core/src/io/anuke/mindustry/net/Packet.java index ef34666dbb..f5feb59c94 100644 --- a/core/src/io/anuke/mindustry/net/Packet.java +++ b/core/src/io/anuke/mindustry/net/Packet.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.net; -import com.badlogic.gdx.utils.Pool.Poolable; +import io.anuke.arc.util.pooling.Pool.Poolable; import java.nio.ByteBuffer; diff --git a/core/src/io/anuke/mindustry/net/Packets.java b/core/src/io/anuke/mindustry/net/Packets.java index 1d3ef834e7..a2a4475493 100644 --- a/core/src/io/anuke/mindustry/net/Packets.java +++ b/core/src/io/anuke/mindustry/net/Packets.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.net; -import com.badlogic.gdx.utils.Base64Coder; +import io.anuke.arc.Core; +import io.anuke.arc.util.serialization.Base64Coder; import io.anuke.mindustry.game.Version; import io.anuke.mindustry.io.TypeIO; -import io.anuke.ucore.util.Bundles; import java.nio.ByteBuffer; @@ -28,11 +28,11 @@ public class Packets{ @Override public String toString(){ - return Bundles.get("text.server.kicked." + name()); + return Core.bundle.get("text.server.kicked." + name()); } public String extraText(){ - return Bundles.getOrNull("text.server.kicked." + name() + ".text"); + return Core.bundle.getOrNull("text.server.kicked." + name() + ".text"); } } diff --git a/core/src/io/anuke/mindustry/net/Registrator.java b/core/src/io/anuke/mindustry/net/Registrator.java index 1fd12cca26..6430a686a9 100644 --- a/core/src/io/anuke/mindustry/net/Registrator.java +++ b/core/src/io/anuke/mindustry/net/Registrator.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.net; -import com.badlogic.gdx.utils.ObjectIntMap; +import io.anuke.arc.collection.ObjectIntMap; +import io.anuke.arc.function.Supplier; import io.anuke.mindustry.net.Packets.*; -import io.anuke.ucore.function.Supplier; public class Registrator{ private static ClassEntry[] classes = { diff --git a/core/src/io/anuke/mindustry/type/AmmoType.java b/core/src/io/anuke/mindustry/type/AmmoType.java index 2244a09a1d..24150b4b14 100644 --- a/core/src/io/anuke/mindustry/type/AmmoType.java +++ b/core/src/io/anuke/mindustry/type/AmmoType.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.type; import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.game.Content; -import io.anuke.ucore.core.Effects.Effect; +import io.anuke.arc.entities.Effects.Effect; public class AmmoType extends Content { /**The item used. Always null if liquid isn't.*/ diff --git a/core/src/io/anuke/mindustry/type/Item.java b/core/src/io/anuke/mindustry/type/Item.java index 62e91451ed..b4e461d4ff 100644 --- a/core/src/io/anuke/mindustry/type/Item.java +++ b/core/src/io/anuke/mindustry/type/Item.java @@ -1,17 +1,16 @@ package io.anuke.mindustry.type; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Strings; import io.anuke.mindustry.Vars; import io.anuke.mindustry.game.UnlockableContent; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.ui.ContentDisplay; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Strings; public class Item extends UnlockableContent implements Comparable{ public final String name; @@ -46,16 +45,16 @@ public class Item extends UnlockableContent implements Comparable{ public Item(String name, Color color){ this.name = name; this.color = color; - this.description = Bundles.getOrNull("item." + this.name + ".description"); + this.description = Core.bundle.getOrNull("item." + this.name + ".description"); - if(!Bundles.has("item." + this.name + ".name")){ + if(!Core.bundle.has("item." + this.name + ".name")){ Log.err("Warning: item '" + name + "' is missing a localized name. Add the following to bundle.properties:"); Log.err("item." + this.name + ".name=" + Strings.capitalize(name.replace('-', '_'))); } } public void load(){ - this.region = Draw.region("item-" + name); + this.region = Core.atlas.find("item-" + name); } @Override @@ -70,7 +69,7 @@ public class Item extends UnlockableContent implements Comparable{ @Override public String localizedName(){ - return Bundles.get("item." + this.name + ".name"); + return Core.bundle.get("item." + this.name + ".name"); } @Override diff --git a/core/src/io/anuke/mindustry/type/Liquid.java b/core/src/io/anuke/mindustry/type/Liquid.java index 3dbb52fbe9..b857b7ffc2 100644 --- a/core/src/io/anuke/mindustry/type/Liquid.java +++ b/core/src/io/anuke/mindustry/type/Liquid.java @@ -1,13 +1,12 @@ package io.anuke.mindustry.type; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.scene.ui.layout.Table; import io.anuke.mindustry.content.StatusEffects; import io.anuke.mindustry.game.UnlockableContent; import io.anuke.mindustry.ui.ContentDisplay; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; public class Liquid extends UnlockableContent{ public final Color color; @@ -36,7 +35,7 @@ public class Liquid extends UnlockableContent{ public Liquid(String name, Color color){ this.name = name; this.color = new Color(color); - this.description = Bundles.getOrNull("liquid." + name + ".description"); + this.description = Core.bundle.getOrNull("liquid." + name + ".description"); } public boolean canExtinguish(){ @@ -45,7 +44,7 @@ public class Liquid extends UnlockableContent{ @Override public void load(){ - iconRegion = Draw.region("liquid-icon-" + name); + iconRegion = Core.atlas.find("liquid-icon-" + name); } @Override @@ -55,7 +54,7 @@ public class Liquid extends UnlockableContent{ @Override public String localizedName(){ - return Bundles.get("liquid." + this.name + ".name"); + return Core.bundle.get("liquid." + this.name + ".name"); } @Override diff --git a/core/src/io/anuke/mindustry/type/Mech.java b/core/src/io/anuke/mindustry/type/Mech.java index 744bf11be1..7abf1a8e3c 100644 --- a/core/src/io/anuke/mindustry/type/Mech.java +++ b/core/src/io/anuke/mindustry/type/Mech.java @@ -1,15 +1,14 @@ package io.anuke.mindustry.type; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.scene.ui.layout.Table; import io.anuke.mindustry.content.Weapons; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.game.UnlockableContent; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.ui.ContentDisplay; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; public class Mech extends UnlockableContent{ public final String name; @@ -44,11 +43,11 @@ public class Mech extends UnlockableContent{ public Mech(String name, boolean flying){ this.flying = flying; this.name = name; - this.description = Bundles.get("mech." + name + ".description"); + this.description = Core.bundle.get("mech." + name + ".description"); } public String localizedName(){ - return Bundles.get("mech." + name + ".name"); + return Core.bundle.get("mech." + name + ".name"); } public void updateAlt(Player player){} @@ -94,12 +93,12 @@ public class Mech extends UnlockableContent{ @Override public void load(){ if(!flying){ - legRegion = Draw.region(name + "-leg"); - baseRegion = Draw.region(name + "-base"); + legRegion = Core.atlas.find(name + "-leg"); + baseRegion = Core.atlas.find(name + "-base"); } - region = Draw.region(name); - iconRegion = Draw.region("mech-icon-" + name); + region = Core.atlas.find(name); + iconRegion = Core.atlas.find("mech-icon-" + name); } @Override diff --git a/core/src/io/anuke/mindustry/type/Recipe.java b/core/src/io/anuke/mindustry/type/Recipe.java index daa84726e7..2ac7590bd6 100644 --- a/core/src/io/anuke/mindustry/type/Recipe.java +++ b/core/src/io/anuke/mindustry/type/Recipe.java @@ -1,9 +1,13 @@ package io.anuke.mindustry.type; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectMap; -import com.badlogic.gdx.utils.OrderedMap; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.collection.OrderedMap; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Strings; import io.anuke.mindustry.Vars; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.UnlockableContent; @@ -12,10 +16,6 @@ import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.mindustry.world.meta.ContentStatValue; import io.anuke.mindustry.world.meta.StatValue; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Strings; import java.util.Arrays; @@ -118,7 +118,7 @@ public class Recipe extends UnlockableContent{ @Override public void init(){ - if(!Bundles.has("block." + result.name + ".name")){ + if(!Core.bundle.has("block." + result.name + ".name")){ Log.err("WARNING: Recipe block '{0}' does not have a formal name defined. Add the following to bundle.properties:", result.name); Log.err("block.{0}.name={1}", result.name, Strings.capitalize(result.name.replace('-', '_'))); }/*else if(result.fullDescription == null){ diff --git a/core/src/io/anuke/mindustry/type/StatusEffect.java b/core/src/io/anuke/mindustry/type/StatusEffect.java index 1d8282354b..2180699a83 100644 --- a/core/src/io/anuke/mindustry/type/StatusEffect.java +++ b/core/src/io/anuke/mindustry/type/StatusEffect.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.type; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.collection.ObjectSet; import io.anuke.mindustry.entities.StatusController.StatusEntry; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.game.Content; diff --git a/core/src/io/anuke/mindustry/type/Weapon.java b/core/src/io/anuke/mindustry/type/Weapon.java index 1a4e9159cd..d15ef9a3ae 100644 --- a/core/src/io/anuke/mindustry/type/Weapon.java +++ b/core/src/io/anuke/mindustry/type/Weapon.java @@ -1,8 +1,14 @@ package io.anuke.mindustry.type; -import com.badlogic.gdx.graphics.g2d.TextureRegion; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.Core; +import io.anuke.arc.entities.Effects; +import io.anuke.arc.entities.Effects.Effect; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Angles; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; import io.anuke.mindustry.Vars; import io.anuke.mindustry.content.fx.Fx; import io.anuke.mindustry.entities.Player; @@ -11,13 +17,6 @@ import io.anuke.mindustry.entities.traits.ShooterTrait; import io.anuke.mindustry.game.Content; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Effects.Effect; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Translator; public class Weapon extends Content{ public final String name; @@ -49,7 +48,7 @@ public class Weapon extends Content{ /**whether to shoot the weapons in different arms one after another, rather than all at once*/ protected boolean roundrobin = false; /**translator for vector calulations*/ - protected Translator tr = new Translator(); + protected Vector2 tr = new Vector2(); public TextureRegion equipRegion, region; @@ -101,8 +100,8 @@ public class Weapon extends Content{ @Override public void load(){ - equipRegion = Draw.region(name + "-equip"); - region = Draw.region(name); + equipRegion = Core.atlas.find(name + "-equip"); + region = Core.atlas.find(name); } @Override diff --git a/core/src/io/anuke/mindustry/ui/BorderImage.java b/core/src/io/anuke/mindustry/ui/BorderImage.java index 66d3913500..2b479a1980 100644 --- a/core/src/io/anuke/mindustry/ui/BorderImage.java +++ b/core/src/io/anuke/mindustry/ui/BorderImage.java @@ -1,13 +1,12 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.graphics.Texture; +import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.mindustry.graphics.Palette; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.layout.Unit; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Lines; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.layout.Unit; public class BorderImage extends Image{ private float thickness = 3f; @@ -31,8 +30,8 @@ public class BorderImage extends Image{ } @Override - public void draw(Batch batch, float alpha){ - super.draw(batch, alpha); + public void draw(){ + super.draw(); float scaleX = getScaleX(); float scaleY = getScaleY(); diff --git a/core/src/io/anuke/mindustry/ui/ContentDisplay.java b/core/src/io/anuke/mindustry/ui/ContentDisplay.java index 25da82eaa8..1b416388d9 100644 --- a/core/src/io/anuke/mindustry/ui/ContentDisplay.java +++ b/core/src/io/anuke/mindustry/ui/ContentDisplay.java @@ -1,7 +1,10 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.OrderedMap; +import io.anuke.arc.Core; +import io.anuke.arc.collection.OrderedMap; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Strings; import io.anuke.mindustry.entities.units.UnitType; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.type.Item; @@ -13,10 +16,6 @@ import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.mindustry.world.meta.BlockStats; import io.anuke.mindustry.world.meta.StatCategory; import io.anuke.mindustry.world.meta.StatValue; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Strings; public class ContentDisplay{ @@ -26,7 +25,7 @@ public class ContentDisplay{ table.table(title -> { int size = 8 * 6; - title.addImage(Draw.region("block-icon-" + block.name)).size(size); + title.addImage(Core.atlas.find("block-icon-" + block.name)).size(size); title.add("[accent]" + block.formalName).padLeft(5); }); @@ -88,13 +87,13 @@ public class ContentDisplay{ table.left().defaults().fillX(); - table.add(Bundles.format("text.item.explosiveness", (int) (item.explosiveness * 100 * 2f))); + table.add(Core.bundle.format("text.item.explosiveness", (int) (item.explosiveness * 100 * 2f))); table.row(); - table.add(Bundles.format("text.item.flammability", (int) (item.flammability * 100 * 2f))); + table.add(Core.bundle.format("text.item.flammability", (int) (item.flammability * 100 * 2f))); table.row(); - table.add(Bundles.format("text.item.radioactivity", (int) (item.radioactivity * 100 * 2f))); + table.add(Core.bundle.format("text.item.radioactivity", (int) (item.radioactivity * 100 * 2f))); table.row(); - table.add(Bundles.format("text.item.fluxiness", (int) (item.fluxiness * 100 * 2f))); + table.add(Core.bundle.format("text.item.fluxiness", (int) (item.fluxiness * 100 * 2f))); table.row(); } @@ -121,15 +120,15 @@ public class ContentDisplay{ table.left().defaults().fillX(); - table.add(Bundles.format("text.item.explosiveness", (int) (liquid.explosiveness * 100 * 2f))); + table.add(Core.bundle.format("text.item.explosiveness", (int) (liquid.explosiveness * 100 * 2f))); table.row(); - table.add(Bundles.format("text.item.flammability", (int) (liquid.flammability * 100 * 2f))); + table.add(Core.bundle.format("text.item.flammability", (int) (liquid.flammability * 100 * 2f))); table.row(); - table.add(Bundles.format("text.liquid.heatcapacity", (int) (liquid.heatCapacity * 100))); + table.add(Core.bundle.format("text.liquid.heatcapacity", (int) (liquid.heatCapacity * 100))); table.row(); - table.add(Bundles.format("text.liquid.temperature", (int) (liquid.temperature * 100))); + table.add(Core.bundle.format("text.liquid.temperature", (int) (liquid.temperature * 100))); table.row(); - table.add(Bundles.format("text.liquid.viscosity", (int) (liquid.viscosity * 100))); + table.add(Core.bundle.format("text.liquid.viscosity", (int) (liquid.viscosity * 100))); table.row(); } @@ -155,23 +154,23 @@ public class ContentDisplay{ table.left().defaults().fillX(); - if(Bundles.has("mech." + mech.name + ".weapon")){ - table.add(Bundles.format("text.mech.weapon", Bundles.get("mech." + mech.name + ".weapon"))); + if(Core.bundle.has("mech." + mech.name + ".weapon")){ + table.add(Core.bundle.format("text.mech.weapon", Core.bundle.get("mech." + mech.name + ".weapon"))); table.row(); } - if(Bundles.has("mech." + mech.name + ".ability")){ - table.add(Bundles.format("text.mech.ability", Bundles.get("mech." + mech.name + ".ability"))); + if(Core.bundle.has("mech." + mech.name + ".ability")){ + table.add(Core.bundle.format("text.mech.ability", Core.bundle.get("mech." + mech.name + ".ability"))); table.row(); } - table.add(Bundles.format("text.mech.armor", mech.armor)); + table.add(Core.bundle.format("text.mech.armor", mech.armor)); table.row(); - table.add(Bundles.format("text.mech.itemcapacity", mech.itemCapacity)); + table.add(Core.bundle.format("text.mech.itemcapacity", mech.itemCapacity)); table.row(); if(mech.drillPower > 0){ - table.add(Bundles.format("text.mech.minespeed", (int) (mech.mineSpeed * 10))); + table.add(Core.bundle.format("text.mech.minespeed", (int) (mech.mineSpeed * 10))); table.row(); - table.add(Bundles.format("text.mech.minepower", mech.drillPower)); + table.add(Core.bundle.format("text.mech.minepower", mech.drillPower)); table.row(); } } @@ -198,9 +197,9 @@ public class ContentDisplay{ table.left().defaults().fillX(); - table.add(Bundles.format("text.unit.health", unit.health)); + table.add(Core.bundle.format("text.unit.health", unit.health)); table.row(); - table.add(Bundles.format("text.unit.speed", Strings.toFixed(unit.speed, 1))); + table.add(Core.bundle.format("text.unit.speed", Strings.toFixed(unit.speed, 1))); table.row(); table.row(); } diff --git a/core/src/io/anuke/mindustry/ui/GridImage.java b/core/src/io/anuke/mindustry/ui/GridImage.java index 01792f5fbb..fd164cc191 100644 --- a/core/src/io/anuke/mindustry/ui/GridImage.java +++ b/core/src/io/anuke/mindustry/ui/GridImage.java @@ -1,9 +1,7 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.Element; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.scene.Element; public class GridImage extends Element{ private int imageWidth, imageHeight; @@ -13,9 +11,8 @@ public class GridImage extends Element{ this.imageHeight = h; } - public void draw(Batch batch, float alpha){ - TextureRegion blank = Draw.region("white"); - + @Override + public void draw(){ float xspace = (getWidth() / imageWidth); float yspace = (getHeight() / imageHeight); float s = 1f; @@ -26,11 +23,11 @@ public class GridImage extends Element{ int jumpy = (int) (Math.max(minspace, yspace) / yspace); for(int x = 0; x <= imageWidth; x += jumpx){ - batch.draw(blank, (int) (getX() + xspace * x - s), getY() - s, 2, getHeight() + (x == imageWidth ? 1 : 0)); + Fill.crect((int) (getX() + xspace * x - s), getY() - s, 2, getHeight() + (x == imageWidth ? 1 : 0)); } for(int y = 0; y <= imageHeight; y += jumpy){ - batch.draw(blank, getX() - s, (int) (getY() + y * yspace - s), getWidth(), 2); + Fill.crect(getX() - s, (int) (getY() + y * yspace - s), getWidth(), 2); } } diff --git a/core/src/io/anuke/mindustry/ui/ImageStack.java b/core/src/io/anuke/mindustry/ui/ImageStack.java index 2ca0063e48..7552ceccd0 100644 --- a/core/src/io/anuke/mindustry/ui/ImageStack.java +++ b/core/src/io/anuke/mindustry/ui/ImageStack.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.layout.Stack; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.layout.Stack; public class ImageStack extends Stack{ diff --git a/core/src/io/anuke/mindustry/ui/IntFormat.java b/core/src/io/anuke/mindustry/ui/IntFormat.java index 6c4431a4b0..cdf1e529ad 100644 --- a/core/src/io/anuke/mindustry/ui/IntFormat.java +++ b/core/src/io/anuke/mindustry/ui/IntFormat.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.ui; -import io.anuke.ucore.util.Bundles; + +import io.anuke.arc.Core; /** * A low-garbage way to format bundle strings. @@ -17,7 +18,7 @@ public class IntFormat{ public CharSequence get(int value){ if(lastValue != value){ builder.setLength(0); - builder.append(Bundles.format(text, value)); + builder.append(Core.bundle.format(text, value)); } lastValue = value; return builder; diff --git a/core/src/io/anuke/mindustry/ui/ItemDisplay.java b/core/src/io/anuke/mindustry/ui/ItemDisplay.java index 4530d606f0..ff5b6153f3 100644 --- a/core/src/io/anuke/mindustry/ui/ItemDisplay.java +++ b/core/src/io/anuke/mindustry/ui/ItemDisplay.java @@ -2,7 +2,7 @@ package io.anuke.mindustry.ui; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.ItemStack; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.layout.Table; /**An item image with text.*/ public class ItemDisplay extends Table{ diff --git a/core/src/io/anuke/mindustry/ui/ItemImage.java b/core/src/io/anuke/mindustry/ui/ItemImage.java index 130916cb26..e13026658f 100644 --- a/core/src/io/anuke/mindustry/ui/ItemImage.java +++ b/core/src/io/anuke/mindustry/ui/ItemImage.java @@ -1,17 +1,17 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.mindustry.type.ItemStack; -import io.anuke.ucore.function.Supplier; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.layout.Stack; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.function.Supplier; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.layout.Stack; +import io.anuke.arc.scene.ui.layout.Table; public class ItemImage extends Stack{ public ItemImage(TextureRegion region, Supplier text){ Table t = new Table().left().bottom(); - t.label(text); + t.label(text).name("item-label"); add(new Image(region)); add(t); @@ -22,7 +22,7 @@ public class ItemImage extends Stack{ if(stack.amount != 0){ Table t = new Table().left().bottom(); - t.add(stack.amount + ""); + t.add(stack.amount + "").name("item-label"); add(t); } } diff --git a/core/src/io/anuke/mindustry/ui/Links.java b/core/src/io/anuke/mindustry/ui/Links.java index 891e44f7f8..b6e74be5ec 100644 --- a/core/src/io/anuke/mindustry/ui/Links.java +++ b/core/src/io/anuke/mindustry/ui/Links.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.graphics.Color; -import io.anuke.ucore.util.Bundles; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; public class Links{ private static LinkEntry[] links; @@ -33,7 +33,7 @@ public class Links{ public LinkEntry(String name, String link, Color color){ this.name = name; this.color = color; - this.description = Bundles.getNotNull("text.link." + name + ".description"); + this.description = Core.bundle.getNotNull("text.link." + name + ".description"); this.link = link; } } diff --git a/core/src/io/anuke/mindustry/ui/LiquidDisplay.java b/core/src/io/anuke/mindustry/ui/LiquidDisplay.java index f639dfe1c5..442707408e 100644 --- a/core/src/io/anuke/mindustry/ui/LiquidDisplay.java +++ b/core/src/io/anuke/mindustry/ui/LiquidDisplay.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.ui; import io.anuke.mindustry.type.Liquid; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.layout.Table; /**An ItemDisplay, but for liquids.*/ public class LiquidDisplay extends Table{ diff --git a/core/src/io/anuke/mindustry/ui/MenuButton.java b/core/src/io/anuke/mindustry/ui/MenuButton.java index 7dd3d16cd1..9d5f34430e 100644 --- a/core/src/io/anuke/mindustry/ui/MenuButton.java +++ b/core/src/io/anuke/mindustry/ui/MenuButton.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.Align; -import io.anuke.ucore.scene.ui.TextButton; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.util.Align; +import io.anuke.arc.scene.ui.TextButton; public class MenuButton extends TextButton{ @@ -12,21 +12,15 @@ public class MenuButton extends TextButton{ public MenuButton(String icon, String text, String description, Runnable clicked){ super("default"); - float s = 66f; clicked(clicked); - clearChildren(); margin(0); table(t -> { - t.addImage(icon).size(14 * 3); - t.update(() -> t.setBackground(getClickListener().isVisualPressed() ? "button-down" : getClickListener().isOver() ? "button-over" : "button")); - }).size(s - 5, s); + t.addImage(icon).size(14 * 3).padLeft(6); - - table(t -> { t.add(text).wrap().growX().get().setAlignment(Align.center, Align.left); if(description != null){ t.row(); diff --git a/core/src/io/anuke/mindustry/ui/Minimap.java b/core/src/io/anuke/mindustry/ui/Minimap.java index 69be4be5b4..243e8039da 100644 --- a/core/src/io/anuke/mindustry/ui/Minimap.java +++ b/core/src/io/anuke/mindustry/ui/Minimap.java @@ -1,81 +1,52 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.graphics.Texture.TextureFilter; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import io.anuke.mindustry.graphics.Shaders; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.Element; -import io.anuke.ucore.scene.event.InputEvent; -import io.anuke.ucore.scene.event.InputListener; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.scene.Element; +import io.anuke.arc.scene.event.InputEvent; +import io.anuke.arc.scene.event.InputListener; +import io.anuke.arc.scene.ui.layout.Container; -import static io.anuke.mindustry.Vars.*; +import static io.anuke.mindustry.Vars.renderer; -public class Minimap extends Table{ +public class Minimap extends Container{ public Minimap(){ - super("pane"); + super(new Element(){ - margin(5); - - TextureRegion r = new TextureRegion(); - - Element elem = new Element(){ @Override public void draw(){ if(renderer.minimap.getRegion() == null) return; - Draw.crect(renderer.minimap.getRegion(), x, y, width, height); + Draw.rect(renderer.minimap.getRegion(), x + width/2f, y + height/2f, width, height); if(renderer.minimap.getTexture() != null){ renderer.minimap.drawEntities(x, y, width, height); } - - if(showFog){ - renderer.fog.getTexture().setFilter(TextureFilter.Nearest, TextureFilter.Nearest); - - r.setRegion(renderer.minimap.getRegion()); - float pad = renderer.fog.getPadding(); - - float px = r.getU() * world.width() + pad; - float py = r.getV() * world.height() + pad; - float px2 = r.getU2() * world.width() + pad; - float py2 = r.getV2() * world.height() + pad; - - r.setTexture(renderer.fog.getTexture()); - r.setU(px / (world.width() + pad*2f)); - r.setV(1f - py / (world.height() + pad*2f)); - r.setU2(px2 / (world.width() + pad*2f)); - r.setV2(1f - py2 / (world.height() + pad*2f)); - - Graphics.shader(Shaders.fog); - Draw.crect(r, x, y, width, height); - Graphics.shader(); - - renderer.fog.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); - } } - }; + }); + + background("pane"); + + size(140f); + margin(5f); addListener(new InputListener(){ - public boolean scrolled(InputEvent event, float x, float y, int amount){ - renderer.minimap.zoomBy(amount); + @Override + public boolean scrolled(InputEvent event, float x, float y, float amountx, float amounty){ + renderer.minimap.zoomBy(amounty); return true; } }); - elem.update(() -> { + update(() -> { - Element e = Core.scene.hit(Graphics.mouse().x, Graphics.mouse().y, true); + Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true); if(e != null && e.isDescendantOf(this)){ Core.scene.setScrollFocus(this); }else if(Core.scene.getScrollFocus() == this){ Core.scene.setScrollFocus(null); } }); - - add(elem).size(140f, 140f); } } diff --git a/core/src/io/anuke/mindustry/ui/MobileButton.java b/core/src/io/anuke/mindustry/ui/MobileButton.java index 68999a260c..4d64eafe5c 100644 --- a/core/src/io/anuke/mindustry/ui/MobileButton.java +++ b/core/src/io/anuke/mindustry/ui/MobileButton.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.ui; -import com.badlogic.gdx.utils.Align; -import io.anuke.ucore.scene.ui.ImageButton; +import io.anuke.arc.util.Align; +import io.anuke.arc.scene.ui.ImageButton; public class MobileButton extends ImageButton{ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/AboutDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/AboutDialog.java index 4cfa262779..f9fd75efd7 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/AboutDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/AboutDialog.java @@ -1,22 +1,22 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.ObjectSet; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.io.Contributors; import io.anuke.mindustry.io.Contributors.Contributor; import io.anuke.mindustry.ui.Links; import io.anuke.mindustry.ui.Links.LinkEntry; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.layout.Cell; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.utils.UIUtils; -import io.anuke.ucore.util.OS; -import io.anuke.ucore.util.Strings; +import io.anuke.arc.Core; +import io.anuke.arc.util.Time; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.layout.Cell; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.utils.UIUtils; +import io.anuke.arc.util.OS; +import io.anuke.arc.util.Strings; import static io.anuke.mindustry.Vars.ios; import static io.anuke.mindustry.Vars.ui; @@ -69,16 +69,16 @@ public class AboutDialog extends FloatingDialog{ }).padLeft(8); table.addImageButton("icon-link", 14 * 3, () -> { - if(!Gdx.net.openURI(link.link)){ + if(!Core.net.openURI(link.link)){ ui.showError("$text.linkfail"); - Gdx.app.getClipboard().setContents(link.link); + Core.app.getClipboard().setContents(link.link); } }).size(h - 5, h); in.add(table).size(w, h).padTop(5).row(); } - shown(() -> Timers.run(1f, () -> Core.scene.setScrollFocus(pane))); + shown(() -> Time.run(1f, () -> Core.scene.setScrollFocus(pane))); content().add(pane).growX(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/AdminsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/AdminsDialog.java index 31496a5e3a..5c1733ba78 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/AdminsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/AdminsDialog.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.ui.dialogs; import io.anuke.mindustry.net.Administration.PlayerInfo; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.layout.Table; import static io.anuke.mindustry.Vars.*; diff --git a/core/src/io/anuke/mindustry/ui/dialogs/BansDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/BansDialog.java index 1a3d8369d7..cc4a5c5fdc 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/BansDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/BansDialog.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.ui.dialogs; import io.anuke.mindustry.net.Administration.PlayerInfo; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.layout.Table; import static io.anuke.mindustry.Vars.*; diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ChangelogDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ChangelogDialog.java index 9d2e094eb1..ecf053bb8a 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ChangelogDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ChangelogDialog.java @@ -1,16 +1,15 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.OS; import io.anuke.mindustry.Vars; +import io.anuke.mindustry.game.Version; import io.anuke.mindustry.io.Changelogs; import io.anuke.mindustry.io.Changelogs.VersionInfo; -import io.anuke.mindustry.game.Version; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.OS; import static io.anuke.mindustry.Vars.ios; @@ -28,10 +27,10 @@ public class ChangelogDialog extends FloatingDialog{ if(!ios && !OS.isMac){ Changelogs.getChangelog(result -> { versions = result; - Gdx.app.postRunnable(this::setup); + Core.app.post(this::setup); }, t -> { Log.err(t); - Gdx.app.postRunnable(this::setup); + Core.app.post(this::setup); }); } } @@ -77,10 +76,10 @@ public class ChangelogDialog extends FloatingDialog{ table.add(in).width(vw).pad(8).row(); } - int lastid = Settings.getInt("lastBuild"); + int lastid = Core.settings.getInt("lastBuild"); if(lastid != 0 && versions.peek().build > lastid){ - Settings.putInt("lastBuild", versions.peek().build); - Settings.save(); + Core.settings.put("lastBuild", versions.peek().build); + Core.settings.save(); show(); } } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ColorPickDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ColorPickDialog.java index a9c282b065..d6a8ebf665 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ColorPickDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ColorPickDialog.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Input.Keys; -import com.badlogic.gdx.graphics.Color; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.scene.ui.Dialog; -import io.anuke.ucore.scene.ui.ImageButton; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.scene.ui.Dialog; +import io.anuke.arc.scene.ui.ImageButton; +import io.anuke.arc.scene.ui.layout.Table; import static io.anuke.mindustry.Vars.playerColors; import static io.anuke.mindustry.Vars.players; @@ -38,7 +38,7 @@ public class ColorPickDialog extends Dialog{ } keyDown(key -> { - if(key == Keys.ESCAPE || key == Keys.BACK) + if(key == KeyCode.ESCAPE || key == KeyCode.BACK) hide(); }); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ContentInfoDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ContentInfoDialog.java index 50a2f4cf78..b513ec0800 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ContentInfoDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ContentInfoDialog.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.ui.dialogs; import io.anuke.mindustry.game.UnlockableContent; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.layout.Table; public class ContentInfoDialog extends FloatingDialog{ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ControlsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ControlsDialog.java index c9c2901a6b..249967f11e 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ControlsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ControlsDialog.java @@ -1,15 +1,16 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Input.Keys; -import com.badlogic.gdx.utils.Align; +import io.anuke.arc.Core; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.KeybindDialog; +import io.anuke.arc.util.Align; import io.anuke.mindustry.graphics.Palette; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.KeybindDialog; public class ControlsDialog extends KeybindDialog{ public ControlsDialog(){ - setDialog(); + setStyle(Core.scene.skin.get("dialog", WindowStyle.class)); setFillParent(true); title().setAlignment(Align.center); @@ -23,7 +24,7 @@ public class ControlsDialog extends KeybindDialog{ buttons().addImageTextButton("$text.back", "icon-arrow-left", 30f, this::hide).size(230f, 64f); keyDown(key -> { - if(key == Keys.ESCAPE || key == Keys.BACK) + if(key == KeyCode.ESCAPE || key == KeyCode.BACK) hide(); }); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/CustomGameDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/CustomGameDialog.java index 1a5f218489..713261bde6 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/CustomGameDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/CustomGameDialog.java @@ -1,22 +1,20 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.Scaling; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.scene.event.Touchable; +import io.anuke.arc.scene.ui.ButtonGroup; +import io.anuke.arc.scene.ui.ImageButton; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.Scaling; import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.ui.BorderImage; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.scene.event.Touchable; -import io.anuke.ucore.scene.ui.ButtonGroup; -import io.anuke.ucore.scene.ui.ImageButton; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.*; @@ -38,7 +36,7 @@ public class CustomGameDialog extends FloatingDialog{ ScrollPane pane = new ScrollPane(maps); pane.setFadeScrollBars(false); - int maxwidth = (Gdx.graphics.getHeight() > Gdx.graphics.getHeight() ? 2 : 4); + int maxwidth = (Core.graphics.getHeight() > Core.graphics.getHeight() ? 2 : 4); Table selmode = new Table(); ButtonGroup group = new ButtonGroup<>(); @@ -77,7 +75,7 @@ public class CustomGameDialog extends FloatingDialog{ sdif.addButton("", () -> {}) .update(t -> { t.setText(state.difficulty.toString()); - t.setTouchable(Touchable.disabled); + t.touchable(Touchable.disabled); }).width(180f); sdif.addImageButton("icon-arrow-right", 10 * 3, () -> { @@ -104,7 +102,7 @@ public class CustomGameDialog extends FloatingDialog{ image.row(); image.add("[accent]" + map.getDisplayName()).pad(3f).growX().wrap().get().setAlignment(Align.center, Align.center); image.row(); - image.label((() -> Bundles.format("text.level.highscore", Settings.getInt("hiscore" + map.name, 0)))).pad(3f); + image.label((() -> Core.bundle.format("text.level.highscore", Core.settings.getInt("hiscore" + map.name, 0)))).pad(3f); BorderImage border = new BorderImage(map.texture, 3f); border.setScaling(Scaling.fit); @@ -135,7 +133,7 @@ public class CustomGameDialog extends FloatingDialog{ } private void displayGameModeHelp(){ - FloatingDialog d = new FloatingDialog(Bundles.get("mode.text.help.title")); + FloatingDialog d = new FloatingDialog(Core.bundle.get("mode.text.help.title")); d.setFillParent(false); Table table = new Table(); table.defaults().pad(1f); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/DiscordDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/DiscordDialog.java index e4571b2447..f37c2156c7 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/DiscordDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/DiscordDialog.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; import io.anuke.mindustry.graphics.Palette; -import io.anuke.ucore.scene.ui.Dialog; +import io.anuke.arc.scene.ui.Dialog; import static io.anuke.mindustry.Vars.discordURL; import static io.anuke.mindustry.Vars.ui; @@ -40,12 +40,12 @@ public class DiscordDialog extends Dialog{ buttons().addButton("$text.back", this::hide); buttons().addButton("$text.copylink", () -> { - Gdx.app.getClipboard().setContents(discordURL); + Core.app.getClipboard().setContents(discordURL); }); buttons().addButton("$text.openlink", () -> { - if(!Gdx.net.openURI(discordURL)){ + if(!Core.net.openURI(discordURL)){ ui.showError("$text.linkfail"); - Gdx.app.getClipboard().setContents(discordURL); + Core.app.getClipboard().setContents(discordURL); } }); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java b/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java index b608f3527c..ed1b972a54 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/FileChooser.java @@ -1,23 +1,22 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.graphics.g2d.GlyphLayout; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.function.Predicate; +import io.anuke.arc.graphics.g2d.GlyphLayout; +import io.anuke.arc.scene.event.Touchable; +import io.anuke.arc.scene.ui.*; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.scene.utils.UIUtils; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.OS; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.pooling.Pools; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.Platform; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.function.Predicate; -import io.anuke.ucore.scene.event.Touchable; -import io.anuke.ucore.scene.ui.*; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.scene.utils.UIUtils; -import io.anuke.ucore.util.OS; -import io.anuke.ucore.util.Pooling; import java.util.Arrays; @@ -27,8 +26,8 @@ public class FileChooser extends FloatingDialog{ public static Predicate jpegFilter = file -> file.extension().equalsIgnoreCase("png") || file.extension().equalsIgnoreCase("jpg") || file.extension().equalsIgnoreCase("jpeg"); public static Predicate defaultFilter = file -> true; private Table files; - private FileHandle homeDirectory = Gdx.files.absolute(OS.isMac ? OS.getProperty("user.home") + "/Downloads/" : - Gdx.files.getExternalStoragePath()); + private FileHandle homeDirectory = Core.files.absolute(OS.isMac ? OS.getProperty("user.home") + "/Downloads/" : + Core.files.getExternalStoragePath()); private FileHandle directory = homeDirectory; private ScrollPane pane; private TextField navigation, filefield; @@ -74,7 +73,7 @@ public class FileChooser extends FloatingDialog{ cancel.clicked(this::hide); navigation = new TextField(""); - navigation.setTouchable(Touchable.disabled); + navigation.touchable(Touchable.disabled); files = new Table(); files.marginRight(10); @@ -82,7 +81,7 @@ public class FileChooser extends FloatingDialog{ pane = new ScrollPane(files){ public float getPrefHeight(){ - return Gdx.graphics.getHeight(); + return Core.graphics.getHeight(); } }; pane.setOverscroll(false, false); @@ -142,7 +141,7 @@ public class FileChooser extends FloatingDialog{ content.add(icontable).expandX().fillX(); content.row(); - content.center().add(pane).width(UIUtils.portrait() ? Gdx.graphics.getWidth() / Unit.dp.scl(1) : Gdx.graphics.getWidth() / Unit.dp.scl(2)).colspan(3).grow(); + content.center().add(pane).width(UIUtils.portrait() ? Core.graphics.getWidth() / Unit.dp.scl(1) : Core.graphics.getWidth() / Unit.dp.scl(2)).colspan(3).grow(); content.row(); if(!open){ @@ -179,9 +178,9 @@ public class FileChooser extends FloatingDialog{ //if is mac, don't display extra info since you can only ever go to downloads navigation.setText(OS.isMac ? directory.name() : directory.toString()); - GlyphLayout layout = Pooling.obtain(GlyphLayout.class, GlyphLayout::new); + GlyphLayout layout = Pools.obtain(GlyphLayout.class, GlyphLayout::new); - layout.setText(Core.font, navigation.getText()); + layout.setText(Core.scene.skin.getFont("default-font"), navigation.getText()); if(layout.width < navigation.getWidth()){ navigation.setCursorPosition(0); @@ -189,7 +188,7 @@ public class FileChooser extends FloatingDialog{ navigation.setCursorPosition(navigation.getText().length()); } - Pooling.free(layout); + Pools.free(layout); files.clearChildren(); files.top().left(); @@ -264,7 +263,7 @@ public class FileChooser extends FloatingDialog{ @Override public Dialog show(){ - Timers.runTask(2f, () -> { + Time.runTask(2f, () -> { content().clear(); setupWidgets(); super.show(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java index 600c59c193..1f7c789d38 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/FloatingDialog.java @@ -1,16 +1,15 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Input.Keys; -import com.badlogic.gdx.utils.Align; +import io.anuke.arc.Core; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.util.Align; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.EventType.ResizeEvent; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Events; -import io.anuke.ucore.scene.ui.Dialog; -import io.anuke.ucore.scene.ui.ScrollPane; +import io.anuke.arc.Events; +import io.anuke.arc.scene.ui.Dialog; +import io.anuke.arc.scene.ui.ScrollPane; import static io.anuke.mindustry.Vars.state; @@ -43,7 +42,7 @@ public class FloatingDialog extends Dialog{ boolean[] done = {false}; - shown(() -> Gdx.app.postRunnable(() -> + shown(() -> Core.app.post(() -> forEach(child -> { if(done[0]) return; @@ -67,8 +66,8 @@ public class FloatingDialog extends Dialog{ buttons().addImageTextButton("$text.back", "icon-arrow-left", 30f, this::hide).size(230f, 64f); keyDown(key -> { - if(key == Keys.ESCAPE || key == Keys.BACK) { - Gdx.app.postRunnable(this::hide); + if(key == KeyCode.ESCAPE || key == KeyCode.BACK) { + Core.app.post(this::hide); } }); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java index 64a8a21bec..484e8cad28 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/GenViewDialog.java @@ -1,23 +1,23 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Pixmap; -import com.badlogic.gdx.graphics.Pixmap.Format; -import com.badlogic.gdx.graphics.Texture; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.async.AsyncExecutor; +import io.anuke.arc.Core; +import io.anuke.arc.Graphics.Cursor.SystemCursor; +import io.anuke.arc.collection.Array; +import io.anuke.arc.collection.GridMap; +import io.anuke.arc.graphics.Pixmap; +import io.anuke.arc.graphics.Pixmap.Format; +import io.anuke.arc.graphics.Texture; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.scene.Element; +import io.anuke.arc.scene.event.InputEvent; +import io.anuke.arc.scene.event.InputListener; +import io.anuke.arc.util.async.AsyncExecutor; import io.anuke.mindustry.content.Items; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.generation.WorldGenerator.GenResult; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.ColorMapper; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.Element; -import io.anuke.ucore.scene.event.InputEvent; -import io.anuke.ucore.scene.event.InputListener; -import io.anuke.ucore.scene.utils.Cursors; -import io.anuke.ucore.util.GridMap; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.sectorSize; import static io.anuke.mindustry.Vars.world; @@ -37,13 +37,13 @@ public class GenViewDialog extends FloatingDialog{ float panX, panY; float lastX, lastY; int viewsize = 3; - AsyncExecutor async = new AsyncExecutor(Mathf.sqr(viewsize*2)); + AsyncExecutor async = new AsyncExecutor(viewsize*2 * viewsize*2); { addListener(new InputListener(){ @Override - public boolean touchDown(InputEvent event, float x, float y, int pointer, int button){ - Cursors.setHand(); + public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){ + Core.graphics.cursor(SystemCursor.hand); lastX = x; lastY = y; return true; @@ -59,8 +59,8 @@ public class GenViewDialog extends FloatingDialog{ } @Override - public void touchUp(InputEvent event, float x, float y, int pointer, int button){ - Cursors.restoreCursor(); + public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){ + Core.graphics.restoreCursor(); } }); } @@ -89,7 +89,7 @@ public class GenViewDialog extends FloatingDialog{ pixmap.drawPixel(i, sectorSize - 1 - j, ColorMapper.colorFor(result.floor, result.wall, Team.none, result.elevation, (byte)0)); } } - Gdx.app.postRunnable(() -> map.put(wx, wy, new Texture(pixmap))); + Core.app.post(() -> map.put(wx, wy, new Texture(pixmap))); return pixmap; }); @@ -99,7 +99,7 @@ public class GenViewDialog extends FloatingDialog{ float drawX = x + width/2f+ wx * padSectorSize - tx * padSectorSize - panX % padSectorSize; float drawY = y + height/2f + wy * padSectorSize - ty * padSectorSize - panY % padSectorSize; - Draw.rect(map.get(wx, wy), drawX, drawY, padSectorSize, padSectorSize); + Draw.rect(Draw.wrap(map.get(wx, wy)), drawX + padSectorSize/2f, drawY + padSectorSize/2f, padSectorSize, padSectorSize); } } } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/HostDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/HostDialog.java index b896ec75fd..5ea199b75d 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/HostDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/HostDialog.java @@ -1,14 +1,13 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.graphics.Color; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.scene.ui.ImageButton; +import io.anuke.arc.util.Strings; +import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.scene.ui.ImageButton; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Strings; import java.io.IOException; @@ -27,18 +26,18 @@ public class HostDialog extends FloatingDialog{ content().table(t -> { t.add("$text.name").padRight(10); - t.addField(Settings.getString("name"), text -> { + t.addField(Core.settings.getString("name"), text -> { player.name = text; - Settings.put("name", text); - Settings.save(); + Core.settings.put("name", text); + Core.settings.save(); ui.listfrag.rebuild(); }).grow().pad(8).get().setMaxLength(40); ImageButton button = t.addImageButton("white", "clear-full", 40, () -> { new ColorPickDialog().show(color -> { player.color.set(color); - Settings.putInt("color-0", Color.rgba8888(color)); - Settings.save(); + Core.settings.put("color-0", Color.rgba8888(color)); + Core.settings.save(); }); }).size(54f).get(); button.update(() -> button.getStyle().imageUpColor = player.color); @@ -49,18 +48,18 @@ public class HostDialog extends FloatingDialog{ content().add().width(65f); content().addButton("$text.host", () -> { - if(Settings.getString("name").trim().isEmpty()){ + if(Core.settings.getString("name").trim().isEmpty()){ ui.showInfo("$text.noname"); return; } ui.loadfrag.show("$text.hosting"); - Timers.runTask(5f, () -> { + Time.runTask(5f, () -> { try{ Net.host(Vars.port); player.isAdmin = true; }catch(IOException e){ - ui.showError(Bundles.format("text.server.error", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.server.error", Strings.parseException(e, false))); } ui.loadfrag.hide(); hide(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java index c81c77e13b..2489382a20 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/JoinDialog.java @@ -1,24 +1,23 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.MathUtils; -import com.badlogic.gdx.utils.Array; import io.anuke.annotations.Annotations.Serialize; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.scene.style.Drawable; +import io.anuke.arc.scene.ui.*; +import io.anuke.arc.scene.ui.layout.Cell; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.utils.UIUtils; +import io.anuke.arc.util.Strings; +import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.game.Version; import io.anuke.mindustry.net.Host; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.scene.style.Drawable; -import io.anuke.ucore.scene.ui.*; -import io.anuke.ucore.scene.ui.layout.Cell; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.utils.UIUtils; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Strings; import static io.anuke.mindustry.Vars.*; @@ -47,9 +46,9 @@ public class JoinDialog extends FloatingDialog{ add = new FloatingDialog("$text.joingame.title"); add.content().add("$text.joingame.ip").padRight(5f).left(); - TextField field = add.content().addField(Settings.getString("ip"), text -> { - Settings.putString("ip", text); - Settings.save(); + TextField field = add.content().addField(Core.settings.getString("ip"), text -> { + Core.settings.put("ip", text); + Core.settings.save(); }).size(320f, 54f).get(); Platform.instance.addDialog(field, 100); @@ -60,19 +59,19 @@ public class JoinDialog extends FloatingDialog{ add.buttons().addButton("$text.ok", () -> { if(renaming == null){ Server server = new Server(); - server.setIP(Settings.getString("ip")); + server.setIP(Core.settings.getString("ip")); servers.add(server); saveServers(); setupRemote(); refreshRemote(); }else{ - renaming.setIP(Settings.getString("ip")); + renaming.setIP(Core.settings.getString("ip")); saveServers(); setupRemote(); refreshRemote(); } add.hide(); - }).disabled(b -> Settings.getString("ip").isEmpty() || Net.active()); + }).disabled(b -> Core.settings.getString("ip").isEmpty() || Net.active()); add.shown(() -> { add.getTitleLabel().setText(renaming != null ? "$text.server.edit" : "$text.server.add"); @@ -145,23 +144,23 @@ public class JoinDialog extends FloatingDialog{ void refreshServer(Server server){ server.content.clear(); - server.content.label(() -> Bundles.get("text.server.refreshing") + Strings.animated(4, 11, ".")); + server.content.label(() -> Core.bundle.get("text.server.refreshing") + Strings.animated(Time.time(), 4, 11, ".")); Net.pingHost(server.ip, server.port, host -> { String versionString; if(host.version == -1){ - versionString = Bundles.format("text.server.version", Bundles.get("text.server.custombuild"), ""); + versionString = Core.bundle.format("text.server.version", Core.bundle.get("text.server.custombuild"), ""); }else if(host.version == 0){ - versionString = Bundles.get("text.server.outdated"); + versionString = Core.bundle.get("text.server.outdated"); }else if(host.version < Version.build && Version.build != -1){ - versionString = Bundles.get("text.server.outdated") + "\n" + - Bundles.format("text.server.version", host.version, ""); + versionString = Core.bundle.get("text.server.outdated") + "\n" + + Core.bundle.format("text.server.version", host.version, ""); }else if(host.version > Version.build && Version.build != -1){ - versionString = Bundles.get("text.server.outdated.client") + "\n" + - Bundles.format("text.server.version", host.version, ""); + versionString = Core.bundle.get("text.server.outdated.client") + "\n" + + Core.bundle.format("text.server.version", host.version, ""); }else{ - versionString = Bundles.format("text.server.version", host.version, host.versionType); + versionString = Core.bundle.format("text.server.version", host.version, host.versionType); } server.content.clear(); @@ -169,12 +168,12 @@ public class JoinDialog extends FloatingDialog{ server.content.table(t -> { t.add(versionString).left(); t.row(); - t.add("[lightgray]" + Bundles.format("text.server.hostname", host.name)).left(); + t.add("[lightgray]" + Core.bundle.format("text.server.hostname", host.name)).left(); t.row(); - t.add("[lightgray]" + (host.players != 1 ? Bundles.format("text.players", host.players) : - Bundles.format("text.players.single", host.players))).left(); + t.add("[lightgray]" + (host.players != 1 ? Core.bundle.format("text.players", host.players) : + Core.bundle.format("text.players.single", host.players))).left(); t.row(); - t.add("[lightgray]" + Bundles.format("text.save.map", host.mapname) + " / " + Bundles.format("text.save.wave", host.wave)).left(); + t.add("[lightgray]" + Core.bundle.format("text.save.map", host.mapname) + " / " + Core.bundle.format("text.save.wave", host.wave)).left(); }).expand().left().bottom().padLeft(12f).padBottom(8); }, e -> { @@ -204,17 +203,17 @@ public class JoinDialog extends FloatingDialog{ content().clear(); content().table(t -> { t.add("$text.name").padRight(10); - t.addField(Settings.getString("name"), text -> { + t.addField(Core.settings.getString("name"), text -> { player.name = text; - Settings.put("name", text); - Settings.save(); + Core.settings.put("name", text); + Core.settings.save(); }).grow().pad(8).get().setMaxLength(maxNameLength); ImageButton button = t.addImageButton("white", "clear-full", 40, () -> { new ColorPickDialog().show(color -> { player.color.set(color); - Settings.putInt("color-0", Color.rgba8888(color)); - Settings.save(); + Core.settings.put("color-0", Color.rgba8888(color)); + Core.settings.save(); }); }).size(54f).get(); button.update(() -> button.getStyle().imageUpColor = player.color); @@ -233,9 +232,9 @@ public class JoinDialog extends FloatingDialog{ pad = 6; } - Cell cell = ((Table) pane.getParent()).getCell(button); + Cell cell = ((Table) pane.getParent()).getCell(button); - if(!MathUtils.isEqual(cell.getMinWidth(), pw)){ + if(!Mathf.isEqual(cell.getMinWidth(), pw)){ cell.width(pw); cell.padLeft(pad); pane.getParent().invalidateHierarchy(); @@ -248,7 +247,7 @@ public class JoinDialog extends FloatingDialog{ local.clear(); local.background((Drawable)null); - local.table("button", t -> t.label(() -> "[accent]" + Bundles.get("text.hosts.discovering") + Strings.animated(4, 10f, ".")).pad(10f)).growX(); + local.table("button", t -> t.label(() -> "[accent]" + Core.bundle.get("text.hosts.discovering") + Strings.animated(Time.time(), 4, 10f, ".")).pad(10f)).growX(); Net.discoverServers(this::addLocalHost, this::finishLocalHosts); } @@ -278,14 +277,12 @@ public class JoinDialog extends FloatingDialog{ .width(w).height(80f).pad(4f).get(); button.left(); button.row(); - button.add("[lightgray]" + (host.players != 1 ? Bundles.format("text.players", host.players) : - Bundles.format("text.players.single", host.players))); - button.row(); - button.add("[lightgray]" + host.address).pad(4).left(); + button.add("[lightgray]" + (host.players != 1 ? Core.bundle.format("text.players", host.players) : + Core.bundle.format("text.players.single", host.players))).padBottom(5); } void connect(String ip, int port){ - if(Settings.getString("name").trim().isEmpty()){ + if(Core.settings.getString("name").trim().isEmpty()){ ui.showInfo("$text.noname"); return; } @@ -297,7 +294,7 @@ public class JoinDialog extends FloatingDialog{ netClient.disconnectQuietly(); }); - Timers.runTask(2f, () -> { + Time.runTask(2f, () -> { Vars.netClient.beginConnecting(); Net.connect(ip, port, () -> { hide(); @@ -310,13 +307,14 @@ public class JoinDialog extends FloatingDialog{ return UIUtils.portrait() ? 350f : 500f; } + @SuppressWarnings("unchecked") private void loadServers(){ - servers = Settings.getObject("server-list", Array.class, Array::new); + servers = Core.settings.getObject("server-list", Array.class, Array::new); } private void saveServers(){ - Settings.putObject("server-list", servers); - Settings.save(); + Core.settings.putObject("server-list", servers); + Core.settings.save(); } @Serialize diff --git a/core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java index a7a05f4433..d0f1afae98 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/LanguageDialog.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.ui.dialogs; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.scene.ui.ButtonGroup; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Log; +import io.anuke.arc.Core; +import io.anuke.arc.scene.ui.ButtonGroup; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Log; import java.util.Locale; @@ -33,8 +33,8 @@ public class LanguageDialog extends FloatingDialog{ TextButton button = new TextButton(loc.getDisplayName(loc), "toggle"); button.clicked(() -> { if(getLocale().equals(loc)) return; - Settings.putString("locale", loc.toString()); - Settings.save(); + Core.settings.put("locale", loc.toString()); + Core.settings.save(); Log.info("Setting locale: {0}", loc.toString()); ui.showInfo("$text.language.restart"); }); @@ -45,7 +45,7 @@ public class LanguageDialog extends FloatingDialog{ } public Locale getLocale(){ - String loc = Settings.getString("locale"); + String loc = Core.settings.getString("locale"); if(loc.equals("default")){ findClosestLocale(); @@ -67,7 +67,7 @@ public class LanguageDialog extends FloatingDialog{ //check exact locale for(Locale l : locales){ if(l.equals(Locale.getDefault())){ - Settings.putString("locale", l.toString()); + Core.settings.put("locale", l.toString()); return; } } @@ -75,11 +75,11 @@ public class LanguageDialog extends FloatingDialog{ //find by language for(Locale l : locales){ if(l.getLanguage().equals(Locale.getDefault().getLanguage())){ - Settings.putString("locale", l.toString()); + Core.settings.put("locale", l.toString()); return; } } - Settings.putString("locale", new Locale("en").toString()); + Core.settings.put("locale", new Locale("en").toString()); } } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/LoadDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/LoadDialog.java index d402ed9eeb..05a869e6ff 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/LoadDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/LoadDialog.java @@ -1,21 +1,19 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.collection.Array; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.io.SaveIO; import io.anuke.mindustry.game.Saves.SaveSlot; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Strings; +import io.anuke.arc.util.Time; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Strings; import java.io.IOException; @@ -35,7 +33,7 @@ public class LoadDialog extends FloatingDialog{ shown(() -> { setup(); - Timers.runTask(2f, () -> Core.scene.setScrollFocus(pane)); + Time.runTask(2f, () -> Core.scene.setScrollFocus(pane)); }); addCloseButton(); @@ -51,7 +49,7 @@ public class LoadDialog extends FloatingDialog{ slots.marginRight(24); - Timers.runTask(2f, () -> Core.scene.setScrollFocus(pane)); + Time.runTask(2f, () -> Core.scene.setScrollFocus(pane)); Array array = control.saves.getSaveSlots(); @@ -88,21 +86,21 @@ public class LoadDialog extends FloatingDialog{ t.addImageButton("icon-save", "empty", 14 * 3, () -> { if(!ios){ - Platform.instance.showFileChooser(Bundles.get("text.save.export"), "Mindustry Save", file -> { + Platform.instance.showFileChooser(Core.bundle.get("text.save.export"), "Mindustry Save", file -> { try{ slot.exportFile(file); setup(); }catch(IOException e){ - ui.showError(Bundles.format("text.save.export.fail", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.save.export.fail", Strings.parseException(e, false))); } }, false, saveExtension); }else{ try{ - FileHandle file = Gdx.files.local("save-" + slot.getName() + "." + Vars.saveExtension); + FileHandle file = Core.files.local("save-" + slot.getName() + "." + Vars.saveExtension); slot.exportFile(file); Platform.instance.shareFile(file); }catch(Exception e){ - ui.showError(Bundles.format("text.save.export.fail", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.save.export.fail", Strings.parseException(e, false))); } } }).size(14 * 3).right(); @@ -114,19 +112,19 @@ public class LoadDialog extends FloatingDialog{ button.defaults().padBottom(3); button.row(); - button.add(Bundles.format("text.save.map", color + (slot.getMap() == null ? "Unknown" : slot.getMap().meta.name()))); + button.add(Core.bundle.format("text.save.map", color + (slot.getMap() == null ? "Unknown" : slot.getMap().meta.name()))); button.row(); - button.add(Bundles.get("text.level.mode") + " " + color + slot.getMode()); + button.add(Core.bundle.get("text.level.mode") + " " + color + slot.getMode()); button.row(); - button.add(Bundles.format("text.save.wave", color + slot.getWave())); + button.add(Core.bundle.format("text.save.wave", color + slot.getWave())); button.row(); - button.add(Bundles.format("text.save.difficulty", color + slot.getDifficulty())); + button.add(Core.bundle.format("text.save.difficulty", color + slot.getDifficulty())); button.row(); - button.label(() -> Bundles.format("text.save.autosave", color + Bundles.get(slot.isAutosave() ? "text.on" : "text.off"))); + button.label(() -> Core.bundle.format("text.save.autosave", color + Core.bundle.get(slot.isAutosave() ? "text.on" : "text.off"))); button.row(); - button.label(() -> Bundles.format("text.save.playtime", color + slot.getPlayTime())); + button.label(() -> Core.bundle.format("text.save.playtime", color + slot.getPlayTime())); button.row(); - button.add(Bundles.format("text.save.date", color + slot.getDate())).colspan(2).padTop(5).right(); + button.add(Core.bundle.format("text.save.date", color + slot.getDate())).colspan(2).padTop(5).right(); button.row(); modifyButton(button, slot); @@ -155,14 +153,14 @@ public class LoadDialog extends FloatingDialog{ if(ios) return; slots.addImageTextButton("$text.save.import", "icon-add", 14 * 3, () -> { - Platform.instance.showFileChooser(Bundles.get("text.save.import"), "Mindustry Save", file -> { + Platform.instance.showFileChooser(Core.bundle.get("text.save.import"), "Mindustry Save", file -> { if(SaveIO.isSaveValid(file)){ try{ control.saves.importSave(file); setup(); }catch(IOException e){ e.printStackTrace(); - ui.showError(Bundles.format("text.save.import.fail", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.save.import.fail", Strings.parseException(e, false))); } }else{ ui.showError("$text.save.import.invalid"); @@ -183,7 +181,7 @@ public class LoadDialog extends FloatingDialog{ Log.err(e); state.set(State.menu); logic.reset(); - threads.runGraphics(() -> ui.showError("$text.save.corrupted")); + ui.showError("$text.save.corrupted"); } }); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/LocalPlayerDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/LocalPlayerDialog.java index 7ef5786ee3..91c64ca57b 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/LocalPlayerDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/LocalPlayerDialog.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.utils.Scaling; +import io.anuke.arc.Core; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.layout.Stack; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Scaling; import io.anuke.mindustry.entities.Player; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.layout.Stack; -import io.anuke.ucore.scene.ui.layout.Table; import static io.anuke.mindustry.Vars.control; import static io.anuke.mindustry.Vars.players; @@ -39,7 +39,7 @@ public class LocalPlayerDialog extends FloatingDialog{ stack.add(new Image("button")); - Image img = new Image(Draw.region("icon-chat")); + Image img = new Image(Core.atlas.find("icon-chat")); img.setScaling(Scaling.fill); stack.add(img); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/MapsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/MapsDialog.java index bed08f9954..c867781c6d 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/MapsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/MapsDialog.java @@ -1,7 +1,16 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.Scaling; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.scene.event.Touchable; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.utils.UIUtils; +import io.anuke.arc.util.Log; +import io.anuke.arc.util.Scaling; +import io.anuke.arc.util.Strings; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.io.MapIO; @@ -9,15 +18,6 @@ import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.maps.MapMeta; import io.anuke.mindustry.maps.MapTileData; import io.anuke.mindustry.ui.BorderImage; -import io.anuke.ucore.scene.event.Touchable; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.utils.UIUtils; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Log; -import io.anuke.ucore.util.Strings; import java.io.DataInputStream; @@ -41,7 +41,7 @@ public class MapsDialog extends FloatingDialog{ String name = meta.tags.get("name", file.nameWithoutExtension()); if(world.maps.getByName(name) != null && !world.maps.getByName(name).custom){ - ui.showError(Bundles.format("text.editor.import.exists", name)); + ui.showError(Core.bundle.format("text.editor.import.exists", name)); }else if(world.maps.getByName(name) != null){ ui.showConfirm("$text.confirm", "$text.editor.overwrite.confirm", () -> { world.maps.saveMap(name, data, meta.tags); @@ -53,7 +53,7 @@ public class MapsDialog extends FloatingDialog{ } }catch(Exception e){ - ui.showError(Bundles.format("text.editor.errorimageload", Strings.parseException(e, false))); + ui.showError(Core.bundle.format("text.editor.errorimageload", Strings.parseException(e, false))); Log.err(e); } }, true, mapExtension); @@ -158,7 +158,7 @@ public class MapsDialog extends FloatingDialog{ }).fillX().height(54f).marginLeft(10); table.addImageTextButton("$text.delete", "icon-trash-16", 16 * 2, () -> { - ui.showConfirm("$text.confirm", Bundles.format("text.map.delete", map.name), () -> { + ui.showConfirm("$text.confirm", Core.bundle.format("text.map.delete", map.name), () -> { world.maps.removeMap(map); dialog.hide(); setup(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/MissionDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/MissionDialog.java index d41b2b7480..00b3d87fea 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/MissionDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/MissionDialog.java @@ -1,8 +1,8 @@ package io.anuke.mindustry.ui.dialogs; +import io.anuke.arc.Core; import io.anuke.mindustry.Vars; import io.anuke.mindustry.maps.Sector; -import io.anuke.ucore.util.Bundles; public class MissionDialog extends FloatingDialog{ @@ -23,7 +23,7 @@ public class MissionDialog extends FloatingDialog{ buttons().addButton("$text.continue", this::hide).size(190f, 64f); - content().add(Bundles.format("text.mission.complete.body", sector.x, sector.y)).pad(10); + content().add(Core.bundle.format("text.mission.complete.body", sector.x, sector.y)).pad(10); show(); } } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java index fc6b0ad57a..e5986a7b0d 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Input.Keys; +import io.anuke.arc.Core; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.scene.style.Drawable; +import io.anuke.arc.scene.ui.layout.Table; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.scene.style.Drawable; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; import static io.anuke.mindustry.Vars.*; @@ -22,7 +22,7 @@ public class PausedDialog extends FloatingDialog{ shown(this::rebuild); keyDown(key -> { - if(key == Keys.ESCAPE || key == Keys.BACK) { + if(key == KeyCode.ESCAPE || key == KeyCode.BACK) { hide(); } }); @@ -33,7 +33,7 @@ public class PausedDialog extends FloatingDialog{ missionTable.background((Drawable) null); if(world.getSector() != null){ missionTable.background("underline"); - missionTable.add(Bundles.format("text.sector", world.getSector().x + ", " + world.getSector().y)); + missionTable.add(Core.bundle.format("text.sector", world.getSector().x + ", " + world.getSector().y)); } } @@ -111,7 +111,7 @@ public class PausedDialog extends FloatingDialog{ control.saves.getCurrent().save(); }catch(Throwable e){ e.printStackTrace(); - threads.runGraphics(() -> ui.showError("[accent]" + Bundles.get("text.savefail"))); + ui.showError("[accent]" + Core.bundle.get("text.savefail")); } state.set(State.menu); }); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/RestartDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/RestartDialog.java index f61cc21a4d..1a7551ec41 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/RestartDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/RestartDialog.java @@ -1,9 +1,9 @@ package io.anuke.mindustry.ui.dialogs; +import io.anuke.arc.Core; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.maps.Sector; -import io.anuke.ucore.util.Bundles; import static io.anuke.mindustry.Vars.*; @@ -28,7 +28,7 @@ public class RestartDialog extends FloatingDialog{ buttons().margin(10); if(state.mode.isPvp){ - content().add(Bundles.format("text.gameover.pvp",winner.localized())).pad(6); + content().add(Core.bundle.format("text.gameover.pvp",winner.localized())).pad(6); buttons().addButton("$text.menu", () -> { hide(); state.set(State.menu); @@ -39,7 +39,7 @@ public class RestartDialog extends FloatingDialog{ content().add("$text.highscore").pad(6); content().row(); } - content().add(Bundles.format("text.wave.lasted", state.wave)).pad(12); + content().add(Core.bundle.format("text.wave.lasted", state.wave)).pad(12); buttons().addButton("$text.menu", () -> { hide(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/SaveDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/SaveDialog.java index 92ffff5f7a..3f49831173 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/SaveDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/SaveDialog.java @@ -1,10 +1,10 @@ package io.anuke.mindustry.ui.dialogs; +import io.anuke.arc.Core; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.util.Time; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.Saves.SaveSlot; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.util.Bundles; import static io.anuke.mindustry.Vars.*; @@ -26,7 +26,7 @@ public class SaveDialog extends LoadDialog{ ui.showTextInput("$text.save", "$text.save.newslot", "", text -> { ui.loadGraphics("$text.saving", () -> { control.saves.addSave(text); - threads.runGraphics(() -> threads.run(() -> threads.runGraphics(this::setup))); + Core.app.post(() -> Core.app.post(this::setup)); }); }) ).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4); @@ -45,7 +45,7 @@ public class SaveDialog extends LoadDialog{ ui.loadfrag.show("$text.saveload"); - Timers.runTask(5f, () -> { + Time.runTask(5f, () -> { hide(); ui.loadfrag.hide(); try{ @@ -53,7 +53,7 @@ public class SaveDialog extends LoadDialog{ }catch(Throwable e){ e.printStackTrace(); - ui.showError("[accent]" + Bundles.get("text.savefail")); + ui.showError("[accent]" + Core.bundle.get("text.savefail")); } }); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/SectorsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/SectorsDialog.java index 1ea6ed5d04..32c7cfda8f 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/SectorsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/SectorsDialog.java @@ -1,27 +1,24 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Align; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.math.geom.Geometry; +import io.anuke.arc.math.geom.Point2; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.scene.Element; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.event.InputEvent; +import io.anuke.arc.scene.event.InputListener; +import io.anuke.arc.scene.event.Touchable; +import io.anuke.arc.scene.ui.layout.Cell; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.util.Align; import io.anuke.mindustry.Vars; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.maps.Sector; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.scene.Element; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.event.InputEvent; -import io.anuke.ucore.scene.event.InputListener; -import io.anuke.ucore.scene.event.Touchable; -import io.anuke.ucore.scene.ui.layout.Cell; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.scene.utils.Cursors; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.world; @@ -54,7 +51,7 @@ public class SectorsDialog extends FloatingDialog{ }); Group container = new Group(); - container.setTouchable(Touchable.childrenOnly); + container.touchable(Touchable.childrenOnly); container.addChild(table); margin(0); @@ -84,16 +81,16 @@ public class SectorsDialog extends FloatingDialog{ table.background("button").margin(5); table.defaults().pad(3); - table.add(Bundles.format("text.sector", sector.x + ", " + sector.y)); + table.add(Core.bundle.format("text.sector", sector.x + ", " + sector.y)); table.row(); if(selected.completedMissions < selected.missions.size && !selected.complete){ - table.labelWrap(Bundles.format("text.mission", selected.getDominantMission().menuDisplayString())).growX(); + table.labelWrap(Core.bundle.format("text.mission", selected.getDominantMission().menuDisplayString())).growX(); table.row(); } if(selected.hasSave()){ - table.labelWrap(Bundles.format("text.sector.time", selected.getSave().getPlayTime())).growX(); + table.labelWrap(Core.bundle.format("text.sector.time", selected.getSave().getPlayTime())).growX(); table.row(); } @@ -118,7 +115,7 @@ public class SectorsDialog extends FloatingDialog{ }).pad(-5).growX().padTop(0); table.pack(); - table.act(Gdx.graphics.getDeltaTime()); + table.act(Core.graphics.getDeltaTime()); } public Sector getSelected(){ @@ -133,7 +130,7 @@ public class SectorsDialog extends FloatingDialog{ SectorView(){ addListener(new InputListener(){ @Override - public boolean touchDown(InputEvent event, float x, float y, int pointer, int button){ + public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){ if(pointer != 0) return false; //Cursors.setHand(); lastX = x; @@ -152,18 +149,38 @@ public class SectorsDialog extends FloatingDialog{ } @Override - public void touchUp(InputEvent event, float x, float y, int pointer, int button){ + public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){ if(pointer != 0) return; - Cursors.restoreCursor(); + //Cursors.restoreCursor(); } }); clicked(() -> clicked = true); + + this.focus(); + } + + private void focus(){ + Sector focusSector = null; + long newestTimestamp = 0; + for(Sector sector : world.sectors.getSectors()){ + if(sector.hasSave()){ + long timestamp = sector.getSave().getTimestamp(); + if(timestamp > newestTimestamp){ + focusSector = sector; + newestTimestamp = timestamp; + } + } + } + if(focusSector != null) { + panX = (focusSector.x + 0.5f) * sectorSize; + panY = (focusSector.y + 0.5f) * sectorSize; + } } @Override public void draw(){ - Draw.alpha(alpha); + Draw.alpha(parentAlpha); int shownSectorsX = (int)(width/sectorSize); int shownSectorsY = (int)(height/sectorSize); @@ -171,7 +188,7 @@ public class SectorsDialog extends FloatingDialog{ int offsetX = (int)(panX / sectorSize); int offsetY = (int)(panY / sectorSize); - Vector2 mouse = Graphics.mouse(); + Vector2 mouse = Core.input.mouse(); for(int x = -shownSectorsX; x <= shownSectorsX; x++){ for(int y = -shownSectorsY; y <= shownSectorsY; y++){ @@ -185,13 +202,13 @@ public class SectorsDialog extends FloatingDialog{ if(sector == null || sector.texture == null){ Draw.reset(); - Draw.rect("empty-sector", drawX, drawY, sectorSize, sectorSize); + Draw.rect(("empty-sector"), drawX, drawY, sectorSize, sectorSize); int i = 0; - for(GridPoint2 point : Geometry.d4){ + for(Point2 point : Geometry.d4){ Sector other = world.sectors.get(sectorX + point.x, sectorY + point.y); if(other != null){ - Draw.rect("sector-edge", drawX, drawY, sectorSize, sectorSize, i*90); + Draw.rect(("sector-edge"), drawX, drawY, sectorSize, sectorSize, i*90); } i ++; @@ -200,7 +217,7 @@ public class SectorsDialog extends FloatingDialog{ } Draw.colorl(!sector.complete ? 0.3f : 1f); - Draw.rect(sector.texture, drawX, drawY, sectorSize, sectorSize); + Draw.rect(Draw.wrap(sector.texture), drawX, drawY, sectorSize, sectorSize); if(sector.missions.size == 0) continue; @@ -216,8 +233,8 @@ public class SectorsDialog extends FloatingDialog{ if(sector == selected){ selectColor = Palette.accent; - }else if(Mathf.inRect(mouse.x, mouse.y, drawX - sectorSize / 2f, drawY - sectorSize / 2f, - drawX + sectorSize / 2f, drawY + sectorSize / 2f)){ + }else if(mouse.x > drawX - sectorSize / 2f && mouse.y > drawY - sectorSize / 2f + && mouse.x < drawX + sectorSize / 2f && mouse.y < drawY + sectorSize / 2f){ if(clicked){ selectSector(sector); } @@ -233,16 +250,16 @@ public class SectorsDialog extends FloatingDialog{ } Draw.color(selectColor); - Draw.rect("sector-select", drawX, drawY, sectorSize, sectorSize); + Draw.rect(("sector-select"), drawX, drawY, sectorSize, sectorSize); Draw.color(backColor); Draw.alpha(0.75f * backColor.a); - Draw.rect("icon-mission-background", drawX, drawY, Unit.dp.scl(18f * 5), Unit.dp.scl(18f * 5)); + Draw.rect(("icon-mission-background"), drawX, drawY, Unit.dp.scl(18f * 5), Unit.dp.scl(18f * 5)); float size = Unit.dp.scl(10f * 5); Draw.color(iconColor); - Draw.rect(region, drawX, drawY, size, size); + Draw.rect((region), drawX, drawY, size, size); } } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java index c088808401..b9482a6ea2 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -1,30 +1,24 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Input.Keys; -import com.badlogic.gdx.files.FileHandle; -import com.badlogic.gdx.utils.Align; +import io.anuke.arc.Core; +import io.anuke.arc.collection.ObjectMap; +import io.anuke.arc.files.FileHandle; +import io.anuke.arc.function.Consumer; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.scene.Element; +import io.anuke.arc.scene.event.InputEvent; +import io.anuke.arc.scene.event.InputListener; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.SettingsDialog; +import io.anuke.arc.scene.ui.SettingsDialog.SettingsTable.Setting; +import io.anuke.arc.scene.ui.Slider; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Align; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.function.Consumer; -import io.anuke.ucore.scene.Element; -import io.anuke.ucore.scene.event.InputEvent; -import io.anuke.ucore.scene.event.InputListener; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.SettingsDialog; -import io.anuke.ucore.scene.ui.SettingsDialog.SettingsTable.Setting; -import io.anuke.ucore.scene.ui.Slider; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Mathf; - -import java.util.HashMap; -import java.util.Map; import static io.anuke.mindustry.Vars.*; @@ -38,7 +32,7 @@ public class SettingsMenuDialog extends SettingsDialog{ private boolean wasPaused; public SettingsMenuDialog(){ - setStyle(Core.skin.get("dialog", WindowStyle.class)); + setStyle(Core.scene.skin.get("dialog", WindowStyle.class)); hidden(() -> { if(!state.is(State.menu)){ @@ -98,7 +92,7 @@ public class SettingsMenuDialog extends SettingsDialog{ ScrollPane pane = new ScrollPane(prefs); pane.addCaptureListener(new InputListener(){ @Override - public boolean touchDown(InputEvent event, float x, float y, int pointer, int button){ + public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){ Element actor = pane.hit(x, y, true); if(actor instanceof Slider){ pane.setFlickScroll(false); @@ -109,7 +103,7 @@ public class SettingsMenuDialog extends SettingsDialog{ } @Override - public void touchUp(InputEvent event, float x, float y, int pointer, int button){ + public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){ pane.setFlickScroll(true); super.touchUp(event, x, y, pointer, button); } @@ -127,14 +121,15 @@ public class SettingsMenuDialog extends SettingsDialog{ } void addSettings(){ - sound.volumePrefs(); + //TODO add when sound works again + //sound.volumePrefs(); game.screenshakePref(); game.checkPref("effects", true); if(mobile){ game.checkPref("autotarget", true); } - game.sliderPref("saveinterval", 120, 10, 5 * 120, i -> Bundles.format("setting.seconds", i)); + game.sliderPref("saveinterval", 120, 10, 5 * 120, i -> Core.bundle.format("setting.seconds", i)); if(!mobile){ game.checkPref("crashreport", true); @@ -164,21 +159,21 @@ public class SettingsMenuDialog extends SettingsDialog{ dialog.content().row(); dialog.content().addButton("$text.settings.clearall", () -> { ui.showConfirm("$text.confirm", "$text.settings.clearall.confirm", () -> { - Map map = new HashMap<>(); - for(String value : Settings.prefs().get().keySet()){ + ObjectMap map = new ObjectMap<>(); + for(String value : Core.settings.keys()){ if(value.contains("usid") || value.contains("uuid")){ - map.put(value, Settings.prefs().getString(value)); + map.put(value, Core.settings.getString(value)); } } - Settings.prefs().clear(); - Settings.prefs().put(map); - Settings.save(); + Core.settings.clear(); + Core.settings.putAll(map); + Core.settings.save(); for(FileHandle file : dataDirectory.list()){ file.deleteDirectory(); } - Gdx.app.exit(); + Core.app.exit(); }); }); dialog.content().row(); @@ -189,21 +184,21 @@ public class SettingsMenuDialog extends SettingsDialog{ } }); - graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Bundles.get("setting.fpscap.none") : Bundles.format("setting.fpscap.text", s))); + graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Core.bundle.get("setting.fpscap.none") : Core.bundle.format("setting.fpscap.text", s))); if(!mobile){ - graphics.checkPref("vsync", true, b -> Gdx.graphics.setVSync(b)); + graphics.checkPref("vsync", true, b -> Core.graphics.setVSync(b)); graphics.checkPref("fullscreen", false, b -> { if(b){ - Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + Core.graphics.setFullscreenMode(Core.graphics.getDisplayMode()); }else{ - Gdx.graphics.setWindowedMode(600, 480); + Core.graphics.setWindowedMode(600, 480); } }); - Gdx.graphics.setVSync(Settings.getBool("vsync")); - if(Settings.getBool("fullscreen")){ - Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); + Core.graphics.setVSync(Core.settings.getBool("vsync")); + if(Core.settings.getBool("fullscreen")){ + Core.graphics.setFullscreenMode(Core.graphics.getDisplayMode()); } } @@ -220,7 +215,7 @@ public class SettingsMenuDialog extends SettingsDialog{ private void visible(int index){ prefs.clearChildren(); - Table table = Mathf.select(index, game, graphics, sound); + Table table = new Table[]{game, graphics, sound}[index]; prefs.add(table); } @@ -229,7 +224,7 @@ public class SettingsMenuDialog extends SettingsDialog{ buttons().addImageTextButton("$text.menu", "icon-arrow-left", 30f, this::hide).size(230f, 64f); keyDown(key -> { - if(key == Keys.ESCAPE || key == Keys.BACK) + if(key == KeyCode.ESCAPE || key == KeyCode.BACK) hide(); }); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/TraceDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/TraceDialog.java index 7c58101b03..cbb7d5897a 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/TraceDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/TraceDialog.java @@ -17,15 +17,15 @@ public class TraceDialog extends FloatingDialog{ /* table.defaults().left(); - table.add(Bundles.format("text.trace.playername", player.name)); + table.add(Core.bundle.format("text.trace.playername", player.name)); table.row(); - table.add(Bundles.format("text.trace.ip", info.ip)); + table.add(Core.bundle.format("text.trace.ip", info.ip)); table.row(); - table.add(Bundles.format("text.trace.id", info.uuid)); + table.add(Core.bundle.format("text.trace.id", info.uuid)); table.row(); - table.add(Bundles.format("text.trace.modclient", info.modclient)); + table.add(Core.bundle.format("text.trace.modclient", info.modclient)); table.row(); - table.add(Bundles.format("text.trace.android", info.android)); + table.add(Core.bundle.format("text.trace.android", info.android)); table.row(); table.add().pad(5); @@ -33,19 +33,19 @@ public class TraceDialog extends FloatingDialog{ //disabled until further notice /* - table.add(Bundles.format("text.trace.totalblocksbroken", info.totalBlocksBroken)); + table.add(Core.bundle.format("text.trace.totalblocksbroken", info.totalBlocksBroken)); table.row(); - table.add(Bundles.format("text.trace.structureblocksbroken", info.structureBlocksBroken)); + table.add(Core.bundle.format("text.trace.structureblocksbroken", info.structureBlocksBroken)); table.row(); - table.add(Bundles.format("text.trace.lastblockbroken", info.lastBlockBroken.formalName)); + table.add(Core.bundle.format("text.trace.lastblockbroken", info.lastBlockBroken.formalName)); table.row(); table.add().pad(5); table.row(); - table.add(Bundles.format("text.trace.totalblocksplaced", info.totalBlocksPlaced)); + table.add(Core.bundle.format("text.trace.totalblocksplaced", info.totalBlocksPlaced)); table.row(); - table.add(Bundles.format("text.trace.lastblockplaced", info.lastBlockPlaced.formalName)); + table.add(Core.bundle.format("text.trace.lastblockplaced", info.lastBlockPlaced.formalName)); table.row(); content().add(table); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/UnlocksDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/UnlocksDialog.java index a1d58ea766..1c300a2d8e 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/UnlocksDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/UnlocksDialog.java @@ -1,17 +1,17 @@ package io.anuke.mindustry.ui.dialogs; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.collection.Array; import io.anuke.mindustry.Vars; import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.UnlockableContent; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.type.ContentType; -import io.anuke.ucore.scene.event.HandCursorListener; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.ScrollPane; -import io.anuke.ucore.scene.ui.Tooltip; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.utils.UIUtils; +import io.anuke.arc.scene.event.HandCursorListener; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.ScrollPane; +import io.anuke.arc.scene.ui.Tooltip; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.utils.UIUtils; import static io.anuke.mindustry.Vars.content; import static io.anuke.mindustry.Vars.control; diff --git a/core/src/io/anuke/mindustry/ui/fragments/BackgroundFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BackgroundFragment.java index ab5cfec300..de0b8851cb 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BackgroundFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BackgroundFragment.java @@ -1,16 +1,13 @@ package io.anuke.mindustry.ui.fragments; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.arc.Core; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.ui.layout.Unit; import io.anuke.mindustry.core.GameState.State; -import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.Shaders; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Fill; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.ui.layout.Unit; import static io.anuke.mindustry.Vars.state; @@ -18,24 +15,21 @@ public class BackgroundFragment extends Fragment{ @Override public void build(Group parent){ - Core.scene.table().addRect((a, b, w, h) -> { Draw.colorl(0.1f); Fill.crect(0, 0, w, h); - Draw.color(Palette.accent); - Graphics.shader(Shaders.menu); + Draw.shader(Shaders.menu); Fill.crect(0, 0, w, h); - Graphics.shader(); - Draw.color(); + Draw.shader(); - boolean portrait = Gdx.graphics.getWidth() < Gdx.graphics.getHeight(); - float logoscl = (int) Unit.dp.scl(7) * (portrait ? 5f / 7f : 1f); - TextureRegion logo = Core.skin.getRegion("logotext"); - float logow = logo.getRegionWidth() * logoscl; - float logoh = logo.getRegionHeight() * logoscl; + boolean portrait = Core.graphics.getWidth() < Core.graphics.getHeight(); + float logoscl = (int) Unit.dp.scl(1); + TextureRegion logo = Core.atlas.find("logotext"); + float logow = logo.getWidth() * logoscl; + float logoh = logo.getHeight() * logoscl; Draw.color(); - Core.batch.draw(logo, (int) (w / 2 - logow / 2), (int) (h - logoh + 15 - Unit.dp.scl(portrait ? 30f : 0)), logow, logoh); + Draw.rect(logo, (int) (w / 2), (int) (h - 10 - logoh - Unit.dp.scl(portrait ? 30f : 0)) + logoh/2, logow, logoh); }).visible(() -> state.is(State.menu)).grow(); } } diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java index b122811e16..3a0c43a706 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java @@ -1,20 +1,18 @@ package io.anuke.mindustry.ui.fragments; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.math.Interpolation; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Align; +import io.anuke.arc.Core; +import io.anuke.arc.math.Interpolation; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.scene.Element; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.actions.Actions; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Align; import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.input.InputHandler; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.scene.Element; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.actions.Actions; -import io.anuke.ucore.scene.ui.layout.Table; import static io.anuke.mindustry.Vars.state; import static io.anuke.mindustry.Vars.tilesize; @@ -46,7 +44,7 @@ public class BlockConfigFragment extends Fragment{ configTile = tile; configBlock = tile.block(); - table.setVisible(true); + table.visible(true); table.clear(); tile.block().buildTable(tile, table); table.pack(); @@ -66,7 +64,7 @@ public class BlockConfigFragment extends Fragment{ } table.setOrigin(Align.center); - Vector2 pos = Graphics.screen(tile.drawx(), tile.drawy() - tile.block().size * tilesize / 2f - 1); + Vector2 pos = Core.input.mouseScreen(tile.drawx(), tile.drawy() - tile.block().size * tilesize / 2f - 1); table.setPosition(pos.x, pos.y, Align.top); if(configTile == null || configTile.block() == Blocks.air || configTile.block() != configBlock){ hideConfig(); @@ -75,7 +73,7 @@ public class BlockConfigFragment extends Fragment{ } public boolean hasConfigMouse(){ - Element e = Core.scene.hit(Gdx.input.getX(), Gdx.graphics.getHeight() - Gdx.input.getY(), true); + Element e = Core.scene.hit(Core.input.mouseX(), Core.graphics.getHeight() - Core.input.mouseY(), true); return e != null && (e == table || e.isDescendantOf(table)); } diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockConsumeFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockConsumeFragment.java index 78ec16761b..95b5cb6ec9 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockConsumeFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockConsumeFragment.java @@ -1,20 +1,19 @@ package io.anuke.mindustry.ui.fragments; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.arc.Core; +import io.anuke.arc.collection.ObjectSet; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.scene.Element; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Align; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.consumers.Consume; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.scene.Element; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.ui.layout.Table; import static io.anuke.mindustry.Vars.*; @@ -30,8 +29,8 @@ public class BlockConsumeFragment extends Fragment{ table.setTransform(true); parent.addChild(new Element(){{update(() -> { - if(!ui.hasMouse()){ - Tile tile = world.tileWorld(Graphics.mouseWorld().x, Graphics.mouseWorld().y); + if(!Core.scene.hasMouse()){ + Tile tile = world.tileWorld(Core.input.mouseWorld().x, Core.input.mouseWorld().y); if(tile == null) return; tile = tile.target(); @@ -86,12 +85,12 @@ public class BlockConsumeFragment extends Fragment{ rebuild(block, entity); } - Vector2 v = Graphics.screen(tile.drawx() - tile.block().size * tilesize / 2f + 0.25f, tile.drawy() + tile.block().size * tilesize / 2f); + Vector2 v = Core.input.mouseScreen(tile.drawx() - tile.block().size * tilesize / 2f + 0.25f, tile.drawy() + tile.block().size * tilesize / 2f); table.pack(); table.setPosition(v.x, v.y, Align.topRight); }); - table.act(Gdx.graphics.getDeltaTime()); + table.act(Core.graphics.getDeltaTime()); } public void hide(){ diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java index e193b04ed2..4d9efabef2 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockInventoryFragment.java @@ -1,11 +1,24 @@ package io.anuke.mindustry.ui.fragments; -import com.badlogic.gdx.math.Interpolation; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.IntSet; import io.anuke.annotations.Annotations.Loc; import io.anuke.annotations.Annotations.Remote; +import io.anuke.arc.Core; +import io.anuke.arc.collection.IntSet; +import io.anuke.arc.function.BooleanProvider; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.math.Interpolation; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.math.geom.Vector2; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.actions.Actions; +import io.anuke.arc.scene.event.HandCursorListener; +import io.anuke.arc.scene.event.InputEvent; +import io.anuke.arc.scene.event.InputListener; +import io.anuke.arc.scene.event.Touchable; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.Strings; +import io.anuke.arc.util.Time; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.gen.Call; @@ -13,18 +26,6 @@ import io.anuke.mindustry.input.InputHandler; import io.anuke.mindustry.type.Item; import io.anuke.mindustry.ui.ItemImage; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Graphics; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.function.BooleanProvider; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.actions.Actions; -import io.anuke.ucore.scene.event.HandCursorListener; -import io.anuke.ucore.scene.event.InputEvent; -import io.anuke.ucore.scene.event.InputListener; -import io.anuke.ucore.scene.event.Touchable; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Strings; import static io.anuke.mindustry.Vars.*; @@ -50,7 +51,7 @@ public class BlockInventoryFragment extends Fragment{ player.inventory.addItem(item, removed); for(int j = 0; j < Mathf.clamp(removed / 3, 1, 8); j++){ - Timers.run(j * 3f, () -> Call.transferItemEffect(item, tile.drawx(), tile.drawy(), player)); + Time.run(j * 3f, () -> Call.transferItemEffect(item, tile.drawx(), tile.drawy(), player)); } } @@ -75,7 +76,7 @@ public class BlockInventoryFragment extends Fragment{ table.clear(); table.update(null); })); - table.setTouchable(Touchable.disabled); + table.touchable(Touchable.disabled); tile = null; } @@ -87,13 +88,13 @@ public class BlockInventoryFragment extends Fragment{ table.clearChildren(); table.background("inventory"); - table.setTouchable(Touchable.enabled); + table.touchable(Touchable.enabled); table.update(() -> { if(state.is(State.menu) || tile == null || tile.entity == null || !tile.block().isAccessible() || tile.entity.items.total() == 0){ hide(); }else{ if(holding && lastItem != null){ - holdTime += Timers.delta(); + holdTime += Time.delta(); if(holdTime >= holdWithdraw){ int amount = Math.min(tile.entity.items.get(lastItem), player.inventory.itemCapacityUsed(lastItem)); @@ -144,7 +145,7 @@ public class BlockInventoryFragment extends Fragment{ image.addListener(new InputListener(){ @Override - public boolean touchDown(InputEvent event, float x, float y, int pointer, int button){ + public boolean touchDown(InputEvent event, float x, float y, int pointer, KeyCode button){ if(!canPick.get() || !tile.entity.items.has(item)) return false; int amount = Math.min(1, player.inventory.itemCapacityUsed(item)); Call.requestItem(player, tile, item, amount); @@ -155,7 +156,7 @@ public class BlockInventoryFragment extends Fragment{ } @Override - public void touchUp(InputEvent event, float x, float y, int pointer, int button){ + public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){ holding = false; lastItem = null; } @@ -190,7 +191,7 @@ public class BlockInventoryFragment extends Fragment{ } private void updateTablePosition(){ - Vector2 v = Graphics.screen(tile.drawx() + tile.block().size * tilesize / 2f, tile.drawy() + tile.block().size * tilesize / 2f); + Vector2 v = Core.input.mouseScreen(tile.drawx() + tile.block().size * tilesize / 2f, tile.drawy() + tile.block().size * tilesize / 2f); table.pack(); table.setPosition(v.x, v.y, Align.topLeft); } diff --git a/core/src/io/anuke/mindustry/ui/fragments/ChatFragment.java b/core/src/io/anuke/mindustry/ui/fragments/ChatFragment.java index 3d96883b34..c3c31902ed 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/ChatFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/ChatFragment.java @@ -1,32 +1,32 @@ package io.anuke.mindustry.ui.fragments; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.Input.Keys; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.Batch; -import com.badlogic.gdx.graphics.g2d.BitmapFont; -import com.badlogic.gdx.graphics.g2d.GlyphLayout; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.Array; +import io.anuke.arc.Core; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.BitmapFont; +import io.anuke.arc.graphics.g2d.Draw; +import io.anuke.arc.graphics.g2d.Fill; +import io.anuke.arc.graphics.g2d.GlyphLayout; +import io.anuke.arc.input.KeyCode; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.ui.Dialog; +import io.anuke.arc.scene.ui.Label; +import io.anuke.arc.scene.ui.Label.LabelStyle; +import io.anuke.arc.scene.ui.TextField; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.Time; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.gen.Call; +import io.anuke.mindustry.input.Binding; import io.anuke.mindustry.net.Net; -import io.anuke.ucore.core.Core; -import io.anuke.ucore.core.Inputs; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.ui.Dialog; -import io.anuke.ucore.scene.ui.Label; -import io.anuke.ucore.scene.ui.Label.LabelStyle; -import io.anuke.ucore.scene.ui.TextField; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.util.Mathf; +import static io.anuke.arc.Core.input; +import static io.anuke.arc.Core.scene; import static io.anuke.mindustry.Vars.*; -import static io.anuke.ucore.core.Core.scene; -import static io.anuke.ucore.core.Core.skin; public class ChatFragment extends Table{ private final static int messagesShown = 10; @@ -55,7 +55,7 @@ public class ChatFragment extends Table{ super(); setFillParent(true); - font = Core.skin.getFont("default-font"); + font = scene.skin.getFont("default-font"); visible(() -> { if(!Net.active() && messages.size > 0){ @@ -71,21 +71,21 @@ public class ChatFragment extends Table{ update(() -> { - if(Net.active() && Inputs.keyTap("chat")){ + if(Net.active() && input.keyTap(Binding.chat)){ toggle(); } if(chatOpen){ - if(Inputs.keyTap("chat_history_prev") && historyPos < history.size - 1){ + if(input.keyTap(Binding.chat_history_prev) && historyPos < history.size - 1){ if(historyPos == 0) history.set(0, chatfield.getText()); historyPos++; updateChat(); } - if(Inputs.keyTap("chat_history_next") && historyPos > 0){ + if(input.keyTap(Binding.chat_history_next) && historyPos > 0){ historyPos--; updateChat(); } - scrollPos = (int) Mathf.clamp(scrollPos + Inputs.getAxis("chat_scroll"), 0, Math.max(0, messages.size - messagesShown)); + scrollPos = (int) Mathf.clamp(scrollPos + input.axis(Binding.chat_scroll), 0, Math.max(0, messages.size - messagesShown)); } }); @@ -108,10 +108,10 @@ public class ChatFragment extends Table{ fieldlabel.getStyle().font = font; fieldlabel.setStyle(fieldlabel.getStyle()); - chatfield = new TextField("", new TextField.TextFieldStyle(skin.get(TextField.TextFieldStyle.class))); + chatfield = new TextField("", new TextField.TextFieldStyle(scene.skin.get(TextField.TextFieldStyle.class))); chatfield.setTextFieldFilter((field, c) -> field.getText().length() < Vars.maxTextLength); chatfield.getStyle().background = null; - chatfield.getStyle().font = skin.getFont("default-font-chat"); + chatfield.getStyle().font = scene.skin.getFont("default-font-chat"); chatfield.getStyle().fontColor = Color.WHITE; chatfield.setStyle(chatfield.getStyle()); @@ -123,21 +123,21 @@ public class ChatFragment extends Table{ dialog.content().defaults().height(65f); TextField to = dialog.content().addField("", t-> {}).pad(15).width(250f).get(); to.setMaxLength(maxTextLength); - to.keyDown(Keys.ENTER, () -> dialog.content().find("okb").fireClick()); + to.keyDown(KeyCode.ENTER, () -> dialog.content().find("okb").fireClick()); dialog.content().addButton("$text.ok", () -> { chatfield.clearText(); chatfield.appendText(to.getText()); chatfield.change(); dialog.hide(); - Gdx.input.setOnscreenKeyboardVisible(false); + Core.input.setOnscreenKeyboardVisible(false); toggle(); }).width(90f).name("okb"); dialog.show(); - Timers.runTask(1f, () -> { + Time.runTask(1f, () -> { to.setCursorPosition(to.getText().length()); Core.scene.setKeyboardFocus(to); - Gdx.input.setOnscreenKeyboardVisible(true); + Core.input.setOnscreenKeyboardVisible(true); }); }); } @@ -153,22 +153,22 @@ public class ChatFragment extends Table{ } @Override - public void draw(Batch batch, float alpha){ + public void draw(){ - batch.setColor(shadowColor); + Draw.color(shadowColor); if(chatOpen){ - batch.draw(skin.getRegion("white"), offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1); + Fill.crect(offsetx, chatfield.getY(), chatfield.getWidth() + 15f, chatfield.getHeight() - 1); } - super.draw(batch, alpha); + super.draw(); float spacing = chatspace; - chatfield.setVisible(chatOpen); - fieldlabel.setVisible(chatOpen); + chatfield.visible(chatOpen); + fieldlabel.visible(chatOpen); - batch.setColor(shadowColor); + Draw.color(shadowColor); float theight = offsety + spacing + getMarginBottom(); for(int i = scrollPos; i < messages.size && i < messagesShown + scrollPos && (i < fadetime || chatOpen); i++){ @@ -182,19 +182,19 @@ public class ChatFragment extends Table{ if(!chatOpen && fadetime - i < 1f && fadetime - i >= 0f){ font.getCache().setAlphas(fadetime - i); - batch.setColor(0, 0, 0, shadowColor.a * (fadetime - i)); + Draw.color(0, 0, 0, shadowColor.a * (fadetime - i)); } - batch.draw(skin.getRegion("white"), offsetx, theight - layout.height - 2, textWidth + Unit.dp.scl(4f), layout.height + textspacing); - batch.setColor(shadowColor); + Fill.crect(offsetx, theight - layout.height - 2, textWidth + Unit.dp.scl(4f), layout.height + textspacing); + Draw.color(shadowColor); - font.getCache().draw(batch); + font.getCache().draw(); } - batch.setColor(Color.WHITE); + Draw.color(); if(fadetime > 0 && !chatOpen) - fadetime -= Timers.delta() / 180f; + fadetime -= Time.delta() / 180f; } private void sendMessage(){ diff --git a/core/src/io/anuke/mindustry/ui/fragments/Fragment.java b/core/src/io/anuke/mindustry/ui/fragments/Fragment.java index 080c2c4a05..f878d5465d 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/Fragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/Fragment.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.ui.fragments; -import io.anuke.ucore.scene.Group; +import io.anuke.arc.scene.Group; public abstract class Fragment{ public abstract void build(Group parent); diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index a0f3694477..8365e7323d 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -1,38 +1,38 @@ package io.anuke.mindustry.ui.fragments; -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.math.Interpolation; -import com.badlogic.gdx.utils.Align; -import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.Scaling; +import io.anuke.arc.Core; +import io.anuke.arc.Events; +import io.anuke.arc.collection.Array; +import io.anuke.arc.graphics.Color; +import io.anuke.arc.graphics.g2d.TextureRegion; +import io.anuke.arc.math.Interpolation; +import io.anuke.arc.math.Mathf; +import io.anuke.arc.scene.Element; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.actions.Actions; +import io.anuke.arc.scene.event.Touchable; +import io.anuke.arc.scene.ui.Image; +import io.anuke.arc.scene.ui.ImageButton; +import io.anuke.arc.scene.ui.Label; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.layout.Stack; +import io.anuke.arc.scene.ui.layout.Table; +import io.anuke.arc.scene.ui.layout.Unit; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.Scaling; +import io.anuke.arc.util.Time; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.EventType.StateChangeEvent; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.gen.Call; import io.anuke.mindustry.graphics.Palette; +import io.anuke.mindustry.input.Binding; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.Packets.AdminAction; import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.ui.IntFormat; import io.anuke.mindustry.ui.Minimap; import io.anuke.mindustry.ui.dialogs.FloatingDialog; -import io.anuke.ucore.core.*; -import io.anuke.ucore.graphics.Hue; -import io.anuke.ucore.scene.Element; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.actions.Actions; -import io.anuke.ucore.scene.event.Touchable; -import io.anuke.ucore.scene.ui.Image; -import io.anuke.ucore.scene.ui.ImageButton; -import io.anuke.ucore.scene.ui.Label; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Stack; -import io.anuke.ucore.scene.ui.layout.Table; -import io.anuke.ucore.scene.ui.layout.Unit; -import io.anuke.ucore.util.Bundles; -import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.*; @@ -75,10 +75,10 @@ public class HudFragment extends Fragment{ } }).update(i -> { if(Net.active()){ - i.getStyle().imageUp = Core.skin.getDrawable("icon-players"); + i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-players"); }else{ i.setDisabled(Net.active()); - i.getStyle().imageUp = Core.skin.getDrawable(state.is(State.paused) ? "icon-play" : "icon-pause"); + i.getStyle().imageUp = Core.scene.skin.getDrawable(state.is(State.paused) ? "icon-play" : "icon-pause"); } }).get(); @@ -94,9 +94,9 @@ public class HudFragment extends Fragment{ } }).update(i -> { if(Net.active() && mobile){ - i.getStyle().imageUp = Core.skin.getDrawable("icon-chat"); + i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-chat"); }else{ - i.getStyle().imageUp = Core.skin.getDrawable("icon-unlocks"); + i.getStyle().imageUp = Core.scene.skin.getDrawable("icon-unlocks"); } }).get(); @@ -109,7 +109,7 @@ public class HudFragment extends Fragment{ } cont.update(() -> { - if(Inputs.keyTap("toggle_menus") && !ui.chatfrag.chatOpen()){ + if(!Core.input.keyDown(Binding.gridMode) && Core.input.keyTap(Binding.toggle_menus) && !ui.chatfrag.chatOpen()){ toggleMenus(); } }); @@ -134,12 +134,12 @@ public class HudFragment extends Fragment{ IntFormat fps = new IntFormat("text.fps"); IntFormat tps = new IntFormat("text.tps"); IntFormat ping = new IntFormat("text.ping"); - t.label(() -> fps.get(Gdx.graphics.getFramesPerSecond())).padRight(10); + t.label(() -> fps.get(Core.graphics.getFramesPerSecond())).padRight(10); t.row(); if(Net.hasClient()){ t.label(() -> ping.get(Net.getPing())).visible(Net::client).colspan(2); } - }).size(-1).visible(() -> Settings.getBool("fps")).update(t -> t.setTranslation(0, (!waves.isVisible() ? wavetable.getHeight() : Math.min(wavetable.getTranslation().y, wavetable.getHeight())) )).get(); + }).size(-1).visible(() -> Core.settings.getBool("fps")).update(t -> t.setTranslation(0, (!waves.isVisible() ? wavetable.getHeight() : Math.min(wavetable.getTranslation().y, wavetable.getHeight())))).get(); //make wave box appear below rest of menu if(mobile){ @@ -148,8 +148,7 @@ public class HudFragment extends Fragment{ }); //minimap - parent.fill(t -> t.top().right().add(new Minimap()) - .visible(() -> !state.is(State.menu) && Settings.getBool("minimap"))); + //parent.fill(t -> t.top().right().add(new Minimap()).visible(() -> !state.is(State.menu) && Core.settings.getBool("minimap"))); //paused table parent.fill(t -> { @@ -193,12 +192,12 @@ public class HudFragment extends Fragment{ coreAttackOpacity = Mathf.lerpDelta(coreAttackOpacity, 0f, 0.1f); } - coreAttackTime -= Timers.delta(); + coreAttackTime -= Time.delta(); return coreAttackOpacity > 0; }); t.table("button", top -> top.add("$text.coreattack").pad(2) - .update(label -> label.setColor(Hue.mix(Color.ORANGE, Color.SCARLET, Mathf.absin(Timers.time(), 2f, 1f))))); + .update(label -> label.getColor().set(Color.ORANGE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 2f, 1f)))); }); //'saving' indicator @@ -207,7 +206,7 @@ public class HudFragment extends Fragment{ t.add("$text.saveload"); }); - blockfrag.build(Core.scene.getRoot()); + blockfrag.build(Core.scene.root); } public void showToast(String text){ @@ -218,7 +217,7 @@ public class HudFragment extends Fragment{ } }); table.margin(12); - table.addImage("icon-check").size(16*2).pad(3); + table.addImage("icon-check").size(16 * 2).pad(3); table.add(text).wrap().width(280f).get().setAlignment(Align.center, Align.center); table.pack(); @@ -231,7 +230,7 @@ public class HudFragment extends Fragment{ Actions.run(() -> container.actions(Actions.translateBy(0, table.getPrefHeight(), 1f, Interpolation.fade), Actions.removeActor()))); } - /**Show unlock notification for a new recipe.*/ + /** Show unlock notification for a new recipe. */ public void showUnlock(Recipe recipe){ //if there's currently no unlock notification... @@ -268,11 +267,11 @@ public class HudFragment extends Fragment{ container.top().add(table); container.setTranslation(0, table.getPrefHeight()); container.actions(Actions.translateBy(0, -table.getPrefHeight(), 1f, Interpolation.fade), Actions.delay(4f), - //nesting actions() calls is necessary so the right prefHeight() is used - Actions.run(() -> container.actions(Actions.translateBy(0, table.getPrefHeight(), 1f, Interpolation.fade), Actions.run(() -> { - lastUnlockTable = null; - lastUnlockLayout = null; - }), Actions.removeActor()))); + //nesting actions() calls is necessary so the right prefHeight() is used + Actions.run(() -> container.actions(Actions.translateBy(0, table.getPrefHeight(), 1f, Interpolation.fade), Actions.run(() -> { + lastUnlockTable = null; + lastUnlockLayout = null; + }), Actions.removeActor()))); lastUnlockTable = container; lastUnlockLayout = in; @@ -345,7 +344,7 @@ public class HudFragment extends Fragment{ Interpolation in = Interpolation.pow3Out; if(flip != null){ - flip.getStyle().imageUp = Core.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up"); + flip.getStyle().imageUp = Core.scene.skin.getDrawable(shown ? "icon-arrow-down" : "icon-arrow-up"); } if(shown){ @@ -368,7 +367,7 @@ public class HudFragment extends Fragment{ IntFormat enemiesf = new IntFormat("text.wave.enemies"); table.clearChildren(); - table.setTouchable(Touchable.enabled); + table.touchable(Touchable.enabled); table.labelWrap(() -> world.getSector() == null ? @@ -378,9 +377,9 @@ public class HudFragment extends Fragment{ enemiesf.get(state.enemies())) : wavef.get(state.wave) + "\n" + (!state.mode.disableWaveTimer ? - Bundles.format("text.wave.waiting", (int)(state.wavetime/60)) : - Bundles.get("text.waiting"))) : - Bundles.format("text.mission.display", world.getSector().currentMission().displayString())).growX().pad(8f); + Core.bundle.format("text.wave.waiting", (int)(state.wavetime/60)) : + Core.bundle.get("text.waiting"))) : + Core.bundle.format("text.mission.display", world.getSector().currentMission().displayString())).growX().pad(8f); table.clicked(() -> { if(world.getSector() != null && world.getSector().currentMission().hasMessage()){ @@ -403,8 +402,8 @@ public class HudFragment extends Fragment{ boolean vis = state.mode.disableWaveTimer && ((Net.server() || players[0].isAdmin) || !Net.active()); boolean paused = state.is(State.paused) || !vis; - l.getStyle().imageUp = Core.skin.getDrawable(vis ? "icon-play" : "clear"); - l.setTouchable(!paused ? Touchable.enabled : Touchable.disabled); + l.getStyle().imageUp = Core.scene.skin.getDrawable(vis ? "icon-play" : "clear"); + l.touchable(!paused ? Touchable.enabled : Touchable.disabled); }).visible(() -> state.mode.disableWaveTimer && ((Net.server() || players[0].isAdmin) || !Net.active()) && unitGroups[Team.red.ordinal()].size() == 0); } } diff --git a/core/src/io/anuke/mindustry/ui/fragments/LoadingFragment.java b/core/src/io/anuke/mindustry/ui/fragments/LoadingFragment.java index 3ea3df3685..f378c5571c 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/LoadingFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/LoadingFragment.java @@ -1,11 +1,11 @@ package io.anuke.mindustry.ui.fragments; import io.anuke.mindustry.graphics.Palette; -import io.anuke.ucore.scene.Group; -import io.anuke.ucore.scene.event.Touchable; -import io.anuke.ucore.scene.ui.Label; -import io.anuke.ucore.scene.ui.TextButton; -import io.anuke.ucore.scene.ui.layout.Table; +import io.anuke.arc.scene.Group; +import io.anuke.arc.scene.event.Touchable; +import io.anuke.arc.scene.ui.Label; +import io.anuke.arc.scene.ui.TextButton; +import io.anuke.arc.scene.ui.layout.Table; public class LoadingFragment extends Fragment{ private Table table; @@ -14,8 +14,8 @@ public class LoadingFragment extends Fragment{ @Override public void build(Group parent){ parent.fill("loadDim", t -> { - t.setVisible(false); - t.setTouchable(Touchable.enabled); + t.visible(false); + t.touchable(Touchable.enabled); t.add().height(70f).row(); t.addImage("white").growX().height(3f).pad(4f).growX().get().setColor(Palette.accent); @@ -31,8 +31,8 @@ public class LoadingFragment extends Fragment{ } public void setButton(Runnable listener){ - button.setVisible(true); - button.getListeners().removeIndex(button.getListeners().size - 1); + button.visible(true); + button.getListeners().remove(button.getListeners().size - 1); button.clicked(listener); } @@ -42,12 +42,12 @@ public class LoadingFragment extends Fragment{ public void show(String text){ table.