View Single Post
  #13  
Unread 10-02-2010, 09:04 AM
Digital_Utopia's Avatar
Digital_Utopia Digital_Utopia is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 207
Quote:
Originally Posted by Olenn
Wow, thanks DU, that should be stickied.

I guess that my problem is this;

When I add this to SetupWindow.lua

Code:
	self.sp:AddItem(self.hdr);
	self.sicHolder=Turbine.UI.Control();
	self.sicHolder:SetSize(280,30);
	
	self.locked = Olenn.DUInterface.CheckBox();
	self.locked:SetChecked(false);
	self.locked:SetText("Satchel locked");
	self.locked:SetParent(self.sicHolder);
	self.locked:SetPosition(-112,0);
	self.sp:AddItem(self.sicHolder);
and this to SatchelWindow.lua

Code:
           self.moveBlocker=Turbine.UI.Window();
	self.moveBlocker:SetParent(self);
           self.moveBlocker:SetSize(self:GetWidth() - 25,35);
	self.moveBlocker:SetPosition(0,0);
	self.moveBlocker:SetZOrder(20);
           self.moveBlocker:SetMouseVisible(false);
Everythings good, but obiviously I haven't done anything yet, but when I add this;

Code:
if ( SetupWindow.locked:IsChecked(true) ) then
     self.moveBlocker:SetMouseVisible(true);
else
     self.moveBlocker:SetMouseVisible(false);
end
I get this;

...Rings Online\Plugins\Olenn\Satchel\SatchelWindow.lua:51: attempt to index field 'locked' (a nil value)

It would seem to me that SetupWindow.locked should point to that in the SetupWindow.lua.

Now, I am obviously missing something because I completely ignored the line that you wrote about adding a conditional. I am not even quite sure what a conditional is. I have been digging through lua.org, though, I just haven't been successful yet.
A conditional is an if/else statement - doing something on the condition that something else is true/false

but basically what the problem is that you need to start off in Main declaring an instance of both SetupWindow and SatchelWindow, and do your if/then/else within that: eg:

in Main.lua
Code:
setWindow = SetupWindow();
satWindow = SatchelWindow();

setWindow.locked.CheckChanged=function(sender,args)

if ( setWindow.locked:IsChecked(true) ) then
     satWindow.moveBlocker:SetMouseVisible(true);
else
     satWindow.moveBlocker:SetMouseVisible(false);
end

end
__________________

Lord of the Rings Online
75 Fourohfour | 75 Artemedis | 60 Whiskeytango Foxtrot | 50 Mistah Boombastic | 56 Appetizer | 25 Aggromi
61 Onepointtwentyone Gigawatts


World of Warcraft
90 Downlo 85 Gravetaxi 85 Ümad 85 Artemedis 85 Guthuros
Reply With Quote