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
205 lines (202 loc) · 7.42 KB
/
Copy pathSettings.lua
File metadata and controls
205 lines (202 loc) · 7.42 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
if NBUI == nil then NBUI = {} end
function CreateNBUISettings()
local LAM2 = LibStub("LibAddonMenu-2.0")
local panelData = {
type = "panel",
name = "Notebook 2018",
displayName = ZO_HIGHLIGHT_TEXT:Colorize(GetString(SI_NBUI_ADDONOPTIONS_NAME)),
author = GetString(SI_NBUI_AUTHOR),
version = GetString(SI_NBUI_VERSION_NUM),
registerForRefresh = true,
registerForDefaults = true,
-- website = "http://www.esoui.com/downloads/info1105-Notebook.html",
-- chat command to open settings window
slashCommand = "/nbs",
-- resets NBUI position, when reset to defaults is pressed
resetFunc = function()
NBUI.NB1MainWindow:ClearAnchors()
NBUI.NB1MainWindow:SetAnchor (CENTER, GuiRoot, CENTER, 0, -48)
_,a,_,b,x,y = NBUI.NB1MainWindow:GetAnchor()
NBUI.db.NB1_Anchor = {["a"]=a, ["b"]=b, ["x"]=x, ["y"]=y}
end
}
LAM2:RegisterAddonPanel("NBUIOptions", panelData)
local optionsData = {
[1]={ -- general category
type = "header",
name = ZO_HIGHLIGHT_TEXT:Colorize(GetString(SI_NBUI_HEADER_GENERAL)),
},
[2]={ -- show title
type = "checkbox",
name = GetString(SI_NBUI_SHOWTITLE_LABEL),
tooltip = GetString(SI_NBUI_SHOWTITLE_TOOLTIP),
getFunc = function() return NBUI.db.NB1_ShowTitle end,
setFunc = function(value)
NBUI.db.NB1_ShowTitle = value
NBUI.NB1LeftPage_Title:SetHidden(not NBUI.db.NB1_ShowTitle)
NBUI.NB1LeftPage_Separator:SetHidden(not NBUI.db.NB1_ShowTitle)
NBUI.NB1Information_Button:SetHidden(not NBUI.db.NB1_ShowTitle)
if (NBUI.db.NB1_ShowTitle) then
NBUI.NB1LeftPage_Backdrop:SetDimensions(420, 645)
else
NBUI.NB1LeftPage_Backdrop:SetDimensions(420, 690)
end
end,
default = NBUI.defaults.NB1_ShowTitle,
},
[3]={ -- title label
type = "editbox",
name = GetString(SI_NBUI_TITLE_LABEL),
tooltip = GetString(SI_NBUI_TITLE_TOOLTIP),
getFunc = function() return NBUI.db.NB1_Title end,
setFunc = function(value)
NBUI.db.NB1_Title = value
NBUI.NB1LeftPage_Title:SetText(NBUI.db.NB1_Title)
end,
default = NBUI.defaults.NB1_Title,
},
[4]={ -- change book color
type = "colorpicker",
name = GetString(SI_NBUI_COLOR_LABEL),
tooltip = GetString(SI_NBUI_COLOR_TOOLTIP),
getFunc = function() return unpack(NBUI.db.NB1_BookColor) end,
setFunc = function(r, g, b, a)
NBUI.db.NB1_BookColor = {r, g, b, a}
NBUI.NB1MainWindow_Cover:SetColor(r, g, b, a)
NBUI.NB1MaxChatWin_ButtonTexture:SetColor(r, g, b, a)
NBUI.NB1MinChatWin_ButtonTexture:SetColor(r, g, b, a)
end,
default = { r = NBUI.defaults.NB1_BookColor[1], g = NBUI.defaults.NB1_BookColor[2], b = NBUI.defaults.NB1_BookColor[3], a = NBUI.defaults.NB1_BookColor[4]},
},
[5] = { -- display dialog
type = "checkbox",
name = GetString(SI_NBUI_DIALOG),
tooltip = GetString(SI_NBUI_DIALOG_TOOLTIP),
getFunc = function() return NBUI.db.NB1_ShowDialog end,
setFunc = function(value)
NBUI.db.NB1_ShowDialog = value
-- NBUI.NB1SavePage_Button:SetHandler("OnClicked", function(self)
-- if (NBUI.db.NB1_ShowDialog) then
-- ZO_Dialogs_ShowDialog("CONFIRM_NBUI_SAVE")
-- else
-- NBUI.NB1SavePage(self)
-- end
-- end)
-- NBUI.NB1UndoPage_Button:SetHandler("OnClicked", function()
-- if (NBUI.db.NB1_ShowDialog) then
-- ZO_Dialogs_ShowDialog("CONFIRM_NBUI_UNDO")
-- else
-- NBUI.NB1UndoPage()
-- end
-- end)
-- NBUI.NB1DeletePage_Button:SetHandler("OnClicked", function()
-- if (NBUI.db.NB1_ShowDialog) then
-- ZO_Dialogs_ShowDialog("CONFIRM_NBUI_DELETE")
-- else
-- NBUI.NB1DeletePage()
-- end
-- end)
-- NBUI.NB1NewPage_Button:SetHandler("OnClicked", function(self)
-- if (NBUI.db.NB1_ShowDialog) then
-- ZO_Dialogs_ShowDialog("CONFIRM_NBUI_NEWPAGE")
-- else
-- NBUI.NB1NewPage(self)
-- end
-- end)
end,
default = NBUI.defaults.NB1_ShowDialog,
},
[6]={ -- lock position
type = "checkbox",
name = GetString(SI_NBUI_LOCK_LABEL),
tooltip = GetString(SI_NBUI_LOCK_TOOLTIP),
getFunc = function() return NBUI.db.NB1_Locked end,
setFunc = function(value)
NBUI.db.NB1_Locked = value
NBUI.NB1MainWindow:SetMovable(not NBUI.db.NB1_Locked)
end,
default = NBUI.defaults.NB1_Locked,
},
[7]={ -- toggle chat button
type = "checkbox",
name = GetString(SI_NBUI_BUTTON_LABEL),
tooltip = GetString(SI_NBUI_BUTTON_TOOLTIP),
getFunc = function() return NBUI.db.NB1_ChatButton end,
setFunc = function(value)
NBUI.db.NB1_ChatButton = value
NBUI.NB1MaxChatWin_Button:SetHidden(not NBUI.db.NB1_ChatButton)
NBUI.NB1MaxChatWin_ButtonTexture:SetHidden(not NBUI.db.NB1_ChatButton)
NBUI.NB1MinChatWin_Button:SetHidden(not NBUI.db.NB1_ChatButton)
NBUI.NB1MinChatWin_ButtonTexture:SetHidden(not NBUI.db.NB1_ChatButton)
end,
default = NBUI.defaults.NB1_ChatButton,
},
[8]={ -- offset man chat button
type = "slider",
name = GetString(SI_NBUI_OFFSETMAX_LABEL),
tooltip = GetString(SI_NBUI_OFFSETMAX_TOOLTIP),
min = -300,
max = -40,
step = 1,
getFunc = function() return NBUI.db.NB1_MaxOffsetChatButton end,
setFunc = function(offset)
if (NBUI.db.NB1_ChatButton) then
NBUI.db.NB1_MaxOffsetChatButton = offset
NBUI.NB1MaxChatWin_Button:SetAnchor(TOPRIGHT, ZO_ChatWindow, TOPRIGHT, NBUI.db.NB1_MaxOffsetChatButton, 7)
end
end,
disabled = function()
return not NBUI.db.NB1_ChatButton
end,
default = NBUI.defaults.NB1_MaxOffsetChatButton,
},
[9]={ -- offset min chat button
type = "slider",
name = GetString(SI_NBUI_OFFSETMIN_LABEL),
tooltip = GetString(SI_NBUI_OFFSETMIN_TOOLTIP),
min = -400,
max = 0,
step = 1,
getFunc = function() return NBUI.db.NB1_MinOffsetChatButton end,
setFunc = function(offset)
if (NBUI.db.NB1_ChatButton) then
NBUI.db.NB1_MinOffsetChatButton = offset
NBUI.NB1MinChatWin_Button:SetAnchor(BOTTOMLEFT, ZO_ChatWindowMinBar, BOTTOMLEFT, -3, NBUI.db.NB1_MinOffsetChatButton)
end
end,
disabled = function()
return not NBUI.db.NB1_ChatButton
end,
default = NBUI.defaults.NB1_MinOffsetChatButton,
},
[10]={ -- Switch to Edit Mode on mouse hover over page.
type = "checkbox",
name = "EditModeHover",
tooltip = "Switch to page Edit Mode when mouse hovers over the page.",
getFunc = function() return NBUI.db.NB1_EditModeHover end,
setFunc = function(v) NBUI.db.NB1_EditModeHover = v end,
},
[11]={ -- Switch to Edit Mode on mouse click on page.
type = "checkbox",
name = "EditModeClick",
tooltip = "Switch to page Edit Mode when clicking the page.",
getFunc = function() return NBUI.db.NB1_EditModeClick end,
setFunc = function(v) NBUI.db.NB1_EditModeClick = v end,
},
[12]={ -- Leave Edit Mode on page lose focus.
type = "checkbox",
name = "LeaveEditModeFocus",
tooltip = "Leave Edit Mode when the page loses focus (clicking outside of it.)",
getFunc = function() return NBUI.db.NB1_LeaveEditModeOnFocus end,
setFunc = function(v) NBUI.db.NB1_LeaveEditModeOnFocus = v end,
},
[13]={ -- Leave Edit Mode on mouse exit page.
type = "checkbox",
name = "LeaveEditModeExit",
tooltip = "Leave Edit Mode when mouse exits (moves out of) the page.",
getFunc = function() return NBUI.db.NB1_LeaveEditModeOnExit end,
setFunc = function(v) NBUI.db.NB1_LeaveEditModeOnExit = v end,
},
}
LAM2:RegisterOptionControls("NBUIOptions", optionsData)
end