teoxoy / factorio-blueprint-editor

A feature-rich Factorio Blueprint Editor
https://fbe.teoxoy.com
MIT License
299 stars 61 forks source link

Adds circuit wires #248

Closed cryhot closed 1 year ago

cryhot commented 1 year ago

I added the following features:

teoxoy commented 1 year ago

This looks great! Thanks for the PR!

There seems to be an issue with the box/hit detection?

https://user-images.githubusercontent.com/28601907/219900207-aae2e327-07f2-4e78-be6d-c29343d390c1.mp4

cryhot commented 1 year ago

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.

cryhot commented 1 year ago

I fixed the hitbox problem. Also fixed the settings problem. Also added the following feature: