uCore dependency setup

This commit is contained in:
Anuken
2017-12-21 20:59:40 -05:00
parent 5505f4790c
commit 460c7163d9
12 changed files with 33 additions and 32 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.anuke.mindustry"
android:versionCode="41"
android:versionName="3.2b" >
android:versionCode="43"
android:versionName="3.2b2" >
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

View File

@ -20,8 +20,9 @@ allprojects {
version = 'release'
ext {
appName = "Mindustry"
gdxVersion = '1.9.6'
aiVersion = '1.8.0'
gdxVersion = '1.9.8'
aiVersion = '1.8.1'
uCoreVersion = '4434f35';
}
repositories {
@ -55,7 +56,7 @@ project(":html") {
compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
compile "com.badlogicgames.gdx:gdx:$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"
dependencies {
if(new File('../uCore-master').exists()){
if(new File('../uCore').exists()){
compile project(":uCore")
}else{
compile 'com.github.anuken:ucore:7938cb4bf9'
compile "com.github.anuken:ucore:$uCoreVersion"
}
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
compile "com.badlogicgames.gdx:gdx-ai:$aiVersion"
}
}

View File

@ -53,9 +53,8 @@ public class Vars{
public static boolean showPlayer = true;
//whether to hide ui, only on debug
public static boolean showUI = true;
//number of save slots-- increasing may lead to layout issues
//TODO named save slots
public static final int saveSlots = 8;
public static final int saveSlots = 10;
//amount of drops that are left when breaking a block
public static final float breakDropAmount = 0.5f;

View File

@ -205,11 +205,11 @@ public class UI extends SceneModule{
prefs.checkPref("fps", "Show FPS", false);
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("indicators", "Enemy Indicators", true);
prefs.checkPref("effects", "Display Effects", true);
prefs.checkPref("drawblocks", "Draw Blocks", true);
prefs.checkPref("pixelate", "Pixelate Screen", true, b->{
if(b){
Vars.renderer.pixelSurface.setScale(Core.cameraScale);

View File

@ -55,7 +55,7 @@ public class MapEditorDialog extends Dialog{
Vars.ui.showError("[orange]Invalid image dimensions![]\nValid map dimensions: " + Arrays.toString(MapEditor.validMapSizes));
}
}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();
}
Vars.ui.hideLoading();
@ -72,7 +72,7 @@ public class MapEditorDialog extends Dialog{
try{
Pixmaps.write(editor.pixmap(), result);
}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();
}
Vars.ui.hideLoading();

View File

@ -304,6 +304,6 @@ public class MapView extends Element implements GestureListener{
@Override
public void pinchStop(){
}
}

View File

@ -13,7 +13,6 @@ import io.anuke.ucore.scene.ui.ScrollPane;
import io.anuke.ucore.scene.ui.TextButton;
import io.anuke.ucore.scene.ui.layout.Table;
//TODO unified save/load dialogs
public class LoadDialog extends FloatingDialog{
ScrollPane pane;
@ -46,7 +45,6 @@ public class LoadDialog extends FloatingDialog{
slots.padRight(24);
for(int i = 0; i < Vars.saveSlots; i++){
final int slot = i;
TextButton button = new TextButton("[accent]Slot " + (i + 1));
button.pad(12);
@ -54,17 +52,15 @@ public class LoadDialog extends FloatingDialog{
button.row();
Label info = new Label("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : SaveIO.getMode(slot) + ", "
+ SaveIO.getMap(slot).name + ", Wave " + SaveIO.getWave(slot)
Label info = new Label("[gray]" + (!SaveIO.isSaveValid(i) ? "<empty>" : SaveIO.getMode(i) + ", "
+ SaveIO.getMap(i).name + ", Wave " + SaveIO.getWave(i)
+ "\nLast Saved: " + SaveIO.getTimeString(i)));
info.setAlignment(Align.center, Align.center);
button.add(info).padBottom(3).padTop(7);
button.row();
//button.addImage("white", Color.GRAY)
//.growX().height(3f).pad(4f);
button.row();
modifyButton(button, slot);
modifyButton(button, i);
slots.add(button).size(404, 104).pad(4);
slots.row();

View File

@ -10,7 +10,6 @@ import io.anuke.ucore.scene.ui.ConfirmDialog;
import io.anuke.ucore.scene.ui.TextButton;
import io.anuke.ucore.scene.ui.layout.Cell;
//TODO unified save/load dialogs
public class SaveDialog extends LoadDialog{
public SaveDialog() {

View File

@ -52,15 +52,19 @@ public class RepairTurret extends PowerTurret{
if(entity.timer.get(timerTarget, targetInterval)){
entity.blockTarget = Vars.world.findTileTarget(tile.worldx(), tile.worldy(), tile, range, true);
}
if(entity.blockTarget != null){
if(Float.isNaN(entity.rotation)){
entity.rotation = 0;
}
float target = entity.angleTo(entity.blockTarget);
entity.rotation = Mathf.slerp(entity.rotation, target, 0.16f*Timers.delta());
if(entity.timer.get(timerReload, reload) && Angles.angleDist(target, entity.rotation) < shootCone){
entity.blockTarget.health++;
if(entity.blockTarget.health > entity.blockTarget.health)
if(entity.blockTarget.health > entity.blockTarget.maxhealth)
entity.blockTarget.health = entity.blockTarget.maxhealth;
entity.power -= powerUsed;

View File

@ -14,6 +14,9 @@ task run(dependsOn: classes, type: JavaExec) {
standardInput = System.in
workingDir = project.assetsDir
ignoreExitValue = true
if (project.hasProperty("appArgs")) {
args Eval.me(appArgs)
}
}
task debug(dependsOn: classes, type: JavaExec) {

View File

@ -5,6 +5,7 @@ import java.io.IOException;
import java.net.URI;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
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.Vars;
import io.anuke.mindustry.io.PlatformFunction;
import io.anuke.ucore.UCore;
import io.anuke.ucore.scene.ui.TextField;
import io.anuke.ucore.scene.ui.layout.Unit;
public class DesktopLauncher {
public static void main (String[] arg) {
Unit.dp.addition = 2f;
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
config.setTitle("Mindustry");
config.setMaximized(true);
config.setWindowedMode(960, 540);
config.setWindowIcon("sprites/icon.png");
config.useVsync(true);
Mindustry.platforms = new PlatformFunction(){
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm");

View File

@ -1,6 +1,6 @@
include 'desktop', 'html', 'core', 'android'
if (new File(settingsDir, '../uCore-master').exists()) {
if (new File(settingsDir, '../uCore').exists()) {
include ':uCore'
project(':uCore').projectDir = new File(settingsDir, '../uCore-master')
project(':uCore').projectDir = new File(settingsDir, '../uCore')
}