Misc bugfixes
This commit is contained in:
@@ -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 -> {
|
t.button("@data.import", Icon.download, style, () -> ui.showConfirm("@confirm", "@data.import.confirm", () -> platform.showFileChooser(true, "zip", file -> {
|
||||||
try{
|
try{
|
||||||
importData(file);
|
importData(file);
|
||||||
|
control.saves.resetSave();
|
||||||
|
state = new GameState();
|
||||||
Core.app.exit();
|
Core.app.exit();
|
||||||
}catch(IllegalArgumentException e){
|
}catch(IllegalArgumentException e){
|
||||||
ui.showErrorMessage("@data.invalid");
|
ui.showErrorMessage("@data.invalid");
|
||||||
|
|||||||
@@ -405,17 +405,16 @@ public class PowerNode extends PowerBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(this == other){ //double tapped
|
if(this == other){ //double tapped
|
||||||
if(other.power.links.size == 0 || Core.input.shift()){ //find links
|
if(other.power.links.size == 0){ //find links
|
||||||
int[] total = {0};
|
Seq<Point2> points = new Seq<>();
|
||||||
getPotentialLinks(tile, team, link -> {
|
getPotentialLinks(tile, team, link -> {
|
||||||
if(!insulated(this, link) && total[0]++ < maxNodes){
|
if(!insulated(this, link) && points.size < maxNodes){
|
||||||
configure(link.pos());
|
points.add(new Point2(link.tileX() - tile.x, link.tileY() - tile.y));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
configure(points.toArray(Point2.class));
|
||||||
}else{ //clear links
|
}else{ //clear links
|
||||||
while(power.links.size > 0){
|
configure(new Point2[0]);
|
||||||
configure(power.links.get(0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
deselect();
|
deselect();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user