From: Matthias Braun Date: Thu, 29 Apr 2004 15:41:40 +0000 (+0000) Subject: fixed broken leveleditor menus X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b3c2368c1768320e511c138629d7ea1a5d1ead29;p=supertux.git fixed broken leveleditor menus SVN-Revision: 845 --- diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index 072b0ee2b..90d092714 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -148,6 +148,11 @@ static int le_selection_mode; static SDL_Event event; TileMapType active_tm; +// menu items for subset creation menu +enum { + MNID_CREATESUBSET +}; + void le_set_defaults() { if(le_current_level != NULL) @@ -270,9 +275,9 @@ int leveleditor(int levelnb) case 0: break; default: - if(i != -1) + if(i >= 1) { - le_level_subset.load(level_subsets.item[i-2]); + le_level_subset.load(level_subsets.item[i-1]); leveleditor_menu->item[3].kind = MN_GOTO; le_level = 1; le_world.arrays_free(); @@ -302,7 +307,7 @@ int leveleditor(int levelnb) switch (i = subset_new_menu->check()) { - case 3: + case MNID_CREATESUBSET: LevelSubset::create(subset_new_menu->item[2].input); le_level_subset.load(subset_new_menu->item[2].input); leveleditor_menu->item[3].kind = MN_GOTO; @@ -430,7 +435,7 @@ int le_init() for(i = 0; i < level_subsets.num_items; ++i) { - subset_load_menu->additem(MN_ACTION,level_subsets.item[i],0,0); + subset_load_menu->additem(MN_ACTION,level_subsets.item[i],0,0, i+1); } subset_load_menu->additem(MN_HL,"",0,0); subset_load_menu->additem(MN_BACK,"Back",0,0); @@ -438,7 +443,7 @@ int le_init() subset_new_menu->additem(MN_LABEL,"New Level Subset",0,0); subset_new_menu->additem(MN_HL,"",0,0); subset_new_menu->additem(MN_TEXTFIELD,"Enter Name",0,0); - subset_new_menu->additem(MN_ACTION,"Create",0,0); + subset_new_menu->additem(MN_ACTION,"Create",0,0, MNID_CREATESUBSET); subset_new_menu->additem(MN_HL,"",0,0); subset_new_menu->additem(MN_BACK,"Back",0,0);