Commit 1277d791 authored by Benik's avatar Benik
Browse files

Merge remote-tracking branch 'origin/development'

parents 0bb9864d dbae06a7
v1.15 - Sep 8 2020
*Followed ElvUI databars changes
*Tuned the install
*Tuned Databars options
v1.142 - Aug 8 2020
*Really fixed the shadow error during flightMode
......
## Interface: 11305
## Author: Benik
## Version: 1.142
## Version: 1.15
## Title: |cff1784d1ElvUI|r |cff00c0faBenikUI Classic|r
## Notes: an ElvUI Classic decorative/enhancement edit
## RequiredDeps: ElvUI
## DefaultState: Enabled
## OptionalDeps: SharedMedia, AddOnSkins, ProjectAzilroka
## X-ElvuiVersion: 1.27
## X-ElvuiVersion: 1.29
libs\load_libs.xml
locales\load_locales.xml
......
......@@ -29,21 +29,22 @@ local function SetupLayout(layout)
E.db["chat"]["panelBackdrop"] = 'SHOWBOTH'
E.db["chat"]["timeStampFormat"] = "%H:%M "
E.db["chat"]["panelWidth"] = 412
E.db["databars"]["statusbar"] = "BuiFlat"
E.db["databars"]["experience"]["font"] = "Expressway"
E.db["databars"]["experience"]["textYoffset"] = 10
E.db["databars"]["experience"]["textFormat"] = "CURPERC"
E.db["databars"]["experience"]["height"] = 6
E.db["databars"]["experience"]["height"] = 5
E.db["databars"]["experience"]["orientation"] = "HORIZONTAL"
E.db["databars"]["experience"]["textSize"] = 10
E.db["databars"]["experience"]["fontSize"] = 10
E.db["databars"]["reputation"]["enable"] = true
E.db["databars"]["reputation"]["height"] = 150
E.db["databars"]["reputation"]["height"] = 148
E.db["databars"]["reputation"]["orientation"] = 'VERTICAL'
E.db["databars"]["reputation"]["textFormat"] = 'NONE'
E.db["databars"]["reputation"]["textSize"] = 9
E.db["databars"]["reputation"]["width"] = 8
E.db["datatexts"]["leftChatPanel"] = false
E.db["databars"]["reputation"]["fontSize"] = 9
E.db["databars"]["reputation"]["width"] = 7
E.db["datatexts"]["panels"]["LeftChatDataPanel"]["enable"] = false
E.db["datatexts"]["panels"]["RightChatDataPanel"]["enable"] = false
E.db["datatexts"]["panelTransparency"] = true
E.db["datatexts"]["rightChatPanel"] = false
E.db["general"]["backdropcolor"]["b"] = 0.025
E.db["general"]["backdropcolor"]["g"] = 0.025
E.db["general"]["backdropcolor"]["r"] = 0.025
......@@ -90,6 +91,7 @@ local function SetupLayout(layout)
E.private["general"]["chatBubbles"] = 'backdrop'
-- common movers
if E.db["movers"] == nil then E.db["movers"] = {} end
E.db["movers"]["AlertFrameMover"] = "TOP,ElvUIParent,TOP,0,-140"
E.db["movers"]["BelowMinimapContainerMover"] = "TOP,ElvUIParent,TOP,0,-192"
E.db["movers"]["BNETMover"] = "TOPRIGHT,ElvUIParent,TOPRIGHT,-156,-200"
......@@ -102,7 +104,7 @@ local function SetupLayout(layout)
E.db["movers"]["ObjectiveFrameMover"] = "TOPRIGHT,ElvUIParent,TOPRIGHT,-210,-176"
E.db["movers"]["PlayerNameplate"] = "BOTTOM,ElvUIParent,BOTTOM,0,359"
E.db["movers"]["ProfessionsMover"] = "TOPRIGHT,ElvUIParent,TOPRIGHT,-5,-184"
E.db["movers"]["ReputationBarMover"] = "BOTTOMRIGHT,ElvUIParent,BOTTOMRIGHT,-415,22"
E.db["movers"]["ReputationBarMover"] = "BOTTOMRIGHT,ElvUIParent,BOTTOMRIGHT,-416,23"
E.db["movers"]["RightChatMover"] = "BOTTOMRIGHT,ElvUIParent,BOTTOMRIGHT,-2,22"
E.db["movers"]["SquareMinimapButtonBarMover"] = "TOPRIGHT,ElvUIParent,TOPRIGHT,-5,-303"
E.db["movers"]["TopCenterContainerMover"] = "TOP,ElvUIParent,TOP,0,-34"
......@@ -303,6 +305,7 @@ local function SetupActionbars(layout)
E.db["benikui"]["datatexts"]["middle"]["backdrop"] = true
BUI:GetModule('Layout'):MiddleDatatextLayout()
E.db["benikui"]["actionbars"]["toggleButtons"]["enable"] = true
if E.db["movers"] == nil then E.db["movers"] = {} end
if layout == 'v1' then
E.db["actionbar"]["font"] = "Bui Visitor1"
......@@ -352,7 +355,7 @@ local function SetupActionbars(layout)
E.db["benikui"]["actionbars"]["style"]["bar2"] = true
E.db["benikui"]["datatexts"]["middle"]["width"] = 414
E.db["databars"]["experience"]["width"] = 414
E.db["databars"]["experience"]["width"] = 412
-- movers
E.db["movers"]["ElvAB_1"] = "BOTTOM,ElvUIParent,BOTTOM,0,97"
......@@ -477,7 +480,7 @@ local function SetupActionbars(layout)
E.db["actionbar"]["stanceBar"]["buttonsize"] = 24
E.db["benikui"]["actionbars"]["style"]["bar2"] = false
E.db["benikui"]["datatexts"]["middle"]["width"] = 414
E.db["databars"]["experience"]["width"] = 414
E.db["databars"]["experience"]["width"] = 412
-- movers
E.db["movers"]["ArenaHeaderMover"] = "BOTTOMRIGHT,ElvUIParent,BOTTOMRIGHT,-56,346"
E.db["movers"]["BossButton"] = "BOTTOM,ElvUIParent,BOTTOM,0,362"
......@@ -505,6 +508,8 @@ end
local function SetupUnitframes(layout)
E.db["general"]["decimalLength"] = 2
if E.db["movers"] == nil then E.db["movers"] = {} end
if layout == 'v1' then
E.db["nameplates"]["units"]["FRIENDLY_PLAYER"]["debuffs"]["countFont"] = "Bui Prototype"
E.db["nameplates"]["units"]["FRIENDLY_PLAYER"]["debuffs"]["font"] = "Bui Prototype"
......@@ -708,22 +713,6 @@ local function SetupUnitframes(layout)
E.db["unitframe"]["units"]["pet"]["castbar"]["width"] = 130
E.db["unitframe"]["units"]["pet"]["castbar"]["height"] = 14
--[[ focus
E.db["unitframe"]["units"]["focus"]["power"]["height"] = 5
E.db["unitframe"]["units"]["focus"]["power"]["width"] = 'fill'
E.db["unitframe"]["units"]["focus"]["width"] = 130
E.db["unitframe"]["units"]["focus"]["height"] = 30
E.db["unitframe"]["units"]["focus"]["castbar"]["height"] = 14
E.db["unitframe"]["units"]["focus"]["castbar"]["width"] = 130
E.db["unitframe"]["units"]["focus"]["debuffs"]["anchorPoint"] = "BOTTOMRIGHT"
E.db["unitframe"]["units"]["focus"]["debuffs"]["enable"] = false
E.db["unitframe"]["units"]["focus"]["portrait"]["enable"] = true
E.db["unitframe"]["units"]["focus"]["portrait"]["camDistanceScale"] = 1
E.db["unitframe"]["units"]["focus"]["castbar"]["iconSize"] = 26
E.db["unitframe"]["units"]["focus"]["castbar"]["enable"] = false
E.db["unitframe"]["units"]["focus"]["infoPanel"]["height"] = 12
E.db["unitframe"]["units"]["focus"]["infoPanel"]["enable"] = false]]
-- targettarget
E.db["unitframe"]["units"]["targettarget"]["debuffs"]["enable"] = false
E.db["unitframe"]["units"]["targettarget"]["portrait"]["enable"] = true
......@@ -879,28 +868,6 @@ local function SetupUnitframes(layout)
E.db["unitframe"]["units"]["raid40"]["rdebuffs"]["fontOutline"] = "OUTLINE"
E.db["unitframe"]["units"]["raid40"]["growthDirection"] = 'RIGHT_UP'
--[[ Boss
E.db["unitframe"]["units"]["boss"]["debuffs"]["sizeOverride"] = 24
E.db["unitframe"]["units"]["boss"]["debuffs"]["yOffset"] = 12
E.db["unitframe"]["units"]["boss"]["debuffs"]["xOffset"] = -1
E.db["unitframe"]["units"]["boss"]["castbar"]["iconAttached"] = false
E.db["unitframe"]["units"]["boss"]["castbar"]["iconXOffset"] = 2
E.db["unitframe"]["units"]["boss"]["castbar"]["iconPosition"] = "RIGHT"
E.db["unitframe"]["units"]["boss"]["width"] = 210
E.db["unitframe"]["units"]["boss"]["infoPanel"]["height"] = 14
E.db["unitframe"]["units"]["boss"]["infoPanel"]["enable"] = true
E.db["unitframe"]["units"]["boss"]["infoPanel"]["transparent"] = true
E.db["unitframe"]["units"]["boss"]["name"]["attachTextTo"] = "InfoPanel"
E.db["unitframe"]["units"]["boss"]["name"]["yOffset"] = 1
E.db["unitframe"]["units"]["boss"]["name"]["xOffset"] = 4
E.db["unitframe"]["units"]["boss"]["name"]["position"] = "LEFT"
E.db["unitframe"]["units"]["boss"]["height"] = 50
E.db["unitframe"]["units"]["boss"]["buffs"]["yOffset"] = 0
E.db["unitframe"]["units"]["boss"]["buffs"]["anchorPoint"] = "CENTER"
E.db["unitframe"]["units"]["boss"]["buffs"]["xOffset"] = 16
E.db["unitframe"]["units"]["boss"]["buffs"]["attachTo"] = "HEALTH"
E.db["unitframe"]["units"]["boss"]["power"]["height"] = 5]]
-- Movers
E.db["movers"]["AltPowerBarMover"] = "TOP,ElvUIParent,TOP,0,-66"
E.db["movers"]["BossButton"] = "BOTTOM,ElvUIParent,BOTTOM,0,271"
......@@ -1183,17 +1150,6 @@ local function SetupUnitframes(layout)
E.db["unitframe"]["units"]["pet"]["power"]["width"] = 'fill'
E.db["unitframe"]["units"]["pet"]["width"] = 130
--[[ focus
E.db["unitframe"]["units"]["focus"]["castbar"]["height"] = 16
E.db["unitframe"]["units"]["focus"]["castbar"]["icon"] = false
E.db["unitframe"]["units"]["focus"]["castbar"]["width"] = 110
E.db["unitframe"]["units"]["focus"]["height"] = 36
E.db["unitframe"]["units"]["focus"]["infoPanel"]["enable"] = false
E.db["unitframe"]["units"]["focus"]["infoPanel"]["transparent"] = true
E.db["unitframe"]["units"]["focus"]["name"]["attachTextTo"] = "Health"
E.db["unitframe"]["units"]["focus"]["power"]["height"] = 5
E.db["unitframe"]["units"]["focus"]["width"] = 110]]
-- targettarget
E.db["unitframe"]["units"]["targettarget"]["height"] = 36
E.db["unitframe"]["units"]["targettarget"]["infoPanel"]["enable"] = false
......@@ -1346,28 +1302,6 @@ local function SetupUnitframes(layout)
E.db["unitframe"]["units"]["raid40"]["infoPanel"]["transparent"] = true
E.db["unitframe"]["units"]["raid40"]["growthDirection"] = 'RIGHT_UP'
--[[ Boss
E.db["unitframe"]["units"]["boss"]["debuffs"]["sizeOverride"] = 24
E.db["unitframe"]["units"]["boss"]["debuffs"]["yOffset"] = 12
E.db["unitframe"]["units"]["boss"]["debuffs"]["xOffset"] = -1
E.db["unitframe"]["units"]["boss"]["castbar"]["iconAttached"] = false
E.db["unitframe"]["units"]["boss"]["castbar"]["iconXOffset"] = 2
E.db["unitframe"]["units"]["boss"]["castbar"]["iconPosition"] = "RIGHT"
E.db["unitframe"]["units"]["boss"]["width"] = 210
E.db["unitframe"]["units"]["boss"]["height"] = 58
E.db["unitframe"]["units"]["boss"]["infoPanel"]["height"] = 18
E.db["unitframe"]["units"]["boss"]["infoPanel"]["enable"] = true
E.db["unitframe"]["units"]["boss"]["infoPanel"]["transparent"] = true
E.db["unitframe"]["units"]["boss"]["name"]["attachTextTo"] = "InfoPanel"
E.db["unitframe"]["units"]["boss"]["name"]["yOffset"] = 0
E.db["unitframe"]["units"]["boss"]["name"]["xOffset"] = 2
E.db["unitframe"]["units"]["boss"]["name"]["position"] = "LEFT"
E.db["unitframe"]["units"]["boss"]["buffs"]["yOffset"] = 0
E.db["unitframe"]["units"]["boss"]["buffs"]["anchorPoint"] = "CENTER"
E.db["unitframe"]["units"]["boss"]["buffs"]["xOffset"] = 16
E.db["unitframe"]["units"]["boss"]["buffs"]["attachTo"] = "HEALTH"
E.db["unitframe"]["units"]["boss"]["power"]["height"] = 5]]
-- Movers
E.db["movers"]["AltPowerBarMover"] = "TOP,ElvUIParent,TOP,0,-66"
E.db["movers"]["BossButton"] = "BOTTOM,ElvUIParent,BOTTOM,0,237"
......@@ -1628,21 +1562,6 @@ local function SetupUnitframes(layout)
E.db["unitframe"]["units"]["pet"]["power"]["height"] = 5
E.db["unitframe"]["units"]["pet"]["width"] = 130
--[[ focus
E.db["unitframe"]["units"]["focus"]["castbar"]["enable"] = false
E.db["unitframe"]["units"]["focus"]["castbar"]["height"] = 14
E.db["unitframe"]["units"]["focus"]["castbar"]["icon"] = false
E.db["unitframe"]["units"]["focus"]["castbar"]["iconSize"] = 26
E.db["unitframe"]["units"]["focus"]["castbar"]["width"] = 130
E.db["unitframe"]["units"]["focus"]["debuffs"]["anchorPoint"] = "BOTTOMRIGHT"
E.db["unitframe"]["units"]["focus"]["debuffs"]["enable"] = false
E.db["unitframe"]["units"]["focus"]["height"] = 30
E.db["unitframe"]["units"]["focus"]["infoPanel"]["height"] = 12
E.db["unitframe"]["units"]["focus"]["infoPanel"]["transparent"] = true
E.db["unitframe"]["units"]["focus"]["portrait"]["camDistanceScale"] = 1
E.db["unitframe"]["units"]["focus"]["portrait"]["enable"] = false
E.db["unitframe"]["units"]["focus"]["width"] = 130]]
-- targettarget
E.db["unitframe"]["units"]["targettarget"]["height"] = 25
E.db["unitframe"]["units"]["targettarget"]["name"]["text_format"] = "[name:medium]"
......@@ -1651,28 +1570,6 @@ local function SetupUnitframes(layout)
E.db["unitframe"]["units"]["targettarget"]["portrait"]["enable"] = false
E.db["unitframe"]["units"]["targettarget"]["width"] = 130
--[[ boss
E.db["unitframe"]["units"]["boss"]["buffs"]["anchorPoint"] = "CENTER"
E.db["unitframe"]["units"]["boss"]["buffs"]["attachTo"] = "HEALTH"
E.db["unitframe"]["units"]["boss"]["buffs"]["xOffset"] = 16
E.db["unitframe"]["units"]["boss"]["buffs"]["yOffset"] = 0
E.db["unitframe"]["units"]["boss"]["castbar"]["iconAttached"] = false
E.db["unitframe"]["units"]["boss"]["castbar"]["iconPosition"] = "RIGHT"
E.db["unitframe"]["units"]["boss"]["castbar"]["iconXOffset"] = 2
E.db["unitframe"]["units"]["boss"]["debuffs"]["sizeOverride"] = 24
E.db["unitframe"]["units"]["boss"]["debuffs"]["xOffset"] = -1
E.db["unitframe"]["units"]["boss"]["debuffs"]["yOffset"] = 12
E.db["unitframe"]["units"]["boss"]["height"] = 50
E.db["unitframe"]["units"]["boss"]["infoPanel"]["enable"] = true
E.db["unitframe"]["units"]["boss"]["infoPanel"]["height"] = 14
E.db["unitframe"]["units"]["boss"]["infoPanel"]["transparent"] = true
E.db["unitframe"]["units"]["boss"]["name"]["attachTextTo"] = "InfoPanel"
E.db["unitframe"]["units"]["boss"]["name"]["position"] = "LEFT"
E.db["unitframe"]["units"]["boss"]["name"]["xOffset"] = 4
E.db["unitframe"]["units"]["boss"]["name"]["yOffset"] = 1
E.db["unitframe"]["units"]["boss"]["portrait"]["enable"] = false
E.db["unitframe"]["units"]["boss"]["width"] = 210]]
-- party
if not E.db.unitframe.units.party.customTexts then E.db.unitframe.units.party.customTexts = {} end
......@@ -1942,11 +1839,11 @@ local function SetupDataTexts(role)
elseif role == 'dpsMelee' then
E.db["datatexts"]["panels"]["BuiLeftChatDTPanel"][1] = 'Attack Power'
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][1] = 'Haste'
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][3] = 'Crit Chance'
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][3] = 'Crit'
elseif role == 'healer' or 'dpsCaster' then
E.db["datatexts"]["panels"]["BuiLeftChatDTPanel"][1] = 'Spell/Heal Power'
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][1] = 'Haste'
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][3] = 'Crit Chance'
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][3] = 'Crit'
end
E.db["datatexts"]["panels"]["BuiLeftChatDTPanel"][2] = ''
......@@ -1956,7 +1853,7 @@ local function SetupDataTexts(role)
E.db["datatexts"]["panels"]["BuiRightChatDTPanel"][3] = 'Gold'
E.db["datatexts"]["panels"]["BuiRightChatDTPanel"][2] = ''
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][2] = 'Mastery'
E.db["datatexts"]["panels"]["BuiMiddleDTPanel"][2] = 'Hit'
PluginInstallStepComplete.message = BUI.Title..L['DataTexts Set']
PluginInstallStepComplete:Show()
......
......@@ -36,20 +36,17 @@ end
function mod:StyleBar(bar, onClick)
bar.fb = CreateFrame('Button', nil, bar)
bar.fb:Point('TOPLEFT', bar, 'BOTTOMLEFT', 0, -SPACING)
bar.fb:Point('BOTTOMRIGHT', bar, 'BOTTOMRIGHT', 0, (E.PixelMode and -20 or -22))
bar.fb:Point('TOPLEFT', bar.backdrop, 'BOTTOMLEFT', 0, -SPACING)
bar.fb:Point('BOTTOMRIGHT', bar.backdrop, 'BOTTOMRIGHT', 0, (E.PixelMode and -20 or -22))
bar.fb:SetScript('OnClick', onClick)
if BUI.ShadowMode then
bar.fb:CreateSoftShadow()
if not bar.style then
bar:CreateSoftShadow()
end
end
if E.db.benikui.general.benikuiStyle ~= true then return end
bar:Style('Outside', nil, false, true)
bar.backdrop:Style('Outside', nil, false, true)
end
function mod:Initialize()
......
local BUI, E, L, V, P, G = unpack(select(2, ...))
local mod = BUI:GetModule('Databars');
local DT = E:GetModule('DataTexts');
local M = E:GetModule('DataBars');
local DB = E:GetModule('DataBars');
local LSM = E.LSM;
local _G = _G
local GetPetExperience = GetPetExperience
local HideUIPanel, ShowUIPanel = HideUIPanel, ShowUIPanel
local InCombatLockdown = InCombatLockdown
local IsXPUserDisabled = IsXPUserDisabled
local UnitLevel = UnitLevel
local UnitXP, UnitXPMax = UnitXP, UnitXPMax
-- GLOBALS: hooksecurefunc, selectioncolor, ElvUI_ExperienceBar, SpellBookFrame
......@@ -22,35 +20,35 @@ local function OnClick(self)
end
function mod:ApplyXpStyling()
local xp = ElvUI_ExperienceBar
local bar = _G.ElvUI_ExperienceBar
if E.db.databars.experience.enable then
if xp.fb then
if bar.fb then
if E.db.databars.experience.orientation == 'VERTICAL' then
if E.db.benikui.datatexts.chat.enable then
xp.fb:Show()
bar.fb:Show()
else
xp.fb:Hide()
bar.fb:Hide()
end
else
xp.fb:Hide()
bar.fb:Hide()
end
end
end
if E.db.benikuiDatabars.experience.buiStyle then
if xp.style then
xp.style:Show()
if bar.backdrop.style then
bar.backdrop.style:Show()
end
else
if xp.style then
xp.style:Hide()
if bar.backdrop.style then
bar.backdrop.style:Hide()
end
end
end
function mod:ToggleXPBackdrop()
if E.db.benikuiDatabars.experience.enable ~= true then return end
local bar = ElvUI_ExperienceBar
local bar = _G.ElvUI_ExperienceBar
local db = E.db.benikuiDatabars.experience
if bar.fb then
......@@ -74,7 +72,7 @@ function mod:ToggleXPBackdrop()
end
function mod:UpdateXpNotifierPositions()
local bar = ElvUI_ExperienceBar.statusBar
local bar = DB.StatusBars.Experience
local db = E.db.benikuiDatabars.experience.notifiers
local arrow = ""
......@@ -122,7 +120,7 @@ function mod:GetXP(unit)
end
function mod:UpdateXpNotifier()
local bar = ElvUI_ExperienceBar.statusBar
local bar = DB.StatusBars.Experience
if E.db.databars.experience.orientation ~= 'VERTICAL' then
bar.f:Hide()
......@@ -135,26 +133,26 @@ function mod:UpdateXpNotifier()
end
function mod:XpTextOffset()
local text = ElvUI_ExperienceBar.text
local text = _G.ElvUI_ExperienceBar.text
text:Point('CENTER', 0, E.db.databars.experience.textYoffset or 0)
end
function mod:LoadXP()
local bar = ElvUI_ExperienceBar
local bar = _G.ElvUI_ExperienceBar
self:XpTextOffset()
hooksecurefunc(M, 'UpdateExperience', mod.XpTextOffset)
hooksecurefunc(DB, 'ExperienceBar_Update', mod.XpTextOffset)
local db = E.db.benikuiDatabars.experience.notifiers
if db.enable then
self:CreateNotifier(bar.statusBar)
self:CreateNotifier(bar)
self:UpdateXpNotifierPositions()
self:UpdateXpNotifier()
hooksecurefunc(M, 'UpdateExperience', mod.UpdateXpNotifier)
hooksecurefunc(DB, 'ExperienceBar_Update', mod.UpdateXpNotifier)
hooksecurefunc(DT, 'LoadDataTexts', mod.UpdateXpNotifierPositions)
hooksecurefunc(M, 'UpdateExperienceDimensions', mod.UpdateXpNotifierPositions)
hooksecurefunc(M, 'UpdateExperienceDimensions', mod.UpdateXpNotifier)
hooksecurefunc(DB, 'UpdateAll', mod.UpdateXpNotifierPositions)
hooksecurefunc(DB, 'UpdateAll', mod.UpdateXpNotifier)
end
if E.db.benikuiDatabars.experience.enable ~= true then return end
......@@ -163,5 +161,5 @@ function mod:LoadXP()
self:ToggleXPBackdrop()
self:ApplyXpStyling()
hooksecurefunc(M, 'UpdateExperienceDimensions', mod.ApplyXpStyling)
hooksecurefunc(DB, 'UpdateAll', mod.ApplyXpStyling)
end
\ No newline at end of file
......@@ -183,7 +183,7 @@ tinsert(BUI.Config, databarsTable)
local function injectElvUIDatabarOptions()
-- xp
E.Options.args.databars.args.experience.args.textYoffset = {
E.Options.args.databars.args.experience.args.fontGroup.args.textYoffset = {
order = 20,
type = "range",
min = -30, max = 30, step = 1,
......@@ -192,26 +192,15 @@ local function injectElvUIDatabarOptions()
set = function(info, value) E.db.databars.experience[ info[#info] ] = value; mod:XpTextOffset() end,
}
E.Options.args.databars.args.experience.args.spacer1 = {
order = 21,
type = 'description',
name = '',
}
E.Options.args.databars.args.experience.args.spacer2 = {
order = 22,
type = 'header',
name = '',
}
E.Options.args.databars.args.experience.args.gotobenikui = {
order = 23,
order = -1,
type = "execute",
name = BUI.Title..XPBAR_LABEL,
func = function() LibStub("AceConfigDialog-3.0-ElvUI"):SelectGroup("ElvUI", "benikui", "benikuiDatabars", "experience") end,
}
-- reputation
E.Options.args.databars.args.reputation.args.textYoffset = {
E.Options.args.databars.args.reputation.args.fontGroup.args.textYoffset = {
order = 20,
type = "range",
min = -30, max = 30, step = 1,
......@@ -220,20 +209,8 @@ local function injectElvUIDatabarOptions()
set = function(info, value) E.db.databars.reputation[ info[#info] ] = value; mod:RepTextOffset() end,
}
E.Options.args.databars.args.reputation.args.spacer1 = {
order = 21,
type = 'description',
name = '',
}
E.Options.args.databars.args.reputation.args.spacer2 = {
order = 22,
type = 'header',
name = '',
}
E.Options.args.databars.args.reputation.args.gotobenikui = {
order = 23,
order = -1,
type = "execute",
name = BUI.Title..REPUTATION,
func = function() LibStub("AceConfigDialog-3.0-ElvUI"):SelectGroup("ElvUI", "benikui", "benikuiDatabars", "reputation") end,
......
local BUI, E, L, V, P, G = unpack(select(2, ...))
local mod = BUI:GetModule('Databars');
local DT = E:GetModule('DataTexts');
local M = E:GetModule('DataBars');
local DB = E:GetModule('DataBars');
local LSM = E.LSM;
local _G = _G
local find, gsub = string.find, string.gsub
local incpat = gsub(gsub(FACTION_STANDING_INCREASED, "(%%s)", "(.+)"), "(%%d)", "(.+)")
local changedpat = gsub(gsub(FACTION_STANDING_CHANGED, "(%%s)", "(.+)"), "(%%d)", "(.+)")
local decpat = gsub(gsub(FACTION_STANDING_DECREASED, "(%%s)", "(.+)"), "(%%d)", "(.+)")
local GetWatchedFactionInfo = GetWatchedFactionInfo
local SetWatchedFactionIndex = SetWatchedFactionIndex
local GetNumFactions = GetNumFactions
local GetGuildInfo = GetGuildInfo
local GetFactionInfo = GetFactionInfo
-- GLOBALS: hooksecurefunc, selectioncolor, ElvUI_ReputationBar, SpellBookFrame, ToggleCharacter
-- GLOBALS: hooksecurefunc, selectioncolor, ToggleCharacter
local function OnClick(self)
if self.template == 'NoBackdrop' then return end
......@@ -26,7 +16,7 @@ local function OnClick(self)
end
function mod:ApplyRepStyling()
local bar = ElvUI_ReputationBar
local bar = _G.ElvUI_ReputationBar
if E.db.databars.reputation.enable then
if bar.fb then
if E.db.databars.reputation.orientation == 'VERTICAL' then
......@@ -50,7 +40,7 @@ end
function mod:ToggleRepBackdrop()
if E.db.benikuiDatabars.reputation.enable ~= true then return end
local bar = ElvUI_ReputationBar
local bar = _G.ElvUI_ReputationBar
local db = E.db.benikuiDatabars.reputation
if bar.fb then
......@@ -74,7 +64,7 @@ function mod:ToggleRepBackdrop()
end
function mod:UpdateRepNotifierPositions()
local bar = ElvUI_ReputationBar.statusBar
local bar = DB.StatusBars.Reputation
local db = E.db.benikuiDatabars.reputation.notifiers
local arrow = ""
......@@ -114,7 +104,7 @@ function mod:UpdateRepNotifierPositions()
end
function mod:UpdateRepNotifier()
local bar = ElvUI_ReputationBar.statusBar
local bar = DB.StatusBars.Reputation
local name, reaction, min, max, value, factionID = GetWatchedFactionInfo()
if not name or E.db.databars.reputation.orientation ~= 'VERTICAL' or (reaction == MAX_REPUTATION_REACTION) then
......@@ -126,57 +116,26 @@ function mod:UpdateRepNotifier()
end
function mod:RepTextOffset()
local text = ElvUI_ReputationBar.text
local text = _G.ElvUI_ReputationBar.text
text:Point('CENTER', 0, E.db.databars.reputation.textYoffset or 0)
end
-- Credit: Feraldin, ElvUI Enhanced (Legion)
function mod:SetWatchedFactionOnReputationBar(event, msg)
if not E.db.benikuiDatabars.reputation.autotrack then return end
local _, _, faction, amount = find(msg, incpat)
if not faction then _, _, faction, amount = find(msg, changedpat) or find(msg, decpat) end
if faction then
if faction == GUILD_REPUTATION then
faction = GetGuildInfo("player")
end
local active = GetWatchedFactionInfo()
for factionIndex = 1, GetNumFactions() do
local name = GetFactionInfo(factionIndex)
if name == faction and name ~= active then
SetWatchedFactionIndex(factionIndex)
break
end
end
end
end
function mod:ToggleRepAutotrack()
if E.db.benikuiDatabars.reputation.autotrack then
self:RegisterEvent('CHAT_MSG_COMBAT_FACTION_CHANGE', 'SetWatchedFactionOnReputationBar')
else
self:UnregisterEvent('CHAT_MSG_COMBAT_FACTION_CHANGE')
end
end
function mod:LoadRep()
local bar = ElvUI_ReputationBar
local bar = _G.ElvUI_ReputationBar
self:RepTextOffset()
hooksecurefunc(M, 'UpdateReputation', mod.RepTextOffset)
self:ToggleRepAutotrack()
hooksecurefunc(DB, 'ReputationBar_Update', mod.RepTextOffset)
local db = E.db.benikuiDatabars.reputation.notifiers