View Single Post
Old July 17, 2019, 04:16   #221
takkaria's Avatar
Join Date: Apr 2007
Posts: 1,936
Donated: $40
takkaria is on a distinguished road
Originally Posted by Nick View Post
At first glance this looks good. Anyone see any objections to it (if it works as described)?
It's cool that this is working, but I think a cleaner way to do this would be to set the 'key' member of struct object_menu_data differently when you're building the menu in build_obj_list(). textui_get_item() would have to pass along the 'command key' which can be found from the command via cmd_lookup_key(cmd, mode). This would have the advantage of not touching the menu code at all, and you keep all the logic in the one function. You could keep track of what letters are assigned when you build the list, and mark those that have no letter with '-', or just assign them using uppercase letters starting from A-Z I guess.
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote