示例#1
0
    private scrollmessage AddChatMessage(string sender, string message, bool leftright, bool interactive, bool poor, bool overrideLast = false)
    {
        if (dontDisplaySender)
        {
            sender = "";
        }

        SHGUIguruchatwindow chat;

        chat = new SHGUIguruchatwindow();
        chat.SetLeftRight(leftright);
        if (interactive)
        {
            chat.SetInteractive();
        }
        if (poor)
        {
            chat.poorMode = true;
        }

        chat.SetWidth(desiredFrameWidth);
        chat.SetContent(message);
        chat.SetLabel(sender);

        chat.x = chatMargin;
        if (!leftright)
        {
            chat.x = SHGUI.current.resolutionX - chatMargin - chat.width;
        }

        int h   = chat.GetHeightOfCompleteTextWithFrameVERYSLOWandMOODY();
        var msg = new scrollmessage(chat, h, 0, false, 0);

        msg.overrideLast = overrideLast;
        queue.Add(msg);

        if (defaultConsoleCallback != null)
        {
            chat.SetCallback(defaultConsoleCallback);
        }
        //chat.ForceFadeRecursive (1f);


        return(msg);
    }
示例#2
0
    public void AddChat(string content, bool interactive)
    {
        SHGUIguruchatwindow chat = new SHGUIguruchatwindow();

        chat.SetContent(content);
        chat.desiredWidth = 25;
        if (interactive)
        {
            chat.SetInteractive();
        }

        if (!interactive)
        {
            chat.showInstructions = false;
        }

        AddChat(chat);
    }
示例#3
0
    void AddChatToQueue(string content, bool interactive = false)
    {
        SHGUIguruchatwindow chat = new SHGUIguruchatwindow();

        chat.SetContent(content);
        chat.desiredWidth = 25;
        //chat.GetPrompter ().maxSmartBreakOffset = 9;
        if (interactive)
        {
            chat.SetInteractive();
        }
        else
        {
            chat.showInstructions = false;
        }
        chat.y = 10;


        AddViewToQueue(chat, 0f);
    }
示例#4
0
    public void AddChatMessage(string sender, string message, bool leftright, bool interactive, bool poor)
    {
        sender = "";
        if (lastChat != null)
        {
            if (lastChat.height < 3)
            {
                lines += 3;
            }
            else
            {
                lines += lastChat.height;
            }
        }

        lastChat = new SHGUIguruchatwindow();
        lastChat.SetLeftRight(leftright);
        if (interactive)
        {
            lastChat.SetInteractive();
        }
        if (poor)
        {
            lastChat.poorMode = true;
        }

        lastChat.SetWidth(35);
        lastChat.SetContent(message);
        lastChat.SetLabel(sender);
        chats.Add(AddSubViewBottom(lastChat) as SHGUIguruchatwindow);
        lastChat.y = lines - totalOff;

        int margin = 14;

        lastChat.x = margin;
        if (!leftright)
        {
            lastChat.x = 80 - margin - lastChat.width - 1;
        }

        if (skippable)
        {
            if (leftright)
            {
                SetInstructions("press-ESC-to-leave-chat");
                //SetInstructions ("TYPE-TO-SPEAK-|-ESC-TO-GO-AWAY");
            }
            else
            {
                SetInstructions("press-ESC-to-leave-chat");
                //SetInstructions ("WAIT-FOR-YOUR-PARTNER-|-ESC-TO-GO-AWAY");
            }
        }
        else
        {
            SetInstructions("");
        }

        if (leftright && interactive && !poor)
        {
            lastChat.PunchIn(.7f);
        }

        if (!poor)
        {
            SHGUI.current.PlaySound(SHGUIsound.confirm);
        }
        else
        {
            SHGUI.current.PlaySound(SHGUIsound.wrong);
        }

        /*
         * a.Add(AddSubView (new SHGUIframe (0, 0, SHGUI.current.resolutionX - 1, 3, 'z')));
         * a.Add(AddSubView (new SHGUItext (message, 2, 1, 'w').BreakCut((int)(SHGUI.current.resolutionX / 2), 2)));
         * if (!leftright) {
         *      (a [a.Count - 1] as SHGUItext).x = SHGUI.current.resolutionX - 3;
         *      (a [a.Count - 1] as SHGUItext).GoFromRight ();
         * }
         *
         * a.Add(AddSubView (new SHGUItext (sender, 2, 0, 'z')));
         * if (!leftright) {
         *      (a [a.Count - 1] as SHGUItext).x = SHGUI.current.resolutionX - 3;
         *      (a [a.Count - 1] as SHGUItext).GoFromRight ();
         * }
         */
    }