Skip to content

Commit

Permalink
Add Azerothian Archives's The Big Dig event
Browse files Browse the repository at this point in the history
  • Loading branch information
erglo committed Jan 23, 2024
1 parent 278c4e6 commit 62bbbfc
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 0 deletions.
20 changes: 20 additions & 0 deletions MissionReportButtonPlus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,17 @@ local function BuildMenuEntryTooltip(garrInfo, activeThreats)
tooltipText = TooltipText_AddTimeRemainingLine(tooltipText, dfSuperbloomInfo.timeString)
end
end
-- The Big Dig
if ns.settings.showTheBigDigInfo then
local dfTheBigDigInfo = util.poi.GetTheBigDigInfo()
if dfTheBigDigInfo then
tooltipText = TooltipText_AddHeaderLine(tooltipText, L["showTheBigDigInfo"] or dfTheBigDigInfo.name)
tooltipText = TooltipText_AddIconLine(tooltipText, dfTheBigDigInfo.name, dfTheBigDigInfo.atlasName)
tooltipText = TooltipText_AddObjectiveLine(tooltipText, dfTheBigDigInfo.mapInfo.name)
tooltipText = TooltipText_AddObjectiveLine(tooltipText, dfTheBigDigInfo.areaName)
tooltipText = TooltipText_AddTimeRemainingLine(tooltipText, dfTheBigDigInfo.timeString)
end
end
end
end

