Aller au contenu

Photo

Made my own ui, but the buttons don't work


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

#1
Colton

Colton
  • Members
  • 58 messages

Ok, so I made a new ui addition, and the buttons that should bring them up.

 

Here are the buttons, beneath the inventory screen: https://i.gyazo.com/...67305273494.png

This is the xml bit from the inventory: https://gyazo.com/e2...4e26518f50d9246

 

 

 

And here is the ui that needs to open when they are clicked: https://gyazo.com/e9...4d115860e986d25

This is the xml from the new ui: https://gyazo.com/49...e067a87953f5ef6

 

 

I am at a complete loss, I don't know how to make the buttons open the new ui. Sorry If this si something really stupid and easy, I'm new.

 

Thanks!



#2
kevL

kevL
  • Members
  • 4 056 messages
DisplayGuiScreen() is an NwScript function, not a GUI function per se. ... more like this:

 
<UIScene name="SCREEN_INVENTORY" ... scriptloadable="true"

<UIButton name="TELEPORT"
OnLeftClick='UIObject_Misc_ExecuteServerScript("gui_teleport")'
<UIButton name="ENCHANT"
OnLeftClick='UIObject_Misc_ExecuteServerScript("gui_enchant")'
// 'gui_teleport'
void main()
{
    object oPC = OBJECT_SELF;
    oPC = GetControlledCharacter(oPC); // this is prob not needed.

    SendMessageToPC(oPC, "You open the Teleport screen");

    DisplayGuiScreen(oPC, "SCREEN_TELEPORT", FALSE);
}
where SCREEN_TELEPORT is the UIScene name of your teleport.xml

And that scene has been added to ingamegui.ini, ingameguix1.ini, ingameguix2.ini (personally i run with just the x2 version). Notice however that DisplayGuiScreen() was expanded at some point to simply input a filename.xml -- you wouldn't need to add the scene in the .ini(s) when passing sFileName, though it might want the ".xml" extension idk
  • Colton aime ceci

#3
Colton

Colton
  • Members
  • 58 messages

Thank you very much KevL