lotrointerface.com
Search Downloads


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

Reply
 
Thread Tools Display Modes
  #1  
Unread 09-26-2010, 10:20 PM
Olenn's Avatar
Olenn Olenn is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 47
Help affecting other windows

Okay i am working on the Settings Panel for Satchel, and I was on a roll until I hit the last line.

I am trying to make the slider change the opacity of the Satchel window. If I replace "Olenn.Satchel.SatchelWindow" with self it will successfully change the opacity of the settings window, but how do I get it to change the opacity of the Satchel window?

Code:
	self:SetText("Satchel Settings");
	self:SetSize(400, 500);
	self:SetPosition( (Turbine.UI.Display.GetWidth() / 2) - 200, (Turbine.UI.Display.GetHeight() / 2 ) - 325 );
	self:SetOpacity(1);
	

	self.opacityLabel = Turbine.UI.Label();
	self.opacityLabel:SetParent( self );
	self.opacityLabel:SetSize(100, 50);
	self.opacityLabel:SetPosition(50 , 75);
	self.opacityLabel:SetFont(Turbine.UI.Lotro.Font.Verdana18);
	self.opacityLabel:SetText("Opacity");		
	

	self.opacityScrollbar = Turbine.UI.Lotro.ScrollBar();
	self.opacityScrollbar:SetOrientation( Turbine.UI.Orientation.Horizontal );
	self.opacityScrollbar:SetParent( self );
	self.opacityScrollbar:SetSize( 300, 10 );
	self.opacityScrollbar:SetPosition(50,100);
	
	self.opacityScrollbar.ValueChanged = function( sender, args )
		Olenn.Satchel.SatchelWindow:SetOpacity( ( 55 + ( 200 - self.opacityScrollbar:GetValue() ) ) / 255 );
	end

Last edited by Olenn : 09-27-2010 at 11:21 AM.
Reply With Quote
  #2  
Unread 09-27-2010, 12:31 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
Okay i am working on the Settings Panel for Satchel, and I was on a rollo until I the last time.

I am trying to make the slider change the opacity of the Satchel window. If I replace "Olenn.Satchel.SatchelWindow" with self it will successfully change the opacity of the settings window, but how do I get it to change the opacity of the Satchel window?

Code:
	self:SetText("Satchel Settings");
	self:SetSize(400, 500);
	self:SetPosition( (Turbine.UI.Display.GetWidth() / 2) - 200, (Turbine.UI.Display.GetHeight() / 2 ) - 325 );
	self:SetOpacity(1);
	

	self.opacityLabel = Turbine.UI.Label();
	self.opacityLabel:SetParent( self );
	self.opacityLabel:SetSize(100, 50);
	self.opacityLabel:SetPosition(50 , 75);
	self.opacityLabel:SetFont(Turbine.UI.Lotro.Font.Verdana18);
	self.opacityLabel:SetText("Opacity");		
	

	self.opacityScrollbar = Turbine.UI.Lotro.ScrollBar();
	self.opacityScrollbar:SetOrientation( Turbine.UI.Orientation.Horizontal );
	self.opacityScrollbar:SetParent( self );
	self.opacityScrollbar:SetSize( 300, 10 );
	self.opacityScrollbar:SetPosition(50,100);
	
	self.opacityScrollbar.ValueChanged = function( sender, args )
		Olenn.Satchel.SatchelWindow:SetOpacity( ( 55 + ( 200 - self.opacityScrollbar:GetValue() ) ) / 255 );
	end
It loosely follows a hierarchy. Normally I would start off with a "main" class that would contain all the individual elements (windows, panels etc). Then you can actually do something like this in your main class;

self.setupWindow.opacityScrollBar.ValueChanged=fun ction(sender,args)
self.SatchelWindow:SetOpacity(<val>);
end

that way you can make a "master" area where you can handle actions between different elements
__________________

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
  #3  
Unread 09-27-2010, 06:34 AM
SanDBoX's Avatar
SanDBoX SanDBoX is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Location: Idaho
Posts: 40
What I ended up doing to solve this problem (or one similar) is in my "main" file declared my windows as having a global scope then was able to access them using that instance name directly. I only had to pull it off once or twice to get things to work, but it seemed to work just fine.

Basically like this:

In your main program file ( the one that the .plugin calls ) you initialize you window -
ajustedwindow = mywindowlayout()

Then any other windows can call it from-
ajustedwindow:SetOpacity( mycalculatedvalue )

It seemed to work just fine for me.
Reply With Quote
  #4  
Unread 09-27-2010, 11:36 AM
Olenn's Avatar
Olenn Olenn is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 47
So I went to bed last night and slept on it. I woke up this morning and looked at all of your sdvice and stared at my code for a little bit...then I realized I was trying to calling SatchelWindow instead of satchelWindow ... stupid capital letters ... that capital S owes me three hours of life, lol.

Anyway, thanks for all of the help everyone!

New issue, the opacity slider is working great, but the value I am using for the opacity doesn't capture the full range.

Code:
self.opacityScrollbar.ValueChanged = function( sender, args )
		satchelWindow:SetOpacity( ( 55 + ( 200 - self.opacityScrollbar:GetValue() ) ) / 255 );
	end
the value was pulled form Turb's examples, but I am trying to go from fully opaque to full invisible.

Any thoughts?
Reply With Quote
  #5  
Unread 09-27-2010, 03:06 PM
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
So I went to bed last night and slept on it. I woke up this morning and looked at all of your sdvice and stared at my code for a little bit...then I realized I was trying to calling SatchelWindow instead of satchelWindow ... stupid capital letters ... that capital S owes me three hours of life, lol.

Anyway, thanks for all of the help everyone!

New issue, the opacity slider is working great, but the value I am using for the opacity doesn't capture the full range.

Code:
self.opacityScrollbar.ValueChanged = function( sender, args )
		satchelWindow:SetOpacity( ( 55 + ( 200 - self.opacityScrollbar:GetValue() ) ) / 255 );
	end
the value was pulled form Turb's examples, but I am trying to go from fully opaque to full invisible.

Any thoughts?
I'm unfamiliar with the variety of slider you're using - so I have no idea what the value range is.

Please don't take this as any kind of self promotion, but I would suggest using the slider class in Palantir's DUInterface folder (feel free just to copy and paste the class somewhere - as well as the images) You can set the minimum and maximum values, as well as the step, making it as easy as just tying the slider value directly to the opacity of the window (and vice versa).

Otherwise, like I sad - in order to give you any help on that formula, I'd have to know what the range you're working with is.
__________________

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
  #6  
Unread 09-27-2010, 07:11 PM
Olenn's Avatar
Olenn Olenn is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 47
Yeah, that was my problem...the slider I am using is part of Turb's package. It seems to work well enough, but the reference on the wiki doesn't say what the range is. The forumla I grabbed is from the original TheOneBag code. Looking at the math it seems that the value should be 1 -100, but it doesn't seem to trasition properly when I use it. When I modify the opacity manually in TheOneBag the scale is from 0.0 to 1.0.

I will try to impliment your code tomorrow (I am at work now). Thanks for everything.
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
Transparent Windows Pobear Interface Help (D) 1 08-06-2010 04:57 AM
windows 7 installation Hotcoffee Interface Help (L) 3 04-07-2010 02:30 PM
Editing Windows IrishNite General Authoring Discussion (L) 0 12-29-2007 08:22 AM
Transparency on windows please oldmanwhoplays Interface Requests (L) 4 06-28-2007 06:20 AM
Chat Windows Jenna Interface Requests (L) 3 05-04-2007 06:42 PM


All times are GMT -5. The time now is 06:38 AM.


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