public void Update()
 {
     if (isTransitioning)
     {
         return;
     }
     if (inOnlineOptions)
     {
         if (onlineBuddy.initializedStatus < -1)
         {
             inOnlineOptions = false;
         }
         else
         {
         }
         return;
     }
     UpdateMouseInput();
     if (PD.usingMouse && isClickingBack())
     {
         SignalSuccess(); PD.GoToMainMenu();
     }
     HandlePlayer1Input();
     HandlePlayer2Input();
     if (conf1 && conf1options && conf2)
     {
         AdvanceToGame();
     }
 }
Ejemplo n.º 2
0
    public void Update()
    {
        if (!hasSaved)
        {
            return;
        }
        if (!hasBeed)
        {
            PD.SetupSound();
            PD.sounds.SetVoiceAndPlay(SoundPaths.A_BEEEEEE, 0);
            hasBeed = true;
        }
        int input = PD.ReturnLaunchOrPauseOrNothingIsPressed();

        if (--countdown < 0 || input > 0)
        {
            if (input != 2)
            {
                PD.ChangeScreen(PersistData.GS.OpeningScene);
            }
            else
            {
                PD.GoToMainMenu();
            }
        }
    }
    private bool HandlePlayer1CursorInput()
    {
        bool pressed = false, clicked = false;

        if (PD.usingMouse)
        {
            clicked = HandleCharSelClicker();
        }
        cursorOpDisplay.SetVisibility(false);
        if (cursor.back())
        {
            SignalSuccess(); PD.GoToMainMenu(); return(true);
        }
        cursor.DoUpdate();
        if (cursor.HasMoved())
        {
            UpdateBackground(true);
        }
        charSprite1.GetComponent <SpriteRenderer>().sprite = chars[cursor.getX()];
        charName1.GetComponent <SpriteRenderer>().sprite   = charNames[cursor.getX()];
        if (clicked || cursor.launchOrPause())
        {
            conf1   = true;
            pressed = true;
            SignalSuccess();
            SpeakCharacterName(cursor.getX(), 0);
            if (cursor.getX() == 0 && p1eggState == 0)
            {
                p1eggState++;
            }
            else if (cursor.getX() == 2 && p1eggState == 1)
            {
                p1eggState++;
            }
            else if (cursor.getX() == 9 && p1eggState == 2)
            {
                p1eggState++; PD.sounds.SetSoundAndPlay(SoundPaths.S_Applause + Random.Range(1, 7).ToString());
            }
            else if (cursor.getX() == 3 && p1eggState == 0)
            {
                p1eggState--;
            }
            else if (cursor.getX() == 5 && p1eggState == -1)
            {
                p1eggState--;
            }
            else if (cursor.getX() == 7 && p1eggState == -2)
            {
                p1eggState--; PD.sounds.SetSoundAndPlay(SoundPaths.S_Applause + Random.Range(1, 7).ToString());
            }
            else
            {
                p1eggState = 0;
            }
            ToggleDisplayOptions(true);
            AddCancelButton();
        }
        return(pressed);
    }
Ejemplo n.º 4
0
    private void UpdateOuter()
    {
        cursor2Display.SetVisibility(false);
        cursor2Display.ResetToStartPos();
        cursor.SetVisibility(true);
        cursor3.SetVisibility(false);
        cursor.DoUpdate();
        int oldIdx = selectedIdx;
        int cy     = cursor.getY();

        selectedIdx = cy;
        if (selectedIdx != oldIdx)
        {
            sidepanels[oldIdx][1].SetActive(false);
        }
        sidepanels[selectedIdx][1].SetActive(true);
        sidepanels[selectedIdx][1].GetComponent <SpriteRenderer>().color = new Color(1.0f, 1.0f, 1.0f, GetButtonOpacity());
        if (cursor.launchOrPause())
        {
            menuPosition = cy;
            if (cy == 3)
            {
                cursor2.setY(8);
                cursor2Display.SetWidth(GetXmlFloat(top, "optionscalewidth"));
                SignalSuccess();
            }
            else if (cy == 2)
            {
                cursor2Display.SetWidth(GetXmlFloat(top, "optionscalewidth"));
                SignalSuccess();
            }
            else if (cy == 1)
            {
                cursor2.setY(8);
                cursor2Display.SetWidth(GetXmlFloat(top, "accessibilityscalewidth"));
                SignalSuccess();
            }
            else if (cy == 0)
            {
                SignalSuccess();
                PD.GoToMainMenu();
            }
        }
        else
        {
            UpdateCursorPosition(cy);
            if (cursor.back())
            {
                SignalSuccess(); PD.GoToMainMenu();
            }
        }
    }
