コード例 #1
0
        override public void Skip()
        {
            AC.Menu _menu = PlayerMenus.GetMenuWithName(_menuToChange);

            if (_menu != null)
            {
                if (changeType == MenuChangeType.TurnOnMenu)
                {
                    if (_menu.appearType == AppearType.Manual || _menu.appearType == AppearType.OnInputKey)
                    {
                        _menu.TurnOn(false);
                    }
                }
                else if (changeType == MenuChangeType.TurnOffMenu)
                {
                    if (_menu.appearType == AppearType.Manual || _menu.appearType == AppearType.OnInputKey || _menu.appearType == AppearType.OnContainer)
                    {
                        _menu.ForceOff();
                    }
                }
                else if (changeType == MenuChangeType.LockMenu)
                {
                    _menu.isLocked = true;
                    _menu.ForceOff();
                }
                else
                {
                    RunInstant(_menu);
                }
            }
        }
コード例 #2
0
ファイル: ActionQTE.cs プロジェクト: IJkeB/Ekster1
        override public float Run()
        {
            if (duration <= 0f || inputName == "")
            {
                isRunning = false;
                return(0f);
            }

            if (!isRunning)
            {
                isRunning = true;

                Animator animator = null;
                if (menuName != "")
                {
                    AC.Menu menu = PlayerMenus.GetMenuWithName(menuName);
                    menu.TurnOn(true);
                    if (menu.canvas != null && menu.canvas.GetComponent <Animator>())
                    {
                        animator = menu.canvas.GetComponent <Animator>();
                    }
                }

                if (qteType == QTEType.SingleKeypress)
                {
                    KickStarter.playerQTE.StartQTE(inputName, duration, animator, wrongKeyFails);
                }
                else if (qteType == QTEType.HoldKey)
                {
                    KickStarter.playerQTE.StartQTE(inputName, duration, holdDuration, animator, wrongKeyFails);
                }
                else if (qteType == QTEType.ButtonMash)
                {
                    KickStarter.playerQTE.StartQTE(inputName, duration, targetPresses, doCooldown, cooldownTime, animator, wrongKeyFails);
                }

                return(defaultPauseTime);
            }
            else
            {
                if (KickStarter.playerQTE.GetState() == QTEState.None)
                {
                    return(defaultPauseTime);
                }

                if (menuName != "")
                {
                    PlayerMenus.GetMenuWithName(menuName).TurnOff(true);
                }

                isRunning = false;
                return(0f);
            }
        }
コード例 #3
0
        public override void Skip()
        {
            AC.Menu _menu = PlayerMenus.GetMenuWithName(runtimeMenuToChange);
            if (_menu == null)
            {
                if (!string.IsNullOrEmpty(runtimeMenuToChange))
                {
                    ACDebug.LogWarning("Could not find menu of name '" + runtimeMenuToChange + "'");
                }
                return;
            }

            switch (changeType)
            {
            case MenuChangeType.TurnOnMenu:
                if (_menu.IsManualControlled())
                {
                    _menu.TurnOn(false);
                }
                break;

            case MenuChangeType.TurnOffMenu:
                if (_menu.IsManualControlled() || _menu.appearType == AppearType.OnInteraction)
                {
                    _menu.ForceOff();
                }
                break;

            case MenuChangeType.LockMenu:
                _menu.isLocked = true;
                _menu.ForceOff();
                break;

            default:
                RunInstant(_menu);
                break;
            }
        }
