Aller au contenu

Photo

XML Dialogs not firing callbacks


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
ColorsFade

ColorsFade
  • Members
  • 1 271 messages
 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?

#2
kevL

kevL
  • Members
  • 4 078 messages
don't gui-callback scripts need to start with "gui_" ?

#3
-Semper-

-Semper-
  • Members
  • 2 259 messages
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
ColorsFade

ColorsFade
  • Members
  • 1 271 messages
You are correct! I did not find that little tidbit of information in the two guides I was following.

Thanks! That fixed it.