Commit a2b4e0c4 authored by Simpy's avatar Simpy 🐹

Merge branch 'development'

parents 002a426c 895923b9
## Interface: 80100 ## Interface: 80100
## Author: Elv ## Author: Elv
## Version: 11.09 ## Version: 11.10
## Title: |cfffe7b2cElvUI|r ## Title: |cfffe7b2cElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft. ## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB ## SavedVariables: ElvDB, ElvPrivateDB
......
...@@ -29,34 +29,27 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ...@@ -29,34 +29,27 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]] ]]
local MAJOR_VERSION = "LibActionButton-1.0-ElvUI" local MAJOR_VERSION = "LibActionButton-1.0-ElvUI"
local MINOR_VERSION = 16 -- the real minor version is 74 local MINOR_VERSION = 17 -- the real minor version is 74
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
if not lib then return end if not lib then return end
-- Lua functions
local _G = _G
local type, error, tostring, tonumber, assert, select = type, error, tostring, tonumber, assert, select local type, error, tostring, tonumber, assert, select = type, error, tostring, tonumber, assert, select
local setmetatable, wipe, unpack, pairs, next = setmetatable, wipe, unpack, pairs, next local setmetatable, wipe, unpack, pairs, next = setmetatable, wipe, unpack, pairs, next
local str_match, format, tinsert, tremove = string.match, format, tinsert, tremove local str_match, format, tinsert, tremove = string.match, format, tinsert, tremove
-- GLOBALS: LibStub, CreateFrame, InCombatLockdown, ClearCursor, GetCursorInfo, GameTooltip, GameTooltip_SetDefaultAnchor -- GLOBALS: ATTACK_BUTTON_FLASH_TIME, C_ToyBox, ClearCursor, COOLDOWN_TYPE_LOSS_OF_CONTROL, COOLDOWN_TYPE_NORMAL
-- GLOBALS: GetBindingKey, GetBindingText, SetBinding, SetBindingClick, GetCVar, GetMacroInfo -- GLOBALS: CooldownFrame_Set, CreateFrame, FindSpellBookSlotBySpellID, FlyoutHasSpell, GameTooltip, GameTooltip_SetDefaultAnchor
-- GLOBALS: PickupAction, PickupItem, PickupMacro, PickupPetAction, PickupSpell, PickupCompanion, PickupEquipmentSet -- GLOBALS: GetActionCharges, GetActionCooldown, GetActionCount, GetActionInfo, GetActionLossOfControlCooldown, GetActionText
-- GLOBALS: CooldownFrame_SetTimer, UIParent, IsSpellOverlayed, SpellFlyout, GetMouseFocus, SetClampedTextureRotation -- GLOBALS: GetActionTexture, GetBindingKey, GetBindingText, GetCursorInfo, GetCVar, GetCVarBool, GetItemCooldown, GetItemCount
-- GLOBALS: GetActionInfo, GetActionTexture, HasAction, GetActionText, GetActionCount, GetActionCooldown, IsAttackAction -- GLOBALS: GetItemIcon, GetLastZoneAbilitySpellTexture, GetMacroInfo, GetMacroSpell, GetModifiedClick, GetMouseFocus, GetSpellCharges
-- GLOBALS: IsAutoRepeatAction, IsEquippedAction, IsCurrentAction, IsConsumableAction, IsUsableAction, IsStackableAction, IsActionInRange -- GLOBALS: GetSpellCooldown, GetSpellCount, GetSpellInfo, GetSpellTexture, HasAction, HasZoneAbility, InCombatLockdown, IsActionInRange
-- GLOBALS: GetSpellLink, GetMacroSpell, GetSpellTexture, GetSpellCount, GetSpellCooldown, IsAttackSpell, IsCurrentSpell -- GLOBALS: IsAltKeyDown, IsAttackAction, IsAttackSpell, IsAutoRepeatAction, IsAutoRepeatSpell, IsConsumableAction, IsConsumableItem
-- GLOBALS: FindSpellBookSlotBySpellID, IsUsableSpell, IsConsumableSpell, IsSpellInRange, IsAutoRepeatSpell -- GLOBALS: IsConsumableSpell, IsControlKeyDown, IsCurrentAction, IsCurrentItem, IsCurrentSpell, IsEquippedAction, IsEquippedItem
-- GLOBALS: GetItemIcon, GetItemCount, GetItemCooldown, IsEquippedItem, IsCurrentItem, IsUsableItem, IsConsumableItem, IsItemInRange -- GLOBALS: IsItemAction, IsItemInRange, IsShiftKeyDown, IsSpellInRange, IsSpellOverlayed, IsStackableAction, IsUsableAction, IsUsableItem
-- GLOBALS: GetActionCharges, IsItemAction, GetSpellCharges -- GLOBALS: IsUsableSpell, LibStub, PickupAction, PickupCompanion, PickupEquipmentSet, PickupItem, PickupMacro, PickupPetAction, PickupSpell
-- GLOBALS: RANGE_INDICATOR, ATTACK_BUTTON_FLASH_TIME, TOOLTIP_UPDATE_TIME -- GLOBALS: RANGE_INDICATOR, SetBinding, SetBindingClick, SetClampedTextureRotation, SpellFlyout, TOOLTIP_UPDATE_TIME, UIParent, ZoneAbilityFrame
-- GLOBALS: ZoneAbilityFrame, HasZoneAbility, GetLastZoneAbilitySpellTexture
---- Added by ElvUI
-- GLOBALS: C_ToyBox, GetSpellInfo, GetCVarBool, GetModifiedClick, IsAltKeyDown, IsControlKeyDown, IsShiftKeyDown, FlyoutHasSpell
-- GLOBALS: CooldownFrame_Set, GetActionLossOfControlCooldown, COOLDOWN_TYPE_LOSS_OF_CONTROL, COOLDOWN_TYPE_NORMAL
local KeyBound = LibStub("LibKeyBound-1.0", true) local KeyBound = LibStub("LibKeyBound-1.0", true)
local CBH = LibStub("CallbackHandler-1.0") local CBH = LibStub("CallbackHandler-1.0")
...@@ -71,6 +64,9 @@ lib.activeButtons = lib.activeButtons or {} ...@@ -71,6 +64,9 @@ lib.activeButtons = lib.activeButtons or {}
lib.actionButtons = lib.actionButtons or {} lib.actionButtons = lib.actionButtons or {}
lib.nonActionButtons = lib.nonActionButtons or {} lib.nonActionButtons = lib.nonActionButtons or {}
lib.ChargeCooldowns = lib.ChargeCooldowns or {}
lib.NumChargeCooldowns = lib.NumChargeCooldowns or 0
lib.ACTION_HIGHLIGHT_MARKS = lib.ACTION_HIGHLIGHT_MARKS or setmetatable({}, { __index = ACTION_HIGHLIGHT_MARKS }) lib.ACTION_HIGHLIGHT_MARKS = lib.ACTION_HIGHLIGHT_MARKS or setmetatable({}, { __index = ACTION_HIGHLIGHT_MARKS })
lib.callbacks = lib.callbacks or CBH:New(lib) lib.callbacks = lib.callbacks or CBH:New(lib)
...@@ -116,8 +112,9 @@ local Update, UpdateButtonState, UpdateUsable, UpdateCount, UpdateCooldown, Upda ...@@ -116,8 +112,9 @@ local Update, UpdateButtonState, UpdateUsable, UpdateCount, UpdateCooldown, Upda
local StartFlash, StopFlash, UpdateFlash, UpdateHotkeys, UpdateRangeTimer, UpdateOverlayGlow local StartFlash, StopFlash, UpdateFlash, UpdateHotkeys, UpdateRangeTimer, UpdateOverlayGlow
local UpdateFlyout, ShowGrid, HideGrid, UpdateGrid, SetupSecureSnippets, WrapOnClick local UpdateFlyout, ShowGrid, HideGrid, UpdateGrid, SetupSecureSnippets, WrapOnClick
local ShowOverlayGlow, HideOverlayGlow local ShowOverlayGlow, HideOverlayGlow
local EndChargeCooldown
local UpdateRange -- Sezz: new method local UpdateRange -- Sezz: new method
local InitializeEventHandler, OnEvent, ForAllButtons, OnUpdate local InitializeEventHandler, OnEvent, ForAllButtons, OnUpdate
local function GameTooltip_GetOwnerForbidden() local function GameTooltip_GetOwnerForbidden()
...@@ -1098,6 +1095,11 @@ function Update(self, fromUpdateConfig) ...@@ -1098,6 +1095,11 @@ function Update(self, fromUpdateConfig)
self:SetAlpha(0.0) self:SetAlpha(0.0)
end end
self.cooldown:Hide() self.cooldown:Hide()
self:SetChecked(false)
if self.chargeCooldown then
EndChargeCooldown(self.chargeCooldown)
end
end end
-- Add a green border if button is an equipped item -- Add a green border if button is an equipped item
...@@ -1248,10 +1250,53 @@ function UpdateCount(self) ...@@ -1248,10 +1250,53 @@ function UpdateCount(self)
end end
end end
function EndChargeCooldown(self)
self:Hide()
self:SetParent(UIParent)
self.parent.chargeCooldown = nil
self.parent = nil
tinsert(lib.ChargeCooldowns, self)
end
local function StartChargeCooldown(parent, chargeStart, chargeDuration, chargeModRate)
if not parent.chargeCooldown then
local cooldown = tremove(lib.ChargeCooldowns)
if not cooldown then
lib.NumChargeCooldowns = lib.NumChargeCooldowns + 1
cooldown = CreateFrame("Cooldown", "LAB10ChargeCooldown"..lib.NumChargeCooldowns, parent, "CooldownFrameTemplate");
cooldown:SetScript("OnCooldownDone", EndChargeCooldown)
cooldown:SetHideCountdownNumbers(true)
cooldown:SetDrawBling(false)
lib.callbacks:Fire("OnChargeCreated", parent, cooldown)
end
cooldown:SetParent(parent)
cooldown:SetAllPoints(parent)
cooldown:SetFrameStrata("TOOLTIP")
cooldown:Show()
parent.chargeCooldown = cooldown
cooldown.parent = parent
end
-- set cooldown
CooldownFrame_Set(parent.chargeCooldown, chargeStart, chargeDuration, true, true, chargeModRate)
-- update charge cooldown skin when masque is used
if Masque and Masque.UpdateCharge then
Masque:UpdateCharge(parent)
end
if not chargeStart or chargeStart == 0 then
EndChargeCooldown(parent.chargeCooldown)
end
end
local function OnCooldownDone(self) local function OnCooldownDone(self)
local button = self:GetParent() local button = self:GetParent()
if (self.currentCooldownType == COOLDOWN_TYPE_NORMAL) and button.locStart and (button.locStart > 0) then if (self.currentCooldownType == COOLDOWN_TYPE_NORMAL) and button.locStart and (button.locStart > 0) then
UpdateCooldown(button) UpdateCooldown(button)
elseif button.chargeCooldown then
button.chargeCooldown:SetDrawSwipe(button.config.useDrawSwipeOnCharges)
end end
lib.callbacks:Fire("OnCooldownDone", button, self) lib.callbacks:Fire("OnCooldownDone", button, self)
...@@ -1262,10 +1307,8 @@ function UpdateCooldown(self) ...@@ -1262,10 +1307,8 @@ function UpdateCooldown(self)
local start, duration, enable, modRate = self:GetCooldown() local start, duration, enable, modRate = self:GetCooldown()
local charges, maxCharges, chargeStart, chargeDuration, chargeModRate = self:GetCharges() local charges, maxCharges, chargeStart, chargeDuration, chargeModRate = self:GetCharges()
self.cooldown:SetScript("OnCooldownDone", OnCooldownDone)
self.cooldown:SetDrawBling(self.config.useDrawBling and (self.cooldown:GetEffectiveAlpha() > 0.5)) self.cooldown:SetDrawBling(self.config.useDrawBling and (self.cooldown:GetEffectiveAlpha() > 0.5))
self.cooldown:SetDrawSwipe(true) self.cooldown:SetScript("OnCooldownDone", OnCooldownDone)
self.cooldown.locStart = locStart self.cooldown.locStart = locStart
self.cooldown.locDuration = locDuration self.cooldown.locDuration = locDuration
...@@ -1276,8 +1319,8 @@ function UpdateCooldown(self) ...@@ -1276,8 +1319,8 @@ function UpdateCooldown(self)
self.cooldown:SetHideCountdownNumbers(true) self.cooldown:SetHideCountdownNumbers(true)
self.cooldown.currentCooldownType = COOLDOWN_TYPE_LOSS_OF_CONTROL self.cooldown.currentCooldownType = COOLDOWN_TYPE_LOSS_OF_CONTROL
end end
CooldownFrame_Set(self.cooldown, locStart, locDuration, true, true, modRate) CooldownFrame_Set(self.cooldown, locStart, locDuration, true, true, modRate)
self.cooldown.isChargeCooldown = nil
else else
if self.cooldown.currentCooldownType ~= COOLDOWN_TYPE_NORMAL then if self.cooldown.currentCooldownType ~= COOLDOWN_TYPE_NORMAL then
self.cooldown:SetEdgeTexture("Interface\\Cooldown\\edge") self.cooldown:SetEdgeTexture("Interface\\Cooldown\\edge")
...@@ -1287,18 +1330,14 @@ function UpdateCooldown(self) ...@@ -1287,18 +1330,14 @@ function UpdateCooldown(self)
end end
if charges and maxCharges and charges > 0 and charges < maxCharges then if charges and maxCharges and charges > 0 and charges < maxCharges then
CooldownFrame_Set(self.cooldown, chargeStart, chargeDuration, true, true, chargeModRate) StartChargeCooldown(self, chargeStart, chargeDuration, chargeModRate)
self.cooldown:SetDrawSwipe(self.config.useDrawSwipeOnCharges)
self.cooldown.isChargeCooldown = true
-- update charge cooldown skin when masque is used self.chargeCooldown:SetDrawSwipe(duration <= 0 and self.config.useDrawSwipeOnCharges)
if Masque and Masque.UpdateCharge then elseif self.chargeCooldown then
Masque:UpdateCharge(self) EndChargeCooldown(self.chargeCooldown)
end
else
CooldownFrame_Set(self.cooldown, start, duration, enable, false, modRate)
self.cooldown.isChargeCooldown = nil
end end
CooldownFrame_Set(self.cooldown, start, duration, enable, false, modRate)
end end
lib.callbacks:Fire("OnCooldownUpdate", self, start, duration, enable, modRate) lib.callbacks:Fire("OnCooldownUpdate", self, start, duration, enable, modRate)
end end
......
...@@ -1055,25 +1055,42 @@ function AB:StyleFlyout(button) ...@@ -1055,25 +1055,42 @@ function AB:StyleFlyout(button)
end end
end end
local function SetButtonDesaturation(button, desaturate, duration) function AB:UpdateChargeCooldown(button, duration)
if desaturate then local cd = button and button.chargeCooldown
if not duration then if not cd then return end
duration = select(2, button:GetCooldown())
end
if duration and duration > 1.5 then local oldstate = cd.hideText
button.icon:SetDesaturated(true) cd.hideText = (duration and duration > 1.5) or (AB.db.chargeCooldown == false) or nil
button.saturationLocked = true if cd.timer and (oldstate ~= cd.hideText) then
else E:Cooldown_ForceUpdate(cd.timer)
button.icon:SetDesaturated(false) end
button.saturationLocked = nil end
function AB:ToggleCooldownOptions()
for button in pairs(LAB.actionButtons) do
if button._state_type == "action" then
local duration = select(2, button:GetCooldown())
AB:UpdateChargeCooldown(button, duration)
AB:SetButtonDesaturation(button, duration)
end end
end
end
function AB:SetButtonDesaturation(button, duration)
if AB.db.desaturateOnCooldown and (duration and duration > 1.5) then
button.icon:SetDesaturated(true)
button.saturationLocked = true
else else
button.icon:SetDesaturated(false) button.icon:SetDesaturated(false)
button.saturationLocked = nil button.saturationLocked = nil
end end
end end
function AB:LAB_ChargeCreated(_, cd)
cd.CooldownOverride = 'actionbar'
E:RegisterCooldown(cd)
end
function AB:LAB_MouseUp() function AB:LAB_MouseUp()
if self.config.clickOnDown then if self.config.clickOnDown then
self:GetPushedTexture():SetAlpha(0) self:GetPushedTexture():SetAlpha(0)
...@@ -1101,32 +1118,13 @@ function AB:LAB_ButtonUpdate(button) ...@@ -1101,32 +1118,13 @@ function AB:LAB_ButtonUpdate(button)
end end
function AB:LAB_CooldownDone(button) function AB:LAB_CooldownDone(button)
SetButtonDesaturation(button, AB.db.desaturateOnCooldown, 0) AB:SetButtonDesaturation(button, 0)
end end
function AB:LAB_CooldownUpdate(button, _, duration) function AB:LAB_CooldownUpdate(button, _, duration)
if button._state_type ~= "action" then return end if button._state_type == "action" then
button.cooldown.hideText = (button.cooldown.isChargeCooldown and (AB.db.chargeCooldown == false)) or nil AB:UpdateChargeCooldown(button, duration)
SetButtonDesaturation(button, AB.db.desaturateOnCooldown, duration) AB:SetButtonDesaturation(button, duration)
end
function AB:ToggleCooldownOptions()
for button in pairs(LAB.actionButtons) do
local oldstate = button.cooldown.hideText
button.cooldown.hideText = (button.cooldown.isChargeCooldown and (AB.db.chargeCooldown == false)) or nil
if button.cooldown.timer and (oldstate ~= button.cooldown.hideText) then
E:Cooldown_ForceUpdate(button.cooldown.timer)
end
SetButtonDesaturation(button, AB.db.desaturateOnCooldown)
end
if AB.db.desaturateOnCooldown or (AB.db.chargeCooldown == false) then
LAB.RegisterCallback(AB, "OnCooldownUpdate", AB.LAB_CooldownUpdate)
LAB.RegisterCallback(AB, "OnCooldownDone", AB.LAB_CooldownDone)
else
LAB.UnregisterCallback(AB, "OnCooldownUpdate")
LAB.UnregisterCallback(AB, "OnCooldownDone")
end end
end end
...@@ -1137,6 +1135,9 @@ function AB:Initialize() ...@@ -1137,6 +1135,9 @@ function AB:Initialize()
LAB.RegisterCallback(AB, "OnButtonUpdate", AB.LAB_ButtonUpdate) LAB.RegisterCallback(AB, "OnButtonUpdate", AB.LAB_ButtonUpdate)
LAB.RegisterCallback(AB, "OnButtonCreated", AB.LAB_ButtonCreated) LAB.RegisterCallback(AB, "OnButtonCreated", AB.LAB_ButtonCreated)
LAB.RegisterCallback(AB, "OnChargeCreated", AB.LAB_ChargeCreated)
LAB.RegisterCallback(AB, "OnCooldownUpdate", AB.LAB_CooldownUpdate)
LAB.RegisterCallback(AB, "OnCooldownDone", AB.LAB_CooldownDone)
self.fadeParent = CreateFrame("Frame", "Elv_ABFade", _G.UIParent) self.fadeParent = CreateFrame("Frame", "Elv_ABFade", _G.UIParent)
self.fadeParent:SetAlpha(1 - self.db.globalFadeAlpha) self.fadeParent:SetAlpha(1 - self.db.globalFadeAlpha)
......
...@@ -205,16 +205,12 @@ function AB:BindUpdate(button, spellmacro) ...@@ -205,16 +205,12 @@ function AB:BindUpdate(button, spellmacro)
end end
GameTooltip:Show(); GameTooltip:Show();
elseif spellmacro=="STANCE" or spellmacro=="PET" then elseif spellmacro=="STANCE" or spellmacro=="PET" then
bind.button.id = tonumber(button:GetID());
bind.button.name = button:GetName(); bind.button.name = button:GetName();
if not bind.button.name then return; end if not bind.button.name then return; end
if not bind.button.id or bind.button.id < 1 or bind.button.id > 10 then bind.button.id = tonumber(button:GetID());
bind.button.bindstring = "CLICK "..bind.button.name..":LeftButton"; bind.button.bindstring = (spellmacro=="STANCE" and "SHAPESHIFTBUTTON" or "BONUSACTIONBUTTON")..bind.button.id;
else
bind.button.bindstring = (spellmacro=="STANCE" and "StanceButton" or "BONUSACTIONBUTTON")..bind.button.id;
end
GameTooltip:SetOwner(bind, "ANCHOR_NONE"); GameTooltip:SetOwner(bind, "ANCHOR_NONE");
GameTooltip:Point("BOTTOM", bind, "TOP", 0, 1); GameTooltip:Point("BOTTOM", bind, "TOP", 0, 1);
...@@ -237,13 +233,12 @@ function AB:BindUpdate(button, spellmacro) ...@@ -237,13 +233,12 @@ function AB:BindUpdate(button, spellmacro)
tt:SetScript("OnHide", nil); tt:SetScript("OnHide", nil);
end); end);
else else
bind.button.action = tonumber(button.action);
bind.button.name = button:GetName(); bind.button.name = button:GetName();
if not bind.button.name then return; end if not bind.button.name then return; end
if (not bind.button.action or bind.button.action < 1 or bind.button.action > 132) and not (bind.button.keyBoundTarget) then bind.button.action = tonumber(button.action);
bind.button.bindstring = "CLICK "..bind.button.name..":LeftButton";
elseif bind.button.keyBoundTarget then if bind.button.keyBoundTarget then
bind.button.bindstring = bind.button.keyBoundTarget bind.button.bindstring = bind.button.keyBoundTarget
else else
local modact = 1+(bind.button.action-1)%12; local modact = 1+(bind.button.action-1)%12;
...@@ -281,19 +276,16 @@ function AB:BindUpdate(button, spellmacro) ...@@ -281,19 +276,16 @@ function AB:BindUpdate(button, spellmacro)
end end
end end
function AB:RegisterButton(b, override) function AB:RegisterButton(b)
local stance = _G.StanceButton1:GetScript("OnClick"); local stance = _G.StanceButton1:GetScript("OnClick");
local pet = _G.PetActionButton1:GetScript("OnClick"); local pet = _G.PetActionButton1:GetScript("OnClick");
local button = SecureActionButton_OnClick;
if b.IsProtected and b.IsObjectType and b.GetScript and b:IsObjectType('CheckButton') and b:IsProtected() then if b.IsProtected and b.IsObjectType and b.GetScript and b:IsObjectType('CheckButton') and b:IsProtected() then
local script = b:GetScript("OnClick"); local script = b:GetScript("OnClick");
if override then if script==pet then
b:HookScript("OnEnter", function(s) self:BindUpdate(s); end);
elseif script==pet then
b:HookScript("OnEnter", function(s) self:BindUpdate(s, "PET"); end); b:HookScript("OnEnter", function(s) self:BindUpdate(s, "PET"); end);
elseif script==stance then elseif script==stance then
b:HookScript("OnEnter", function(s) self:BindUpdate(s, "STANCE"); end); b:HookScript("OnEnter", function(s) self:BindUpdate(s, "STANCE"); end);
elseif (script==button) then else
b:HookScript("OnEnter", function(s) self:BindUpdate(s); end); b:HookScript("OnEnter", function(s) self:BindUpdate(s); end);
end end
end end
...@@ -383,7 +375,7 @@ function AB:LoadKeyBinder() ...@@ -383,7 +375,7 @@ function AB:LoadKeyBinder()
end end
for b in pairs(self.handledbuttons) do for b in pairs(self.handledbuttons) do
self:RegisterButton(b, true); self:RegisterButton(b);
end end
if not IsAddOnLoaded("Blizzard_MacroUI") then if not IsAddOnLoaded("Blizzard_MacroUI") then
......
...@@ -5,6 +5,7 @@ local S = E:GetModule('Skins') ...@@ -5,6 +5,7 @@ local S = E:GetModule('Skins')
local _G = _G local _G = _G
local select = select local select = select
--WoW API / Variables --WoW API / Variables
local hooksecurefunc = hooksecurefunc
-- GLOBALS: -- GLOBALS:
local function LoadSkin() local function LoadSkin()
...@@ -18,15 +19,23 @@ local function LoadSkin() ...@@ -18,15 +19,23 @@ local function LoadSkin()
frame.buttonFrame:Hide() frame.buttonFrame:Hide()
local eb = frame.editBox local eb = frame.editBox
eb:CreateBackdrop("Transparent")
eb.backdrop:Hide()
eb:SetAltArrowKeyMode(false) eb:SetAltArrowKeyMode(false)
for i = 3, 8 do for i = 3, 8 do
select(i, eb:GetRegions()):SetAlpha(0) select(i, eb:GetRegions()):SetAlpha(0)
end end
S:HandleEditBox(eb)
eb:ClearAllPoints() eb:ClearAllPoints()
eb:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", 0, -7) eb:SetPoint("TOPLEFT", frame, "BOTTOMLEFT", 0, -7)
eb:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, -32) eb:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 0, -32)
hooksecurefunc("ChatEdit_DeactivateChat", function(editBox)
if editBox.isGM then eb.backdrop:Hide() end
end)
hooksecurefunc("ChatEdit_ActivateChat", function(editBox)
if editBox.isGM then eb.backdrop:Show() end
end)
local lang = _G.GMChatFrameEditBoxLanguage local lang = _G.GMChatFrameEditBoxLanguage
lang:GetRegions():SetAlpha(0) lang:GetRegions():SetAlpha(0)
lang:SetPoint("TOPLEFT", eb, "TOPRIGHT", 3, 0) lang:SetPoint("TOPLEFT", eb, "TOPRIGHT", 3, 0)
...@@ -40,10 +49,10 @@ local function LoadSkin() ...@@ -40,10 +49,10 @@ local function LoadSkin()
tab:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, 28) tab:SetPoint("TOPRIGHT", frame, "TOPRIGHT", 0, 28)
_G.GMChatTabIcon:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-Blizz") _G.GMChatTabIcon:SetTexture("Interface\\ChatFrame\\UI-ChatIcon-Blizz")
S:HandleCloseButton(_G.GMChatFrameCloseButton) local close = _G.GMChatFrameCloseButton
_G.GMChatFrameCloseButton:ClearAllPoints() S:HandleCloseButton(close)
_G.GMChatFrameCloseButton:SetPoint("RIGHT", _G.GMChatTab, -5, 0) close:ClearAllPoints()
close:SetPoint("RIGHT", tab, -5, 0)
end end
S:AddCallbackForAddon("Blizzard_GMChatUI", "GMChat", LoadSkin) S:AddCallbackForAddon("Blizzard_GMChatUI", "GMChat", LoadSkin)
...@@ -3,7 +3,7 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private ...@@ -3,7 +3,7 @@ local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, Private
--Global Settings --Global Settings
G.general = { G.general = {
UIScale = 0.64, UIScale = 0.64,
version = 11.09, version = 11.10,
eyefinity = false, eyefinity = false,
ignoreScalePopup = false, ignoreScalePopup = false,
smallerWorldMap = true, smallerWorldMap = true,
......
...@@ -4653,7 +4653,7 @@ P.actionbar = { ...@@ -4653,7 +4653,7 @@ P.actionbar = {
addNewSpells = false, addNewSpells = false,
rightClickSelfCast = false, rightClickSelfCast = false,
desaturateOnCooldown = false, desaturateOnCooldown = false,
chargeCooldown = true, chargeCooldown = false,
bar1 = { bar1 = {
enabled = true, enabled = true,
......
...@@ -100,27 +100,15 @@ local function BuildABConfig() ...@@ -100,27 +100,15 @@ local function BuildABConfig()
AB:UpdatePetCooldownSettings() AB:UpdatePetCooldownSettings()
end, end,
}, },
useDrawSwipeOnCharges = {
order = 9,
type = "toggle",
name = L["Use Draw Swipe"],
desc = L["Shows a swipe animation when a spell is recharging but still has charges left."],
get = function(info) return E.db.actionbar.useDrawSwipeOnCharges end,
set = function(info, value) E.db.actionbar.useDrawSwipeOnCharges = value;
for _, bar in pairs(AB.handledBars) do
AB:UpdateButtonConfig(bar, bar.bindButtons)
end
end,
},
addNewSpells = { addNewSpells = {
order = 10, order = 9,
type = "toggle", type = "toggle",
name = L["Auto Add New Spells"], name = L["Auto Add New Spells"],
desc = L["Allow newly learned spells to be automatically placed on an empty actionbar slot."], desc = L["Allow newly learned spells to be automatically placed on an empty actionbar slot."],
set = function(info, value) E.db.actionbar.addNewSpells = value; AB:IconIntroTracker_Toggle() end, set = function(info, value) E.db.actionbar.addNewSpells = value; AB:IconIntroTracker_Toggle() end,
}, },
rightClickSelfCast = { rightClickSelfCast = {
order = 11, order = 10,
type = "toggle", type = "toggle",
name = L["RightClick Self-Cast"], name = L["RightClick Self-Cast"],
set = function(info, value) set = function(info, value)
...@@ -130,26 +118,45 @@ local function BuildABConfig() ...@@ -130,26 +118,45 @@ local function BuildABConfig()
end end
end, end,
}, },
desaturateOnCooldown = { useDrawSwipeOnCharges = {
order = 11,
type = "toggle",
name = L["Charge Draw Swipe"],
desc = L["Shows a swipe animation when a spell is recharging but still has charges left."],
get = function(info) return E.db.actionbar.useDrawSwipeOnCharges end,
set = function(info, value) E.db.actionbar.useDrawSwipeOnCharges = value;
for _, bar in pairs(AB.handledBars) do
AB:UpdateButtonConfig(bar, bar.bindButtons)
end
end,
},
chargeCooldown = {
order = 12, order = 12,
type = "toggle", type = "toggle",
name = L["Desaturate On Cooldown"], name = L["Charge Cooldown Text"],
set = function(info, value) set = function(info, value)
E.db.actionbar.desaturateOnCooldown = value; E.db.actionbar.chargeCooldown = value;
AB:ToggleCooldownOptions() AB:ToggleCooldownOptions()
end, end,
}, },
chargeCooldown = { desaturateOnCooldown = {
order = 13, order = 13,
type = "toggle", type = "toggle",
name = L["Show Charge Cooldown"], name = L["Desaturate Cooldowns"],
customWidth = 180,
set = function(info, value) set = function(info, value)
E.db.actionbar.chargeCooldown = value; E.db.actionbar.desaturateOnCooldown = value;
AB:ToggleCooldownOptions() AB:ToggleCooldownOptions()
end, end,
}, },
movementModifier = { spacer = {
order = 14, order = 14,
type = "description",
name = " ",
width = 'full',
},
movementModifier = {
order = 15,
type = 'select', type = 'select',
name = PICKUP_ACTION_KEY_TEXT, name = PICKUP_ACTION_KEY_TEXT,
desc = L["The button you must hold down in order to drag an ability to another action button."], desc = L["The button you must hold down in order to drag an ability to another action button."],
...@@ -162,7 +169,7 @@ local function BuildABConfig() ...@@ -162,7 +169,7 @@ local function BuildABConfig()
}, },
}, },
globalFadeAlpha = { globalFadeAlpha = {
order = 15, order = 16,
type = 'range', type = 'range',
name = L["Global Fade Transparency"], name = L["Global Fade Transparency"],
desc = L["Transparency level when not in combat, no target exists, full health, not casting, and no focus target exists."], desc = L["Transparency level when not in combat, no target exists, full health, not casting, and no focus target exists."],
......
...@@ -83,6 +83,10 @@ L["Button Spacing"] = "按钮间距" ...@@ -83,6 +83,10 @@ L["Button Spacing"] = "按钮间距"
L["Buttons Per Row"] = "每行按钮数" L["Buttons Per Row"] = "每行按钮数"
L["Buttons"] = "按钮数" L["Buttons"] = "按钮数"
L["Change the alpha level of the frame."] = "改变框架透明度" L["Change the alpha level of the frame."] = "改变框架透明度"
L["Charge Cooldown Text"] = "显示充能冷却"
L["Charge Draw Swipe"] = "反向充能动画"
L["Color Keybind Text when Out of Range, instead of the button."] = "当你超过射程时对键位文字着色而不是对按钮着色"
L["Color Keybind Text"] = "键位文字着色"
L["Color of the actionbutton when not usable."] = "动作条按键不可用时的颜色" L["Color of the actionbutton when not usable."] = "动作条按键不可用时的颜色"
L["Color of the actionbutton when out of power (Mana, Rage, Focus, Holy Power)."] = "当能量不足时(如法力,怒气等)动作条按键的颜色" L["Color of the actionbutton when out of power (Mana, Rage, Focus, Holy Power)."] = "当能量不足时(如法力,怒气等)动作条按键的颜色"
L["Color of the actionbutton when out of range."] = "当超出距离时动作条按键的颜色" L["Color of the actionbutton when out of range."] = "当超出距离时动作条按键的颜色"
...@@ -95,7 +99,7 @@ L["Color when the text is in the seconds format."] = "以秒显示的文字颜 ...@@ -95,7 +99,7 @@ L["Color when the text is in the seconds format."] = "以秒显示的文字颜
L["Cooldown Text"] = "冷却文字" L["Cooldown Text"] = "冷却文字"
L["Darken Inactive"] = "未激活时暗化" L["Darken Inactive"] = "未激活时暗化"
L["Days"] = "天" L["Days"] = "天"