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 |
137 |
MrJackdaw-1942 |
Category=item:GetCat() |
79 |
103 |
MrJackdaw-1942 |
Quality=item:GetQuality() |
80 |
137 |
MrJackdaw-1942 |
CategoryText=ItemCategory[item:GetCat()] |
81 |
103 |
MrJackdaw-1942 |
Name=item:GetName() |
82 |
138 |
MrJackdaw-1942 |
--Name=string.gsub(Name,"[^%a]","") |
83 |
128 |
MrJackdaw-1942 |
W=weight(i) |
84 |
103 |
MrJackdaw-1942 |
else |
85 |
|
MrJackdaw-1942 |
Category=nil |
86 |
|
MrJackdaw-1942 |
Quality=nil |
87 |
|
MrJackdaw-1942 |
CategoryText=nil |
88 |
|
MrJackdaw-1942 |
Name=nil |
89 |
128 |
MrJackdaw-1942 |
W=weight(i) |
90 |
103 |
MrJackdaw-1942 |
end |
91 |
102 |
MrJackdaw-1942 |
|
92 |
136 |
MrJackdaw-1942 |
backpackdata[i]={ |
93 |
|
MrJackdaw-1942 |
{ |
94 |
|
MrJackdaw-1942 |
["Name"] = Name, |
95 |
|
MrJackdaw-1942 |
["Category"] = Category, |
96 |
|
MrJackdaw-1942 |
["Quality"] = Quality, |
97 |
|
MrJackdaw-1942 |
["CategoryText"] = CategoryText, |
98 |
|
MrJackdaw-1942 |
["W"] = W |
99 |
|
MrJackdaw-1942 |
}} |
100 |
|
MrJackdaw-1942 |
|
101 |
102 |
MrJackdaw-1942 |
label(w1,i) |
102 |
|
MrJackdaw-1942 |
label(w2,Name) |
103 |
|
MrJackdaw-1942 |
label(w3,Category) |
104 |
|
MrJackdaw-1942 |
label(w4,CategoryText) |
105 |
|
MrJackdaw-1942 |
label(w5,Quality) |
106 |
128 |
MrJackdaw-1942 |
label(w6,W) |
107 |
102 |
MrJackdaw-1942 |
end |
108 |
|
MrJackdaw-1942 |
|
109 |
136 |
MrJackdaw-1942 |
JackdawPlugins.Patch.Save( Turbine.DataScope.Server, "SortpackDebugBackpackContents", backpackdata ) |
110 |
102 |
MrJackdaw-1942 |
end |
111 |
|
MrJackdaw-1942 |
|