Skip to content

Commit

Permalink
v0.5.75
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Aug 3, 2024
1 parent fa0c698 commit 8368db2
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 57 deletions.
2 changes: 1 addition & 1 deletion DarkMode.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Interface-Cata: 40400
## Interface: 100207, 110000

## Version: 0.5.74
## Version: 0.5.75
## Title: DarkMode by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Cata.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 40400
## Version: 0.5.74
## Version: 0.5.75
## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_TBC.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 20504
## Version: 0.5.74
## Version: 0.5.75
## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 11503
## Version: 0.5.74
## Version: 0.5.75
## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion DarkMode_Wrath.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 30403
## Version: 0.5.74
## Version: 0.5.75
## Title: DarkMode |T136122:16:16:0:0|t by |cff3FC7EBD4KiR |T132115:16:16:0:0|t
## Notes: Improve Any Ui or Frame
## Author: D4KiR
Expand Down
2 changes: 1 addition & 1 deletion core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ function DarkMode:Event(event, ...)
["name"] = "DarkMode",
["icon"] = 136122,
["dbtab"] = DMTAB,
["vTT"] = {"DarkMode", DarkMode:Trans("MMBTNLEFT"), DarkMode:Trans("MMBTNRIGHT")},
["vTT"] = {{"DarkMode |T136122:16:16:0:0|t", "v|cff3FC7EB0.5.75"}, {DarkMode:Trans("LEFTCLICK"), DarkMode:Trans("MMBTNLEFT")}, {DarkMode:Trans("RIGHTCLICK"), DarkMode:Trans("MMBTNRIGHT")}},
["funcL"] = function()
DarkMode:ToggleSettings()
end,
Expand Down
39 changes: 38 additions & 1 deletion libs/D4Lib/D4MinimapButtons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function D4:CreateMinimapButton(tab)
OnTooltipShow = function(tooltip)
if not tooltip or not tooltip.AddLine then return end
for i, v in pairs(tab.vTT) do
tooltip:AddLine(v)
tooltip:AddDoubleLine(v[1], v[2])
end
end,
}
Expand All @@ -39,6 +39,43 @@ function D4:CreateMinimapButton(tab)
if mmbtn and D4:GetLibDBIcon() then
D4:GetLibDBIcon():Register(tab.name, mmbtn, tab.dbtab)
end

if AddonCompartmentFrame then
AddonCompartmentFrame:RegisterAddon(
{
text = tab.name,
icon = tab.icon,
registerForAnyClick = true,
notCheckable = true,
func = function(button, menuInputData, menu)
local btnName = menuInputData.buttonName
if btnName == "LeftButton" and IsShiftKeyDown() and tab.funcSL then
tab:funcSL()
elseif btnName == "RightButton" and IsShiftKeyDown() and tab.funcSR then
tab:funcSR()
elseif btnName == "LeftButton" and tab.funcL then
tab:funcL()
elseif btnName == "RightButton" and tab.funcR then
tab:funcR()
end
end,
funcOnEnter = function(button)
MenuUtil.ShowTooltip(
button,
function(tooltip)
if not tooltip or not tooltip.AddLine then return end
for i, v in pairs(tab.vTT) do
tooltip:AddDoubleLine(v[1], v[2])
end
end
)
end,
funcOnLeave = function(button)
MenuUtil.HideTooltip(button)
end,
}
)
end
end
end

Expand Down
22 changes: 15 additions & 7 deletions libs/D4Lib/LibDBIcon-1.0/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
------------------------------------------------------------------------
r137 | funkehdude | 2024-07-09 18:35:23 +0000 (Tue, 09 Jul 2024) | 1 line
r141 | funkehdude | 2024-08-02 17:28:35 +0000 (Fri, 02 Aug 2024) | 1 line
Changed paths:
M /trunk/LibDBIcon-1.0.toc
D /trunk/LibDBIcon-1.0_Cata.toc
D /trunk/LibDBIcon-1.0_TBC.toc
D /trunk/LibDBIcon-1.0_Vanilla.toc
D /trunk/LibDBIcon-1.0_Wrath.toc
M /trunk/LibDBIcon-1.0/LibDBIcon-1.0.lua

Merge toc files
Extra safety checks for the compartment
------------------------------------------------------------------------
r140 | funkehdude | 2024-07-24 21:45:35 +0000 (Wed, 24 Jul 2024) | 1 line
Changed paths:
M /trunk/LibDBIcon-1.0/LibDBIcon-1.0.lua

Update the compartment menu icon as needed
------------------------------------------------------------------------
r139 | funkehdude | 2024-07-24 21:09:05 +0000 (Wed, 24 Jul 2024) | 1 line
Changed paths:
M /trunk/LibDBIcon-1.0/LibDBIcon-1.0.lua

Compartment menu fixes for WoW 11
------------------------------------------------------------------------

2 changes: 1 addition & 1 deletion libs/D4Lib/LibDBIcon-1.0/LibDBIcon-1.0.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 11502, 11503, 20504, 30403, 40400, 100207, 110000, 110002
## Version: v10.2.3
## Version: v11.0.0
## LoadOnDemand: 1
## Title: Lib: DataBrokerIcon-1.0
## Notes: Allows addons to easily create a lightweight minimap icon as an alternative to heavier LDB displays.
Expand Down
77 changes: 45 additions & 32 deletions libs/D4Lib/LibDBIcon-1.0/LibDBIcon-1.0/LibDBIcon-1.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
--

local DBICON10 = "LibDBIcon-1.0"
local DBICON10_MINOR = 52 -- Bump on changes
local DBICON10_MINOR = 55 -- 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
Expand All @@ -25,6 +25,15 @@ function lib:IconCallback(event, name, key, value)
if lib.objects[name] then
if key == "icon" then
lib.objects[name].icon:SetTexture(value)
if lib:IsButtonInCompartment(name) and lib:IsButtonCompartmentAvailable() then
local addonList = AddonCompartmentFrame.registeredAddons
for i =1, #addonList do
if addonList[i].text == name then
addonList[i].icon = value
return
end
end
end
elseif key == "iconCoords" then
lib.objects[name].icon:UpdateCoord()
elseif key == "iconR" then
Expand Down Expand Up @@ -94,8 +103,8 @@ local function onLeave(self)
end
end

local function onEnterCompartment(self)
local buttonName = self.value
local function onEnterCompartment(self, menu)
local buttonName = menu.text
local object = lib.objects[buttonName]
if object and object.dataObject then
if object.dataObject.OnTooltipShow then
Expand All @@ -109,10 +118,10 @@ local function onEnterCompartment(self)
end
end

local function onLeaveCompartment(self)
local function onLeaveCompartment(self, menu)
lib.tooltip:Hide()

local buttonName = self.value
local buttonName = menu.text
local object = lib.objects[buttonName]
if object and object.dataObject then
if object.dataObject.OnLeave then
Expand Down Expand Up @@ -497,39 +506,43 @@ function lib:IsButtonInCompartment(buttonName)
end

function lib:AddButtonToCompartment(buttonName, customIcon)
local object = lib.objects[buttonName]
if object and not object.compartmentData and AddonCompartmentFrame then
if object.db then
object.db.showInCompartment = true
if lib:IsButtonCompartmentAvailable() then
local object = lib.objects[buttonName]
if object and not object.compartmentData then
if object.db then
object.db.showInCompartment = true
end
object.compartmentData = {
text = buttonName,
icon = customIcon or object.dataObject.icon,
notCheckable = true,
registerForAnyClick = true,
func = function(_, menuInputData, menu)
object.dataObject.OnClick(menu, menuInputData.buttonName)
end,
funcOnEnter = onEnterCompartment,
funcOnLeave = onLeaveCompartment,
}
AddonCompartmentFrame:RegisterAddon(object.compartmentData)
end
object.compartmentData = {
text = buttonName,
icon = customIcon or object.dataObject.icon,
notCheckable = true,
registerForAnyClick = true,
func = function(frame, _, _, _, clickType)
object.dataObject.OnClick(frame, clickType)
end,
funcOnEnter = onEnterCompartment,
funcOnLeave = onLeaveCompartment,
}
AddonCompartmentFrame:RegisterAddon(object.compartmentData)
end
end

