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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
local DEFAULT_FROM_DISPLAY_NAME = nil
local DEFAULT_RAW_MESSAGE_TEXT = nil
local DEFAULT_TARGET_CHANNEL = nil
local g_pvpKillFeedDeathRecurrenceTracker = nil
do
-- The PvP Kill Feed uses ZO_RecurrenceTracker to track whether any given
-- killer/victim message has been shown within the last 10 seconds from a
-- given source (local vs. kill location). Note that the instance count
-- tracked by ZO_RecurrenceTracker is irrelevant here for the purpose of
-- the kill feed.
local EXPIRATION_MS = 10000 -- 10 seconds
local EXTENSION_MS = 10000 -- 10 seconds
end
if channelInfo . channelLinkable then
end
end
if isCustomerServiceAccount then
return "|t16:16:EsoUI/Art/ChatWindow/csIcon.dds|t"
end
return ""
end
end
end
-- message formatting events can be keyed off of anything, including strings, but numbers will be assumed to be EVENT_MANAGER events and will automatically be registered.
local BUILTIN_MESSAGE_FORMATTERS = {
[ EVENT_CHAT_MESSAGE_CHANNEL ] = function ( messageType , fromName , text , isFromCustomerService , fromDisplayName )
local channelInfo = ChannelInfo [ messageType ]
local userFacingName
--We have a character name and a display name, so follow the setting
else
--We either have two display names, or we weren't given a guaranteed display name, so just use the default fromName
userFacingName = fromName
end
local fromLink = channelInfo . playerLinkable and ZO_LinkHandler_CreatePlayerLink ( userFacingName ) or userFacingName
if channelInfo . formatMessage then
end
local channelInfoFormat
else
end
local channelInfoNarrationFormat
else
end
end
-- Channels with links will not have CS messages
local formattedText
local formattedNarrationText
if channelLink then
if channelInfoNarrationFormat then
end
else
if channelInfo . supportCSIcon then
formattedText = string . format ( channelInfoFormat , GetCustomerServiceIcon ( isFromCustomerService ) , fromLink , text )
if channelInfoNarrationFormat then
formattedNarrationText = string . format ( channelInfoNarrationFormat , GetCustomerServiceIcon ( isFromCustomerService ) , fromLink , text )
end
else
if channelInfoNarrationFormat then
end
end
end
end
end ,
[ EVENT_BROADCAST ] = function ( message )
return string . format ( GetString ( SI_CHAT_MESSAGE_SYSTEM ) , GetString ( "SI_CHATCHANNELCATEGORIES" , CHAT_CATEGORY_SYSTEM ) , message )
end ,
[ EVENT_FRIEND_PLAYER_STATUS_CHANGED ] = function ( displayName , characterName , oldStatus , newStatus )
local wasOnline = oldStatus ~= PLAYER_STATUS_OFFLINE
local isOnline = newStatus ~= PLAYER_STATUS_OFFLINE
if wasOnline ~= isOnline then
if isOnline then
if characterName ~= "" then
else
end
else
if characterName ~= "" then
text = zo_strformat ( SI_FRIENDS_LIST_FRIEND_CHARACTER_LOGGED_OFF , displayNameLink , characterNameLink )
else
end
end
end
end ,
[ EVENT_IGNORE_ADDED ] = function ( displayName )
end ,
[ EVENT_IGNORE_REMOVED ] = function ( displayName )
end ,
[ EVENT_GROUP_TYPE_CHANGED ] = function ( largeGroup )
if largeGroup then
else
end
end ,
[ EVENT_GROUP_INVITE_RESPONSE ] = function ( characterName , response , displayName )
-- Only one name will be sent here, so use that and do not use special formatting since this appears in chat
local nameToDisplay
if characterName ~= "" then
else
end
local alertMessage = nameToDisplay ~= "" and zo_strformat ( GetString ( "SI_GROUPINVITERESPONSE" , response ) , nameToDisplay ) or GetString ( SI_PLAYER_BUSY )
return alertMessage , nil , displayName
end
end ,
end
end ,
[ EVENT_TRIAL_FEATURE_RESTRICTED ] = function ( restrictionType )
end
end ,
[ EVENT_GROUP_MEMBER_LEFT ] = function ( characterName , reason , isLocalPlayer , isLeader , displayName , actionRequiredVote )
if reason == GROUP_LEAVE_REASON_KICKED and isLocalPlayer and actionRequiredVote then
end
end ,
[ EVENT_BATTLEGROUND_INACTIVITY_WARNING ] = function ( )
end ,
[ EVENT_GUILD_KEEP_ATTACK_UPDATE ] = function ( channel , numGuardsKilled , numAttackers , location )
if tonumber ( GetSetting ( SETTING_TYPE_UI , UI_SETTING_SHOW_AVA_NOTIFICATIONS ) ) ~= AVA_NOTIFICATIONS_SETTING_CHOICE_DONT_SHOW and
tonumber ( GetSetting ( SETTING_TYPE_UI , UI_SETTING_SHOW_GUILD_KEEP_NOTICES ) ) == GUILD_KEEP_NOTICES_SETTING_CHOICE_CHAT then
local channelInfo = ChannelInfo [ channel ]
if channelInfo then
if numGuardsKilled > 0 then
else
end
return formattedText
end
end
end ,
[ EVENT_PVP_KILL_FEED_DEATH ] = function ( killLocation , killerDisplayName , killerCharacterName , killerAlliance , killerRank , victimDisplayName , victimCharacterName , victimAlliance , victimRank , isKillLocation )
local showKillFeedNotifications = GetSetting_Bool ( SETTING_TYPE_UI , UI_SETTING_SHOW_PVP_KILL_FEED_NOTIFICATIONS )
if not showKillFeedNotifications then
return nil
end
local messageKeyLocal = "L" .. messageKeySuffix
local messageKeyKillLocation = "B" .. messageKeySuffix
if isKillLocation then
-- This message was kill location sourced.
-- The same message was already shown as a result of a local message;
-- remove the original message from the tracker and suppress this message.
return nil
end
-- Track this kill location sourced message.
else
-- This message was locally sourced.
-- The same message was already shown as a result of a kill location message;
-- remove the original message from the tracker and suppress this message.
return nil
end
-- Track this locally sourced message.
end
local killerAllianceColor
local victimAllianceColor
if isBattleground then
else
end
local ICON_SIZE = 24
local killerIcon
local victimIcon
if isBattleground then
else
end
local killerAllianceName
local victimAllianceName
if isBattleground then
else
end
local hasLocation = killLocation and killLocation ~= ""
local messageStringId = hasLocation and SI_PVP_KILL_FEED_DEATH_AND_LOCATION or SI_PVP_KILL_FEED_DEATH
local message = zo_strformat ( messageStringId , killerAllianceColor : Colorize ( killerName ) , killerIcon , victimAllianceColor : Colorize ( victimName ) , victimIcon , killLocation )
local narrationStringId = hasLocation and SI_PVP_KILL_FEED_DEATH_AND_LOCATION_NARRATION or SI_PVP_KILL_FEED_DEATH_NARRATION
local narrationMessage = zo_strformat ( narrationStringId , killerAllianceName , killerRankName , killerName , victimAllianceName , victimRankName , victimName , killLocation )
return message , DEFAULT_TARGET_CHANNEL , DEFAULT_FROM_DISPLAY_NAME , DEFAULT_RAW_MESSAGE_TEXT , narrationMessage , ZO_WHITE
end ,
-- System messages will already be formatted by the time they get here
end ,
-- Transcript messages will already be formatted by the time they get here
end ,
}
-----------------
-- Chat Router --
-----------------
--[[
The chat router's job is to format chat events and route them to the multiple chat subsystems that exist.
All methods should be safely callable without checking if the chat system is available or not
]] --
return object
end
return
end
end
local enableTranscriptForwarding = GetSetting_Bool ( SETTING_TYPE_ACCESSIBILITY , ACCESSIBILITY_SETTING_SEND_TRANSCRIPT_TO_TEXT_CHAT )
end
EVENT_MANAGER : RegisterForEvent ( "ChatRouter" , EVENT_VOICE_CHAT_ACCESSIBILITY_SETTING_CHANGED , SetTranscriptForwardingEnabled )
EVENT_MANAGER : RegisterForEvent ( "ChatRouter" , EVENT_FORWARD_TRANSCRIPT_TO_TEXT_CHAT_ACCESSIBILITY_SETTING_CHANGED , SetTranscriptForwardingEnabled )
end
end
-- FlashTaskbarWindow is a private function: to keep it from tainting the normal event handler we'll register for it seperately
if chatChannel == CHAT_CHANNEL_WHISPER then
local NUM_FLASHES_BEFORE_SOLID = 7
end
end
EVENT_MANAGER : RegisterForEvent ( "ChatRouterNotification" , EVENT_CHAT_MESSAGE_CHANNEL , OnChatMessageChannel )
end
end
do
end
return
end
local eventCode = eventKey
end
end
end
do
local MultiLevelEventToCategoryMappings , SimpleEventToCategoryMappings = ZO_ChatSystem_GetEventCategoryMappings ( )
return
end
local eventCategory = nil
if SimpleEventToCategoryMappings [ eventKey ] then
eventCategory = SimpleEventToCategoryMappings [ eventKey ]
elseif MultiLevelEventToCategoryMappings [ eventKey ] then
eventCategory = MultiLevelEventToCategoryMappings [ eventKey ] [ messageType ]
end
local formattedEventText , targetChannel , fromDisplayName , rawMessageText , formattedNarrationText , overrideColorDef = messageFormatter ( ... )
if formattedEventText then
if targetChannel then
end
self : FireCallbacks ( "FormattedChatMessage" , formattedEventText , eventCategory , targetChannel , fromDisplayName , rawMessageText , formattedNarrationText , overrideColorDef )
end
end
end
end
end
end
end
end
else
end
end
end
end
end
--- Global functions ---
end
end
return false
end
end
else
end
end |