I don't know who among you might know about this stuff, but I started looking into the XML dialogs to see if I could solve a particular problem.
What I want to do is pop the PartyRoster dialog so the player can edit their party. So I copied the XML file to /ui/custom and renamed it.
I then went about testing it by firing the following from a script:
DisplayGuiScreen(oPC, "Party", FALSE, "party.xml");
This works. It opens the dialog in the screen just fine. So, then I read about event callbacks and how they are handled in the XML file. Supposedly, you can perform more than one callback on a button click. So I wrote the following into the accept button:
<UIButton name="COMMIT_PARTY" strref="181409" x=0 y=0 style="STYLE_LARGE_BUTTON" OnLeftClick0=UIObject_MISC_ExecuteServerScript("d_accept_party") OnLeftClick1=UIObject_MISC_ExecuteServerScript("d_gui_test") OnLeftClick2=UIButton_Input_CommitNewRosterPartyMembers("local:0")></UIButton>
The scripts d_accept_party and d_gui_test simply are suppose to write statements to the chat window, but they don't happen.
One of those scripts is a Campaign script and the other is a module script. Neither fires.
Why is that?
According to documentation written by Lance Botelle and Sunjammer, this should work. But it doesn't. And I am at a loss for why.
I don't want to reinvent the wheel here. I'd prefer to use this dialog to handle party roster management. But if I can't get it to fire off and run custom scripts, it's pretty useless and I might have to go some other route (which will no doubt be less elegant).
Any ideas?
XML Dialogs not firing callbacks
Débuté par
ColorsFade
, avril 20 2013 04:20
#1
Posté 20 avril 2013 - 04:20
#2
Posté 20 avril 2013 - 04:27
don't gui-callback scripts need to start with "gui_" ?
#3
Posté 20 avril 2013 - 07:33
yup, kevl is right. callback scripts need to be named "gui_", else they won't fire. here's also a nice tutorial to get into gui scripting.
Modifié par -Semper-, 20 avril 2013 - 07:33 .
#4
Posté 20 avril 2013 - 02:18
You are correct! I did not find that little tidbit of information in the two guides I was following.
Thanks! That fixed it.
Thanks! That fixed it.





Retour en haut






