Warn instead of loading when ClassicAPI is missing

The addon needs the ClassicAPI DLL - without it the inline |T markup the
emotes are built from renders as literal text, title included. Move the
real load order into TwitchEmotes_ClassicAPI.toc, which the DLL picks up
in preference, and leave the base TOC loading nothing but CAPI_Warning.lua:
a popup and a chat line pointing at the latest release, with the download
URL in a preselected edit box. Its title drops the inline-texture markup
for the same reason.

Also list CreateFrame among the globals in .luarc.json.
This commit is contained in:
Brues
2026-09-03 16:05:02 -05:00
parent 94777ecbc4
commit 4173e827eb
4 changed files with 72 additions and 26 deletions
+2 -1
View File
@@ -16,7 +16,8 @@
"arg6",
"arg7",
"arg8",
"arg9"
"arg9",
"CreateFrame"
]
}
}
+38
View File
@@ -0,0 +1,38 @@
local CLASSIC_API_WEBSITE = "https://github.com/brues-code/ClassicAPI"
local CLASSIC_API_LATEST_URL = CLASSIC_API_WEBSITE .. "/releases/latest"
local headline = "TwitchEmotes has been disabled."
local detail = "The ClassicAPI DLL isn't loaded. Download the latest release from: "
local function ShowRequiredPopup()
StaticPopupDialogs["TWITCH_CLASSICAPI_REQUIRED"] = {
text = headline .. "\n\n" .. detail,
button1 = OKAY,
hasEditBox = 1,
editBoxWidth = 280,
timeout = 0,
whileDead = 1,
hideOnEscape = 1,
preferredIndex = 3,
OnShow = function()
local editBox = getglobal(this:GetName().."EditBox")
if editBox then
editBox:SetText(CLASSIC_API_LATEST_URL)
editBox:HighlightText()
editBox:SetFocus()
end
end,
}
StaticPopup_Show("TWITCH_CLASSICAPI_REQUIRED")
DEFAULT_CHAT_FRAME:AddMessage(
headline .. " " .. detail .. CLASSIC_API_LATEST_URL,
1, 0.3, 0.3
)
end
local loginFrame = CreateFrame("Frame")
loginFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
loginFrame:SetScript("OnEvent", function()
loginFrame:UnregisterEvent("PLAYER_ENTERING_WORLD")
ShowRequiredPopup()
end)
+4 -25
View File
@@ -1,29 +1,8 @@
## Interface: 11200
## Title: |TInterface\Addons\TwitchEmotes\Emotes\Pepes\EZ:0|t|cff6441a5Twitch|r |cffffffffEmotes|r|TInterface\Addons\TwitchEmotes\Emotes\Pepes\EZ:0|t
## IconTexture: Interface\AddOns\TwitchEmotes\Emotes\1337.tga
## Notes: Adds popular Twitch & Discord emotes to your chat. Developed by Ren - 1.12.1 backport by Brues
## Author: Ren
## Title: TwitchEmotes (MISSING CLASSICAPI)
## Notes: If you're seeing this, ClassicAPI has failed to load.
## Author: Brues
## Version: @project-version@
## SavedVariables: Emoticons_Settings, Emoticons_Eyecandy, TwitchEmoteStatistics
## OptionalDeps: LibStub
## LoadSavedVariablesFirst: 1
# Libraries (Ace3v — the 1.12.1 fork of Ace3)
Libs\LibStub\LibStub.lua
Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua
Libs\AceCore-3.0\AceCore-3.0.xml
Libs\AceHook-3.0\AceHook-3.0.xml
Libs\libdatabroker-1-1\LibDataBroker-1.1.lua
Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua
Libs\AceConsole-3.0\AceConsole-3.0.xml
Libs\AceGUI-3.0\AceGUI-3.0.xml
Libs\AceGUI-3.0\widgets\widgets.xml
Libs\AceConfig-3.0\AceConfig-3.0.xml
Emotes.lua
TwitchEmotes.lua
TwitchEmotesAutoComplete.lua
TwitchEmotesStats.lua
TwitchEmotesAnimator.lua
CAPI_Warning.lua
+28
View File
@@ -0,0 +1,28 @@
## Interface: 11200
## Title: |TInterface\Addons\TwitchEmotes\Emotes\Pepes\EZ:0|t|cff6441a5Twitch|r |cffffffffEmotes|r|TInterface\Addons\TwitchEmotes\Emotes\Pepes\EZ:0|t
## Notes: Adds popular Twitch & Discord emotes to your chat. Developed by Ren - 1.12.1 backport by Brues
## Author: Ren
## Version: @project-version@
## SavedVariables: Emoticons_Settings, Emoticons_Eyecandy, TwitchEmoteStatistics
## OptionalDeps: LibStub
## LoadSavedVariablesFirst: 1
# Libraries (Ace3v — the 1.12.1 fork of Ace3)
Libs\LibStub\LibStub.lua
Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua
Libs\AceCore-3.0\AceCore-3.0.xml
Libs\AceHook-3.0\AceHook-3.0.xml
Libs\libdatabroker-1-1\LibDataBroker-1.1.lua
Libs\LibDBIcon-1.0\LibDBIcon-1.0.lua
Libs\AceConsole-3.0\AceConsole-3.0.xml
Libs\AceGUI-3.0\AceGUI-3.0.xml
Libs\AceGUI-3.0\widgets\widgets.xml
Libs\AceConfig-3.0\AceConfig-3.0.xml
Emotes.lua
TwitchEmotes.lua
TwitchEmotesAutoComplete.lua
TwitchEmotesStats.lua
TwitchEmotesAnimator.lua