2 CLASS(VoretMapInfoDialog) EXTENDS(VoretDialog)
\r
3 METHOD(VoretMapInfoDialog, fill, void(entity))
\r
4 METHOD(VoretMapInfoDialog, loadMapInfo, void(entity, float, entity))
\r
5 ATTRIB(VoretMapInfoDialog, title, string, "Map Information")
\r
6 ATTRIB(VoretMapInfoDialog, color, vector, SKINCOLOR_DIALOG_MAPINFO)
\r
7 ATTRIB(VoretMapInfoDialog, intendedWidth, float, 0.85)
\r
8 ATTRIB(VoretMapInfoDialog, rows, float, 9)
\r
9 ATTRIB(VoretMapInfoDialog, columns, float, 10)
\r
11 ATTRIB(VoretMapInfoDialog, previewImage, entity, NULL)
\r
12 ATTRIB(VoretMapInfoDialog, titleLabel, entity, NULL)
\r
13 ATTRIB(VoretMapInfoDialog, authorLabel, entity, NULL)
\r
14 ATTRIB(VoretMapInfoDialog, descriptionLabel, entity, NULL)
\r
15 ATTRIB(VoretMapInfoDialog, featuresLabel, entity, NULL)
\r
17 ATTRIB(VoretMapInfoDialog, typeDeathmatchLabel, entity, NULL)
\r
18 ATTRIB(VoretMapInfoDialog, typeTDMLabel, entity, NULL)
\r
19 ATTRIB(VoretMapInfoDialog, typeLMSLabel, entity, NULL)
\r
20 ATTRIB(VoretMapInfoDialog, typeArenaLabel, entity, NULL)
\r
21 ATTRIB(VoretMapInfoDialog, typeDominationLabel, entity, NULL)
\r
22 ATTRIB(VoretMapInfoDialog, typeKeyHuntLabel, entity, NULL)
\r
23 ATTRIB(VoretMapInfoDialog, typeCTFLabel, entity, NULL)
\r
24 ATTRIB(VoretMapInfoDialog, typeCALabel, entity, NULL)
\r
25 ATTRIB(VoretMapInfoDialog, typeAssaultLabel, entity, NULL)
\r
26 ATTRIB(VoretMapInfoDialog, typeOnslaughtLabel, entity, NULL)
\r
27 ATTRIB(VoretMapInfoDialog, typeRaceLabel, entity, NULL)
\r
28 ATTRIB(VoretMapInfoDialog, typeCTSLabel, entity, NULL)
\r
30 ATTRIB(VoretMapInfoDialog, currentMapIndex, float, 0)
\r
31 ATTRIB(VoretMapInfoDialog, currentMapBSPName, string, string_null)
\r
32 ATTRIB(VoretMapInfoDialog, currentMapTitle, string, string_null)
\r
33 ATTRIB(VoretMapInfoDialog, currentMapAuthor, string, string_null)
\r
34 ATTRIB(VoretMapInfoDialog, currentMapDescription, string, string_null)
\r
35 ATTRIB(VoretMapInfoDialog, currentMapPreviewImage, string, string_null)
\r
36 ATTRIB(VoretMapInfoDialog, currentMapFeaturesText, string, string_null)
\r
37 ENDCLASS(VoretMapInfoDialog)
\r
40 #ifdef IMPLEMENTATION
\r
41 void loadMapInfoVoretMapInfoDialog(entity me, float i, entity mlb)
\r
43 me.currentMapIndex = i;
\r
44 me.startButton.onClickEntity = mlb;
\r
45 MapInfo_Get_ByID(i);
\r
47 if(me.currentMapBSPName)
\r
49 strunzone(me.currentMapBSPName);
\r
50 strunzone(me.currentMapTitle);
\r
51 strunzone(me.currentMapAuthor);
\r
52 strunzone(me.currentMapDescription);
\r
53 strunzone(me.currentMapPreviewImage);
\r
54 strunzone(me.currentMapFeaturesText);
\r
56 me.currentMapBSPName = strzone(MapInfo_Map_bspname);
\r
57 me.currentMapTitle = strzone(MapInfo_Map_title);
\r
58 me.currentMapAuthor = strzone(MapInfo_Map_author);
\r
59 me.currentMapDescription = strzone(MapInfo_Map_description);
\r
60 me.currentMapFeaturesText = strzone((MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_WEAPONS) ? "Full item placement" : "MinstaGib only");
\r
61 me.currentMapPreviewImage = strzone(strcat("/maps/", MapInfo_Map_bspname));
\r
63 me.frame.setText(me.frame, me.currentMapBSPName);
\r
64 me.titleLabel.setText(me.titleLabel, me.currentMapTitle);
\r
65 me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);
\r
66 me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);
\r
67 me.featuresLabel.setText(me.featuresLabel, me.currentMapFeaturesText);
\r
68 me.previewImage.src = me.currentMapPreviewImage;
\r
70 me.typeDeathmatchLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH);
\r
71 me.typeTDMLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH);
\r
72 me.typeLMSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS);
\r
73 me.typeArenaLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ARENA);
\r
74 me.typeDominationLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DOMINATION);
\r
75 me.typeKeyHuntLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEYHUNT);
\r
76 me.typeCTFLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTF);
\r
77 me.typeCALabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CA);
\r
78 me.typeAssaultLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ASSAULT);
\r
79 me.typeOnslaughtLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ONSLAUGHT);
\r
80 me.typeRaceLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE);
\r
81 me.typeCTSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS);
\r
83 MapInfo_ClearTemps();
\r
85 void fillVoretMapInfoDialog(entity me)
\r
90 me.TDempty(me, 0.2);
\r
91 me.TD(me, me.rows - 2, 3, e = makeVoretImage(string_null, 4.0/3.0));
\r
92 me.previewImage = e;
\r
93 me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
\r
94 w = me.columns - me.currentColumn;
\r
95 me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Title:"));
\r
96 me.TD(me, 1, w-1, e = makeVoretTextLabel(0, ""));
\r
97 e.colorL = SKINCOLOR_MAPLIST_TITLE;
\r
101 me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Author:"));
\r
102 me.TD(me, 1, w-1, e = makeVoretTextLabel(0, ""));
\r
103 e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
\r
105 me.authorLabel = e;
\r
107 me.TD(me, 1, 1, e = makeVoretTextLabel(0, "Features:"));
\r
108 me.TD(me, 1, w-1, e = makeVoretTextLabel(0, ""));
\r
110 me.featuresLabel = e;
\r
112 me.TD(me, 1, w, e = makeVoretTextLabel(0, "Game types:"));
\r
113 me.TR(me); wgt = (w-0.2)/5;
\r
114 me.TDempty(me, 0.2);
\r
115 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "DM"));
\r
116 me.typeDeathmatchLabel = e;
\r
117 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "TDM"));
\r
118 me.typeTDMLabel = e;
\r
119 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "LMS"));
\r
120 me.typeLMSLabel = e;
\r
121 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Arena"));
\r
122 me.typeArenaLabel = e;
\r
124 me.TDempty(me, 0.2);
\r
125 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Domination"));
\r
126 me.typeDominationLabel = e;
\r
127 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Key Hunt"));
\r
128 me.typeKeyHuntLabel = e;
\r
129 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "CTF"));
\r
130 me.typeCTFLabel = e;
\r
131 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "CA"));
\r
132 me.typeCALabel = e;
\r
133 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Assault"));
\r
134 me.typeAssaultLabel = e;
\r
136 me.TDempty(me, 0.2);
\r
137 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Onslaught"));
\r
138 me.typeOnslaughtLabel = e;
\r
139 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "Race"));
\r
140 me.typeRaceLabel = e;
\r
141 me.TD(me, 1, wgt, e = makeVoretTextLabel(0, "CTS"));
\r
142 me.typeCTSLabel = e;
\r
144 me.gotoRC(me, me.rows - 2, 0);
\r
145 me.TD(me, 1, me.columns, e = makeVoretTextLabel(0.5, ""));
\r
147 me.descriptionLabel = e;
\r
149 me.gotoRC(me, me.rows - 1, 0);
\r
150 me.TDempty(me, 0.5);
\r
152 me.TD(me, 1, me.columns - 5.5, e = makeVoretButton("Close", '0 0 0'));
\r
153 e.onClick = Dialog_Close;
\r
154 e.onClickEntity = me;
\r
155 me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeVoretButton("Play", '0 0 0'));
\r
156 me.startButton.onClick = MapList_LoadMap;
\r
157 me.startButton.onClickEntity = NULL; // filled later
\r
158 me.TDempty(me, 0.5);
\r