teoxoy / factorio-blueprint-editor

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

Implement the other cursorBoxes #24

Open teoxoy opened 5 years ago

teoxoy commented 5 years ago
EphDoering commented 5 years ago

I think this is referring to the blue boxes that show up on connected entities:

  1. Blue for electrically connected entities,
  2. White boxes that show up on inserter connected entities (and the yellow triangles indicating inserter direction)
  3. Green boxes on corresponding underground entities.

Is this correct? / Am I missing any?

If so, I think a precursor would be a system to record those connections. I think it would make sense to keep track of those connections separate from the display of the cursors. That way the connection information could also be used for the throughput/bottleneck detector, displaying the "unplugged" warning sign etc.

Maybe this connection recording system is already in place, but given how the underground highlighting code is written my guess is that it's not storring that connection information anywhere.

teoxoy commented 5 years ago

I have just implemented nr3 in 01123339e5fc49a6b806c5fc728efe3eadc37ad6 and I'm currently getting the copy/paste of entity settings (green cursorBox around source entity).

I don't think we would need to keep track of those connections. The needed position data is in G.bp.entityPositionGrid. I guess it would be helpful in the future for the "unplugged" warning sign but haven't thought how that would work yet.

I feel like there is logic code everywhere - as the project progressed, it got out of hand and I'm looking into refactoring it using an ECS (Entity Component System). Not sure when or if I will do it but ECS looks quite interesting. This is not really related to this issue but it's just something that is bothering me. :)

teoxoy commented 5 years ago

A few cursor boxes were missing from your comment so I made a check list in the issue body that you can refer to.