forked from phuein/UserScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.lua
More file actions
153 lines (139 loc) · 4.95 KB
/
Copy pathSettings.lua
File metadata and controls
153 lines (139 loc) · 4.95 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
-- Settings menu.
function ShowMount.LoadSettings()
local LAM = LibStub("LibAddonMenu-2.0")
local panelData = {
type = "panel",
name = ShowMount.menuName,
displayName = ShowMount.Colorize(ShowMount.menuName),
author = ShowMount.Colorize(ShowMount.author),
slashCommand = "/sm",
registerForRefresh = true,
-- registerForDefaults = true,
}
LAM:RegisterAddonPanel(ShowMount.menuName, panelData)
local optionsTable = {}
-- Category. --
-- table.insert(optionsTable, {
-- type = "header",
-- name = ZO_HIGHLIGHT_TEXT:Colorize("Options"),
-- width = "full", --or "half" (optional)
-- })
-- table.insert(optionsTable, {
-- type = "description",
-- -- title = "My Title", --(optional)
-- title = nil, --(optional)
-- text = "Set or reset your mount selection.",
-- width = "full", --or "half" (optional)
-- })
-- Mount selection category. --
table.insert(optionsTable, {
type = "header",
name = ZO_HIGHLIGHT_TEXT:Colorize("Mount Selection"),
})
table.insert(optionsTable, {
type = "dropdown",
name = "Set Mount One",
choices = ShowMount.mountsNamesMenu,
getFunc = function()
local i = ShowMount.GetIndex("mountsIds", ShowMount.savedVariables.MountOne)
local name = ShowMount.mountsNames[i]
return name or "-"
end,
setFunc = function(v)
-- Reset.
if v == "-" then ShowMount.ResetMounts("One") return end
-- or Set.
local i = ShowMount.GetIndex("mountsNames", v)
local mount_id = ShowMount.mountsIds[i]
ShowMount.SetMount("One", mount_id)
end,
width = "half",
})
table.insert(optionsTable, {
type = "dropdown",
name = "Set Mount Two",
choices = ShowMount.mountsNamesMenu,
getFunc = function()
local i = ShowMount.GetIndex("mountsIds", ShowMount.savedVariables.MountTwo)
local name = ShowMount.mountsNames[i]
return name or "-"
end,
setFunc = function(v)
-- Reset.
if v == "-" then ShowMount.ResetMounts("Two") return end
-- or Set.
local i = ShowMount.GetIndex("mountsNames", v)
local mount_id = ShowMount.mountsIds[i]
ShowMount.SetMount("Two", mount_id)
end,
width = "half",
})
table.insert(optionsTable, {
type = "dropdown",
name = "Set Mount Three",
choices = ShowMount.mountsNamesMenu,
getFunc = function()
local i = ShowMount.GetIndex("mountsIds", ShowMount.savedVariables.MountThree)
local name = ShowMount.mountsNames[i]
return name or "-"
end,
setFunc = function(v)
-- Reset.
if v == "-" then ShowMount.ResetMounts("Three") return end
-- or Set.
local i = ShowMount.GetIndex("mountsNames", v)
local mount_id = ShowMount.mountsIds[i]
ShowMount.SetMount("Three", mount_id)
end,
width = "half",
})
table.insert(optionsTable, {
type = "dropdown",
name = "Set Mount Four",
choices = ShowMount.mountsNamesMenu,
getFunc = function()
local i = ShowMount.GetIndex("mountsIds", ShowMount.savedVariables.MountFour)
local name = ShowMount.mountsNames[i]
return name or "-"
end,
setFunc = function(v)
-- Reset.
if v == "-" then ShowMount.ResetMounts("Four") return end
-- or Set.
local i = ShowMount.GetIndex("mountsNames", v)
local mount_id = ShowMount.mountsIds[i]
ShowMount.SetMount("Four", mount_id)
end,
width = "half",
})
-- Other options category. --
table.insert(optionsTable, {
type = "header",
name = ZO_HIGHLIGHT_TEXT:Colorize("Options"),
})
table.insert(optionsTable, {
type = "checkbox",
name = "Enable chat commands for mount activation.",
tooltip = "/sm1 /sm2 /sm3 /sm4 /smr",
getFunc = function() return ShowMount.savedVariables.EnableChatCmds end,
setFunc = function(v)
ShowMount.EnableChatCommands(v)
end,
width = "full",
})
table.insert(optionsTable, {
type = "button",
name = "Reset All Mounts",
func = function() ShowMount.ResetMounts() end,
width = "half",
})
-- table.insert(optionsTable, {
-- type = "texture",
-- image = "EsoUI\\Art\\ActionBar\\abilityframe64_up.dds",
-- imageWidth = 64, --max of 250 for half width, 510 for full
-- imageHeight = 64, --max of 100
-- tooltip = "Image's tooltip text.", --(optional)
-- width = "half", --or "half" (optional)
-- })
LAM:RegisterOptionControls(ShowMount.menuName, optionsTable)
end