ToME: the Tales of Maj'Eyal
http://forums.te4.org/

[v1.0.1-1.0.5] Inventory Keys
http://forums.te4.org/viewtopic.php?f=50&t=37702
Page 1 of 1

Author:  Zizzo [ Tue Apr 30, 2013 1:26 am ]
Post subject:  [v1.0.1-1.0.5] Inventory Keys

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:
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]

Author:  Hunter [ Fri May 03, 2013 6:24 pm ]
Post subject:  Re: [v1.0.1] Inventory Keys

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

Author:  Zizzo [ Sat May 04, 2013 10:37 pm ]
Post subject:  Re: [v1.0.1] Inventory Keys

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)

Author:  Zizzo [ Fri May 10, 2013 3:26 am ]
Post subject:  Re: [v1.0.1] Inventory Keys

And migrating to v1.0.3.

Author:  Zizzo [ Wed May 22, 2013 1:38 am ]
Post subject:  Re: [v1.0.1] Inventory Keys

And migrating again to v1.0.4.

Author:  Jeoshua [ Mon Sep 16, 2013 1:55 am ]
Post subject:  Re: [v1.0.1-1.0.4] Inventory Keys

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.

Author:  Zizzo [ Fri Nov 01, 2013 2:19 am ]
Post subject:  Re: [v1.0.1-1.0.4] Inventory Keys

[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:
  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.

Author:  Zizzo [ Wed Nov 13, 2013 5:58 am ]
Post subject:  Re: [v1.0.1-1.0.4] Inventory Keys

Migrating to v1.0.5. The new built-in item actions get their own mnemonics:
Code:
  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)]

Author:  Zizzo [ Sun Jun 22, 2014 1:03 am ]
Post subject:  Re: [v1.0.1-1.0.5] Inventory Keys

Pushing out v1g, with a bugfix that was clobbering Alchemists' Interact with Golem talent.

Author:  Zizzo [ Fri Oct 24, 2014 1:06 am ]
Post subject:  Re: [v1.0.1-1.0.5] Inventory Keys

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:

Author:  Zizzo [ Fri May 29, 2015 2:42 am ]
Post subject:  Re: [v1.0.1-1.0.5] Inventory Keys

Pushing out bugfix release v1h.1. I think I've finally got the Interact with Golem bug sorted out this time... :oops:

Author:  Zizzo [ Fri Mar 10, 2017 12:12 am ]
Post subject:  Re: [v1.0.1-1.0.5] Inventory Keys

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:

Author:  Zizzo [ Sat Nov 09, 2019 1:39 am ]
Post subject:  Re: [v1.0.1-1.0.5] Inventory Keys

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.™

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/