I have some custom entities that use the electric-energy-interface as the "base". I'd like to be able to support copy-pasting of entity settings between them, but attempting to copy settings from an EEI doesn't seem to do anything.
Is there any way to enable copy-paste on entities that don't otherwise support it?
If not, I suppose I could always overlay a constant-combinator over the whole thing but then the tooltip will be for that instead of showing the power needs of the entity...
Copy-paste entity settings for EEI
Re: Copy-paste entity settings for EEI
electric-energy-interface does support copy/paste. Please describe exactly what you tried to do, and exactly what you want to happen.
Re: Copy-paste entity settings for EEI
The EEI has settings associated with it, and I want to be able to copy-paste them with shift-left/right clicking. But, as you mention, EEI doesn't support copy-paste. I wanted to know if there's a way to force it. I know entities can be forced to accept pastes, but allowing copy is another matter...
- NotRexButCaesar
- Smart Inserter
- Posts: 1122
- Joined: Sun Feb 16, 2020 12:47 am
- Contact:
Re: Copy-paste entity settings for EEI
Emphasis added
DaveMcW wants you to be more specific about what you did.
Ⅲ—Crevez, chiens, si vous n'étes pas contents!
Re: Copy-paste entity settings for EEI
Oh whoops, I misread.
I made an electric-energy-interface prototype with 20MW consumption, placed it in game and tried to copy settings from it with shift-right click. There was no sound and no green highlight box around it.
However I'm realising now... The UI type is none since it's a fixed consumer and not a player-controlled thing. Maybe that's why I can't copy from it?
I made an electric-energy-interface prototype with 20MW consumption, placed it in game and tried to copy settings from it with shift-right click. There was no sound and no green highlight box around it.
However I'm realising now... The UI type is none since it's a fixed consumer and not a player-controlled thing. Maybe that's why I can't copy from it?
Re: Copy-paste entity settings for EEI
Apparently electric-energy-interface is hard-coded to only support copy-paste if it has a gui. You can get a gui in the map editor, but that does not help normal users.
Maybe you can replace the gui in on_gui_opened so it still exists but the player can't use it.
Maybe you can replace the gui in on_gui_opened so it still exists but the player can't use it.
Re: Copy-paste entity settings for EEI
Since the setting is a toggle and the building in question cannot be rotated once placed, I went and implemented this as "hit the Rotate key to toggle the mode without having to open the GUI" instead. It's a convenience feature anyway and the control is now in the entity-description text so it's all good.
Thanks for the help, sorry for misreading XD
Thanks for the help, sorry for misreading XD
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Copy-paste entity settings for EEI
For future readers: You can use the on_entity_settings_pasted event to implement custom behavior.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Copy-paste entity settings for EEI
on_entity_settings_pasted is inconsistent, which is why this thread exists. The event does not trigger for an electric-energy-interface with no gui.eradicator wrote: ↑Wed Aug 04, 2021 10:52 amFor future readers: You can use the on_entity_settings_pasted event to implement custom behavior.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Copy-paste entity settings for EEI
Apologies. I thought the thread was about the EEI not supporting "natural" pasting. I don't see anyone mentioning events. In that case one could try to hack their own event using linked game controls 'copy-entity-settings' and 'paste-entity-settings'. And possibly LuaPlayer.entity_copy_source?DaveMcW wrote: ↑Wed Aug 04, 2021 2:04 pmon_entity_settings_pasted is inconsistent, which is why this thread exists. The event does not trigger for an electric-energy-interface with no gui.eradicator wrote: ↑Wed Aug 04, 2021 10:52 amFor future readers: You can use the on_entity_settings_pasted event to implement custom behavior.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.