From 688856e58b1e423c9831e97cc82c9f748a7486c2 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 7 Feb 2016 19:19:34 +0100 Subject: [PATCH] Properly detect the path of the current menu skin in the client --- qcsrc/client/main.qc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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) -- 2.39.2