ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Creating a new subtitle popup (https://www.esoui.com/forums/showthread.php?t=5584)

dominoid 01/09/16 07:48 PM

Creating a new subtitle popup
 
I made great progress on the custom quest in the quest list. I got all the functions working in the Journal and haven't given up on getting the UI quest tracker to find it. Thought I'd ask a "quick" one in another area.

Looking at http://esodata.uesp.net/current/src/...itles.lua.html, why isn't making a new subtitle as easy as calling:

Lua Code:
  1. ZO_Subtitle:New(messageType, "Dominoid", "Something Dominoid is saying."

in the code? What is the "best" way to show a custom NPC subtitle? Should I add a fake NPC conversation to the NPC chat tab?

I noticed that ZO_Alert has a nice and tidy:

Lua Code:
  1. function ZO_Alert(category, soundId, message, ...)

TIA Again.

Shinni 01/18/16 02:36 PM

Whenever a NPC is talking, the game fires a EVENT_SHOW_SUBTITLE. The subtitle manager listens to this event and displays the subtitle whenever the event is fired (see line 87 of your linked source).
The subtitle manager displays the subtitle by calling OnShowSubtitle, so I'd call that function:
Lua Code:
  1. ZO_SUBTITLE_MANAGER:OnShowSubtitle(0,"Name","message")
The first argument is the message type. I don't know what types there are, but 0 worked fine when i tested it,

dominoid 01/21/16 08:54 AM

Thanks. Worked perfectly and annoyed me at it's simplicity. ;-)


All times are GMT -6. The time now is 01:41 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI