This commit is contained in:
2026-07-19 15:39:52 +04:00
parent 721833bb50
commit f02f4d73f0
6 changed files with 18671 additions and 9 deletions
@@ -353,6 +353,80 @@ EnsureColorMethods(HIGHLIGHT_FONT_COLOR)
EnsureColorMethods(RED_FONT_COLOR)
EnsureColorMethods(GREEN_FONT_COLOR)
EnsureColorMethods(DISABLED_FONT_COLOR)
-- The imported Encounter Journal UI uses tooltip helpers introduced after
-- 3.3.5. Keep their retail signatures, but implement them with the tooltip
-- methods available in the 3.3.5 client.
local function TooltipColorRGB(color, fallbackR, fallbackG, fallbackB)
if type(color) == "table" then
if color.GetRGB then
return color:GetRGB()
end
return color.r or fallbackR, color.g or fallbackG, color.b or fallbackB
end
return fallbackR, fallbackG, fallbackB
end
if not GameTooltip_AddColoredLine then
function GameTooltip_AddColoredLine(tooltip, text, color, wrap)
if not tooltip or not tooltip.AddLine then
return
end
local r, g, b = TooltipColorRGB(color, 1, 1, 1)
tooltip:AddLine(text or "", r, g, b, wrap and true or false)
end
end
if not GameTooltip_AddNormalLine then
function GameTooltip_AddNormalLine(tooltip, text, wrap)
GameTooltip_AddColoredLine(tooltip, text, NORMAL_FONT_COLOR, wrap)
end
end
if not GameTooltip_AddHighlightLine then
function GameTooltip_AddHighlightLine(tooltip, text, wrap)
GameTooltip_AddColoredLine(tooltip, text, HIGHLIGHT_FONT_COLOR, wrap)
end
end
if not GameTooltip_AddBlankLineToTooltip then
function GameTooltip_AddBlankLineToTooltip(tooltip)
if tooltip and tooltip.AddLine then
tooltip:AddLine(" ")
end
end
end
if not GameTooltip_SetTitle then
function GameTooltip_SetTitle(tooltip, text, color)
if not tooltip then
return
end
local r, g, b = TooltipColorRGB(color or NORMAL_FONT_COLOR, 1, 0.82, 0)
if tooltip.SetText then
tooltip:SetText(text or "", r, g, b)
elseif tooltip.AddLine then
tooltip:AddLine(text or "", r, g, b)
end
end
end
if not GameTooltip_ShowDisabledTooltip then
function GameTooltip_ShowDisabledTooltip(tooltip, owner, text, anchor, offsetX, offsetY)
if not tooltip or not owner then
return
end
tooltip:SetOwner(owner, anchor or "ANCHOR_RIGHT", offsetX or 0, offsetY or 0)
GameTooltip_AddNormalLine(tooltip, text, true)
tooltip:Show()
end
end
LOOTJOURNAL_SOURCE_TOOLTIP_HEAD = LOOTJOURNAL_SOURCE_TOOLTIP_HEAD or "Способ получения:"
RETURN_TO_DEFAULT = RETURN_TO_DEFAULT or "Настройки по умолчанию"
GUIDEBOOK = GUIDEBOOK or "Путеводитель"
@@ -557,6 +631,23 @@ local function EnsureItemsCache()
end
local itemsCache = type(_G.ItemsCache) == "table" and _G.ItemsCache or nil
local compactItemsCache = _G.MoonWellEncounterJournalItemCache
if type(compactItemsCache) == "table" then
itemsCache = itemsCache or {}
for itemID, compactData in pairs(compactItemsCache) do
if type(itemID) == "number" and type(compactData) == "table" and not itemsCache[itemID] then
itemsCache[itemID] = {
[ITEM_CACHE_FIELD.NAME_ENGB] = compactData[1],
[ITEM_CACHE_FIELD.NAME_RURU] = compactData[2],
[ITEM_CACHE_FIELD.RARITY] = compactData[3],
[ITEM_CACHE_FIELD.TEXTURE] = compactData[4],
}
end
end
_G.ItemsCache = itemsCache
_G.MoonWellEncounterJournalItemCache = nil
end
local fileIndex = 1
local itemCacheTable = _G["ItemsCache" .. fileIndex]
@@ -711,8 +802,8 @@ local function EnsureItemCacheFrame()
end
C_Item.GetItemInfo = function(item, skipClientCache, callback, ...)
local name, link, quality, itemLevel, reqLevel, itemType, itemSubType, maxStack, equipSlot, icon, vendorPrice
if ExistingCItemGetItemInfo then
local name, link, quality, itemLevel, reqLevel, itemType, itemSubType, maxStack, equipSlot, icon, vendorPrice = C_Item.GetItemInfoCache(item)
if not name and ExistingCItemGetItemInfo then
name, link, quality, itemLevel, reqLevel, itemType, itemSubType, maxStack, equipSlot, icon, vendorPrice = ExistingCItemGetItemInfo(item, skipClientCache, nil, ...)
end
if not name then
@@ -2,11 +2,92 @@
-- The static fallback is loaded from Generated_EncounterJournal.lua, so the journal works
-- without ever calling ApplyEncounterJournalData.
-- These entries belong to the Sirus-specific content pack that was mixed into
-- the production export. They are not MoonWell content and must never reach
-- the client, including when the journal is refreshed through AIO.
local BLOCKED_INSTANCE_IDS = {
[773] = true, -- Bronze Sanctum
[774] = true, -- Tol'Garod Prison
[776] = true, -- Sirus categories
[777] = true, -- Sirus world bosses (Norigorn)
}
local function RemoveBlockedInstances(data)
local instances = data.JOURNALINSTANCE or data.instances
local encounters = data.JOURNALENCOUNTER or data.encounters
local creatures = data.JOURNALENCOUNTERCREATURE or data.creatures
local items = data.JOURNALENCOUNTERITEM or data.items
local sections = data.JOURNALENCOUNTERSECTION or data.sections
local tierInstances = data.JOURNALTIERXINSTANCE or data.tierInstances
local blockedEncounterIDs = {}
if type(encounters) == "table" then
for instanceID in pairs(BLOCKED_INSTANCE_IDS) do
local encounterList = encounters[instanceID]
if type(encounterList) == "table" then
for _, encounterInfo in ipairs(encounterList) do
if type(encounterInfo) == "table" and type(encounterInfo[1]) == "number" then
blockedEncounterIDs[encounterInfo[1]] = true
end
end
end
encounters[instanceID] = nil
end
end
if type(instances) == "table" then
for instanceID in pairs(BLOCKED_INSTANCE_IDS) do
instances[instanceID] = nil
end
end
for encounterID in pairs(blockedEncounterIDs) do
if type(creatures) == "table" then
creatures[encounterID] = nil
end
if type(items) == "table" then
items[encounterID] = nil
end
end
if type(sections) == "table" then
for sectionID, sectionInfo in pairs(sections) do
if type(sectionInfo) == "table" and blockedEncounterIDs[sectionInfo[7]] then
sections[sectionID] = nil
end
end
end
if type(tierInstances) == "table" then
for instanceID in pairs(BLOCKED_INSTANCE_IDS) do
tierInstances[instanceID] = nil
end
for _, instanceList in pairs(tierInstances) do
if type(instanceList) == "table" then
local writeIndex = 1
for readIndex = 1, #instanceList do
local instanceID = instanceList[readIndex]
if not BLOCKED_INSTANCE_IDS[instanceID] then
instanceList[writeIndex] = instanceID
writeIndex = writeIndex + 1
end
end
for index = writeIndex, #instanceList do
instanceList[index] = nil
end
end
end
end
end
local function ApplyEncounterJournalData(data)
if type(data) ~= "table" then
return
end
RemoveBlockedInstances(data)
local function NormalizeTierInstances(tiers, tierInstances)
if type(tiers) ~= "table" or type(tierInstances) ~= "table" then
return tierInstances
@@ -9,6 +9,7 @@
AchievementFactions.lua
MoonWellClient.lua
EncounterJournal\EncounterJournalItemCache.lua
EncounterJournal\EncounterJournalCompat.lua
EncounterJournal\SharedXML\SoundKitConstants.lua
EncounterJournal\Generated_EncounterJournalData.lua