예제 #1
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (transitioning)
        {
            return(true);
        }
        if (eventType != InputManager.Event.Down)
        {
            return(true);
        }
        switch (command)
        {
        case InputManager.Command.Cancel:
            StartCoroutine(TransitionOut());
            break;

        case InputManager.Command.Confirm:
            Select();
            break;

        case InputManager.Command.Down:
            MoveCursor(1);
            break;

        case InputManager.Command.Up:
            MoveCursor(-1);
            break;

        case InputManager.Command.Left:
        case InputManager.Command.Right:
            SwitchMode();
            break;
        }
        return(true);
    }
예제 #2
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType != InputManager.Event.Up)
        {
            return(true);
        }
        switch (command)
        {
        case InputManager.Command.Up:
            MoveSelection(-1);
            break;

        case InputManager.Command.Down:
            MoveSelection(1);
            break;

        case InputManager.Command.Cancel:
            awaitingResult.Cancel();
            EndAwait();
            break;

        case InputManager.Command.Confirm:
        case InputManager.Command.Equip:
        case InputManager.Command.CutPage:
        case InputManager.Command.ErasePage:
        case InputManager.Command.AddPage:
        case InputManager.Command.View:
            awaitingResult.value = command;
            EndAwait();
            break;
        }
        return(true);
    }
예제 #3
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType == InputManager.Event.Up)
        {
            switch (command)
            {
            case InputManager.Command.Down:
            case InputManager.Command.Left:
            case InputManager.Command.Right:
            case InputManager.Command.Up:
            case InputManager.Command.DownLeft:
            case InputManager.Command.UpLeft:
            case InputManager.Command.DownRight:
            case InputManager.Command.UpRight:
                AttemptSetDirection(EightDirExtensions.FromCommand(command));
                break;

            case InputManager.Command.Confirm:
                awaitingSelect.value = currentDir;
                Global.Instance().Input.RemoveListener(this);
                break;

            case InputManager.Command.Cancel:
                awaitingSelect.Cancel();
                Global.Instance().Input.RemoveListener(this);
                break;
            }
        }
        return(true);
    }
예제 #4
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType != InputManager.Event.Down)
        {
            return(true);
        }
        switch (command)
        {
        case InputManager.Command.Down:
        case InputManager.Command.Right:
            MoveCursor(1);
            return(true);

        case InputManager.Command.Left:
        case InputManager.Command.Up:
            MoveCursor(-1);
            return(true);

        case InputManager.Command.Confirm:
            Confirm();
            return(true);

        default:
            return(true);
        }
    }
예제 #5
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (Event.Tracking || IsInputPaused)
        {
            return(false);
        }
        switch (eventType)
        {
        case InputManager.Event.Hold:
            switch (command)
            {
            case InputManager.Command.Up:
                TryStep(OrthoDir.North);
                return(true);

            case InputManager.Command.Down:
                TryStep(OrthoDir.South);
                return(true);

            case InputManager.Command.Right:
                TryStep(OrthoDir.East);
                return(true);

            case InputManager.Command.Left:
                TryStep(OrthoDir.West);
                return(true);

            default:
                return(true);
            }

        case InputManager.Event.Down:
            switch (command)
            {
            case InputManager.Command.Confirm:
                Interact();
                return(true);

            case InputManager.Command.Phune:
                StartCoroutine(PhoneRoutine());
                return(true);

            case InputManager.Command.Menu:
                Global.Instance().StartCoroutine(FindObjectOfType <PauseView>().MenuRoutine());
                return(true);

            case InputManager.Command.Debug:
                Global.Instance().Serialization.SaveToSlot(0);
                return(true);

            default:
                return(true);
            }

        default:
            return(true);
        }
    }
