Merge branch 'terencehill/menu_fixes' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / credits.qc
1 #ifndef CREDITS_H
2 #define CREDITS_H
3
4 #define CREDITS(TITLE, FUNCTION, PERSON, PERSON_, NL) \
5         TITLE(_("Core Team")) \
6                 PERSON(Rudolf "divVerent" Polzer) \
7                 PERSON(Ant "Antibody" Zucaro) \
8                 PERSON(Marvin "Mirio" Beck) \
9                 PERSON(Merlijn Hofstra) \
10                 PERSON(Peter "Morphed" Pielak) \
11                 PERSON(Ruszkai "CuBe0wL" Ákos) \
12                 PERSON(Samual "Ares" Lenks) \
13                 PERSON(TimePath) \
14                 PERSON(Tyler "-z-" Mulligan) \
15                 PERSON(Zac "Mario" Jardine) \
16         NL() \
17         TITLE(_("Extended Team")) \
18                 PERSON(Antonio "terencehill" Piu) \
19                 PERSON(Archer) \
20                 PERSON(BuddyFriendGuy) \
21                 PERSON(Debugger) \
22                 PERSON(GATTS) \
23                 PERSON(Halogene) \
24                 PERSON(IDWMaster) \
25                 PERSON(Jan "zykure" Behrens) \
26                 PERSON(JH0nny) \
27                 PERSON(Luigi) \
28                 PERSON(Łukasz "kuniu the frogg" Polek) \
29                 PERSON(Matthias "matthiaskrgr" Krüger) \
30                 PERSON(Mattia "Melanosuchus" Basaglia) \
31                 PERSON(MrBougo) \
32                 PERSON(Nick "bitbomb" Lucca) \
33                 PERSON(nilyt/nyov) \
34                 PERSON(Nitroxis) \
35                 PERSON(packer) \
36                 PERSON(Pearce "theShadow" Michal) \
37                 PERSON(Rasmus "FruitieX" Eskola) \
38                 PERSON(s1lence) \
39                 PERSON(Severin "sev" Meyer) \
40                 PERSON(Soelen) \
41                 PERSON(Sydes) \
42                 PERSON(unfa) \
43         NL() \
44         NL() \
45         FUNCTION(_("Website")) \
46                 PERSON(Ant "Antibody" Zucaro (web)) \
47                 PERSON(Merlijn Hofstra) \
48                 PERSON(Tyler "-z-" Mulligan (web / game)) \
49         NL() \
50         FUNCTION(_("Stats")) \
51                 PERSON(Ant "Antibody" Zucaro) \
52                 PERSON(Jan "zykure" Behrens) \
53         NL() \
54         FUNCTION(_("Art")) \
55                 PERSON(Severin "sev" Meyer) \
56                 PERSON(Sahil "DiaboliK" Singhal) \
57                 PERSON(Peter "Morphed" Pielak) \
58                 PERSON(Sam "LJFHutch" Hutchinson) \
59                 PERSON(Pearce "theShadow" Michal) \
60         NL() \
61         FUNCTION(_("Animation")) \
62                 PERSON(Sahil "DiaboliK" Singhal) \
63                 PERSON(nifrek) \
64         NL() \
65         FUNCTION(_("Level Design")) \
66                 PERSON(Amadeusz "amade/proraide" Sławiński) \
67                 PERSON(Ben "MooKow" Banker) \
68                 PERSON(Calinou) \
69                 PERSON(Cortez) \
70                 PERSON(Cuinn "Cuinnton" Herrick) \
71                 PERSON(Debugger) \
72                 PERSON(Jakob "tZork" Markström Gröhn) \
73                 PERSON(Konrad "Justin" Slawinski) \
74                 PERSON(Maddin) \
75                 PERSON(L0) \
76                 PERSON(Łukasz "kuniu the frogg" Polek) \
77                 PERSON(Maik "SavageX" Merten) \
78                 PERSON(Marvin "Mirio" Beck) \
79                 PERSON(MintOX) \
80                 PERSON(packer) \
81                 PERSON(Pearce "theShadow" Michal) \
82                 PERSON(Rasmus "FruitieX" Eskola) \
83                 PERSON(Ruszkai "CuBe0wL" Ákos) \
84                 PERSON(Severin "sev" Meyer) \
85                 PERSON(ShadoW) \
86         NL() \
87         FUNCTION(_("Music / Sound FX")) \
88                 PERSON(AquaNova (Archer)) \
89                 PERSON(blkrbt) \
90                 PERSON(chooksta) \
91                 PERSON(Independent.nu) \
92                 PERSON([master]mind) \
93                 PERSON(Merlijn Hofstra) \
94                 PERSON(Mick Rippon) \
95                 PERSON(Nick "bitbomb" Lucca) \
96                 PERSON(remaxim) \
97                 PERSON(Saulo "mand1nga" Gil) \
98                 PERSON({SC0RP} - Ian "ID" Dorrell) \
99                 PERSON(Stephan) \
100                 PERSON(unfa) \
101         NL() \
102         FUNCTION(_("Game Code")) \
103                 PERSON(Samual "Ares" Lenks) \
104                 PERSON(Rudolf "divVerent" Polzer) \
105                 PERSON(Jakob "tZork" Markström Gröhn) \
106                 PERSON(Rasmus "FruitieX" Eskola) \
107                 PERSON(TimePath) \
108                 PERSON(Zac "Mario" Jardine) \
109         NL() \
110         FUNCTION(_("Marketing / PR")) \
111                 PERSON(Tyler "-z-" Mulligan) \
112                 PERSON(Ruszkai "CuBe0wL" Ákos) \
113                 PERSON(Samual "Ares" Lenks) \
114                 PERSON(Saulo "mand1nga" Gil) \
115         NL() \
116         FUNCTION(_("Legal")) \
117                 PERSON(Rudolf "divVerent" Polzer) \
118                 PERSON(Merlijn Hofstra) \
119         NL() \
120         NL() \
121         TITLE(_("Game Engine")) \
122                 FUNCTION(_("DarkPlaces")) \
123                         PERSON(Forest "LordHavoc" Hale) \
124                 NL() \
125                 FUNCTION(_("Engine Additions")) \
126                         PERSON(Rudolf "divVerent" Polzer) \
127                         PERSON(Samual "Ares" Lenks) \
128                 NL() \
129         NL() \
130         TITLE(_("Compiler")) \
131                 FUNCTION(_("GMQCC")) \
132                         PERSON(Wolfgang "Blub\0" Bumiller) \
133                         PERSON(Dale "graphitemaster" Weiler) \
134                 NL() \
135         NL() \
136         TITLE(_("Other Active Contributors")) \
137                 PERSON(Erik "Ablu" Schilling) \
138                 PERSON(Mircea "Taoki" Kitsune) \
139                 PERSON(Penguinum) \
140         NL() \
141         NL() \
142         TITLE(_("Translators")) \
143                 NL() \
144                 FUNCTION(_("Asturian")) \
145                         PERSON(Llumex03) \
146                         PERSON(Tornes "Tornes.Llume" Ḷḷume) \
147                         PERSON(Ximielga) \
148                 NL() \
149                 FUNCTION(_("Belarusian")) \
150                         PERSON(Mihail "meequz" Varantsou) \
151                 NL() \
152                 FUNCTION(_("Bulgarian")) \
153                         PERSON(lokster) \
154                         PERSON(set_killer) \
155                 NL() \
156                 FUNCTION(_("Chinese (China)")) \
157                         PERSON(Antonidas) \
158                         PERSON(kalawore) \
159                         PERSON(sapphireliu) \
160                 NL() \
161                 FUNCTION(_("Czech")) \
162                         PERSON(shogun assassin/woky) \
163                         PERSON(Superovoce) \
164                         PERSON(Tomáš "CZHeron" Volavka) \
165                 NL() \
166                 FUNCTION(_("Dutch")) \
167                         PERSON(Alexander "freefang" van Dam) \
168                         PERSON(PinkRobot) \
169                         PERSON(vegiburger) \
170                 NL() \
171                 FUNCTION(_("English (Australia)")) \
172                         PERSON(Laurene "sunflowers" Albrand) \
173                         PERSON(Zac "Mario" Jardine) \
174                 NL() \
175                 FUNCTION(_("Finnish")) \
176                         PERSON(Henry "Exitium" Sanmark) \
177                         PERSON(Rasmus "FruitieX" Eskola) \
178                 NL() \
179                 FUNCTION(_("French")) \
180                         PERSON(Calinou) \
181                         PERSON(Maxime "Taximus" Paradis) \
182                         PERSON(RedGuff) \
183                         PERSON(Yannick "SpiKe" Le Guen) \
184                 NL() \
185                 FUNCTION(_("German")) \
186                         PERSON(Brot) \
187                         PERSON(cvcxc) \
188                         PERSON(Erik "Ablu" Schilling) \
189                         PERSON(Jope "Sless" Withers) \
190                         PERSON(Marvin "Mirio" Beck) \
191                         PERSON(Rudolf "divVerent" Polzer) \
192                         PERSON(Yepoleb) \
193                 NL() \
194                 FUNCTION(_("Greek")) \
195                         PERSON_("Γιάννης \"Evropi\" Ανθυμίδης") \
196                         PERSON(Konstantinos "LDinos" Mihalenas) \
197                         PERSON(Savoritias) \
198                         PERSON(Vindex) \
199                 NL() \
200                 FUNCTION(_("Hungarian")) \
201                         PERSON(Ruszkai "CuBe0wL" Ákos) \
202                         PERSON(xaN1C4n3) \
203                 NL() \
204                 FUNCTION(_("Italian")) \
205                         PERSON(Antonio "terencehill" Piu) \
206                         PERSON(Felice "MaidenBeast" Sallustio) \
207                         PERSON(stdi) \
208                         PERSON(XCostaX) \
209                 NL() \
210                 FUNCTION(_("Polish")) \
211                         PERSON(4m) \
212                         PERSON(Alex "tiprogrammierer.alex" Progger) \
213                         PERSON(Amadeusz "amade/proraide" Sławiński) \
214                 NL() \
215                 FUNCTION(_("Portuguese")) \
216                         PERSON(Ricardo Manuel "Hellgardia" da Cruz Coelho da Silva) \
217                         PERSON(xXxCHAOTICxXx) \
218                 NL() \
219                 FUNCTION(_("Romanian")) \
220                         PERSON(Adrian-Ciprian "adrian.tinjala" Tînjală) \
221                         PERSON(BusterDBK) \
222                         PERSON(Mircea "Taoki" Kitsune) \
223                         PERSON(Tudor "TropiKo" Ionel) \
224                 NL() \
225                 FUNCTION(_("Russian")) \
226                         PERSON(Alex "alextalker7" Talker) \
227                         PERSON(Alexandr "zrg") \
228                         PERSON(Andrei "adem4ik" Stepanov) \
229                         PERSON(gravicappa) \
230                         PERSON(Hot Dog) \
231                         PERSON(Lord Canistra) \
232                         PERSON(Nikoli) \
233                         PERSON(Sergej "Clearness High" Lutsyk) \
234                 NL() \
235                 FUNCTION(_("Serbian")) \
236                         PERSON_("Саша \"salepetronije\" Петровић") \
237                         PERSON(Pendulla) \
238                         PERSON(Rafael "Ristovski") \
239                 NL() \
240                 FUNCTION(_("Spanish")) \
241                         PERSON_("0000simon") \
242                         PERSON(Alan "aagp" Garcia) \
243                         PERSON(Ari_tent) \
244                         PERSON(brunodeleo) \
245                         PERSON(Kammy) \
246                         PERSON(roader_gentoo) \
247                         PERSON(Rodrigo Mouton Laudin) \
248                         PERSON(SouL) \
249                 NL() \
250                 FUNCTION(_("Swedish")) \
251                         PERSON(Karl-Oskar "machine" Rikås) \
252                         PERSON(marcus256) \
253                 NL() \
254                 FUNCTION(_("Ukrainian")) \
255                         PERSON(Oleh "BlaXpirit" Prypin) \
256                         PERSON(Vasyl "Harmata" Melnyk) \
257                         PERSON(Yuriy "herrniemand" Ackermann) \
258                 NL() \
259         NL() \
260         TITLE(_("Past Contributors")) \
261                 PERSON(Akari) \
262                 PERSON(Alexander "naryl" Suhoverhov) \
263                 PERSON(Alexander "motorsep" Zubov) \
264                 PERSON(Amos "torus" Dudley) \
265                 PERSON(Andreas "Black" Kirsch) \
266                 PERSON(Attila "WW3" Houtkooper) \
267                 PERSON(BigMac) \
268                 PERSON(Braden "meoblast001" Walters) \
269                 PERSON(Brain Younds) \
270                 PERSON(Chris "amethyst7" Matz) \
271                 PERSON(Christian Ice) \
272                 PERSON(Clinton "Kaziganthe" Freeman) \
273                 PERSON(Dan "Digger" Korostelev) \
274                 PERSON(Dan "Wazat" Hale) \
275                 PERSON(Dokujisan) \
276                 PERSON(Donkey) \
277                 PERSON(dstrek) \
278                 PERSON(Dustin Geeraert) \
279                 PERSON(Edgenetwork) \
280                 PERSON(Edward "Ed" Holness) \
281                 PERSON(Eric "Munyul Verminard" Sambach) \
282                 PERSON(Fabien "H. Reaper" Tschirhart) \
283                 PERSON(Florian Paul "lda17h" Schmidt) \
284                 PERSON(FrikaC) \
285                 PERSON(Garth "Zombie" Hendy) \
286                 PERSON(Gerd "Elysis" Raudenbusch) \
287                 PERSON(Gottfried "Toddd" Hofmann) \
288                 PERSON(Henning "Tymo" Janssen) \
289                 PERSON(Innovati) \
290                 PERSON(Jitspoe) \
291                 PERSON(Jody Gallagher) \
292                 PERSON(Jope "Sless" Withers) \
293                 PERSON(Juergen "LowDragon" Timm) \
294                 PERSON(KadaverJack) \
295                 PERSON(Kevin "Tyrann" Shanahan) \
296                 PERSON(Kristian "morfar" Johansson) \
297                 PERSON(Kurt Dereli) \
298                 PERSON(lcatlnx) \
299                 PERSON(Lee David Ash) \
300                 PERSON(Lee Vermeulen) \
301                 PERSON(leileilol) \
302                 PERSON(magorian) \
303                 PERSON(Marius "GreEn`mArine" Shekow) \
304                 PERSON(Marko "Urre" Permanto) \
305                 PERSON(Mathieu "Elric" Olivier) \
306                 PERSON(Mattrew "Tronyn" Rye) \
307                 PERSON(MauveBib) \
308                 PERSON(Mephisto) \
309                 PERSON(michaelb) \
310                 PERSON(Michael "Tenshihan" Quinn) \
311                 PERSON(Mepper) \
312                 PERSON(Munyul) \
313                 PERSON(Netzwerg) \
314                 PERSON(NoelCower) \
315                 PERSON(Parapraxis) \
316                 PERSON(parasti) \
317                 PERSON(Paul "Strahlemann" Evers) \
318                 PERSON(Paul Scott) \
319                 PERSON(Petithomme) \
320                 PERSON(PlasmaSheep) \
321                 PERSON(Przemysław "atheros" Grzywacz) \
322                 PERSON(Q1 Retexturing Project) \
323                 PERSON(Qantourisc) \
324                 PERSON(Oleh "BlaXpirit" Prypin) \
325                 PERSON(Rick "Rat" Kelley) \
326                 PERSON(Robert "ai" Kuroto) \
327                 PERSON(Ronan) \
328                 PERSON(Sajt) \
329                 PERSON(Saulo "mand1nga" Gil) \
330                 PERSON(Shaggy) \
331                 PERSON(Shank) \
332                 PERSON(Simon O’Callaghan) \
333                 PERSON(SomeGuy) \
334                 PERSON(SoulKeeper_p) \
335                 PERSON(Spike) \
336                 PERSON(Spirit) \
337                 PERSON(Stephan "esteel" Stahl) \
338                 PERSON(Steve Vermeulen) \
339                 PERSON(Supajoe) \
340                 PERSON(Tei) \
341                 PERSON(The player with the unnecessarily long name) \
342                 PERSON(Tomaz) \
343                 PERSON(Ulrich Galbraith) \
344                 PERSON(Vortex) \
345                 PERSON(William Libert) \
346                 PERSON(William "Willis" Weilep) \
347                 PERSON(Yves "EviLair" Allaire) \
348                 PERSON(Zenex) \
349                 /**/
350
351 int credits_get()
352 {
353         int n = buf_create();
354         #define CREDITS_TITLE(t) bufstr_add(n, strcat("**", t), 0);
355         #define CREDITS_FUNCTION(f) bufstr_add(n, strcat("*", f), 0);
356         #define CREDITS_PERSON(p) bufstr_add(n, p, 0);
357         #define _CREDITS_PERSON(p) CREDITS_PERSON(#p)
358         #define CREDITS_NL() bufstr_add(n, "", 0);
359     CREDITS(CREDITS_TITLE, CREDITS_FUNCTION, _CREDITS_PERSON, CREDITS_PERSON, CREDITS_NL)
360         #undef CREDITS_TITLE
361         #undef CREDITS_FUNCTION
362         #undef CREDITS_PERSON
363         #undef _CREDITS_PERSON
364         #undef CREDITS_NL
365         return n;
366 }
367
368 #undef CREDITS
369
370 #include "listbox.qc"
371 CLASS(XonoticCreditsList, XonoticListBox)
372         METHOD(XonoticCreditsList, configureXonoticCreditsList, void(entity));
373         ATTRIB(XonoticCreditsList, rowsPerItem, float, 1)
374         METHOD(XonoticCreditsList, draw, void(entity));
375         METHOD(XonoticCreditsList, drawListBoxItem, void(entity, int, vector, bool, bool));
376         METHOD(XonoticCreditsList, resizeNotify, void(entity, vector, vector, vector, vector));
377         METHOD(XonoticCreditsList, keyDown, float(entity, float, float, float));
378         METHOD(XonoticCreditsList, destroy, void(entity));
379         ATTRIB(XonoticCreditsList, selectionDoesntMatter, bool, true)
380
381         ATTRIB(XonoticCreditsList, realFontSize, vector, '0 0 0')
382         ATTRIB(XonoticCreditsList, realUpperMargin, float, 0)
383         ATTRIB(XonoticCreditsList, bufferIndex, float, 0)
384         ATTRIB(XonoticCreditsList, scrolling, float, 0)
385
386         ATTRIB(XonoticCreditsList, alphaBG, float, 0)
387 ENDCLASS(XonoticCreditsList)
388 entity makeXonoticCreditsList();
389 #endif
390
391 #ifdef IMPLEMENTATION
392 entity makeXonoticCreditsList()
393 {
394         entity me;
395         me = NEW(XonoticCreditsList);
396         me.configureXonoticCreditsList(me);
397         return me;
398 }
399 void XonoticCreditsList_configureXonoticCreditsList(entity me)
400 {
401         me.configureXonoticListBox(me);
402     me.bufferIndex = credits_get();
403         me.nItems = buf_getsize(me.bufferIndex);
404 }
405 void XonoticCreditsList_destroy(entity me)
406 {
407         buf_del(me.bufferIndex);
408 }
409 void XonoticCreditsList_draw(entity me)
410 {
411         if(me.scrolling)
412         {
413                 me.scrollPos = bound(0, (time - me.scrolling) * me.itemHeight, me.nItems * me.itemHeight - 1);
414                 me.scrollPosTarget = me.scrollPos;
415         }
416         SUPER(XonoticCreditsList).draw(me);
417 }
418 void XonoticCreditsList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
419 {
420         SUPER(XonoticCreditsList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
421
422         me.realFontSize_y = me.fontSize / (absSize.y * me.itemHeight);
423         me.realFontSize_x = me.fontSize / (absSize.x * (1 - me.controlWidth));
424         me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
425 }
426 void XonoticCreditsList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
427 {
428         // layout: Ping, Credits name, Map name, NP, TP, MP
429         string s;
430         float theAlpha;
431         vector theColor;
432
433         s = bufstr_get(me.bufferIndex, i);
434
435         if(substring(s, 0, 2) == "**")
436         {
437                 s = substring(s, 2, strlen(s) - 2);
438                 theColor = SKINCOLOR_CREDITS_TITLE;
439                 theAlpha = SKINALPHA_CREDITS_TITLE;
440         }
441         else if(substring(s, 0, 1) == "*")
442         {
443                 s = substring(s, 1, strlen(s) - 1);
444                 theColor = SKINCOLOR_CREDITS_FUNCTION;
445                 theAlpha = SKINALPHA_CREDITS_FUNCTION;
446         }
447         else
448         {
449                 theColor = SKINCOLOR_CREDITS_PERSON;
450                 theAlpha = SKINALPHA_CREDITS_PERSON;
451         }
452
453         draw_CenterText(me.realUpperMargin * eY + 0.5 * eX, s, me.realFontSize, theColor, theAlpha, 0);
454 }
455
456 float XonoticCreditsList_keyDown(entity me, float key, float ascii, float shift)
457 {
458         me.scrolling = 0;
459         return SUPER(XonoticCreditsList).keyDown(me, key, ascii, shift);
460 }
461 #endif