Beispiel #1
0
    public void AddTextToQueueCentered(string Text, float Delay, char color = 'z')
    {
        SHGUItext TextView = new SHGUItext(Text, 0, 0, color);

        TextView.x = frameOffset + (int)(SHGUI.current.resolutionX / 2) - (int)(TextView.GetLineLength() / 2);
        queue.Add(new scrollmessage(TextView, TextView.CountLines(), Delay, false, .5f));
    }
Beispiel #2
0
    public SHGUItext GetCenteredAsciiArt(string artname, int screenPosX = 32, int screenPosY = 12)
    {
        SHGUItext t = new SHGUItext(GetASCIIartByName(artname), 1, 1, 'w') as SHGUItext;

        t.x = screenPosX - (int)(t.GetLineLength() / 2);
        t.y = screenPosY - (int)(t.CountLines() / 2);

        return(t);
    }
Beispiel #3
0
    public void AddOtherQuit()
    {
        AddControlCommand("skiphere");
        AddControlCommand("nolabels");
        string    chatEndedString = "---CHAT-ENDED---";
        SHGUItext v = new SHGUItext(chatEndedString, 0, 0, 'w');

        v.x = frameOffset + (int)(SHGUI.current.resolutionX / 2) - (int)(v.GetLineLength() / 2) - 1;
        AddMessageToQueue(new SHGUIview(), 1, 0f, false);
        AddMessageToQueue(v, 1, 0f, false);
        AddMessageToQueue(new SHGUIview(), 1, 1.75f, false);
    }
Beispiel #4
0
    void AddText(string line)
    {
        var    lines     = line.Split(';');
        string firstline = lines[0];

        thisLineDelay = .8f;

        if (firstline.Contains(">"))
        {
            int index = firstline.IndexOf('>');
            var cmd   = firstline.Substring(0, index);
            lines[0] = firstline.Substring(index + 1);

            for (int i = 0; i < cmd.Length; ++i)
            {
                if (cmd[i] == 'D')
                {
                    this.thisLineDelay *= 1.2f;
                }
            }
        }

        foreach (var L in text)
        {
            L.Kill();
            L.remove = true;
        }

        int height = 0;

        foreach (var l in lines)
        {
            var t = new SHGUItext(SHGUI.current.GetASCIIartFromFont(l), 0, 0, 'w');

            t.x = (int)(SHGUI.current.resolutionX / 2) - (int)(t.GetLineLength() / 2);
            t.y = (int)(SHGUI.current.resolutionY / 2) - (int)(t.CountLines() / 2) + height;
            AddSubView(t);
            height += (int)(SHGUI.current.resolutionY / 2) - (int)(t.CountLines() / 2) - 1;
            t.PunchIn(1f);

            text.Add(t);
        }

        foreach (var t in text)
        {
            t.y -= (int)(height / 4);
        }

        PlaySound();
    }