Minor duct preview optimizations
This commit is contained in:
@@ -50,8 +50,8 @@ public abstract class UnlockableContent extends MappableContent{
|
|||||||
fullIcon =
|
fullIcon =
|
||||||
Core.atlas.find(getContentType().name() + "-" + name + "-full",
|
Core.atlas.find(getContentType().name() + "-" + name + "-full",
|
||||||
Core.atlas.find(name + "-full",
|
Core.atlas.find(name + "-full",
|
||||||
Core.atlas.find(name,
|
|
||||||
Core.atlas.find(getContentType().name() + "-" + name,
|
Core.atlas.find(getContentType().name() + "-" + name,
|
||||||
|
Core.atlas.find(name,
|
||||||
Core.atlas.find(name + "1")))));
|
Core.atlas.find(name + "1")))));
|
||||||
|
|
||||||
uiIcon = Core.atlas.find(getContentType().name() + "-" + name + "-ui", fullIcon);
|
uiIcon = Core.atlas.find(getContentType().name() + "-" + name + "-ui", fullIcon);
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ public class DuctBridge extends Block{
|
|||||||
public void drawRequestConfigTop(BuildPlan req, Eachable<BuildPlan> list){
|
public void drawRequestConfigTop(BuildPlan req, Eachable<BuildPlan> list){
|
||||||
otherReq = null;
|
otherReq = null;
|
||||||
otherDst = range;
|
otherDst = range;
|
||||||
|
Point2 d = Geometry.d4(req.rotation);
|
||||||
list.each(other -> {
|
list.each(other -> {
|
||||||
if(other.block == this && req != other){
|
if(other.block == this && req != other && Mathf.clamp(other.x - req.x, -1, 1) == d.x && Mathf.clamp(other.y - req.y, -1, 1) == d.y){
|
||||||
for(int i = 1; i <= range; i++){
|
int dst = Math.max(Math.abs(other.x - req.x), Math.abs(other.y - req.y));
|
||||||
if(req.x + (Geometry.d4x(req.rotation) * i) == other.x && req.y + (Geometry.d4y(req.rotation) * i) == other.y && i <= otherDst){
|
if(dst <= otherDst){
|
||||||
otherReq = other;
|
otherReq = other;
|
||||||
otherDst = i;
|
otherDst = dst;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user