Wednesday, March 5, 2008

Designing a Menu System

Well, it's 2am and I've been plugging away at what I think will be a useful menu system. We'll have to just wait and see when I've got it finished. I'm basing the architecture on the way a TreeView works in C#, and my goal is that the following code will initialize a menu:

Menu menu = new Menu();

menu.AddChoice("New Game");

menu.AddChoice("Load Game");

MenuChoice OptionsMenu = menu.AddChoice("Options");

OptionsMenu.AddChoice("Resolution");

OptionsMenu.AddChoice("Volume");

menu.NodeSelectedEvent += new Menu.ChoiceExecutedHandler(ChoiceExecuted);



We'll see what I end up with. Hopefully it won't get too cluttered with code related to drawing the darn thing.

No comments: