LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   ItemControl:SetOpacity bugged? (https://www.lotrointerface.com/forums/showthread.php?t=1040)

Dworgdir 09-14-2010 09:55 PM

ItemControl:SetOpacity bugged?
 
First of all, sorry for my poor english...

Well... im working on a addon that when something happens i got to fade a ItemControl component... but looks like it doesnt work at all.


When i try to execute:

local backpack = Turbine.Gameplay.LocalPlayer():GetBackpack();
local myItem = Turbine.UI.Lotro.ItemControl(backpack:GetItem(1));
myItem:SetOpacity(0);

And i add myItem to the screen.. the opacity is always 1. If i do myItem:SetVisible(false) it doesnt appear... so looks like the opacity is bugged...

Any info on this situation?

ForsakenArcher 09-15-2010 12:21 AM

You need to parent the item control to a window.

window = Turbine.UI.Lotro.Window();
window:SetPosition( 200, 200 );
window:SetSize( 200, 200 );
window:SetText( "Test Window" );
window:SetVisible( true );

local player = Turbine.Gameplay.LocalPlayer();
local backpack = player:GetBackpack();
local item = backpack:GetItem( 1 );

itemControl = Turbine.UI.Lotro.ItemControl();
itemControl:SetParent( window );
itemControl:SetPosition( 50, 50 );
itemControl:SetItem( item );

Dworgdir 09-15-2010 06:41 AM

Thanks for the answer. I'll try as soon as i can.

Im working on a bag addon, and this is the only thing i didnt manage to do. A important part of the bag is the possibility of searching a item on it. When the searched item is found i trying to set the Opacity of all ItemControls to 0.5 and the search results ones with 1.0 to highlight them.

My ItemControl component is on a ListBox, and this ListBox is on a Window, with their parents set as follow:

ItemControl --> ListBox
ListBox --> Window

When i put the opacity on the window it works... but i need only to set the opacity to the ItemControl and not all the window. Its strange cause i can set all the properties on the ItemControl but the Opacity doesnt work at all. I think the "Item" icon is put on top of ItemControl so im just setting the Opacity on the ItemControl and not on the Item icon itself...

I mean, if i put a background color on ItemControl it just colorizes the back and not the icon (its correct, of course)... im just starting to think this is the case with opacity...

Ill keep your guys updated on any news on this issue;

Thanks!

Dworgdir 09-15-2010 06:45 PM

Well,

The code you provided ForsakenArcher keeps the same situation. The item icon RECEIVE the Opacity value but doesnt SHOW it.

Anyone got any advice on this?

Thanks!

ForsakenArcher 09-16-2010 10:31 PM

2nd note: SetOpacity only works on Top Level elements. This means Window, GoldWindow, and for underlying reasons I cannot get into QuickslotDisplay.

Dworgdir 09-17-2010 08:27 AM

This limitation is intended or its just not implemented on the current version of LOTRO?

I managed to do a workaround because of this limitation, but i'll really love to see the opacity on visible components implemented on future.


I think my addon is almost ready to be uploaded. Its a inventory addon, with counters, search function and the possibility of division. I mean: you can create a new bag for ingots, so when you press your inventory key the ingots you have on the inventory all appear on your ingot bag! You configure anything to be put on the bag, almost like ArkInventory (WoW Addon) but less flexible.

Im playing with it on for 2-3 days, and looks almost stable. Well, ill keep your guys updated. I started with TheOneBag as base, and now i think the code is nearly unrecognizable :p:p:p

I work as a Usability Engineer, so i enjoy a lot playing with ui :D:D

Ah, ForsakenArcher: your guys did a great job implementing Lua on LOTRO. Im eager to see what kinds of plugins the community will create on the near future.


All times are GMT -5. The time now is 05:04 PM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI