Hi,
I wonder if there is a way to get the entity that is copied when you do a shift-right-button ?
Because I want to do my own paste from this source...
Get the entity copied by shift-right-button ?
Get the entity copied by shift-right-button ?
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)
Re: Get the entity copied by shift-right-button ?
If you want to get ahold of me I'm almost always on Discord.
Re: Get the entity copied by shift-right-button ?
I already tried this one,
but it only works when doing the paste operation with shift-left-click on a single destination.
I am writing a mod that is doing multiple paste at once on several destination objects.
So I defined a selection tool, that I want to use for the paste part, calling several times copy_settings.
But for the copy part, it would be nice if I retain the classical factorio copy that users already know : "shit-right-click".
So I just need to get the source part of the on_pre_entity_settings_pasted, before the classical paste is done.
but it only works when doing the paste operation with shift-left-click on a single destination.
I am writing a mod that is doing multiple paste at once on several destination objects.
So I defined a selection tool, that I want to use for the paste part, calling several times copy_settings.
But for the copy part, it would be nice if I retain the classical factorio copy that users already know : "shit-right-click".
So I just need to get the source part of the on_pre_entity_settings_pasted, before the classical paste is done.
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)
Re: Get the entity copied by shift-right-button ?
I don't understand what you're asking for...
If you want to get ahold of me I'm almost always on Discord.
Re: Get the entity copied by shift-right-button ?
Sorry for my english, I will rephrase :
When the user clicks on shift-right-mouse on an entity (the "copy" part of the classical copy-paste process), I would like to get the entity that was selected.
I.e. the entity that will appear as the source in the on_pre_entity_settings_pasted, ONLY IF the user makes a shift-left-click to paste.
So I would like to get this entity BEFORE the user makes any paste with shift-left-mouse.
Because I want to make my own multiple paste selection tool. So the on_pre_entity_settings_pasted will not be triggered by my custom selection tool taht I will use for multiple pasting.
EDIT : to be short, there is already a player.selected variable.
I'm looking for a player.copy_source variable. That contains the last entity that was shift-right-clicked.
When the user clicks on shift-right-mouse on an entity (the "copy" part of the classical copy-paste process), I would like to get the entity that was selected.
I.e. the entity that will appear as the source in the on_pre_entity_settings_pasted, ONLY IF the user makes a shift-left-click to paste.
So I would like to get this entity BEFORE the user makes any paste with shift-left-mouse.
Because I want to make my own multiple paste selection tool. So the on_pre_entity_settings_pasted will not be triggered by my custom selection tool taht I will use for multiple pasting.
EDIT : to be short, there is already a player.selected variable.
I'm looking for a player.copy_source variable. That contains the last entity that was shift-right-clicked.
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)
Re: Get the entity copied by shift-right-button ?
Rseding, here is the tool I wrote, so that you see what I try to say.
viewtopic.php?f=92&t=30163
look at image no2.
it's here that I would like to use the classical shift-right-mouse source object.
viewtopic.php?f=92&t=30163
look at image no2.
it's here that I would like to use the classical shift-right-mouse source object.
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)
Re: Get the entity copied by shift-right-button ?
Looks like it was implemented in 0.13.13:
FactorioBot wrote:
- Scripting
- Added LuaPlayer::entity_copy_source - the source entity used during entity settings copy paste.
Factorio Lua API wrote:entity_copy_source :: LuaEntity [Read-only]
- The source entity used during entity settings copy-paste if any.
nil if there isn't currently a source entity.
Re: Get the entity copied by shift-right-button ?
Thx Rseding !Added LuaPlayer::entity_copy_source - the source entity used during entity settings copy paste.
My mods on the Factorio Mod Portal ![Geek :geek:](./images/smilies/icon_e_geek.gif)
![Geek :geek:](./images/smilies/icon_e_geek.gif)