Ejemplo n.º 5
0
    public void Update()
    {
        switch (state)
        {
        case 0: UpdateOpeningText(); break;

        case 1: UpdateAnimation(); break;

        case 2: FlickerEyes(); break;

        case 3: UpdateLeavingAnimation(); break;
        }
        if (PD.GetP1Controller() != null)
        {
            PD.GoToMainMenu();
        }
    }
Ejemplo n.º 6
0
 public void Update()
 {
     if (isTransitioning)
     {
         return;
     }
     UpdateMouseInput();
     if (PD.usingMouse && isClickingBack())
     {
         SignalSuccess(); PD.GoToMainMenu();
     }
     HandlePlayer1Input();
     HandlePlayer2Input();
     if (conf1 && conf1options && conf2)
     {
         AdvanceToGame();
     }
 }
Ejemplo n.º 7
0
    private void UpdateOuterMouse(bool isClicking, bool ignoreC2Resize = false)
    {
        cursor.SetVisibility(true);
        sidepanels[selectedIdx][0].GetComponent <SpriteRenderer>().sprite = leftButton[0];
        int cy = cursor.getY();

        selectedIdx = cy;
        sidepanels[selectedIdx][0].GetComponent <SpriteRenderer>().sprite = leftButton[1];
        if (isClicking)
        {
            UpdateCursorPosition(cy);
            menuPosition = cy;
            if (cy == 3)
            {
                cursor2.setY(8);
                cursor2Display.SetWidth(GetXmlFloat(top, "optionscalewidth"));
                SignalSuccess();
            }
            else if (cy == 2)
            {
                if (!ignoreC2Resize)
                {
                    cursor2Display.SetWidth(GetXmlFloat(top, "optionscalewidth"));
                }
                SignalSuccess();
            }
            else if (cy == 1)
            {
                cursor2.setY(8);
                cursor2Display.SetWidth(GetXmlFloat(top, "accessibilityscalewidth"));
                SignalSuccess();
            }
            else if (cy == 0)
            {
                SignalSuccess();
                PD.GoToMainMenu();
            }
        }
    }
Ejemplo n.º 8
0
    public void Update()
    {
        UpdateMouseInput();
        if (cursor.back() || isClickingBack())
        {
            SignalSuccess(); PD.GoToMainMenu(); return;
        }
        if (cursor.launchOrPause() || HandleMouse())
        {
            SignalSuccess(); ConfirmSelection();
        }
        cursor.DoUpdate();
        int l = GetLevelFromCursorPos();

        if (curLevel == l)
        {
            return;
        }
        curLevel = l;
        previewer.SetPreviewTiles(curLevel);
        infotext.text = GetLevelText(curLevel);
    }
Ejemplo n.º 9
0
    private void UpdateLeavingAnimation()
    {
        if (curFrame++ == 30)
        {
            for (int i = 0; i < 10; i++)
            {
                Destroy(charTiles[i]);
            }
            charTiles = null;
            PD.GoToMainMenu();
        }
        if (curFrame >= 30)
        {
            return;
        }
        float ny = Mathf.Pow(curFrame * 0.065f, 2);

        for (int i = 0; i < 10; i++)
        {
            Vector3 p = charTiles[i].transform.position;
            p.y = (i % 2 != 0)?-ny:ny;
            charTiles[i].transform.position = p;
        }
    }
