Quantcast LoTROInterface - View Single Post - Help affecting other windows
View Single Post
  #7  
Unread 09-28-2010, 12:29 PM
Olenn's Avatar
Olenn Olenn is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 47
Thanks, DU. I have been digging through your code all day. Your classes are quite elegant and I have been learning a lot. I have my entire settings window built now and I am still figuring out what everything does and how to tie it all up.

Here is the code if you are interested.

Code:
import "Turbine";
import "Turbine.Gameplay";
import "Turbine.UI";
import "Turbine.UI.Extensions";
import "Turbine.UI.Lotro";
import "Turbine.Utils";
import "Olenn.Satchel"
import "Olenn.DUInterface";
import "Olenn.Utilsx";

---Big thanks to Digital_Utopia for use of his code!

SetupWindow = class(Olenn.DUInterface.Window );

function SetupWindow:Constructor()
	Olenn.DUInterface.Window.Constructor( self,380,225 );
	if ( self.window ~= nil ) then
		return;
	end
	self:SetPosition((Turbine.UI.Display.GetWidth() / 2) - (self:GetWidth() / 2), (Turbine.UI.Display.GetHeight() / 2 ) - (self:GetHeight()));
	self.tbHolder:SetWidth(255);
	self.tbRight:SetPosition(self.tbHolder:GetWidth()-35,0)
	self.tbHolder:SetLeft((self:GetWidth() - self.tbHolder:GetWidth())/2);
	self.tbCenter:SetSize(self.tbHolder:GetWidth()-70,42);
	self.tbCenter:SetPosition(self.tbLeft:GetLeft()+35,0)
	self.bg:SetSize(325, 180);
	self.text:SetText("Satchel Options");
	self.text:SetWidth(self.tbHolder:GetWidth());
	self.text:SetHeight(20);
	self.text:SetLeft(-35);
	self.text:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleCenter);
	self.clButton:SetPosition(self:GetWidth()-23,24)
	self.tw=Turbine.UI.Window();
	self.tw:SetParent(self);
	self.tw:SetSize(400,534);
	self.tw:SetPosition(0,0);
	self.tw:SetMouseVisible(false);
	
	
	self.sp=Turbine.UI.ListBox();
	self.sp:SetParent(self.tw);
	self.sp:SetPosition(12,65);
	self.sp:SetSize(356,448);


	self.sp:SetOrientation( Turbine.UI.Orientation.Horizontal );
	self.sp:SetMaxItemsPerLine(1);
	self.sp:SetBackColorBlendMode(0);
	self.sp:SetBlendMode(4);
	

----BOTTOM BUTTONS----
	self.defSettings=Turbine.UI.Lotro.Button();
	self.defSettings:SetParent(self.tw);
	self.defSettings:SetSize(128,20);
	self.defSettings:SetText("Default Settings");
	self.defSettings:SetPosition(41, 190);
	
	self.accSettings=Turbine.UI.Lotro.Button();
	self.accSettings:SetParent(self.tw);
	self.accSettings:SetSize(128,20);
	self.accSettings:SetText("Accept");
	self.accSettings:SetPosition(215,190);
	

----SATCHEL LOCKED CHECK BOX----
	self.sp:AddItem(self.hdr);
	self.sicHolder=Turbine.UI.Control();
	self.sicHolder:SetSize(280,30);
	
	self.locked = Olenn.DUInterface.CheckBox();
	self.locked:SetChecked(true);
	self.locked:SetText("Satchel locked");
	self.locked:SetParent(self.sicHolder);
	self.locked:SetPosition(-112,0);
	self.sp:AddItem(self.sicHolder); 

	
----SETTINGS SCOPE----
	self.acHolder=Turbine.UI.Control();
	self.acHolder:SetSize(400,30);
	
	self.ac = Olenn.DUInterface.DropDownBox({"Account","Character","Server"});
	self.ac:SetParent(self.acHolder);
	self.ac:SetPosition(160,0);
	self.acPanel = Turbine.UI.Window();
	self.acPanel:SetParent(self.sp);
	self.acPanel:SetPosition(0,0);
	self.acPanel:SetSize(480,448);
	self.acPanel:SetZOrder(99);
	self.acPanel:SetVisible(false);
	self.acLb = self.ac.listBox; 
	self.acLb:SetParent(self.acPanel);
	self.acLb:SetZOrder(99);
	self.acLb:SetBlendMode(0);
	self.acLb:SetBackColorBlendMode(0);
	self.acLb:SetPosition(200,200);
	self.acLabel=Turbine.UI.Label();
	self.acLabel:SetParent(self.acHolder);
	self.acLabel:SetPosition(-34,0);
	self.acLabel:SetSize(200,20);
	self.acLabel:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleCenter);
	self.acLabel:SetFont(Turbine.UI.Lotro.Font.TrajanPro14);
	self.acLabel:SetForeColor(Turbine.UI.Color(1,0.96,0.874,0.576));
	self.acLabel:SetText("Settings Scope");
	self.sp:AddItem(self.acHolder);


----OPACITY SLIDER----
	self.voHolder = Turbine.UI.Control();
	self.voHolder:SetSize(335,45);

	self.voSld = Olenn.DUInterface.Slider();
	self.voSld:SetParent(self.voHolder);
	self.voSld:SetLeft(20);
	self.voSld:SetText("Opacity");
	self.sp:AddItem(self.voHolder);
	
	self.bpHolder = Turbine.UI.Control();
	self.bpHolder:SetSize(335,45);


	
	self.txHolder = Turbine.UI.Control();
	self.txHolder:SetSize(400,45);

	
		self.acPanel.MouseClick=function(sender,args)
		self.ac.Close();
		self.acPanel:SetVisible(false);
	end


	self.ac.Opening =function()
		self.acPanel:SetVisible(true);
		tl,tt=self.acHolder:PointToScreen(self.acHolder:GetPosition());
		self.acLb:SetPosition(246,self.acHolder:GetTop()+21);
		
	end
	

	self.showSetup = function()
		
	end
	
	self.closeSetup = function()
	
	end
end
One question, is there a reason you create your own window as opposed to using Turb's? It seams that if I use Turb's window that it accepts skins from users. Just a question, thanks for everything.
Reply With Quote