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

@ -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;