[v1.3.0+] Juggle Hotkeys on Unwield

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

[v1.3.0+] Juggle Hotkeys on Unwield

#1 Post by Zizzo »

As you may or may not know, hotkeys for activateable wielded objects don't go away when you unwield them; activating a hotkey for an unwielded object wields the object instead of activating it. Which can be deadly if you weren't expecting it. Hence my new Juggle Hotkeys on Unwield addon.

Originally I was just going to add a special marker to the hotkey icon for unwielded items, but then Steven Aus requested a way to have the icon be removed altogether, so I expanded the addon's purview a bit. Now we add a game option "UI | Hotkey handling on unwield", with values "Default", "Mark" or "Remove".

Now, I haven't exhaustively tested this addon, just made sure it works with my usual option settings; in particular, I'm not sure how it interacts with the "Always add objects to hotkeys" option (which I turned off). So I'm putting this out for further testing before likely eventual merging into ZOmnibus.

[edit 2017-07-15: Technical info]

Code: Select all

Hooks:
  ToME:run [to surgically modify the hotkeys toolbar for our needs]
  ToME:runDone [to apply our settings on game load]
  GameOptions:generateList [to add our game options]
Superload:
  mod.class.Player:
    onWear() [to update hotkey marks]
    onTakeoff() [to update hotkey marks]
    onRemoveObject() [to update hotkey marks]
Last edited by Zizzo on Sun Jul 16, 2017 1:22 am, edited 1 time in total.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#2 Post by Zizzo »

Zizzo wrote:Now, I haven't exhaustively tested this addon, […]
Eh heh… :oops: So it turns out we weren't passing necessary artifact set handing information through our superloaded onWear() and onTakeoff(), which was breaking stuff in a lot of places (I tripped over it, for instance, trying to exit the level-up dialog while wielding a completed set of mindstars :shock: ). Simple enough to fix; that's going out as v1a. We Apologize for the Inconvenience.™
"Blessed are the yeeks, for they shall inherit Arda..."

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#3 Post by Steven Aus »

Can you also apply this to stacks of one-use scrolls and infusion patches (from Utility Supplies) when you run out of them? Not sure if you want them to automatically appear on the bar or not though when you get the first one of a certain stack.

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#4 Post by Zizzo »

Steven Aus wrote:Can you also apply this to stacks of one-use scrolls and infusion patches (from Utility Supplies) when you run out of them?
Ah, that's a slightly different angle: those are usable from inventory, which isn't something this addon addresses directly. [sound F/X: testing] So for instance, if you have "Hotkey handling on unwield" set to "Mark", then Summertide Phial's hotkey will be marked when you unwield it and go empty when you drop it. Similarly with f.i. the Rod of Spydric Poison if you hotkey it and then drop it.

What behavior do we want for this? It would probably be straightforward, for instance, to add another boolean option to remove an item's hotkey if it's dropped or destroyed (or consumed, in your case).
Steven Aus wrote:Not sure if you want them to automatically appear on the bar or not though when you get the first one of a certain stack.
(shrug) I assume that would depend on whether you have the "Always add objects to hotkeys" option enabled (I don't, so I wouldn't know).
"Blessed are the yeeks, for they shall inherit Arda..."

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#5 Post by Steven Aus »

I do, but I'm not sure if I notice every time whether consumables are added to the hotbar.

Steven Aus
Archmage
Posts: 366
Joined: Sat Dec 13, 2014 3:38 pm

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#6 Post by Steven Aus »

It doesn't appear to add consumables to the hotbar when you get the first one of a certain type.

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#7 Post by Zizzo »

Zizzo wrote:It would probably be straightforward, for instance, to add another boolean option to remove an item's hotkey if it's dropped or destroyed (or consumed, in your case).
Well, that turned out not to be quite as straightforward as I'd hoped, but it wasn't too bad; v1b, just released, adds a boolean game option "UI | Remove hotkey on unwield", which does pretty much exactly what it sounds like it does. :wink: And I can confirm from testing that with this new option enabled, if you put a stack of scrolls or infusion patches on the hotkeys toolbar, the hotkey will be removed when you use up the last of the stack.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#8 Post by Zizzo »

In addition to compatibiity changes for the merge into ZOmnibus/Lite v16, v1c is mostly internal structural changes. See, when I first wrote this addon, I didn't know that addons could superload engine components (in our case, engine.HotkeysIconsDisplay, which is used to draw the hotkeys toolbar). I learned that trick while writing Proper Possession and Possessor Tweaks, so now I'm busting it out here too. Should be no change in functionality (I hope…).
"Blessed are the yeeks, for they shall inherit Arda..."

Lprsti99
Yeek
Posts: 12
Joined: Sun Jan 01, 2012 7:14 am

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#9 Post by Lprsti99 »

Title makes me wish for a mod that juggled hotkeys on weapon swap. So for Temporal Warden, 1-5 could be shoot + arrow talents on one set, and the 4 blade talents plus, like, rush swap in when you hit q.

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#10 Post by Zizzo »

v1d is mostly a compatibility release that cooperates with my new Annotated Charm Hotkeys addon so that they don't fight each other while modifying hotkey icons. Also the usual localization support, and our game options are now under the new "[ZOmnibus]" tab on the Game Options dialog.
"Blessed are the yeeks, for they shall inherit Arda..."

Zizzo
Sher'Tul Godslayer
Posts: 2521
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: [v1.3.0+] Juggle Hotkeys on Unwield

#11 Post by Zizzo »

As you may or may not know, you can assign a hotkey to an object by pressing the hotkey while the object is selected in an inventory dialog. Of course, if the object is in your inventory and needs to be wielded to use, it should get our not-wielded marker, which we weren't doing. That's fixed in v1e, just pushed out.

Of course, the way I know about that particular hotkey-assigning method is from accidentally typing a hotkey while an inventory dialog is open and thereby clobbering one of my talent hotkeys. :oops: Since I was already working in that general area, I decided to fix that too. v1e also adds a new game option "[ZOmnibus] | Confirm setting hotkeys from inventory dialog", which, if enabled, will prompt you to make sure you hit that hotkey intentionally. :wink:
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply