Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Matt on April 22, 2012, 12:37:03 AM
-
I purchased NGUI a few weeks back and am really enjoying using it so far.
I'm trying to create a menu using the popup list and have run into a problem where the previous selected item is being remembered - when I attempt to select this item a second time immediately afterward, no event is fired.
i.e. one of the menu options is "Help (H)" to show a help dialog. I click on the button labeled "Menu" which displays the popup list, then select "Help (H)" to display the help dialog. I then close the dialog by clicking on the "X" in the top right corner.
This works well, however if I repeat the action a second time, the list thinks that "Help (H)" already selected and the dialog doesn't open since the event is not being triggered. I tried setting "selected" to null, however that triggers an exception.
My temporary workaround for this is to make mSelectedItem public, and set it to false which creates the behavior I want - obviously not a good or long term solution :)
Is there currently a good and simple way to either clear the selected item or prevent the selected item from being retained?
-
You mention that you're trying to create a menu... are you using a menu template to start with? I'm kind of confused by you mentioning clicking on a button and displaying a popup list.
-
Yes that's right. I used the "Popup Menu" template.
By "button" I mean the Label and SlicedSprite background which are automatically generated by the template.