Skip to content

Commit 719bb55

Browse files
committed
Added an option to hide the "Season Best" text (closes #7)
1 parent 2ef6908 commit 719bb55

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

modules/dungeonIconText.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,13 @@ function Module:GetDescription()
134134
end
135135

136136
function Module:GetOptions(defaultOptionsTable, db)
137+
--- @type MPT_DungeonIconText_Settings
137138
self.db = db;
139+
--- @class MPT_DungeonIconText_Settings
138140
local defaults = {
139141
dash = false,
140142
name = OPTION_MIDDLE_NAME,
143+
hideSeasonBest = false,
141144
}
142145
for k, v in pairs(defaults) do
143146
if db[k] == nil then
@@ -197,6 +200,16 @@ function Module:GetOptions(defaultOptionsTable, db)
197200
width = 'double',
198201
style = 'radio'
199202
};
203+
defaultOptionsTable.args.hideSeasonBest = {
204+
type = 'toggle',
205+
name = ('Hide %s text'):format(MYTHIC_PLUS_SEASON_BEST),
206+
desc = ('Hides the %s text above the dungeon icons.'):format(MYTHIC_PLUS_SEASON_BEST),
207+
get = get,
208+
set = function(info, value)
209+
set(info, value);
210+
end,
211+
order = increment(),
212+
};
200213

201214
return defaultOptionsTable;
202215
end
@@ -223,6 +236,8 @@ function Module:RepositionFrameElements(frame, forceReset)
223236
if self.db.name == OPTION_NO_NAME or forceReset then
224237
seasonBestOffsetY = 15;
225238
end
239+
local shown = not self.db.hideSeasonBest or forceRest;
240+
frame.WeeklyInfo.Child.SeasonBest:SetShown(shown);
226241
frame.WeeklyInfo.Child.SeasonBest:ClearAllPoints();
227242
frame.WeeklyInfo.Child.SeasonBest:SetPoint('TOPLEFT', frame.DungeonIcons[1], 'TOPLEFT', 5, seasonBestOffsetY);
228243
end

0 commit comments

Comments
 (0)