Skip to content

Commit

Permalink
v0.5.51
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kir92 committed Jun 19, 2024
1 parent 19f5ffd commit 4faad3d
Show file tree
Hide file tree
Showing 16 changed files with 100 additions and 50 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.50
## Version: 0.5.51
## 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.50
## Version: 0.5.51
## 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.50
## Version: 0.5.51
## 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: 11502
## Version: 0.5.50
## Version: 0.5.51
## 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.50
## Version: 0.5.51
## 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
5 changes: 5 additions & 0 deletions libs/D4Lib/D4DB.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
function D4:GV(db, key, value)
if db == nil then
D4:msg("[D4:GV] db is nil", "db", tostring(db), "key", tostring(key), "value", tostring(value))
Expand Down
5 changes: 5 additions & 0 deletions libs/D4Lib/D4Frames.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
--[[ INPUTS ]]
function D4:AddCategory(tab)
tab.sw = tab.sw or 25
Expand Down
5 changes: 5 additions & 0 deletions libs/D4Lib/D4Grid.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
function D4:Grid(n, snap)
n = n or 0
snap = snap or 10
Expand Down
4 changes: 4 additions & 0 deletions libs/D4Lib/D4Lib.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
print("ONCE")
--[[ Basics ]]
local buildNr = select(4, GetBuildInfo())
local buildName = "CLASSIC"
Expand Down
4 changes: 4 additions & 0 deletions libs/D4Lib/D4Math.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
print("ONCE2")
function D4:MClamp(val, vmin, vmax)
if val < vmin then
return vmin
Expand Down
5 changes: 5 additions & 0 deletions libs/D4Lib/D4MinimapButtons.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
local icon = null
function D4:GetLibDBIcon()
if not D4:IsOldWow() then
Expand Down
5 changes: 5 additions & 0 deletions libs/D4Lib/D4Output.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
function D4:msg(...)
print("[D4] ", ...)
end
Expand Down
5 changes: 5 additions & 0 deletions libs/D4Lib/D4SlashCmds.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
local cmds = {}
function D4:AddSlash(name, func)
if name == nil then
Expand Down
5 changes: 5 additions & 0 deletions libs/D4Lib/D4Translations.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
local _, _ = ...
D4 = D4 or {}
D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
function D4:Trans(key, lang, t1, t2, t3)
D4.trans = D4.trans or {}
if lang == nil then
Expand Down
93 changes: 50 additions & 43 deletions libs/D4Lib/D4Versions.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
local AddonName, _ = ...
D4.VersionTab = D4.VersionTab or {}
D4 = D4 or {}
local pre = "D4PREFIX"
local f = CreateFrame("FRAME")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript(
"OnEvent",
function(sel, event, isInitialLogin, isReloadingUi)
C_Timer.After(
2,
function()
if D4.VersionTab[string.lower(AddonName)] then
local id = D4.VersionTab[string.lower(AddonName)].id or 0
C_Timer.After(
id * 0.1,
function()
local ver = D4:GetVersion(AddonName)
if ver == nil then
D4:MSG(AddonName, 0, "|cffff0000MISSING VERSION", AddonName)
end

if isInitialLogin and ver and pre and C_ChatInfo then
C_ChatInfo.SendAddonMessage(pre, string.format("A;%s;V;%s", AddonName, ver))
end
end
)
end
end
)
end
)

local r = CreateFrame("FRAME")
r:RegisterEvent("CHAT_MSG_ADDON")
r:SetScript(
"OnEvent",
function(sel, event, pref, msg, ...)
if pref == pre and msg then
local a, name, v, ver = string.split(";", msg)
if a and name and v and ver and a == "A" and v == "V" and AddonName == name and not D4:FoundHigher(name) then
D4:CheckVersion(name, ver)
end
end
end
)

D4.LibVersion = D4.LibVersion or 0
local D4LibVersion = 1.0
if D4.LibVersion >= D4LibVersion then return end
D4.VersionTab = D4.VersionTab or {}
if C_ChatInfo then
C_ChatInfo.RegisterAddonMessagePrefix(pre)
end
Expand Down Expand Up @@ -103,45 +150,5 @@ function D4:CheckVersion(name, ver)
end
end

local f = CreateFrame("FRAME")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript(
"OnEvent",
function(sel, event, isInitialLogin, isReloadingUi)
C_Timer.After(
2,
function()
if D4.VersionTab[string.lower(AddonName)] then
local id = D4.VersionTab[string.lower(AddonName)].id or 0
C_Timer.After(
id * 0.1,
function()
local ver = D4:GetVersion(AddonName)
if ver == nil then
D4:MSG(AddonName, 0, "|cffff0000MISSING VERSION", AddonName)
end

if isInitialLogin and ver and pre and C_ChatInfo then
C_ChatInfo.SendAddonMessage(pre, string.format("A;%s;V;%s", AddonName, ver))
end
end
)
end
end
)
end
)

local r = CreateFrame("FRAME")
r:RegisterEvent("CHAT_MSG_ADDON")
r:SetScript(
"OnEvent",
function(sel, event, pref, msg, ...)
if pref == pre and msg then
local a, name, v, ver = string.split(";", msg)
if a and name and v and ver and a == "A" and v == "V" and AddonName == name and not D4:FoundHigher(name) then
D4:CheckVersion(name, ver)
end
end
end
)
D4.LibVersion = D4LibVersion
print(D4LibVersion)
4 changes: 2 additions & 2 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ function DarkMode:InitDMSettings()
DMSettings:Hide()
end

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

0 comments on commit 4faad3d

Please sign in to comment.