]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
In the skinlist, set the default tag automatically
authorSeverin Meyer <sev.ch@web.de>
Wed, 15 Jul 2015 16:18:59 +0000 (18:18 +0200)
committerSeverin Meyer <sev.ch@web.de>
Wed, 15 Jul 2015 16:18:59 +0000 (18:18 +0200)
gfx/menu/luminos/skinvalues.txt
qcsrc/menu/xonotic/skinlist.qc

index b9c69802e490e28ecc7b6b6cbebf24e3eb479204..6bcff0075b75e4b9567c345a1df82537ce1921bc 100755 (executable)
@@ -1,4 +1,4 @@
-title Luminos (default)
+title Luminos
 author sev
 
 // Colors: 'Red Green Blue'
index 46babc3f9517f5c9ae63c390e68e9d4bfdaa0960..7400b379f6c52fca110bb8387b7b9b21ef4845df 100644 (file)
@@ -85,7 +85,7 @@ string XonoticSkinList_skinParameter(entity me, float i, float key)
 void XonoticSkinList_getSkins(entity me)
 {
        float glob, buf, i, n, fh;
-       string s;
+       string s, name;
 
        buf = buf_create();
        glob = search_begin("gfx/menu/*/skinvalues.txt", true, true);
@@ -100,7 +100,8 @@ void XonoticSkinList_getSkins(entity me)
        for(i = 0; i < n; ++i)
        {
                s = search_getfilename(glob, i);
-               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_NAME, substring(s, 9, strlen(s) - 24)); // the * part
+               name = substring(s, 9, strlen(s) - 24); // the * part
+               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_NAME, name);
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, _("<TITLE>"));
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, _("<AUTHOR>"));
                if(draw_PictureSize(strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview")) == '0 0 0')
@@ -117,7 +118,12 @@ void XonoticSkinList_getSkins(entity me)
                {
                        // these two are handled by skinlist.qc
                        if(substring(s, 0, 6) == "title ")
-                               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, substring(s, 6, strlen(s) - 6));
+                       {
+                               if (name == cvar_defstring("menu_skin"))
+                                       bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, strcat(substring(s, 6, strlen(s) - 6), " (", _("Default"), ")"));
+                               else
+                                       bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, substring(s, 6, strlen(s) - 6));
+                       }
                        else if(substring(s, 0, 7) == "author ")
                                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, substring(s, 7, strlen(s) - 7));
                }