Index: talkbox/trunk/tools/genlang =================================================================== --- talkbox.orig/trunk/tools/genlang 2007-10-11 12:51:32.000000000 +0200 +++ talkbox/trunk/tools/genlang 2007-10-14 10:34:15.000000000 +0200 @@ -529,6 +529,20 @@ /* this contains the concatenation of all strings, separated by \\0 chars */ extern const unsigned char language_builtin[]; +#include "${prefix}_enum.h" + +MOO + ; + + close(HFILE); + + open(HFILE, ">${prefix}_enum.h") || + die "couldn't create file ${prefix}_enum.h\n"; + + print HFILE <set_option("Number Of Worms", &worm_count,INT, num_worms_option, 3, NULL); @@ -2173,10 +2173,10 @@ { bool ret; static const struct opt_items num_players_option[4] = { - { "0", -1 }, - { "1", -1 }, - { "2", -1 }, - { "3", -1 } + { "0", TALK_ID(0, UNIT_INT) }, + { "1", TALK_ID(1, UNIT_INT) }, + { "2", TALK_ID(2, UNIT_INT) }, + { "3", TALK_ID(3, UNIT_INT) } }; ret = rb->set_option("Number of Players", &players, INT,num_players_option , 4, NULL); @@ -2195,17 +2195,17 @@ bool set_worm_argh_size(void) { static const struct opt_items argh_size_option[11] = { - { "0", -1 }, - { "1", -1 }, - { "2", -1 }, - { "3", -1 }, - { "4", -1 }, - { "5", -1 }, - { "6", -1 }, - { "7", -1 }, - { "8", -1 }, - { "9", -1 }, - { "10", -1 } + { "0", TALK_ID(0, UNIT_INT) }, + { "1", TALK_ID(1, UNIT_INT) }, + { "2", TALK_ID(2, UNIT_INT) }, + { "3", TALK_ID(3, UNIT_INT) }, + { "4", TALK_ID(4, UNIT_INT) }, + { "5", TALK_ID(5, UNIT_INT) }, + { "6", TALK_ID(6, UNIT_INT) }, + { "7", TALK_ID(7, UNIT_INT) }, + { "8", TALK_ID(8, UNIT_INT) }, + { "9", TALK_ID(9, UNIT_INT) }, + { "10", TALK_ID(10, UNIT_INT) } }; return rb->set_option("Argh Size", &argh_size,INT,argh_size_option , 11, NULL); @@ -2217,17 +2217,17 @@ bool set_worm_food(void) { static const struct opt_items worm_food_option[11] = { - { "0", -1 }, - { "1", -1 }, - { "2", -1 }, - { "3", -1 }, - { "4", -1 }, - { "5", -1 }, - { "6", -1 }, - { "7", -1 }, - { "8", -1 }, - { "9", -1 }, - { "10", -1 } + { "0", TALK_ID(0, UNIT_INT) }, + { "1", TALK_ID(1, UNIT_INT) }, + { "2", TALK_ID(2, UNIT_INT) }, + { "3", TALK_ID(3, UNIT_INT) }, + { "4", TALK_ID(4, UNIT_INT) }, + { "5", TALK_ID(5, UNIT_INT) }, + { "6", TALK_ID(6, UNIT_INT) }, + { "7", TALK_ID(7, UNIT_INT) }, + { "8", TALK_ID(8, UNIT_INT) }, + { "9", TALK_ID(9, UNIT_INT) }, + { "10", TALK_ID(10, UNIT_INT) } }; return rb->set_option("Worm Growth Per Food", &worm_food,INT,worm_food_option , 11, NULL); } @@ -2238,11 +2238,11 @@ bool set_argh_per_food(void) { static const struct opt_items argh_food_option[5] = { - { "0", -1 }, - { "1", -1 }, - { "2", -1 }, - { "3", -1 }, - { "4", -1 }, + { "0", TALK_ID(0, UNIT_INT) }, + { "1", TALK_ID(1, UNIT_INT) }, + { "2", TALK_ID(2, UNIT_INT) }, + { "3", TALK_ID(3, UNIT_INT) }, + { "4", TALK_ID(4, UNIT_INT) }, }; return rb->set_option("Arghs Per Food", &arghs_per_food,INT,argh_food_option , 5, NULL); } @@ -2405,14 +2405,14 @@ /* Setup screen */ static const struct opt_items noyes[2] = { - { "No", -1 }, - { "Yes", -1 }, + { STR(LANG_SET_BOOL_NO) }, + { STR(LANG_SET_BOOL_YES) }, }; static const struct opt_items num_worms_option[3] = { - { "1", -1 }, - { "2", -1 }, - { "3", -1 } + { "1", TALK_ID(1, UNIT_INT) }, + { "2", TALK_ID(2, UNIT_INT) }, + { "3", TALK_ID(3, UNIT_INT) } }; #ifdef MULTIPLAYER @@ -2420,36 +2420,36 @@ #else static const struct opt_items num_players_option[2] = { #endif - { "0", -1 }, - { "1", -1 } + { "0", TALK_ID(0, UNIT_INT) }, + { "1", TALK_ID(1, UNIT_INT) } #ifdef MULTIPLAYER - ,{ "2", -1 }, - { "3", -1 } + ,{ "2", TALK_ID(2, UNIT_INT) }, + { "3", TALK_ID(3, UNIT_INT) } #endif }; static const struct opt_items argh_size_option[9] = { - { "2", -1 }, - { "3", -1 }, - { "4", -1 }, - { "5", -1 }, - { "6", -1 }, - { "7", -1 }, - { "8", -1 }, - { "9", -1 }, - { "10", -1 } + { "2", TALK_ID(2, UNIT_INT) }, + { "3", TALK_ID(3, UNIT_INT) }, + { "4", TALK_ID(4, UNIT_INT) }, + { "5", TALK_ID(5, UNIT_INT) }, + { "6", TALK_ID(6, UNIT_INT) }, + { "7", TALK_ID(7, UNIT_INT) }, + { "8", TALK_ID(8, UNIT_INT) }, + { "9", TALK_ID(9, UNIT_INT) }, + { "10", TALK_ID(10, UNIT_INT) } }; static const struct opt_items food_size_option[9] = { - { "2", -1 }, - { "3", -1 }, - { "4", -1 }, - { "5", -1 }, - { "6", -1 }, - { "7", -1 }, - { "8", -1 }, - { "9", -1 }, - { "10", -1 } + { "2", TALK_ID(2, UNIT_INT) }, + { "3", TALK_ID(3, UNIT_INT) }, + { "4", TALK_ID(4, UNIT_INT) }, + { "5", TALK_ID(5, UNIT_INT) }, + { "6", TALK_ID(6, UNIT_INT) }, + { "7", TALK_ID(7, UNIT_INT) }, + { "8", TALK_ID(8, UNIT_INT) }, + { "9", TALK_ID(9, UNIT_INT) }, + { "10", TALK_ID(10, UNIT_INT) } }; static const struct opt_items worm_food_option[16] = {