1 |
108 |
MrJackdaw-1942 |
import "Turbine" |
2 |
|
MrJackdaw-1942 |
import "Turbine.UI" |
3 |
|
MrJackdaw-1942 |
import "Turbine.UI.Lotro" |
4 |
|
MrJackdaw-1942 |
import "Turbine.Gameplay" |
5 |
|
MrJackdaw-1942 |
import "Deusdictum.UI.Dragbar" |
6 |
113 |
MrJackdaw-1942 |
import "JackdawPlugins.SortPack.Functions" |
7 |
|
MrJackdaw-1942 |
import "JackdawPlugins.SortPack.Slash" |
8 |
90 |
MrJackdaw-1942 |
|
9 |
111 |
MrJackdaw-1942 |
player = Turbine.Gameplay.LocalPlayer.GetInstance() |
10 |
|
MrJackdaw-1942 |
backpack = player:GetBackpack() |
11 |
|
MrJackdaw-1942 |
size =backpack:GetSize() |
12 |
|
MrJackdaw-1942 |
|
13 |
78 |
MrJackdaw-1942 |
if not pcall(function() import "JackdawPlugins.Patch.Patch" end) then |
14 |
|
MrJackdaw-1942 |
--Turbine.Shell.WriteLine("Patch not present - default Load and Save used") |
15 |
|
MrJackdaw-1942 |
JackdawPlugins.Patch={} |
16 |
86 |
MrJackdaw-1942 |
function JackdawPlugins.Patch.Load(a,b,c) return Turbine.PluginData.Load(a,b,c) end |
17 |
78 |
MrJackdaw-1942 |
function JackdawPlugins.Patch.Save(a,b,c,d) Turbine.PluginData.Save(a,b,c,d) end |
18 |
|
MrJackdaw-1942 |
end |
19 |
70 |
MrJackdaw-1942 |
|
20 |
111 |
MrJackdaw-1942 |
local Player = player:GetName() |
21 |
104 |
MrJackdaw-1942 |
local savedata=JackdawPlugins.Patch.Load( Turbine.DataScope.Server, "SortPackData" ) |
22 |
|
MrJackdaw-1942 |
if savedata~=nil then |
23 |
138 |
MrJackdaw-1942 |
ItemCategory=savedata.ItemCategory |
24 |
|
MrJackdaw-1942 |
CustomItem=savedata.CustomItem |
25 |
104 |
MrJackdaw-1942 |
Groups=savedata.Groups |
26 |
|
MrJackdaw-1942 |
if Groups==nil then Turbine.Shell.WriteLine("I am sorry, this new version of Sortpack uses groups and your old data has been lost. Please right click the SortPack icon to restore your order and see the new feature that makes this easier.") end |
27 |
114 |
MrJackdaw-1942 |
if savedata[Player]~=nil then |
28 |
145 |
MrJackdaw-1942 |
SortButtonData=savedata[Player].SortButtonData |
29 |
114 |
MrJackdaw-1942 |
SB=savedata[Player].SB |
30 |
131 |
MrJackdaw-1942 |
Counter=savedata[Player].Counter |
31 |
114 |
MrJackdaw-1942 |
end |
32 |
104 |
MrJackdaw-1942 |
else |
33 |
|
MrJackdaw-1942 |
savedata={} |
34 |
|
MrJackdaw-1942 |
end |
35 |
110 |
MrJackdaw-1942 |
|
36 |
113 |
MrJackdaw-1942 |
import"JackdawPlugins.SortPack.List" |
37 |
145 |
MrJackdaw-1942 |
import"JackdawPlugins.SortPack.Button" |
38 |
104 |
MrJackdaw-1942 |
|
39 |
90 |
MrJackdaw-1942 |
Plugins["SortPack"].Unload = function( sender, args ) |
40 |
132 |
MrJackdaw-1942 |
|
41 |
147 |
MrJackdaw-1942 |
Turbine.Shell.WriteLine("<rgb=#888888>Saved Sort Pack Data") |
42 |
146 |
MrJackdaw-1942 |
SortButtonData.X,SortButtonData.Y=SortButton:GetPosition() |
43 |
69 |
MrJackdaw-1942 |
local Player = Turbine.Gameplay.LocalPlayer.GetInstance():GetName() |
44 |
146 |
MrJackdaw-1942 |
|
45 |
100 |
MrJackdaw-1942 |
savedata.list=nil |
46 |
|
MrJackdaw-1942 |
savedata.Groups=Groups |
47 |
138 |
MrJackdaw-1942 |
savedata.CustomItem=CustomItem |
48 |
|
MrJackdaw-1942 |
savedata.ItemCategory=ItemCategory |
49 |
76 |
MrJackdaw-1942 |
savedata[Player]={} |
50 |
145 |
MrJackdaw-1942 |
savedata[Player].SortButtonData=SortButtonData |
51 |
104 |
MrJackdaw-1942 |
savedata[Player].SB=SB |
52 |
131 |
MrJackdaw-1942 |
savedata[Player].Counter=Counter |
53 |
78 |
MrJackdaw-1942 |
JackdawPlugins.Patch.Save( Turbine.DataScope.Server, "SortPackData", savedata ) |
54 |
120 |
MrJackdaw-1942 |
end |
55 |
|
MrJackdaw-1942 |
|
56 |
|
MrJackdaw-1942 |
--If the SortBag is to override the main data then better load it! |
57 |
|
MrJackdaw-1942 |
if SB~=nil then |
58 |
|
MrJackdaw-1942 |
if SB.override then |
59 |
|
MrJackdaw-1942 |
import "JackdawPlugins.SortPack.bag" |
60 |
|
MrJackdaw-1942 |
end |
61 |
131 |
MrJackdaw-1942 |
end |
62 |
|
MrJackdaw-1942 |
|
63 |
|
MrJackdaw-1942 |
--Load the onscreen bag counter |
64 |
|
MrJackdaw-1942 |
if Counter~=nil then |
65 |
|
MrJackdaw-1942 |
if Counter.Show then |
66 |
|
MrJackdaw-1942 |
import "JackdawPlugins.SortPack.Counter" |
67 |
|
MrJackdaw-1942 |
end |
68 |
68 |
MrJackdaw-1942 |
end |