[v1.3.0+] Roguelike Chat Guard

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+] Roguelike Chat Guard

#1 Post by Zizzo »

If you use roguelike keybindings (perhaps installed via my handy addon, if you'll forgive the shameless plug :wink: ), you've no doubt experienced the "joy" of being surprised on the worldmap by say, the lumberjack quest chat dialog or the lost kitten chat dialog while moving southwest — which, in the roguelike keybindings, is bound to the 'b' key, which in both dialogs just happens to be associated with the "go away, don't bother me" option. :|

Having been tripped up by that once too often, I'm working on an addon to try to prevent it from happening. My current approach is to modify the chat dialog during creation so that none of its options are associated with any key bound to a movement action. (And I am actually walking the live keybindings instead of just hard-coding the usual roguelike keys, in case someone has their own custom keybindings that might similarly trip over a chat dialog — maybe an 'asdf'-based left-handed roguelike variant?)

Now, I'm not currently planning to modify all chat dialogs in this manner, just the ones that are likely to get sprung on the player while you're moving. Right now, that's the ones mentioned above, the lumberjack quest chat and the lost kitten chat; while I'm testing, I figured I'd solicit input to see if there are any other chat dialogs anyone thinks I should also give this treatment to (or whether people think I should just go ahead and unilaterally modify all chat dialogs [or, for that matter, whether people think I should be doing this some other way…]).
Last edited by Zizzo on Sat Oct 06, 2018 8:06 pm, 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+] Roguelike Chat Guard

#2 Post by Zizzo »

Well, all the tests appear to work, so I'm releasing my new Roguelike Chat Guard addon. As promised (and since no one suggested anything else), we modify the lumberjack quest chat and the lost kitten chat. If you're an addon developer and you think one of your addon's chats would benefit from the same treatment, you can hook into this too; just add code roughly like the following to your ToME:load hook:

Code: Select all

local Chat = require 'engine.dialogs.Chat'
if Chat.addChatForRoguelikeModify then
  Chat:addChatForRoguelikeModify('your-chat-name')
end
[Technical notes:]

Code: Select all

Superload:
  engine.dialogs.Chat:
    generateList() [to modify the generated list]
"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+] Roguelike Chat Guard

#3 Post by Zizzo »

Frequently Asked Questions:

How does this addon work?

This addon alters certain chat dialogs so that no key bound to any movement action is used as a hotkey for any opeion in the chat dialog. This ensures that if the chat dialog pops up while you are moving, your movement key will not be misinterpreted as selecting a chat option. The Steam page image shows an example of this.

Wait, who would have letter keys bound to movement actions?

Mostly this will be useful for people using the "roguelike" or "vi" keybindings on a laptop or other keyboard lacking a numeric keypad. (We don't assume those keybindings, though, in case you have your own custom arrangement.)

Which chats does this addon modify?

Currently, the following chat dialogs are modified:
  • The lumberjack quest chat.
  • The lost kitten chat.
Various chats defined by other addons may also be modified, at the addon's option; presumably this will be detailed in the addon's documentation.

(If you prefer, you can enable the game option "UI | Avoid movement chars in chat dialogs" to arrange for all chat dialogs to be modified in this fashion. You can also use the game option "UI | No hotkeys in chat dialogs", which further modifies chat dialogs to use no hotkeys at all.)

Why only those chats?

In the author's experience, those two chats are the only ones that are likely to pop up unexpectedly while the player is moving. If there are other chats that you think could benefit from this modification, here would be a good place to suggest them for addition to a later version.
"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+] Roguelike Chat Guard

#4 Post by Zizzo »

A couple requesters from the addon page itself (which I rarely read, hence the delay [for which, as always, We Apologize™]) noted that there is another use case for filtering movement keys out of chat dialogs: in their absence, the up/down movement keys can be used to navigate the chat dialog's response list (I'd always just used the up/down arrows for this, so that hadn't occurred to me). Indeed, if you're expecting to be able to navigate the chat dialog with movement keys, long chats like the Lost Hope merchant's randart builder can easily trip you up.

Thus, v2, just released, adds two new game options:
  • "UI | Avoid movement chars in chat dialogs", which extends the no-movement-keys protection to all chat dialogs.
  • "UI | No hotkeys in chat dialogs", which removes "shortcut" keys from chat dialogs entirely.
Both of these default to disabled, to preserve continuity of game behavior.
"Blessed are the yeeks, for they shall inherit Arda..."

Post Reply