Note on using On hide and changing dependent variables UI
Posted: Wed Aug 31, 2011 9:03 am
It's not really a bug but something to consider.
I recently had an issue with trying to fix a bug with my "tons of code" Ui. I actually removed a string from a list directly after hiding a Ui window that depended on it. I also had a selected index which marked which one in the list was currently displayed on screen (a screen worth of stuff to display for each thing in the list). So if the selected index was the last item on the list renpy would crash because while hiding the window renpy still references that item in the list.
I got around it by making a copy of the list and having the Ui reference the copy while action modifying the original list.
I recently had an issue with trying to fix a bug with my "tons of code" Ui. I actually removed a string from a list directly after hiding a Ui window that depended on it. I also had a selected index which marked which one in the list was currently displayed on screen (a screen worth of stuff to display for each thing in the list). So if the selected index was the last item on the list renpy would crash because while hiding the window renpy still references that item in the list.
I got around it by making a copy of the list and having the Ui reference the copy while action modifying the original list.