Expand Down Expand Up @@ -1928,6 +1939,15 @@ function ns.MissionReportButtonPlus_OnAddonCompartmentEnter(button)
util.GameTooltip_AddObjectiveLine(tooltip, lineText, nil, wrapLine, leftOffset, dfSuperbloomInfo.atlasName)
end
end
-- The Big Dig
if ns.settings.showTheBigDigInfo then
local dfTheBigDigInfo = util.poi.GetTheBigDigInfo()
if dfTheBigDigInfo then
local timeLeft = dfTheBigDigInfo.timeString or "...";
local lineText = format("%s @ %s", dfTheBigDigInfo.name, dfTheBigDigInfo.mapInfo.name)..": "..timeLeft
util.GameTooltip_AddObjectiveLine(tooltip, lineText, nil, wrapLine, leftOffset, dfTheBigDigInfo.atlasName)
end
end
end
if (expansion.ID == util.expansion.data.Shadowlands.ID) then
-- Covenant Renown
Expand Down
8 changes: 8 additions & 0 deletions MissionReportButtonPlus_Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ ns.defaultSettings = { --> default + fallback settings
["showTimeRiftInfo"] = true,
["showDreamsurgeInfo"] = true,
["showSuperbloomInfo"] = true,
["showTheBigDigInfo"] = true,
["hideEventDescriptions"] = false,
-- Shadowlands
["showCovenantMissionInfo"] = true,
Expand Down Expand Up @@ -952,6 +953,13 @@ function MRBP_Settings_Register()
tooltip = FormatTooltipTemplate("showSuperbloomInfo", L.CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_SUPERBLOOM),
parentVariable = "showDragonflightWorldMapEvents",
modifyPredicate = ShouldShowEntryTooltip,
},
{
variable = "showTheBigDigInfo",
name = L["showTheBigDigInfo"],
tooltip = FormatTooltipTemplate("showTheBigDigInfo", L.CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_THE_BIG_DIG),
parentVariable = "showDragonflightWorldMapEvents",
modifyPredicate = ShouldShowEntryTooltip,
tag = Settings.Default.True,
},
{
Expand Down
47 changes: 47 additions & 0 deletions MissionReportButtonPlus_Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1712,6 +1712,51 @@ function util.poi.GetSuperbloomInfo()
end
end

----- The Big Dig -----

local TheBigDigData = {}
-- TheBigDigData.areaPoiID = 7657
TheBigDigData.widgetSetID = 1018
TheBigDigData.mapID = DRAGON_ISLES_MAP_ID
TheBigDigData.mapInfos = LocalMapUtil.GetMapChildrenInfo(TheBigDigData.mapID, Enum.UIMapType.Zone)
TheBigDigData.CompareFunction = LocalPoiUtil.DoesEventDataMatchWidgetSetID
TheBigDigData.includeAreaName = true
TheBigDigData.GetNextEventTime = function(self)
-- The event occurs every hour on the half-hour.
local now = GetServerTime()
local waitTimeSeconds = 3600
local eventTime = now + C_DateAndTime.GetSecondsUntilDailyReset() + 1800
while eventTime > (now + waitTimeSeconds) do
eventTime = eventTime - waitTimeSeconds
end
return (eventTime - now)
end
TheBigDigData.GetTimeLeft = function(self)
local secondsLeft = self:GetNextEventTime()
if (secondsLeft >= 0) then
local isActive = (3600-secondsLeft) <= 600 -- event lasts for 10 minutes
local timeLeftInfo = LocalQuestUtil.GetQuestTimeLeftInfo(nil, isActive and 600-(3600-secondsLeft) or secondsLeft)
local timeLeftString = timeLeftInfo and timeLeftInfo.coloredTimeLeftString
return timeLeftString, isActive
end
end

function util.poi.GetTheBigDigInfo()
local poiInfo = LocalPoiUtil.MultipleAreas.GetAreaPoiInfo(TheBigDigData)
if poiInfo then
-- data:SaveLabel("showTheBigDigInfo", poiInfo.name) --> use "Azerothian Archives" instead
if not poiInfo.isTimed then
local timeLeftString, isActive = TheBigDigData:GetTimeLeft()
if timeLeftString then
local activeTimeLeftString = timeLeftString.." "..GREEN_FONT_COLOR:WrapTextInColorCode(SPEC_ACTIVE)
poiInfo.timeString = isActive and activeTimeLeftString or timeLeftString
poiInfo.isTimed = true
end
end
return poiInfo
end
end

----- Battle for Azeroth: Faction Assaults -----

local BfAFactionAssaultsData = {};
Expand Down Expand Up @@ -2039,6 +2084,7 @@ if _log.DEVMODE then
"7471", -- Fyrakk Assaults - Ohn'ahra
"7486", -- Fyrakk Assaults - Ohn'ahra
"7221", -- Elemental Storm (Air)
"7222", -- Elemental Storm (Earth)
"7224", -- Elemental Storm (Water)
"7229", -- Elemental Storm (Air) - Ohn'ahran Plains
"7230", -- Elemental Storm (Earth) - Azure Span
Expand Down Expand Up @@ -2077,6 +2123,7 @@ if _log.DEVMODE then
"7602", -- Dreamsurge, Thaldraszus
"7634", -- Superbloom, Emerald Dream
"7635", -- Superbloom, Emerald Dream
"7657", -- The Big Dig: Traitor's Rest, Azure Span
-- Shadowlands
-- Battle for Azeroth
"5896", -- Faction Assaults (Horde attacking Tiragardesound)
Expand Down
10 changes: 10 additions & 0 deletions data/labels.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ L.defaultLabels = { -- English defaults
["showTimeRiftInfo"] = "Time Rift",
["showDreamsurgeInfo"] = "Dreamsurge",
["showSuperbloomInfo"] = "Superbloom",
["showTheBigDigInfo"] = "Azerothian Archives",
}
--> TODO - Add Shadowlands "Covenant Assaults"
--> TODO - Add BfA "Faction Assaults"
Expand All @@ -109,6 +110,7 @@ local savedLabels = {
["showTimeRiftInfo"] = "Zeitriss",
["showDreamsurgeInfo"] = "Traumsprung",
["showSuperbloomInfo"] = "Superblüte",
["showTheBigDigInfo"] = "Archive von Azeroth",
},
["esES"] = {
["showLegionAssaultsInfo"] = "Asalto de la Legión", -- Legion
Expand All @@ -126,6 +128,7 @@ local savedLabels = {
["showTimeRiftInfo"] = "Falla temporal",
["showDreamsurgeInfo"] = "Pico Onírico",
["showSuperbloomInfo"] = "Superfloración",
["showTheBigDigInfo"] = "Archivos de Azeroth",
},
["frFR"] = {
["showLegionAssaultsInfo"] = "Assaut de la Légion", -- Legion
Expand All @@ -143,6 +146,7 @@ local savedLabels = {
["showTimeRiftInfo"] = "Faille temporelle",
["showDreamsurgeInfo"] = "Poussée onirique",
["showSuperbloomInfo"] = "Superfloraison",
["showTheBigDigInfo"] = "Archives d’Azeroth",
},
["itIT"] = {
["showLegionAssaultsInfo"] = "Assalto della Legione ", -- Legion
Expand All @@ -160,6 +164,7 @@ local savedLabels = {
["showTimeRiftInfo"] = "Fenditura del Tempo",
["showDreamsurgeInfo"] = "Sovronirico",
["showSuperbloomInfo"] = "Superfioritura",
["showTheBigDigInfo"] = "Archivi Azerothiani",
},
["ptBR"] = {
["showLegionAssaultsInfo"] = "Ataque da Legião", -- Legion
Expand All @@ -177,6 +182,7 @@ local savedLabels = {
["showTimeRiftInfo"] = "Fenda Temporal",
["showDreamsurgeInfo"] = "Surto Onírico",
["showSuperbloomInfo"] = "Superflorada",
["showTheBigDigInfo"] = "Arquivo Azerothiano",
},
["ruRU"] = {
["showLegionAssaultsInfo"] = "Атака Легиона", -- Legion
Expand All @@ -194,6 +200,7 @@ local savedLabels = {
["showTimeRiftInfo"] = "Портал времени",
["showDreamsurgeInfo"] = "Прилив Снов",
["showSuperbloomInfo"] = "Цветочный бум",
["showTheBigDigInfo"] = "Азеротские Архивы",
},
["zhCN"] = {
["showLegionAssaultsInfo"] = "军团入侵", -- Legion
Expand All @@ -211,6 +218,7 @@ local savedLabels = {
["showTimeRiftInfo"] = "时光裂隙",
["showDreamsurgeInfo"] = "梦涌",
["showSuperbloomInfo"] = "超然",
["showTheBigDigInfo"] = "艾泽拉斯档案馆",
},
["zhTW"] = {
["showLegionAssaultsInfo"] = "軍團入侵", -- Legion
Expand All @@ -228,6 +236,7 @@ local savedLabels = {
["showTimeRiftInfo"] = "時間裂隙",
-- ["showDreamsurgeInfo"] = "",
-- ["showSuperbloomInfo"] = "",
-- ["showTheBigDigInfo"] = "",
},
}

Expand Down Expand Up @@ -337,4 +346,5 @@ ns.data.LoadInGameLabels = function(self)
L["showTimeRiftInfo"] = ns.data:GetLabel("showTimeRiftInfo")
L["showDreamsurgeInfo"] = ns.data:GetLabel("showDreamsurgeInfo")
L["showSuperbloomInfo"] = ns.data:GetLabel("showSuperbloomInfo")
L["showTheBigDigInfo"] = ns.data:GetLabel("showTheBigDigInfo")
end
1 change: 1 addition & 0 deletions locales/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ ns.L = {
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_TIME_RIFTS = "der Zeitrisse in Thaldraszus",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_DREAMSURGE = "des Traumsprungs auf den Dracheninseln",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_SUPERBLOOM = "der Superblüte im Smaragdgrünen Traum",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_THE_BIG_DIG = "über das große Buddeln auf den Dracheninseln",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_RESEARCHERS_UNDER_FIRE = "von Forscher unter Feuer in der Zaralekhöhle",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_ONLY_IN_ZARALEK_CAVERN = "(Funktioniert nur in der Zaralekhöhle!)",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_HIDE_EVENT_DESCRIPTIONS = "Wenn aktiviert, werden Texte die weitere Details zu einem Ereignis beschreiben, ausgeblendet.",
Expand Down
1 change: 1 addition & 0 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ ns.L = {
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_TIME_RIFTS = "the Time Rifts in Thaldraszus",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_DREAMSURGE = "the Dreamsurge on the Dragon Isles",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_SUPERBLOOM = "the Superbloom in the Emerald Dream",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_THE_BIG_DIG = "the Big Dig event on the Dragon Isles",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_RESEARCHERS_UNDER_FIRE = "Researchers Under Fire in the Zaralek Cavern",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_ONLY_IN_ZARALEK_CAVERN = "(Works in Zaralek Cavern only!)",
CFG_DDMENU_ENTRYTOOLTIP_EVENT_POI_HIDE_EVENT_DESCRIPTIONS = "Hides additional event description texts when enabled.",
Expand Down

0 comments on commit 62bbbfc

Please sign in to comment.