Skip to content

Commit c18f954

Browse files
committed
rearranged options a bit
1 parent 4525056 commit c18f954

File tree

1 file changed

+65
-31
lines changed

1 file changed

+65
-31
lines changed

UI.lua

Lines changed: 65 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ function MPT:CreateSpace(order)
121121
return t
122122
end
123123

124-
local GeneralOptions = {
124+
125+
local MainOptions = {
125126
type = "group",
126-
name = "General Options",
127-
order = 1,
127+
name = "Non-Display Settings",
128128
args = {
129129
Preview = {
130130
type = "execute",
@@ -152,22 +152,31 @@ local GeneralOptions = {
152152
MPT:ShowPBFrame()
153153
end,
154154
},
155-
FrameStrata = MPT:CreateDropDown(3, {["BACKGROUND"] = "BACKGROUND", ["LOW"] = "LOW", ["MEDIUM"] = "MEDIUM", ["HIGH"] = "HIGH", ["DIALOG"] = "DIALOG", ["FULLSCREEN"] = "FULLSCREEN", ["FULLSCREEN_DIALOG"] = "FULLSCREEN_DIALOG", ["TOOLTIP"] = "TOOLTIP"}, "Frame Strata", "Strata of the entire Display. High is the default because this makes it appear above the options window.", "FrameStrata", true),
156-
Scale = MPT:CreateRange(4, "Group Scale", "Scale of the entire Display", 0.1, 3, 0.01, "Scale", true),
157-
Spacing = MPT:CreateRange(5, "Bar Spacing", "Spacing for each Bar", -5, 10, 1, "Spacing", true),
158155
UpdateRate = MPT:CreateRange(6, "Update Interval", "How often the timer updates", 0.1, 3, 0.1, "UpdateRate"),
159-
HideTracker = MPT:CreateToggle(7, "Hide Objective Tracker", "Hides Blizzard's Objective Tracker during an active M+", "HideTracker"),
160-
CloseBags = MPT:CreateToggle(8, "Close Bags", "Automatically close bags after inserting the Keystone", "CloseBags"),
161-
Keyslot = MPT:CreateToggle(9, "Automatic Keyslot", "Automatically insert Keystone", "KeySlot"),
162156
LowerKey = {
163157
type = "toggle",
164158
order = 9,
165159
name = "Data from Lower Level",
166-
width = "full",
167160
desc = "Get Split Timers from one key level lower if no data for current level exists",
168161
set = function(_, value) MPTSV.LowerKey = value end,
169162
get = function() return MPTSV.LowerKey end,
170163
},
164+
CloseBags = {
165+
type = "toggle",
166+
order = 9,
167+
name = "Close Bags",
168+
desc = "Automatically close bags after inserting the Keystone",
169+
set = function(_, value) MPTSV.CloseBags = value end,
170+
get = function() return MPTSV.CloseBags end,
171+
},
172+
KeySlot = {
173+
type = "toggle",
174+
order = 9,
175+
name = "Automatic Keyslot",
176+
desc = "Automatically insert Keystone when interacting with the Keystone Interface",
177+
set = function(_, value) MPTSV.KeySlot = value end,
178+
get = function() return MPTSV.KeySlot end,
179+
},
171180
Gap = MPT:CreateSpace(10),
172181
ImportFromWA = {
173182
type = "execute",
@@ -178,19 +187,14 @@ local GeneralOptions = {
178187
MPT:ImportWAData()
179188
end,
180189
},
181-
182190
}
183191
}
184192
local Position = {
185193
type = "group",
186194
name = "Frame Position",
187195
order = 2,
188196
args = {
189-
Anchor = MPT:CreateDropDown(1, {["CENTER"] = "CENTER", ["TOP"] = "TOP", ["BOTTOM"] = "BOTTOM", ["LEFT"] = "LEFT", ["RIGHT"] = "RIGHT", ["TOPLEFT"] = "TOPLEFT", ["TOPRIGHT"] = "TOPRIGHT", ["BOTTOMLEFT"] = "BOTTOMLEFT", ["BOTTOMRIGHT"] = "BOTTOMRIGHT"}, "Anchor", "", {"Position", "Anchor"}, true),
190-
relativeTo = MPT:CreateDropDown(2, {["CENTER"] = "CENTER", ["TOP"] = "TOP", ["BOTTOM"] = "BOTTOM", ["LEFT"] = "LEFT", ["RIGHT"] = "RIGHT", ["TOPLEFT"] = "TOPLEFT", ["TOPRIGHT"] = "TOPRIGHT", ["BOTTOMLEFT"] = "BOTTOMLEFT", ["BOTTOMRIGHT"] = "BOTTOMRIGHT"}, "Relative To", "", {"Position", "relativeTo"}, true),
191-
Gap = MPT:CreateSpace(3),
192-
xOffset = MPT:CreateRange(4, "X Offset", "X Offset", -4000, 4000, 1, {"Position", "xOffset"}, true),
193-
yOffset = MPT:CreateRange(5, "Y Offset", "Y Offset", -4000, 4000, 1, {"Position", "yOffset"}, true),
197+
194198
}
195199
}
196200
local Background = {
@@ -209,19 +213,37 @@ local Background = {
209213
}
210214
}
211215

212-
216+
local GeneralOptions = {
217+
type = "group",
218+
name = "General Options",
219+
order = 1,
220+
args = {
221+
FrameStrata = MPT:CreateDropDown(1, {["BACKGROUND"] = "BACKGROUND", ["LOW"] = "LOW", ["MEDIUM"] = "MEDIUM", ["HIGH"] = "HIGH", ["DIALOG"] = "DIALOG", ["FULLSCREEN"] = "FULLSCREEN", ["FULLSCREEN_DIALOG"] = "FULLSCREEN_DIALOG", ["TOOLTIP"] = "TOOLTIP"}, "Frame Strata", "Strata of the entire Display. High is the default because this makes it appear above the options window.", "FrameStrata", true),
222+
Scale = MPT:CreateRange(2, "Group Scale", "Scale of the entire Display", 0.1, 3, 0.01, "Scale", true),
223+
Spacing = MPT:CreateRange(3, "Bar Spacing", "Spacing for each Bar", -5, 10, 1, "Spacing", true),
224+
HideTracker = MPT:CreateToggle(4, "Hide Objective Tracker", "Hides Blizzard's Objective Tracker during an active M+", "HideTracker"),
225+
Gap = MPT:CreateSpace(5),
226+
Desc = {
227+
type = "header",
228+
order = 6,
229+
name = "Main Frame Positioning",
230+
},
231+
Anchor = MPT:CreateDropDown(7, {["CENTER"] = "CENTER", ["TOP"] = "TOP", ["BOTTOM"] = "BOTTOM", ["LEFT"] = "LEFT", ["RIGHT"] = "RIGHT", ["TOPLEFT"] = "TOPLEFT", ["TOPRIGHT"] = "TOPRIGHT", ["BOTTOMLEFT"] = "BOTTOMLEFT", ["BOTTOMRIGHT"] = "BOTTOMRIGHT"}, "Anchor", "", {"Position", "Anchor"}, true),
232+
relativeTo = MPT:CreateDropDown(8, {["CENTER"] = "CENTER", ["TOP"] = "TOP", ["BOTTOM"] = "BOTTOM", ["LEFT"] = "LEFT", ["RIGHT"] = "RIGHT", ["TOPLEFT"] = "TOPLEFT", ["TOPRIGHT"] = "TOPRIGHT", ["BOTTOMLEFT"] = "BOTTOMLEFT", ["BOTTOMRIGHT"] = "BOTTOMRIGHT"}, "Relative To", "", {"Position", "relativeTo"}, true),
233+
Gap = MPT:CreateSpace(9),
234+
xOffset = MPT:CreateRange(10, "X Offset", "X Offset", -4000, 4000, 1, {"Position", "xOffset"}, true),
235+
yOffset = MPT:CreateRange(11, "Y Offset", "Y Offset", -4000, 4000, 1, {"Position", "yOffset"}, true),
236+
}
237+
}
213238
local General = {
214239
type = "group",
215240
name = "General",
216-
handler = MPTUI,
217-
order = 1,
218241
childGroups = "tab",
242+
order = 1,
219243
args = {
220-
GeneralOptions = GeneralOptions,
221-
Position = Position,
222-
Background = Background,
223-
BestTimes = BestTimes,
224-
},
244+
General = GeneralOptions,
245+
Background = Background,
246+
}
225247
}
226248

227249

@@ -441,6 +463,9 @@ local PBInfo = MPT:CreateTextSetting("PB Info", "PBInfo", 6, true)
441463
PBInfo.args.Format = MPT:CreateDropDown(11, {[1] = "DD/MM/YY", [2] = "MM/DD/YY"}, "Date Format", "Format in which the date is displayed", {"PBInfo", "Format"}, true)
442464
PBInfo.args.AnchoredTo = MPT:CreateDropDown(12, {["MainFrame"] = "Main Frame", ["KeyInfo"] = "KeyInfo Bar", ["TimerBar"] = "Timer Bar", ["Bosses"] = "Bosses", ["ForcesBar"] = "Forces Bar"}, "Anchored To", "What the PB Info is anchored to", {"PBInfo", "AnchoredTo"}, true)
443465

466+
467+
468+
444469
local MainProfile = {
445470
type = "select",
446471
name = "Main Profile",
@@ -515,8 +540,7 @@ local DeleteProfile = {
515540
get = function() return "" end,
516541
}
517542

518-
519-
local Profiles = {
543+
local profiles = {
520544
type = "group",
521545
name = "Profiles",
522546
order = 6,
@@ -571,8 +595,8 @@ local Profiles = {
571595
}
572596
}
573597

574-
local options= {
575-
name = "General Settings",
598+
local settings = {
599+
name = "Display Settings",
576600
handler = MPTUI,
577601
childGroups = "tab",
578602
type = "group",
@@ -585,15 +609,25 @@ local options= {
585609
PBInfo = PBInfo,
586610
},
587611
}
612+
613+
614+
615+
616+
local options = {
617+
618+
619+
}
588620

589621

590622
function MPT.UI:OnInitialize()
591623
local AceConfig = LibStub("AceConfig-3.0")
592-
AceConfig:RegisterOptionsTable("MPTUI", options)
593-
AceConfig:RegisterOptionsTable("MPTProfiles", Profiles)
624+
AceConfig:RegisterOptionsTable("MPTUI", MainOptions)
625+
AceConfig:RegisterOptionsTable("MPTSettings", settings)
626+
AceConfig:RegisterOptionsTable("MPTProfiles", profiles)
594627
local AceConfigdialog = LibStub("AceConfigDialog-3.0")
595628
self.optionsFrame = AceConfigdialog:AddToBlizOptions("MPTUI", "MPlusTimer")
596-
self.profilesFrame = AceConfigdialog:AddToBlizOptions("MPTProfiles", "Profiles", "MPlusTimer") -- needs to be after the optionsFrame is created
629+
self.settingsFrame = AceConfigdialog:AddToBlizOptions("MPTSettings", "Display Settings", "MPlusTimer")
630+
self.profilesFrame = AceConfigdialog:AddToBlizOptions("MPTProfiles", "Profiles", "MPlusTimer")
597631
self:RegisterChatCommand("mpt", "SlashCommand")
598632
self:RegisterChatCommand("mplustimer", "SlashCommand")
599633
end

0 commit comments

Comments
 (0)