Exemplo n.º 1
0
    public void SetSubtitle(string content, char color)
    {
        if (subtitle != null)
        {
            subtitle.Kill();
        }

        int currentLine = 0;
        int longestLine = 0;

        for (int i = 0; i < content.Length; ++i)
        {
            if (currentLine > longestLine)
            {
                longestLine = currentLine;
            }

            if (content[i] == '\n')
            {
                currentLine = 0;
            }
            else
            {
                currentLine++;
            }
        }

        subtitle = AddSubView(new SHGUItext(content, 32 - (int)(longestLine / 2), 19, color)) as SHGUItext;
    }
Exemplo n.º 2
0
    private void UpdateInstructions()
    {
        if (subElement == null)
        {
            return;
        }

        string lastInstructions = subElement.text;

        if (showInstructions && !textElement.IsFinished())
        {
            if (textElement.manualUpdate)
            {
                if (textElement.IsAlmostFinished())
                {
                    subElement.text = LocalizationManager.Instance.GetLocalized("ENTER_TO_SEND_INPUT");
                }
                else
                {
                    subElement.text = LocalizationManager.Instance.GetLocalized("TYPE_TO_HACK_INPUT");
                }
            }
            else
            {
                //if (!leftright)
                subElement.text = "WAIT";
            }
            subElement.x = width - 2;
            subElement.y = height - 1;
            subElement.GoFromRight();

            if (lastInstructions != subElement.text)
            {
                subElement.PunchIn(.6f);
            }
        }
        else
        {
            //this could backfire and null maybe?
            subElement.Kill();
        }

        if (textElement.IsFinished())
        {
            subElement.Kill();
        }
    }
Exemplo n.º 3
0
 public void HideChatLabels()
 {
     //if (frame != null) frame.Kill ();
     if (appname != null)
     {
         appname.Kill();
     }
     if (instructions != null)
     {
         instructions.Kill();
     }
     if (chatQuitInstructions != null)
     {
         chatQuitInstructions.Kill();
     }
     if (clock != null)
     {
         clock.Kill();
     }
 }
Exemplo n.º 4
0
    void UpdateCurrentPhase()
    {
        if (phase == 0)           //brain gets scanned in Redraw(...)
        {
            if (Progress(10f))
            {
                AddSubView(brainView);
            }
        }
        else if (phase == 1)             //memory is prepared
        {
            if (Progress(1f))
            {
                AddSubView(memoryFrame);

                memoryFrame.x = cypherBrainView.x;
                memoryFrame.y = cypherBrainView.y;
            }
        }
        else if (phase == 2)             //brain and memory converge
        {
            if (!Wait(1.5f))
            {
                return;
            }
            ShowPopup(" Are you sure? ");

            brainView.x       = (int)Mathf.Lerp(brainViewSideX, brainViewCenterX, progress);
            cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewSideX, cypherBrainViewCenterX, progress);
            memoryFrame.x     = cypherBrainView.x;
            if (Progress(2f))
            {
                brainView.x       = brainViewCenterX;
                cypherBrainView.x = cypherBrainViewCenterX;
                memoryFrame.x     = cypherBrainView.x;
                SetSubtitle(" you may experience\n slight discomfort ", 'z');
            }
        }
        else if (phase == 3)             //brain dump in Redraw(...)
        {
            if (!Wait(0.5f))
            {
                return;
            }
            Progress(4f);
        }
        else if (phase == 4)             //brain dump in Redraw(...)
        {
            if (!Wait(0.5f))
            {
                return;
            }
            Progress(4f);
        }
        else if (phase == 5)             //brain dump in Redraw(...)
        {
            if (!Wait(0.5f))
            {
                return;
            }
            Progress(4f);
        }
        else if (phase == 6)             //brain dump in Redraw(...)
        {
            if (!Wait(0.5f))
            {
                return;
            }
            if (Progress(4f))
            {
                SetSubtitle("", 'w');
                cypherBrainView.text = SHGUI.current.GetASCIIartByName("CypherBrain01");
                AddSubView(brainCover);

                brainCover.x = brainView.x;
                brainCover.y = brainView.y;

                AddSubView(cypherBrainView);
            }
        }
        else if (phase == 7)             // brain and memory diverge
        {
            if (!Wait(2f))
            {
                return;
            }

            brainView.x       = (int)Mathf.Lerp(brainViewCenterX, brainViewSideX, progress);
            cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewCenterX, cypherBrainViewSideX, progress);
            memoryFrame.x     = cypherBrainView.x;
            brainCoverItself.SetChar(GetPulsatingChar());

            brainCover.x = brainView.x;
            brainCover.y = brainView.y;

            if (Progress(2.5f))
            {
                brainView.x       = brainViewSideX;
                cypherBrainView.x = cypherBrainViewSideX;
                memoryFrame.x     = cypherBrainView.x;
            }
        }
        else if (phase == 8)             //connection persists
        {
            brainCover.x = brainView.x;
            brainCover.y = brainView.y;
            memoryFrameGlow.SetChar(GetPulsatingChar());
            brainCoverItself.SetChar(GetPulsatingChar());

            Progress(2f);
        }
        else if (phase == 9)             //connection blinks fast for a moment

        {
            memoryFrameGlow.SetChar(GetPulsatingChar(10f));
            brainCoverItself.SetChar(GetPulsatingChar(10f));

            Progress(.5f);
        }
        else if (phase == 10)             //connection disappears brain half-empty; brain dies

        {
            memoryFrameGlow.SetChar(' ');
            brainCoverItself.SetChar(' ');

            if (Progress(2f))
            {
                brainView.Kill();
                brainView.overrideFadeOutSpeed = .15f;
            }
        }
        else if (phase == 11)
        {
            if (!Wait(2.5f))
            {
                return;
            }

            cypherBrainView.x = (int)Mathf.Lerp(cypherBrainViewSideX, cypherBrainViewCenterX, progress);
            memoryFrame.x     = cypherBrainView.x;

            if (Progress(2.5f))
            {
                if (brainCover != null)
                {
                    brainCover.Kill();
                }
                cypherBrainView.x = cypherBrainViewCenterX;
                memoryFrame.x     = cypherBrainView.x;
            }
        }
        else if (phase == 12)
        {
            if (Progress(2f))
            {
                memoryFrame.SetColorRecursive('r');
                outflowView = AddSubView(new SHGUIoutflow()) as SHGUIoutflow;
            }
        }
        else if (phase == 13)
        {
            if (!Wait(.3f))
            {
                return;
            }

            outflowView.AddSeeds();

            if (Progress(2f))
            {
                memoryFrame.AddSubView(new SHGUIrect(-1, 2, -1, 2));
                outflowView.DestroyBarrier();
            }
        }
        else if (phase == 14)
        {
            outflowView.DestroyBarrier();
            if (cypherBrainView != null && !cypherBrainView.fadingOut)
            {
                cypherBrainView.Kill();
            }

            if (Progress(1.2f))
            {
                outflowView.AddLimit();
            }
        }
        else if (phase == 15)
        {
            outflowView.AddLimit();            //dla pewności
            if (!Wait(1.5f))
            {
                return;
            }

            if (memoryFrame != null)
            {
                memoryFrame.Kill();
            }

            if (Progress(4.2f))
            {
                outflowView.Kill();
                Kill();
                SHGUI.current.AddViewOnTop(new APPrecruit());
            }
        }
        else if (phase == 16)
        {
            if (Progress(10f))
            {
            }
        }
        else if (phase == 60)           //only copy exists
        {
            if (Progress(5))
            {
                //Kill ();
            }
        }
        else             // skip empty phases
        {
            Progress(-1f);
        }
    }
