]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Properly detect the path of the current menu skin in the client
authorterencehill <piuntn@gmail.com>
Sun, 7 Feb 2016 18:19:34 +0000 (19:19 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 7 Feb 2016 18:19:34 +0000 (19:19 +0100)
qcsrc/client/main.qc

index 7682198338308463520b72a815e03e4b8cd91b0d..0dcf6811dec488dd5306781bafd43956d6f5ba84 100644 (file)
@@ -125,7 +125,26 @@ void CSQC_Init()
        }
 
        hud_skin_path = strzone(strcat("gfx/hud/", autocvar_hud_skin));
-       draw_currentSkin = strzone(strcat("gfx/menu/", cvar_string("menu_skin")));
+
+       int fh = -1;
+       if(cvar_string("menu_skin") != "")
+       {
+               draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
+               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+       }
+       if(fh < 0 && cvar_defstring("menu_skin") != "")
+       {
+               cvar_set("menu_skin", cvar_defstring("menu_skin"));
+               draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
+               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+       }
+       if(fh < 0)
+       {
+               draw_currentSkin = "gfx/menu/default";
+               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+       }
+
+       draw_currentSkin = strzone(draw_currentSkin);
 }
 
 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)