1 #include "dialog_multiplayer_create_mapinfo.qh"
6 #include "textlabel.qh"
7 #include <common/mapinfo.qh>
9 void XonoticMapInfoDialog_loadMapInfo(entity me, int i, entity mlb)
11 me.currentMapIndex = i;
12 me.startButton.onClickEntity = mlb;
15 strcpy(me.currentMapBSPName, MapInfo_Map_bspname);
16 strcpy(me.currentMapTitle, strdecolorize(MapInfo_Map_title));
17 strcpy(me.currentMapAuthor, strdecolorize(MapInfo_Map_author));
18 strcpy(me.currentMapDescription, MapInfo_Map_description);
19 strcpy(me.currentMapPreviewImage, strcat("/maps/", MapInfo_Map_bspname));
21 me.frame.setText(me.frame, me.currentMapBSPName);
22 me.titleLabel.setText(me.titleLabel, me.currentMapTitle);
23 me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);
24 me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);
25 if(draw_PictureSize(me.currentMapPreviewImage) == '0 0 0')
26 me.previewImage.src = "nopreview_map";
28 me.previewImage.src = me.currentMapPreviewImage;
30 for(i = 0; i < GameType_GetTotalCount(); ++i)
33 e = me.(typeLabels[i]);
34 e.disabled = !(MapInfo_Map_supportedGametypes & GameType_GetID(i).m_flags);
39 void XonoticMapInfoDialog_fill(entity me)
46 me.TD(me, me.rows - 2, 3, e = makeXonoticImage(string_null, 4.0/3.0));
48 me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
49 w = me.columns - me.currentColumn;
50 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Title:")));
51 me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
52 e.colorL = SKINCOLOR_MAPLIST_TITLE;
56 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Author:")));
57 me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
58 e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
62 me.TD(me, 1, w, e = makeXonoticTextLabel(0, _("Game types:")));
64 n = ceil(GameType_GetTotalCount() / (me.rows - 6));
66 for(i = 0; i < GameType_GetTotalCount(); ++i)
73 me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, MapInfo_Type_ToText(GameType_GetID(i))));
74 me.(typeLabels[i]) = e;
77 me.gotoRC(me, me.rows - 2, 0);
78 me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, ""));
80 me.descriptionLabel = e;
82 me.gotoRC(me, me.rows - 1, 0);
85 me.TD(me, 1, me.columns - 5.5, e = makeXonoticButton(_("Close"), '0 0 0'));
86 e.onClick = Dialog_Close;
88 me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton(ZCTX(_("MAP^Play")), '0 0 0'));
89 me.startButton.onClick = MapList_LoadMap;
90 me.startButton.onClickEntity = NULL; // filled later