Esempio n. 1
0
    void AddDownload()
    {
        string str = "DOWNLOAD COMPLETE";


        SHGUIview a1 = new SHGUItempview(2.5f);

        a1.AddSubView(new SHGUIframe((int)(SHGUI.current.resolutionX / 2) - (int)(str.Length / 2) - 1, (int)(SHGUI.current.resolutionY / 2) - 2, (int)(SHGUI.current.resolutionX / 2) + (int)(str.Length / 2) + 1, (int)(SHGUI.current.resolutionY / 2), 'z'));
        SHGUIprompter prom = new SHGUIprompter((int)(SHGUI.current.resolutionX / 2) - (int)(str.Length / 2), (int)(SHGUI.current.resolutionY / 2) - 1, 'z');

        prom.SetInput("^Cz████████████^W1█^W1████");
        a1.AddSubView(prom);

        queue.Add(a1);

        SHGUIview a = new SHGUItempview(2.5f);
        SHGUIview b = new SHGUIblinkview(.2f);

        a.AddSubView(b);

        b.AddSubView(new SHGUIframe((int)(SHGUI.current.resolutionX / 2) - (int)(str.Length / 2) - 1, (int)(SHGUI.current.resolutionY / 2) - 2, (int)(SHGUI.current.resolutionX / 2) + (int)(str.Length / 2) + 1, (int)(SHGUI.current.resolutionY / 2), 'z'));
        b.AddSubView(new SHGUItext(str, (int)(SHGUI.current.resolutionX / 2) - (int)(str.Length / 2), (int)(SHGUI.current.resolutionY / 2) - 1, 'w'));

        queue.Add(a);
    }
Esempio n. 2
0
    public SHGUIguruchatwindow()
    {
        background   = AddSubView(new SHGUIrect(0, 0, 0, 0, 'z')) as SHGUIrect;
        frameElement = AddSubView(new SHGUIframe(0, 0, 0, 0, 'z')) as SHGUIframe;
        labelElement = AddSubView(new SHGUItext("", 1, 0, 'z')) as SHGUItext;
        subElement   = AddSubView(new SHGUItext("", 1, 0, 'z')) as SHGUItext;
        textElement  = AddSubView(new SHGUIprompter(1, 1, 'w')) as SHGUIprompter;

        SetContent("");
    }
Esempio n. 3
0
    void AddMyPrompter(string line)
    {
        lastPrompter = new SHGUIprompter(1, currentline, 'w');
        lastPrompter.SetInput(line);
        lastPrompter.y                   = currentline;
        lastPrompter.maxLineLength       = 30;
        lastPrompter.maxSmartBreakOffset = 1;
        lastPrompter.SwitchToManualInputMode();

        AddSubView(lastPrompter);
    }
Esempio n. 4
0
    public int GetHeightOfCompleteTextWithFrameVERYSLOWandMOODY()
    {
        SHGUIprompter p   = new SHGUIprompter(0, 0, 'w');
        SHGUIprompter old = textElement as SHGUIprompter;

        p.SetInput(old.input, true);
        p.maxLineLength = old.maxLineLength;
        p.ShowInstant();

        return(p.CountLines() + 2);
    }
Esempio n. 5
0
    void AddPrompter(string line)
    {
        SHGUIprompter prom = new SHGUIprompter(0, 0, 'w');

        prom.SetInput(line);
        prom.baseCharDelay *= 1.25f;
        prom.maxLineLength  = 60;

        AddSubView(prom);

        prompters.Add(prom);
    }
Esempio n. 6
0
    void AddOtherPrompter(string line)
    {
        lastPrompter = new SHGUIprompter(1, currentline, 'z');
        lastPrompter.SetInput(line);
        lastPrompter.y                   = currentline;
        lastPrompter.maxLineLength       = 30;
        lastPrompter.maxSmartBreakOffset = 1;



        AddSubView(lastPrompter);
    }
Esempio n. 7
0
    public APPprompter()
    {
        SHGUIprompter p = AddSubView(new SHGUIprompter(1, 1, 'w')) as SHGUIprompter;

        p.SetInput("What did you see? Everybody gets something different.\n" +
                   "There was this car crash and shooting, then I was a jail guard and all the cells started opening, prisoners running at me. I shot them.\n" +
                   "Man, I know this jail. I was the one who opened the cells!\n" +
                   "So it's like co-op?\n" +
                   "I'm not sure. I just got this thing from a friend. I'm going back in, bye.\n" +
                   "Me too, see ya.\n");

        p.maxLineLength = SHGUI.current.resolutionX - 10;
    }
