From: terencehill Date: Sun, 7 Feb 2016 18:19:34 +0000 (+0100) Subject: Properly detect the path of the current menu skin in the client X-Git-Tag: xonotic-v0.8.2~1195^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=688856e58b1e423c9831e97cc82c9f748a7486c2;p=xonotic%2Fxonotic-data.pk3dir.git Properly detect the path of the current menu skin in the client --- diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 768219833..0dcf6811d 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -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)