Some questions about the menu class

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
enki
Posts: 60
Joined: December 28th, 2003, 8:04 pm
Location: Linköping, Sweden

Some questions about the menu class

Post by enki »

I have a couple of questions about the menu-class in wesnoth.

1. When creating a dialog (or any other gui-element) with more than one menu, they all recieve the same key-events. E.g. down-arrow will change the selection for all menus. Is this a bug or am I just using them wrong?

2. Is there a way to hide a menu (and not make it handle any events)? It would be nice not having to destroy the menu each time it should disappear from the gui.l
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Post by Dave »

(1) this is a problem that we will have to correct at some point if we are to have dialogs with multiple menus.

(2) Just don't call the draw() or process() functions for the menu and it won't be drawn.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
enki
Posts: 60
Joined: December 28th, 2003, 8:04 pm
Location: Linköping, Sweden

Post by enki »

Thanks for the answers :) Just some additional questions about this:

(2) So if I want to hide a menu, I can just paint it over with something else and skip calling process() for this menu object?

What will happen when calling pump()? Wont the "hidden" menu stil recieve and handle the events and e.g. change which item is selected?
Post Reply