Skip to content

Commit

Permalink
cleanup gui option of class power
Browse files Browse the repository at this point in the history
  • Loading branch information
ffainy committed Apr 6, 2022
1 parent 0ddef1b commit 199e2c9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
26 changes: 18 additions & 8 deletions gui/extra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -919,10 +919,6 @@ function GUI:SetupNameplateMajorSpells(parent)
end
end

local function UpdateIndicators()
NAMEPLATE:UpdateIndicators()
end

local function UpdateNameplateCVars()
NAMEPLATE:UpdateNameplateCVars()
end
Expand Down Expand Up @@ -1401,7 +1397,7 @@ function GUI:SetupArenaFrameSize(parent)
end

function GUI:SetupClassPowerSize(parent)
local guiName = 'FreeUIGUIClassPowerSize'
local guiName = 'FreeUIGUIClassPower'
TogglePanel(guiName)
if extraGUIs[guiName] then
return
Expand All @@ -1410,12 +1406,26 @@ function GUI:SetupClassPowerSize(parent)
local panel = CreateExtraGUI(parent, guiName)
local scroll = GUI:CreateScroll(panel, 220, 540)
local db = C.CharacterSettings.Unitframe
local mKey = 'Unitframe'

local datas = {key = 'ClassPowerHeight', value = db.ClassPowerHeight, text = L['Height'], min = 1, max = 20, step = 1}
local datas = {
slider = {[1] = {key = 'ClassPowerHeight', value = db.ClassPowerHeight, text = L['Height'], min = 1, max = 20, step = 1}},
checkbox = {[1] = {value = 'RunesTimer', text = L['Runes Timer'], tip = L['Display timer for DK Runes.']}},
}

local offset = -10
CreateGroupTitle(scroll, L['ClassPower'], offset)
CreateSlider(scroll, 'Unitframe', datas.key, datas.text, datas.min, datas.max, datas.step, datas.value, 20, offset - 50)
for _, v in ipairs(datas.slider) do
CreateGroupTitle(scroll, L['Class Power'], offset)
CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50)
end

scroll.groupTitle = nil

for _, v in ipairs(datas.checkbox) do
CreateGroupTitle(scroll, L['Runes'], offset - 100)
CreateCheckbox(scroll, offset - 130, mKey, v.value, v.text, nil, v.tip)
offset = offset - 35
end
end

function GUI:SetupUnitFrameFader(parent)
Expand Down
4 changes: 1 addition & 3 deletions gui/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -574,15 +574,13 @@ GUI.OptionsList = {
{1, 'Unitframe', 'Portrait', L['Portrait'], nil, nil, UpdateGroupElements, L['Show dynamic portrait on unit frame.']},
{1, 'Unitframe', 'GCDIndicator', L['GCD Indicator'], true, nil, UpdateGCDTicker, L['Show global cooldown ticker above the player frame.']},
{1, 'Unitframe', 'AbbrName', L['Abbreviate Name'], nil, nil, UpdateUnitTags},
{1, 'Unitframe', 'ClassPower', L['Class Power'], true, SetupClassPowerSize, nil, L['Show special resources of the class, such as Combo Points, Holy Power, Chi, Runes, etc.']},
{},
{1, 'Unitframe', 'OnlyShowPlayer', L['Player Debuffs Only'], nil, nil, nil, L['Display debuffs cast by player only.']},
{1, 'Unitframe', 'DesaturateIcon', L['Desaturate Debuffs'], true, nil, nil, L['Desaturate debuffs cast by others.']},
{1, 'Unitframe', 'DebuffTypeColor', L['Debuffs Type Color'], nil, nil, nil, L['Color debuffs border by type.|nMagic is blue, Curse is purple, Poison is green, Disease is yellow, and others are red.']},
{1, 'Unitframe', 'StealableBuffs', L['Purgeable Buffs'], true, nil, nil, L['Display purgeable buffs.']},
{},
{1, 'Unitframe', 'ClassPower', L['Class Power'], nil, SetupClassPowerSize, nil, L['Show special resources of the class, such as Combo Points, Holy Power, Chi, Runes, etc.']},
{1, 'Unitframe', 'RunesTimer', L['Runes Timer'], true, nil, nil, L['Show timer for DK Runes.']},
{},
{1, 'Unitframe', 'Castbar', L['Enable Castbar'], nil, SetupCastbarColor, nil, L['Uncheck this if you want to use other castbar addon.']},
{1, 'Unitframe', 'SeparateCastbar', L['Separate Castbar'], true, SetupCastbarSize, nil, L['If disabled, the castbar will be overlapped on the healthbar.|nNote that the spell name and time are only available with separate castbar.']},
{},
Expand Down

0 comments on commit 199e2c9

Please sign in to comment.