Don't configure processor when no changes are made
This commit is contained in:
@@ -45,6 +45,7 @@ public class AndroidLauncher extends AndroidApplication{
|
|||||||
handler.uncaughtException(thread, error);
|
handler.uncaughtException(thread, error);
|
||||||
}else{
|
}else{
|
||||||
error.printStackTrace();
|
error.printStackTrace();
|
||||||
|
Log.err(error);
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -136,7 +136,9 @@ abstract class PayloadComp implements Posc, Rotc, Hitboxc, Unitc{
|
|||||||
int rot = (int)((rotation + 45f) / 90f) % 4;
|
int rot = (int)((rotation + 45f) / 90f) % 4;
|
||||||
payload.place(on, rot);
|
payload.place(on, rot);
|
||||||
|
|
||||||
if(isPlayer()) payload.build.lastAccessed = getPlayer().name;
|
if(getControllerName() != null){
|
||||||
|
payload.build.lastAccessed = getControllerName();
|
||||||
|
}
|
||||||
|
|
||||||
Fx.unitDrop.at(tile);
|
Fx.unitDrop.at(tile);
|
||||||
Fx.placeBlock.at(on.drawx(), on.drawy(), on.block().size);
|
Fx.placeBlock.at(on.drawx(), on.drawy(), on.block().size);
|
||||||
|
|||||||
@@ -445,6 +445,15 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
remove();
|
remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @return name of direct or indirect player controller. */
|
||||||
|
@Override
|
||||||
|
public @Nullable String getControllerName(){
|
||||||
|
if(isPlayer()) return getPlayer().name;
|
||||||
|
if(controller instanceof LogicAI ai && ai.controller != null) return ai.controller.lastAccessed;
|
||||||
|
if(controller instanceof FormationAI ai && ai.leader != null && ai.leader.isPlayer()) return ai.leader.getPlayer().name;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void display(Table table){
|
public void display(Table table){
|
||||||
type.display(self(), table);
|
type.display(self(), table);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package mindustry.logic;
|
|||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.func.*;
|
import arc.func.*;
|
||||||
import arc.scene.ui.TextButton.*;
|
import arc.scene.ui.TextButton.*;
|
||||||
|
import arc.util.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.logic.LStatements.*;
|
import mindustry.logic.LStatements.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
@@ -90,16 +91,20 @@ public class LogicDialog extends BaseDialog{
|
|||||||
onResize(() -> canvas.rebuild());
|
onResize(() -> canvas.rebuild());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void show(String code, Cons<String> consumer){
|
public void show(String code, Cons<String> modified){
|
||||||
canvas.statements.clearChildren();
|
canvas.statements.clearChildren();
|
||||||
canvas.rebuild();
|
canvas.rebuild();
|
||||||
try{
|
try{
|
||||||
canvas.load(code);
|
canvas.load(code);
|
||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
t.printStackTrace();
|
Log.err(t);
|
||||||
canvas.load("");
|
canvas.load("");
|
||||||
}
|
}
|
||||||
this.consumer = consumer;
|
this.consumer = result -> {
|
||||||
|
if(!result.equals(code)){
|
||||||
|
modified.get(result);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,12 @@ public class CrashSender{
|
|||||||
|
|
||||||
public static void send(Throwable exception, Cons<File> writeListener){
|
public static void send(Throwable exception, Cons<File> writeListener){
|
||||||
try{
|
try{
|
||||||
|
try{
|
||||||
|
//log to file
|
||||||
|
Log.err(exception);
|
||||||
|
}catch(Throwable no){
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
//try saving game data
|
//try saving game data
|
||||||
try{
|
try{
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ public class Build{
|
|||||||
build.setDeconstruct(previous);
|
build.setDeconstruct(previous);
|
||||||
build.prevBuild = prevBuild;
|
build.prevBuild = prevBuild;
|
||||||
tile.build.health = tile.build.maxHealth * prevPercent;
|
tile.build.health = tile.build.maxHealth * prevPercent;
|
||||||
if(unit != null && unit.isPlayer()) tile.build.lastAccessed = unit.getPlayer().name;
|
|
||||||
|
if(unit != null && unit.getControllerName() != null){
|
||||||
|
tile.build.lastAccessed = unit.getControllerName();
|
||||||
|
}
|
||||||
|
|
||||||
Core.app.post(() -> Events.fire(new BlockBuildBeginEvent(tile, team, unit, true)));
|
Core.app.post(() -> Events.fire(new BlockBuildBeginEvent(tile, team, unit, true)));
|
||||||
}
|
}
|
||||||
@@ -64,7 +67,7 @@ public class Build{
|
|||||||
|
|
||||||
//auto-rotate the block to the correct orientation and bail out
|
//auto-rotate the block to the correct orientation and bail out
|
||||||
if(tile.team() == team && tile.block == result && tile.build != null && tile.block.quickRotate){
|
if(tile.team() == team && tile.block == result && tile.build != null && tile.block.quickRotate){
|
||||||
if(unit != null && unit.isPlayer()) tile.build.lastAccessed = unit.getPlayer().name;
|
if(unit != null && unit.getControllerName() != null) tile.build.lastAccessed = unit.getControllerName();
|
||||||
tile.build.rotation = Mathf.mod(rotation, 4);
|
tile.build.rotation = Mathf.mod(rotation, 4);
|
||||||
tile.build.updateProximity();
|
tile.build.updateProximity();
|
||||||
tile.build.noSleep();
|
tile.build.noSleep();
|
||||||
@@ -90,7 +93,7 @@ public class Build{
|
|||||||
|
|
||||||
build.setConstruct(previous.size == sub.size ? previous : Blocks.air, result);
|
build.setConstruct(previous.size == sub.size ? previous : Blocks.air, result);
|
||||||
build.prevBuild = prevBuild;
|
build.prevBuild = prevBuild;
|
||||||
if(unit != null && unit.isPlayer()) build.lastAccessed = unit.getPlayer().name;
|
if(unit != null && unit.getControllerName() != null) build.lastAccessed = unit.getControllerName();
|
||||||
|
|
||||||
result.placeBegan(tile, previous);
|
result.placeBegan(tile, previous);
|
||||||
|
|
||||||
|
|||||||
@@ -78,8 +78,8 @@ public class ConstructBlock extends Block{
|
|||||||
tile.build.overwrote(prev);
|
tile.build.overwrote(prev);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(builder != null && builder.isPlayer()){
|
if(builder != null && builder.getControllerName() != null){
|
||||||
tile.build.lastAccessed = builder.getPlayer().name;
|
tile.build.lastAccessed = builder.getControllerName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -477,9 +477,7 @@ public class LogicBlock extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void buildConfiguration(Table table){
|
public void buildConfiguration(Table table){
|
||||||
table.button(Icon.pencil, Styles.clearTransi, () -> {
|
table.button(Icon.pencil, Styles.clearTransi, () -> {
|
||||||
Vars.ui.logic.show(code, code -> {
|
Vars.ui.logic.show(code, code -> configure(compress(code, relativeConnections())));
|
||||||
configure(compress(code, relativeConnections()));
|
|
||||||
});
|
|
||||||
}).size(40);
|
}).size(40);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=e77f5b14f5d621df62c7739854468ddae0c6c7ea
|
archash=638a163631aa138e4fc4a90efe1bd8113e27a489
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
|||||||
}catch(Throwable t){
|
}catch(Throwable t){
|
||||||
//attempt to log the exception
|
//attempt to log the exception
|
||||||
CrashSender.log(t);
|
CrashSender.log(t);
|
||||||
|
Log.err(t);
|
||||||
//rethrow the exception so it actually crashes
|
//rethrow the exception so it actually crashes
|
||||||
throw t;
|
throw t;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user