From: Ingo Ruhnke Date: Mon, 26 Apr 2004 13:18:40 +0000 (+0000) Subject: - added more meaningfull savegame titles X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ac0d0cbed75bb244d3377c6ff04552d989c1809c;p=supertux.git - added more meaningfull savegame titles SVN-Revision: 744 --- diff --git a/src/gameloop.cpp b/src/gameloop.cpp index 8e8df1c04..45da68bf1 100644 --- a/src/gameloop.cpp +++ b/src/gameloop.cpp @@ -746,10 +746,21 @@ std::string slotinfo(int slot) { char tmp[1024]; char slotfile[1024]; + std::string title; sprintf(slotfile,"%s/slot%d.stsg",st_save_dir,slot); + lisp_object_t* savegame = lisp_read_from_file(slotfile); + LispReader reader(lisp_cdr(savegame)); + reader.read_string("title", &title); + lisp_free(savegame); + if (access(slotfile, F_OK) == 0) - sprintf(tmp,"Slot %d - Savegame",slot); + { + if (!title.empty()) + snprintf(tmp,1024,"Slot %d - %s",slot, title.c_str()); + else + snprintf(tmp, 1024,"Slot %d - Savegame",slot); + } else sprintf(tmp,"Slot %d - Free",slot);