lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #11  
Unread 10-02-2010, 05:50 AM
SanDBoX's Avatar
SanDBoX SanDBoX is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Location: Idaho
Posts: 40
Another thing to note is the main file gives you a great place to instance and access your classes (or windows) that way you have one place where you can see what all your windows are doing and how they are diffrent. It also gives you the ability to pass one instance into another or compare data between them, or create a class whithin a class (such as a subwindow).

I found that most of my "real" logic ended up in main so that it could access and pull data from everywhere and my window classes had minimal logic, mostly just layout.
Reply With Quote
  #12  
Unread 10-02-2010, 08:27 AM
Olenn's Avatar
Olenn Olenn is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 47
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.
Reply With Quote
  #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
Send a message via MSN to Digital_Utopia Send a message via Yahoo to Digital_Utopia
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
  #14  
Unread 10-02-2010, 03:04 PM
Olenn's Avatar
Olenn Olenn is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 47
Okay, I think I understand everything, and I am pretty sure that I have everything where is is supposed to go. I just got the error;

...d of the Rings Online\Plugins\Olenn\Satchel\Main.lua:63: attempt to call method 'IsChecked' (a boolean value)

I know that a boolean in a 'true / false' statement, but what is this error trying to tell me?

Oh yeah, the line it is calling is;

Code:
61     SetupWindow.locked.CheckChanged=function(sender,args)
62
63     if ( SetupWindow.locked:IsChecked(true) ) then
64          SatchelWindow.moveBlocker:SetMouseVisible(true);
65     else
66          SatchelWindow.moveBlocker:SetMouseVisible(false);
67     end
68
69     end
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving window position Olenn Lua Programming Help (L) 25 10-01-2010 01:08 AM
Quest Window Normandy9 Interface Requests (L) 0 09-12-2010 05:38 PM
Raid window? Kyosen Graphics modification help (L) 4 06-13-2008 07:58 PM
Horizontal Fellowship window? Askyn Interface Help (L) 4 01-01-2008 04:45 PM
Is there an implied target window? zelindar Interface Help (L) 1 06-15-2007 05:04 PM


All times are GMT -5. The time now is 07:48 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui