Closed cryhot closed 1 year ago
This looks great! Thanks for the PR!
There seems to be an issue with the box/hit detection?
I see what you mean. I used the entity selection_box
attribute to detect connection points (see getWire_connection_box
). It is smaller that a cell for some entities like inserters and power poles (and I'm not even talking about entities with multiple connection points).
On the other hand, getEntityAtPosition
return entities based on the cell. This leads to a situation where if the cursor is on a cell of an entity but not inside any of the connection points bounding boxes, then it shows the entity as "not connectable".
I'm not sure if we want to make the connection point hitbox bigger, or if we want to make getEntityAtPosition
consider the selection_box
attribute.
I fixed the hitbox problem. Also fixed the settings problem. Also added the following feature:
I added the following features:
Limit Wires Length
(on by default). When deactivated, one can move and connect entities even if it makes a wire longer than the max distance. Wires that are too long are indicated as shaded. This feature is helpful for rearranging your circuits without having to cut wires temporarily.