Utility schematic method changes / Geothermal map submission update
This commit is contained in:
Binary file not shown.
@@ -274,10 +274,15 @@ public class Schematics implements Loadable{
|
|||||||
return previews.get(schematic);
|
return previews.get(schematic);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates an array of build plans from a schematic's data, centered on the provided x+y coordinates. */
|
/** Creates an array of build plans from a schematic's data, centered on the provided x,y coordinates. */
|
||||||
public Seq<BuildPlan> toPlans(Schematic schem, int x, int y){
|
public Seq<BuildPlan> toPlans(Schematic schem, int x, int y){
|
||||||
|
return toPlans(schem, x, y, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Creates an array of build plans from a schematic's data, centered on the provided x,y coordinates. */
|
||||||
|
public Seq<BuildPlan> toPlans(Schematic schem, int x, int y, boolean checkHidden){
|
||||||
return schem.tiles.map(t -> new BuildPlan(t.x + x - schem.width/2, t.y + y - schem.height/2, t.rotation, t.block, t.config))
|
return schem.tiles.map(t -> new BuildPlan(t.x + x - schem.width/2, t.y + y - schem.height/2, t.rotation, t.block, t.config))
|
||||||
.removeAll(s -> (!s.block.isVisible() && !(s.block instanceof CoreBlock)) || !s.block.unlockedNow()).sort(Structs.comparingInt(s -> -s.block.schematicPriority));
|
.removeAll(s -> (checkHidden && !s.block.isVisible() && !(s.block instanceof CoreBlock)) || !s.block.unlockedNow()).sort(Structs.comparingInt(s -> -s.block.schematicPriority));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return all the valid loadouts for a specific core type. */
|
/** @return all the valid loadouts for a specific core type. */
|
||||||
|
|||||||
@@ -499,13 +499,13 @@ public class DesktopInput extends InputHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void useSchematic(Schematic schem){
|
public void useSchematic(Schematic schem, boolean checkHidden){
|
||||||
block = null;
|
block = null;
|
||||||
schematicX = tileX(getMouseX());
|
schematicX = tileX(getMouseX());
|
||||||
schematicY = tileY(getMouseY());
|
schematicY = tileY(getMouseY());
|
||||||
|
|
||||||
selectPlans.clear();
|
selectPlans.clear();
|
||||||
selectPlans.addAll(schematics.toPlans(schem, schematicX, schematicY));
|
selectPlans.addAll(schematics.toPlans(schem, schematicX, schematicY, checkHidden));
|
||||||
mode = none;
|
mode = none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1317,9 +1317,11 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void useSchematic(Schematic schem){
|
public void useSchematic(Schematic schem){
|
||||||
selectPlans.addAll(schematics.toPlans(schem, player.tileX(), player.tileY()));
|
useSchematic(schem, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract void useSchematic(Schematic schem, boolean checkHidden);
|
||||||
|
|
||||||
protected void showSchematicSave(){
|
protected void showSchematicSave(){
|
||||||
if(lastSchematic == null) return;
|
if(lastSchematic == null) return;
|
||||||
|
|
||||||
|
|||||||
@@ -501,9 +501,9 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void useSchematic(Schematic schem){
|
public void useSchematic(Schematic schem, boolean checkHidden){
|
||||||
selectPlans.clear();
|
selectPlans.clear();
|
||||||
selectPlans.addAll(schematics.toPlans(schem, World.toTile(Core.camera.position.x), World.toTile(Core.camera.position.y)));
|
selectPlans.addAll(schematics.toPlans(schem, World.toTile(Core.camera.position.x), World.toTile(Core.camera.position.y), checkHidden));
|
||||||
lastSchematic = schem;
|
lastSchematic = schem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ org.gradle.caching=true
|
|||||||
org.gradle.internal.http.socketTimeout=100000
|
org.gradle.internal.http.socketTimeout=100000
|
||||||
org.gradle.internal.http.connectionTimeout=100000
|
org.gradle.internal.http.connectionTimeout=100000
|
||||||
android.enableR8.fullMode=false
|
android.enableR8.fullMode=false
|
||||||
archash=5677d5c798
|
archash=c93f3ff4cb
|
||||||
|
|||||||
Reference in New Issue
Block a user