mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-27 16:09:57 +07:00
Minor duct preview optimizations
This commit is contained in:
parent
75abe7661d
commit
8d12dbbe70
@ -50,8 +50,8 @@ public abstract class UnlockableContent extends MappableContent{
|
||||
fullIcon =
|
||||
Core.atlas.find(getContentType().name() + "-" + name + "-full",
|
||||
Core.atlas.find(name + "-full",
|
||||
Core.atlas.find(name,
|
||||
Core.atlas.find(getContentType().name() + "-" + name,
|
||||
Core.atlas.find(name,
|
||||
Core.atlas.find(name + "1")))));
|
||||
|
||||
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){
|
||||
otherReq = null;
|
||||
otherDst = range;
|
||||
Point2 d = Geometry.d4(req.rotation);
|
||||
list.each(other -> {
|
||||
if(other.block == this && req != other){
|
||||
for(int i = 1; i <= range; i++){
|
||||
if(req.x + (Geometry.d4x(req.rotation) * i) == other.x && req.y + (Geometry.d4y(req.rotation) * i) == other.y && i <= otherDst){
|
||||
otherReq = other;
|
||||
otherDst = i;
|
||||
}
|
||||
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){
|
||||
int dst = Math.max(Math.abs(other.x - req.x), Math.abs(other.y - req.y));
|
||||
if(dst <= otherDst){
|
||||
otherReq = other;
|
||||
otherDst = dst;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user