Hello,
First of all - thanks for continuing the work on the mod, it is really a lovely addition to the game, and I hope you are still somewhat active in Factorio modding :)
This idea/suggestion is related to problems around preserving the display plate information when a player selects new contents for the blueprint.
For start, I am aware of all the issues behind it - went through a thread on the forums where the inability to access/modify blueprint entities during this event was discussed etc, and I started digging into the code a bit as well to see what's going on, and if some workaround was possible.
So, my idea was to try to find some other type of entity that could allow storing the information instead, and what I ended-up with was basing the display plates on lamp
prototype instead of the simple-entity-with-owner
prototype. The idea is to misuse the lamp's circuit condition to store information about displayed item, and the "Use colors" option for storing map marker toggle.
Of course, this would be quite a big refactor of the code, but it would allow to update existing blueprints without loss of information. The only drawback that I see is that it could affect performance, but I'm guessing that fake lamps that do not connect to electric network nor actually emit any kind of light shouldn't be an issue.
Currently I have a very quick-and-dirty hack locally where I was able to achieve the following:
- Properly rendering the display plate as lamp, without it overlapping on top of character when walking on top of it (using
integration_patch
, with picture_on
/picture_off
being set to bogus 1x1 PNG).
- Hooking into the correct event to trigger the display plate symbol selection dialog to be shown (
defines.events.on_gui_opened
, check if display plate is the entity, and simply display Industrial Plate Display GUI so that lamp GUI would get replaced/closed).
- Just some ad-hoc checking if I can easily access circuit condition on display-plate-as-a-lamp entity.
I would be highly interested in contributing with a full patch via pull request if you would be interested in taking this direction, but I really wanted to check your feedback before starting any major coding :)
Best regards,
Branko
P.S.
Another possibility might be looking into constant-combinator
as the base, but that might require finding a way to disable showing the symbol in alt-mode. A positive thing could be that display plate could be used for emitting signal as well, though.