From 8ed23ca329185e41ca3aa92348e0f5717e8beae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20H=C3=BCskes?= Date: Sat, 3 Dec 2022 17:20:17 +0100 Subject: [PATCH] Update LibDBIcon --- Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua | 64 +++++++++++++++++----------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua b/Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua index 9c889de..32e7da3 100755 --- a/Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua +++ b/Libs/LibDBIcon-1.0/LibDBIcon-1.0.lua @@ -1,4 +1,4 @@ - +--@curseforge-project-slug: libdbicon-1-0@ ----------------------------------------------------------------------- -- LibDBIcon-1.0 -- @@ -6,7 +6,7 @@ -- local DBICON10 = "LibDBIcon-1.0" -local DBICON10_MINOR = 44 -- Bump on changes +local DBICON10_MINOR = 45 -- Bump on changes if not LibStub then error(DBICON10 .. " requires LibStub.") end local ldb = LibStub("LibDataBroker-1.1", true) if not ldb then error(DBICON10 .. " requires LibDataBroker-1.1.") end @@ -218,37 +218,49 @@ local function createButton(name, object, db) button.dataObject = object button.db = db button:SetFrameStrata("MEDIUM") - if button.SetFixedFrameStrata then -- Classic support - button:SetFixedFrameStrata(true) - end + button:SetFixedFrameStrata(true) button:SetFrameLevel(8) - if button.SetFixedFrameLevel then -- Classic support - button:SetFixedFrameLevel(true) - end + button:SetFixedFrameLevel(true) button:SetSize(31, 31) button:RegisterForClicks("anyUp") button:RegisterForDrag("LeftButton") button:SetHighlightTexture(136477) --"Interface\\Minimap\\UI-Minimap-ZoomButton-Highlight" - local overlay = button:CreateTexture(nil, "OVERLAY") - overlay:SetSize(53, 53) - overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder" - overlay:SetPoint("TOPLEFT") - local background = button:CreateTexture(nil, "BACKGROUND") - background:SetSize(20, 20) - background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background" - background:SetPoint("TOPLEFT", 7, -5) - local icon = button:CreateTexture(nil, "ARTWORK") - icon:SetSize(17, 17) - icon:SetTexture(object.icon) - icon:SetPoint("TOPLEFT", 7, -6) - button.icon = icon + if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then + local overlay = button:CreateTexture(nil, "OVERLAY") + overlay:SetSize(50, 50) + overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder" + overlay:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0) + local background = button:CreateTexture(nil, "BACKGROUND") + background:SetSize(24, 24) + background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background" + background:SetPoint("CENTER", button, "CENTER", 0, 1) + local icon = button:CreateTexture(nil, "ARTWORK") + icon:SetSize(18, 18) + icon:SetTexture(object.icon) + icon:SetPoint("CENTER", button, "CENTER", 0, 1) + button.icon = icon + else + local overlay = button:CreateTexture(nil, "OVERLAY") + overlay:SetSize(53, 53) + overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder" + overlay:SetPoint("TOPLEFT") + local background = button:CreateTexture(nil, "BACKGROUND") + background:SetSize(20, 20) + background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background" + background:SetPoint("TOPLEFT", 7, -5) + local icon = button:CreateTexture(nil, "ARTWORK") + icon:SetSize(17, 17) + icon:SetTexture(object.icon) + icon:SetPoint("TOPLEFT", 7, -6) + button.icon = icon + end + button.isMouseDown = false + local r, g, b = button.icon:GetVertexColor() + button.icon:SetVertexColor(object.iconR or r, object.iconG or g, object.iconB or b) - local r, g, b = icon:GetVertexColor() - icon:SetVertexColor(object.iconR or r, object.iconG or g, object.iconB or b) - - icon.UpdateCoord = updateCoord - icon:UpdateCoord() + button.icon.UpdateCoord = updateCoord + button.icon:UpdateCoord() button:SetScript("OnEnter", onEnter) button:SetScript("OnLeave", onLeave)