uCore dependency setup
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="io.anuke.mindustry"
|
package="io.anuke.mindustry"
|
||||||
android:versionCode="41"
|
android:versionCode="43"
|
||||||
android:versionName="3.2b" >
|
android:versionName="3.2b2" >
|
||||||
|
|
||||||
<uses-permission android:name="com.android.vending.BILLING" />
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
|||||||
13
build.gradle
13
build.gradle
@@ -20,8 +20,9 @@ allprojects {
|
|||||||
version = 'release'
|
version = 'release'
|
||||||
ext {
|
ext {
|
||||||
appName = "Mindustry"
|
appName = "Mindustry"
|
||||||
gdxVersion = '1.9.6'
|
gdxVersion = '1.9.8'
|
||||||
aiVersion = '1.8.0'
|
aiVersion = '1.8.1'
|
||||||
|
uCoreVersion = '4434f35';
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -55,7 +56,7 @@ project(":html") {
|
|||||||
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
|
||||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
|
||||||
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
|
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
|
||||||
compile "com.badlogicgames.gdx:gdx-ai:1.8.0:sources"
|
compile "com.badlogicgames.gdx:gdx-ai:$aiVersion:sources"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,13 +81,13 @@ project(":core") {
|
|||||||
apply plugin: "java"
|
apply plugin: "java"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
if(new File('../uCore-master').exists()){
|
if(new File('../uCore').exists()){
|
||||||
compile project(":uCore")
|
compile project(":uCore")
|
||||||
}else{
|
}else{
|
||||||
compile 'com.github.anuken:ucore:7938cb4bf9'
|
compile "com.github.anuken:ucore:$uCoreVersion"
|
||||||
}
|
}
|
||||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||||
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
compile "com.badlogicgames.gdx:gdx-ai:$aiVersion"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,8 @@ public class Vars{
|
|||||||
public static boolean showPlayer = true;
|
public static boolean showPlayer = true;
|
||||||
//whether to hide ui, only on debug
|
//whether to hide ui, only on debug
|
||||||
public static boolean showUI = true;
|
public static boolean showUI = true;
|
||||||
//number of save slots-- increasing may lead to layout issues
|
|
||||||
//TODO named save slots
|
public static final int saveSlots = 10;
|
||||||
public static final int saveSlots = 8;
|
|
||||||
//amount of drops that are left when breaking a block
|
//amount of drops that are left when breaking a block
|
||||||
public static final float breakDropAmount = 0.5f;
|
public static final float breakDropAmount = 0.5f;
|
||||||
|
|
||||||
|
|||||||
@@ -205,11 +205,11 @@ public class UI extends SceneModule{
|
|||||||
|
|
||||||
prefs.checkPref("fps", "Show FPS", false);
|
prefs.checkPref("fps", "Show FPS", false);
|
||||||
prefs.checkPref("vsync", "VSync", true, b -> Gdx.graphics.setVSync(b));
|
prefs.checkPref("vsync", "VSync", true, b -> Gdx.graphics.setVSync(b));
|
||||||
prefs.checkPref("noshadows", "Disable shadows", false);
|
//prefs.checkPref("noshadows", "Disable shadows", false);
|
||||||
|
//prefs.checkPref("drawblocks", "Draw Blocks", true);
|
||||||
prefs.checkPref("smoothcam", "Smooth Camera", true);
|
prefs.checkPref("smoothcam", "Smooth Camera", true);
|
||||||
prefs.checkPref("indicators", "Enemy Indicators", true);
|
prefs.checkPref("indicators", "Enemy Indicators", true);
|
||||||
prefs.checkPref("effects", "Display Effects", true);
|
prefs.checkPref("effects", "Display Effects", true);
|
||||||
prefs.checkPref("drawblocks", "Draw Blocks", true);
|
|
||||||
prefs.checkPref("pixelate", "Pixelate Screen", true, b->{
|
prefs.checkPref("pixelate", "Pixelate Screen", true, b->{
|
||||||
if(b){
|
if(b){
|
||||||
Vars.renderer.pixelSurface.setScale(Core.cameraScale);
|
Vars.renderer.pixelSurface.setScale(Core.cameraScale);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class MapEditorDialog extends Dialog{
|
|||||||
Vars.ui.showError("[orange]Invalid image dimensions![]\nValid map dimensions: " + Arrays.toString(MapEditor.validMapSizes));
|
Vars.ui.showError("[orange]Invalid image dimensions![]\nValid map dimensions: " + Arrays.toString(MapEditor.validMapSizes));
|
||||||
}
|
}
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
Vars.ui.showError("Error loading image file:\n" + Strings.parseException((Exception)e.getCause()));
|
Vars.ui.showError("Error loading image file:\n[orange]" + Strings.parseException(e, false));
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
Vars.ui.hideLoading();
|
Vars.ui.hideLoading();
|
||||||
@@ -72,7 +72,7 @@ public class MapEditorDialog extends Dialog{
|
|||||||
try{
|
try{
|
||||||
Pixmaps.write(editor.pixmap(), result);
|
Pixmaps.write(editor.pixmap(), result);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
Vars.ui.showError("Error saving image file:\n " + Strings.parseException((Exception)e.getCause()));
|
Vars.ui.showError("Error saving image file:\n[orange]" + Strings.parseException(e, false));
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
Vars.ui.hideLoading();
|
Vars.ui.hideLoading();
|
||||||
|
|||||||
@@ -304,6 +304,6 @@ public class MapView extends Element implements GestureListener{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void pinchStop(){
|
public void pinchStop(){
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import io.anuke.ucore.scene.ui.ScrollPane;
|
|||||||
import io.anuke.ucore.scene.ui.TextButton;
|
import io.anuke.ucore.scene.ui.TextButton;
|
||||||
import io.anuke.ucore.scene.ui.layout.Table;
|
import io.anuke.ucore.scene.ui.layout.Table;
|
||||||
|
|
||||||
//TODO unified save/load dialogs
|
|
||||||
public class LoadDialog extends FloatingDialog{
|
public class LoadDialog extends FloatingDialog{
|
||||||
ScrollPane pane;
|
ScrollPane pane;
|
||||||
|
|
||||||
@@ -46,7 +45,6 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
slots.padRight(24);
|
slots.padRight(24);
|
||||||
|
|
||||||
for(int i = 0; i < Vars.saveSlots; i++){
|
for(int i = 0; i < Vars.saveSlots; i++){
|
||||||
final int slot = i;
|
|
||||||
|
|
||||||
TextButton button = new TextButton("[accent]Slot " + (i + 1));
|
TextButton button = new TextButton("[accent]Slot " + (i + 1));
|
||||||
button.pad(12);
|
button.pad(12);
|
||||||
@@ -54,17 +52,15 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
|
|
||||||
button.row();
|
button.row();
|
||||||
|
|
||||||
Label info = new Label("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : SaveIO.getMode(slot) + ", "
|
Label info = new Label("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : SaveIO.getMode(i) + ", "
|
||||||
+ SaveIO.getMap(slot).name + ", Wave " + SaveIO.getWave(slot)
|
+ SaveIO.getMap(i).name + ", Wave " + SaveIO.getWave(i)
|
||||||
+ "\nLast Saved: " + SaveIO.getTimeString(i)));
|
+ "\nLast Saved: " + SaveIO.getTimeString(i)));
|
||||||
info.setAlignment(Align.center, Align.center);
|
info.setAlignment(Align.center, Align.center);
|
||||||
|
|
||||||
button.add(info).padBottom(3).padTop(7);
|
button.add(info).padBottom(3).padTop(7);
|
||||||
button.row();
|
button.row();
|
||||||
//button.addImage("white", Color.GRAY)
|
|
||||||
//.growX().height(3f).pad(4f);
|
|
||||||
button.row();
|
button.row();
|
||||||
modifyButton(button, slot);
|
modifyButton(button, i);
|
||||||
|
|
||||||
slots.add(button).size(404, 104).pad(4);
|
slots.add(button).size(404, 104).pad(4);
|
||||||
slots.row();
|
slots.row();
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import io.anuke.ucore.scene.ui.ConfirmDialog;
|
|||||||
import io.anuke.ucore.scene.ui.TextButton;
|
import io.anuke.ucore.scene.ui.TextButton;
|
||||||
import io.anuke.ucore.scene.ui.layout.Cell;
|
import io.anuke.ucore.scene.ui.layout.Cell;
|
||||||
|
|
||||||
//TODO unified save/load dialogs
|
|
||||||
public class SaveDialog extends LoadDialog{
|
public class SaveDialog extends LoadDialog{
|
||||||
|
|
||||||
public SaveDialog() {
|
public SaveDialog() {
|
||||||
|
|||||||
@@ -52,15 +52,19 @@ public class RepairTurret extends PowerTurret{
|
|||||||
if(entity.timer.get(timerTarget, targetInterval)){
|
if(entity.timer.get(timerTarget, targetInterval)){
|
||||||
entity.blockTarget = Vars.world.findTileTarget(tile.worldx(), tile.worldy(), tile, range, true);
|
entity.blockTarget = Vars.world.findTileTarget(tile.worldx(), tile.worldy(), tile, range, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(entity.blockTarget != null){
|
if(entity.blockTarget != null){
|
||||||
|
if(Float.isNaN(entity.rotation)){
|
||||||
|
entity.rotation = 0;
|
||||||
|
}
|
||||||
|
|
||||||
float target = entity.angleTo(entity.blockTarget);
|
float target = entity.angleTo(entity.blockTarget);
|
||||||
entity.rotation = Mathf.slerp(entity.rotation, target, 0.16f*Timers.delta());
|
entity.rotation = Mathf.slerp(entity.rotation, target, 0.16f*Timers.delta());
|
||||||
|
|
||||||
if(entity.timer.get(timerReload, reload) && Angles.angleDist(target, entity.rotation) < shootCone){
|
if(entity.timer.get(timerReload, reload) && Angles.angleDist(target, entity.rotation) < shootCone){
|
||||||
entity.blockTarget.health++;
|
entity.blockTarget.health++;
|
||||||
|
|
||||||
if(entity.blockTarget.health > entity.blockTarget.health)
|
if(entity.blockTarget.health > entity.blockTarget.maxhealth)
|
||||||
entity.blockTarget.health = entity.blockTarget.maxhealth;
|
entity.blockTarget.health = entity.blockTarget.maxhealth;
|
||||||
|
|
||||||
entity.power -= powerUsed;
|
entity.power -= powerUsed;
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ task run(dependsOn: classes, type: JavaExec) {
|
|||||||
standardInput = System.in
|
standardInput = System.in
|
||||||
workingDir = project.assetsDir
|
workingDir = project.assetsDir
|
||||||
ignoreExitValue = true
|
ignoreExitValue = true
|
||||||
|
if (project.hasProperty("appArgs")) {
|
||||||
|
args Eval.me(appArgs)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task debug(dependsOn: classes, type: JavaExec) {
|
task debug(dependsOn: classes, type: JavaExec) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.io.IOException;
|
|||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
|
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
|
||||||
@@ -14,22 +15,20 @@ import com.badlogic.gdx.utils.Array;
|
|||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.io.PlatformFunction;
|
import io.anuke.mindustry.io.PlatformFunction;
|
||||||
|
import io.anuke.ucore.UCore;
|
||||||
import io.anuke.ucore.scene.ui.TextField;
|
import io.anuke.ucore.scene.ui.TextField;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
|
|
||||||
public class DesktopLauncher {
|
public class DesktopLauncher {
|
||||||
|
|
||||||
public static void main (String[] arg) {
|
public static void main (String[] arg) {
|
||||||
|
|
||||||
Unit.dp.addition = 2f;
|
|
||||||
|
|
||||||
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
|
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
|
||||||
config.setTitle("Mindustry");
|
config.setTitle("Mindustry");
|
||||||
config.setMaximized(true);
|
config.setMaximized(true);
|
||||||
config.setWindowedMode(960, 540);
|
config.setWindowedMode(960, 540);
|
||||||
config.setWindowIcon("sprites/icon.png");
|
config.setWindowIcon("sprites/icon.png");
|
||||||
config.useVsync(true);
|
|
||||||
|
|
||||||
Mindustry.platforms = new PlatformFunction(){
|
Mindustry.platforms = new PlatformFunction(){
|
||||||
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm");
|
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm");
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
include 'desktop', 'html', 'core', 'android'
|
include 'desktop', 'html', 'core', 'android'
|
||||||
|
|
||||||
if (new File(settingsDir, '../uCore-master').exists()) {
|
if (new File(settingsDir, '../uCore').exists()) {
|
||||||
include ':uCore'
|
include ':uCore'
|
||||||
project(':uCore').projectDir = new File(settingsDir, '../uCore-master')
|
project(':uCore').projectDir = new File(settingsDir, '../uCore')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user