mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-09-22 07:36:58 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user