예제 #6
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        switch (eventType)
        {
        case InputManager.Event.Down:
            switch (command)
            {
            case InputManager.Command.Cancel:
                awaitingResult.Cancel();
                break;

            case InputManager.Command.Confirm:
                awaitingResult.value = dummyCard;
                break;

            case InputManager.Command.Down:
                AddKey(OrthoDir.South);
                break;

            case InputManager.Command.Up:
                AddKey(OrthoDir.North);
                break;

            case InputManager.Command.Left:
                AddKey(OrthoDir.West);
                break;

            case InputManager.Command.Right:
                AddKey(OrthoDir.East);
                break;
            }
            break;

        case InputManager.Event.Up:
            switch (command)
            {
            case InputManager.Command.Down:
                RemoveKey(OrthoDir.South);
                break;

            case InputManager.Command.Up:
                RemoveKey(OrthoDir.North);
                break;

            case InputManager.Command.Left:
                RemoveKey(OrthoDir.West);
                break;

            case InputManager.Command.Right:
                RemoveKey(OrthoDir.East);
                break;
            }
            break;
        }
        return(true);
    }
예제 #7
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (Parent.Tracking || IsInputPaused)
        {
            return(false);
        }
        switch (eventType)
        {
        case InputManager.Event.Hold:
            switch (command)
            {
            case InputManager.Command.Up:
                TryStep(OrthoDir.North);
                return(true);

            case InputManager.Command.Down:
                TryStep(OrthoDir.South);
                return(true);

            case InputManager.Command.Right:
                TryStep(OrthoDir.East);
                return(true);

            case InputManager.Command.Left:
                TryStep(OrthoDir.West);
                return(true);

            default:
                return(true);
            }

        case InputManager.Event.Down:
            switch (command)
            {
            case InputManager.Command.Confirm:
                Interact();
                return(true);

            case InputManager.Command.Menu:
            case InputManager.Command.Cancel:
                ShowMenu();
                return(true);

            case InputManager.Command.Debug:
                Global.Instance().Serialization.SaveToSlot(0);
                return(true);

            default:
                return(true);
            }

        default:
            return(true);
        }
    }
예제 #8
0
 public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
 {
     if (eventType != InputManager.Event.Down)
     {
         return(false);
     }
     if (command == InputManager.Command.Menu)
     {
         StartCoroutine(PauseRoutine());
         return(true);
     }
     return(false);
 }
예제 #9
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (GetComponent <MapEvent>().tracking || InputPaused)
        {
            return(true);
        }
        switch (eventType)
        {
        case InputManager.Event.Hold:
            switch (command)
            {
            case InputManager.Command.Up:
                TryStep(OrthoDir.North);
                return(false);

            case InputManager.Command.Down:
                TryStep(OrthoDir.South);
                return(false);

            case InputManager.Command.Right:
                TryStep(OrthoDir.East);
                return(false);

            case InputManager.Command.Left:
                TryStep(OrthoDir.West);
                return(false);

            default:
                return(false);
            }

        case InputManager.Event.Up:
            switch (command)
            {
            case InputManager.Command.Confirm:
                Interact();
                return(false);

            case InputManager.Command.Debug:
                Global.Instance().Memory.SaveToSlot(0);
                return(false);

            default:
                return(false);
            }

        default:
            return(false);
        }
    }
예제 #10
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType != InputManager.Event.Up)
        {
            return(false);
        }

        if (awaitingConfirm && command == InputManager.Command.Confirm)
        {
            confirmed       = true;
            awaitingConfirm = false;
        }

        return(false);
    }
예제 #11
0
 public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
 {
     if (eventType != InputManager.Event.Up)
     {
         return(true);
     }
     if (command == InputManager.Command.Confirm)
     {
         confirmResult.value = true;
     }
     else if (command == InputManager.Command.Cancel)
     {
         confirmResult.value = false;
     }
     return(true);
 }
예제 #12
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType != InputManager.Event.Up || working)
        {
            return(true);
        }
        switch (command)
        {
        case InputManager.Command.Cancel:
        case InputManager.Command.Left:
            Global.Instance().Input.RemoveListener(this);
            FindObjectOfType <PhuneUI>().SelectEntry(true);
            return(true);

        default:
            return(InternalHandleCommand(command));
        }
    }
예제 #13
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType == InputManager.Event.Down)
        {
            if (awaitingConfirm)
            {
                if (command == InputManager.Command.Confirm)
                {
                    Global.Instance().Audio.PlaySFX("confirm");
                    awaitingConfirm = false;
                }
                else if (command == InputManager.Command.Cancel)
                {
                    canceledConfirm = true;
                    Global.Instance().Audio.PlaySFX("cancel");
                    awaitingConfirm = false;
                }
            }
            else
            {
                switch (command)
                {
                case InputManager.Command.Cancel:
                    awaitingResult.Cancel();
                    Global.Instance().Audio.PlaySFX("cancel");
                    break;

                case InputManager.Command.Confirm:
                    awaitingResult.value = GetSelectedDoll().unit;
                    Global.Instance().Audio.PlaySFX("confirm");
                    break;

                case InputManager.Command.Down:
                    MoveSelection(1);
                    break;

                case InputManager.Command.Up:
                    MoveSelection(-1);
                    break;
                }
            }
        }
        return(true);
    }
예제 #14
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType != InputManager.Event.Up)
        {
            return(true);
        }
        switch (command)
        {
        case InputManager.Command.Up:
        case InputManager.Command.Down:
            ToggleSelection();
            break;

        case InputManager.Command.Confirm:
            Select();
            break;
        }
        return(true);
    }
예제 #15
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType != InputManager.Event.Up || halting)
        {
            return(true);
        }
        switch (command)
        {
        case InputManager.Command.Up:
            MoveSelection(-1);
            break;

        case InputManager.Command.Down:
            MoveSelection(1);
            break;

        case InputManager.Command.Confirm:
            if (helping)
            {
                HideHelp();
            }
            else
            {
                switch (selection)
                {
                case 0:
                    StartGame();
                    break;

                case 1:
                    ShowHelp();
                    break;

                case 2:
                    Quit();
                    break;
                }
            }
            break;
        }
        return(true);
    }
예제 #16
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        switch (eventType)
        {
        case InputManager.Event.Hold:
            if (command == InputManager.Command.Confirm)
            {
                hurried = true;
            }
            break;

        case InputManager.Event.Down:
            if (command == InputManager.Command.Confirm)
            {
                confirmed = true;
            }
            break;
        }
        return(true);
    }
예제 #17
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (GetComponent <MapEvent>().tracking || (awaitingSelect != null && awaitingSelect.finished))
        {
            return(true);
        }
        switch (eventType)
        {
        case InputManager.Event.Down:
            switch (command)
            {
            case InputManager.Command.Up:
            case InputManager.Command.Down:
            case InputManager.Command.Right:
            case InputManager.Command.Left:
            case InputManager.Command.UpLeft:
            case InputManager.Command.DownLeft:
            case InputManager.Command.DownRight:
            case InputManager.Command.UpRight:
                TryStep(EightDirExtensions.FromCommand(command));
                break;

            case InputManager.Command.Confirm:
                Vector2Int loc = GetComponent <MapEvent>().location;
                if (awaitingSelect != null && validator(GetComponent <MapEvent>().location))
                {
                    awaitingSelect.value = loc;
                }
                break;

            case InputManager.Command.Cancel:
                if (awaitingSelect != null)
                {
                    awaitingSelect.Cancel();
                }
                break;
            }
            break;
        }
        return(true);
    }
