tung / DynaHack

A NetHack variant with randomized equipment, new items, new monsters, new maps, new challenges and an advanced ASCII interface.
https://tung.github.io/DynaHack/
48 stars 4 forks source link

Add accelerator keys for enum options #49

Open tung opened 11 years ago

tung commented 11 years ago

This depends on how much needs to be modified to add a new char accel field to nh_listitem.

tung commented 11 years ago

nh_listitem is used in a lot of things, including a couple of structs used by options, which would involve changing a lot of network code. Moving enum options off of nh_listitem to something new, or even to something like nh_menuitem to support a new accelerator field would involve a fair amount of network code changes.

Putting this off for now.

tung commented 11 years ago

New idea: The accelerator for each enum option's entries could live in the first character of the caption string by convention. Not the prettiest design, but it'd require no protocol changes, and no code changes outside of handling of enum options. I might go ahead on this after all.

tung commented 11 years ago

I just tried doing this... the changes required were awful, since the choice descriptions for enum options are stored as-is in the game's config files. Also, generating unique accelerator keys for the dynamically-created 'race' and 'role' options was non-trivial, so I had to special-case them out in 3 different places across the front-end and back-end.

Putting this off again.