Quantcast ESOUI - View Single Post - CENTER_SCREEN_ANNOUNCE changes
View Single Post
05/23/17, 08:20 AM   #4
Harven
 
Harven's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 137
Hey,
There is a new API to create center screen announcements. This is how I use it in my Thieves Troves Marker addon:

Lua Code:
  1. local params = CENTER_SCREEN_ANNOUNCE:CreateMessageParams(CSA_CATEGORY_LARGE_TEXT, SOUNDS.ACHIEVEMENT_AWARDED)
  2.             params:SetCSAType(CENTER_SCREEN_ANNOUNCE_TYPE_POI_DISCOVERED)
  3.             params:SetText(GetString(HARVENS_THIEVES_TROVE_DISCOVERED))
  4.             CENTER_SCREEN_ANNOUNCE:AddMessageWithParams(params)

List of categories:
Lua Code:
  1. CSA_CATEGORY_SMALL_TEXT = 1
  2. CSA_CATEGORY_LARGE_TEXT = 2
  3. CSA_CATEGORY_NO_TEXT = 3
  4. CSA_CATEGORY_RAID_COMPLETE_TEXT = 4
  5. CSA_CATEGORY_MAJOR_TEXT = 5
  6. CSA_CATEGORY_COUNTDOWN_TEXT = 6

List of SCATypes is in the doc attached in this post: https://forums.elderscrollsonline.co...change-log-pts

Here are useful CENTER_SCREEN_ANNOUNCE public functions:
Lua Code:
  1. CreateBarParams(...)
  2. CreateMessageParams(category, sound) --this returs an object of type ZO_CenterScreenMessageParams
  3. ReleaseMessageParams(messageParams)
  4. CanDisplayMessage(category)
  5. AddMessage(eventId, category, ...) --this is the legacy function
  6. AddMessageWithParams(messageParams)
  7. QueueMessage(messageParams)
  8. DisplayMessage(messageParams)

ZO_CenterScreenMessageParams functions:
Lua Code:
  1. Reset()
  2. SetSound(sound)
  3. GetSound()
  4. SetText(mainText, secondaryText)
  5. GetMainText()
  6. GetSecondaryText()
  7. SetIconData(icon, iconBg)
  8. GetIconData()
  9. SetExpiringCallback(callback)
  10. GetExpiringCallback()
  11. SetBarParams(barParams)
  12. GetBarParams()
  13. SetLifespanMS(lifespanMS)
  14. GetLifespanMS()
  15. MarkSuppressIconFrame()
  16. GetSuppressIconFrame()
  17. MarkQueueImmediately(reinsertStompedMessage)
  18. GetQueueImmediately()
  19. MarkShowImmediately()
  20. GetShowImmediately()
  21. GetMostUniqueMessage()
  22. SetCategory(category)
  23. GetCategory()
  24. SetObjectPoolKey(key)
  25. SetCSAType(csaType)
  26. GetCSAType()
  27. SetPriority(priority)
  28. GetPriority()
  29. SetQueuedOrder(queuedOrder)
  30. GetQueuedOrder()
  31. SetEndOfRaidData(endOfRaidData)
  32. GetEndOfRaidData()
  33. CallExpiringCallback()
  34. PlaySound()
  35. ConvertOldParams(sound, message, combinedMessage, icon, iconBg, expiringCallback, barParams, lifespan, suppressFrame, queueImmediately, showImmediately, reinsertStompedMessage)

You can also add your types with priorities with this function:
Lua Code:
  1. ZO_CenterScreenAnnounce_SetPriority(csaType, priority)

Hope this will be useful
  Reply With Quote