+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Poster of Note Online status: Garan is offline Reputation: Garan has disabled reputation
    Join Date
    Mar 2007
    Posts
    828

    ItemControl renders Vault items differently than Backpack items

    I thought I was crazier than usual when I was trying to fix a control alignment problem in AltInventory when I realized it wasn't me this time (or at least not all me). It turns out, the ItemControl is rendering Backpack items with a three pixel border but if the same exact item is moved to the vault and then set to the ItemControl, it is rendered without the border, causing the item contol to look misaligned.

    In the image below, both items are stacks of Exceptional Leather. The one on the left is in the backpack, the one on the right was in the Vault.

    The code for this example is:
    Code:
    import "Turbine";
    import "Turbine.UI";
    import "Turbine.UI.Lotro";
    
    localplayer=Turbine.Gameplay.LocalPlayer.GetInstance();
    backpack=localplayer:GetBackpack();
    item1=backpack:GetItem(1);
    vault=localplayer:GetVault();
    if vault:IsAvailable() then
        item2=vault:GetItem(1);
    end
    testwindow=Turbine.UI.Lotro.Window();
    testwindow:SetSize(240,140);
    testwindow:SetText("Item Test");
    label1=Turbine.UI.Label();
    label1:SetSize(100,20);
    label1:SetPosition(10,45);
    label1:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleRight);
    label1:SetText("Backpack");
    label1:SetParent(testwindow)
    label2=Turbine.UI.Label();
    label2:SetSize(90,20);
    label2:SetPosition(120,45);
    label2:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft);
    label2:SetText("Vault");
    label2:SetParent(testwindow)
    backdrop1=Turbine.UI.Control()
    backdrop1:SetParent(testwindow)
    backdrop1:SetSize(35,35)
    backdrop1:SetPosition(80,65)
    backdrop1:SetBackColor(Turbine.UI.Color(.2,.2,.2))
    testitem1=Turbine.UI.Lotro.ItemControl();
    testitem1:SetParent(testwindow);
    testitem1:SetPosition(80,65);
    testitem1:SetItem(item1);
    backdrop2=Turbine.UI.Control()
    backdrop2:SetParent(testwindow)
    backdrop2:SetSize(35,35)
    backdrop2:SetPosition(120,65)
    backdrop2:SetBackColor(Turbine.UI.Color(.2,.2,.2))
    testitem2=Turbine.UI.Lotro.ItemControl();
    testitem2:SetParent(testwindow);
    testitem2:SetPosition(120,65);
    testitem2:SetItem(item2);
    testwindow:SetVisible(true);
    This example assumes you have an item in the first slot of your backpack and an item in your vault.

    EDIT: As expected, Shared Storage items work exactly like Vault items, that is, they render without a border
    Last edited by Garan; Jun 03 2012 at 10:16 PM.
    Gnashtooth - Rank 10 Warg - My breath's worse than my bite - but what d'ya want? I eat Hobbitsess fer cryin' out loud
    Garan - Captain of little note - got parked at a Fell Scrying Pool so long it dried up and blew away
    and many, many others...
    "No, no, the hamsters are for the forums. The servers run on chinchillas!"-Patience 7/20/2007

  2. #2
    Poster of Note Online status: Garan is offline Reputation: Garan has disabled reputation
    Join Date
    Mar 2007
    Posts
    828
    Still buggy as of Jan 29 2013
    Gnashtooth - Rank 10 Warg - My breath's worse than my bite - but what d'ya want? I eat Hobbitsess fer cryin' out loud
    Garan - Captain of little note - got parked at a Fell Scrying Pool so long it dried up and blew away
    and many, many others...
    "No, no, the hamsters are for the forums. The servers run on chinchillas!"-Patience 7/20/2007

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts