mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
handle the new save files properly
This commit is contained in:
parent
4a421dbb49
commit
6e77198b6f
1 changed files with 23 additions and 2 deletions
|
@ -12,6 +12,7 @@
|
|||
#include "debug.h"
|
||||
#include "HUD.h"
|
||||
#include "client_menu.h"
|
||||
#include "PropertyList.h"
|
||||
|
||||
#include "gui/InputLine.h"
|
||||
#include "gui/Rect.h"
|
||||
|
@ -89,10 +90,26 @@ integer [MAX_SAVEGAMES] loadable;
|
|||
integer load_cursor;
|
||||
integer save_cursor;
|
||||
|
||||
string (QFile f) get_comment =
|
||||
{
|
||||
local string line;
|
||||
local string plist_data = str_new ();
|
||||
local PLItem plist;
|
||||
|
||||
while ((line = Qgetline (f)))
|
||||
str_cat (plist_data, line);
|
||||
plist = [PLItem newFromString:plist_data];
|
||||
str_free (plist_data);
|
||||
line = [(PLString) [plist getObjectForKey:"comment"] string];
|
||||
[plist release];
|
||||
return line;
|
||||
}
|
||||
|
||||
void () scan_saves =
|
||||
{
|
||||
local integer i;
|
||||
local QFile f;
|
||||
local string line;
|
||||
for (i = 0; i < MAX_SAVEGAMES; i++) {
|
||||
if (!filenames[i])
|
||||
filenames[i] = str_new ();
|
||||
|
@ -102,8 +119,12 @@ void () scan_saves =
|
|||
str_copy (filenames[i], "--- UNUSED SLOT ---");
|
||||
continue;
|
||||
}
|
||||
Qgetline (f);
|
||||
str_copy (filenames[i], Qgetline (f));
|
||||
line = Qgetline (f);
|
||||
if (line == "QuakeForge\n") {
|
||||
str_copy (filenames[i], get_comment (f));
|
||||
} else {
|
||||
str_copy (filenames[i], Qgetline (f));
|
||||
}
|
||||
loadable[i] = 1;
|
||||
Qclose (f);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue