From: Ricardo Cruz Date: Mon, 25 Oct 2004 18:46:13 +0000 (+0000) Subject: Bugfix: it was impossible to create a level subset in leveleditor cause Create button... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d1b8f5c22b2bc39978c05493e029aa33a6627585;p=supertux.git Bugfix: it was impossible to create a level subset in leveleditor cause Create button was always disabled. Bugfix: LevelSubset was saving subsets hide-from-contribs field wrongly, and couldn't load them. SVN-Revision: 2063 --- diff --git a/src/level_subset.cpp b/src/level_subset.cpp index fda54170e..4b3378db7 100644 --- a/src/level_subset.cpp +++ b/src/level_subset.cpp @@ -150,7 +150,7 @@ LevelSubset::save() fprintf(fi," (description \"%s\")\n", description.c_str()); /* Save the hide from Contrbis menu boolean: */ - fprintf(fi," (hide-from-contribs \"%s\")\n", hide_from_contribs ? "#t" : "#f"); + fprintf(fi," (hide-from-contribs %s)\n", hide_from_contribs ? "#t" : "#f"); fprintf( fi,")"); fclose(fi); diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index 260c9d359..b861345df 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -268,9 +268,13 @@ while(SDL_PollEvent(&event)) } else if(menu == create_subset_menu) { + // activate or deactivate Create button if any filename as been specified if(create_subset_menu->get_item_by_id(MN_ID_FILENAME_SUBSET).input[0] == '\0') create_subset_menu->get_item_by_id(MN_ID_CREATE_SUBSET).kind = MN_DEACTIVE; - else if(create_subset_menu->check() == MN_ID_CREATE_SUBSET) + else + create_subset_menu->get_item_by_id(MN_ID_CREATE_SUBSET).kind = MN_ACTION; + + if(create_subset_menu->check() == MN_ID_CREATE_SUBSET) { // applying settings: LevelSubset::create(create_subset_menu->get_item_by_id(MN_ID_FILENAME_SUBSET).input);