Skip to content

Commit c6d0942

Browse files
committed
refactor: use _G
1 parent 5d989f3 commit c6d0942

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Core/Core.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ local strmatch = strmatch
1313
local strsub = strsub
1414
local tinsert = tinsert
1515
local tonumber = tonumber
16+
local type = type
1617
local unpack = unpack
1718
local xpcall = xpcall
1819

@@ -258,15 +259,15 @@ end
258259

259260
do -- Midnight API Fix
260261
local BackdropTemplateMixin_SetupTextureCoordinates = _G.BackdropTemplateMixin.SetupTextureCoordinates
261-
function BackdropTemplateMixin:SetupTextureCoordinates(...)
262+
function _G.BackdropTemplateMixin:SetupTextureCoordinates(...)
262263
local enabled = E and E.global and E.global.WT and E.global.WT.core and E.global.WT.core.midnightAPIFix
263264
if not enabled or E:NotSecretValue(self:GetWidth()) then
264265
BackdropTemplateMixin_SetupTextureCoordinates(self, ...)
265266
end
266267
end
267268

268269
-- Fix from NDui
269-
MoneyFrame_Update_OLD = MoneyFrame_Update
270+
local MoneyFrame_Update_OLD = _G.MoneyFrame_Update
270271

271272
local function GetMoneyFrame(frameOrName)
272273
local argType = type(frameOrName)
@@ -278,7 +279,7 @@ do -- Midnight API Fix
278279
return nil
279280
end
280281

281-
function MoneyFrame_Update(frameName, money, forceShow)
282+
function _G.MoneyFrame_Update(frameName, money, forceShow)
282283
local enabled = E and E.global and E.global.WT and E.global.WT.core and E.global.WT.core.midnightAPIFix
283284
if not enabled then
284285
MoneyFrame_Update_OLD(frameName, money, forceShow)
@@ -293,9 +294,9 @@ do -- Midnight API Fix
293294
end
294295

295296
-- Fix from NDui
296-
SetTooltipMoney_OLD = SetTooltipMoney
297+
local SetTooltipMoney_OLD = _G.SetTooltipMoney
297298

298-
function SetTooltipMoney(frame, money, type, prefixText, suffixText)
299+
function _G.SetTooltipMoney(frame, money, type, prefixText, suffixText)
299300
local enabled = E and E.global and E.global.WT and E.global.WT.core and E.global.WT.core.midnightAPIFix
300301
if not enabled then
301302
SetTooltipMoney_OLD(frame, money, type, prefixText, suffixText)

0 commit comments

Comments
 (0)