コード例 #4
0
        override public float Run()
        {
            if (string.IsNullOrEmpty(inputName) && (KickStarter.settingsManager.inputMethod != InputMethod.TouchScreen || qteType == QTEType.SingleAxis))
            {
                isRunning = false;
                return(0f);
            }

            if (duration <= 0f)
            {
                isRunning = false;
                return(0f);
            }

            if (!isRunning)
            {
                isRunning = true;

                Animator animator = null;
                if (!string.IsNullOrEmpty(menuName))
                {
                    AC.Menu menu = PlayerMenus.GetMenuWithName(menuName);
                    if (menu != null)
                    {
                        menu.TurnOn(true);
                        if (animateUI && menu.RuntimeCanvas != null && menu.RuntimeCanvas.GetComponent <Animator>())
                        {
                            animator = menu.RuntimeCanvas.GetComponent <Animator>();
                        }
                    }
                }

                if (qteType == QTEType.SingleKeypress)
                {
                    KickStarter.playerQTE.StartSinglePressQTE(inputName, duration, animator, wrongKeyFails);
                }
                else if (qteType == QTEType.SingleAxis)
                {
                    KickStarter.playerQTE.StartSingleAxisQTE(inputName, duration, axisThreshold, animator, wrongKeyFails);
                }
                else if (qteType == QTEType.HoldKey)
                {
                    KickStarter.playerQTE.StartHoldKeyQTE(inputName, duration, holdDuration, animator, wrongKeyFails);
                }
                else if (qteType == QTEType.ButtonMash)
                {
                    KickStarter.playerQTE.StartButtonMashQTE(inputName, duration, targetPresses, doCooldown, cooldownTime, animator, wrongKeyFails);
                }

                return(defaultPauseTime);
            }
            else
            {
                if (KickStarter.playerQTE.GetState() == QTEState.None)
                {
                    return(defaultPauseTime);
                }

                if (!string.IsNullOrEmpty(menuName))
                {
                    AC.Menu menu = PlayerMenus.GetMenuWithName(menuName);
                    if (menu != null)
                    {
                        menu.TurnOff(true);
                    }
                }

                isRunning = false;
                return(0f);
            }
        }
コード例 #5
0
        override public float Run()
        {
            if (!isRunning)
            {
                isRunning = true;
                AC.Menu _menu = PlayerMenus.GetMenuWithName(_menuToChange);

                if (_menu != null)
                {
                    if (changeType == MenuChangeType.TurnOnMenu)
                    {
                        if (_menu.IsManualControlled())
                        {
                            if (!_menu.TurnOn(doFade))
                            {
                                // Menu is already on
                                isRunning = false;
                                return(0f);
                            }

                            if (doFade && willWait)
                            {
                                return(_menu.fadeSpeed);
                            }
                        }
                        else
                        {
                            ACDebug.LogWarning("Can only turn on Menus with an Appear Type of Manual, OnInputKey, OnContainer or OnViewDocument - did you mean 'Unlock Menu'?");
                        }
                    }
                    else if (changeType == MenuChangeType.TurnOffMenu)
                    {
                        if (_menu.IsManualControlled() || _menu.appearType == AppearType.OnInteraction)
                        {
                            if (!_menu.TurnOff(doFade))
                            {
                                // Menu is already off
                                isRunning = false;
                                return(0f);
                            }

                            if (doFade && willWait)
                            {
                                return(_menu.fadeSpeed);
                            }
                        }
                        else
                        {
                            ACDebug.LogWarning("Can only turn off Menus with an Appear Type of Manual, OnInputKey, OnContainer or OnViewDocument - did you mean 'Lock Menu'?");
                        }
                    }
                    else if (changeType == MenuChangeType.LockMenu)
                    {
                        if (doFade)
                        {
                            _menu.TurnOff(true);
                        }
                        else
                        {
                            _menu.ForceOff();
                        }
                        _menu.isLocked = true;

                        if (doFade && willWait)
                        {
                            return(_menu.fadeSpeed);
                        }
                    }
                    else
                    {
                        RunInstant(_menu);
                    }
                }
                else if (menuToChange != "")
                {
                    ACDebug.LogWarning("Could not find menu of name '" + menuToChange + "'");
                }
            }
            else
            {
                isRunning = false;
                return(0f);
            }

            return(0f);
        }
