Commit 4032ad7a authored by Blazeflack's avatar Blazeflack

Changed references to "CastBarPowerOverlay" and "CBPO" to the new names "CastBarOverlay" and "CBO".

parent 6873aceb
package-as: ElvUI_CastBarPowerOverlay
package-as: ElvUI_CastBarOverlay
ignore:
- Changelog_Curse.txt
move-folders:
ElvUI_CastBarPowerOverlay/ElvUI_CastBarPowerOverlay: ElvUI_CastBarPowerOverlay
ElvUI_CastBarOverlay/ElvUI_CastBarOverlay: ElvUI_CastBarOverlay
manual-changelog:
filename: Changelog_Curse.txt
......
**2.37, September 4th 2015**
* [NEW] Added options to overlay the Pet Castbar.
* [NEW] Added option which allows you to overlay on Health instead of Power.
\\ \\
**2.36, July 14th 2015**
* Update ToC for patch 6.2
\\ \\
**2.35, February 25th 2015**
* Update ToC for patch 6.1
\\ \\
**2.34, October 14th 2014**
* Bump toc for patch 6.0.2
\\ \\
**2.33, October 30th 2013**
* [FIX] Fix frame level issues introduced with recent ElvUI changes.
\\ \\
**2.32, September 10th 2013**
* Bump toc for 5.4
\\ \\
**2.31, June 2nd 2013**
* [CHG] Remove plugin header with information about me and my plugins.
\\ \\
**Older Versions**
2.30: Fix error when toggling overlay for Arena or Boss frames. Move all unit code into core and reduce the amount of code by 193 lines (~10KB).
2.29: Update info about other plugins, bump TOC for patch 5.3.
2.28: Information update, locales updated, bump TOC.
2.27: Information update, bump TOC.
2.26: Fix a FrameStrata issue causing the castbar to appear on top of other UI elements.
2.25: Remove LibElvUIPlugin-1.0 library which is now included with ElvUI. Update recommended!
2.24: Update LibElvUIPlugin-1.0 library. Fixes a bug. Updating is recommended!
2.23: Update LibElvUIPlugin-1.0 library.
2.22: Fix compatibility issue with ElvUI_CastBarSnap.
2.21: Config has been rewritten to make use of the new LibElvUIPlugin-1.0 library. Additionally, options to hide or offset castbar text have been added.
2.19: Change post hooks to secure hooks. This change should not be noticeable in any way.
2.18: Small position tweaks, toc bump for 5.1.
2.17: Pixel Perfect tweaks. Try to minimize risk of setting incorrect size or position under some circumstances.
2.16: Fix: Don't touch position or size unless the option is enabled.
2.15: Fix (I think) a bug which causes the castbar to use incorrect sizes when changing spec or going through loading screens.
2.14: Preparation for the new PixelPerfect mode in ElvUI.
2.13: Locale update.
2.12: Disable option to overlay on power bar, if power bar is disabled.
2.11: License included with download.
2.1: Allow CastBarSnap and CastBarPowerOverlay to coexist by disabling CastBarPowerOverlay for the player castbar if both addons are loaded.
2.01: Fix arena config.
2.0: Version to be used with the World of Warcraft Mists of Pandaria Beta.
\ No newline at end of file
## Interface: 60200
## Author: Blazeflack
## Version: 2.37
## Title: |cff1784d1ElvUI|r CastBarPowerOverlay
## Notes: Adds a toggle option to overlay the castbar on the power bar for the respective unit frame.
## Version: 0.1
## Title: |cff1784d1ElvUI|r CastBarOverlay
## Notes: Allows you to overlay castbars on other frames.
## RequiredDeps: ElvUI
## OptionalDeps: ElvUI_CastBarSnap
......@@ -10,5 +10,5 @@ locales.lua
config.lua
core.lua
## X-Tukui-ProjectID: 62
## X-Tukui-ProjectFolders: ElvUI_CastBarPowerOverlay
\ No newline at end of file
## X-Tukui-ProjectFolders: ElvUI_CastBarOverlay
\ No newline at end of file
ElvUI_CastBarPowerOverlay License
Copyright ©2012-2015
ElvUI_CastBarOverlay License
Copyright ©2016
The contents of this addon, excluding third-party resources, are
copyrighted to their authors with all rights reserved.
......
local E, L, V, P, G, _ = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local CBPO = E:NewModule('CastBarPowerOverlay', 'AceTimer-3.0', 'AceEvent-3.0')
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local CBO = E:NewModule('CastBarOverlay', 'AceTimer-3.0', 'AceEvent-3.0')
local UF = E:GetModule('UnitFrames');
-- Defaults
V['CBPO'] = {
V['CBO'] = {
['warned'] = false,
}
P['CBPO'] = {
P['CBO'] = {
['player'] = {
['overlay'] = true,
["overlayOnFrame"] = "POWER",
......@@ -64,7 +64,7 @@ P['CBPO'] = {
},
}
function CBPO:InsertOptions()
function CBO:InsertOptions()
if not E.Options.args.blazeplugins then
E.Options.args.blazeplugins = {
order = -2,
......@@ -90,27 +90,27 @@ function CBPO:InsertOptions()
type = 'toggle',
name = L['Enable Overlay'],
desc = L['Overlay the castbar on the chosen panel.'],
get = function(info) return E.db.CBPO[unit].overlay end,
set = function(info, value) E.db.CBPO[unit].overlay = value; updateFunc(CBPO, unit) end,
get = function(info) return E.db.CBO[unit].overlay end,
set = function(info, value) E.db.CBO[unit].overlay = value; updateFunc(CBO, unit) end,
},
overlayOnFrame = {
order = 3,
type = 'select',
name = L['Overlay Panel'],
desc = L['Choose which panel to overlay the castbar on.'],
disabled = function() return not E.db.CBPO[unit].overlay end,
disabled = function() return not E.db.CBO[unit].overlay end,
values = {
["POWER"] = L["Power"],
["HEALTH"] = L["Health"],
},
get = function(info) return E.db.CBPO[unit].overlayOnFrame end,
get = function(info) return E.db.CBO[unit].overlayOnFrame end,
set = function(info, value)
if value == "POWER" and not E.db.unitframe.units[unit].power.enable then
E:StaticPopup_Show('CBPO_PowerDisabled')
E:StaticPopup_Show('CBO_PowerDisabled')
value = "HEALTH"
end
E.db.CBPO[unit].overlayOnFrame = value;
updateFunc(CBPO, unit);
E.db.CBO[unit].overlayOnFrame = value;
updateFunc(CBO, unit);
end,
},
hidetext = {
......@@ -118,9 +118,9 @@ function CBPO:InsertOptions()
type = 'toggle',
name = L['Hide Text'],
desc = L['Hide Castbar text. Useful if your power height is very low or if you use power offset.'],
get = function(info) return E.db.CBPO[unit].hidetext end,
set = function(info, value) E.db.CBPO[unit].hidetext = value; updateFunc(CBPO, unit); end,
disabled = function() return not E.db.CBPO[unit].overlay end,
get = function(info) return E.db.CBO[unit].hidetext end,
set = function(info, value) E.db.CBO[unit].hidetext = value; updateFunc(CBO, unit); end,
disabled = function() return not E.db.CBO[unit].overlay end,
},
spacer1 = {
order = 5,
......@@ -132,20 +132,20 @@ function CBPO:InsertOptions()
type = 'range',
name = L['Text xOffset'],
desc = L['Move castbar text to the left or to the right. Default is 4'],
get = function(info) return E.db.CBPO[unit].xOffsetText end,
set = function(info, value) E.db.CBPO[unit].xOffsetText = value; updateFunc(CBPO, unit); end,
get = function(info) return E.db.CBO[unit].xOffsetText end,
set = function(info, value) E.db.CBO[unit].xOffsetText = value; updateFunc(CBO, unit); end,
min = -100, max = 100, step = 1,
disabled = function() return (not E.db.CBPO[unit].overlay or E.db.CBPO[unit].hidetext) end,
disabled = function() return (not E.db.CBO[unit].overlay or E.db.CBO[unit].hidetext) end,
},
yOffsetText = {
order = 7,
type = 'range',
name = L['Text yOffset'],
desc = L['Move castbar text up or down. Default is 0'],
get = function(info) return E.db.CBPO[unit].yOffsetText end,
set = function(info, value) E.db.CBPO[unit].yOffsetText = value; updateFunc(CBPO, unit); end,
get = function(info) return E.db.CBO[unit].yOffsetText end,
set = function(info, value) E.db.CBO[unit].yOffsetText = value; updateFunc(CBO, unit); end,
min = -50, max = 50, step = 1,
disabled = function() return (not E.db.CBPO[unit].overlay or E.db.CBPO[unit].hidetext) end,
disabled = function() return (not E.db.CBO[unit].overlay or E.db.CBO[unit].hidetext) end,
},
spacer2 = {
order = 8,
......@@ -157,20 +157,20 @@ function CBPO:InsertOptions()
type = 'range',
name = L['Time xOffset'],
desc = L['Move castbar time to the left or to the right. Default is -4'],
get = function(info) return E.db.CBPO[unit].xOffsetTime end,
set = function(info, value) E.db.CBPO[unit].xOffsetTime = value; updateFunc(CBPO, unit); end,
get = function(info) return E.db.CBO[unit].xOffsetTime end,
set = function(info, value) E.db.CBO[unit].xOffsetTime = value; updateFunc(CBO, unit); end,
min = -100, max = 100, step = 1,
disabled = function() return (not E.db.CBPO[unit].overlay or E.db.CBPO[unit].hidetext) end,
disabled = function() return (not E.db.CBO[unit].overlay or E.db.CBO[unit].hidetext) end,
},
yOffsetTime = {
order = 10,
type = 'range',
name = L['Time yOffset'],
desc = L['Move castbar time up or down. Default is 0'],
get = function(info) return E.db.CBPO[unit].yOffsetTime end,
set = function(info, value) E.db.CBPO[unit].yOffsetTime = value; updateFunc(CBPO, unit); end,
get = function(info) return E.db.CBO[unit].yOffsetTime end,
set = function(info, value) E.db.CBO[unit].yOffsetTime = value; updateFunc(CBO, unit); end,
min = -50, max = 50, step = 1,
disabled = function() return (not E.db.CBPO[unit].overlay or E.db.CBPO[unit].hidetext) end,
disabled = function() return (not E.db.CBO[unit].overlay or E.db.CBO[unit].hidetext) end,
},
},
}
......@@ -178,7 +178,7 @@ function CBPO:InsertOptions()
return group
end
E.Options.args.blazeplugins.args.CBPO = {
E.Options.args.blazeplugins.args.CBO = {
order = 10,
type = 'group',
name = 'CastBarPowerOverlay',
......@@ -187,16 +187,16 @@ function CBPO:InsertOptions()
args = {},
}
local options = E.Options.args.blazeplugins.args.CBPO.args
options.player = CreateOptionsGroup(1, L["Player"], "player", CBPO.UpdateSettings)
options.target = CreateOptionsGroup(2, L["Target"], "target", CBPO.UpdateSettings)
options.focus = CreateOptionsGroup(3, L["Focus"], "focus", CBPO.UpdateSettings)
options.pet = CreateOptionsGroup(4, L["Pet"], "pet", CBPO.UpdateSettings)
options.arena = CreateOptionsGroup(5, L["Arena"], "arena", CBPO.UpdateSettings)
options.boss = CreateOptionsGroup(6, L["Boss"], "boss", CBPO.UpdateSettings)
local options = E.Options.args.blazeplugins.args.CBO.args
options.player = CreateOptionsGroup(1, L["Player"], "player", CBO.UpdateSettings)
options.target = CreateOptionsGroup(2, L["Target"], "target", CBO.UpdateSettings)
options.focus = CreateOptionsGroup(3, L["Focus"], "focus", CBO.UpdateSettings)
options.pet = CreateOptionsGroup(4, L["Pet"], "pet", CBO.UpdateSettings)
options.arena = CreateOptionsGroup(5, L["Arena"], "arena", CBO.UpdateSettings)
options.boss = CreateOptionsGroup(6, L["Boss"], "boss", CBO.UpdateSettings)
--Disable player overlay if CastBarSnap is enabled
E.Options.args.blazeplugins.args.CBPO.args.player.args.overlay.disabled = function() return IsAddOnLoaded('ElvUI_CastBarSnap') end
E.Options.args.blazeplugins.args.CBO.args.player.args.overlay.disabled = function() return IsAddOnLoaded('ElvUI_CastBarSnap') end
end
E:RegisterModule(CBPO:GetName())
\ No newline at end of file
E:RegisterModule(CBO:GetName())
\ No newline at end of file
local E, L, V, P, G, _ = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local CBPO = E:GetModule('CastBarPowerOverlay')
local CBO = E:GetModule('CastBarOverlay')
local UF = E:GetModule('UnitFrames');
local EP = LibStub('LibElvUIPlugin-1.0')
local addon, ns = ...
......@@ -7,18 +7,18 @@ local addon, ns = ...
local CBS_Enabled = false
-- Create compatibility warning popup
E.PopupDialogs['CBPOCompatibility'] = {
text = L['CBPO_CONFLICT_WARNING'],
E.PopupDialogs['CBOCompatibility'] = {
text = L['CBO_CONFLICT_WARNING'],
button1 = L['I understand'],
OnAccept = function() E.private.CBPO.warned = true end,
OnAccept = function() E.private.CBO.warned = true end,
timeout = 0,
whileDead = 1,
preferredIndex = 3,
}
-- Warn about trying to overlay on disabled power bar
E.PopupDialogs['CBPO_PowerDisabled'] = {
text = L['CBPO_POWER_DISABLED'],
E.PopupDialogs['CBO_PowerDisabled'] = {
text = L['CBO_POWER_DISABLED'],
button1 = L['I understand'],
timeout = 0,
whileDead = 1,
......@@ -27,7 +27,7 @@ E.PopupDialogs['CBPO_PowerDisabled'] = {
--Set size of castbar and position on chosen frame
local function SetCastbarSizeAndPosition(unit, unitframe, overlayFrame)
local db = E.db.CBPO[unit];
local db = E.db.CBO[unit];
local cdb = E.db.unitframe.units[unit].castbar;
local castbar = unitframe.Castbar
......@@ -97,7 +97,7 @@ end
--Configure castbar text position and alpha
local function ConfigureText(unit, castbar)
local db = E.db.CBPO[unit]
local db = E.db.CBO[unit]
if db.hidetext then -- Hide
castbar.Text:SetAlpha(0)
......@@ -126,7 +126,7 @@ end
--Initiate update/reset of castbar
local function ConfigureCastbar(unit, unitframe)
local db = E.db.CBPO[unit];
local db = E.db.CBO[unit];
local cdb = E.db.unitframe.units[unit].castbar;
local castbar = unitframe.Castbar
......@@ -141,14 +141,14 @@ local function ConfigureCastbar(unit, unitframe)
end
--Initiate update of unit
function CBPO:UpdateSettings(unit)
local db = E.db.CBPO[unit];
function CBO:UpdateSettings(unit)
local db = E.db.CBO[unit];
local cdb = E.db.unitframe.units[unit].castbar;
--Check if power is disabled and overlay is set to POWER
if not E.db.unitframe.units[unit].power.enable and (E.db.CBPO[unit].overlay and E.db.CBPO[unit].overlayOnFrame == "POWER") then
E:StaticPopup_Show('CBPO_PowerDisabled', unit)
E.db.CBPO[unit].overlayOnFrame = "HEALTH"
if not E.db.unitframe.units[unit].power.enable and (E.db.CBO[unit].overlay and E.db.CBO[unit].overlayOnFrame == "POWER") then
E:StaticPopup_Show('CBO_PowerDisabled', unit)
E.db.CBO[unit].overlayOnFrame = "HEALTH"
end
if (unit == 'player' and not CBS_Enabled) or unit == 'target' or unit == 'focus' or unit == "pet" then
......@@ -169,31 +169,31 @@ function CBPO:UpdateSettings(unit)
end
-- Function to be called when registered events fire
function CBPO:UpdateAllCastbars()
CBPO:UpdateSettings("player")
CBPO:UpdateSettings("target")
CBPO:UpdateSettings("focus")
CBPO:UpdateSettings("pet")
CBPO:UpdateSettings("arena")
CBPO:UpdateSettings("boss")
function CBO:UpdateAllCastbars()
CBO:UpdateSettings("player")
CBO:UpdateSettings("target")
CBO:UpdateSettings("focus")
CBO:UpdateSettings("pet")
CBO:UpdateSettings("arena")
CBO:UpdateSettings("boss")
end
function CBPO:Initialize()
function CBO:Initialize()
-- Register callback with LibElvUIPlugin
EP:RegisterPlugin(addon, CBPO.InsertOptions)
EP:RegisterPlugin(addon, CBO.InsertOptions)
--ElvUI UnitFrames are not enabled, stop right here!
if E.private.unitframe.enable ~= true then return end
if IsAddOnLoaded('ElvUI_CastBarSnap') then
CBS_Enabled = true
if not E.private.CBPO.warned then
if not E.private.CBO.warned then
-- Warn user about CastBarPowerOverlay being disabled for Player CastBar
E:StaticPopup_Show('CBPOCompatibility')
E:StaticPopup_Show('CBOCompatibility')
end
E.db.CBPO.player.overlay = false
E.db.CBO.player.overlay = false
else
E.private.CBPO.warned = false
E.private.CBO.warned = false
end
--Profile changed, update castbar overlay settings
......@@ -206,24 +206,24 @@ function CBPO:Initialize()
hooksecurefunc(UF, "Configure_Castbar", function(self, frame, preventLoop)
if preventLoop then return; end --I call Configure_Castbar with "true" as 2nd argument
local unit = frame.unitframeType
if unit and E.db.CBPO[unit] and E.db.CBPO[unit].overlay then
CBPO:UpdateSettings(unit)
if unit and E.db.CBO[unit] and E.db.CBO[unit].overlay then
CBO:UpdateSettings(unit)
end
end)
--Health may have changed size, update castbar overlay settings
hooksecurefunc(UF,'Configure_HealthBar', function(self, frame)
local unit = frame.unitframeType
if unit and E.db.CBPO[unit] and E.db.CBPO[unit].overlay and E.db.CBPO[unit].overlayOnFrame == "HEALTH" then
CBPO:UpdateSettings(unit)
if unit and E.db.CBO[unit] and E.db.CBO[unit].overlay and E.db.CBO[unit].overlayOnFrame == "HEALTH" then
CBO:UpdateSettings(unit)
end
end)
--Power may have changed size, update castbar overlay settings
hooksecurefunc(UF,'Configure_Power',function(self, frame)
local unit = frame.unitframeType
if unit and E.db.CBPO[unit] and E.db.CBPO[unit].overlay and E.db.CBPO[unit].overlayOnFrame == "POWER" then
CBPO:UpdateSettings(unit)
if unit and E.db.CBO[unit] and E.db.CBO[unit].overlay and E.db.CBO[unit].overlayOnFrame == "POWER" then
CBO:UpdateSettings(unit)
end
end)
end
\ No newline at end of file
......@@ -2,8 +2,8 @@
local L = LibStub("AceLocale-3.0"):NewLocale("ElvUI", "enUS", true);
if not L then return end
L["CBPO_CONFLICT_WARNING"] = "It would appear you have ElvUI_CastBarSnap loaded. CastBarPowerOverlay has been disabled for the Player CastBar."
L["CBPO_POWER_DISABLED"] = "The %s power frame is disabled. Setting castbar overlay to health instead."
L["CBO_CONFLICT_WARNING"] = "It would appear you have ElvUI_CastBarSnap loaded. CastBarPowerOverlay has been disabled for the Player CastBar."
L["CBO_POWER_DISABLED"] = "The %s power frame is disabled. Setting castbar overlay to health instead."
L["I understand"] = true
L['Arena'] = true
L['Boss'] = true
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment