Пример #1
0
        private void Emote(string command, string[] args)
        {
            if (args.Length < 1)
            {
                this.Monitor.Log($"{I18n.Command_MissingParameters()}\n\n{I18n.Command_PlayEmote_Usage()}", LogLevel.Info);
                return;
            }

            if (!int.TryParse(args[0], out int id))
            {
                this.Monitor.Log($"The emote id must be a integer.", LogLevel.Info);
                return;
            }

            if (id > 0)
            {
                //Game1.player.doEmote(id * 4);
                Game1.player.netDoEmote(Farmer.EMOTES[id].emoteString);
                this.Monitor.Log($"Playing emote: {id}", LogLevel.Info);
#if DEBUG
            }
            else if (id < 0)
            {
                EmoteTemporaryAnimation emoteTempAnim = new EmoteTemporaryAnimation(Helper.Reflection, Helper.Events);
                emoteTempAnim.BroadcastEmote(id * -1);
                this.Monitor.Log($"Playing emote (workarround test): {id * -1}");
#endif
            }
            else
            {
                this.Monitor.Log($"The emote id value must be greater than 0.", LogLevel.Info);
            }
        }