Exemplo n.º 5
0
    public override void Update()
    {
        base.Update();
        if (fadingOut)
        {
            return;
        }

        if ((lastChat == null || lastChat.finished))
        {
            if (messageQueue.Count > 0)
            {
                gurumessage m = messageQueue[0];
                messageQueue.RemoveAt(0);
                AddChatMessage(m.sender, m.message, m.leftright, m.interactive, m.isPoor);

                if (m.isQuit)
                {
                    quiting = true;
                }
            }
            else
            {
                Kill();
                return;
            }
        }

        if (quiting)
        {
            instructions.Kill();
            appname.Kill();
            clock.Kill();
            //frame.Kill();

            /*
             * for (int i = 1; i < children.Count; ++i){
             *      children[i].Kill();
             * }
             */
        }

        if (lastChat == null)
        {
            return;
        }

        if (FixedUpdater(.01f))
        {
            //lastChat.SetContent(lastChat.message + StringScrambler.GetGlitchChar());
            //chat.ForcedFadeIn(1);
            int margin = 14;
            lastChat.x = margin;
            if (!lastChat.leftright)
            {
                lastChat.x = SHGUI.current.resolutionX - margin - lastChat.width - 1;
            }
        }

        if (lines + lastChat.height - totalOff > SHGUI.current.resolutionY - 1)
        {
            for (int i = 0; i < chats.Count; ++i)
            {
                chats[i].y -= 1;

                if (chats[i].y < -chats[i].height)
                {
                    chats[i].remove = true;
                }
            }
            totalOff++;
        }
    }
Exemplo n.º 6
0
    public override void Update()
    {
        MoveListOffset(0);
        if (!pathUpdated)
        {
            pathView.text = path;
            pathView.CutTextForLineLength(width - 2);
            pathUpdated = true;
        }

        if (rightPanel.fadingIn)
        {
            rightPanel.fade += 0.2f;
        }

        base.Update();

        for (int i = 0; i < buttons.Count; ++i)
        {
            buttons[i].highlighted = false;
        }

        buttons [currentButton].highlighted = true;
        buttons [currentButton].SpeedUpFadeIn();


        if (fade < 0.99f)
        {
            return;
        }


        if (buttons[currentButton].fade > .99f && buttons[currentButton].y == minListOffset && currentListOffset < 0)
        {
            MoveListOffset(1);
        }

        if (buttons[currentButton].fade > .99f && buttons[currentButton].y == listLength)
        {
            MoveListOffset(-1);
        }


        return;

        //LocalizationManager.Instance
        if (instructions == null)
        {
            string text = LocalizationManager.Instance.GetLocalized("COMMANDER_TUTORIAL_INPUT");
            instructions = AddSubView(new SHGUItext(text, SHGUI.current.resolutionX - left - 5, SHGUI.current.resolutionY - 1, 'z').GoFromRight()) as SHGUItext;
        }
        else
        {
            string text = LocalizationManager.Instance.GetLocalized("COMMANDER_TUTORIAL_INPUT");
            if (text != instructions.text)
            {
                instructions.Kill();
                instructions = null;
                instructions = AddSubView(new SHGUItext(text, SHGUI.current.resolutionX - left - 5, SHGUI.current.resolutionY - 1, 'z').GoFromRight()) as SHGUItext;
            }
        }
    }