Repository navigation
legacy
Notes on how I back ported modern (bfa, shadowlands, classic, tbc) to legacy (3.3.5a) client
Thanks to Wow Addons; discord #legacy for the help
-
Get corresponding
BugSackto debug https://www.curseforge.com/wow/addons/bug-grabber/files/436826 and https://www.curseforge.com/wow/addons/bugsack/files/437907 -
In the toc you need to use
## Interface: 30300- backslash (
\) and not forward slash (/) as directory seperator, eg.MoLib\MoLib.lua
-
You need to fully restart the client for most change of addon, toc etc (no dynamic reload)
-
GetPhysicalScreenSize: https://github.com/bkader/Compat-WotLK/blob/main/Compat/elements/screen.lua#L9-L12 -
texture:SetColorTexture->texture:SetTexture(see MolibUI.lua ML:Frame for a way to have this fixed) -
C_Timer-> https://github.com/bkader/Compat-WotLK/blob/main/Compat/elements/timer.lua (use OnUpdate as replacement...) - simpler (see MoLib for latest implementation):
C_Timer = {}
C_Timer.timers = {}
local timerFrame = CreateFrame("Frame", "C_TimerFrame")
function ML.TimerOnUpdate(_self, elapsed)
ML:Debug(9, "C_TimerOnUpdate elapsed %", elapsed)
for i, v in ipairs(C_Timer.timers) do
ML:Debug(9, "C_TimerOnUpdate timer %: %", i, v)
if v.cancelled then
table.remove(C_Timer.timers, i)
break
end
if v.timeLeft < 0 then
v.callback()
if v.iterations ~= nil then
v.iterations = v.iterations - 1
if v.iterations <= 0 then
table.remove(C_Timer.timers, i)
end
end
v.timeLeft = v.duration
else
v.timeLeft = v.timeLeft - elapsed
end
end
end
timerFrame:SetScript("OnUpdate",ML.TimerOnUpdate)
function C_Timer.NewTicker(duration, callback, iterations)
local t = {
duration = duration,
timeLeft = duration,
callback = callback,
iterations = iterations,
cancelled = false,
Cancel = function(self)
self.cancelled = true
end,
IsCancelled = function(self)
return self.cancelled
end
}
table.insert(C_Timer.timers, t)
return t
end
function C_Timer.NewTimer(duration, callback)
C_Timer.NewTicker(duration, callback, 1)
end
function C_Timer.After(duration, callback)
C_Timer.NewTicker(duration, callback, 1)
end-
button don't have a
Textfontstring: Try giving the buttons a global name and using_G[c:GetName().."Text"] -
missing
slider:SetStepsPerPage: don't call it. and for Text/Low/High of sliders:
local name= nil
if addon.isLegacy then
name = "MoLib" .. self.name .. "Slider".. tostring(addon:NextId())
end
local s = CreateFrame("Slider", name, self, "OptionsSliderTemplate")
if s.Text == nil then
s.Text = _G[name.."Text"]
s.Low = _G[name.."Low"]
s.High = _G[name.."High"]
end-
GetNumGroupMembers()Compat.IsInRaid() and GetNumRaidMembers() or GetNumPartyMembers() -
C_ChatInfodoesn't exist -
no
UnitFullName: useUnitNameandGetRealmNamefor "player" realm -
no
SetMaxLineson font string -> ignore -
no
CreateLine -
no
GetServerTime