Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GUI Openning + Textlist Help (https://forums.graalonline.com/forums/showthread.php?t=134266859)

Astram 07-26-2012 10:54 PM

GUI Openning + Textlist Help
 
Hey, I have a question. You may have known me before, but I left for around 1 year. Now I am back and I am deciding to script again, however forgetting some things. However, on a GUI I'm working on, when I say /test the first time, the GUI opens. However, after I "X" out, the second time I try, it doesn't open. I am calling the GUINAME.open(); event too, because I think that is how you do it, if I remember correctly but I just can't remember 100%.

In this GUI I also have a text list. However, I don't know how to get the selected row from the TextList and use it on text. For example, I don't know how to take Archer from a selected text list, and show up in the same GUI as "You selected: Archer". I think this is because it won't update it I believe until you re-open it. But then the selected text will be gone, so please give me help on these 2 things!

Thanks!

fowlplay4 07-26-2012 11:17 PM

It's show() not open, and you can use an event to get what you selected.

All GUI objects have these functions on this page: http://wiki.graal.net/index.php/Crea...ent/GuiControl

PHP Code:

//#CLIENTSIDE

// < Your GUI Stuff Here >

function YourGUITextListName.onDblClick(entryid,entrytext,entryindex) {
  echo(
"You selected: " entrytext);


See here for other events GuiTextListCtrl has: http://wiki.graal.net/index.php/Crea...uiTextListCtrl

cbk1994 07-27-2012 03:03 AM

Quote:

Originally Posted by fowlplay4 (Post 1700192)
It's show() not open, and you can use an event to get what you selected.

All GUI objects have these functions on this page: http://wiki.graal.net/index.php/Crea...ent/GuiControl

To expand on this, the reason it's not working is because when the window is closed, visible becomes false. When you show the window the next time by using new GuiWindowCtrl, it reuses the same window object. Since visible is still false, it doesn't show.

Normally I just set visible = true when creating a new window.


All times are GMT +2. The time now is 11:03 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.