Misc bugfixes

This commit is contained in:
Anuken
2023-07-26 10:31:18 -04:00
parent dc8783d4a6
commit 7850e61672
2 changed files with 8 additions and 7 deletions

View File

@@ -180,6 +180,8 @@ public class SettingsMenuDialog extends BaseDialog{
t.button("@data.import", Icon.download, style, () -> ui.showConfirm("@confirm", "@data.import.confirm", () -> platform.showFileChooser(true, "zip", file -> {
try{
importData(file);
control.saves.resetSave();
state = new GameState();
Core.app.exit();
}catch(IllegalArgumentException e){
ui.showErrorMessage("@data.invalid");

View File

@@ -405,17 +405,16 @@ public class PowerNode extends PowerBlock{
}
if(this == other){ //double tapped
if(other.power.links.size == 0 || Core.input.shift()){ //find links
int[] total = {0};
if(other.power.links.size == 0){ //find links
Seq<Point2> points = new Seq<>();
getPotentialLinks(tile, team, link -> {
if(!insulated(this, link) && total[0]++ < maxNodes){
configure(link.pos());
if(!insulated(this, link) && points.size < maxNodes){
points.add(new Point2(link.tileX() - tile.x, link.tileY() - tile.y));
}
});
configure(points.toArray(Point2.class));
}else{ //clear links
while(power.links.size > 0){
configure(power.links.get(0));
}
configure(new Point2[0]);
}
deselect();
return false;