PDA

View Full Version : Sidebar button memory



bmos
August 12th, 2020, 14:18
I have successfully added a new sidebar button, but it doesn't stay enabled when I reload FG. What am I missing?

Thanks :)

Trenloe
August 12th, 2020, 16:28
Are you enabling it via the button entries at the top of the Library window? Or are you enabling it via code?

bmos
August 12th, 2020, 16:37
Are you enabling it via the button entries at the top of the Library window? Or are you enabling it via code?Sorry, I should have specified. I'm checking the visibility box for it in the Library window. When I quit and re-load, it is unchecked again (I assume the original set of them is being loaded before my new option is added to the array).

Here's the code that I'm using to add it:
https://github.com/bmos/FG-PFRPG-Disease-Tracker/blob/diseaselibrary/scripts/disease_tracker.lua

Trenloe
August 12th, 2020, 17:00
FGC or FGU?

Do other standard buttons save their state after you exit FG and re-start the campaign?

EDIT: Note that /reload won't save these settings, you need to exit the campaign.

Trenloe
August 12th, 2020, 17:12
I can't see anything obviously wrong with your code.

The ["sidebar"] buttons are stored in the campaign CampaignRegistry.lua file. Check to see if that is being written OK when you exit.

bmos
August 12th, 2020, 17:42
Oh!
I hadn't actually closed, just /reload
Thanks Trenloe