Reducing the kludge in menu.c
Moderator: InsideQC Admins
17 posts
• Page 2 of 2 • 1, 2
Baker wrote:silverjoel wrote:Have you looked at the Quake 3 menu system?
I haven't, at least not the code. As far as menu systems go, I think Quake's menu system is rather effective, with one such an example of expanding it (ezQuake) taking it, in my opinion, a bit farther than it needed to go.
I'm kind of looking for a happy medium. But with one eye on making the code easy to maintain and modify.
I've been slowly putting the Quake 3 menu in DP. I pretty much have it implemented, but have to clean it up some. It seems like a nice way to go, at least for me. If you look at it, you want to check out ui_qmenu.c and ui_atoms.c. That is the base part of the menu system and each menu has it's own c file. I like it.
- silverjoel
- Posts: 51
- Joined: Thu Sep 30, 2010 6:46 am
mh wrote::D
Same realization some years ago (have a look at my menu_common.cpp), but it's uncanny when you think about it - that's really all that a menu actually is. Build a controls library around some drawing and input functions, add some event handlers and you're there. (Plus you'll be able to build new menus - and add new items to existing menus - really quickly, easily and safely).
Hehe, no kidding ...
// sound
menu_Sound.AddOption (new CQMenuCustomEnter (Menu_SoundCustomEnter));
menu_Sound.AddOption (new CQMenuCustomDraw (Menu_SoundCustomDraw));
menu_Sound.AddOption (new CQMenuBanner (&gfx_p_option_lmp));
menu_Sound.AddOption (new CQMenuTitle ("Sound Options"));
menu_Sound.AddOption (new CQMenuCvarSlider ("Music Volume", &bgmvolume, 0, 1, 0.05));
menu_Sound.AddOption (new CQMenuCvarSlider ("Sound Volume", &volume, 0, 1, 0.05));
menu_Sound.AddOption (new CQMenuSpacer (DIVIDER_LINE));
menu_Sound.AddOption (new CQMenuCvarSlider ("Clip Distance", &sound_nominal_clip_dist, 500, 2000, 100));
menu_Sound.AddOption (new CQMenuCvarSlider ("Ambient Level", &ambient_level, 0, 1, 0.05));
menu_Sound.AddOption (new CQMenuCvarSlider ("Ambient Fade", &ambient_fade, 50, 200, 10));
Was mostly taking a look at your in_win.cpp and decided to look at the menu stuffs.
I see RawInput stuffs in there, amongst other things.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
17 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest