[v1.0.1-1.0.5] Inventory Keys

A place to post your add ons and ideas for them

Moderator: Moderator

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

[v1.0.1-1.0.5] Inventory Keys

#1 Post by Zizzo »

Prompted by a suggestion in another addon thread, I went digging in the inventory UI code and discovered that the requested feature, selecting inventory items by list letter, was already implemented in the engine -- if the right part of the dialog has focus, which it doesn't by default. Now, you could focus the right part by mouse, but once you've done that you might as well select the item by mouse too. Well, as long as I was there fixing that, I figured I'd add some other tweaks I'd been missing myself, leading to my new Inventory Keys addon. Here's what this adds:
  • As described above, by putting the focus in the right place when we create the dialog, we effectively enable the engine functionality of selecting an inventory item by typing its list letter. If you move the focus somewhere else with the mouse, you're on your own. :wink:
  • I don't know when this was lost, but I used to love the ability to move between the equipment and inventory sections of the inventory dialog with the left and right arrow keys, because it let me easily select an equipment item to activate without using the mouse. That's back now.
  • Similarly, we restore the lost "wrap-around" functionality of inventory lists, so that moving down from the last item on the list will wrap around to the top and vice versa.
Note that this all applies both to the main inventory dialog and the various inventory-related dialogs used by the 'd'rop command and various item-using talents.

As always, I'm putting this out for beta testing and suggestions before possible merging into ZOmnibus.

[edit 2013-10-31 10:25pm] Technical info:

Code: Select all

Superload:
  mod.dialogs.ShowInventory:
    init() [to allow wraparound and put focus on the list]
  mod.dialogs.ShowEquipInven:
    init() [as above]
  mod.dialogs.UseItemDialog:
    init() [to catch mnemonic keys and invoke corresponding actions]
    on_register() [to make the preceding actually work]
    generateList() [to add action mnemonics]
Last edited by Zizzo on Wed Nov 13, 2013 5:59 am, edited 4 times in total.
"Blessed are the yeeks, for they shall inherit Arda..."

Hunter
Uruivellas
Posts: 638
Joined: Tue Feb 17, 2004 4:43 pm

Re: [v1.0.1] Inventory Keys

#2 Post by Hunter »

Seems to be working perfectly so far. Thanks. :D

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

Re: [v1.0.1] Inventory Keys

#3 Post by Zizzo »

Did I say no complaints with this addon? That was tempting fate... Just tripped over a stupid bug in up/down arrow key handling in the 'd'rop dialog --- same bug I'd already fixed in the main inventory dialog, but somehow forgot to check for here. :oops: Just pushed out v1a with the fix. We Apologize for the Inconvenience.(TM)
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1] Inventory Keys

#4 Post by Zizzo »

And migrating to v1.0.3.
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1] Inventory Keys

#5 Post by Zizzo »

And migrating again to v1.0.4.
"Blessed are the yeeks, for they shall inherit Arda..."

Jeoshua
Cornac
Posts: 37
Joined: Sat Sep 14, 2013 2:08 pm

Re: [v1.0.1-1.0.4] Inventory Keys

#6 Post by Jeoshua »

I've been using this, along with the zOmnibus, to get a bit more mileage out of my keyboard with this game. It works great, but there is just one gripe:

You hit "i" to open inventory. Great.
You then hit "a-z" to select something.

But then at that point you have to select the action with your arrow keys.

What about modifying that dialogue box so that you can type different characters, like:

"w" to wield.
"u" to use.
"d" to drop.
"T" (that's Shift-t) to Transmogrify.

etc.

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

Re: [v1.0.1-1.0.4] Inventory Keys

#7 Post by Zizzo »

[We Apologize for the Delay;(TM) buying and moving into a condo is a time-comsuming and stressful process, as I'm sure you can imagine...]
Jeoshua wrote:What about modifying that dialogue box so that you can type different characters, like:

"w" to wield.
"u" to use.
"d" to drop.
"T" (that's Shift-t) to Transmogrify.

etc.
After an annoying amount of effort getting the use-item dialog to actually respond usefully to keystrokes, I've bashed together an implementation of this. The mnemonic keys defined for the game's built-in item actions are:

Code: Select all

  i   Identify
  m   Move to normal inventory
  u   Use
  w   Wield/Wear
  t   Take off
  d   Drop
  p   Transfer to party
  c   Link item in chat
  T   Transmogrify now
Addons that define new item actions via the 'UseItemMenu:generate' hook can also define the mnemonic to be used for the action. In the { name="Do a thing", action="do_thing" } table that you add to the data.menu list, just add a mnemonic="D" field. (Mnemonics are first come first served for now, so if two actions specify the same character for their mnemonic, whichever gets added first will get it.) For actions that don't define a mnemonic, the addon will try to fake up one using the first character of the action name, if that character hasn't already been used.

And that's pushed out as v1d. Let me know if anything breaks... :oops: And pursuant to DarkGod's subtle hint, :wink: I've gone back and added technical info to the original release post.
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1-1.0.4] Inventory Keys

#8 Post by Zizzo »

Migrating to v1.0.5. The new built-in item actions get their own mnemonics:

Code: Select all

  g   Tag
  G   Untag
  X   Lua inspect (via cheat mode)
[Note that if you're also using Use Item Shortcuts (or ZOmnibus), the "Grasp telekinetically" action, whose mnemonic used to be 'g', is changed to 'K' to avoid collision. We Apologize for the Inconvenience.(TM)]
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1-1.0.5] Inventory Keys

#9 Post by Zizzo »

Pushing out v1g, with a bugfix that was clobbering Alchemists' Interact with Golem talent.
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1-1.0.5] Inventory Keys

#10 Post by Zizzo »

New small release v1h, with new mnemonics 'A' and 'D' for the new in-game item actions Attach to item and Detach from item. Should be interesting finding out what those are for... :wink:
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1-1.0.5] Inventory Keys

#11 Post by Zizzo »

Pushing out bugfix release v1h.1. I think I've finally got the Interact with Golem bug sorted out this time... :oops:
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1-1.0.5] Inventory Keys

#12 Post by Zizzo »

Release v1i has one small change for v1.5: since the "Detach tinker" item command is now officially defined by the module instead of added by Tinker Tinkering, we have to patch in our mnemonic key for the command instead of defining it when we add the command. As before, we assign it the 'D' key; that actually collides with the "Detach from item" command, but that would only be a problem for a tinker with its own tinker attached, which I don't think is supported. :wink:
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1-1.0.5] Inventory Keys

#13 Post by Zizzo »

v1i.1 fixes a six-year-old bug reported on Steam: a tiny typo that broke handling of entries in the use-item dialog that ended up without a mnemonic key assigned to them. Amazing that that never came up before… We Apologize for the Inconvenience.™
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: [v1.0.1-1.0.5] Inventory Keys

#14 Post by Zizzo »

Inspired by a recent request, I'm releasing v2 with a new interface for customizing the shortcut keys that we add to the use-item dialog. The new game option "[ZOmnibus] | Use-item dialog shortcuts" brings up the new Use-Item Dialog Shortcuts dialog, whence you can set or unset your own keys for various actions on the use-item dialog. [Disclaimer: This interface is kind of experimental, and I'm not really sure what kinds of keys will actually work as shortcuts in this contexts, so proceed with caution.]
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply