правки по encounter journal

This commit is contained in:
2026-06-13 15:07:58 +04:00
parent 22ae941c4a
commit d5e2dce359
6 changed files with 294 additions and 22 deletions
+4
View File
@@ -6,3 +6,7 @@ AWS_DEFAULT_REGION=
AWS_BUCKET= AWS_BUCKET=
AWS_ENDPOINT= AWS_ENDPOINT=
AWS_USE_PATH_STYLE_ENDPOINT= AWS_USE_PATH_STYLE_ENDPOINT=
PRODUCTION_REALMLIST=
PTR_REALMLIST=
LOCAL_REALMLIST=
+21
View File
@@ -1,3 +1,9 @@
param(
[Parameter(Mandatory=$false)]
[ValidateSet("production", "ptr", "local")]
[string]$Env = "local"
)
# Stop on errors # Stop on errors
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
@@ -70,6 +76,21 @@ if ($LASTEXITCODE -ge 8) {
Write-Host "MPQ archives deployed to $WOW_HOME" Write-Host "MPQ archives deployed to $WOW_HOME"
# --- Write realmlist.wtf based on selected environment
$realmlist = switch ($Env) {
"production" { $env:PRODUCTION_REALMLIST }
"ptr" { $env:PTR_REALMLIST }
"local" { $env:LOCAL_REALMLIST }
}
if ($realmlist) {
$realmlistPath = Join-Path $WOW_HOME "Data\ruRU\realmlist.wtf"
Set-Content -Path $realmlistPath -Value "set realmlist $realmlist" -Encoding ASCII
Write-Host "Realmlist ($Env): $realmlist"
} else {
Write-Warning "REALMLIST for '$Env' is not set in .env -- skipping realmlist.wtf"
}
# --- Run WoW reload script # --- Run WoW reload script
Write-Host "Launching WoW..." Write-Host "Launching WoW..."
cmd /c $RELOAD_SCRIPT cmd /c $RELOAD_SCRIPT
@@ -177,12 +177,75 @@ function EncounterJournal_InitTab(self)
end end
end end
local function EncounterJournal_ScrollFrame_OnMouseWheel(scrollFrame, delta, isHybrid)
if not scrollFrame then
return false;
end
if isHybrid and HybridScrollFrame_OnMouseWheel then
HybridScrollFrame_OnMouseWheel(scrollFrame, delta);
return true;
end
if ScrollFrameTemplate_OnMouseWheel then
ScrollFrameTemplate_OnMouseWheel(scrollFrame, delta);
return true;
end
local scrollBar = scrollFrame.ScrollBar or scrollFrame.scrollBar or _G[scrollFrame:GetName() .. "ScrollBar"];
if scrollBar then
local minValue, maxValue = scrollBar:GetMinMaxValues();
local step = scrollBar:GetValueStep() or 20;
scrollBar:SetValue(math.min(maxValue, math.max(minValue, scrollBar:GetValue() - delta * step)));
return true;
end
return false;
end
function EncounterJournal_OnMouseWheel(self, delta)
if PlayerGuideFrame and PlayerGuideFrame:IsVisible() and PlayerGuideFrame.BodyScroll and PlayerGuideFrame.BodyScroll:IsShown() then
return EncounterJournal_ScrollFrame_OnMouseWheel(PlayerGuideFrame.BodyScroll, delta);
end
if self.searchResults and self.searchResults:IsVisible() and self.searchResults.scrollFrame and self.searchResults.scrollFrame:IsShown() then
return EncounterJournal_ScrollFrame_OnMouseWheel(self.searchResults.scrollFrame, delta, true);
end
if self.suggestFrame and self.suggestFrame:IsVisible() then
EJSuggestFrame_OnMouseWheel(self.suggestFrame, delta);
return true;
end
local instanceSelect = self.instanceSelect;
if instanceSelect and instanceSelect:IsVisible() and instanceSelect.scroll and instanceSelect.scroll:IsShown() then
return EncounterJournal_ScrollFrame_OnMouseWheel(instanceSelect.scroll, delta);
end
local info = self.encounter and self.encounter.info;
if info and info:IsVisible() then
if info.lootScroll and info.lootScroll:IsShown() then
return EncounterJournal_ScrollFrame_OnMouseWheel(info.lootScroll, delta, true);
elseif info.detailsScroll and info.detailsScroll:IsShown() then
return EncounterJournal_ScrollFrame_OnMouseWheel(info.detailsScroll, delta);
elseif info.overviewScroll and info.overviewScroll:IsShown() then
return EncounterJournal_ScrollFrame_OnMouseWheel(info.overviewScroll, delta);
elseif info.bossesScroll and info.bossesScroll:IsShown() then
return EncounterJournal_ScrollFrame_OnMouseWheel(info.bossesScroll, delta);
end
end
return false;
end
function EncounterJournal_OnLoad(self) function EncounterJournal_OnLoad(self)
EncounterJournalTitleText:SetText(ADVENTURE_JOURNAL); EncounterJournalTitleText:SetText(ADVENTURE_JOURNAL);
SetPortraitToTexture(EncounterJournalPortrait, "Interface\\EncounterJournal\\UI-EJ-PortraitIcon"); SetPortraitToTexture(EncounterJournalPortrait, "Interface\\EncounterJournal\\UI-EJ-PortraitIcon");
self:RegisterCustomEvent("EJ_LOOT_DATA_RECIEVED"); self:RegisterCustomEvent("EJ_LOOT_DATA_RECIEVED");
self:RegisterCustomEvent("EJ_DIFFICULTY_UPDATE"); self:RegisterCustomEvent("EJ_DIFFICULTY_UPDATE");
self:RegisterCustomEvent("SEARCH_DB_LOADED"); self:RegisterCustomEvent("SEARCH_DB_LOADED");
self:EnableMouseWheel(true);
self:SetScript("OnMouseWheel", EncounterJournal_OnMouseWheel);
do do
SetParentFrameLevel(self.inset) SetParentFrameLevel(self.inset)
@@ -1149,6 +1212,30 @@ local toggleTempList = {};
local headerCount = 0; local headerCount = 0;
local loopedSections = {}; local loopedSections = {};
local function EncounterJournal_GetHeaderWidth(sourceFrame)
local width = sourceFrame and sourceFrame:GetWidth() or 0;
if width and width > 20 then
return width;
end
local info = EncounterJournal and EncounterJournal.encounter and EncounterJournal.encounter.info;
local scrollFrame = info and ((info.detailsScroll and info.detailsScroll:IsShown() and info.detailsScroll) or
(info.overviewScroll and info.overviewScroll:IsShown() and info.overviewScroll) or info.detailsScroll or info.overviewScroll);
local child = scrollFrame and (scrollFrame.child or scrollFrame.ScrollChild);
width = child and child:GetWidth() or 0;
if width and width > 20 then
return width;
end
width = scrollFrame and scrollFrame:GetWidth() or 0;
if width and width > 20 then
return math.max(1, width - 30);
end
return 320;
end
function EncounterJournal_UpdateButtonState(self) function EncounterJournal_UpdateButtonState(self)
local oldtex = self.textures.expanded; local oldtex = self.textures.expanded;
if self:GetParent().expanded then if self:GetParent().expanded then
@@ -1178,6 +1265,22 @@ function EncounterJournal_UpdateButtonState(self)
self.tex.down[3]:Hide(); self.tex.down[3]:Hide();
end end
local function EncounterJournal_NormalizeHeaderButton(infoHeader, width)
if not infoHeader or not infoHeader.button then
return;
end
width = width or EncounterJournal_GetHeaderWidth(infoHeader);
infoHeader:SetWidth(width);
infoHeader.button:SetWidth(width);
if infoHeader.button:GetButtonState() ~= "NORMAL" then
infoHeader.button:SetButtonState("NORMAL");
end
EncounterJournal_UpdateButtonState(infoHeader.button);
end
function EncounterJournal_OnClick(self) function EncounterJournal_OnClick(self)
if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then
if self.link then if self.link then
@@ -1471,6 +1574,7 @@ function EncounterJournal_SetUpOverview(self, role, index)
infoHeader.button.link = link; infoHeader.button.link = link;
infoHeader.sectionID = nextSectionID; infoHeader.sectionID = nextSectionID;
EncounterJournal_NormalizeHeaderButton(infoHeader, EncounterJournal_GetHeaderWidth(self));
infoHeader.overviewDescription:SetWidth(infoHeader:GetWidth() - 20); infoHeader.overviewDescription:SetWidth(infoHeader:GetWidth() - 20);
EncounterJournal_SetDescriptionWithBullets(infoHeader, description); EncounterJournal_SetDescriptionWithBullets(infoHeader, description);
infoHeader:Show(); infoHeader:Show();
@@ -1479,7 +1583,7 @@ end
function EncounterJournal_ToggleHeaders(self, doNotShift) function EncounterJournal_ToggleHeaders(self, doNotShift)
local numAdded = 0; local numAdded = 0;
local infoHeader, parentID, _; local infoHeader, parentID, _;
local hWidth = self:GetWidth(); local hWidth = EncounterJournal_GetHeaderWidth(self);
local nextSectionID; local nextSectionID;
local topLevelSection = false; local topLevelSection = false;
@@ -1703,7 +1807,7 @@ function EncounterJournal_ToggleHeaders(self, doNotShift)
end end
infoHeader.index = nil; infoHeader.index = nil;
infoHeader:SetWidth(hWidth); EncounterJournal_NormalizeHeaderButton(infoHeader, hWidth);
EncounterJournal_SetHeaderDescription(infoHeader, description); EncounterJournal_SetHeaderDescription(infoHeader, description);
-- If this section has not be seen and should start open -- If this section has not be seen and should start open
@@ -1717,6 +1821,7 @@ function EncounterJournal_ToggleHeaders(self, doNotShift)
numAdded = numAdded + EncounterJournal_ToggleHeaders(infoHeader, true); numAdded = numAdded + EncounterJournal_ToggleHeaders(infoHeader, true);
end end
EncounterJournal_NormalizeHeaderButton(infoHeader, hWidth);
infoHeader:Show(); infoHeader:Show();
end -- if not filteredByDifficulty end -- if not filteredByDifficulty
@@ -68,6 +68,22 @@ local function updateScrollBar(scrollFrame, contentHeight, contentWidth)
end end
end end
local function scrollFrameOnMouseWheel(scrollFrame, delta)
if not scrollFrame then return end
if ScrollFrameTemplate_OnMouseWheel then
ScrollFrameTemplate_OnMouseWheel(scrollFrame, delta)
return
end
local scrollBar = getScrollBar(scrollFrame)
if scrollBar then
local minValue, maxValue = scrollBar:GetMinMaxValues()
local step = scrollBar:GetValueStep() or 20
scrollBar:SetValue(math.min(maxValue, math.max(minValue, scrollBar:GetValue() - delta * step)))
end
end
local function hideScrollBar(scrollFrame) local function hideScrollBar(scrollFrame)
local scrollBar = getScrollBar(scrollFrame) local scrollBar = getScrollBar(scrollFrame)
if scrollBar then scrollBar:Hide() end if scrollBar then scrollBar:Hide() end
@@ -78,6 +94,24 @@ local function getBodyChild()
return body and body.ScrollChild return body and body.ScrollChild
end end
local resolveEncounterJournalInstanceID
local function getRecommendationArtwork(data)
if type(data) ~= "table" then return nil end
local artwork = data.artwork or data.cover or data.coverImage or data.buttonImage or data.bgImage or data.icon
if artwork and artwork ~= "" then return artwork end
if not resolveEncounterJournalInstanceID or not EJ_GetInstanceInfo then return nil end
local instanceID = resolveEncounterJournalInstanceID(data)
if not instanceID then return nil end
local ok, _, _, bgImage, buttonImage, loreImage, buttonSmallImage = pcall(EJ_GetInstanceInfo, instanceID)
if ok then
return buttonImage or bgImage or loreImage or buttonSmallImage
end
end
-- ─────────────────────────────────── Цепочка этапов ── -- ─────────────────────────────────── Цепочка этапов ──
local stageBadges = {} local stageBadges = {}
@@ -248,7 +282,12 @@ local function renderRecommendations()
card:SetBackdropBorderColor(0.64, 0.45, 0.15, 0.95) card:SetBackdropBorderColor(0.64, 0.45, 0.15, 0.95)
end end
local artwork = getRecommendationArtwork(r)
card.Artwork:SetTexCoord(0, 0.68359375, 0, 0.7421875)
card.Artwork:SetVertexColor(1, 1, 1, 1)
if not artwork or not card.Artwork:SetTexture(artwork) then
card.Artwork:SetTexture(BIOME_TEX[r.biome] or BIOME_TEX.fire) card.Artwork:SetTexture(BIOME_TEX[r.biome] or BIOME_TEX.fire)
end
card.Name:SetText(r.name or r.title or "") card.Name:SetText(r.name or r.title or "")
card.Loc:SetText(r.loc or r.description or "") card.Loc:SetText(r.loc or r.description or "")
card.Level:SetText(r.level or "") card.Level:SetText(r.level or "")
@@ -368,6 +407,8 @@ end
function MW_PlayerGuide_OnLoad(self) function MW_PlayerGuide_OnLoad(self)
EncounterJournal.playerGuideFrame = self EncounterJournal.playerGuideFrame = self
self:EnableMouse(true)
self:EnableMouseWheel(true)
local bodyChild = self.BodyScroll and self.BodyScroll.ScrollChild local bodyChild = self.BodyScroll and self.BodyScroll.ScrollChild
if bodyChild then if bodyChild then
@@ -386,6 +427,12 @@ function MW_PlayerGuide_OnLoad(self)
C_PlayerGuide.RegisterListener(function() refresh() end) C_PlayerGuide.RegisterListener(function() refresh() end)
end end
function MW_PlayerGuide_OnMouseWheel(self, delta)
if self.BodyScroll and self.BodyScroll:IsShown() then
scrollFrameOnMouseWheel(self.BodyScroll, delta)
end
end
function MW_PlayerGuide_OnShow() function MW_PlayerGuide_OnShow()
if not C_PlayerGuide.HasData() then if not C_PlayerGuide.HasData() then
C_PlayerGuide.SetLoading() C_PlayerGuide.SetLoading()
@@ -399,16 +446,94 @@ function MW_PlayerGuide_RefreshButton_OnClick()
C_PlayerGuide.RequestRefresh() C_PlayerGuide.RequestRefresh()
end end
local function validEncounterJournalInstanceID(value)
local instanceID = tonumber(value)
if not instanceID or instanceID <= 0 or not EJ_GetInstanceInfo then return nil end
local ok, instanceName = pcall(EJ_GetInstanceInfo, instanceID)
if ok and instanceName then return instanceID end
end
local function mapIDToEncounterJournalInstanceID(value)
local mapID = tonumber(value)
if not mapID or mapID <= 0 then return nil end
if not C_EncounterJournal or not C_EncounterJournal.GetInstanceIDByMapID then return nil end
local ok, instanceID = pcall(C_EncounterJournal.GetInstanceIDByMapID, mapID)
if ok then
return validEncounterJournalInstanceID(instanceID)
end
end
function resolveEncounterJournalInstanceID(data)
if type(data) == "number" or type(data) == "string" then
return validEncounterJournalInstanceID(data) or mapIDToEncounterJournalInstanceID(data)
end
if type(data) ~= "table" then return nil end
local instanceID =
validEncounterJournalInstanceID(data.ej_instanceID) or
validEncounterJournalInstanceID(data.ejInstanceID) or
validEncounterJournalInstanceID(data.journalInstanceID) or
validEncounterJournalInstanceID(data.instanceID) or
validEncounterJournalInstanceID(data.dungeonID) or
validEncounterJournalInstanceID(data.targetID)
if instanceID then return instanceID end
return mapIDToEncounterJournalInstanceID(data.mapID) or
mapIDToEncounterJournalInstanceID(data.worldMapAreaID) or
mapIDToEncounterJournalInstanceID(data.instanceID) or
mapIDToEncounterJournalInstanceID(data.dungeonID) or
mapIDToEncounterJournalInstanceID(data.targetID)
end
local function requestOpenTarget(data)
if type(data) == "table" and data.id and C_PlayerGuide and C_PlayerGuide.RequestOpenTarget then
C_PlayerGuide.RequestOpenTarget(data.id)
end
end
local function openEncounterJournalInstance(data, encounterID)
if not EncounterJournal then return nil end
local instanceID = resolveEncounterJournalInstanceID(data)
if not instanceID then
requestOpenTarget(data)
return nil
end
if type(data) == "table" and not encounterID then
encounterID = data.encounterID
end
if not EncounterJournal:IsShown() then
ShowUIPanel(EncounterJournal)
end
if EncounterJournal.encounter then
EncounterJournal.encounter:Show()
end
if EncounterJournal.instanceSelect then
EJ_ContentTab_SelectAppropriateInstanceTab(instanceID)
end
if NavBar_Reset and EncounterJournal.navBar then
NavBar_Reset(EncounterJournal.navBar)
end
EncounterJournal_DisplayInstance(instanceID)
if encounterID and encounterID > 0 then
EncounterJournal_DisplayEncounter(encounterID)
end
end
function MW_PlayerGuide_Objective_OnClick(self) function MW_PlayerGuide_Objective_OnClick(self)
local o = self.objectiveData local o = self.objectiveData
if not o then return end if not o then return end
if o.type == "dungeon" or o.type == "raid" then if o.type == "dungeon" or o.type == "raid" then
if o.instanceID and o.instanceID > 0 then openEncounterJournalInstance(o)
if not EncounterJournal:IsShown() then ShowUIPanel(EncounterJournal) end
EJ_ContentTab_SelectAppropriateInstanceTab(o.instanceID)
EncounterJournal_DisplayInstance(o.instanceID)
end
elseif o.type == "boss" then elseif o.type == "boss" then
if o.encounterID and o.encounterID > 0 then if o.encounterID and o.encounterID > 0 then
if not EncounterJournal:IsShown() then ShowUIPanel(EncounterJournal) end if not EncounterJournal:IsShown() then ShowUIPanel(EncounterJournal) end
@@ -457,11 +582,7 @@ function MW_PlayerGuide_Objective_OnLeave() GameTooltip:Hide() end
function MW_PlayerGuide_Rec_OnClick(self) function MW_PlayerGuide_Rec_OnClick(self)
local r = self.recData local r = self.recData
if r and r.instanceID and r.instanceID > 0 then if r then openEncounterJournalInstance(r) end
if not EncounterJournal:IsShown() then ShowUIPanel(EncounterJournal) end
EJ_ContentTab_SelectAppropriateInstanceTab(r.instanceID)
EncounterJournal_DisplayInstance(r.instanceID)
end
end end
function MW_PlayerGuide_Rec_OnEnter(self) function MW_PlayerGuide_Rec_OnEnter(self)
@@ -133,16 +133,19 @@
<Layers> <Layers>
<Layer level="ARTWORK"> <Layer level="ARTWORK">
<!-- Artwork: 138x56, top offset 5 → bottom at y=61 from card top --> <!-- Artwork: 138x56, top offset 5 → bottom at y=61 from card top -->
<Texture name="$parentArtwork" parentKey="Artwork" file="Interface\Buttons\WHITE8X8"> <Texture name="$parentArtwork" parentKey="Artwork" file="Interface\Buttons\WHITE8X8" setAllPoints="true">
<Size><AbsDimension x="168" y="72"/></Size> <Color r="1" g="1" b="1"/>
<Anchors>
<Anchor point="TOP"><Offset><AbsDimension x="0" y="-5"/></Offset></Anchor>
</Anchors>
<Color r="0.55" g="0.16" b="0.07"/>
</Texture> </Texture>
</Layer> </Layer>
<Layer level="OVERLAY"> <Layer level="OVERLAY">
<!-- Level: top-right corner of artwork (artwork starts at y=-5 → level at TOPRIGHT+(-4,-9)) --> <!-- Level: top-right corner of artwork (artwork starts at y=-5 → level at TOPRIGHT+(-4,-9)) -->
<Texture name="$parentTextBackdrop" parentKey="TextBackdrop" file="Interface\Buttons\WHITE8X8">
<Size><AbsDimension x="176" y="42"/></Size>
<Anchors>
<Anchor point="BOTTOM"/>
</Anchors>
<Color r="0" g="0" b="0" a="0.72"/>
</Texture>
<FontString name="$parentLevel" parentKey="Level" inherits="GameFontNormalSmall" justifyH="RIGHT"> <FontString name="$parentLevel" parentKey="Level" inherits="GameFontNormalSmall" justifyH="RIGHT">
<Size><AbsDimension x="80" y="12"/></Size> <Size><AbsDimension x="80" y="12"/></Size>
<Anchors> <Anchors>
@@ -154,7 +157,7 @@
<FontString name="$parentName" parentKey="Name" inherits="GameFontNormal" justifyH="LEFT"> <FontString name="$parentName" parentKey="Name" inherits="GameFontNormal" justifyH="LEFT">
<Size><AbsDimension x="162" y="16"/></Size> <Size><AbsDimension x="162" y="16"/></Size>
<Anchors> <Anchors>
<Anchor point="TOPLEFT"><Offset><AbsDimension x="8" y="-80"/></Offset></Anchor> <Anchor point="TOPLEFT"><Offset><AbsDimension x="8" y="-82"/></Offset></Anchor>
</Anchors> </Anchors>
<Color r="1.0" g="0.91" b="0.63"/> <Color r="1.0" g="0.91" b="0.63"/>
</FontString> </FontString>
@@ -162,7 +165,7 @@
<FontString name="$parentLoc" parentKey="Loc" inherits="MW_PG_Italic" justifyH="LEFT"> <FontString name="$parentLoc" parentKey="Loc" inherits="MW_PG_Italic" justifyH="LEFT">
<Size><AbsDimension x="162" y="16"/></Size> <Size><AbsDimension x="162" y="16"/></Size>
<Anchors> <Anchors>
<Anchor point="TOPLEFT"><Offset><AbsDimension x="8" y="-96"/></Offset></Anchor> <Anchor point="TOPLEFT"><Offset><AbsDimension x="8" y="-98"/></Offset></Anchor>
</Anchors> </Anchors>
</FontString> </FontString>
</Layer> </Layer>
@@ -480,6 +483,7 @@
<Scripts> <Scripts>
<OnLoad function="MW_PlayerGuide_OnLoad"/> <OnLoad function="MW_PlayerGuide_OnLoad"/>
<OnShow function="MW_PlayerGuide_OnShow"/> <OnShow function="MW_PlayerGuide_OnShow"/>
<OnMouseWheel function="MW_PlayerGuide_OnMouseWheel"/>
</Scripts> </Scripts>
</Frame> </Frame>
@@ -313,6 +313,11 @@ function L.GetObjectiveInfo(index)
questID = o.questID, questID = o.questID,
questChainID = o.questChainID, questChainID = o.questChainID,
instanceID = o.instanceID, instanceID = o.instanceID,
ej_instanceID = o.ej_instanceID or o.ejInstanceID,
journalInstanceID = o.journalInstanceID,
mapID = o.mapID,
worldMapAreaID = o.worldMapAreaID,
dungeonID = o.dungeonID,
encounterID = o.encounterID, encounterID = o.encounterID,
achievementID = o.achievementID, achievementID = o.achievementID,
factionID = o.factionID, factionID = o.factionID,
@@ -342,7 +347,19 @@ function L.GetRecommendationInfo(index)
loc = r.loc, loc = r.loc,
level = r.level, level = r.level,
biome = r.biome, biome = r.biome,
artwork = r.artwork,
cover = r.cover,
coverImage = r.coverImage,
bgImage = r.bgImage,
buttonImage = r.buttonImage,
icon = r.icon,
instanceID = r.instanceID, instanceID = r.instanceID,
ej_instanceID = r.ej_instanceID or r.ejInstanceID,
journalInstanceID = r.journalInstanceID,
mapID = r.mapID,
worldMapAreaID = r.worldMapAreaID,
targetID = r.targetID,
dungeonID = r.dungeonID,
encounterID = r.encounterID, encounterID = r.encounterID,
priority = r.priority or 0, priority = r.priority or 0,
} }