lotrointerface.com
Search Downloads

LoTROInterface SVN SortPack

[/] [trunk/] [JackdawPlugins/] [SortPack/] [Debug.lua] - Blame information for rev 156

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 102 MrJackdaw-1942
DW={}
2 MrJackdaw-1942
 
3 MrJackdaw-1942
Width=500
4 MrJackdaw-1942
Height=500
5 128 MrJackdaw-1942
Col=6
6 102 MrJackdaw-1942
 
7 MrJackdaw-1942
        --Make the window
8 MrJackdaw-1942
        DW.Window = Turbine.UI.Lotro.Window()
9 MrJackdaw-1942
        DW.Window:SetPosition( 100,0 )
10 MrJackdaw-1942
        DW.Window:SetSize(Width,Height)
11 MrJackdaw-1942
        DW.Window:SetVisible(false)
12 MrJackdaw-1942
 
13 MrJackdaw-1942
        DW.Window:SetText( "Debug Window")
14 MrJackdaw-1942
        DW.Window:SetZOrder(1000)
15 MrJackdaw-1942
 
16 MrJackdaw-1942
        DW.Frame={}
17 MrJackdaw-1942
 
18 MrJackdaw-1942
                DW.Frame=Frame()
19 MrJackdaw-1942
                DW.Frame:SetParent(DW.Window)
20 MrJackdaw-1942
                DW.Frame:SetSize(Width-10,Height-60)
21 MrJackdaw-1942
                DW.Frame:SetTop(40)
22 MrJackdaw-1942
 
23 MrJackdaw-1942
                DW.Frame.ScrollBar=Turbine.UI.Lotro.ScrollBar()
24 MrJackdaw-1942
                DW.Frame.ScrollBar:SetOrientation( Turbine.UI.Orientation.Vertical )
25 MrJackdaw-1942
 
26 MrJackdaw-1942
                DW.Frame.ListBox = Turbine.UI.ListBox()
27 MrJackdaw-1942
                DW.Frame.ListBox:SetParent( DW.Frame )
28 MrJackdaw-1942
                DW.Frame.ListBox:SetPosition( 10, 2 )
29 MrJackdaw-1942
                DW.Frame.ListBox:SetSize( Width-20, Height-64)
30 MrJackdaw-1942
                DW.Frame.ListBox:SetMaxItemsPerLine(Col)
31 MrJackdaw-1942
                DW.Frame.ListBox:SetOrientation( Turbine.UI.Orientation.Horizontal )
32 MrJackdaw-1942
                DW.Frame.ListBox:SetVerticalScrollBar( DW.Frame.ScrollBar )
33 MrJackdaw-1942
                DW.Frame.ScrollBar:SetParent(DW.Frame)
34 MrJackdaw-1942
                DW.Frame.ScrollBar:SetPosition(0,2)
35 MrJackdaw-1942
                DW.Frame.ScrollBar:SetHeight(Height-64)
36 MrJackdaw-1942
                DW.Frame.ScrollBar:SetWidth(10)
37 MrJackdaw-1942
 
38 MrJackdaw-1942
 
39 MrJackdaw-1942
function Debug()
40 MrJackdaw-1942
 
41 MrJackdaw-1942
local w1=20
42 107 MrJackdaw-1942
local w2=230
43 102 MrJackdaw-1942
local w3=30
44 MrJackdaw-1942
local w4=100
45 MrJackdaw-1942
local w5=30
46 128 MrJackdaw-1942
local w6=100
47 136 MrJackdaw-1942
local backpackdata={}
48 102 MrJackdaw-1942
 
49 MrJackdaw-1942
local function label(w,s)
50 103 MrJackdaw-1942
        if s==nil then s="-" end
51 102 MrJackdaw-1942
        Geoff=Turbine.UI.Label()
52 MrJackdaw-1942
        Geoff:SetFont(Font)
53 MrJackdaw-1942
        Geoff:SetText(s)
54 128 MrJackdaw-1942
        Geoff:SetMultiline(false)
55 102 MrJackdaw-1942
        Geoff:SetMouseVisible(false)
56 MrJackdaw-1942
        Geoff:SetSize(w,16)
57 MrJackdaw-1942
        DW.Frame.ListBox:AddItem(Geoff)
58 MrJackdaw-1942
end
59 MrJackdaw-1942
 
60 MrJackdaw-1942
                DW.Window:SetVisible(true)
61 MrJackdaw-1942
 
62 MrJackdaw-1942
                DW.Frame.ListBox:ClearItems()
63 MrJackdaw-1942
                        label(w1,"id")
64 MrJackdaw-1942
                        label(w2,"Name")
65 MrJackdaw-1942
                        label(w3,"Cat")
66 MrJackdaw-1942
                        label(w4,"CategoryText")
67 MrJackdaw-1942
                        label(w5,"Quality")
68 128 MrJackdaw-1942
                        label(w6,"Weight")
69 102 MrJackdaw-1942
 
70 103 MrJackdaw-1942
                local Category
71 MrJackdaw-1942
                local Quality
72 MrJackdaw-1942
                local CategoryText
73 MrJackdaw-1942
                local Name
74 MrJackdaw-1942
 
75 102 MrJackdaw-1942
        for i=1,backpack:GetSize() do
76 MrJackdaw-1942
                        local item = backpack:GetItem(i)
77 103 MrJackdaw-1942
                        if item~=nil then
78 156 MrJackdaw-1942
                                local itemInfo=item:GetItemInfo();
79 MrJackdaw-1942
                                Category=GetCat(item)
80 MrJackdaw-1942
                                Quality=itemInfo:GetQuality()
81 MrJackdaw-1942
                                CategoryText=ItemCategory[GetCat(item)]
82 MrJackdaw-1942
                                Name=itemInfo:GetName()
83 138 MrJackdaw-1942
                                --Name=string.gsub(Name,"[^%a]","")
84 128 MrJackdaw-1942
                                W=weight(i)
85 103 MrJackdaw-1942
                        else
86 MrJackdaw-1942
                                Category=nil
87 MrJackdaw-1942
                                Quality=nil
88 MrJackdaw-1942
                                CategoryText=nil
89 MrJackdaw-1942
                                Name=nil
90 128 MrJackdaw-1942
                                W=weight(i)
91 103 MrJackdaw-1942
                        end
92 102 MrJackdaw-1942
 
93 136 MrJackdaw-1942
                        backpackdata[i]={
94 MrJackdaw-1942
                                {
95 MrJackdaw-1942
                                                ["Name"] = Name,
96 MrJackdaw-1942
                                                ["Category"] = Category,
97 MrJackdaw-1942
                                                ["Quality"] = Quality,
98 MrJackdaw-1942
                                                ["CategoryText"] = CategoryText,
99 MrJackdaw-1942
                                                ["W"] = W
100 MrJackdaw-1942
                                        }}
101 MrJackdaw-1942
 
102 102 MrJackdaw-1942
                        label(w1,i)
103 MrJackdaw-1942
                        label(w2,Name)
104 MrJackdaw-1942
                        label(w3,Category)
105 MrJackdaw-1942
                        label(w4,CategoryText)
106 MrJackdaw-1942
                        label(w5,Quality)
107 128 MrJackdaw-1942
                        label(w6,W)
108 102 MrJackdaw-1942
                end
109 MrJackdaw-1942
 
110 136 MrJackdaw-1942
        JackdawPlugins.Patch.Save( Turbine.DataScope.Server, "SortpackDebugBackpackContents", backpackdata )
111 102 MrJackdaw-1942
end
112 MrJackdaw-1942
 

All times are GMT -5. The time now is 06:40 PM.


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