File size: 2,303 Bytes
24b81cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
class EmoteConstructor
{
bool ConstructEmotes(PlayerBase player, out map<int, ref EmoteBase> emoteMap)
{
TTypenameArray emote_array_names = new TTypenameArray;
RegisterEmotes(emote_array_names);
Sort(emote_array_names,emote_array_names.Count());
emoteMap = new map<int, ref EmoteBase>;
ref EmoteBase new_emote;
for (int i = 0; i < emote_array_names.Count(); i++)
{
new_emote = EmoteBase.Cast(emote_array_names[i].Spawn());
if (new_emote)
{
if (new_emote.GetID() < 0)
{
ErrorEx("Emote " + emote_array_names[i].ToString() + " has an invalid ID, registation failed!");
return false;
}
else if (emoteMap.Contains(new_emote.GetID()))
{
ErrorEx("Emote " + emote_array_names[i].ToString() + " has a duplicate ID, registation failed!");
return false;
}
else
{
new_emote.SetOwnerPlayer(player);
emoteMap.Insert(new_emote.GetID(), new_emote);
}
}
}
return true;
}
void RegisterEmotes(TTypenameArray emotes)
{
emotes.Insert(EmoteGreeting);
emotes.Insert(EmoteSOS);
emotes.Insert(EmoteHeart);
emotes.Insert(EmoteTaunt);
emotes.Insert(EmoteLyingDown);
emotes.Insert(EmoteTauntKiss);
emotes.Insert(EmotePoint);
emotes.Insert(EmoteTauntElbow);
emotes.Insert(EmoteThumb);
emotes.Insert(EmoteThumbDown);
emotes.Insert(EmoteThroat);
emotes.Insert(EmoteDance);
emotes.Insert(EmoteSalute);
emotes.Insert(EmoteTimeout);
//emotes.Insert(EmoteDabbing);
emotes.Insert(EmoteFacepalm);
emotes.Insert(EmoteClap);
emotes.Insert(EmoteSilent);
emotes.Insert(EmoteWatching);
emotes.Insert(EmoteHold);
emotes.Insert(EmoteListening);
emotes.Insert(EmotePointSelf);
emotes.Insert(EmoteLookAtMe);
emotes.Insert(EmoteTauntThink);
emotes.Insert(EmoteMove);
emotes.Insert(EmoteGetDown);
emotes.Insert(EmoteCome);
emotes.Insert(EmoteSurrender); //exception, partially handled in EmoteManager directly (..)
emotes.Insert(EmoteCampfireSit);
emotes.Insert(EmoteSitA);
emotes.Insert(EmoteSitB);
emotes.Insert(EmoteRPSRandom);
emotes.Insert(EmoteRPSRock);
emotes.Insert(EmoteRPSPaper);
emotes.Insert(EmoteRPSScisors);
emotes.Insert(EmoteNod);
emotes.Insert(EmoteShake);
emotes.Insert(EmoteShrug);
emotes.Insert(EmoteSuicide);
emotes.Insert(EmoteVomit);
}
} |