コード例 #6
0
        public override float Run()
        {
            if (!isRunning)
            {
                AC.Menu _menu = PlayerMenus.GetMenuWithName(runtimeMenuToChange);

                if (_menu == null)
                {
                    if (!string.IsNullOrEmpty(runtimeMenuToChange))
                    {
                        ACDebug.LogWarning("Could not find menu of name '" + runtimeMenuToChange + "'", this);
                    }
                    return(0f);
                }

                isRunning = true;

                switch (changeType)
                {
                case MenuChangeType.TurnOnMenu:
                    if (_menu.IsManualControlled())
                    {
                        if (!_menu.TurnOn(doFade))
                        {
                            // Menu is already on
                            isRunning = false;
                            return(0f);
                        }

                        if (doFade && willWait)
                        {
                            return(_menu.fadeSpeed);
                        }
                    }
                    else
                    {
                        LogWarning("Can only turn on Menus with an Appear Type of Manual, OnInputKey, OnContainer or OnViewDocument - did you mean 'Unlock Menu'?");
                    }
                    break;

                case MenuChangeType.TurnOffMenu:
                    if (_menu.IsManualControlled() || _menu.appearType == AppearType.OnInteraction)
                    {
                        if (!_menu.TurnOff(doFade))
                        {
                            // Menu is already off
                            isRunning = false;
                            return(0f);
                        }

                        if (doFade && willWait)
                        {
                            return(_menu.fadeSpeed);
                        }
                    }
                    else
                    {
                        LogWarning("Can only turn off Menus with an Appear Type of Manual, OnInputKey, OnContainer or OnViewDocument - did you mean 'Lock Menu'?");
                    }
                    break;

                case MenuChangeType.LockMenu:
                    if (doFade)
                    {
                        _menu.TurnOff(true);
                    }
                    else
                    {
                        _menu.ForceOff();
                    }
                    _menu.isLocked = true;

                    if (doFade && willWait)
                    {
                        return(_menu.fadeSpeed);
                    }
                    break;

                default:
                    RunInstant(_menu);
                    break;
                }
            }
            else
            {
                isRunning = false;
                return(0f);
            }

            return(0f);
        }
コード例 #7
0
ファイル: ActionMenuState.cs プロジェクト: mcbodge/eidolon
        override public float Run()
        {
            if (!isRunning)
            {
                isRunning = true;
                AC.Menu _menu = PlayerMenus.GetMenuWithName(menuToChange);

                if (_menu != null)
                {
                    if (changeType == MenuChangeType.TurnOnMenu)
                    {
                        if (_menu.IsManualControlled())
                        {
                            if (!_menu.TurnOn(doFade))
                            {
                                // Menu is already on
                                isRunning = false;
                                return(0f);
                            }

                            if (doFade && willWait)
                            {
                                return(_menu.fadeSpeed);
                            }
                        }
                        else
                        {
                            ACDebug.LogWarning("Can only turn on Menus with an Appear Type of Manual, OnInputKey or OnContainer - did you mean 'Unlock Menu'?");
                        }
                    }
                    else if (changeType == MenuChangeType.TurnOffMenu)
                    {
                        if (_menu.IsManualControlled())
                        {
                            if (!_menu.TurnOff(doFade))
                            {
                                // Menu is already off
                                isRunning = false;
                                return(0f);
                            }

                            if (doFade && willWait)
                            {
                                return(_menu.fadeSpeed);
                            }
                        }
                        else
                        {
                            ACDebug.LogWarning("Can only turn off Menus with an Appear Type of Manual, OnInputKey or OnContainer - did you mean 'Lock Menu'?");
                        }
                    }
                    else if (changeType == MenuChangeType.HideMenuElement || changeType == MenuChangeType.ShowMenuElement)
                    {
                        MenuElement _element = PlayerMenus.GetElementWithName(menuToChange, elementToChange);
                        if (_element != null)
                        {
                            if (changeType == MenuChangeType.HideMenuElement)
                            {
                                _element.isVisible = false;
                            }
                            else
                            {
                                _element.isVisible = true;
                            }

                            _menu.ResetVisibleElements();
                            _menu.Recalculate();
                            KickStarter.playerMenus.FindFirstSelectedElement();
                        }
                        else
                        {
                            ACDebug.LogWarning("Could not find element of name '" + elementToChange + "' on menu '" + menuToChange + "'");
                        }
                    }
                    else if (changeType == MenuChangeType.LockMenu)
                    {
                        if (doFade)
                        {
                            _menu.TurnOff(true);
                        }
                        else
                        {
                            _menu.ForceOff();
                        }
                        _menu.isLocked = true;

                        if (doFade && willWait)
                        {
                            return(_menu.fadeSpeed);
                        }
                    }
                    else if (changeType == MenuChangeType.UnlockMenu)
                    {
                        _menu.isLocked = false;
                    }
                    else if (changeType == MenuChangeType.AddJournalPage)
                    {
                        MenuElement _element = PlayerMenus.GetElementWithName(menuToChange, elementToChange);
                        if (_element != null)
                        {
                            if (journalText != "")
                            {
                                if (_element is MenuJournal)
                                {
                                    MenuJournal journal = (MenuJournal)_element;
                                    JournalPage newPage = new JournalPage(lineID, journalText);
                                    journal.AddPage(newPage, onlyAddNewJournal);
                                }
                                else
                                {
                                    ACDebug.LogWarning(_element.title + " is not a journal!");
                                }
                            }
                            else
                            {
                                ACDebug.LogWarning("No journal text to add!");
                            }
                        }
                        else
                        {
                            ACDebug.LogWarning("Could not find menu element of name '" + elementToChange + "' inside '" + menuToChange + "'");
                        }
                    }
                }
                else if (menuToChange != "")
                {
                    ACDebug.LogWarning("Could not find menu of name '" + menuToChange + "'");
                }
            }
            else
            {
                isRunning = false;
                return(0f);
            }

            return(0f);
        }
