diff --git a/.env.example b/.env.example index 96f07f9..43818af 100644 --- a/.env.example +++ b/.env.example @@ -5,4 +5,8 @@ AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION= AWS_BUCKET= AWS_ENDPOINT= -AWS_USE_PATH_STYLE_ENDPOINT= \ No newline at end of file +AWS_USE_PATH_STYLE_ENDPOINT= + +PRODUCTION_REALMLIST= +PTR_REALMLIST= +LOCAL_REALMLIST= \ No newline at end of file diff --git a/run.ps1 b/run.ps1 index e139258..e97543f 100644 --- a/run.ps1 +++ b/run.ps1 @@ -1,3 +1,9 @@ +param( + [Parameter(Mandatory=$false)] + [ValidateSet("production", "ptr", "local")] + [string]$Env = "local" +) + # Stop on errors $ErrorActionPreference = "Stop" @@ -70,6 +76,21 @@ if ($LASTEXITCODE -ge 8) { 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 Write-Host "Launching WoW..." cmd /c $RELOAD_SCRIPT diff --git a/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/Custom_EncounterJournal.lua b/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/Custom_EncounterJournal.lua index cddaae8..c5d5209 100644 --- a/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/Custom_EncounterJournal.lua +++ b/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/Custom_EncounterJournal.lua @@ -177,12 +177,75 @@ function EncounterJournal_InitTab(self) 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) EncounterJournalTitleText:SetText(ADVENTURE_JOURNAL); SetPortraitToTexture(EncounterJournalPortrait, "Interface\\EncounterJournal\\UI-EJ-PortraitIcon"); self:RegisterCustomEvent("EJ_LOOT_DATA_RECIEVED"); self:RegisterCustomEvent("EJ_DIFFICULTY_UPDATE"); self:RegisterCustomEvent("SEARCH_DB_LOADED"); + self:EnableMouseWheel(true); + self:SetScript("OnMouseWheel", EncounterJournal_OnMouseWheel); do SetParentFrameLevel(self.inset) @@ -1149,6 +1212,30 @@ local toggleTempList = {}; local headerCount = 0; 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) local oldtex = self.textures.expanded; if self:GetParent().expanded then @@ -1178,6 +1265,22 @@ function EncounterJournal_UpdateButtonState(self) self.tex.down[3]:Hide(); 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) if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then if self.link then @@ -1471,6 +1574,7 @@ function EncounterJournal_SetUpOverview(self, role, index) infoHeader.button.link = link; infoHeader.sectionID = nextSectionID; + EncounterJournal_NormalizeHeaderButton(infoHeader, EncounterJournal_GetHeaderWidth(self)); infoHeader.overviewDescription:SetWidth(infoHeader:GetWidth() - 20); EncounterJournal_SetDescriptionWithBullets(infoHeader, description); infoHeader:Show(); @@ -1479,7 +1583,7 @@ end function EncounterJournal_ToggleHeaders(self, doNotShift) local numAdded = 0; local infoHeader, parentID, _; - local hWidth = self:GetWidth(); + local hWidth = EncounterJournal_GetHeaderWidth(self); local nextSectionID; local topLevelSection = false; @@ -1703,7 +1807,7 @@ function EncounterJournal_ToggleHeaders(self, doNotShift) end infoHeader.index = nil; - infoHeader:SetWidth(hWidth); + EncounterJournal_NormalizeHeaderButton(infoHeader, hWidth); EncounterJournal_SetHeaderDescription(infoHeader, description); -- 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); end + EncounterJournal_NormalizeHeaderButton(infoHeader, hWidth); infoHeader:Show(); end -- if not filteredByDifficulty diff --git a/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/PlayerGuide.lua b/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/PlayerGuide.lua index 25ffe1c..0e41bcc 100644 --- a/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/PlayerGuide.lua +++ b/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/PlayerGuide.lua @@ -68,6 +68,22 @@ local function updateScrollBar(scrollFrame, contentHeight, contentWidth) 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 scrollBar = getScrollBar(scrollFrame) if scrollBar then scrollBar:Hide() end @@ -78,6 +94,24 @@ local function getBodyChild() return body and body.ScrollChild 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 = {} @@ -248,7 +282,12 @@ local function renderRecommendations() card:SetBackdropBorderColor(0.64, 0.45, 0.15, 0.95) end - card.Artwork:SetTexture(BIOME_TEX[r.biome] or BIOME_TEX.fire) + 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) + end card.Name:SetText(r.name or r.title or "") card.Loc:SetText(r.loc or r.description or "") card.Level:SetText(r.level or "") @@ -368,6 +407,8 @@ end function MW_PlayerGuide_OnLoad(self) EncounterJournal.playerGuideFrame = self + self:EnableMouse(true) + self:EnableMouseWheel(true) local bodyChild = self.BodyScroll and self.BodyScroll.ScrollChild if bodyChild then @@ -386,6 +427,12 @@ function MW_PlayerGuide_OnLoad(self) C_PlayerGuide.RegisterListener(function() refresh() 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() if not C_PlayerGuide.HasData() then C_PlayerGuide.SetLoading() @@ -399,16 +446,94 @@ function MW_PlayerGuide_RefreshButton_OnClick() C_PlayerGuide.RequestRefresh() 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) local o = self.objectiveData if not o then return end if o.type == "dungeon" or o.type == "raid" then - if o.instanceID and o.instanceID > 0 then - if not EncounterJournal:IsShown() then ShowUIPanel(EncounterJournal) end - EJ_ContentTab_SelectAppropriateInstanceTab(o.instanceID) - EncounterJournal_DisplayInstance(o.instanceID) - end + openEncounterJournalInstance(o) elseif o.type == "boss" then if o.encounterID and o.encounterID > 0 then 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) local r = self.recData - if r and r.instanceID and r.instanceID > 0 then - if not EncounterJournal:IsShown() then ShowUIPanel(EncounterJournal) end - EJ_ContentTab_SelectAppropriateInstanceTab(r.instanceID) - EncounterJournal_DisplayInstance(r.instanceID) - end + if r then openEncounterJournalInstance(r) end end function MW_PlayerGuide_Rec_OnEnter(self) diff --git a/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/PlayerGuide.xml b/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/PlayerGuide.xml index 9d9a2c5..528d8f6 100644 --- a/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/PlayerGuide.xml +++ b/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Custom_EncounterJournal/PlayerGuide.xml @@ -133,16 +133,19 @@ - - - - - - + + + + + + + + + @@ -154,7 +157,7 @@ - + @@ -162,7 +165,7 @@ - + @@ -480,6 +483,7 @@ + diff --git a/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Utils/C_PlayerGuide.lua b/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Utils/C_PlayerGuide.lua index 8652c48..2f5abd4 100644 --- a/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Utils/C_PlayerGuide.lua +++ b/src/Data/ruRU/patch-ruRU-5/Interface/AddOns/MoonWellClient/EncounterJournal/Utils/C_PlayerGuide.lua @@ -313,6 +313,11 @@ function L.GetObjectiveInfo(index) questID = o.questID, questChainID = o.questChainID, 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, achievementID = o.achievementID, factionID = o.factionID, @@ -342,7 +347,19 @@ function L.GetRecommendationInfo(index) loc = r.loc, level = r.level, biome = r.biome, + artwork = r.artwork, + cover = r.cover, + coverImage = r.coverImage, + bgImage = r.bgImage, + buttonImage = r.buttonImage, + icon = r.icon, 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, priority = r.priority or 0, }