|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
end end EVENT_MANAGER:RegisterForEvent("ZO_SpectacleEvents_Manager", EVENT_SPECTACLE_EVENT_UPDATED, OnSpectacleEventUpdated) local function OnSpectacleEventPhaseUpdated(_, spectacleEventId, oldActivePhaseId, newActivePhaseId, isInitialUpdate) self:UpdateActiveSpectacleEventPhaseId(spectacleEventId, oldActivePhaseId, newActivePhaseId, isInitialUpdate) end EVENT_MANAGER:RegisterForEvent("ZO_SpectacleEvents_Manager", EVENT_SPECTACLE_EVENT_PHASE_UPDATED, OnSpectacleEventPhaseUpdated)endendend else end endendfunction ZO_SpectacleEvents_Manager:UpdateActiveSpectacleEventPhaseId(spectacleEventId, oldActivePhaseId, newActivePhaseId, isInitialUpdate) if oldActivePhaseId ~= newActivePhaseId then if oldActivePhaseId ~= 0 then self:FireCallbacks("ActiveSpectacleEventPhaseComplete", spectacleEventId, oldActivePhaseId, isInitialUpdate) end if newActivePhaseId ~= 0 then self:FireCallbacks("ActiveSpectacleEventPhaseStarted", spectacleEventId, newActivePhaseId, isInitialUpdate) end endend local secondsRemainingUntilStart = GetSecondsRemainingUntilNextActiveSpectacleEventPhase(spectacleEventId) local timeRemainingString if secondsRemainingUntilStart < ZO_ONE_MINUTE_IN_SECONDS then else timeRemainingString = ZO_FormatTimeLargestTwo(secondsRemainingUntilStart, TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_HIDE_ZEROES) end if currentPhase >= numPhases then -- There can be a phantom phase at the end of the event to allow for a more graceful ending -- In that case currentPhase == numPhases, but the server will have sent us a transition time if secondsRemainingUntilStart > 0 then return zo_strformat(SI_SPECTACLE_EVENTS_EVENT_ENDS_IN_FORMATTER, ZO_SELECTED_TEXT:Colorize(timeRemainingString)) end return nil end local nextPhase = currentPhase + 1 end if secondsRemainingUntilStart <= 0 then end return zo_strformat(SI_SPECTACLE_EVENTS_PHASE_BEGINS_IN_FORMATTER, nextPhase, ZO_SELECTED_TEXT:Colorize(timeRemainingString))end |