Ejemplo n.º 10
0
    public void Update()
    {
        TweenAndMouse();
        if (inSoundTest)
        {
            UpdateSoundTest(true); return;
        }
        cursor.DoUpdate();
        int cy = cursor.getY();

        UpdateCursorPosition(cy);
        if (cy == 2 && --p1_delay <= 0)
        {
            int dx = 0;
            if (PD.usingMouse)
            {
                dx = HandleBioClicker();
            }
            bool keyWasPressed = false;
            if (cursor.shiftRight() || cursor.shiftAllRight() || PD.controller.Nav_Right())
            {
                dx++;
                keyWasPressed = true;
                navigationArrows.HighlightArrow(true);
            }
            else if (cursor.shiftLeft() || cursor.shiftAllLeft() || PD.controller.Nav_Left())
            {
                dx--;
                keyWasPressed = true;
                navigationArrows.HighlightArrow(false);
            }
            else
            {
                if (!PD.usingMouse)
                {
                    navigationArrows.ClearArrows();
                }
            }
            charIdx += dx;

            if (charIdx < 0)
            {
                charIdx = bioCount;
            }
            else if (charIdx > bioCount)
            {
                charIdx = 0;
            }

            if (dx != 0)
            {
                SignalMovement(); writer.LoadCharacterBio(charIdx, PD);
            }

            if (keyWasPressed)
            {
                p1_delay = 20;
            }
        }
        else if (cy == 1)
        {
            bool res = UpdateSoundTest(false);
            if (res || cursor.launchOrPause() || (clicker.getPositionInGameObject(sidepanels[5][0]).z > 0.0f && clicker.isDown()))
            {
                if (!res)
                {
                    SignalSuccess();
                }
                inSoundTest = true;
            }
        }
        if (cursor.back() || (cursor.getY() == 0 && (cursor.launchOrPause() || (clicker.isDown() && PD.usingMouse))))
        {
            SignalSuccess(); PD.GoToMainMenu();
        }
    }
