[v1.7.0+] Interact with Sidekicks
Posted: Fri Dec 25, 2020 3:00 am
So, you may have noticed that I've been on a bit of a tear recently
expanding the functionality of various of my addons as they relate to player companions like the golem. (Mostly this was driven by playing various addon classes like Hiveminder and Mirrorblade, which have companions that you can equip and spend talent points for.) Naturally, I missed the Interact-with-the-Golem-style chat interaction that I had implemented with Interact with the Worm and Interact with the Mech, and I started thinking, "Can I generalize those?" The result is my new Interact with Sidekicks addon.
Lacking an obvious place to put an interact-with talent, we provide several other interfaces: the "Interact with party member" keybinding (bound to <Alt-Shift-I> by default), the "Interact with Party Members" action on the main game menu, and the "Interact" action on the map menu when you right-click on a sidekick. We re-use interfaces where we can; if you choose the Alchemist golem, for instance, we forward to the Interact with the Golem talent, and similarly for Writhing Ones' worm that walks and Annihilators' mecharachnid if you have the corresponding addons installed. For the general case we have a similar dialog of our own, less flavor-texty but covering all the commands that we can confirm the sidekick in question can handle.
The part that I'm really proud of, though, is that we also cover the two main things that you generally still have to take direct control of a sidekidk to do, even with the fancy dialogs: apply an inscription to it or change its talent point plan. Both of those are implemented on the general-purpose dialog for sidekicks that support them (checking for the relevant addon in the latter case, of course), and we even back-patch them into the existing interact-with talent dialogs (it looks like the mecharachnid supports inscription changing, if only to upgrade its steam generator).
(NOTE: The Talent Point Planner addon required a bit of re-architecting to work with this addon, so for compatibility, you'll want to upgrade it to release 10.8.3 or higher if you're using it with this addon. Similarly, ZOmnibus or ZOmnibus Lite will need to be upgraded to at least release 17.2.3.)
[Implementation notes:]

Lacking an obvious place to put an interact-with talent, we provide several other interfaces: the "Interact with party member" keybinding (bound to <Alt-Shift-I> by default), the "Interact with Party Members" action on the main game menu, and the "Interact" action on the map menu when you right-click on a sidekick. We re-use interfaces where we can; if you choose the Alchemist golem, for instance, we forward to the Interact with the Golem talent, and similarly for Writhing Ones' worm that walks and Annihilators' mecharachnid if you have the corresponding addons installed. For the general case we have a similar dialog of our own, less flavor-texty but covering all the commands that we can confirm the sidekick in question can handle.
The part that I'm really proud of, though, is that we also cover the two main things that you generally still have to take direct control of a sidekidk to do, even with the fancy dialogs: apply an inscription to it or change its talent point plan. Both of those are implemented on the general-purpose dialog for sidekicks that support them (checking for the relevant addon in the latter case, of course), and we even back-patch them into the existing interact-with talent dialogs (it looks like the mecharachnid supports inscription changing, if only to upgrade its steam generator).
(NOTE: The Talent Point Planner addon required a bit of re-architecting to work with this addon, so for compatibility, you'll want to upgrade it to release 10.8.3 or higher if you're using it with this addon. Similarly, ZOmnibus or ZOmnibus Lite will need to be upgraded to at least release 17.2.3.)
[Implementation notes:]
Code: Select all
Hooks:
ToME:load [to install our keybinding]
Game:alterGameMenu [to add our 'Interact with Party Members' action]
Chat:load [to modify existing interact-with chat dialogs]
Superload:
mod.class.Game:
setupCommands() [to add our action to the keybinding]
mod.dialogs.MapMenu:
generateList() [to add "Interact" action as appropriate]