mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +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 "debug.h"
|
||||||
#include "HUD.h"
|
#include "HUD.h"
|
||||||
#include "client_menu.h"
|
#include "client_menu.h"
|
||||||
|
#include "PropertyList.h"
|
||||||
|
|
||||||
#include "gui/InputLine.h"
|
#include "gui/InputLine.h"
|
||||||
#include "gui/Rect.h"
|
#include "gui/Rect.h"
|
||||||
|
@ -89,10 +90,26 @@ integer [MAX_SAVEGAMES] loadable;
|
||||||
integer load_cursor;
|
integer load_cursor;
|
||||||
integer save_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 =
|
void () scan_saves =
|
||||||
{
|
{
|
||||||
local integer i;
|
local integer i;
|
||||||
local QFile f;
|
local QFile f;
|
||||||
|
local string line;
|
||||||
for (i = 0; i < MAX_SAVEGAMES; i++) {
|
for (i = 0; i < MAX_SAVEGAMES; i++) {
|
||||||
if (!filenames[i])
|
if (!filenames[i])
|
||||||
filenames[i] = str_new ();
|
filenames[i] = str_new ();
|
||||||
|
@ -102,8 +119,12 @@ void () scan_saves =
|
||||||
str_copy (filenames[i], "--- UNUSED SLOT ---");
|
str_copy (filenames[i], "--- UNUSED SLOT ---");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Qgetline (f);
|
line = Qgetline (f);
|
||||||
str_copy (filenames[i], Qgetline (f));
|
if (line == "QuakeForge\n") {
|
||||||
|
str_copy (filenames[i], get_comment (f));
|
||||||
|
} else {
|
||||||
|
str_copy (filenames[i], Qgetline (f));
|
||||||
|
}
|
||||||
loadable[i] = 1;
|
loadable[i] = 1;
|
||||||
Qclose (f);
|
Qclose (f);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue