Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-27-2006, 02:35 AM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Help with GUI

NPC Code:

//#CLIENTSIDE

function onWeaponFired(){
new GuiWindowCtrl(WindowTest){
extent = {140,62};
position = {50,50};

text = "Test Window";

new GuiButtonCtrl(Okay){
position = {6,24};
extent = {128,32};

text = "Okay!";
}
}
}
function WindowTest.onAction(){
WindowTest.destroy;
}




What's wrong with it?
Reply With Quote
  #2  
Old 03-27-2006, 03:29 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
You might mean to use Okay.onAction() as that is the actual button control, that is if you want the window to close when you click the button. Currently, WindowTest.onAction() is checking some action with the window itself, which I don't think happens. :o
__________________
Liek omigosh.

Reply With Quote
  #3  
Old 03-28-2006, 12:42 AM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
But shouldn't it still be created? It's not even popping up.
Reply With Quote
  #4  
Old 03-28-2006, 01:01 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by protagonist
But shouldn't it still be created? It's not even popping up.
You're not giving it a profile to use.

add: profile = "GuiBlueWindowProfile"; to the window, and: profile = "GuiBlueButtonProfile" to the button.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #5  
Old 03-28-2006, 01:46 AM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by ApothiX
You're not giving it a profile to use.

add: profile = "GuiBlueWindowProfile"; to the window, and: profile = "GuiBlueButtonProfile" to the button.
What if he doesn't like blue!
__________________
Liek omigosh.

Reply With Quote
  #6  
Old 03-28-2006, 01:51 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
NPC Code:

new GuiWindowCtrl("WindowTest"){


In the function creating the new window, WindowTest would be a string. You need quotations.
Reply With Quote
  #7  
Old 03-30-2006, 04:00 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Bl0nkt
NPC Code:

new GuiWindowCtrl("WindowTest"){


In the function creating the new window, WindowTest would be a string. You need quotations.
No, it doesn't have to have quotes around it. Most people prefer not to put quotes, for some odd reason.


Quote:
Originally Posted by Ajira
What if he doesn't like blue!
Then that's too bad for him!
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #8  
Old 03-30-2006, 08:40 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
I _BELIEVE_ the only arrays used in GUI controls are the rows object.

In which case, extent would be "min max", not {min,max};

Alternative, you could set x, y, width, and height. I personally don't like using extent and such.
Reply With Quote
  #9  
Old 03-30-2006, 08:49 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Yen
I _BELIEVE_ the only arrays used in GUI controls are the rows object.

In which case, extent would be "min max", not {min,max};

Alternative, you could set x, y, width, and height. I personally don't like using extent and such.
Arrays are probably more effective for setting these values. The "vector" datatype that people use (for example, "min max") are essentially converted into arrays anyway.
__________________
Skyld
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:11 PM.


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