MenuItem& get_item(int index) { return item[index]; }
MenuItem& get_item_by_id(int id);
+ int get_active_item_id();
+
bool isToggled(int id);
void Menu::get_controlfield_key_into_input(MenuItem *item);
}
else if(menu == load_game_menu)
{
- if (process_load_game_menu())
+ if(event.key.keysym.sym == SDLK_DELETE)
+ {
+ int slot = menu->get_active_item_id();
+ char str[1024];
+ sprintf(str,"Are you sure you want to delete slot %d?", slot);
+
+ Menu::set_current(0);
+ draw_background();
+
+ if(confirm_dialog(str))
+ {
+ sprintf(str,"%s/slot%d.stsg", st_save_dir, slot);
+ printf("Removing: %s\n",str);
+ remove(str);
+ }
+
+ update_time = st_get_ticks();
+ Menu::set_current(main_menu);
+ }
+ else if (process_load_game_menu())
{
// FIXME: shouldn't be needed if GameSession doesn't relay on global variables
// reset tux