function lib:RemoveButtonFromCompartment(buttonName)
local object = lib.objects[buttonName]
if object and object.compartmentData then
for i = 1, #AddonCompartmentFrame.registeredAddons do
local entry = AddonCompartmentFrame.registeredAddons[i]
if entry == object.compartmentData then
object.compartmentData = nil
if object.db then
object.db.showInCompartment = nil
if lib:IsButtonCompartmentAvailable() then
local object = lib.objects[buttonName]
if object and object.compartmentData then
for i = 1, #AddonCompartmentFrame.registeredAddons do
local entry = AddonCompartmentFrame.registeredAddons[i]
if entry == object.compartmentData then
object.compartmentData = nil
if object.db then
object.db.showInCompartment = nil
end
table.remove(AddonCompartmentFrame.registeredAddons, i)
AddonCompartmentFrame:UpdateDisplay()
return
end
table.remove(AddonCompartmentFrame.registeredAddons, i)
AddonCompartmentFrame:UpdateDisplay()
return
end
end
end
Expand Down
6 changes: 4 additions & 2 deletions locale/deDE.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
-- deDE German Deutsch
local _, DarkMode = ...
DarkMode:AddTrans("deDE", "MMBTNLEFT", "Linksklick => Optionen")
DarkMode:AddTrans("deDE", "MMBTNRIGHT", "Rechtsklick => Minimapknopf verstecken")
DarkMode:AddTrans("deDE", "LEFTCLICK", "Linksklick")
DarkMode:AddTrans("deDE", "RIGHTCLICK", "Rechtsklick")
DarkMode:AddTrans("deDE", "MMBTNLEFT", "Optionen")
DarkMode:AddTrans("deDE", "MMBTNRIGHT", "Minimapknopf verstecken")
DarkMode:AddTrans("deDE", "GENERAL", "Allgemein")
DarkMode:AddTrans("deDE", "MMBTN", "Minimapknopf anzeigen")
DarkMode:AddTrans("deDE", "COLORMODE", "Farbmodus Ui")
Expand Down
6 changes: 4 additions & 2 deletions locale/enUS.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
-- enUS English
local _, DarkMode = ...
DarkMode:AddTrans("enUS", "MMBTNLEFT", "Left Click => Options")
DarkMode:AddTrans("enUS", "MMBTNRIGHT", "Right Click => Hide Minimap Button")
DarkMode:AddTrans("enUS", "LEFTCLICK", "Leftclick")
DarkMode:AddTrans("enUS", "RIGHTCLICK", "Rightclick")
DarkMode:AddTrans("enUS", "MMBTNLEFT", "Options")
DarkMode:AddTrans("enUS", "MMBTNRIGHT", "Hide Minimap Button")
DarkMode:AddTrans("enUS", "GENERAL", "General")
DarkMode:AddTrans("enUS", "MMBTN", "Show Minimap Button")
DarkMode:AddTrans("enUS", "COLORMODE", "Color Mode Ui")
Expand Down
6 changes: 4 additions & 2 deletions locale/zhcn.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
-- zhCN
local _, DarkMode = ...
DarkMode:AddTrans("zhCN", "MMBTNLEFT", "左键点击 => 菜单选项")
DarkMode:AddTrans("zhCN", "MMBTNRIGHT", "右键点击 => 隐藏小地图按钮")
DarkMode:AddTrans("zhCN", "LEFTCLICK", "左键点击")
DarkMode:AddTrans("zhCN", "RIGHTCLICK", "右键点击")
DarkMode:AddTrans("zhCN", "MMBTNLEFT", "菜单选项")
DarkMode:AddTrans("zhCN", "MMBTNRIGHT", "隐藏小地图按钮")
DarkMode:AddTrans("zhCN", "GENERAL", "常规")
DarkMode:AddTrans("zhCN", "MMBTN", "显示小地图按钮")
DarkMode:AddTrans("zhCN", "COLORMODE", "界面染色")
Expand Down
6 changes: 4 additions & 2 deletions locale/zhtw.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
-- zhTW
local _, DarkMode = ...
DarkMode:AddTrans("zhTW", "MMBTNLEFT", "左鍵點擊 => 選項設定")
DarkMode:AddTrans("zhTW", "MMBTNRIGHT", "右鍵點擊 => 隱藏小地圖按鈕")
DarkMode:AddTrans("zhTW", "LEFTCLICK", "左鍵點擊")
DarkMode:AddTrans("zhTW", "RIGHTCLICK", "右鍵點擊")
DarkMode:AddTrans("zhTW", "MMBTNLEFT", "選項設定")
DarkMode:AddTrans("zhTW", "MMBTNRIGHT", "隱藏小地圖按鈕")
DarkMode:AddTrans("zhTW", "GENERAL", "一般")
DarkMode:AddTrans("zhTW", "MMBTN", "顯示小地圖按鈕")
DarkMode:AddTrans("zhTW", "COLORMODE", "介面著色")
Expand Down
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

DarkMode:SetVersion(AddonName, 136122, "0.5.74")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.74"))
DarkMode:SetVersion(AddonName, 136122, "0.5.75")
DMSettings.TitleText:SetText(format("DarkMode |T136122:16:16:0:0|t v|cff3FC7EB%s", "0.5.75"))
DMSettings.CloseButton:SetScript(
"OnClick",
function()
Expand Down

0 comments on commit 8368db2

Please sign in to comment.