entity_copy_source is the entity that the player last used Shift+Right-click on to copy its settings. A function to clear this property (i.e. set it back to nil) would be very nice, if not direct write access.
The motivation for this is my mod Compact Recipe Pins which allows you to create GUI pins of recipes, and then copy/paste those recipes from the pin into the machine.
To do this, I overload the controls for the standard copy/paste to create a control scheme that's obvious to the user, but this ends up conflicting with the standard copy behaviour, and I've had to employ numerous workarounds.
Obviously I could just solve it all by using different controls, but that's not what I'm looking to hear.
Provide a way to clear LuaPlayer::entity_copy_source
Re: Provide a way to clear LuaPlayer::entity_copy_source
Ok, I've added write support for 2.1.
If you want to get ahold of me I'm almost always on Discord.
Re: Provide a way to clear LuaPlayer::entity_copy_source
Thanks very much, I wonder if it will be possible to assign entities which don't normally support Copy/Paste. I guess we'll have to wait and see...
Something you may want to test for is that, when a CustomInput is using linked_game_control like mine is doing, the events run in this order:
Currently in the mod, I've been using the on_entity_settings_pasted event to detect when the vanilla behaviour triggers in order to clean up. Will this still run every time, even if my handler sets the property to nil or an invalid target?
Something you may want to test for is that, when a CustomInput is using linked_game_control like mine is doing, the events run in this order:
- Mod CustomInput handler (my recipe copy code)
- on_pre_entity_settings_pasted
- Native game control (Factorio's standard entity setting paste behaviour)
- on_entity_settings_pasted
Currently in the mod, I've been using the on_entity_settings_pasted event to detect when the vanilla behaviour triggers in order to clean up. Will this still run every time, even if my handler sets the property to nil or an invalid target?

