Skip to content

Instantly share code, notes, and snippets.

@arcadepro
Last active March 27, 2023 04:05
Show Gist options
  • Save arcadepro/f2307f6d4f620d213b1c31599fc6e69b to your computer and use it in GitHub Desktop.
Save arcadepro/f2307f6d4f620d213b1c31599fc6e69b to your computer and use it in GitHub Desktop.
fix details corrupting cvars
local addon = ...
local f = CreateFrame("Frame")
local msgcolor = BLUE_FONT_COLOR
local chatframe = SELECTED_CHAT_FRAME
local function printf(msg)
if not msg then
msg = "Loaded."
else
local output = (addon..": "..msg)
local colorstring = msgcolor:WrapTextInColorCode(output)
chatframe:AddMessage(colorstring)
end
end
local function nuke()
if C_CVar.GetCVar("LibOpenRaidTempCache") then
C_CVar.SetCVar("LibOpenRaidTempCache", 0)
C_CVar.SetCVar("LibOpenRaidTempCacheDebug", 0) -- not necessary but w/e
printf("LibOpenRaidTempCache deleted.")
end
end
f:SetScript("OnEvent", function(self, event, arg1, ...)
if event == "PLAYER_ENTERING_WORLD" then
--printf()
if IsAddOnLoaded("Details") then
OpenRaidLibFrame:UnregisterEvent("PLAYER_LOGOUT")
nuke()
--printf("OpenRaidLibFrame's PLAYER_LOGOUT event is now unregistered.")
end
end
if event == "PLAYER_LOGOUT" then
nuke()
end
end)
SlashCmdList["DETAILSFIX"] = function()
printf("LibOpenRaidTempCache = " .. C_CVar.GetCVar("LibOpenRaidTempCache"))
end
SLASH_DETAILSFIX1 = '/df'
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:RegisterEvent("PLAYER_LOGOUT")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment