2 CLASS(NexuizMapInfoDialog) EXTENDS(NexuizDialog)
3 METHOD(NexuizMapInfoDialog, fill, void(entity))
4 METHOD(NexuizMapInfoDialog, loadMapInfo, void(entity, float))
5 ATTRIB(NexuizMapInfoDialog, title, string, "Map Information")
6 ATTRIB(NexuizMapInfoDialog, color, vector, SKINCOLOR_DIALOG_MAPINFO)
7 ATTRIB(NexuizMapInfoDialog, intendedWidth, float, 0.75)
8 ATTRIB(NexuizMapInfoDialog, rows, float, 9)
9 ATTRIB(NexuizMapInfoDialog, columns, float, 9)
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, typeKeyHuntLabel, entity, NULL)
23 ATTRIB(NexuizMapInfoDialog, typeCTFLabel, entity, NULL)
24 ATTRIB(NexuizMapInfoDialog, typeAssaultLabel, entity, NULL)
25 ATTRIB(NexuizMapInfoDialog, typeOnslaughtLabel, entity, NULL)
27 ATTRIB(NexuizMapInfoDialog, currentMapIndex, float, 0)
28 ATTRIB(NexuizMapInfoDialog, currentMapBSPName, string, string_null)
29 ATTRIB(NexuizMapInfoDialog, currentMapTitle, string, string_null)
30 ATTRIB(NexuizMapInfoDialog, currentMapAuthor, string, string_null)
31 ATTRIB(NexuizMapInfoDialog, currentMapDescription, string, string_null)
32 ATTRIB(NexuizMapInfoDialog, currentMapPreviewImage, string, string_null)
33 ATTRIB(NexuizMapInfoDialog, currentMapFeaturesText, string, string_null)
34 ENDCLASS(NexuizMapInfoDialog)
38 void loadMapInfoNexuizMapInfoDialog(entity me, float i)
40 me.currentMapIndex = i;
43 if(me.currentMapBSPName)
45 strunzone(me.currentMapBSPName);
46 strunzone(me.currentMapTitle);
47 strunzone(me.currentMapAuthor);
48 strunzone(me.currentMapDescription);
49 strunzone(me.currentMapPreviewImage);
50 strunzone(me.currentMapFeaturesText);
52 me.currentMapBSPName = strzone(MapInfo_Map_bspname);
53 me.currentMapTitle = strzone(MapInfo_Map_title);
54 me.currentMapAuthor = strzone(MapInfo_Map_author);
55 me.currentMapDescription = strzone(MapInfo_Map_description);
56 me.currentMapFeaturesText = strzone((MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_WEAPONS) ? "Full item placement" : "MinstaGib only");
57 me.currentMapPreviewImage = strzone(strcat("/maps/", MapInfo_Map_bspname));
59 me.frame.setText(me.frame, me.currentMapBSPName);
60 me.titleLabel.setText(me.titleLabel, me.currentMapTitle);
61 me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);
62 me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);
63 me.featuresLabel.setText(me.featuresLabel, me.currentMapFeaturesText);
64 me.previewImage.src = me.currentMapPreviewImage;
66 me.typeDeathmatchLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH);
67 me.typeTDMLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH);
68 me.typeLMSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS);
69 me.typeArenaLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ARENA);
70 me.typeRuneLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RUNEMATCH);
71 me.typeKeyHuntLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEYHUNT);
72 me.typeCTFLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTF);
73 if(me.typeAssaultLabel)
74 me.typeAssaultLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ASSAULT);
75 if(me.typeOnslaughtLabel)
76 me.typeOnslaughtLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ONSLAUGHT);
78 void fillNexuizMapInfoDialog(entity me)
82 me.TD(me, me.rows - 2, 3, e = makeNexuizImage(string_null, 4.0/3.0));
84 me.gotoXY(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
85 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Title:"));
86 me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
88 e.colorL = SKINCOLOR_MAPLIST_TITLE;
92 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Author:"));
93 me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
95 e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
99 me.TD(me, 1, 5.5, e = makeNexuizTextLabel(0, ""));
101 me.featuresLabel = e;
103 me.TD(me, 1, 5.5, e = makeNexuizTextLabel(0, "Game types:"));
106 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "Deathmatch"));
107 me.typeDeathmatchLabel = e;
108 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "TDM"));
110 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "LMS"));
114 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "Arena"));
115 me.typeArenaLabel = e;
116 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "Rune"));
117 me.typeRuneLabel = e;
118 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "Key Hunt"));
119 me.typeKeyHuntLabel = e;
122 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "CTF"));
124 if(cvar("developer"))
126 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "Assault"));
127 me.typeAssaultLabel = e;
128 me.TD(me, 1, 1.5, e = makeNexuizTextLabel(0, "Onslaught"));
129 me.typeOnslaughtLabel = e;
132 me.gotoXY(me, me.rows - 2, 0);
133 me.TD(me, 1, me.columns, e = makeNexuizTextLabel(0.5, ""));
135 me.descriptionLabel = e;
137 me.gotoXY(me, me.rows - 1, 0);
138 me.TD(me, 1, me.columns, e = makeNexuizButton("OK", '0 0 0'));
139 e.onClick = Dialog_Close;
140 e.onClickEntity = me;