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, 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)
28 ATTRIB(NexuizMapInfoDialog, currentMapIndex, float, 0)
29 ATTRIB(NexuizMapInfoDialog, currentMapBSPName, string, string_null)
30 ATTRIB(NexuizMapInfoDialog, currentMapTitle, string, string_null)
31 ATTRIB(NexuizMapInfoDialog, currentMapAuthor, string, string_null)
32 ATTRIB(NexuizMapInfoDialog, currentMapDescription, string, string_null)
33 ATTRIB(NexuizMapInfoDialog, currentMapPreviewImage, string, string_null)
34 ATTRIB(NexuizMapInfoDialog, currentMapFeaturesText, string, string_null)
35 ENDCLASS(NexuizMapInfoDialog)
39 void loadMapInfoNexuizMapInfoDialog(entity me, float i)
41 me.currentMapIndex = i;
44 if(me.currentMapBSPName)
46 strunzone(me.currentMapBSPName);
47 strunzone(me.currentMapTitle);
48 strunzone(me.currentMapAuthor);
49 strunzone(me.currentMapDescription);
50 strunzone(me.currentMapPreviewImage);
51 strunzone(me.currentMapFeaturesText);
53 me.currentMapBSPName = strzone(MapInfo_Map_bspname);
54 me.currentMapTitle = strzone(MapInfo_Map_title);
55 me.currentMapAuthor = strzone(MapInfo_Map_author);
56 me.currentMapDescription = strzone(MapInfo_Map_description);
57 me.currentMapFeaturesText = strzone((MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_WEAPONS) ? "Full item placement" : "MinstaGib only");
58 me.currentMapPreviewImage = strzone(strcat("/maps/", MapInfo_Map_bspname));
60 me.frame.setText(me.frame, me.currentMapBSPName);
61 me.titleLabel.setText(me.titleLabel, me.currentMapTitle);
62 me.authorLabel.setText(me.authorLabel, me.currentMapAuthor);
63 me.descriptionLabel.setText(me.descriptionLabel, me.currentMapDescription);
64 me.featuresLabel.setText(me.featuresLabel, me.currentMapFeaturesText);
65 me.previewImage.src = me.currentMapPreviewImage;
67 me.typeDeathmatchLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH);
68 me.typeTDMLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH);
69 me.typeLMSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS);
70 me.typeArenaLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ARENA);
71 me.typeRuneLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RUNEMATCH);
72 me.typeKeyHuntLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEYHUNT);
73 me.typeCTFLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTF);
74 if(me.typeAssaultLabel)
75 me.typeAssaultLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ASSAULT);
76 if(me.typeOnslaughtLabel)
77 me.typeOnslaughtLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ONSLAUGHT);
79 void fillNexuizMapInfoDialog(entity me)
83 me.TD(me, me.rows - 2, 3, e = makeNexuizImage(string_null, 4.0/3.0));
85 me.gotoXY(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
86 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Title:"));
87 me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
89 e.colorL = SKINCOLOR_MAPLIST_TITLE;
93 me.TD(me, 1, 1, e = makeNexuizTextLabel(0, "Author:"));
94 me.TD(me, 1, 4.5, e = makeNexuizTextLabel(0, ""));
96 e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
100 me.TD(me, 1, 5.5, e = makeNexuizTextLabel(0, ""));
102 me.featuresLabel = e;
104 me.TD(me, 1, 5.5, e = makeNexuizTextLabel(0, "Game types:"));
106 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "Deathmatch"));
107 me.typeDeathmatchLabel = e;
108 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "TDM"));
110 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "LMS"));
112 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "Arena"));
113 me.typeArenaLabel = e;
115 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "Rune"));
116 me.typeRuneLabel = e;
117 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "Domination"));
118 me.typeDominationLabel = e;
119 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "Key Hunt"));
120 me.typeKeyHuntLabel = e;
121 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "CTF"));
124 if(cvar("developer"))
126 me.TD(me, 1, 5.5/4, e = makeNexuizTextLabel(0, "Assault"));
127 me.typeAssaultLabel = e;
128 me.TD(me, 1, 5.5/4, 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;