mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-28 07:22:21 -08:00
Minor duct preview optimizations
This commit is contained in:
parent
75abe7661d
commit
8d12dbbe70
2 changed files with 7 additions and 7 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue