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 if(me.currentMapBSPName)
17 strunzone(me.currentMapBSPName);
18 strunzone(me.currentMapTitle);
19 strunzone(me.currentMapAuthor);
20 strunzone(me.currentMapDescription);
21 strunzone(me.currentMapPreviewImage);
23 me.currentMapBSPName = strzone(MapInfo_Map_bspname);
24 me.currentMapTitle = strzone(strdecolorize(MapInfo_Map_title));
25 me.currentMapAuthor = strzone(strdecolorize(MapInfo_Map_author));
26 me.currentMapDescription = strzone(MapInfo_Map_description);
27 me.currentMapPreviewImage = strzone(strcat("/maps/", MapInfo_Map_bspname));
29 me.frame.setText(me.frame, me.currentMapBSPName);
30 me.titleLabel.setText(me.titleLabel, me.currentMapTitle);
31 me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);
32 me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);
33 if(draw_PictureSize(me.currentMapPreviewImage) == '0 0 0')
34 me.previewImage.src = "nopreview_map";
36 me.previewImage.src = me.currentMapPreviewImage;
38 for(i = 0; i < GameType_GetTotalCount(); ++i)
41 e = me.(typeLabels[i]);
42 e.disabled = !(MapInfo_Map_supportedGametypes & GameType_GetID(i).m_flags);
47 void XonoticMapInfoDialog_fill(entity me)
54 me.TD(me, me.rows - 2, 3, e = makeXonoticImage(string_null, 4.0/3.0));
56 me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
57 w = me.columns - me.currentColumn;
58 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Title:")));
59 me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
60 e.colorL = SKINCOLOR_MAPLIST_TITLE;
64 me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Author:")));
65 me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
66 e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
70 me.TD(me, 1, w, e = makeXonoticTextLabel(0, _("Game types:")));
72 n = ceil(GameType_GetTotalCount() / (me.rows - 6));
74 for(i = 0; i < GameType_GetTotalCount(); ++i)
81 me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, MapInfo_Type_ToText(GameType_GetID(i))));
82 me.(typeLabels[i]) = e;
85 me.gotoRC(me, me.rows - 2, 0);
86 me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, ""));
88 me.descriptionLabel = e;
90 me.gotoRC(me, me.rows - 1, 0);
93 me.TD(me, 1, me.columns - 5.5, e = makeXonoticButton(_("Close"), '0 0 0'));
94 e.onClick = Dialog_Close;
96 me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton(ZCTX(_("MAP^Play")), '0 0 0'));
97 me.startButton.onClick = MapList_LoadMap;
98 me.startButton.onClickEntity = NULL; // filled later