예제 #18
0
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType != InputManager.Event.Up || halting)
        {
            return(true);
        }
        switch (command)
        {
        case InputManager.Command.Up:
        case InputManager.Command.Down:
        case InputManager.Command.Right:
        case InputManager.Command.Left:
        case InputManager.Command.UpLeft:
        case InputManager.Command.DownLeft:
        case InputManager.Command.DownRight:
        case InputManager.Command.UpRight:
            EightDir dir = EightDirExtensions.FromCommand(command);
            Global.Instance().Input.RemoveListener(this);
            unit.battler.StepOrAttack(dir, executeResult);
            break;

        case InputManager.Command.Wait:
            Global.Instance().Input.RemoveListener(this);
            executeResult.value = true;
            break;

        case InputManager.Command.Skill1:
        case InputManager.Command.Skill2:
        case InputManager.Command.Skill3:
        case InputManager.Command.Skill4:
        case InputManager.Command.Skill5:
        case InputManager.Command.Skill6:
            int skillNumber = Global.Instance().Input.CommandToNumber(command) - 1;
            if (skillNumber < pc.activeBook.spells.Count)
            {
                Skill skill = pc.activeBook.spells[skillNumber];
                if (unit.CanUse(skill))
                {
                    Global.Instance().Input.RemoveListener(this);
                    StartCoroutine(skill.PlaySkillRoutine(unit, executeResult));
                }
                else
                {
                    if (skill.costMP > 0)
                    {
                        narrator.Log(skill + " costs too much MP to cast.", true);
                    }
                    else
                    {
                        narrator.Log(skill + " is on cooldown.", true);
                    }
                }
            }
            break;

        case InputManager.Command.Examine:
        case InputManager.Command.Confirm:
            Global.Instance().Input.RemoveListener(this);
            StartCoroutine(ScanRoutine());
            rightDisplayEnabled = false;
            break;

        case InputManager.Command.Debug:
            StartCoroutine(spellEditor.ActivateRoutine(this, pc,
                                                       pc.GetComponent <MapEvent>().map.GetComponent <MapGenerator>().level));
            break;

        case InputManager.Command.Zoom:
            MapCamera cam = FindObjectOfType <MapCamera>();
            if (cam.target == pc.GetComponent <MapEvent3D>())
            {
                cam.target         = pc.battle.map.GetEventNamed("ZoomTarget").GetComponent <MapEvent3D>();
                cam.targetDistance = 100.0f;
            }
            else
            {
                cam.targetDistance = 25.0f;
                cam.target         = pc.GetComponent <MapEvent3D>();
            }
            break;
        }
        return(true);
    }
예제 #19
0
파일: PhuneUI.cs 프로젝트: yazici/erebus
    public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
    {
        if (eventType == InputManager.Event.Up)
        {
            if (!shown)
            {
                if (command == InputManager.Command.Menu)
                {
                    StartCoroutine(ShowRoutine());
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else if (subselectionMode)
            {
                switch (command)
                {
                case InputManager.Command.Cancel:
                case InputManager.Command.Menu:
                case InputManager.Command.Confirm:
                case InputManager.Command.Left:
                    SelectEntry(true);
                    break;
                }
            }
            else
            {
                switch (command)
                {
                case InputManager.Command.Cancel:
                    if (!(selection is PhuneHeaderCell))
                    {
                        CollapseEntry();
                    }
                    else
                    {
                        StartCoroutine(HideRoutine());
                    }
                    break;

                case InputManager.Command.Menu:
                    StartCoroutine(HideRoutine());
                    break;

                case InputManager.Command.Up:
                    MoveSelection(-1);
                    break;

                case InputManager.Command.Down:
                    MoveSelection(1);
                    break;

                case InputManager.Command.Right:
                case InputManager.Command.Confirm:
                    if (selection is PhuneHeaderCell)
                    {
                        CollapseEntry();
                    }
                    else
                    {
                        selection.Execute();
                    }
                    break;

                case InputManager.Command.Left:
                    CollapseEntry();
                    break;
                }
            }
        }
        return(true);
    }
예제 #20
0
 public bool OnCommand(InputManager.Command command, InputManager.Event eventType)
 {
     return(eventResponder(command, eventType));
 }