]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/getreplies.qc
Update color selection
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / getreplies.qc
index 0bedd6d5e21f3ce44f0b2d479eed092a59029b65..309dfb1b087de402e46a61f37b929ba77caaf220 100644 (file)
@@ -96,7 +96,7 @@ string getrankings()
                        continue;
                        
                n = race_readName(map, i);
-               p = race_placeName(i);
+               p = count_ordinal(i);
                s = strcat(s, strpad(8, p), " ", strpad(-8, TIME_ENCODED_TOSTRING(t)), " ", n, "\n");
        }
 
@@ -240,7 +240,7 @@ string getladder()
        s = strcat(s, " ^7Total  ^3|");
        
        for(i = 1; i <= LADDER_CNT; ++i)
-               { s = strcat(s, " ^7", race_placeName(i), " ^3|"); }
+               { s = strcat(s, " ^7", count_ordinal(i), " ^3|"); }
        
        s = strcat(s, " ^7Speed awards ^3| ^7Name");
        s = strcat(s, "\n^3----+--------");
@@ -263,7 +263,7 @@ string getladder()
                if(argv(LADDER_CNT+1) == "") // total is 0, skip
                        continue;
                        
-               s = strcat(s, strpad(4, race_placeName(i+1)), "^3| ^7"); // pos
+               s = strcat(s, strpad(4, count_ordinal(i+1)), "^3| ^7"); // pos
                s = strcat(s, strpad(7, argv(LADDER_CNT+1)), "^3| ^7"); // total
                
                for(j = 1; j <= min(9, LADDER_CNT); ++j)
@@ -285,3 +285,60 @@ string getladder()
        else
                return strcat("Top ", ftos(LADDER_SIZE), " ladder rankings:\n", s);
 }
+
+string getmaplist()
+{
+       //print("^1================= Executing getmaplist()! =================\n");
+
+       string maplist = "", col;
+       float i, argc;
+       
+       argc = tokenize_console(autocvar_g_maplist);
+       for(i = 0; i < argc; ++i)
+       {
+               if(MapInfo_CheckMap(argv(i)))
+               {
+                       if(mod(i, 2)) { col = "^2"; }
+                       else { col = "^3"; }
+                       maplist = sprintf("%s%s%s ", maplist, col, argv(i));
+               }
+       }
+
+       MapInfo_ClearTemps();
+       return sprintf("^7Maps in list: %s\n", maplist);
+}
+
+       
+string getlsmaps()
+{
+       //print("^1================= Executing getlsmaps()! =================\n");
+
+       string lsmaps = "", col;
+       float i;
+       
+       for(i = 0; i < MapInfo_count; ++i)
+       {
+               if((MapInfo_Get_ByID(i)) && !(MapInfo_Map_flags & MapInfo_ForbiddenFlags()))
+               {
+                       if(
+                               (g_race && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, RACE_RECORD, "time"))))
+                               ||
+                               (g_cts && !stof(db_get(ServerProgsDB, strcat(MapInfo_Map_bspname, CTS_RECORD, "time"))))
+                       )
+                       {
+                               if(mod(i, 2)) { col = "^4*"; }
+                               else { col = "^5*"; }
+                       }
+                       else
+                       {
+                               if(mod(i, 2)) { col = "^2"; }
+                               else { col = "^3"; }
+                       }
+
+                       lsmaps = sprintf("%s%s%s ", lsmaps, col, MapInfo_Map_bspname);
+               }
+       }
+
+       MapInfo_ClearTemps();
+       return sprintf("^7Maps available: %s\n", lsmaps);
+}