Skip to content

Commit

Permalink
feat(unitframe): display buffs and debuffs like blizz default group f…
Browse files Browse the repository at this point in the history
…rame
  • Loading branch information
ffainy committed Mar 9, 2022
1 parent 5abc966 commit f04d193
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 90 deletions.
14 changes: 8 additions & 6 deletions config/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ C.CharacterSettings = {
PartyWatcherSync = true,
PartyWatcherOnRight = false,
PartyNameLength = 4,
PartyBuff = true,
PartyBuffSize = 16,
PartyDebuff = true,
PartyDebuffSize = 16,

RaidFrame = true,
RaidColorStyle = 2,
Expand All @@ -271,7 +275,10 @@ C.CharacterSettings = {
RaidHealthHeight = 30,
RaidPowerHeight = 2,
RaidNameLength = 2,

RaidBuff = false,
RaidBuffSize = 12,
RaidDebuff = false,
RaidDebuffSize = 12,

GroupName = false,
GroupRole = true,
Expand All @@ -282,12 +289,7 @@ C.CharacterSettings = {

SmartRaid = true,

ShowRaidBuff = false,
RaidBuffSize = 8,

ShowRaidDebuff = false,
RaidDebuffSize = 12,
RaidDebuffsScale = 1,

PositionBySpec = false,
ClickToCast = true,
Expand Down
135 changes: 135 additions & 0 deletions gui/extra.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,141 @@ function GUI:SetupNameLength(parent)
end
end

local function UpdateGroupAuras()
UNITFRAME:UpdateGroupAuras()
end



function GUI:SetupPartyBuffSize(parent)
local guiName = 'FreeUIGUISetupPartyBuffSize'
TogglePanel(guiName)
if extraGUIs[guiName] then
return
end

local panel = CreateExtraGUI(parent, guiName)
local scroll = GUI:CreateScroll(panel, 220, 540)

local mKey = 'Unitframe'
local db = C.CharacterSettings.Unitframe

local datas = {
[1] = {
key = 'PartyBuffSize',
value = db.PartyBuffSize,
text = L['Icon Size'],
min = 12,
max = 36,
step = 1
}
}

local offset = -10
for _, v in ipairs(datas) do
CreateGroupTitle(scroll, L['Party Buff'], offset)
CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50, UpdateGroupAuras)
offset = offset - 65
end
end

function GUI:SetupPartyDebuffSize(parent)
local guiName = 'FreeUIGUISetupPartyDebuffSize'
TogglePanel(guiName)
if extraGUIs[guiName] then
return
end

local panel = CreateExtraGUI(parent, guiName)
local scroll = GUI:CreateScroll(panel, 220, 540)

local mKey = 'Unitframe'
local db = C.CharacterSettings.Unitframe

local datas = {
[1] = {
key = 'PartyDebuffSize',
value = db.PartyDebuffSize,
text = L['Icon Size'],
min = 12,
max = 36,
step = 1
},
}

local offset = -10
for _, v in ipairs(datas) do
CreateGroupTitle(scroll, L['Party Debuff'], offset)
CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50, UpdateGroupAuras)
offset = offset - 65
end
end


function GUI:SetupRaidBuffSize(parent)
local guiName = 'FreeUIGUISetupRaidBuffSize'
TogglePanel(guiName)
if extraGUIs[guiName] then
return
end

local panel = CreateExtraGUI(parent, guiName)
local scroll = GUI:CreateScroll(panel, 220, 540)

local mKey = 'Unitframe'
local db = C.CharacterSettings.Unitframe

local datas = {
[1] = {
key = 'RaidBuffSize',
value = db.RaidBuffSize,
text = L['Icon Size'],
min = 12,
max = 36,
step = 1
}
}

local offset = -10
for _, v in ipairs(datas) do
CreateGroupTitle(scroll, L['Raid Buff'], offset)
CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50, UpdateGroupAuras)
offset = offset - 65
end
end

function GUI:SetupRaidDebuffSize(parent)
local guiName = 'FreeUIGUISetupRaidDebuffSize'
TogglePanel(guiName)
if extraGUIs[guiName] then
return
end

local panel = CreateExtraGUI(parent, guiName)
local scroll = GUI:CreateScroll(panel, 220, 540)

