on_blueprint_book_active_index_changed

Post Reply
321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

on_blueprint_book_active_index_changed

Post by 321freddy »

Please add a new event called "on_blueprint_book_active_index_changed" (or something like that) which fires when the player changes the active index of the blueprint book in his cursor. Should at least contain the player index as an attribute.

Right now I have to monitor the LuaItemStack.active_index of every players cursor stack in on_tick to see if it changed.

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

Re: on_blueprint_book_active_index_changed

Post by Rseding91 »

I can make such an event but it would only be fired if the player changed the index while it's in the cursor. It wouldn't include opening the book and cycling it there due to how the Lua API interacts with item stacks.

Would that still be useful? It doesn't sound like it would be to me.
If you want to get ahold of me I'm almost always on Discord.

321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: on_blueprint_book_active_index_changed

Post by 321freddy »

That's fine, I only need to know if index of the item in the cursor changed.

It is for my mod Attach notes (see signature). I have custom GUI which shows the note of the selected blueprint.
The gui has to update when the selected blueprint changes. For normal blueprints I use on_player_cursor_stack_changed, but there is no event for when the book index changes.

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

Re: on_blueprint_book_active_index_changed

Post by Rseding91 »

I've changed it so in the next version of 0.16. a player changing the active index in a blueprint book in the cursor will fire the player_cursor_stack_changed event.
If you want to get ahold of me I'm almost always on Discord.

321freddy
Fast Inserter
Fast Inserter
Posts: 125
Joined: Fri Sep 23, 2016 10:16 pm
Contact:

Re: on_blueprint_book_active_index_changed

Post by 321freddy »

That works as well. Thank you :D

Post Reply

Return to “Implemented mod requests”