Exemplo n.º 1
0
    public static ChatterEmote[] ParseTwitchEmotes(string[] splitEmotes)
    {
        ChatterEmote[] emotes = new ChatterEmote[splitEmotes.Length];

        for (int i = 0; i < splitEmotes.Length; ++i)
        {
            string e = splitEmotes[i];

            string[] indexes = e.Substring(e.IndexOf(':') + 1).Length > 0 ? e.Substring(e.IndexOf(':') + 1).Split(',') : new string[0];

            ChatterEmote.Index[] ind = new ChatterEmote.Index[indexes.Length];

            for (int j = 0; j < ind.Length; ++j)
            {
                ind[j].startIndex = int.Parse(indexes[j].Substring(0, indexes[j].IndexOf('-')));
                ind[j].endIndex   = int.Parse(indexes[j].Substring(indexes[j].IndexOf('-') + 1));
            }

            emotes[i] = new ChatterEmote()
            {
                id      = e.Substring(0, e.IndexOf(':')),
                indexes = ind
            };
        }

        return(emotes);
    }
Exemplo n.º 2
0
    public Emote Load(ChatterEmote emote)
    {
        scale = "3.0";
        var loaded = base.Load(emote.id) as Emote;

        return(loaded);
    }
Exemplo n.º 3
0
    public void ChangeIndex(ChatterEmote emote)
    {
        List <Index> indexes = new List <Emote.Index>();

        foreach (var index in emote.indexes)
        {
            indexes.Add(new Emote.Index()
            {
                startIndex = index.startIndex, endIndex = index.endIndex
            });
        }
        this.indexes = indexes.ToArray();
    }