mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-31 15:09:07 +07:00
uCore dependency setup
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -304,6 +304,6 @@ public class MapView extends Element implements GestureListener{
|
||||
|
||||
@Override
|
||||
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.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();
|
||||
|
@ -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() {
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user