Fix realm-gate disable for book/options, pet-rank learning, unique beasts

- Hunter's Book and options window now show a full 'DISABLED.' overlay on realm-gated realms instead of rendering content
- Pet training: new rank of an already-known ability is now recognised, announced, and reflected in tooltips
- Restore curated 'unique appearance' beast allowlist (34 beasts) in data/init.lua
- CHANGELOG updated
This commit is contained in:
DuvelCorp
2026-09-08 01:25:51 +02:00
parent 38e080261c
commit c55cd66ffc
19 changed files with 996 additions and 698 deletions
+68 -1
View File
@@ -7,7 +7,18 @@ MTH = MTH or {
}
local MTH_CHAT_PREFIX = "|cFFFFFFFF[|r|cFFD14A4AMeta|r|cFFABD473Hunt|r|cFFFFFFFF]|r "
local MTH_NON_HUNTER_BLOCK_MESSAGE = "You are not a hunter and you are not allowed here. Disable the add-on for this character."
local MTH_NON_HUNTER_BLOCK_MESSAGE = "You are not a hunter. Disable the add-on for this character."
local MTH_REALM_BLOCK_MESSAGE = "Zero support for Ravencraft/Capybara mafia's realms. Consider joining Octowow."
local MTH_BLOCKED_REALMS = {
["Medivh"] = true,
["\230\176\184\230\173\140\232\141\146\233\135\142"] = true,
["\211\192\184\232\187\196\210\176"] = true,
["\229\159\186\232\181\171\231\186\179\230\150\175"] = true,
["\187\249\186\213\196\201\203\185"] = true,
["\231\190\164\230\152\159\231\155\134\229\156\176"] = true,
["\200\186\208\199\197\232\181\216"] = true,
}
local MTH_MESSAGE_DEFAULTS = {
initModulesLoaded = false,
initSarcasticWelcome = true,
@@ -189,6 +200,57 @@ function MTH:ApplyClassGate(_source)
return blocked
end
function MTH:GetCurrentRealmName()
local realm = nil
if type(GetRealmName) == "function" then
realm = GetRealmName()
end
if (realm == nil or realm == "") and type(GetCVar) == "function" then
realm = GetCVar("realmName")
end
return realm
end
function MTH:IsRealmGateBlocked()
return self and self._realmGateBlocked and true or false
end
function MTH:CheckRealmGate()
-- Realm name is only reliable once logged in; an empty result never blocks.
local realm = self:GetCurrentRealmName()
if type(realm) == "string" and realm ~= "" then
self._currentRealm = realm
if MTH_BLOCKED_REALMS[realm] then
self._realmGateBlocked = true
end
end
return self:IsRealmGateBlocked()
end
function MTH:AnnounceRealmGateBlocked()
if self._realmGateAnnounced then
return
end
local sink = MTH_TryOutputClassGateMessage(MTH_REALM_BLOCK_MESSAGE)
if sink == "chat" or sink == "uierrors" or sink == "print" then
self._realmGateAnnounced = true
end
end
function MTH:ApplyRealmGate(_source)
if self:IsHardBlocked() then
return true
end
if self:CheckRealmGate() then
self:AnnounceRealmGateBlocked()
if self.ShutdownForNonHunter then
self:ShutdownForNonHunter(_source or "realm-gate")
end
return true
end
return false
end
MTH:ApplyClassGate("startup")
if not MTH._classGateLifecycleFrame then
@@ -202,6 +264,11 @@ if not MTH._classGateLifecycleFrame then
MTH._classGateAnnounced = nil
MTH._classGateAnnouncePending = nil
end
if MTH and MTH.ApplyRealmGate and MTH:ApplyRealmGate(event) then
this:UnregisterAllEvents()
this:SetScript("OnEvent", nil)
return
end
if MTH and MTH.ApplyClassGate and MTH:ApplyClassGate(event) and MTH._classGateAnnouncedChat then
this:UnregisterAllEvents()
this:SetScript("OnEvent", nil)
+34 -1
View File
@@ -335,6 +335,39 @@ local function MTH_PT_IsHunterTokenKnown(token)
return false
end
-- Rank-strict variant of MTH_PT_IsHunterTokenKnown: only the EXACT token counts, with
-- no fall back to the base ability. Knowing Charge (Rank 1) must NOT make Charge (Rank 2)
-- look already-learned, otherwise learning a new rank is never recorded or announced.
local function MTH_PT_IsExactTokenKnown(token)
if token == nil or token == "" then
return false
end
local store = MTH_PT_GetStore()
if store.hunterKnownMap and store.hunterKnownMap[token] == true then
return true
end
if store.spellMap and store.spellMap[token] and store.spellMap[token].isKnown == true then
return true
end
return false
end
-- Authoritative, rank-strict check for whether the HUNTER has learned a pet ability at a
-- given rank. Consults both hunterKnownMap and spellMap, so callers (e.g. the tooltip hint)
-- stay correct even when a full Beast Training rescan has not yet rebuilt spellMap rows.
function MTH_IsPetAbilityKnownByHunter(abilityName, rankNumber)
local ability = MTH_PT_NormalizeName(abilityName)
if ability == "" then
return false
end
local token = MTH_PT_MakeTokenFromAbilityRank(ability, rankNumber)
if token == "" then
return false
end
return MTH_PT_IsExactTokenKnown(token)
end
local function MTH_PT_ProcessLearnSystemMessage(rawMessage)
local message = tostring(rawMessage or "")
if message == "" then return false end
@@ -368,7 +401,7 @@ local function MTH_PT_ProcessLearnSystemMessage(rawMessage)
local token = MTH_PT_MakeTokenFromAbilityRank(abilityName, rankNumber)
if token == "" then return false end
local alreadyKnown = MTH_PT_IsHunterTokenKnown(token)
local alreadyKnown = MTH_PT_IsExactTokenKnown(token)
local changed = false
if not alreadyKnown then
changed = MTH_PT_MarkHunterKnownToken(token)
+73 -25
View File
@@ -20,34 +20,34 @@ local MTH_BOOK_GetZoneName
local MTH_BOOK_GetPlayerLevelValue
local MTH_BOOK_IsSpellInLevelScope
local MTH_BOOK_GetScopedRankSummary
local MTH_BOOK_BEAST_DATABASE_URL = "https://database.turtlecraft.gg/?npc=%d"
local MTH_BOOK_NPC_DATABASE_URL = "https://database.turtlecraft.gg/?npc=%d"
local MTH_BOOK_ITEM_DATABASE_URL = "https://database.turtlecraft.gg/?item=%d"
local MTH_BOOK_BEAST_DATABASE_URL = "https://octowow.st/db/?npc=%d"
local MTH_BOOK_NPC_DATABASE_URL = "https://octowow.st/db/?npc=%d"
local MTH_BOOK_ITEM_DATABASE_URL = "https://octowow.st/db/?item=%d"
local MTH_BOOK_STABLE_CURRENT_ID_CACHE = nil
local MTH_BOOK_FALLBACK_BAG_ITEMS = {
[2101] = { name = "Light Quiver", subtype = "quiver", slots = 6, reqlevel = nil, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=2101" },
[2102] = { name = "Small Ammo Pouch", subtype = "ammo pouch", slots = 6, reqlevel = nil, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=2102" },
[2662] = { name = "Ribbly's Quiver", subtype = "quiver", slots = 16, reqlevel = 50, quality = 2, sourceUrl = "https://database.turtlecraft.gg/?item=2662" },
[2663] = { name = "Ribbly's Bandolier", subtype = "ammo pouch", slots = 16, reqlevel = 50, quality = 2, sourceUrl = "https://database.turtlecraft.gg/?item=2663" },
[3573] = { name = "Hunting Quiver", subtype = "quiver", slots = 10, reqlevel = nil, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=3573" },
[3574] = { name = "Hunting Ammo Sack", subtype = "ammo pouch", slots = 10, reqlevel = nil, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=3574" },
[3604] = { name = "Bandolier of the Night Watch", subtype = "ammo pouch", slots = 12, reqlevel = nil, quality = 2, sourceUrl = "https://database.turtlecraft.gg/?item=3604" },
[3605] = { name = "Quiver of the Night Watch", subtype = "quiver", slots = 12, reqlevel = nil, quality = 2, sourceUrl = "https://database.turtlecraft.gg/?item=3605" },
[5439] = { name = "Small Quiver", subtype = "quiver", slots = 8, reqlevel = nil, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=5439" },
[5441] = { name = "Small Shot Pouch", subtype = "ammo pouch", slots = 8, reqlevel = nil, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=5441" },
[7278] = { name = "Light Leather Quiver", subtype = "quiver", slots = 8, reqlevel = nil, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=7278" },
[7279] = { name = "Small Leather Ammo Pouch", subtype = "ammo pouch", slots = 8, reqlevel = nil, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=7279" },
[7371] = { name = "Heavy Quiver", subtype = "quiver", slots = 14, reqlevel = 30, quality = 2, sourceUrl = "https://database.turtlecraft.gg/?item=7371" },
[7372] = { name = "Heavy Leather Ammo Pouch", subtype = "ammo pouch", slots = 14, reqlevel = 30, quality = 2, sourceUrl = "https://database.turtlecraft.gg/?item=7372" },
[8217] = { name = "Quickdraw Quiver", subtype = "quiver", slots = 16, reqlevel = 40, quality = 2, sourceUrl = "https://database.turtlecraft.gg/?item=8217" },
[8218] = { name = "Thick Leather Ammo Pouch", subtype = "ammo pouch", slots = 16, reqlevel = 40, quality = 2, sourceUrl = "https://database.turtlecraft.gg/?item=8218" },
[11362] = { name = "Medium Quiver", subtype = "quiver", slots = 10, reqlevel = 10, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=11362" },
[11363] = { name = "Medium Shot Pouch", subtype = "ammo pouch", slots = 10, reqlevel = 10, quality = 1, sourceUrl = "https://database.turtlecraft.gg/?item=11363" },
[18714] = { name = "Ancient Sinew Wrapped Lamina", subtype = "quiver", slots = 18, reqlevel = 60, quality = 4, sourceUrl = "https://database.turtlecraft.gg/?item=18714" },
[19319] = { name = "Harpy Hide Quiver", subtype = "quiver", slots = 16, reqlevel = 55, quality = 3, sourceUrl = "https://database.turtlecraft.gg/?item=19319" },
[19320] = { name = "Gnoll Skin Bandolier", subtype = "ammo pouch", slots = 16, reqlevel = 55, quality = 3, sourceUrl = "https://database.turtlecraft.gg/?item=19320" },
[61549] = { name = "Swiftfeather Quiver", subtype = "quiver", slots = 16, reqlevel = 57, quality = 3, sourceUrl = "https://database.turtlecraft.gg/?item=61549" },
[2101] = { name = "Light Quiver", subtype = "quiver", slots = 6, reqlevel = nil, quality = 1, sourceUrl = "https://octowow.st/db/?item=2101" },
[2102] = { name = "Small Ammo Pouch", subtype = "ammo pouch", slots = 6, reqlevel = nil, quality = 1, sourceUrl = "https://octowow.st/db/?item=2102" },
[2662] = { name = "Ribbly's Quiver", subtype = "quiver", slots = 16, reqlevel = 50, quality = 2, sourceUrl = "https://octowow.st/db/?item=2662" },
[2663] = { name = "Ribbly's Bandolier", subtype = "ammo pouch", slots = 16, reqlevel = 50, quality = 2, sourceUrl = "https://octowow.st/db/?item=2663" },
[3573] = { name = "Hunting Quiver", subtype = "quiver", slots = 10, reqlevel = nil, quality = 1, sourceUrl = "https://octowow.st/db/?item=3573" },
[3574] = { name = "Hunting Ammo Sack", subtype = "ammo pouch", slots = 10, reqlevel = nil, quality = 1, sourceUrl = "https://octowow.st/db/?item=3574" },
[3604] = { name = "Bandolier of the Night Watch", subtype = "ammo pouch", slots = 12, reqlevel = nil, quality = 2, sourceUrl = "https://octowow.st/db/?item=3604" },
[3605] = { name = "Quiver of the Night Watch", subtype = "quiver", slots = 12, reqlevel = nil, quality = 2, sourceUrl = "https://octowow.st/db/?item=3605" },
[5439] = { name = "Small Quiver", subtype = "quiver", slots = 8, reqlevel = nil, quality = 1, sourceUrl = "https://octowow.st/db/?item=5439" },
[5441] = { name = "Small Shot Pouch", subtype = "ammo pouch", slots = 8, reqlevel = nil, quality = 1, sourceUrl = "https://octowow.st/db/?item=5441" },
[7278] = { name = "Light Leather Quiver", subtype = "quiver", slots = 8, reqlevel = nil, quality = 1, sourceUrl = "https://octowow.st/db/?item=7278" },
[7279] = { name = "Small Leather Ammo Pouch", subtype = "ammo pouch", slots = 8, reqlevel = nil, quality = 1, sourceUrl = "https://octowow.st/db/?item=7279" },
[7371] = { name = "Heavy Quiver", subtype = "quiver", slots = 14, reqlevel = 30, quality = 2, sourceUrl = "https://octowow.st/db/?item=7371" },
[7372] = { name = "Heavy Leather Ammo Pouch", subtype = "ammo pouch", slots = 14, reqlevel = 30, quality = 2, sourceUrl = "https://octowow.st/db/?item=7372" },
[8217] = { name = "Quickdraw Quiver", subtype = "quiver", slots = 16, reqlevel = 40, quality = 2, sourceUrl = "https://octowow.st/db/?item=8217" },
[8218] = { name = "Thick Leather Ammo Pouch", subtype = "ammo pouch", slots = 16, reqlevel = 40, quality = 2, sourceUrl = "https://octowow.st/db/?item=8218" },
[11362] = { name = "Medium Quiver", subtype = "quiver", slots = 10, reqlevel = 10, quality = 1, sourceUrl = "https://octowow.st/db/?item=11362" },
[11363] = { name = "Medium Shot Pouch", subtype = "ammo pouch", slots = 10, reqlevel = 10, quality = 1, sourceUrl = "https://octowow.st/db/?item=11363" },
[18714] = { name = "Ancient Sinew Wrapped Lamina", subtype = "quiver", slots = 18, reqlevel = 60, quality = 4, sourceUrl = "https://octowow.st/db/?item=18714" },
[19319] = { name = "Harpy Hide Quiver", subtype = "quiver", slots = 16, reqlevel = 55, quality = 3, sourceUrl = "https://octowow.st/db/?item=19319" },
[19320] = { name = "Gnoll Skin Bandolier", subtype = "ammo pouch", slots = 16, reqlevel = 55, quality = 3, sourceUrl = "https://octowow.st/db/?item=19320" },
[61549] = { name = "Swiftfeather Quiver", subtype = "quiver", slots = 16, reqlevel = 57, quality = 3, sourceUrl = "https://octowow.st/db/?item=61549" },
}
local function MTH_BOOK_FamiliesTrace(message)
@@ -5661,11 +5661,58 @@ _G.MTH_BOOK_GetScopedRankSummary = MTH_BOOK_GetScopedRankSummary
_G.MTH_BOOK_UpdateResults = MTH_BOOK_UpdateResults
_G.MTH_BOOK_RefreshFilter = MTH_BOOK_RefreshFilter
-- On a blocked realm the whole book must be inert. Rather than rendering any pages we
-- drop an opaque "DISABLED." panel over the entire window (with its own close button so
-- the frame can still be dismissed). Returns true when the realm gate is active.
local function MTH_BOOK_UpdateRealmGateOverlay(frame)
if not frame then return false end
local blocked = (MTH and MTH.IsRealmGateBlocked and MTH:IsRealmGateBlocked()) and true or false
local overlay = frame.realmGateOverlay
if not overlay then
if not blocked then return false end
overlay = CreateFrame("Frame", "MTH_BOOK_RealmGateOverlay", frame)
overlay:SetAllPoints(frame)
overlay:EnableMouse(true)
overlay:EnableMouseWheel(true)
overlay:SetFrameStrata("FULLSCREEN_DIALOG")
if overlay.SetFrameLevel and frame.GetFrameLevel then
overlay:SetFrameLevel(frame:GetFrameLevel() + 50)
end
local bg = overlay:CreateTexture(nil, "BACKGROUND")
bg:SetAllPoints(overlay)
bg:SetTexture("Interface\\Buttons\\WHITE8X8")
if bg.SetVertexColor then bg:SetVertexColor(0, 0, 0, 1) end
local label = overlay:CreateFontString(nil, "OVERLAY")
label:SetPoint("CENTER", overlay, "CENTER", 0, 0)
if label.SetFont then label:SetFont("Fonts\\FRIZQT__.TTF", 48, "OUTLINE") end
label:SetText("DISABLED.")
label:SetTextColor(1.0, 0.1, 0.1)
local close = CreateFrame("Button", nil, overlay, "UIPanelCloseButton")
close:SetPoint("TOPRIGHT", overlay, "TOPRIGHT", -4, -4)
close:SetScript("OnClick", function() frame:Hide() end)
frame.realmGateOverlay = overlay
end
if blocked then
overlay:Show()
else
overlay:Hide()
end
return blocked
end
function MTH_OpenHunterBook()
if not MTH_HB_RequireOpenDeps() then return end
local frame = MTH_BOOK_EnsureWindow()
if not frame then return end
frame:Show()
if MTH_BOOK_UpdateRealmGateOverlay(frame) then return end
MTH_BOOK_RefreshFilter()
end
@@ -5677,6 +5724,7 @@ function MTH_ToggleHunterBook()
frame:Hide()
else
frame:Show()
if MTH_BOOK_UpdateRealmGateOverlay(frame) then return end
MTH_BOOK_RefreshFilter()
end
end
+4 -17
View File
@@ -142,7 +142,7 @@ function MTH_SetupCreditsOptions()
-4)
cursor = MTH_CreditsCreateText(content, cursor,
MTH_CR_L("CREDITS_ABOUT_TOOLTIPS", "- Tooltips module is based on Hunter Helper, another vanilla addon of Fizzwidget. I kept the general idea, but there's not much original code left from it in Metahunt as I refactored everything so it plugs on MetaHunt controlled event handlers, can work with Turtle wow data, and is now usable on other things than Beasts."),
MTH_CR_L("CREDITS_ABOUT_TOOLTIPS", "- Tooltips module is based on Hunter Helper, another vanilla addon of Fizzwidget. I kept the general idea, but there's not much original code left from it in Metahunt as I refactored everything so it plugs on MetaHunt controlled event handlers, can work with Twow data, and is now usable on other things than Beasts."),
"GameFontNormalSmall", -10)
cursor = MTH_CreditsCreateLink(content,
"https://legacy-wow.com/vanilla-addons/fizzwidget-hunter-helper/",
@@ -179,34 +179,21 @@ function MTH_SetupCreditsOptions()
cursor = MTH_CreditsCreateText(content, cursor, MTH_CR_L("CREDITS_ABOUT_DATA_TITLE", "About data sources"), "GameFontNormal", -14, 1.00, 0.82, 0.00)
cursor = MTH_CreditsCreateText(content, cursor,
MTH_CR_L("CREDITS_ABOUT_DATA_INTRO", "Metahunt ships with its own Turtle-WoW datastores, limited to hunter stuff only, and most of this data is up-to-date (Feb 2026).\n\n"
MTH_CR_L("CREDITS_ABOUT_DATA_INTRO", "Metahunt ships with its own Twow datastores, limited to hunter stuff only, and most of this data is up-to-date (Feb 2026).\n\n"
.. "Sources used to build the data include:"),
"GameFontNormalSmall", -10)
cursor = MTH_CreditsCreateText(content, cursor,
MTH_CR_L("CREDITS_DATA_PFQUEST", "- pfQuest for Beasts and Ammo vendors NPCs and their spawn points (and beasts respawn times if any). Thank you again Shagu."),
"GameFontNormalSmall", -10)
cursor = MTH_CreditsCreateText(content, cursor,
MTH_CR_L("CREDITS_DATA_SHEET", "- This invaluable and very accurate spreadsheet for beasts having pet abilities. A big thanks to all twow players that crafted this! Now you dont need that sheet anymore, you have Metahunt! And the Great Book of Huntards is awesome and accurate also because of YOU."),
"GameFontNormalSmall", -10)
cursor = MTH_CreditsCreateLink(content,
"https://docs.google.com/spreadsheets/d/1u33knqlYXvY-jR6pvTd58gyDg8OYEuwYsSoEnIjeA8k/edit?gid=4136205#gid=4136205",
"https://docs.google.com/spreadsheets/d/1u33knqlYXvY-jR6pvTd58gyDg8OYEuwYsSoEnIjeA8k/edit?gid=4136205#gid=4136205",
cursor,
-4)
cursor = MTH_CreditsCreateText(content, cursor,
MTH_CR_L("CREDITS_DATA_OTHER", "- Atlas twow for ranged weapon sources\n\n"
.. "- Twow wiki for pet diet (which was incomplete, missing Serpents and Foxes)"),
"GameFontNormalSmall", -10)
cursor = MTH_CreditsCreateText(content, cursor,
MTH_CR_L("CREDITS_CLOSING", "With that being said, go back hunting fellas!"),
MTH_CR_L("CREDITS_CLOSING", "With that being said, go back hunting fellas! Preferably on Octowow."),
"GameFontNormalSmall", -10, 1.00, 0.82, 0.00)
cursor = MTH_CreditsCreateText(content, cursor,
MTH_CR_L("CREDITS_SIGNATURE", "\n"
.. "Metasploit <Atlantis>, of Nordaanar."),
.. "Metasploit <Atlantis>, of Nordaanar, now N'Zoth"),
"GameFontNormalSmall", -10)
end
+6 -2
View File
@@ -114,6 +114,10 @@ local function MTH_FOM_BuildBindingChord(key)
key)
end
-- Forward declaration: defined below but referenced by the capture-frame
-- closures above it, so it must be an in-scope local upvalue (not a global).
local MTH_FOM_SaveBinding
local function MTH_FOM_MakeCaptureFrame()
local f = CreateFrame("Frame", "MTH_FOMBindCapture", UIParent)
f:SetFrameStrata("FULLSCREEN_DIALOG")
@@ -168,7 +172,7 @@ local function MTH_FOM_StartBindingCapture()
end
end
local function MTH_FOM_SaveBinding(key)
function MTH_FOM_SaveBinding(key)
if not SetBinding or not SaveBindings or not GetBindingKey then
if MTH and MTH.Print then
MTH:Print(MTH_FOM_L("FOM_ERROR_KEYBIND_API_UNAVAILABLE", "Keybinding APIs unavailable."))
@@ -258,7 +262,7 @@ function MTH_SetupFeedOMaticOptions()
statusNotice:SetJustifyH("LEFT")
statusNotice:SetJustifyV("TOP")
statusNotice:SetTextColor(0.35, 0.65, 1)
statusNotice:SetText(MTH_FOM_L("FOM_STATUS_NOTICE", "Feed-O-Matic, created by the great Fizzwidget, is not yet entirely ready for TurtleWoW because I am missing \na reliable list of all foods, mostly impossible to fetch from the DB.\n It still works much better in this version, but all stuff related to Food buff and Cooking isnt fully functional."))
statusNotice:SetText(MTH_FOM_L("FOM_STATUS_NOTICE", "Feed-O-Matic, created by the great Fizzwidget, is not yet entirely ready for Twow because I am missing \na reliable list of all foods, mostly impossible to fetch from the DB.\n It still works much better in this version, but all stuff related to Food buff and Cooking isnt fully functional."))
local moduleCheck = MTH_CreateCheckbox(container, "MetaHuntOptionsFeedOMaticEnabled", MTH_FOM_L("FOM_ENABLE_MODULE", "Enable FeedOMatic module"), -32 + yAdjust)
if moduleCheck then
+47
View File
@@ -271,6 +271,52 @@ function MTH_ResetAndSelectOptionsTab(tabKey)
MTH_SelectOptionsTab(tabKey)
end
-- On a blocked realm the options window must be inert too. Instead of drawing any tabs we
-- drop an opaque "DISABLED." panel over the whole window (with its own close button so it can
-- still be dismissed). Returns true when the realm gate is active.
local function MTH_OPTIONS_UpdateRealmGateOverlay(frame)
if not frame then return false end
local blocked = (MTH and MTH.IsRealmGateBlocked and MTH:IsRealmGateBlocked()) and true or false
local overlay = frame.realmGateOverlay
if not overlay then
if not blocked then return false end
overlay = CreateFrame("Frame", "MetaHuntOptionsRealmGateOverlay", frame)
overlay:SetAllPoints(frame)
overlay:EnableMouse(true)
overlay:EnableMouseWheel(true)
overlay:SetFrameStrata("FULLSCREEN_DIALOG")
if overlay.SetFrameLevel and frame.GetFrameLevel then
overlay:SetFrameLevel(frame:GetFrameLevel() + 50)
end
local bg = overlay:CreateTexture(nil, "BACKGROUND")
bg:SetAllPoints(overlay)
bg:SetTexture("Interface\\Buttons\\WHITE8X8")
if bg.SetVertexColor then bg:SetVertexColor(0, 0, 0, 1) end
local label = overlay:CreateFontString(nil, "OVERLAY")
label:SetPoint("CENTER", overlay, "CENTER", 0, 0)
if label.SetFont then label:SetFont("Fonts\\FRIZQT__.TTF", 48, "OUTLINE") end
label:SetText("DISABLED.")
label:SetTextColor(1.0, 0.1, 0.1)
local close = CreateFrame("Button", nil, overlay, "UIPanelCloseButton")
close:SetPoint("TOPRIGHT", overlay, "TOPRIGHT", -4, -4)
close:SetScript("OnClick", function() frame:Hide() end)
frame.realmGateOverlay = overlay
end
if blocked then
overlay:Show()
else
overlay:Hide()
end
return blocked
end
function MTH_OpenOptions(tabKey)
if not MTH_OPTIONS_SHELL_READY then return end
local optionsFrame = MTH_EnsureOptionsFrame()
@@ -278,5 +324,6 @@ function MTH_OpenOptions(tabKey)
return
end
optionsFrame:Show()
if MTH_OPTIONS_UpdateRealmGateOverlay(optionsFrame) then return end
MTH_SelectOptionsTab(tabKey or "General")
end