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.x = (screenwidth / 2) - (this.width / 2);
this.y = (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.x = TradeWindow.x + TradeWindow.width + 5;
this.y = 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.x = (screenwidth / 2) - (this.width / 2);
this.y = (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.x = 0;
this.y = 0;
this.height = 20;
this.width = 120;
}
new GuiButtonCtrl("TradeInvitationAccept") {
this.profile = GuiGrayButtonProfile;
this.text = "Accept";
this.x = 10;
this.y = 25;
this.height = 20;
this.width = 100;
}
new GuiButtonCtrl("TradeInvitationDeny") {
this.profile = GuiGrayButtonProfile;
this.text = "Deny";
this.x = 10;
this.y = 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.x = (screenwidth / 2) - (this.width / 2);
this.y = (screenheight / 2) - (this.height / 2);
this.visible = false;
this.alpha = 0;
this.text = "Account:";
new GuiTextEditCtrl("TradeSendInviteAccount") {
this.profile = GuiGrayTextEditProfile;
this.x = 0;
this.y = 0;
this.height = 20;
this.width = 120;
}
new GuiButtonCtrl("TradeSendInvite") {
this.profile = GuiGrayButtonProfile;
this.text = "Send";
this.x = 10;
this.y = 25;
this.height = 20;
this.width = 100;
}
}
}