Ejemplo n.º 11
0
 protected override bool HandleMouse()
 {
     if (!PD.usingMouse)
     {
         return(false);
     }
     if (menuPosition == 3)
     {
         Vector2 res = optionsScreen.GetColliderPosition(clicker);
         if (res.y < 0)
         {
             return(false);
         }
         int i = (int)res.y;
         cursor2.setY(8 - i);
         int dx = 0;
         if (clicker.getPositionInGameObject(cursor2Display.leftArrow).z == 1.0f)
         {
             cursor2Display.HighlightArrow(false);
             dx--;
         }
         else if (clicker.getPositionInGameObject(cursor2Display.rightArrow).z == 1.0f)
         {
             cursor2Display.HighlightArrow(true);
             dx++;
         }
         else
         {
             cursor2Display.ClearArrows();
         }
         if (!clicker.isDown())
         {
             return(false);
         }
         if (i < 6)
         {
             UpdateOption(8 - i, dx);
         }
         else if (i == 6)
         {
             WipeSelected_Options();
         }
         else if (i == 7)
         {
             ApplySelected_Options();
         }
         else
         {
             menuPosition = 0;
             SignalFailure();
             ResetOptions();
             cursor.setY(3);
         }
     }
     else if (menuPosition == 2)
     {
         if (clicker.getPositionInGameObject(side_back[0]).z > 0 ||
             clicker.getPositionInGameObject(side_accessibility[0]).z > 0 ||
             clicker.getPositionInGameObject(side_controls[0]).z > 0 ||
             clicker.getPositionInGameObject(side_options[0]).z > 0)
         {
             if (clicker.isDown())
             {
                 LeaveControls();
                 return(false);
             }
         }
         if (controlsPos == 0)
         {
             Vector2 res = controlsScreen.GetTopColliderPositionX(clicker);
             if (res.y < 0)
             {
                 return(false);
             }
             cursor3.setX(res.x < 0 ? 0 : 1);
             if (clicker.isDown())
             {
                 TransitionIntoControlsInner();
             }
         }
         else if (controlsPos == 1)
         {
             Vector2 res = controlsScreen.GetTopColliderPositionY(clicker);
             if (res.x < 0)
             {
                 return(false);
             }
             int newval = 11;
             if (res.y < -1.05f)
             {
                 newval = 0;
             }
             else if (res.y < -0.87f)
             {
                 newval = 1;
             }
             else if (res.y < -0.65f)
             {
                 newval = 2;
             }
             else if (res.y < -0.48f)
             {
                 newval = 3;
             }
             else if (res.y < -0.28f)
             {
                 newval = 4;
             }
             else if (res.y < -0.08f)
             {
                 newval = 5;
             }
             else if (res.y < 0.12f)
             {
                 newval = 6;
             }
             else if (res.y < 0.32f)
             {
                 newval = 7;
             }
             else if (res.y < 0.52f)
             {
                 newval = 8;
             }
             else if (res.y < 0.72f)
             {
                 newval = 9;
             }
             else if (res.y < 0.92f)
             {
                 newval = 10;
             }
             cursor2.setY(newval);
             if (clicker.isDown())
             {
                 SelectControlChange();
             }
         }
         else if (controlsPos == 2)
         {
             if (controlsScreen.ClickingCancelButton(clicker))
             {
                 SignalFailure();
                 controlsPos = 1;
                 controlsScreen.UndoQuestion(cursor2.getY(), cursor3.getX() == 0);
             }
         }
     }
     else if (menuPosition == 1)
     {
         Vector2 res = accessibilityScreen.GetColliderPosition(clicker);
         if (res.y < 0)
         {
             return(false);
         }
         int i  = (int)res.y;
         int cy = 8 - i;
         cursor2.setY(cy);
         int dx = 0;
         if (clicker.getPositionInGameObject(cursor2Display.leftArrow).z == 1.0f)
         {
             cursor2Display.HighlightArrow(false);
             dx--;
         }
         else if (clicker.getPositionInGameObject(cursor2Display.rightArrow).z == 1.0f)
         {
             cursor2Display.HighlightArrow(true);
             dx++;
         }
         else
         {
             cursor2Display.ClearArrows();
         }
         if (!clicker.isDown())
         {
             return(false);
         }
         if (cy == 1)
         {
             ApplySelected_Accessibility();
         }
         else if (cy == 0)
         {
             menuPosition = 0;
             SignalFailure();
             accessibilityScreen.Reset(PD.GetSaveData());
             cursor.setY(1);
         }
         else
         {
             UpdateAccessibilityOption(cy, dx);
         }
     }
     else
     {
         if (clicker.getPositionInGameObject(side_back[0]).z > 0)
         {
             cursor.setY(0);
             if (clicker.isDown())
             {
                 SignalSuccess(); PD.GoToMainMenu();
             }
         }
         else if (clicker.getPositionInGameObject(side_accessibility[0]).z > 0)
         {
             cursor.setY(1);
             if (clicker.isDown())
             {
                 SignalSuccess();
                 cursor2.setY(8);
                 menuPosition = 1;
                 cursor2Display.SetWidth(GetXmlFloat(top, "accessibilityscalewidth"));
             }
         }
         else if (clicker.getPositionInGameObject(side_controls[0]).z > 0)
         {
             cursor.setY(2);
             if (clicker.isDown())
             {
                 SignalSuccess();
                 menuPosition = 2;
             }
         }
         else if (clicker.getPositionInGameObject(side_options[0]).z > 0)
         {
             cursor.setY(3);
             if (clicker.isDown())
             {
                 cursor2.setY(8);
                 menuPosition = 3;
                 cursor2Display.SetWidth(GetXmlFloat(top, "optionscalewidth"));
                 SignalSuccess();
             }
         }
         return(false);
     }
     return(false);
 }