Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
emoteconstructor.c
Go to the documentation of this file.
2 {
3  bool ConstructEmotes(PlayerBase player, out map<int, ref EmoteBase> emoteMap)
4  {
5  TTypenameArray emote_array_names = new TTypenameArray;
6  RegisterEmotes(emote_array_names);
7  Sort(emote_array_names,emote_array_names.Count());
8 
9  emoteMap = new map<int, ref EmoteBase>;
10  ref EmoteBase new_emote;
11 
12  for (int i = 0; i < emote_array_names.Count(); i++)
13  {
14  new_emote = EmoteBase.Cast(emote_array_names[i].Spawn());
15  if (new_emote)
16  {
17  if (new_emote.GetID() < 0)
18  {
19  ErrorEx("Emote " + emote_array_names[i].ToString() + " has an invalid ID, registation failed!");
20  return false;
21  }
22  else if (emoteMap.Contains(new_emote.GetID()))
23  {
24  ErrorEx("Emote " + emote_array_names[i].ToString() + " has a duplicate ID, registation failed!");
25  return false;
26  }
27  else
28  {
29  new_emote.SetOwnerPlayer(player);
30  emoteMap.Insert(new_emote.GetID(), new_emote);
31  }
32  }
33  }
34  return true;
35  }
36 
37  void RegisterEmotes(TTypenameArray emotes)
38  {
39  emotes.Insert(EmoteGreeting);
40  emotes.Insert(EmoteSOS);
41  emotes.Insert(EmoteHeart);
42  emotes.Insert(EmoteTaunt);
43  emotes.Insert(EmoteLyingDown);
44  emotes.Insert(EmoteTauntKiss);
45  emotes.Insert(EmotePoint);
46  emotes.Insert(EmoteTauntElbow);
47  emotes.Insert(EmoteThumb);
48  emotes.Insert(EmoteThumbDown);
49  emotes.Insert(EmoteThroat);
50  emotes.Insert(EmoteDance);
51  emotes.Insert(EmoteSalute);
52  emotes.Insert(EmoteTimeout);
53  //emotes.Insert(EmoteDabbing);
54  emotes.Insert(EmoteFacepalm);
55  emotes.Insert(EmoteClap);
56  emotes.Insert(EmoteSilent);
57  emotes.Insert(EmoteWatching);
58  emotes.Insert(EmoteHold);
59  emotes.Insert(EmoteListening);
60  emotes.Insert(EmotePointSelf);
61  emotes.Insert(EmoteLookAtMe);
62  emotes.Insert(EmoteTauntThink);
63  emotes.Insert(EmoteMove);
64  emotes.Insert(EmoteGetDown);
65  emotes.Insert(EmoteCome);
66  emotes.Insert(EmoteSurrender); //exception, partially handled in EmoteManager directly (..)
67  emotes.Insert(EmoteCampfireSit);
68  emotes.Insert(EmoteSitA);
69  emotes.Insert(EmoteSitB);
70  emotes.Insert(EmoteRPSRandom);
71  emotes.Insert(EmoteRPSRock);
72  emotes.Insert(EmoteRPSPaper);
73  emotes.Insert(EmoteRPSScisors);
74  emotes.Insert(EmoteNod);
75  emotes.Insert(EmoteShake);
76  emotes.Insert(EmoteShrug);
77  emotes.Insert(EmoteSuicide);
78  emotes.Insert(EmoteVomit);
79  }
80 }
EmoteTimeout
class EmoteSalute extends EmoteBase EmoteTimeout()
Definition: emoteclasses.c:203
EmoteSalute
void EmoteSalute()
Definition: emoteclasses.c:179
EmoteSilent
class EmoteClap extends EmoteBase EmoteSilent()
Definition: emoteclasses.c:259
EmoteMove
void EmoteMove()
Definition: emoteclasses.c:179
Sort
proto void Sort(void param_array[], int num)
Sorts static array of integers(ascendically) / floats(ascendically) / strings(alphabetically)
EmoteThroat
void EmoteThroat()
Definition: emoteclasses.c:2
EmoteCome
void EmoteCome()
Definition: emoteclasses.c:179
EmotePointSelf
class EmoteListening extends EmoteBase EmotePointSelf()
Definition: emoteclasses.c:315
EmoteThumb
void EmoteThumb()
Definition: emoteclasses.c:2
EmoteDance
class EmoteThroat extends EmoteBase EmoteDance()
Definition: emoteclasses.c:167
EmoteSitA
class EmoteCampfireSit extends EmoteBase EmoteSitA()
Definition: emoteclasses.c:446
EmoteWatching
void EmoteWatching()
Definition: emoteclasses.c:179
EmoteRPSScisors
void EmoteRPSScisors()
Definition: emoteclasses.c:414
EmotePoint
void EmotePoint()
Definition: emoteclasses.c:2
EmoteTauntThink
class EmoteLookAtMe extends EmoteBase EmoteTauntThink()
Definition: emoteclasses.c:343
EmoteSuicide
void EmoteSuicide()
Definition: emoteclasses.c:414
EmoteListening
void EmoteListening()
Definition: emoteclasses.c:179
ToString
proto string ToString()
TTypenameArray
array< typename > TTypenameArray
Definition: enscript.c:693
ErrorEx
enum ShapeType ErrorEx
EmoteTauntElbow
class EmotePoint extends EmoteBase EmoteTauntElbow()
Definition: emoteclasses.c:111
EmoteNod
class EmoteRPSScisors extends EmoteBase EmoteNod()
Definition: emoteclasses.c:530
EmoteBase
Definition: emotebase.c:1
EmoteHold
class EmoteWatching extends EmoteBase EmoteHold()
Definition: emoteclasses.c:287
Spawn
void Spawn()
spawn damage trigger
Definition: areadamagemanager.c:70
PlayerBase
Definition: playerbaseclient.c:1
map
map
Definition: controlsxboxnew.c:3
EmoteShake
void EmoteShake()
Definition: emoteclasses.c:414
EmoteHeart
void EmoteHeart()
Definition: emoteclasses.c:2
EmoteGreeting
void EmoteGreeting()
Definition: emoteclasses.c:2
EmoteLyingDown
void EmoteLyingDown()
Definition: emoteclasses.c:3
EmoteCampfireSit
void EmoteCampfireSit()
Definition: emoteclasses.c:414
array< typename >
EmoteFacepalm
class EmoteDabbing extends EmoteBase EmoteFacepalm()
Definition: emoteclasses.c:231
EmoteShrug
class EmoteShake extends EmoteBase EmoteShrug()
Definition: emoteclasses.c:558
EmoteRPSPaper
class EmoteRPSRock extends EmoteBase EmoteRPSPaper()
Definition: emoteclasses.c:502
EmoteSurrender
class EmoteCome extends EmoteBase EmoteSurrender()
Definition: emoteclasses.c:400
EmoteTauntKiss
class EmoteLyingDown extends EmoteBase EmoteTauntKiss()
Definition: emoteclasses.c:83
EmoteConstructor
Definition: emoteconstructor.c:1
EmoteVomit
EmoteCB EmoteVomit
EmoteLookAtMe
void EmoteLookAtMe()
Definition: emoteclasses.c:179
EmoteSitB
void EmoteSitB()
Definition: emoteclasses.c:414
EmoteRPSRandom
class EmoteSitB extends EmoteBase EmoteRPSRandom()
Definition: emoteclasses.c:474
EmoteRPSRock
void EmoteRPSRock()
Definition: emoteclasses.c:414
EmoteClap
void EmoteClap()
Definition: emoteclasses.c:179
EmoteThumbDown
class EmoteThumb extends EmoteBase EmoteThumbDown()
Definition: emoteclasses.c:139
EmoteSOS
class EmoteGreeting extends EmoteBase EmoteSOS()
Definition: emoteclasses.c:18
EmoteTaunt
class EmoteHeart extends EmoteBase EmoteTaunt()
Definition: emoteclasses.c:46
EmoteGetDown
class EmoteMove extends EmoteBase EmoteGetDown()
Definition: emoteclasses.c:371