Page 1 of 1

RFH: game options, post-Game:run(), setupCommands()

Posted: Sun Jun 02, 2013 2:10 am
by Zizzo
As a follow-up to this earlier comment, I'd like to submit a formal Request For Hooks that would simplify some of my addons, and would particularly simplify combining them into ZOmnibus. To wit:
  • As mentioned earlier, a hook invoked from the various generateListMumble() methods of GameOptions would be useful for addons that add game options (in my case, Auto-Transmo Gems, Opt-in Adventures Parties, Tier-1 Short Circuit Option and Alternate Zones Option). The data{} parameters would include the name of the tab for which the list is being built and the list itself, into which the hook would insert its option(s) in the usual manner.
  • Game:run() invokes the ToME:run hook immediately before calling Game:runReal(); it would be useful to have another hook invoked immediately after that, for addons that want to do something at the start of the game after the character has been loaded or created and everything, including the UI, has been set up. Notes to Self displays its notes popup at this point, for instance, and some of my addons that need to convert their saved data to a new format (recently including Store Wish List) have generally done their work here, in case they needed to show a dialog to the player.
  • My addons that add key commands (Timed Rest, Talent Point Planner, Notes to Self and Store Wish List) superload Game:setupCommands() to add KeyBind:addBinds() calls for their commands; a hook invoked therefrom would be useful for this. ...Hmm, actually, I suppose that would arguably be covered by the preceding hook, since Game:setupCommands() is called from Game:runReal().

Re: RFH: game options, post-Game:run(), setupCommands()

Posted: Fri Nov 01, 2013 11:38 pm
by darkgod
Done 1 & 2
3 doesnt need a hook, superloading there is fine

Re: RFH: game options, post-Game:run(), setupCommands()

Posted: Sat Nov 02, 2013 3:00 am
by Zizzo
darkgod wrote:Done 1 & 2
3 doesnt need a hook, superloading there is fine
Cool, thanks. No worries about 3; as I figured out above, I can achieve pretty much the same effect by putting the addBinds() calls in the hook from 2. [My motivation is that anything I can move into hooks makes maintaining ZOmnibus easier.]