diff --git a/.luarc.json b/.luarc.json index ec3b2dd..5f98ed0 100644 --- a/.luarc.json +++ b/.luarc.json @@ -16,7 +16,8 @@ "arg6", "arg7", "arg8", - "arg9" + "arg9", + "CreateFrame" ] } } diff --git a/CAPI_Warning.lua b/CAPI_Warning.lua new file mode 100644 index 0000000..455595e --- /dev/null +++ b/CAPI_Warning.lua @@ -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) diff --git a/TwitchEmotes.toc b/TwitchEmotes.toc index 1df7125..b2b09a9 100644 --- a/TwitchEmotes.toc +++ b/TwitchEmotes.toc @@ -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 diff --git a/TwitchEmotes_ClassicAPI.toc b/TwitchEmotes_ClassicAPI.toc new file mode 100644 index 0000000..0af22f1 --- /dev/null +++ b/TwitchEmotes_ClassicAPI.toc @@ -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