Make LuaEntity.copy_settings raise events
Posted: Tue Feb 25, 2020 2:25 am
I would like LuaEntity.copy_settings to raise events of some kind for compatability.
I can see on_entity_settings_pasted and on_pre_entity_settings_pasted being modified so that player_index is optional, and an optional arg is added to LuaEntity.copy_settings to provide the player who did the copy pasteing if available.
Or adding a script_raised_pasted event, with source and destination fields just like the others.
This event may get the same player related treatment as mentioned above, though considering the other script_raised events do not have a player_index, it would be weird for this one to have it.
I personally can live with using script.raise_event to raise them myself, however in this case i would appreciate a concise specification of which entities can copy paste to which entities.
I am aware of LuaEntityPrototype.additional_pastable_entities, however you can copy from crafting machines to requester chests for example, which is not included in this property, and i was not able to find a list or something similar which contains all these special cases.
(I can try to find all cases myself with testing and experiance, i'm just worried i would miss some)
I would like to add that i am still against using script.raise_event for anything, so i would appreciate if i (or anybody) would not have to.
I can see on_entity_settings_pasted and on_pre_entity_settings_pasted being modified so that player_index is optional, and an optional arg is added to LuaEntity.copy_settings to provide the player who did the copy pasteing if available.
Or adding a script_raised_pasted event, with source and destination fields just like the others.
This event may get the same player related treatment as mentioned above, though considering the other script_raised events do not have a player_index, it would be weird for this one to have it.
I personally can live with using script.raise_event to raise them myself, however in this case i would appreciate a concise specification of which entities can copy paste to which entities.
I am aware of LuaEntityPrototype.additional_pastable_entities, however you can copy from crafting machines to requester chests for example, which is not included in this property, and i was not able to find a list or something similar which contains all these special cases.
(I can try to find all cases myself with testing and experiance, i'm just worried i would miss some)
I would like to add that i am still against using script.raise_event for anything, so i would appreciate if i (or anybody) would not have to.