local mKey = 'Unitframe'
local db = C.CharacterSettings.Unitframe

local datas = {
[1] = {
key = 'RaidDebuffSize',
value = db.RaidDebuffSize,
text = L['Icon Size'],
min = 12,
max = 36,
step = 1
}
}

local offset = -10
for _, v in ipairs(datas) do
CreateGroupTitle(scroll, L['Raid Debuff'], offset)
CreateSlider(scroll, mKey, v.key, v.text, v.min, v.max, v.step, v.value, 20, offset - 50, UpdateGroupAuras)
offset = offset - 65
end
end


-- General

Expand Down
26 changes: 26 additions & 0 deletions gui/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,26 @@ local function SetupNameLength()
GUI:SetupNameLength(GUI.Page[12])
end

local function SetupPartyBuffSize()
GUI:SetupPartyBuffSize(GUI.Page[12])
end

local function SetupPartyDebuffSize()
GUI:SetupPartyDebuffSize(GUI.Page[12])
end

local function SetupRaidBuffSize()
GUI:SetupRaidBuffSize(GUI.Page[12])
end

local function SetupRaidDebuffSize()
GUI:SetupRaidDebuffSize(GUI.Page[12])
end

local function UpdateGroupAuras()
UNITFRAME:UpdateGroupAuras()
end


-- General

Expand Down Expand Up @@ -619,12 +639,18 @@ GUI.OptionsList = {
{1, 'Unitframe', 'RaidFrame', L['Enable RaidFrame'], nil, SetupRaidFrame},
{1, 'Unitframe', 'SimpleMode', L['Simple Mode'], nil, SetupSimpleRaidFrame, nil, L['Simple mode remove most of the elements, and only show unit health status.']},
{1, 'Unitframe', 'TeamIndex', L['Display Team Index'], true, nil, UpdateRaidHeader},

{1, 'Unitframe', 'RaidBuff', L['Display Buffs'], nil, SetupRaidBuffSize, UpdateGroupAuras, L['Display buffs on RaidFrame by blizzard API logic, up to 3 icons.|nThis may overlap with the Corner Indicator and is best not enabled at the same time.']},
{1, 'Unitframe', 'RaidDebuff', L['Display Debuffs'], true, SetupRaidDebuffSize, UpdateGroupAuras, L['Display debuffs on RaidFrame by blizzard API logic, up to 3 icons.|nThis may overlap with the Corner Indicator and is best not enabled at the same time.']},
{},

{1, 'Unitframe', 'PartyFrame', L['Enable PartyFrame'], nil, SetupPartyFrame},
{1, 'Unitframe', 'ShowSolo', L['Display PartyFrame on Solo'], nil, nil, UpdateAllHeaders, L['If checked, the PartyFrame would be visible even you are solo.']},
{1, 'Unitframe', 'DescRole', L['Sort by Reverse Roles'], true, nil, UpdatePartyHeader, L["If checked, sort your party order by 'Damager Healer Tank' within growth direction.|nIf unchecked, sort your party order by 'Tank Healer Damager' within growth direction."]},

{1, 'Unitframe', 'PartyBuff', L['Display Buffs'], nil, SetupPartyBuffSize, UpdateGroupAuras, L['Display buffs on PartyFrame by blizzard API logic, up to 3 icons.|nThis may overlap with the Corner Indicator and is best not enabled at the same time.']},
{1, 'Unitframe', 'PartyDebuff', L['Display Debuffs'], true, SetupPartyDebuffSize, UpdateGroupAuras, L['Display debuffs on PartyFrame by blizzard API logic, up to 3 icons.|nThis may overlap with the Corner Indicator and is best not enabled at the same time.']},

{1, 'Unitframe', 'PartyWatcher', L['Enable Party Watcher'], nil, SetupPartyWatcher, nil, L['If enabled, show spell cooldown for your group members on PartyFrames']},
{1, 'Unitframe', 'PartyWatcherOnRight', L['Swap Icons Side'], nil, nil, UpdatePartyElements},
{1, 'Unitframe', 'PartyWatcherSync', L['Sync Party Watcher'], true, nil, nil, L['If enabled, the cooldown status would sync with players who using party watcher or ZenTracker(WA).|nThis might decrease your performance.']},
Expand Down
Loading

0 comments on commit f04d193

Please sign in to comment.