[Tux4kids-commits] r1123 - in tuxmath/trunk: data/menus src
Bolesław Kulbabiński
bolekk-guest at alioth.debian.org
Wed Jul 1 00:06:27 UTC 2009
Author: bolekk-guest
Date: 2009-07-01 00:06:26 +0000 (Wed, 01 Jul 2009)
New Revision: 1123
Added:
tuxmath/trunk/data/menus/level_menu.xml
Modified:
tuxmath/trunk/data/menus/Makefile.am
tuxmath/trunk/data/menus/main_menu.xml
tuxmath/trunk/src/menu.c
tuxmath/trunk/src/menu.h
Log:
copied all menu entries into xml files
Modified: tuxmath/trunk/data/menus/Makefile.am
===================================================================
--- tuxmath/trunk/data/menus/Makefile.am 2009-06-30 23:30:41 UTC (rev 1122)
+++ tuxmath/trunk/data/menus/Makefile.am 2009-07-01 00:06:26 UTC (rev 1123)
@@ -3,5 +3,6 @@
menusdir = $(pkgdatadir)/menus
-dist_menus_DATA = main_menu.xml
+dist_menus_DATA = main_menu.xml \
+ level_menu.xml
Added: tuxmath/trunk/data/menus/level_menu.xml
===================================================================
--- tuxmath/trunk/data/menus/level_menu.xml (rev 0)
+++ tuxmath/trunk/data/menus/level_menu.xml 2009-07-01 00:06:26 UTC (rev 1123)
@@ -0,0 +1,9 @@
+<menu title="Difficulty Level Menu" entries="7">
+ <item title="Space Cadet" sprite="tux_helmet_yellow" run="RUN_SPACE_CADET">
+ <item title="Scout" sprite="tux_helmet_green" run="RUN_SCOUT">
+ <item title="Ranger" sprite="tux_helmet_blue" run="RUN_RANGER">
+ <item title="Ace" sprite="tux_helmet_red" run="RUN_ACE">
+ <item title="Commando" sprite="tux_helmet_black" run="RUN_COMMANDO">
+ <item title="Hall Of Fame" sprite="trophy" run="RUN_HALL_OF_FAME">
+ <item title="Main Menu" sprite="main" run="RUN_MAIN_MENU">
+</menu>
Modified: tuxmath/trunk/data/menus/main_menu.xml
===================================================================
--- tuxmath/trunk/data/menus/main_menu.xml 2009-06-30 23:30:41 UTC (rev 1122)
+++ tuxmath/trunk/data/menus/main_menu.xml 2009-07-01 00:06:26 UTC (rev 1123)
@@ -1,28 +1,31 @@
<menu title="Main Menu" entries="7">
- <menu title="Play Alone" entries="5">
- <item title="Math Command Training Academy" run="RUN_ACADEMY">
- <item title="Math Command Fleet Missions" run="RUN_FLEET_MISSIONS">
- <item title="Play Arcade Game" run="RUN_ARCADE">
- <item title="Play Custom Game" run="RUN_CUSTOM">
- <item title="Main Menu" run="RUN_MAIN_MENU">
+ <menu title="Play Alone" sprite="alone" entries="5">
+ <item title="Math Command Training Academy" sprite="lesson" run="RUN_ACADEMY">
+ <item title="Math Command Fleet Missions" sprite="fleet" run="RUN_FLEET_MISSIONS">
+ <item title="Play Arcade Game" sprite="comet" run="RUN_ARCADE">
+ <item title="Play Custom Game" sprite="tux_config" run="RUN_CUSTOM">
+ <item title="Main Menu" sprite="main" run="RUN_MAIN_MENU">
</menu>
<menu title="LAN Game" entries="3">
<item title="Host" run="RUN_LAN_HOST">
<item title="Join" run="RUN_LAN_JOIN">
- <item title="Main Menu" run="RUN_MAIN_MENU">
+ <item title="Main Menu" sprite="main" run="RUN_MAIN_MENU">
</menu>
- <menu title="Play With Friends" entries="0">
+ <menu title="Play With Friends" sprite="friends" entries="3">
+ <item title="Score Sweep" sprite="nums" run="RUN_SCORE_SWEEP">
+ <item title="Elimination" sprite="exclamation" run="RUN_ELIMINATION">
+ <item title="Main Menu" sprite="main" run="RUN_MAIN_MENU">
</menu>
- <menu title="Factoroids!" entries="2">
- <item title="Factors" run="RUN_FACTORS">
- <item title="Fractions" run="RUN_FRACTIONS">
+ <menu title="Factoroids!" sprite="factoroids" entries="2">
+ <item title="Factors" sprite="factors" run="RUN_FACTORS">
+ <item title="Fractions" sprite="fractions" run="RUN_FRACTIONS">
</menu>
- <item title="Help" run="RUN_HELP">
- <menu title="More Options" entries="4">
- <item title="Demo" run="RUN_DEMO">
- <item title="Project Info" run="RUN_PROJECT_INFO">
- <item title="Credits" run="RUN_CREDITS">
- <item title="Main Menu" run="RUN_MAIN_MENU">
+ <item title="Help" sprite="help" run="RUN_HELP">
+ <menu title="More Options" sprite="tux_config" entries="4">
+ <item title="Demo" sprite="comet" run="RUN_DEMO">
+ <item title="Project Info" sprite="help" run="RUN_INFO">
+ <item title="Credits" sprite="credits" run="RUN_CREDITS">
+ <item title="Main Menu" sprite="main" run="RUN_MAIN_MENU">
</menu>
<item title="Quit" sprite="quit" run="RUN_QUIT">
</menu>
Modified: tuxmath/trunk/src/menu.c
===================================================================
--- tuxmath/trunk/src/menu.c 2009-06-30 23:30:41 UTC (rev 1122)
+++ tuxmath/trunk/src/menu.c 2009-07-01 00:06:26 UTC (rev 1123)
@@ -26,7 +26,7 @@
/* we may use a few separate menu trees */
typedef enum {
MENU_MAIN,
- MENU_GAME_DIFFICULTY,
+ MENU_DIFFICULTY,
N_OF_MENUS
} MenuType;
@@ -183,16 +183,29 @@
/* load menu trees from disk */
void LoadMenus(void)
{
- FILE* main_menu_file = fopen(DATA_PREFIX "/menus/main_menu.xml", "r");
- if(main_menu_file == NULL)
+ /* main menu */
+ FILE* menu_file = fopen(DATA_PREFIX "/menus/main_menu.xml", "r");
+ if(menu_file == NULL)
{
DEBUGMSG(debug_menu, "LoadMenus(): Could not load main menu file !\n");
}
else
{
- menus[MENU_MAIN] = load_menu_from_file(main_menu_file);
- fclose(main_menu_file);
+ menus[MENU_MAIN] = load_menu_from_file(menu_file);
+ fclose(menu_file);
}
+
+ /* difficulty menu */
+ menu_file = fopen(DATA_PREFIX "/menus/level_menu.xml", "r");
+ if(menu_file == NULL)
+ {
+ DEBUGMSG(debug_menu, "LoadMenus(): Could not load level menu file !\n");
+ }
+ else
+ {
+ menus[MENU_DIFFICULTY] = load_menu_from_file(menu_file);
+ fclose(menu_file);
+ }
}
/* create login menu tree, run it and set the user home directory
Modified: tuxmath/trunk/src/menu.h
===================================================================
--- tuxmath/trunk/src/menu.h 2009-06-30 23:30:41 UTC (rev 1122)
+++ tuxmath/trunk/src/menu.h 2009-07-01 00:06:26 UTC (rev 1123)
@@ -19,8 +19,28 @@
By using a define we can create both an enum and
a string array without writing these names twice */
#define ACTIVITIES \
- X( RUN_SUBMENU ),\
+ X( RUN_ACADEMY ),\
+ X( RUN_FLEET_MISSIONS ),\
+ X( RUN_ARCADE ),\
+ X( RUN_CUSTOM ),\
+ X( RUN_MAIN_MENU ),\
+ X( RUN_LAN_HOST ),\
+ X( RUN_LAN_JOIN ),\
+ X( RUN_SCORE_SWEEP ),\
+ X( RUN_ELIMINATION ),\
+ X( RUN_FACTORS ),\
+ X( RUN_FRACTIONS ),\
X( RUN_HELP ),\
+ X( RUN_DEMO ),\
+ X( RUN_INFO ),\
+ X( RUN_CREDITS ),\
+ X( RUN_HALL_OF_FAME ),\
+ X( RUN_QUIT ),\
+ X( RUN_SPACE_CADET ),\
+ X( RUN_SCOUT ),\
+ X( RUN_RANGER ),\
+ X( RUN_ACE ),\
+ X( RUN_COMMANDO ),\
X( N_OF_ACTIVITIES ) /* this one has to be the last one */
/* create enum */
More information about the Tux4kids-commits
mailing list