Page 1 of 1
on_blueprint_book_active_index_changed
Posted: Sat Jan 20, 2018 11:28 am
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.
Re: on_blueprint_book_active_index_changed
Posted: Fri Jan 26, 2018 10:48 pm
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.
Re: on_blueprint_book_active_index_changed
Posted: Fri Jan 26, 2018 11:01 pm
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.
Re: on_blueprint_book_active_index_changed
Posted: Fri Feb 02, 2018 1:36 am
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.
Re: on_blueprint_book_active_index_changed
Posted: Fri Feb 02, 2018 11:58 am
by 321freddy
That works as well. Thank you
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)