-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathGridProfileAPI.lua
More file actions
49 lines (40 loc) · 1.13 KB
/
Copy pathGridProfileAPI.lua
File metadata and controls
49 lines (40 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Grid2ProfileAPI = {}
function Grid2ProfileAPI:ExportProfile(profileKey)
return Grid2.ExportProfileByKey(profileKey, true)
end
function Grid2ProfileAPI:ImportProfile(profileString, profileKey)
return Grid2.ImportProfileIntoKey(profileKey, profileString, true, true)
end
function Grid2ProfileAPI:DecodeProfileString(profileString)
local success, profileData = Grid2.UnserializeProfile(profileString, true)
if not success then
return nil
end
return profileData
end
function Grid2ProfileAPI:SetProfile(profileKey)
Grid2.db:SetProfile(profileKey)
end
function Grid2ProfileAPI:GetProfileKeys()
local profileKeys = {}
if Grid2DB and Grid2DB.profiles then
for profileKey in pairs(Grid2DB.profiles) do
profileKeys[profileKey] = true
end
end
return profileKeys
end
function Grid2ProfileAPI:GetCurrentProfileKey()
return Grid2.db:GetCurrentProfile()
end
function Grid2ProfileAPI:GetProfileAssignments()
return Grid2DB and Grid2DB.profileKeys or nil
end
function Grid2ProfileAPI:OpenConfig()
Grid2:OpenGrid2Options()
end
function Grid2ProfileAPI:CloseConfig()
if Grid2Options.optionsFrame then
Grid2Options.optionsFrame:Hide()
end
end