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 09-20-2008, 08:19 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
GuiWindowCtrl bug/error.

For the life of me, I cannot figure out what's going wrong here. I'm creating 4 GuiWindowCtrls, and the first 3 work as intended. However, the fourth one is driving me crazy. Since Inverness is dealing with Ike, you guys will have to help me.

Here's the function that creates the controls. System.destroyobject(obj), checks to see if the object exists, then if so, it destroys it. All of the windows should not be visible, as their visibility is toggled by a fade script. However, if you look at the top left-hand corner, you will see a GuiTextEditCtrl and a GuiButtonCtrl.

It's either a really stupid mistake on my part (I tend to do that), or some kind of bug with Graal. As you can see from the engine log, TradeWindow4.fadein() does not exist, however fadein() is in the util_guifade class, which is joined to TradeWindow4 upon creation.

PHP Code:
function createcontrols() {
  
System.destroyobject("TradeWindow");
  
System.destroyobject("TradeWindow2");
  
System.destroyobject("TradeWindow3");
  
System.destroyobject("TradeWindow4");
  new 
GuiWindowCtrl("TradeWindow") {
    
this.join("util_guifade");
    
this.profile GuiGrayWindowProfile;
    
this.clientrelative true;
    
this.clientextent = {320,320};
    
this.canclose true;
    
this.canmaximize false;
    
this.canminimize false;
    
this.canmove true;
    
this.canresize true;
    
this.closequery false;
    
this.destroyonhide false;
    
this.= (screenwidth 2) - (this.width 2);
    
this.= (screenheight 2) - (this.height 2);
    
this.visible false;
    
this.alpha 0;
    
this.text "Your Offer";
    
thiso.catchevent(this.name"onMove""movewindows");
  }
  new 
GuiWindowCtrl("TradeWindow2") {
    
this.join("util_guifade");
    
this.profile GuiGrayWindowProfile;
    
this.clientrelative true;
    
this.clientextent = {220,320};
    
this.canclose false;
    
this.canmaximize false;
    
this.canminimize false;
    
this.canmove true;
    
this.canresize true;
    
this.closequery false;
    
this.destroyonhide false;
    
this.TradeWindow.TradeWindow.width 5;
    
this.TradeWindow.y;
    
this.visible false;
    
this.alpha 0;
    
this.text "TestAccount's Offer";
  }
  new 
GuiWindowCtrl("TradeWindow3") {
    
this.join("util_guifade");
    
this.profile GuiGrayWindowProfile;
    
this.clientrelative true;
    
this.clientextent = {120,80};
    
this.canclose false;
    
this.canmaximize false;
    
this.canminimize false;
    
this.canmove false;
    
this.canresize false;
    
this.closequery false;
    
this.destroyonhide false;
    
this.= (screenwidth 2) - (this.width 2);
    
this.= (screenheight 2) - (this.height 2);
    
this.visible false;
    
this.alpha 0;
    
this.text "Trade Invite";

    new 
GuiTextCtrl("TradeInvitationAccount") {
      
this.profile GuiGrayTextProfile;
      
this.text "From: TestAccount";
      
this.0;
      
this.0;
      
this.height 20;
      
this.width 120;
    }
    new 
GuiButtonCtrl("TradeInvitationAccept") {
      
this.profile GuiGrayButtonProfile;
      
this.text "Accept";
      
this.10;
      
this.25;
      
this.height 20;
      
this.width 100;
    }
    new 
GuiButtonCtrl("TradeInvitationDeny") {
      
this.profile GuiGrayButtonProfile;
      
this.text "Deny";
      
this.10;
      
this.50;
      
this.height 20;
      
this.width 100;
    }
  }
  new 
GuiWindowCtrl("TradeWindow4") {
    
this.join("util_guifade");
    
this.profile GuiGrayWindowProfile;
    
this.clientrelative true;
    
this.clientextent = {120,80};
    
this.canclose true;
    
this.canmaximize false;
    
this.canminimize false;
    
this.canmove false;
    
this.canresize false;
    
this.closequery false;
    
this.destroyonhide true;
    
this.= (screenwidth 2) - (this.width 2);
    
this.= (screenheight 2) - (this.height 2);
    
this.visible false;
    
this.alpha 0;
    
this.text "Account:";

    new 
GuiTextEditCtrl("TradeSendInviteAccount") {
      
this.profile GuiGrayTextEditProfile;
      
this.0;
      
this.0;
      
this.height 20;
      
this.width 120;
    }
    new 
GuiButtonCtrl("TradeSendInvite") {
      
this.profile GuiGrayButtonProfile;
      
this.text "Send";
      
this.10;
      
this.25;
      
this.height 20;
      
this.width 100;
    }
  }

Attached Thumbnails
Click image for larger version

Name:	GUI Window Screenshot.gif
Views:	83
Size:	160.8 KB
ID:	45938  
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #2  
Old 09-20-2008, 08:43 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Well, I'm unsure, but tried setting destroyonhide to false in the 4th window control? Maybe it destroys it when the alpha is 0.

Edit: Just saw you are setting this.visible to false aswell. I'm pretty sure this thing is destroyed again.
__________________
Reply With Quote
  #3  
Old 09-20-2008, 09:00 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by Crow View Post
Well, I'm unsure, but tried setting destroyonhide to false in the 4th window control? Maybe it destroys it when the alpha is 0.

Edit: Just saw you are setting this.visible to false aswell. I'm pretty sure this thing is destroyed again.
Huh. I did not know that alpha/visible actually destroys the control. However, setting this.destroyonhide to false worked. Thanks.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
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:46 PM.


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