From b0594f027015896373c6e1920b33b968f23af825 Mon Sep 17 00:00:00 2001 From: Daenarys Date: Thu, 28 Nov 2024 17:43:26 +0100 Subject: [PATCH] sync --- RazerNaga/actionButton.lua | 249 ++--------------- RazerNaga/autoBinder.lua | 44 +-- RazerNaga/bagBar.lua | 59 +--- RazerNaga/bindableButton.lua | 4 - RazerNaga/configModeDialog.lua | 49 +--- .../libs/LibKeyBound-1.0/LibKeyBound-1.0.lua | 40 +-- RazerNaga/menuBar.lua | 261 +----------------- RazerNaga/petBar.lua | 50 ---- RazerNaga/settingsLoader.lua | 2 +- RazerNaga/spellFlyout.lua | 78 +++--- RazerNaga/stanceBar.lua | 30 -- RazerNaga_Cast/CastingBarFrame.lua | 249 ----------------- RazerNaga_Cast/RazerNaga_Cast.toc | 1 - RazerNaga_Cast/castBar.lua | 67 +---- RazerNaga_Cast/castBar.xml | 58 +--- RazerNaga_Cast/localization.xml | 3 - RazerNaga_Cast/localization/localization.lua | 5 - RazerNaga_Config/menu.lua | 38 +-- 18 files changed, 89 insertions(+), 1198 deletions(-) delete mode 100644 RazerNaga_Cast/CastingBarFrame.lua delete mode 100644 RazerNaga_Cast/localization.xml delete mode 100644 RazerNaga_Cast/localization/localization.lua diff --git a/RazerNaga/actionButton.lua b/RazerNaga/actionButton.lua index a3348cf..ef4f1b3 100644 --- a/RazerNaga/actionButton.lua +++ b/RazerNaga/actionButton.lua @@ -35,49 +35,34 @@ end local function skinActionButton(self) self.icon:SetTexCoord(0.06, 0.94, 0.06, 0.94) - self.NormalTexture:SetTexture([[Interface\Buttons\UI-Quickslot2]]) self.NormalTexture:ClearAllPoints() - self.NormalTexture:SetPoint("TOPLEFT", -15, 15) - self.NormalTexture:SetPoint("BOTTOMRIGHT", 15, -15) - self.NormalTexture:SetVertexColor(1, 1, 1, 0.5) - self.PushedTexture:SetTexture([[Interface\Buttons\UI-Quickslot-Depress]]) + self.NormalTexture:SetPoint("TOPLEFT", -3, 3) + self.NormalTexture:SetPoint("BOTTOMRIGHT", 7, -7) self.PushedTexture:ClearAllPoints() - self.PushedTexture:SetAllPoints() - self.HighlightTexture:SetTexture([[Interface\Buttons\ButtonHilight-Square]]) + self.PushedTexture:SetPoint("TOPLEFT", -2, 2) + self.PushedTexture:SetPoint("BOTTOMRIGHT", 6, -6) self.HighlightTexture:ClearAllPoints() - self.HighlightTexture:SetAllPoints() - self.HighlightTexture:SetBlendMode("ADD") - self.CheckedTexture:SetTexture([[Interface\Buttons\CheckButtonHilight]]) + self.HighlightTexture:SetPoint("TOPLEFT", -3, 3) + self.HighlightTexture:SetPoint("BOTTOMRIGHT", 3, -2) self.CheckedTexture:ClearAllPoints() - self.CheckedTexture:SetAllPoints() - self.CheckedTexture:SetBlendMode("ADD") - self.NewActionTexture:SetSize(44, 44) - self.NewActionTexture:SetAtlas("bags-newitem") + self.CheckedTexture:SetPoint("TOPLEFT", -3, 3) + self.CheckedTexture:SetPoint("BOTTOMRIGHT", 3, -2) self.NewActionTexture:ClearAllPoints() - self.NewActionTexture:SetPoint("CENTER") - self.NewActionTexture:SetBlendMode("ADD") - self.SpellHighlightTexture:SetSize(44, 44) - self.SpellHighlightTexture:SetAtlas("bags-newitem") + self.NewActionTexture:SetPoint("TOPLEFT", -3, 3) + self.NewActionTexture:SetPoint("BOTTOMRIGHT", 3, -2) self.SpellHighlightTexture:ClearAllPoints() - self.SpellHighlightTexture:SetPoint("CENTER") - self.SpellHighlightTexture:SetBlendMode("ADD") - self.Border:SetTexture([[Interface\Buttons\UI-ActionButton-Border]]) - self.Border:SetSize(62, 62) + self.SpellHighlightTexture:SetPoint("TOPLEFT", -3, 3) + self.SpellHighlightTexture:SetPoint("BOTTOMRIGHT", 3, -2) self.Border:ClearAllPoints() - self.Border:SetPoint("CENTER") - self.Border:SetBlendMode("ADD") + self.Border:SetPoint("TOPLEFT", -3, 3) + self.Border:SetPoint("BOTTOMRIGHT", 2, -2) self.cooldown:ClearAllPoints() self.cooldown:SetAllPoints() - self.Flash:SetTexture([[Interface\Buttons\UI-QuickslotRed]]) - self.Flash:ClearAllPoints() - self.Flash:SetAllPoints() self.Count:ClearAllPoints() self.Count:SetPoint("BOTTOMRIGHT", -2, 2) - self.Count:SetDrawLayer("ARTWORK", 2) + self.Flash:ClearAllPoints() + self.Flash:SetAllPoints() self.FlyoutBorderShadow:SetSize(48, 48) - if self.IconMask then - self.IconMask:Hide() - end if self.SlotBackground then self.SlotBackground:Hide() end @@ -310,7 +295,7 @@ function ActionButton:AddCastOnKeyPressSupport(button) button:UpdateOverrideBindings() end --- restore old animations +-- disable new animations if (ActionBarActionEventsFrame) then ActionBarActionEventsFrame:UnregisterEvent("UNIT_SPELLCAST_INTERRUPTED") ActionBarActionEventsFrame:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED") @@ -326,209 +311,9 @@ if (ActionBarActionEventsFrame) then ActionBarActionEventsFrame:UnregisterEvent("UNIT_SPELLCAST_FAILED") end -local function OverlayGlowAnimOutFinished(animGroup) - local overlay = animGroup:GetParent() - local frame = overlay:GetParent() - overlay:Hide() - frame.ActionButtonOverlay = nil -end - -local function OverlayGlow_OnHide(self) - if self.animOut:IsPlaying() then - self.animOut:Stop() - OverlayGlowAnimOutFinished(self.animOut) - end -end - -local function OverlayGlow_OnUpdate(self, elapsed) - AnimateTexCoords(self.ants, 256, 256, 48, 48, 22, elapsed, 0.01) - local cooldown = self:GetParent().cooldown - if cooldown and cooldown:IsShown() and cooldown:GetCooldownDuration() > 3000 then - self:SetAlpha(0.5) - else - self:SetAlpha(1.0) - end -end - -local function CreateScaleAnim(group, target, order, duration, x, y, delay) - local scale = group:CreateAnimation("Scale") - scale:SetTarget(target) - scale:SetOrder(order) - scale:SetDuration(duration) - scale:SetScale(x, y) - - if delay then - scale:SetStartDelay(delay) - end -end - -local function CreateAlphaAnim(group, target, order, duration, fromAlpha, toAlpha, delay) - local alpha = group:CreateAnimation("Alpha") - alpha:SetTarget(target) - alpha:SetOrder(order) - alpha:SetDuration(duration) - alpha:SetFromAlpha(fromAlpha) - alpha:SetToAlpha(toAlpha) - - if delay then - alpha:SetStartDelay(delay) - end -end - -local function AnimIn_OnPlay(group) - local frame = group:GetParent() - local frameWidth, frameHeight = frame:GetSize() - frame.spark:SetSize(frameWidth, frameHeight) - frame.spark:SetAlpha(0.3) - frame.innerGlow:SetSize(frameWidth / 2, frameHeight / 2) - frame.innerGlow:SetAlpha(1.0) - frame.innerGlowOver:SetAlpha(1.0) - frame.outerGlow:SetSize(frameWidth * 2, frameHeight * 2) - frame.outerGlow:SetAlpha(1.0) - frame.outerGlowOver:SetAlpha(1.0) - frame.ants:SetSize(frameWidth * 0.85, frameHeight * 0.85) - frame.ants:SetAlpha(0) - frame:Show() -end - -local function AnimIn_OnFinished(group) - local frame = group:GetParent() - local frameWidth, frameHeight = frame:GetSize() - frame.spark:SetAlpha(0) - frame.innerGlow:SetAlpha(0) - frame.innerGlow:SetSize(frameWidth, frameHeight) - frame.innerGlowOver:SetAlpha(0.0) - frame.outerGlow:SetSize(frameWidth, frameHeight) - frame.outerGlowOver:SetAlpha(0.0) - frame.outerGlowOver:SetSize(frameWidth, frameHeight) - frame.ants:SetAlpha(1.0) -end - -hooksecurefunc("ActionButton_SetupOverlayGlow", function(button) - if button.SpellActivationAlert then - button.SpellActivationAlert:SetAlpha(0) - end - - if button.ActionButtonOverlay then - return; - end - - local name = button:GetName() - local overlay = CreateFrame("Frame", name, UIParent) - - -- spark - overlay.spark = overlay:CreateTexture(name .. "Spark", "BACKGROUND") - overlay.spark:SetPoint("CENTER") - overlay.spark:SetAlpha(0) - overlay.spark:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) - overlay.spark:SetTexCoord(0.00781250, 0.61718750, 0.00390625, 0.26953125) - - -- inner glow - overlay.innerGlow = overlay:CreateTexture(name .. "InnerGlow", "ARTWORK") - overlay.innerGlow:SetPoint("CENTER") - overlay.innerGlow:SetAlpha(0) - overlay.innerGlow:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) - overlay.innerGlow:SetTexCoord(0.00781250, 0.50781250, 0.27734375, 0.52734375) - - -- inner glow over - overlay.innerGlowOver = overlay:CreateTexture(name .. "InnerGlowOver", "ARTWORK") - overlay.innerGlowOver:SetPoint("TOPLEFT", overlay.innerGlow, "TOPLEFT") - overlay.innerGlowOver:SetPoint("BOTTOMRIGHT", overlay.innerGlow, "BOTTOMRIGHT") - overlay.innerGlowOver:SetAlpha(0) - overlay.innerGlowOver:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) - overlay.innerGlowOver:SetTexCoord(0.00781250, 0.50781250, 0.53515625, 0.78515625) - - -- outer glow - overlay.outerGlow = overlay:CreateTexture(name .. "OuterGlow", "ARTWORK") - overlay.outerGlow:SetPoint("CENTER") - overlay.outerGlow:SetAlpha(0) - overlay.outerGlow:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) - overlay.outerGlow:SetTexCoord(0.00781250, 0.50781250, 0.27734375, 0.52734375) - - -- outer glow over - overlay.outerGlowOver = overlay:CreateTexture(name .. "OuterGlowOver", "ARTWORK") - overlay.outerGlowOver:SetPoint("TOPLEFT", overlay.outerGlow, "TOPLEFT") - overlay.outerGlowOver:SetPoint("BOTTOMRIGHT", overlay.outerGlow, "BOTTOMRIGHT") - overlay.outerGlowOver:SetAlpha(0) - overlay.outerGlowOver:SetTexture([[Interface\SpellActivationOverlay\IconAlert]]) - overlay.outerGlowOver:SetTexCoord(0.00781250, 0.50781250, 0.53515625, 0.78515625) - - -- ants - overlay.ants = overlay:CreateTexture(name .. "Ants", "OVERLAY") - overlay.ants:SetPoint("CENTER") - overlay.ants:SetAlpha(0) - overlay.ants:SetTexture([[Interface\SpellActivationOverlay\IconAlertAnts]]) - - -- setup antimations - overlay.animIn = overlay:CreateAnimationGroup() - CreateScaleAnim(overlay.animIn, overlay.spark, 1, 0.2, 1.5, 1.5) - CreateAlphaAnim(overlay.animIn, overlay.spark, 1, 0.2, 0, 1) - CreateScaleAnim(overlay.animIn, overlay.innerGlow, 1, 0.3, 2, 2) - CreateScaleAnim(overlay.animIn, overlay.innerGlowOver, 1, 0.3, 2, 2) - CreateAlphaAnim(overlay.animIn, overlay.innerGlowOver, 1, 0.3, 1, 0) - CreateScaleAnim(overlay.animIn, overlay.outerGlow, 1, 0.3, 0.5, 0.5) - CreateScaleAnim(overlay.animIn, overlay.outerGlowOver, 1, 0.3, 0.5, 0.5) - CreateAlphaAnim(overlay.animIn, overlay.outerGlowOver, 1, 0.3, 1, 0) - CreateScaleAnim(overlay.animIn, overlay.spark, 1, 0.2, 2/3, 2/3, 0.2) - CreateAlphaAnim(overlay.animIn, overlay.spark, 1, 0.2, 1, 0, 0.2) - CreateAlphaAnim(overlay.animIn, overlay.innerGlow, 1, 0.2, 1, 0, 0.3) - CreateAlphaAnim(overlay.animIn, overlay.ants, 1, 0.2, 0, 1, 0.3) - overlay.animIn:SetScript("OnPlay", AnimIn_OnPlay) - overlay.animIn:SetScript("OnFinished", AnimIn_OnFinished) - - overlay.animOut = overlay:CreateAnimationGroup() - CreateAlphaAnim(overlay.animOut, overlay.outerGlowOver, 1, 0.2, 0, 1) - CreateAlphaAnim(overlay.animOut, overlay.ants, 1, 0.2, 1, 0) - CreateAlphaAnim(overlay.animOut, overlay.outerGlowOver, 2, 0.2, 1, 0) - CreateAlphaAnim(overlay.animOut, overlay.outerGlow, 2, 0.2, 1, 0) - overlay.animOut:SetScript("OnFinished", OverlayGlowAnimOutFinished) - - -- scripts - overlay:SetScript("OnUpdate", OverlayGlow_OnUpdate) - overlay:SetScript("OnHide", OverlayGlow_OnHide) - - local frameWidth, frameHeight = button:GetSize() - overlay:SetParent(button) - overlay:SetFrameLevel(button:GetFrameLevel() + 5) - overlay:ClearAllPoints() - overlay:SetSize(frameWidth * 1.4, frameHeight * 1.4) - overlay:SetPoint("TOPLEFT", button, "TOPLEFT", -frameWidth * 0.2, frameHeight * 0.2) - overlay:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", frameWidth * 0.2, -frameHeight * 0.2) - overlay.animIn:Play() - button.ActionButtonOverlay = overlay -end) - -hooksecurefunc("ActionButton_ShowOverlayGlow", function(button) - if button.ActionButtonOverlay then - if button.ActionButtonOverlay.animOut:IsPlaying() then - button.ActionButtonOverlay.animOut:Stop() - button.ActionButtonOverlay.animIn:Play() - end - end -end) - -hooksecurefunc("ActionButton_HideOverlayGlow", function(button) - if button.ActionButtonOverlay then - if button.ActionButtonOverlay.animIn:IsPlaying() then - button.ActionButtonOverlay.animIn:Stop() - end - if button:IsVisible() then - button.ActionButtonOverlay.animOut:Play() - else - OverlayGlowAnimOutFinished(button.ActionButtonOverlay.animOut) - end - end -end) - hooksecurefunc("StartChargeCooldown", function(parent) parent.chargeCooldown:SetAllPoints(parent) end) -hooksecurefunc("CooldownFrame_Set", function(self) - if not self:IsForbidden() then - self:SetEdgeTexture("Interface\\Cooldown\\edge") - end -end) - -- exports RazerNaga.ActionButton = ActionButton \ No newline at end of file diff --git a/RazerNaga/autoBinder.lua b/RazerNaga/autoBinder.lua index 7cf3cf9..f7f85c8 100644 --- a/RazerNaga/autoBinder.lua +++ b/RazerNaga/autoBinder.lua @@ -22,51 +22,19 @@ local function CreateEnableAutomaticBindingsPrompt() f:SetScript('OnHide', function() PlaySound(SOUNDKIT.GS_TITLE_OPTION_EXIT) end) local border = CreateFrame('Frame', nil, f, 'DialogBorderTemplate') - border.TopEdge:SetSize(32, 32) - border.TopEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal", true) - border.TopEdge:SetTexCoord(0, 0.5, 0.13671875, 0.26171875) - border.TopLeftCorner:SetSize(32, 32) - border.TopLeftCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.TopLeftCorner:SetTexCoord(0.015625, 0.515625, 0.53515625, 0.66015625) + local header = CreateFrame('Frame', nil, f, 'DialogHeaderTemplate') + header:SetWidth(140) + header:SetPoint('TOP', 0, 12) - border.TopRightCorner:SetSize(32, 32) - border.TopRightCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.TopRightCorner:SetTexCoord(0.015625, 0.515625, 0.66796875, 0.79296875) - - border.BottomEdge:SetSize(32, 32) - border.BottomEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal", true) - border.BottomEdge:SetTexCoord(0, 0.5, 0.00390625, 0.12890625) - - border.BottomLeftCorner:SetSize(32, 32) - border.BottomLeftCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.BottomLeftCorner:SetTexCoord(0.015625, 0.515625, 0.26953125, 0.39453125) - - border.BottomRightCorner:SetSize(32, 32) - border.BottomRightCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.BottomRightCorner:SetTexCoord(0.015625, 0.515625, 0.40234375, 0.52734375) - - border.LeftEdge:SetSize(32, 32) - border.LeftEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetalVertical", false, true) - border.LeftEdge:SetTexCoord(0.0078125, 0.2578125, 0, 1) - - border.RightEdge:SetSize(32, 32) - border.RightEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetalVertical", false, true) - border.RightEdge:SetTexCoord(0.2734375, 0.5234375, 0, 1) - - local header = f:CreateTexture(nil, 'ARTWORK') - header:SetTexture('Interface\\DialogFrame\\UI-DialogBox-Header') - header:SetWidth(320); header:SetHeight(64) - header:SetPoint('TOP', f, 'TOP', 0, 12) - - local title = f:CreateFontString(nil, 'ARTWORK') + local title = header:CreateFontString(nil, 'ARTWORK') title:SetFontObject('GameFontNormal') - title:SetPoint('TOP', header, 'TOP', 0, -14) + title:SetPoint('TOP', 0, -14) title:SetText('RazerNaga') local desc = f:CreateFontString(nil, 'ARTWORK') desc:SetFontObject('GameFontHighlight') - desc:SetPoint('TOP', f, 'TOP', 0, -32) + desc:SetPoint('TOP', 0, -32) desc:SetWidth(290) desc:SetHeight(0) desc:SetText(L.EnableAutoBindingsPrompt) diff --git a/RazerNaga/bagBar.lua b/RazerNaga/bagBar.lua index 402be99..dcc5900 100644 --- a/RazerNaga/bagBar.lua +++ b/RazerNaga/bagBar.lua @@ -19,70 +19,17 @@ end function BagBar:SkinButton(b) if b.skinned then return end - b:SetSize(30, 30) + b:SetSize(34, 34) - if b.IconBorder ~= nil then - b.IconBorder:SetSize(30, 30) - end - - if b.IconOverlay ~= nil then - b.IconOverlay:SetSize(30, 30) - end - - if b.CircleMask then - b.CircleMask:Hide() - end - - local function updateTextures(self) - self:GetNormalTexture():SetTexture("Interface\\Buttons\\UI-Quickslot2") - self:GetNormalTexture():SetSize(50, 50) - self:GetNormalTexture():SetAlpha(1) - self:GetNormalTexture():ClearAllPoints() - self:GetNormalTexture():SetPoint("CENTER", 0, -1) - self:SetPushedTexture("Interface\\Buttons\\UI-Quickslot-Depress") - self:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square") - self:GetHighlightTexture():SetAlpha(1) - self.SlotHighlightTexture:SetTexture("Interface\\Buttons\\CheckButtonHilight") - self.SlotHighlightTexture:SetBlendMode("ADD") - end - - hooksecurefunc(b, "SetItemButtonQuality", ItemButtonMixin.SetItemButtonQuality) - hooksecurefunc(b, "UpdateTextures", updateTextures) - - updateTextures(b) - MainMenuBarBackpackButtonIconTexture:SetAtlas("hud-backpack", false) MainMenuBarBackpackButtonCount:ClearAllPoints() - MainMenuBarBackpackButtonCount:SetPoint("CENTER", 1, -7) + MainMenuBarBackpackButtonCount:SetPoint("CENTER", 0, -7) b.skinned = true end -local function Disable_BagButtons() - for i, bagButton in MainMenuBarBagManager:EnumerateBagButtons() do - bagButton:Disable() - SetDesaturation(bagButton.icon, true) - end -end - -local function Enable_BagButtons() - for i, bagButton in MainMenuBarBagManager:EnumerateBagButtons() do - bagButton:Enable() - SetDesaturation(bagButton.icon, false) - end -end - -GameMenuFrame:HookScript("OnShow", function() - Disable_BagButtons() -end) - -GameMenuFrame:HookScript("OnHide", function() - Enable_BagButtons() -end) - function BagBar:GetDefaults() return { - point = 'BOTTOMRIGHT', - spacing = 2 + point = 'BOTTOMRIGHT' } end diff --git a/RazerNaga/bindableButton.lua b/RazerNaga/bindableButton.lua index 8997db1..381eee6 100644 --- a/RazerNaga/bindableButton.lua +++ b/RazerNaga/bindableButton.lua @@ -102,10 +102,6 @@ end function BindableButton:UpdateHotkeys() local key = (self.GetHotkey or getButtonHotkey)(self) or '' - self.HotKey:SetVertexColor(ACTIONBAR_HOTKEY_FONT_COLOR:GetRGB()) - self.TextOverlayContainer:SetFrameLevel(2) - self.HotKey:SetDrawLayer("ARTWORK", 2) - if key ~= '' and RazerNaga:ShowBindingText() and self.buttonType == 'BONUSACTIONBUTTON' then self.HotKey:SetText(key) self.HotKey:Show() diff --git a/RazerNaga/configModeDialog.lua b/RazerNaga/configModeDialog.lua index 410fda6..8f6d227 100644 --- a/RazerNaga/configModeDialog.lua +++ b/RazerNaga/configModeDialog.lua @@ -28,46 +28,14 @@ function ConfigModeDialog:Load() self:SetScript('OnDragStop', function() self:StopMovingOrSizing() end) local border = CreateFrame('Frame', nil, self, 'DialogBorderTemplate') - border.TopEdge:SetSize(32, 32) - border.TopEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal", true) - border.TopEdge:SetTexCoord(0, 0.5, 0.13671875, 0.26171875) - border.TopLeftCorner:SetSize(32, 32) - border.TopLeftCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.TopLeftCorner:SetTexCoord(0.015625, 0.515625, 0.53515625, 0.66015625) - - border.TopRightCorner:SetSize(32, 32) - border.TopRightCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.TopRightCorner:SetTexCoord(0.015625, 0.515625, 0.66796875, 0.79296875) - - border.BottomEdge:SetSize(32, 32) - border.BottomEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal", true) - border.BottomEdge:SetTexCoord(0, 0.5, 0.00390625, 0.12890625) - - border.BottomLeftCorner:SetSize(32, 32) - border.BottomLeftCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.BottomLeftCorner:SetTexCoord(0.015625, 0.515625, 0.26953125, 0.39453125) - - border.BottomRightCorner:SetSize(32, 32) - border.BottomRightCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.BottomRightCorner:SetTexCoord(0.015625, 0.515625, 0.40234375, 0.52734375) - - border.LeftEdge:SetSize(32, 32) - border.LeftEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetalVertical", false, true) - border.LeftEdge:SetTexCoord(0.0078125, 0.2578125, 0, 1) - - border.RightEdge:SetSize(32, 32) - border.RightEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetalVertical", false, true) - border.RightEdge:SetTexCoord(0.2734375, 0.5234375, 0, 1) - - local header = self:CreateTexture(nil, 'ARTWORK') - header:SetTexture('Interface\\DialogFrame\\UI-DialogBox-Header') - header:SetSize(326, 64) + local header = CreateFrame('Frame', nil, self, 'DialogHeaderTemplate') + header:SetWidth(170) header:SetPoint('TOP', 0, 12) - local title = self:CreateFontString(nil, 'ARTWORK') + local title = header:CreateFontString(nil, 'ARTWORK') title:SetFontObject('GameFontNormal') - title:SetPoint('TOP', header, 'TOP', 0, -14) + title:SetPoint('TOP', 0, -14) title:SetText(L.ConfigMode) local desc = self:CreateFontString(nil, 'ARTWORK') @@ -80,7 +48,7 @@ function ConfigModeDialog:Load() --menu buttons local exitConfig = self:CreateExitButton() - exitConfig:SetPoint('TOPRIGHT', -4, -4) + exitConfig:SetPoint('TOPRIGHT') --ui menu display local bindingMode = self:CreateBindingModeButton() @@ -245,11 +213,6 @@ end function ConfigModeDialog:CreateExitButton() local exitConfig = CreateFrame('Button', self:GetName() .. 'ExitConfig', self, 'UIPanelCloseButton') - exitConfig:SetSize(32, 32) - exitConfig:SetDisabledTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Disabled") - exitConfig:SetNormalTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Up") - exitConfig:SetPushedTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Down") - exitConfig:SetHighlightTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Highlight") exitConfig:SetScript('OnClick', function() RazerNaga:SetLock(true) end) @@ -327,4 +290,4 @@ function ConfigModeDialog:CreateBindingModeButton() end) return b -end +end \ No newline at end of file diff --git a/RazerNaga/libs/LibKeyBound-1.0/LibKeyBound-1.0.lua b/RazerNaga/libs/LibKeyBound-1.0/LibKeyBound-1.0.lua index 42afac3..51e28ac 100644 --- a/RazerNaga/libs/LibKeyBound-1.0/LibKeyBound-1.0.lua +++ b/RazerNaga/libs/LibKeyBound-1.0/LibKeyBound-1.0.lua @@ -65,46 +65,14 @@ function LibKeyBound:Initialize() f:SetScript('OnDragStop', function(f) f:StopMovingOrSizing() end) local border = CreateFrame('Frame', nil, f, 'DialogBorderTemplate') - border.TopEdge:SetSize(32, 32) - border.TopEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal", true) - border.TopEdge:SetTexCoord(0, 0.5, 0.13671875, 0.26171875) - border.TopLeftCorner:SetSize(32, 32) - border.TopLeftCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.TopLeftCorner:SetTexCoord(0.015625, 0.515625, 0.53515625, 0.66015625) - - border.TopRightCorner:SetSize(32, 32) - border.TopRightCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.TopRightCorner:SetTexCoord(0.015625, 0.515625, 0.66796875, 0.79296875) - - border.BottomEdge:SetSize(32, 32) - border.BottomEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal", true) - border.BottomEdge:SetTexCoord(0, 0.5, 0.00390625, 0.12890625) - - border.BottomLeftCorner:SetSize(32, 32) - border.BottomLeftCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.BottomLeftCorner:SetTexCoord(0.015625, 0.515625, 0.26953125, 0.39453125) - - border.BottomRightCorner:SetSize(32, 32) - border.BottomRightCorner:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetal") - border.BottomRightCorner:SetTexCoord(0.015625, 0.515625, 0.40234375, 0.52734375) - - border.LeftEdge:SetSize(32, 32) - border.LeftEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetalVertical", false, true) - border.LeftEdge:SetTexCoord(0.0078125, 0.2578125, 0, 1) - - border.RightEdge:SetSize(32, 32) - border.RightEdge:SetTexture("Interface\\FrameGeneral\\UIFrameDiamondMetalVertical", false, true) - border.RightEdge:SetTexCoord(0.2734375, 0.5234375, 0, 1) - - local header = f:CreateTexture(nil, 'ARTWORK') - header:SetTexture('Interface\\DialogFrame\\UI-DialogBox-Header') - header:SetWidth(256); header:SetHeight(64) + local header = CreateFrame('Frame', nil, f, 'DialogHeaderTemplate') + header:SetWidth(150) header:SetPoint('TOP', 0, 12) - local title = f:CreateFontString(nil, 'ARTWORK') + local title = header:CreateFontString('ARTWORK') title:SetFontObject('GameFontNormal') - title:SetPoint('TOP', header, 'TOP', 0, -14) + title:SetPoint('TOP', 0, -14) title:SetText(L.BindingMode) local desc = f:CreateFontString(nil, 'ARTWORK') diff --git a/RazerNaga/menuBar.lua b/RazerNaga/menuBar.lua index 17fb860..8c076d5 100644 --- a/RazerNaga/menuBar.lua +++ b/RazerNaga/menuBar.lua @@ -42,265 +42,6 @@ function MenuBar:SkinButton(button) button:SetSize(28, 36) - local buttons = { - {button = CharacterMicroButton, name = "Character"}, - {button = ProfessionMicroButton, name = "Spellbook"}, - {button = PlayerSpellsMicroButton, name = "Talents"}, - {button = AchievementMicroButton, name = "Achievement"}, - {button = QuestLogMicroButton, name = "Quest"}, - {button = GuildMicroButton, name = "Socials"}, - {button = LFDMicroButton, name = "LFG"}, - {button = CollectionsMicroButton, name = "Mounts"}, - {button = EJMicroButton, name = "EJ"}, - {button = StoreMicroButton, name = "BStore"}, - {button = MainMenuMicroButton, name = "MainMenu"} - } - - local function replaceAtlases(self, name) - local prefix = "hud-microbutton-"; - self:SetNormalAtlas(prefix..name.."-Up", true) - self:SetPushedAtlas(prefix..name.."-Down", true) - if self:GetDisabledTexture() then - self:SetDisabledAtlas(prefix..name.."-Disabled", true) - end - end - - local function replaceAllAtlases() - for _, data in pairs(buttons) do - replaceAtlases(data.button, data.name) - end - end - replaceAllAtlases() - - button:HookScript("OnUpdate", function(self) - local normalTexture = self:GetNormalTexture() - if (normalTexture) then - normalTexture:SetAlpha(1) - end - local highlightTexture = self:GetHighlightTexture() - if (highlightTexture) then - highlightTexture:SetAlpha(1) - end - if self.Background then - self.Background:Hide() - end - if self.PushedBackground then - self.PushedBackground:Hide() - end - if self.Shadow then - self.Shadow:Hide() - end - if self.PushedShadow then - self.PushedShadow:Hide() - end - if self.FlashBorder then - self.FlashBorder:SetAtlas("hud-microbutton-highlightalert", true) - self.FlashBorder:ClearAllPoints() - self.FlashBorder:SetPoint("TOPLEFT", -2, 2) - end - if self.FlashContent then - UIFrameFlashStop(self.FlashContent) - end - if self.Emblem then - self.Emblem:Hide() - end - if self.HighlightEmblem then - self.HighlightEmblem:Hide() - end - self:SetHighlightAtlas("hud-microbutton-highlight") - end) - - if not MicroButtonPortrait then - local portrait = CharacterMicroButton:CreateTexture("MicroButtonPortrait", "OVERLAY") - portrait:SetSize(16, 22) - portrait:SetPoint("TOP", 0, -8) - portrait:SetTexCoord(0.2, 0.8, 0.0666, 0.9) - end - - CharacterMicroButton:HookScript("OnEvent", function(self, event, ...) - if ( event == "UNIT_PORTRAIT_UPDATE" ) then - local unit = ...; - if ( unit == "player" ) then - SetPortraitTexture(MicroButtonPortrait, "player") - end - elseif ( event == "PORTRAITS_UPDATED" ) then - SetPortraitTexture(MicroButtonPortrait, "player") - elseif ( event == "PLAYER_ENTERING_WORLD" ) then - SetPortraitTexture(MicroButtonPortrait, "player") - end - end) - - local function CharacterMicroButton_SetPushed() - MicroButtonPortrait:SetTexCoord(0.2666, 0.8666, 0, 0.8333) - MicroButtonPortrait:SetAlpha(0.5) - end - - local function CharacterMicroButton_SetNormal() - MicroButtonPortrait:SetTexCoord(0.2, 0.8, 0.0666, 0.9) - MicroButtonPortrait:SetAlpha(1.0) - end - - CharacterMicroButton:HookScript("OnMouseDown", function(self) - if ( not KeybindFrames_InQuickKeybindMode() and self:IsEnabled() ) then - MicroButtonPortrait:SetTexCoord(0.2666, 0.8666, 0, 0.8333) - MicroButtonPortrait:SetAlpha(0.5) - end - end) - - CharacterMicroButton:HookScript("OnMouseUp", function(self) - if ( not KeybindFrames_InQuickKeybindMode() and self:IsEnabled() ) then - MicroButtonPortrait:SetTexCoord(0.2, 0.8, 0.0666, 0.9) - MicroButtonPortrait:SetAlpha(1.0) - end - end) - - if not MainMenuBarDownload then - MainMenuBarDownload = MainMenuMicroButton:CreateTexture("MainMenuBarDownload", "OVERLAY") - MainMenuBarDownload:SetSize(28, 28) - MainMenuBarDownload:SetPoint("BOTTOM", MainMenuMicroButton, "BOTTOM", 0, -7) - end - - MainMenuMicroButton:HookScript("OnUpdate", function(self, elapsed) - local status = GetFileStreamingStatus(); - if ( status == 0 ) then - MainMenuBarDownload:Hide() - self:SetNormalAtlas("hud-microbutton-MainMenu-Up", true) - self:SetPushedAtlas("hud-microbutton-MainMenu-Down", true) - self:SetDisabledAtlas("hud-microbutton-MainMenu-Disabled", true) - else - self:SetNormalTexture("Interface\\Buttons\\UI-MicroButtonStreamDL-Up") - self:SetPushedTexture("Interface\\Buttons\\UI-MicroButtonStreamDL-Down") - self:SetDisabledTexture("Interface\\Buttons\\UI-MicroButtonStreamDL-Up") - if ( status == 1 ) then - MainMenuBarDownload:SetTexture("Interface\\BUTTONS\\UI-MicroStream-Green") - elseif ( status == 2 ) then - MainMenuBarDownload:SetTexture("Interface\\BUTTONS\\UI-MicroStream-Yellow") - elseif ( status == 3 ) then - MainMenuBarDownload:SetTexture("Interface\\BUTTONS\\UI-MicroStream-Red") - end - MainMenuBarDownload:Show() - end - end) - - if not GuildMicroButtonTabard then - local GuildMicroButtonTabard = CreateFrame("Frame", "GuildMicroButtonTabard", GuildMicroButton) - GuildMicroButtonTabard:SetSize(28, 36) - GuildMicroButtonTabard:SetPoint("TOPLEFT") - GuildMicroButtonTabard:Hide() - end - - if not GuildMicroButtonTabardBackground then - GuildMicroButtonTabard.background = GuildMicroButtonTabard:CreateTexture("GuildMicroButtonTabardBackground", "ARTWORK") - GuildMicroButtonTabardBackground:SetAtlas("hud-microbutton-Guild-Banner", true) - GuildMicroButtonTabardBackground:SetPoint("CENTER", 0, 0) - end - - if not GuildMicroButtonTabardEmblem then - GuildMicroButtonTabard.emblem = GuildMicroButtonTabard:CreateTexture("GuildMicroButtonTabardEmblem", "OVERLAY") - GuildMicroButtonTabardEmblem:SetSize(14, 14) - GuildMicroButtonTabardEmblem:SetTexture("Interface\\GuildFrame\\GuildEmblems_01") - GuildMicroButtonTabardEmblem:SetPoint("CENTER", 0, 0) - end - - GuildMicroButton:HookScript("OnMouseDown", function(self) - if self:IsEnabled() then - GuildMicroButtonTabard:SetPoint("TOPLEFT", -1, -1) - GuildMicroButtonTabard:SetAlpha(0.5) - end - end) - - GuildMicroButton:HookScript("OnMouseUp", function(self) - if self:IsEnabled() then - GuildMicroButtonTabard:SetPoint("TOPLEFT", 0, 0) - GuildMicroButtonTabard:SetAlpha(1.0) - end - end) - - hooksecurefunc(GuildMicroButton, "UpdateNotificationIcon", function(self) - self.NotificationOverlay:Hide() - end) - - hooksecurefunc(GuildMicroButton, "UpdateTabard", function() - local tabard = GuildMicroButtonTabard; - if ( not tabard.needsUpdate ) then - return; - end - -- switch textures if the guild has a custom tabard - local emblemFilename = select(10, GetGuildLogoInfo()) - if ( emblemFilename ) then - if ( not tabard:IsShown() ) then - local button = GuildMicroButton; - button:SetNormalAtlas("hud-microbutton-Character-Up", true) - button:SetPushedAtlas("hud-microbutton-Character-Down", true) - button:SetDisabledAtlas("hud-microbutton-Character-Up", true) - tabard:Show() - end - SetSmallGuildTabardTextures("player", tabard.emblem, tabard.background) - else - if ( tabard:IsShown() ) then - local button = GuildMicroButton; - button:SetNormalAtlas("hud-microbutton-Socials-Up", true) - button:SetPushedAtlas("hud-microbutton-Socials-Down", true) - button:SetDisabledAtlas("hud-microbutton-Socials-Disabled", true) - tabard:Hide() - end - end - tabard.needsUpdate = nil; - end) - - GuildMicroButton:HookScript("OnEvent", function(self, event, ...) - if ( event == "PLAYER_ENTERING_WORLD" or event == "PLAYER_GUILD_UPDATE" or event == "NEUTRAL_FACTION_SELECT_RESULT" ) then - GuildMicroButtonTabard.needsUpdate = true; - end - end) - - hooksecurefunc("UpdateMicroButtons", function() - if AchievementMicroButton:IsEnabled() then - AchievementMicroButton.tooltipText = MicroButtonTooltipText(ACHIEVEMENT_BUTTON, "TOGGLEACHIEVEMENT"); - end - if CharacterMicroButton.Portrait then - CharacterMicroButton.Portrait:Hide() - end - if CharacterMicroButton.PortraitMask then - CharacterMicroButton.PortraitMask:Hide() - end - if ( CharacterFrame and CharacterFrame:IsShown() ) then - CharacterMicroButton_SetPushed() - else - CharacterMicroButton_SetNormal() - end - if not CharacterMicroButton:IsEnabled() then - SetDesaturation(MicroButtonPortrait, true) - else - SetDesaturation(MicroButtonPortrait, false) - end - GuildMicroButton:GetNormalTexture():SetVertexColor(1, 1, 1) - GuildMicroButton:GetPushedTexture():SetVertexColor(1, 1, 1) - GuildMicroButton:GetDisabledTexture():SetVertexColor(1, 1, 1) - GuildMicroButton:GetHighlightTexture():SetVertexColor(1, 1, 1) - if ( CommunitiesFrame and CommunitiesFrame:IsShown() ) or ( GuildFrame and GuildFrame:IsShown() ) then - GuildMicroButtonTabard:SetPoint("TOPLEFT", -1, -1) - GuildMicroButtonTabard:SetAlpha(0.70) - else - GuildMicroButtonTabard:SetPoint("TOPLEFT", 0, 0) - GuildMicroButtonTabard:SetAlpha(1) - end - end) - - hooksecurefunc("LoadMicroButtonTextures", function() - local button = GuildMicroButton - local emblemFilename = select(10, GetGuildLogoInfo()) - if ( emblemFilename ) then - button:SetNormalAtlas("hud-microbutton-Character-Up", true) - button:SetPushedAtlas("hud-microbutton-Character-Down", true) - button:SetDisabledAtlas("hud-microbutton-Character-Up", true) - else - button:SetNormalAtlas("hud-microbutton-Socials-Up", true) - button:SetPushedAtlas("hud-microbutton-Socials-Down", true) - button:SetDisabledAtlas("hud-microbutton-Socials-Disabled", true) - end - end) - hooksecurefunc("HelpOpenWebTicketButton_OnUpdate", function(self) self:SetParent(MainMenuMicroButton) self:ClearAllPoints() @@ -642,7 +383,7 @@ function MenuBarModule:OnInitialize() if perf then perf:SetSize(28, 58) perf:ClearAllPoints() - perf:SetPoint('BOTTOM') + perf:SetPoint("BOTTOM", 0, -2) end -- temp fix for 10.2.6 bug diff --git a/RazerNaga/petBar.lua b/RazerNaga/petBar.lua index 0b84b30..8ef249b 100644 --- a/RazerNaga/petBar.lua +++ b/RazerNaga/petBar.lua @@ -12,48 +12,6 @@ local function getPetButton(id) return _G[('PetActionButton%d'):format(id)] end -local function skinPetButton(self) - _G[self:GetName() .. 'Icon']:SetTexCoord(0.06, 0.94, 0.06, 0.94) - self.IconMask:SetSize(64, 64) - self.SlotBackground:Hide() - self.PushedTexture:SetTexture([[Interface\Buttons\UI-Quickslot-Depress]]) - self.PushedTexture:ClearAllPoints() - self.PushedTexture:SetAllPoints() - self.HighlightTexture:SetTexture([[Interface\Buttons\ButtonHilight-Square]]) - self.HighlightTexture:ClearAllPoints() - self.HighlightTexture:SetAllPoints() - self.HighlightTexture:SetBlendMode("ADD") - self.CheckedTexture:SetTexture([[Interface\Buttons\CheckButtonHilight]]) - self.CheckedTexture:ClearAllPoints() - self.CheckedTexture:SetAllPoints() - self.CheckedTexture:SetBlendMode("ADD") - self.Flash:SetTexture([[Interface\Buttons\UI-QuickslotRed]]) - self.Flash:ClearAllPoints() - self.Flash:SetAllPoints() - if self.IconMask then - self.IconMask:Hide() - end - - --simulate old floatingbg - hooksecurefunc(PetActionBar, 'Update', function() - local petActionID = self:GetID() - local texture = GetPetActionInfo(petActionID); - if ( texture ) then - self.NormalTexture:SetTexture([[Interface\Buttons\UI-Quickslot2]]) - self.NormalTexture:SetSize(54, 54) - self.NormalTexture:ClearAllPoints() - self.NormalTexture:SetPoint("CENTER", 0, -1) - self.NormalTexture:SetVertexColor(1, 1, 1, 0.5) - else - self.NormalTexture:SetTexture([[Interface\Buttons\UI-Quickslot]]) - self.NormalTexture:SetSize(54, 54) - self.NormalTexture:ClearAllPoints() - self.NormalTexture:SetPoint("CENTER", 0, -1) - self.NormalTexture:SetVertexColor(1, 1, 1, 0.5) - end - end) -end - for id = 1, NUM_PET_ACTION_SLOTS do local button = getPetButton(id) @@ -64,14 +22,6 @@ for id = 1, NUM_PET_ACTION_SLOTS do -- apply hooks for quick binding RazerNaga.BindableButton:AddQuickBindingSupport(button) - -- disable new texture loading - if button.UpdateButtonArt then - button.UpdateButtonArt = function() end - end - - -- apply pre 10.x button skin - skinPetButton(button) - -- enable cooldown bling button.cooldown:SetDrawBling(true) end diff --git a/RazerNaga/settingsLoader.lua b/RazerNaga/settingsLoader.lua index 23cf02e..28ffa8f 100644 --- a/RazerNaga/settingsLoader.lua +++ b/RazerNaga/settingsLoader.lua @@ -253,6 +253,7 @@ function SettingsLoader:GetThreeByFour() ['anchor'] = false, ['hidden'] = false, ['point'] = 'BOTTOM', + ['spacing'] = 1, ['x'] = 0, ['y'] = 0 }, @@ -285,7 +286,6 @@ function SettingsLoader:GetThreeByFour() ['hidden'] = false, ['numButtons'] = 6, ['point'] = 'BOTTOM', - ['spacing'] = 2, ['x'] = 250, ['y'] = 0 }, diff --git a/RazerNaga/spellFlyout.lua b/RazerNaga/spellFlyout.lua index 6e91104..053f82b 100644 --- a/RazerNaga/spellFlyout.lua +++ b/RazerNaga/spellFlyout.lua @@ -139,6 +139,7 @@ local SpellFlyoutFrameMixin = {} -- methods we're importing from the stock UI SpellFlyoutFrameMixin.SetBorderColor = SpellFlyout_SetBorderColor +SpellFlyoutFrameMixin.SetBorderSize = SpellFlyout_SetBorderSize -- secure methods local SpellFlyoutFrame_Toggle = [[ @@ -257,25 +258,21 @@ function SpellFlyoutFrameMixin:Initialize() self.Background = CreateFrame('Frame', nil, self) self.Background:SetAllPoints() - self.Background.Start = self.Background:CreateTexture(nil, 'BACKGROUND') - self.Background.Start:Hide() - - self.Background.End = self:CreateTexture(nil, "BACKGROUND") - self.Background.End:SetTexture("Interface\\Buttons\\ActionBarFlyoutButton") - self.Background.End:SetSize(37,22) - self.Background.End:SetTexCoord(0.01562500,0.59375000,0.74218750,0.91406250) + self.Background.End = self.Background:CreateTexture(nil, 'BACKGROUND') + self.Background.End:SetAtlas('UI-HUD-ActionBar-IconFrame-FlyoutButton', true) - self.Background.HorizontalMiddle = self:CreateTexture(nil, "BACKGROUND") - self.Background.HorizontalMiddle:SetTexture("Interface\\Buttons\\ActionBarFlyoutButton-FlyoutMidLeft") + self.Background.HorizontalMiddle = self.Background:CreateTexture(nil, 'BACKGROUND') + self.Background.HorizontalMiddle:SetAtlas('_UI-HUD-ActionBar-IconFrame-FlyoutMidLeft', true) self.Background.HorizontalMiddle:SetHorizTile(true) - self.Background.HorizontalMiddle:SetSize(32,37) - self.Background.HorizontalMiddle:SetTexCoord(0,1,0,0.578125) + self.Background.HorizontalMiddle:Hide() - self.Background.VerticalMiddle = self:CreateTexture(nil, "BACKGROUND") - self.Background.VerticalMiddle:SetTexture("Interface\\Buttons\\ActionBarFlyoutButton-FlyoutMid") + self.Background.VerticalMiddle = self.Background:CreateTexture(nil, 'BACKGROUND') + self.Background.VerticalMiddle:SetAtlas('!UI-HUD-ActionBar-IconFrame-FlyoutMid', true) self.Background.VerticalMiddle:SetVertTile(true) - self.Background.VerticalMiddle:SetSize(37,32) - self.Background.VerticalMiddle:SetTexCoord(0,0.578125,0,1) + self.Background.VerticalMiddle:Hide() + + self.Background.Start = self.Background:CreateTexture(nil, 'BACKGROUND') + self.Background.Start:SetAtlas('UI-HUD-ActionBar-IconFrame-FlyoutBottom', true) local command = [[ FLYOUT_INFO = newtable() @@ -296,34 +293,47 @@ end function SpellFlyoutFrameMixin:LayoutTextures(direction, distance) self.direction = direction self.Background.End:ClearAllPoints() + self.Background.Start:ClearAllPoints() - if (direction == "UP") then - self.Background.End:SetPoint("TOP") + if direction == "UP" then + self.Background.End:SetPoint("TOP", 0, SPELLFLYOUT_INITIAL_SPACING) SetClampedTextureRotation(self.Background.End, 0) + SetClampedTextureRotation(self.Background.VerticalMiddle, 0) + self.Background.Start:SetPoint("TOP", self.Background.VerticalMiddle, "BOTTOM") + SetClampedTextureRotation(self.Background.Start, 0) self.Background.HorizontalMiddle:Hide() self.Background.VerticalMiddle:Show() self.Background.VerticalMiddle:ClearAllPoints() self.Background.VerticalMiddle:SetPoint("TOP", self.Background.End, "BOTTOM") self.Background.VerticalMiddle:SetPoint("BOTTOM", 0, distance) - elseif (direction == "DOWN") then - self.Background.End:SetPoint("BOTTOM") + elseif direction == "DOWN" then + self.Background.End:SetPoint("BOTTOM", 0, -SPELLFLYOUT_INITIAL_SPACING) SetClampedTextureRotation(self.Background.End, 180) + SetClampedTextureRotation(self.Background.VerticalMiddle, 180) + self.Background.Start:SetPoint("BOTTOM", self.Background.VerticalMiddle, "TOP") + SetClampedTextureRotation(self.Background.Start, 180) self.Background.HorizontalMiddle:Hide() self.Background.VerticalMiddle:Show() self.Background.VerticalMiddle:ClearAllPoints() self.Background.VerticalMiddle:SetPoint("BOTTOM", self.Background.End, "TOP") self.Background.VerticalMiddle:SetPoint("TOP", 0, -distance) - elseif (direction == "LEFT") then - self.Background.End:SetPoint("LEFT") + elseif direction == "LEFT" then + self.Background.End:SetPoint("LEFT", -SPELLFLYOUT_INITIAL_SPACING, 0) SetClampedTextureRotation(self.Background.End, 270) + SetClampedTextureRotation(self.Background.HorizontalMiddle, 180) + self.Background.Start:SetPoint("LEFT", self.Background.HorizontalMiddle, "RIGHT") + SetClampedTextureRotation(self.Background.Start, 270) self.Background.VerticalMiddle:Hide() self.Background.HorizontalMiddle:Show() self.Background.HorizontalMiddle:ClearAllPoints() self.Background.HorizontalMiddle:SetPoint("LEFT", self.Background.End, "RIGHT") self.Background.HorizontalMiddle:SetPoint("RIGHT", -distance, 0) - elseif (direction == "RIGHT") then - self.Background.End:SetPoint("RIGHT") + elseif direction == "RIGHT" then + self.Background.End:SetPoint("RIGHT", SPELLFLYOUT_INITIAL_SPACING, 0) SetClampedTextureRotation(self.Background.End, 90) + SetClampedTextureRotation(self.Background.HorizontalMiddle, 0) + self.Background.Start:SetPoint("RIGHT", self.Background.HorizontalMiddle, "LEFT") + SetClampedTextureRotation(self.Background.Start, 90) self.Background.VerticalMiddle:Hide() self.Background.HorizontalMiddle:Show() self.Background.HorizontalMiddle:ClearAllPoints() @@ -332,6 +342,7 @@ function SpellFlyoutFrameMixin:LayoutTextures(direction, distance) end self:SetBorderColor(0.7, 0.7, 0.7) + self:SetBorderSize(43) end function SpellFlyoutFrameMixin:UpdateKnownFlyouts() @@ -445,27 +456,6 @@ function SpellFlyoutFrameMixin:CreateFlyoutButton(id) local name = ('%sSpellFlyoutButton%d'):format("RazerNaga", id) local button = CreateFrame('CheckButton', name, self, 'SmallActionButtonTemplate, SecureActionButtonTemplate') - button:SetSize(28, 28) - button.cooldown:SetDrawBling(true) - _G[button:GetName().."Icon"]:SetTexCoord(4/64, 60/64, 4/64, 60/64) - button.NormalTexture:SetAlpha(0) - button.CheckedTexture:SetTexture([[Interface\Buttons\CheckButtonHilight]]) - button.CheckedTexture:ClearAllPoints() - button.CheckedTexture:SetPoint("TOPLEFT") - button.CheckedTexture:SetPoint("BOTTOMRIGHT") - button.CheckedTexture:SetBlendMode("ADD") - button.HighlightTexture:SetTexture([[Interface\Buttons\ButtonHilight-Square]]) - button.HighlightTexture:ClearAllPoints() - button.HighlightTexture:SetPoint("TOPLEFT") - button.HighlightTexture:SetPoint("BOTTOMRIGHT") - button.HighlightTexture:SetBlendMode("ADD") - button.PushedTexture:SetTexture([[Interface\Buttons\UI-Quickslot-Depress]]) - button.PushedTexture:ClearAllPoints() - button.PushedTexture:SetPoint("TOPLEFT") - button.PushedTexture:SetPoint("BOTTOMRIGHT") - button.cooldown:ClearAllPoints() - button.cooldown:SetAllPoints() - Mixin(button, SpellFlyoutButtonMixin) button:Initialize() diff --git a/RazerNaga/stanceBar.lua b/RazerNaga/stanceBar.lua index d6bf31a..690e549 100644 --- a/RazerNaga/stanceBar.lua +++ b/RazerNaga/stanceBar.lua @@ -24,28 +24,6 @@ local function getStanceButton(id) return _G[('StanceButton%d'):format(id)] end -local function skinStanceButton(self) - _G[self:GetName() .. 'Icon']:SetTexCoord(0.06, 0.94, 0.06, 0.94) - self.NormalTexture:SetTexture([[Interface\Buttons\UI-Quickslot2]]) - self.NormalTexture:SetSize(54, 54) - self.NormalTexture:ClearAllPoints() - self.NormalTexture:SetPoint("CENTER", 0, -1) - self.NormalTexture:SetVertexColor(1, 1, 1, 0.5) - self.PushedTexture:SetTexture([[Interface\Buttons\UI-Quickslot-Depress]]) - self.PushedTexture:SetSize(30, 30) - self.HighlightTexture:SetTexture([[Interface\Buttons\ButtonHilight-Square]]) - self.HighlightTexture:SetSize(30, 30) - self.HighlightTexture:SetBlendMode("ADD") - self.CheckedTexture:SetTexture([[Interface\Buttons\CheckButtonHilight]]) - self.CheckedTexture:ClearAllPoints() - self.CheckedTexture:SetPoint("TOPLEFT", self.icon, "TOPLEFT") - self.CheckedTexture:SetPoint("BOTTOMRIGHT", self.icon, "BOTTOMRIGHT") - self.CheckedTexture:SetBlendMode("ADD") - if self.IconMask then - self.IconMask:Hide() - end -end - for id = 1, 10 do local button = getStanceButton(id) @@ -56,14 +34,6 @@ for id = 1, 10 do -- apply hooks for quick binding RazerNaga.BindableButton:AddQuickBindingSupport(button) - -- disable new texture loading - if button.UpdateButtonArt then - button.UpdateButtonArt = function() end - end - - -- apply pre 10.x button skin - skinStanceButton(button) - -- enable cooldown bling button.cooldown:SetDrawBling(true) end diff --git a/RazerNaga_Cast/CastingBarFrame.lua b/RazerNaga_Cast/CastingBarFrame.lua deleted file mode 100644 index bc4ceab..0000000 --- a/RazerNaga_Cast/CastingBarFrame.lua +++ /dev/null @@ -1,249 +0,0 @@ -local CASTING_BAR_ALPHA_STEP = 0.05 -local CASTING_BAR_FLASH_STEP = 0.2 -local CASTING_BAR_HOLD_TIME = 1 - -function CastingBarFrame_OnLoad(self, unit, showTradeSkills) - self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED") - self:RegisterEvent("UNIT_SPELLCAST_DELAYED") - self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START") - self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE") - self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP") - self:RegisterEvent("PLAYER_ENTERING_WORLD") - self:RegisterUnitEvent("UNIT_SPELLCAST_START", unit) - self:RegisterUnitEvent("UNIT_SPELLCAST_STOP", unit) - self:RegisterUnitEvent("UNIT_SPELLCAST_FAILED", unit) - - self.unit = unit - self.showTradeSkills = showTradeSkills - self.casting = nil - self.channeling = nil - self.holdTime = 0 - self.showCastbar = true -end - -function CastingBarFrame_OnEvent(self, event, ...) - local arg1 = ... - - local unit = self.unit - if ( event == "PLAYER_ENTERING_WORLD" ) then - local nameChannel = UnitChannelInfo(unit) - local nameSpell = UnitCastingInfo(unit) - if ( nameChannel ) then - event = "UNIT_SPELLCAST_CHANNEL_START" - arg1 = unit - elseif ( nameSpell ) then - event = "UNIT_SPELLCAST_START" - arg1 = unit - else - CastingBarFrame_FinishSpell(self) - end - end - - if ( arg1 ~= unit ) then - return - end - - if ( event == "UNIT_SPELLCAST_START" ) then - local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(unit) - if ( not name or (not self.showTradeSkills and isTradeSkill)) then - self:Hide() - return - end - self:SetStatusBarColor(1.0, 0.7, 0.0) - self.Flash:SetVertexColor(1.0, 0.7, 0.0) - if ( self.Spark ) then - self.Spark:Show() - end - self.value = (GetTime() - (startTime / 1000)) - self.maxValue = (endTime - startTime) / 1000 - self:SetMinMaxValues(0, self.maxValue) - self:SetValue(self.value) - if ( self.Text ) then - self.Text:SetText(text) - end - self:SetAlpha(1.0) - self.holdTime = 0 - self.casting = true - self.castID = castID - self.channeling = nil - self.fadeOut = nil - if ( self.showCastbar ) then - self:Show() - end - elseif ( event == "UNIT_SPELLCAST_STOP" or event == "UNIT_SPELLCAST_CHANNEL_STOP") then - if ( not self:IsVisible() ) then - self:Hide() - end - if ( (self.casting and event == "UNIT_SPELLCAST_STOP" and select(2, ...) == self.castID) or - (self.channeling and event == "UNIT_SPELLCAST_CHANNEL_STOP") ) then - if ( self.Spark ) then - self.Spark:Hide() - end - if ( self.Flash ) then - self.Flash:SetAlpha(0.0) - self.Flash:Show() - end - self:SetValue(self.maxValue) - if ( event == "UNIT_SPELLCAST_STOP" ) then - self.casting = nil - else - self.channeling = nil - end - self.flash = true - self.fadeOut = true - self.holdTime = 0 - end - elseif ( event == "UNIT_SPELLCAST_FAILED" or event == "UNIT_SPELLCAST_INTERRUPTED" ) then - if ( self:IsShown() and - (self.casting and select(2, ...) == self.castID) and not self.fadeOut ) then - self:SetValue(self.maxValue) - self:SetStatusBarColor(0.86, 0.08, 0.24) - if ( self.Spark ) then - self.Spark:Hide() - end - if ( self.Text ) then - if ( event == "UNIT_SPELLCAST_FAILED" ) then - self.Text:SetText(FAILED) - else - self.Text:SetText(INTERRUPTED) - end - end - self.casting = nil - self.channeling = nil - self.fadeOut = true - self.holdTime = GetTime() + CASTING_BAR_HOLD_TIME - end - elseif ( event == "UNIT_SPELLCAST_DELAYED" ) then - if ( self:IsShown() ) then - local name, text, texture, startTime, endTime, isTradeSkill, castID, notInterruptible = UnitCastingInfo(unit) - if ( not name or (not self.showTradeSkills and isTradeSkill)) then - self:Hide() - return - end - self.value = (GetTime() - (startTime / 1000)) - self.maxValue = (endTime - startTime) / 1000 - self:SetMinMaxValues(0, self.maxValue) - if ( not self.casting ) then - self:SetStatusBarColor(1.0, 0.7, 0.0) - if ( self.Spark ) then - self.Spark:Show() - end - if ( self.Flash ) then - self.Flash:SetAlpha(0.0) - self.Flash:Hide() - end - self.casting = true - self.channeling = nil - self.flash = nil - self.fadeOut = nil - end - end - elseif ( event == "UNIT_SPELLCAST_CHANNEL_START" ) then - local name, text, texture, startTime, endTime, isTradeSkill, notInterruptible, spellID, _, numStages = UnitChannelInfo(unit) - if ( not name or (not self.showTradeSkills and isTradeSkill)) then - self:Hide() - return - end - self:SetStatusBarColor(0.0, 1.0, 0.0) - self.Flash:SetVertexColor(0.0, 1.0, 0.0) - self.value = ((endTime / 1000) - GetTime()) - self.maxValue = (endTime - startTime) / 1000 - self:SetMinMaxValues(0, self.maxValue) - self:SetValue(self.value) - if ( self.Text ) then - self.Text:SetText(text) - end - if ( self.Spark ) then - self.Spark:Hide() - end - self:SetAlpha(1.0) - self.holdTime = 0 - self.casting = nil - self.channeling = true - self.fadeOut = nil - if ( self.showCastbar ) then - self:Show() - end - elseif ( event == "UNIT_SPELLCAST_CHANNEL_UPDATE" ) then - if ( self:IsShown() ) then - local name, text, texture, startTime, endTime, isTradeSkill = UnitChannelInfo(unit) - if ( not name or (not self.showTradeSkills and isTradeSkill)) then - self:Hide() - return - end - self.value = ((endTime / 1000) - GetTime()) - self.maxValue = (endTime - startTime) / 1000 - self:SetMinMaxValues(0, self.maxValue) - self:SetValue(self.value) - end - end -end - -function CastingBarFrame_OnUpdate(self, elapsed) - if ( self.casting ) then - self.value = self.value + elapsed - if ( self.value >= self.maxValue ) then - self:SetValue(self.maxValue) - CastingBarFrame_FinishSpell(self) - return - end - self:SetValue(self.value) - if ( self.Flash ) then - self.Flash:Hide() - end - if ( self.Spark ) then - local sparkPosition = (self.value / self.maxValue) * self:GetWidth() - self.Spark:SetPoint("CENTER", self, "LEFT", sparkPosition, -4) - end - elseif ( self.channeling ) then - self.value = self.value - elapsed - if ( self.value <= 0 ) then - CastingBarFrame_FinishSpell(self) - return - end - self:SetValue(self.value) - if ( self.Flash ) then - self.Flash:Hide() - end - elseif ( GetTime() < self.holdTime ) then - return - elseif ( self.flash ) then - local alpha = 0 - if ( self.Flash ) then - alpha = self.Flash:GetAlpha() + CASTING_BAR_FLASH_STEP - end - if ( alpha < 1 ) then - if ( self.Flash ) then - self.Flash:SetAlpha(alpha) - end - else - if ( self.Flash ) then - self.Flash:SetAlpha(1.0) - end - self.flash = nil - end - elseif ( self.fadeOut ) then - local alpha = self:GetAlpha() - CASTING_BAR_ALPHA_STEP - if ( alpha > 0 ) then - self:SetAlpha(alpha) - else - self.fadeOut = nil - self:Hide() - end - end -end - -function CastingBarFrame_FinishSpell(self) - self:SetStatusBarColor(0.0, 1.0, 0.0) - if ( self.Spark ) then - self.Spark:Hide() - end - if ( self.Flash ) then - self.Flash:SetAlpha(0.0) - self.Flash:Show() - end - self.flash = true - self.fadeOut = true - self.casting = nil - self.channeling = nil -end \ No newline at end of file diff --git a/RazerNaga_Cast/RazerNaga_Cast.toc b/RazerNaga_Cast/RazerNaga_Cast.toc index ffef969..77ed549 100644 --- a/RazerNaga_Cast/RazerNaga_Cast.toc +++ b/RazerNaga_Cast/RazerNaga_Cast.toc @@ -4,5 +4,4 @@ ## Notes: A movable casting bar, with timer ## Author: Daenarys ## Dependencies: RazerNaga -localization.xml castBar.xml \ No newline at end of file diff --git a/RazerNaga_Cast/castBar.lua b/RazerNaga_Cast/castBar.lua index 99e89e5..ab48ab9 100644 --- a/RazerNaga_Cast/castBar.lua +++ b/RazerNaga_Cast/castBar.lua @@ -28,11 +28,8 @@ function CastBar:New() if not f.cast then f.cast = CastingBar:New(f) - f:SetWidth(240) - f:SetHeight(24) end - f:UpdateText() f:Layout() return f @@ -42,33 +39,14 @@ function CastBar:GetDefaults() return { point = 'CENTER', x = 0, - y = 30, - showText = true + y = 30 } end -function CastBar:ToggleText(enable) - self.sets.showText = enable or false - self:UpdateText() -end - -function CastBar:UpdateText() - if self.sets.showText then - self.cast.Time:Show() - else - self.cast.Time:Hide() - end - self.cast:AdjustWidth() -end - function CastBar:CreateMenu() local menu = RazerNaga:NewMenu(self.id) local panel = menu:NewPanel(LibStub('AceLocale-3.0'):GetLocale('RazerNaga-Config').Layout) - local time = panel:NewCheckButton(RazerNaga_SHOW_TIME) - time:SetScript('OnClick', function(b) self:ToggleText(b:GetChecked()) end) - time:SetScript('OnShow', function(b) b:SetChecked(self.sets.showText) end) - panel:NewOpacitySlider() panel:NewFadeSlider() panel:NewScaleSlider() @@ -88,45 +66,20 @@ end CastingBar = RazerNaga:CreateClass('StatusBar') -local BORDER_SCALE = 197/150 -local TEXT_PADDING = 18 - function CastingBar:New(parent) local f = self:Bind(CreateFrame('StatusBar', 'RazerNagaCastingBar', parent, 'RazerNagaCastingBarTemplate')) - f:SetPoint('CENTER') - - f.normalWidth = f:GetWidth() - f:SetScript('OnUpdate', f.OnUpdate) + f:SetPoint('CENTER', 0, 5) return f end -function CastingBar:OnUpdate(elapsed) - CastingBarFrame_OnUpdate(self, elapsed) +RazerNagaCastingBarMixin = {} - if self.casting then - self.Time:SetFormattedText('%.1f', self.maxValue - self.value) - self:AdjustWidth() - elseif self.channeling then - self.Time:SetFormattedText('%.1f', self.value) - self:AdjustWidth() - end -end - -function CastingBar:AdjustWidth() - local textWidth = self.Text:GetStringWidth() + TEXT_PADDING - local timeWidth = (self.Time:IsShown() and (self.Time:GetStringWidth() + 4) * 2) or 0 - local width = textWidth + timeWidth - - if width < self.normalWidth then - width = self.normalWidth - end - - local diff = math.abs(width - self:GetWidth()) - - if diff > TEXT_PADDING then - self:SetWidth(width) - self.Border:SetWidth(width * BORDER_SCALE) - self.Flash:SetWidth(width * BORDER_SCALE) - end +function RazerNagaCastingBarMixin:OnLoad() + local showTradeSkills = true + local showShieldNo = false + CastingBarMixin.OnLoad(self, "player", showTradeSkills, showShieldNo) + self.Icon:Hide() + self.Text:ClearAllPoints() + self.Text:SetPoint("TOP", 0, -9) end \ No newline at end of file diff --git a/RazerNaga_Cast/castBar.xml b/RazerNaga_Cast/castBar.xml index 539880a..74d1cdf 100644 --- a/RazerNaga_Cast/castBar.xml +++ b/RazerNaga_Cast/castBar.xml @@ -1,59 +1,13 @@ -