コード例 #8
0
ファイル: ActionMenuState.cs プロジェクト: mcbodge/eidolon
        override public void Skip()
        {
            AC.Menu _menu = PlayerMenus.GetMenuWithName(menuToChange);

            if (_menu != null)
            {
                if (changeType == MenuChangeType.TurnOnMenu)
                {
                    if (_menu.appearType == AppearType.Manual || _menu.appearType == AppearType.OnInputKey)
                    {
                        _menu.TurnOn(false);
                    }
                }
                else if (changeType == MenuChangeType.TurnOffMenu)
                {
                    if (_menu.appearType == AppearType.Manual || _menu.appearType == AppearType.OnInputKey || _menu.appearType == AppearType.OnContainer)
                    {
                        _menu.ForceOff();
                    }
                }
                else if (changeType == MenuChangeType.HideMenuElement || changeType == MenuChangeType.ShowMenuElement)
                {
                    MenuElement _element = PlayerMenus.GetElementWithName(menuToChange, elementToChange);
                    if (_element != null)
                    {
                        if (changeType == MenuChangeType.HideMenuElement)
                        {
                            _element.isVisible = false;
                        }
                        else
                        {
                            _element.isVisible = true;
                        }
                        _menu.ResetVisibleElements();
                        _menu.Recalculate();
                    }
                }
                else if (changeType == MenuChangeType.LockMenu)
                {
                    _menu.isLocked = true;
                    _menu.ForceOff();
                }
                else if (changeType == MenuChangeType.UnlockMenu)
                {
                    _menu.isLocked = false;
                }
                else if (changeType == MenuChangeType.AddJournalPage)
                {
                    MenuElement _element = PlayerMenus.GetElementWithName(menuToChange, elementToChange);
                    if (_element != null)
                    {
                        if (journalText != "")
                        {
                            if (_element is MenuJournal)
                            {
                                MenuJournal journal = (MenuJournal)_element;
                                JournalPage newPage = new JournalPage(lineID, journalText);
                                journal.AddPage(newPage, onlyAddNewJournal);
                            }
                        }
                    }
                }
            }
        }