Esempio n. 8
0
    public void AddInteractivePrompterToQueue(string Text, string prefix = "")
    {
        SHGUItext TextView = new SHGUItext(Text, frameOffset, 0, 'w');

        TextView.BreakCut(SHGUI.current.resolutionX - 2, 100);

        SHGUIprompter promp = new SHGUIprompter(frameOffset, 0, 'w');

        promp.SetInput(Text);
        promp.SwitchToManualInputMode();
        promp.maxLineLength       = SHGUI.current.resolutionX - 2 - frameOffset;
        promp.maxSmartBreakOffset = 0;
        promp.AddPrefix(prefix);
        queue.Add(new scrollmessage(promp, TextView.CountLines(), 0));
    }
Esempio n. 9
0
    void PreparePrompters()
    {
        prompters        = new SHGUIview();
        prompters.hidden = true;

        SHGUIprompter p1 = new SHGUIprompter(32 - 10, 6, 'w');

        p1.SetInput("^M2HIS NAME IS TREEDUDE");
        prompters.AddSubView(p1);

        SHGUIprompter p2 = new SHGUIprompter(32 - 9, 15, 'w');

        p2.SetInput("^M2^W9AND HIS SONG IS^M1^W2.^W2.^W2.^W7");
        prompters.AddSubView(p2);


        //AddSubView (prompters);
    }
Esempio n. 10
0
    public void AddPrompterToQueue(string Text, float Delay, bool centered = false)
    {
        SHGUItext TextView = new SHGUItext(Text, frameOffset, 0, 'z');

        TextView.BreakCut(SHGUI.current.resolutionX - 2 - frameOffset, 100);
        int width = TextView.GetLongestLineLength();

        SHGUIprompter promp = new SHGUIprompter(frameOffset, 0, 'w');

        promp.SetInput(Text);
        if (centered)
        {
            promp.x = (int)(SHGUI.current.resolutionX / 2) - (int)(promp.GetFirstLineLengthWithoutSpecialSigns() / 2);
        }
        promp.maxLineLength       = SHGUI.current.resolutionX - 2;
        promp.maxSmartBreakOffset = 0;
        queue.Add(new scrollmessage(promp, TextView.CountLines(), Delay));
    }
Esempio n. 11
0
    public override void Update()
    {
        base.Update();

        if (startQueueCount < 0)
        {
            startQueueCount = queue.Count;
        }

        delay -= Time.unscaledDeltaTime;
        if (lines > maxlines)
        {
            ShiftAllMessages(-1);
        }

        if (customSkipTimeout < 0)
        {
            if (skippable)
            {
                SetChatQuitInstructions(LocalizationManager.Instance.GetLocalized(leaveChatLocalizedString));
            }
            else
            {
                SetChatQuitInstructions("");
            }
        }
        else
        {
            customSkipTimeout -= Time.unscaledDeltaTime;
        }

        bool waitForMessageToEnd = false;

        if (messages.Count > 0)
        {
            if (messages[messages.Count - 1] as SHGUIprompter != null && (messages[messages.Count - 1] as SHGUIprompter).manualUpdate)
            {
                waitForMessageToEnd = true;
                SHGUIprompter prom = messages[messages.Count - 1] as SHGUIprompter;
                if (prom.noInteractionTimer > 1.5f)
                {
                    if (prom.IsAlmostFinished())
                    {
                        UpdateInstructions(enterInstruction);
                    }
                    else
                    {
                        UpdateInstructions(typeInstruction);
                    }
                }
                else
                {
                    UpdateInstructions("");
                }
            }
            if (messages[messages.Count - 1] as SHGUIguruchatwindow != null)
            {
                waitForMessageToEnd = true;
            }
        }

        if (waitForMessageToEnd)
        {
            if ((messages[messages.Count - 1] as SHGUIprompter != null) && (messages[messages.Count - 1] as SHGUIprompter).IsFinished())
            {
                DisplayNextMessage();
            }
            else if (messages[messages.Count - 1] as SHGUIguruchatwindow != null)
            {
                SHGUIguruchatwindow g = messages[messages.Count - 1] as SHGUIguruchatwindow;
                if (g.finished == true)
                {
                    DisplayNextMessage();
                }
            }
        }
        else
        {
            UpdateInstructions("");
            if (delay < 0)
            {
                DisplayNextMessage();
            }
        }

        for (int i = 0; i < messages.Count; ++i)
        {
            SHGUIguruchatwindow g = messages[i] as SHGUIguruchatwindow;

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