]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - menu.c
Thanks to faded (of the tenebrae team) for provoking me to recite a lengthy explanati...
[xonotic/darkplaces.git] / menu.c
diff --git a/menu.c b/menu.c
index bcc5117e4d900bcb7b35f63380cabf3d1c1b414c..f4bda352360446dcd1cb324d011f7304ea861e8c 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -676,20 +676,20 @@ void M_ScanSaves (void)
        int             i, j;
        char    name[MAX_OSPATH];
        char    *str;
-       QFile   *f;
+       qfile_t *f;
        int             version;
 
        for (i=0 ; i<MAX_SAVEGAMES ; i++)
        {
                strcpy (m_filenames[i], "--- UNUSED SLOT ---");
                loadable[i] = false;
-               sprintf (name, "%s/s%i.sav", com_gamedir, i);
-               f = Qopen (name, "rz");
+               sprintf (name, "%s/s%i.sav", fs_gamedir, i);
+               f = FS_Open (name, "r", false);
                if (!f)
                        continue;
-               str = Qgetline (f);
+               str = FS_Getline (f);
                sscanf (str, "%i\n", &version);
-               str = Qgetline (f);
+               str = FS_Getline (f);
                strncpy (m_filenames[i], str, sizeof(m_filenames[i])-1);
 
        // change _ back to space
@@ -697,7 +697,7 @@ void M_ScanSaves (void)
                        if (m_filenames[i][j] == '_')
                                m_filenames[i][j] = ' ';
                loadable[i] = true;
-               Qclose (f);
+               FS_Close (f);
        }
 }
 
@@ -949,7 +949,7 @@ void M_MenuPlayerTranslate (qbyte *translation, int top, int bottom)
        if (menuplyr_load)
        {
                menuplyr_load = false;
-               f = COM_LoadFile("gfx/menuplyr.lmp", true);
+               f = FS_LoadFile("gfx/menuplyr.lmp", true);
                if (!f)
                {
                        menuplyr_failed = true;
@@ -3023,6 +3023,8 @@ int maxplayers;
 qboolean m_serverInfoMessage = false;
 double m_serverInfoMessageTime;
 
+extern cvar_t sv_public;
+
 void M_Menu_GameOptions_f (void)
 {
        key_dest = key_menu;
@@ -3035,8 +3037,8 @@ void M_Menu_GameOptions_f (void)
 }
 
 
-int gameoptions_cursor_table[] = {40, 56, 64, 72, 80, 88, 96, 112, 120};
-#define        NUM_GAMEOPTIONS 9
+int gameoptions_cursor_table[] = {40, 56, 64, 72, 80, 88, 96, 104, 120, 128};
+#define        NUM_GAMEOPTIONS 10
 int            gameoptions_cursor;
 
 void M_GameOptions_Draw (void)
@@ -3139,14 +3141,17 @@ void M_GameOptions_Draw (void)
        else
                M_Print (160, 96, va("%i minutes", timelimit.integer));
 
+       M_Print (0, 104, "    Public server");
+       M_Print (160, 104, (sv_public.integer == 0) ? "no" : "yes");
+
        g = lookupgameinfo();
 
-       M_Print (0, 112, "         Episode");
-       M_Print (160, 112, g->episodes[startepisode].description);
+       M_Print (0, 120, "         Episode");
+       M_Print (160, 120, g->episodes[startepisode].description);
 
-       M_Print (0, 120, "           Level");
-       M_Print (160, 120, g->levels[g->episodes[startepisode].firstLevel + startlevel].description);
-       M_Print (160, 128, g->levels[g->episodes[startepisode].firstLevel + startlevel].name);
+       M_Print (0, 128, "           Level");
+       M_Print (160, 128, g->levels[g->episodes[startepisode].firstLevel + startlevel].description);
+       M_Print (160, 136, g->levels[g->episodes[startepisode].firstLevel + startlevel].name);
 
 // line cursor
        M_DrawCharacter (144, gameoptions_cursor_table[gameoptions_cursor], 12+((int)(realtime*4)&1));
@@ -3251,6 +3256,10 @@ void M_NetStart_Change (int dir)
                break;
 
        case 7:
+               Cvar_SetValueQuick (&sv_public, !sv_public.integer);
+               break;
+
+       case 8:
                startepisode += dir;
                g = lookupgameinfo();
 
@@ -3263,7 +3272,7 @@ void M_NetStart_Change (int dir)
                startlevel = 0;
                break;
 
-       case 8:
+       case 9:
                startlevel += dir;
                g = lookupgameinfo();
 
@@ -3563,9 +3572,9 @@ void M_Init (void)
 
        if (gamemode == GAME_NEHAHRA)
        {
-               if (COM_FileExists("maps/neh1m4.bsp"))
+               if (FS_FileExists("maps/neh1m4.bsp"))
                {
-                       if (COM_FileExists("hearing.dem"))
+                       if (FS_FileExists("hearing.dem"))
                        {
                                Con_Printf("Nehahra movie and game detected.\n");
                                NehGameType = TYPE_BOTH;
@@ -3578,7 +3587,7 @@ void M_Init (void)
                }
                else
                {
-                       if (COM_FileExists("hearing.dem"))
+                       if (FS_FileExists("hearing.dem"))
                        {
                                Con_Printf("Nehahra movie detected.\n");
                                NehGameType = TYPE_DEMO;