Find the original blueprint when "Select new contents for the blueprint" is clicked

Place to get help with not working mods / modding interface.
Post Reply
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Find the original blueprint when "Select new contents for the blueprint" is clicked

Post by DaveMcW »

When a player clicks "Select new contents for the blueprint" to replace an existing blueprint, the on_player_setup_blueprint event fires, and all the entity data is stored in the original blueprint. Reading the original blueprint is the offical way to access this data. However, the event has no way to access the original blueprint directly.

What is the best way to find the original blueprint?

I tried saving the original blueprint in on_gui_opened, and this works when right-clicking a blueprint in the player's inventory.

However, it fails when you open the gui by:
- Right-clicking a blueprint book in the player's inventory.
- Right-clicking a blueprint in the player's blueprint library.

Is there any way, or combination of ways, to reliably find the original blueprint when the player clicks "Select new contents for the blueprint"?

Post Reply

Return to “Modding help”