]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.qc
Merge branch 'bones_was_here/subtlebloom' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / dialog_multiplayer_create_mapinfo.qc
index 8fcb975eab6764c5b43d44061102d4ff0132b7b3..c9db70116f0f171729d6e3115aa20f06233bc2de 100644 (file)
@@ -12,19 +12,11 @@ void XonoticMapInfoDialog_loadMapInfo(entity me, int i, entity mlb)
        me.startButton.onClickEntity = mlb;
        MapInfo_Get_ByID(i);
 
-       if(me.currentMapBSPName)
-       {
-               strunzone(me.currentMapBSPName);
-               strunzone(me.currentMapTitle);
-               strunzone(me.currentMapAuthor);
-               strunzone(me.currentMapDescription);
-               strunzone(me.currentMapPreviewImage);
-       }
-       me.currentMapBSPName = strzone(MapInfo_Map_bspname);
-       me.currentMapTitle = strzone(strdecolorize(MapInfo_Map_title));
-       me.currentMapAuthor = strzone(strdecolorize(MapInfo_Map_author));
-       me.currentMapDescription = strzone(MapInfo_Map_description);
-       me.currentMapPreviewImage = strzone(strcat("/maps/", MapInfo_Map_bspname));
+       strcpy(me.currentMapBSPName, MapInfo_Map_bspname);
+       strcpy(me.currentMapTitle, strdecolorize(MapInfo_Map_title));
+       strcpy(me.currentMapAuthor, strdecolorize(MapInfo_Map_author));
+       strcpy(me.currentMapDescription, MapInfo_Map_description);
+       strcpy(me.currentMapPreviewImage, strcat("/maps/", MapInfo_Map_bspname));
 
        me.frame.setText(me.frame, me.currentMapBSPName);
        me.titleLabel.setText(me.titleLabel, me.currentMapTitle);
@@ -35,7 +27,7 @@ void XonoticMapInfoDialog_loadMapInfo(entity me, int i, entity mlb)
        else
                me.previewImage.src = me.currentMapPreviewImage;
 
-       for(i = 0; i < GameType_GetCount(); ++i)
+       for(i = 0; i < GameType_GetTotalCount(); ++i)
        {
                entity e;
                e = me.(typeLabels[i]);
@@ -69,9 +61,9 @@ void XonoticMapInfoDialog_fill(entity me)
        me.TR(me);
                me.TD(me, 1, w, e = makeXonoticTextLabel(0, _("Game types:")));
 
-       n = ceil(GameType_GetCount() / (me.rows - 6));
+       n = ceil(GameType_GetTotalCount() / (me.rows - 6));
        wgt = (w - 0.2) / n;
-       for(i = 0; i < GameType_GetCount(); ++i)
+       for(i = 0; i < GameType_GetTotalCount(); ++i)
        {
                if(mod(i, n) == 0)
                {
@@ -96,4 +88,5 @@ void XonoticMapInfoDialog_fill(entity me)
                me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton(ZCTX(_("MAP^Play")), '0 0 0'));
                        me.startButton.onClick = MapList_LoadMap;
                        me.startButton.onClickEntity = NULL; // filled later
+                       setDependent(e, "g_campaign", 0, 0);
 }