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));
20 if(draw_PictureSize(me.currentMapPreviewImage) == '0 0 0') // Quake 3 compatibility
21 strcpy(me.currentMapPreviewImage, strcat("/levelshots/", MapInfo_Map_bspname));
23 me.frame.setText(me.frame, me.currentMapBSPName);
24 me.titleLabel.setText(me.titleLabel, me.currentMapTitle);
25 me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);
26 me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);
27 if(draw_PictureSize(me.currentMapPreviewImage) == '0 0 0')
28 me.previewImage.src = "nopreview_map";
30 me.previewImage.src = me.currentMapPreviewImage;
32 for(i = 0; i < GameType_GetTotalCount(); ++i)
35 e = me.(typeLabels[i]);
36 e.disabled = !(MapInfo_Map_supportedGametypes & GameType_GetID(i).m_flags);
41 void XonoticMapInfoDialog_fill(entity me)
48 me.TD(me, me.rows - 2, 3, e = makeXonoticImage(string_null, 4.0/3.0));
50 me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
51 w = me.columns - me.currentColumn;
52 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Title:")));
53 me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
54 e.colorL = SKINCOLOR_MAPLIST_TITLE;
58 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Author:")));
59 me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
60 e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
64 me.TD(me, 1, w, e = makeXonoticTextLabel(0, _("Game types:")));
66 n = ceil(GameType_GetTotalCount() / (me.rows - 6));
68 for(i = 0; i < GameType_GetTotalCount(); ++i)
75 me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, MapInfo_Type_ToText(GameType_GetID(i))));
76 me.(typeLabels[i]) = e;
79 me.gotoRC(me, me.rows - 2, 0);
80 me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, ""));
82 me.descriptionLabel = e;
84 me.gotoRC(me, me.rows - 1, 0);
87 me.TD(me, 1, me.columns - 5.5, e = makeXonoticButton(_("Close"), '0 0 0'));
88 e.onClick = Dialog_Close;
90 me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton(ZCTX(_("MAP^Play")), '0 0 0'));
91 me.startButton.onClick = MapList_LoadMap;
92 me.startButton.onClickEntity = NULL; // filled later