X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdialog_multiplayer_create_mapinfo.qc;h=87ffadf3831d8015641eb7b3b9e50e7d8e95ecc7;hp=5254f5aa37223a251bd7364992b80a1684767489;hb=2d30ce639fd8525a6f22d383f44c4c9af89fe873;hpb=9eb82dd6fc682e3ddecd471835f9047816236342 diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.qc b/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.qc index 5254f5aa3..87ffadf38 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.qc @@ -1,52 +1,22 @@ -#ifndef DIALOG_MULTIPLAYER_CREATE_MAPINFO_H -#define DIALOG_MULTIPLAYER_CREATE_MAPINFO_H -#include "dialog.qc" -CLASS(XonoticMapInfoDialog, XonoticDialog) - METHOD(XonoticMapInfoDialog, fill, void(entity)) - METHOD(XonoticMapInfoDialog, loadMapInfo, void(entity, float, entity)) - ATTRIB(XonoticMapInfoDialog, title, string, _("Map Information")) - ATTRIB(XonoticMapInfoDialog, color, vector, SKINCOLOR_DIALOG_MAPINFO) - ATTRIB(XonoticMapInfoDialog, intendedWidth, float, 1.0) - ATTRIB(XonoticMapInfoDialog, rows, float, 11) - ATTRIB(XonoticMapInfoDialog, columns, float, 10) +#include "dialog_multiplayer_create_mapinfo.qh" - ATTRIB(XonoticMapInfoDialog, previewImage, entity, NULL) - ATTRIB(XonoticMapInfoDialog, titleLabel, entity, NULL) - ATTRIB(XonoticMapInfoDialog, authorLabel, entity, NULL) - ATTRIB(XonoticMapInfoDialog, descriptionLabel, entity, NULL) - ATTRIB(XonoticMapInfoDialog, featuresLabel, entity, NULL) +#include "button.qh" +#include "image.qh" +#include "maplist.qh" +#include "textlabel.qh" +#include - ATTRIBARRAY(XonoticMapInfoDialog, typeLabels, entity, 24) - - ATTRIB(XonoticMapInfoDialog, currentMapIndex, float, 0) - ATTRIB(XonoticMapInfoDialog, currentMapBSPName, string, string_null) - ATTRIB(XonoticMapInfoDialog, currentMapTitle, string, string_null) - ATTRIB(XonoticMapInfoDialog, currentMapAuthor, string, string_null) - ATTRIB(XonoticMapInfoDialog, currentMapDescription, string, string_null) - ATTRIB(XonoticMapInfoDialog, currentMapPreviewImage, string, string_null) -ENDCLASS(XonoticMapInfoDialog) -#endif - -#ifdef IMPLEMENTATION void XonoticMapInfoDialog_loadMapInfo(entity me, int i, entity mlb) { me.currentMapIndex = i; 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); @@ -57,11 +27,11 @@ 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]); - e.disabled = !(MapInfo_Map_supportedGametypes & GameType_GetID(i)); + e.disabled = !(MapInfo_Map_supportedGametypes & GameType_GetID(i).m_flags); } MapInfo_ClearTemps(); @@ -91,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) { @@ -119,4 +89,3 @@ void XonoticMapInfoDialog_fill(entity me) me.startButton.onClick = MapList_LoadMap; me.startButton.onClickEntity = NULL; // filled later } -#endif