2 CLASS(NexuizMapInfoDialog) EXTENDS(NexuizDialog)
3 METHOD(NexuizMapInfoDialog, fill, void(entity))
4 METHOD(NexuizMapInfoDialog, loadMapInfo, void(entity, float, entity))
5 ATTRIB(NexuizMapInfoDialog, title, string, "Map Information")
6 ATTRIB(NexuizMapInfoDialog, color, vector, SKINCOLOR_DIALOG_MAPINFO)
7 ATTRIB(NexuizMapInfoDialog, intendedWidth, float, 0.85)
8 ATTRIB(NexuizMapInfoDialog, rows, float, 9)
9 ATTRIB(NexuizMapInfoDialog, columns, float, 10)
11 ATTRIB(NexuizMapInfoDialog, previewImage, entity, NULL)
12 ATTRIB(NexuizMapInfoDialog, titleLabel, entity, NULL)
13 ATTRIB(NexuizMapInfoDialog, authorLabel, entity, NULL)
14 ATTRIB(NexuizMapInfoDialog, descriptionLabel, entity, NULL)
15 ATTRIB(NexuizMapInfoDialog, featuresLabel, entity, NULL)
17 ATTRIB(NexuizMapInfoDialog, typeDeathmatchLabel, entity, NULL)
18 ATTRIB(NexuizMapInfoDialog, typeTDMLabel, entity, NULL)
19 ATTRIB(NexuizMapInfoDialog, typeLMSLabel, entity, NULL)
20 ATTRIB(NexuizMapInfoDialog, typeArenaLabel, entity, NULL)
21 ATTRIB(NexuizMapInfoDialog, typeRuneLabel, entity, NULL)
22 ATTRIB(NexuizMapInfoDialog, typeDominationLabel, entity, NULL)
23 ATTRIB(NexuizMapInfoDialog, typeKeyHuntLabel, entity, NULL)
24 ATTRIB(NexuizMapInfoDialog, typeCTFLabel, entity, NULL)
25 ATTRIB(NexuizMapInfoDialog, typeAssaultLabel, entity, NULL)
26 ATTRIB(NexuizMapInfoDialog, typeOnslaughtLabel, entity, NULL)
27 ATTRIB(NexuizMapInfoDialog, typeRaceLabel, entity, NULL)
29 ATTRIB(NexuizMapInfoDialog, currentMapIndex, float, 0)
30 ATTRIB(NexuizMapInfoDialog, currentMapBSPName, string, string_null)
31 ATTRIB(NexuizMapInfoDialog, currentMapTitle, string, string_null)
32 ATTRIB(NexuizMapInfoDialog, currentMapAuthor, string, string_null)
33 ATTRIB(NexuizMapInfoDialog, currentMapDescription, string, string_null)
34 ATTRIB(NexuizMapInfoDialog, currentMapPreviewImage, string, string_null)
35 ATTRIB(NexuizMapInfoDialog, currentMapFeaturesText, string, string_null)
36 ENDCLASS(NexuizMapInfoDialog)
40 void loadMapInfoNexuizMapInfoDialog(entity me, float i, entity mlb)
42 me.currentMapIndex = i;
43 me.startButton.onClickEntity = mlb;
46 if(me.currentMapBSPName)
48 strunzone(me.currentMapBSPName);
49 strunzone(me.currentMapTitle);
50 strunzone(me.currentMapAuthor);
51 strunzone(me.currentMapDescription);
52 strunzone(me.currentMapPreviewImage);
53 strunzone(me.currentMapFeaturesText);
55 me.currentMapBSPName = strzone(MapInfo_Map_bspname);
56 me.currentMapTitle = strzone(MapInfo_Map_title);
57 me.currentMapAuthor = strzone(MapInfo_Map_author);
58 me.currentMapDescription = strzone(MapInfo_Map_description);
59 me.currentMapFeaturesText = strzone((MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_WEAPONS) ? "Full item placement" : "MinstaGib only");
60 me.currentMapPreviewImage = strzone(strcat("/maps/", MapInfo_Map_bspname));
62 me.frame.setText(me.frame, me.currentMapBSPName);
63 me.titleLabel.setText(me.titleLabel, me.currentMapTitle);
64 me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);
65 me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);
66 me.featuresLabel.setText(me.featuresLabel, me.currentMapFeaturesText);
67 me.previewImage.src = me.currentMapPreviewImage;
69 me.typeDeathmatchLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH);
70 me.typeTDMLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH);
71 me.typeLMSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS);
72 me.typeArenaLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ARENA);
73 me.typeDominationLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DOMINATION);
74 me.typeRuneLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RUNEMATCH);
75 me.typeKeyHuntLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEYHUNT);
76 me.typeCTFLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTF);
77 me.typeAssaultLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ASSAULT);
78 me.typeOnslaughtLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ONSLAUGHT);
79 me.typeRaceLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE);
83 void fillNexuizMapInfoDialog(entity me)
88 me.TD(me, me.rows - 2, 3, e = makeNexuizImage(string_null, 4.0/3.0));
90 me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
91 w = me.columns - me.currentColumn;
92 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Title:"));
93 me.TD(me, 1, w-1, e = makeNexuizTextLabel(0, ""));
94 e.colorL = SKINCOLOR_MAPLIST_TITLE;
98 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Author:"));
99 me.TD(me, 1, w-1, e = makeNexuizTextLabel(0, ""));
100 e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
104 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Features:"));
105 me.TD(me, 1, w-1, e = makeNexuizTextLabel(0, ""));
107 me.featuresLabel = e;
109 me.TD(me, 1, w, e = makeNexuizTextLabel(0, "Game types:"));
110 me.TR(me); wgt = (w-0.4)/4;
111 me.TD(me, 1, 0.4, e = makeNexuizTextLabel(0, ""));
112 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "Deathmatch"));
113 me.typeDeathmatchLabel = e;
114 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "TDM"));
116 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "LMS"));
118 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "Arena"));
119 me.typeArenaLabel = e;
121 me.TD(me, 1, 0.4, e = makeNexuizTextLabel(0, ""));
122 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "Rune"));
123 me.typeRuneLabel = e;
124 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "Domination"));
125 me.typeDominationLabel = e;
126 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "Key Hunt"));
127 me.typeKeyHuntLabel = e;
128 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "CTF"));
131 me.TD(me, 1, 0.4, e = makeNexuizTextLabel(0, ""));
132 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "Assault"));
133 me.typeAssaultLabel = e;
134 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "Onslaught"));
135 me.typeOnslaughtLabel = e;
136 me.TD(me, 1, wgt, e = makeNexuizTextLabel(0, "Race"));
137 me.typeRaceLabel = e;
139 me.gotoRC(me, me.rows - 2, 0);
140 me.TD(me, 1, me.columns, e = makeNexuizTextLabel(0.5, ""));
142 me.descriptionLabel = e;
144 me.gotoRC(me, me.rows - 1, 0);
147 me.TD(me, 1, me.columns - 5.5, e = makeNexuizButton("OK", '0 0 0'));
148 e.onClick = Dialog_Close;
149 e.onClickEntity = me;
150 me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeNexuizButton("Play", '0 0 0'));
151 me.startButton.onClick = MapList_LoadMap;
152 me.startButton.onClickEntity = NULL; // filled later