[1.1.5] Copy-paste-tool reported as "blueprint" in on_player_setup_blueprint event.item

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Post Reply
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

[1.1.5] Copy-paste-tool reported as "blueprint" in on_player_setup_blueprint event.item

Post by eradicator »

The on_player_setup_blueprint event's "item" string is "blueprint" even when the copy-paste-tool was used.

Code: Select all

/c
script.on_event(defines.events.on_player_setup_blueprint, function(e)
  game.print(e.item)
  end)
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.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [1.1.5] Copy-paste-tool reported as "blueprint" in on_player_setup_blueprint event.item

Post by posila »

I don't know if this is a bug. Copy-paste tool literally spawns a blueprint item in the cursor and that get's setup.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [1.1.5] Copy-paste-tool reported as "blueprint" in on_player_setup_blueprint event.item

Post by eradicator »

posila wrote:
Mon Dec 07, 2020 2:39 pm
I don't know if this is a bug. Copy-paste tool literally spawns a blueprint item in the cursor and that get's setup.
The api event doc states:
item :: string: The item used to select the area.
As the player.cursor_stack is already replaced by the blueprint during the event there's no way to distinguish between a normal blueprint select and a copy-paste-tool select otherwise.
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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.5] Copy-paste-tool reported as "blueprint" in on_player_setup_blueprint event.item

Post by Rseding91 »

eradicator wrote:
Mon Dec 07, 2020 2:56 pm
posila wrote:
Mon Dec 07, 2020 2:39 pm
I don't know if this is a bug. Copy-paste tool literally spawns a blueprint item in the cursor and that get's setup.
The api event doc states:
item :: string: The item used to select the area.
As the player.cursor_stack is already replaced by the blueprint during the event there's no way to distinguish between a normal blueprint select and a copy-paste-tool select otherwise.
I can update the Lua docs if wanted. But I don't consider it worth the time and annoying complexity to do anything around copy/cut-paste and blueprint re-assigning. It's a giant spaghetti mess that I don't want to stick more spaghetti code around. It's "what it is" and if it works for some peoples purposes that's great but after years of trying to make all the cases people have work It's just not worth it. Sorry.
If you want to get ahold of me I'm almost always on Discord.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [1.1.5] Copy-paste-tool reported as "blueprint" in on_player_setup_blueprint event.item

Post by eradicator »

Rseding91 wrote:
Mon Dec 07, 2020 9:27 pm
I can update the Lua docs if wanted.
Yes please. At the very least that should prevent other people from also getting a headache :D.

Just to be sure: This means that there currently is no straight-forward way to distinguish between a copy-paste made blueprint and a normal one right? So i'd have to do cursor_stack_changed heuristics, or maybe opened gui guessing.
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.

Post Reply

Return to “Minor issues”