ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sun Mar 26, 2017 5:18 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: Tue Apr 30, 2013 1:26 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
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]

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Last edited by Zizzo on Wed Nov 13, 2013 5:59 am, edited 4 times in total.

Top
 Profile  
 
PostPosted: Fri May 03, 2013 6:24 pm 
Offline
Uruivellas

Joined: Tue Feb 17, 2004 4:43 pm
Posts: 606
Seems to be working perfectly so far. Thanks. :D


Top
 Profile  
 
PostPosted: Sat May 04, 2013 10:37 pm 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
PostPosted: Fri May 10, 2013 3:26 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
And migrating to v1.0.3.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Wed May 22, 2013 1:38 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
And migrating again to v1.0.4.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Mon Sep 16, 2013 1:55 am 
Offline
Cornac

Joined: Sat Sep 14, 2013 2:08 pm
Posts: 37
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.


Top
 Profile  
 
PostPosted: Fri Nov 01, 2013 2:19 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
[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.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Wed Nov 13, 2013 5:58 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
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)]

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Sun Jun 22, 2014 1:03 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
Pushing out v1g, with a bugfix that was clobbering Alchemists' Interact with Golem talent.

_________________
"Blessed are the yeeks, for they shall inherit Arda..."


Top
 Profile  
 
PostPosted: Fri Oct 24, 2014 1:06 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
PostPosted: Fri May 29, 2015 2:42 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
PostPosted: Fri Mar 10, 2017 12:12 am 
Offline
Sher'Tul

Joined: Thu Jan 23, 2003 8:13 pm
Posts: 1296
Location: A shallow water area south of Bree
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..."


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group