]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Gametype Votescreen: Remove the _icon cvar for custom gametypes as it is not needed... 359/head
authorFreddy <schro.sb@gmail.com>
Wed, 24 Aug 2016 11:57:21 +0000 (13:57 +0200)
committerFreddy <schro.sb@gmail.com>
Wed, 24 Aug 2016 12:02:05 +0000 (14:02 +0200)
custom icons need to follow the same naming scheme like official icons:
gfx/menu/<themename>/gametype_<mytype>

qcsrc/client/mapvoting.qc
qcsrc/server/mapvoting.qc

index e1b33158e64ad2b15a260dd6f4117d27bf3f114a..57daed8eb1f396840e247ff82c778a1793566a62 100644 (file)
@@ -610,7 +610,7 @@ void GameTypeVote_ReadOption(int i)
        mv_maps[i] = gt;
        mv_flags[i] = ReadByte();
 
-       string mv_picpath = string_null;
+       string basetype = "";
 
        if ( mv_flags[i] & GTV_CUSTOM )
        {
@@ -619,13 +619,7 @@ void GameTypeVote_ReadOption(int i)
                        name = gt;
                mv_pk3[i] = strzone(name);
                mv_desc[i] = strzone(ReadString());
-               gt = strzone(ReadString());
-               mv_picpath = strzone(ReadString());
-               // "" or " " makes precache_pic crash, string_null doesn't
-               if (strreplace(" ", "", mv_picpath) == "")
-               {
-                       mv_picpath = string_null;
-               }
+               basetype = strzone(ReadString());
        }
        else
        {
@@ -634,12 +628,17 @@ void GameTypeVote_ReadOption(int i)
                mv_desc[i] = MapInfo_Type_Description(type);
        }
 
-       if(!mv_picpath || precache_pic(mv_picpath) == "")
+       string mv_picpath = sprintf("gfx/menu/%s/gametype_%s", autocvar_menu_skin, gt);
+       if(precache_pic(mv_picpath) == "")
        {
-               mv_picpath = sprintf("gfx/menu/%s/gametype_%s", autocvar_menu_skin, gt);
+               mv_picpath = strcat("gfx/menu/default/gametype_", gt);
                if(precache_pic(mv_picpath) == "")
                {
-                       mv_picpath = strcat("gfx/menu/default/gametype_", gt);
+                       mv_picpath = sprintf("gfx/menu/%s/gametype_%s", autocvar_menu_skin, basetype);
+                       if(precache_pic(mv_picpath) == "")
+                       {
+                               mv_picpath = strcat("gfx/menu/default/gametype_", basetype);
+                       }
                }
        }
        string pic = strzone(mv_picpath);
index b21186b57e88302ebdaa1816855f619da796f7c5..9a1ed5c040fd6e8d55cc0c44df8204a1dbc78936 100644 (file)
@@ -338,8 +338,6 @@ void GameTypeVote_SendOption(int i)
                                strcat("sv_vote_gametype_",type_name,"_description")));
                        WriteString(MSG_ENTITY, cvar_string(
                                strcat("sv_vote_gametype_",type_name,"_type")));
-                       WriteString(MSG_ENTITY, cvar_string(
-                               strcat("sv_vote_gametype_",type_name,"_icon")));
                }
        }
 }