forked from Nnoggie/MythicDungeonTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildCheck.lua
36 lines (34 loc) · 1.42 KB
/
BuildCheck.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local addonName, MDT = ...
local AceGUI = LibStub("AceGUI-3.0")
local L
function MDT:IsCompatibleVersion()
local gameVersion = select(4, GetBuildInfo())
return gameVersion >= 110000
end
function MDT:ShowFallbackWindow()
if not MDT.fallbackFrame then
L = MDT.L
local gameVersionString = GetBuildInfo()
local addonVersionString = C_AddOns and C_AddOns.GetAddOnMetadata(addonName, "Version") or GetAddOnMetadata(addonName, "Version")
local labelText = L["incompatibleVersionError"].."\n\nGame: "..gameVersionString.."\nMDT: "..addonVersionString
MDT.fallbackFrame = AceGUI:Create("Frame")
_G["MDTFallbackFrame"] = MDT.fallbackFrame.frame
tinsert(UISpecialFrames, "MDTFallbackFrame")
local fallbackFrame = MDT.fallbackFrame
fallbackFrame:EnableResize(false)
fallbackFrame:SetWidth(600)
fallbackFrame:SetHeight(300)
fallbackFrame:EnableResize(false)
fallbackFrame:SetLayout("Flow")
fallbackFrame:SetCallback("OnClose", function(widget) end)
fallbackFrame:SetTitle(L["MDT Error"])
fallbackFrame.label = AceGUI:Create("Label")
fallbackFrame.label:SetWidth(600)
fallbackFrame.label:SetFontObject("GameFontNormalLarge")
fallbackFrame.label.label:SetFont(fallbackFrame.label.label:GetFont(), 30);
fallbackFrame.label.label:SetTextColor(1, 0, 0)
fallbackFrame.label:SetText(labelText)
fallbackFrame:AddChild(fallbackFrame.label)
end
MDT.fallbackFrame:Show()
end