Beispiel #1
0
        public override IEnumerator<bool> Execute()
        {
            Manager.Add(sum, 1);
            Manager.AddRangeTo(uvs, 1);
            Manager.AddRangeTo(seluvs, 1);
            Manager.AddRangeTo(udc, 2);
            foreach (var i in udc) i.AddSubOperation(SpritePatterns.Blink(30, 0.8, Easing.Linear));
            Manager.Add(mc, 2);
            Manager.AddRangeTo(selopts, 1);
            Manager.OffsetX = 640;
            Manager.OffsetY = 240;
            //突入
            for (int i = 0; i < 40; i++)
            {
                Manager.OffsetX = Easing.OutQuad(i, 40, 640, -640);
                yield return true;
            }
            Manager.OffsetX = 0;

            prevstate = Gamepad.GetState();
            while (true)
            {
                state = Gamepad.GetState();
                tstate = state.GetTriggerStateWith(prevstate);
                switch (cstate)
                {
                    case 0:
                        if (tstate.Buttons[1])
                        {
                            Parent.SendChildMessage("ReturnToOptionEdit");
                            CommonObjects.SoundMenuCancel.Play();
                            for (int i = 0; i < 40; i++)
                            {
                                Manager.OffsetX = Easing.OutQuad(i, 40, 0, 640);
                                yield return true;
                            }
                            goto EXIT;
                        }
                        if (tstate.Buttons[0])
                        {
                            CommonObjects.SoundMenuOK.Play();
                            if (usel == selopts.Count - 1)
                            {
                                var ol = new OptionInformation[5];
                                for (int i = 0; i < avu; i++)
                                {
                                    ol[i] = new OptionInformation(opts[i]);
                                    ol[i].TargetOperation = OptionOperations.SelectionInformation[osi[i]].Operation;
                                    ol[i].InitializationInformation = oii[i];
                                }
                                Parent.SendChildMessage("ApplyOptionInformation", ol);
                                Parent.SendChildMessage("StartGame");
                                for (int i = 0; i < 40; i++)
                                {
                                    Manager.OffsetX = Easing.OutQuad(i, 40, 0, -640);
                                    yield return true;
                                }
                                goto EXIT;
                            }
                            else
                            {
                                GoToEditingMode();
                            }
                        }
                        if ((tstate.Direction & GamepadDirection.Up) != 0)
                        {
                            selopts[usel].AddSubOperation(SpritePatterns.Alpha(15, 0, Easing.Linear));
                            selopts[usel].AddSubOperation(SpritePatterns.Move(15, selopts[usel].X, selopts[usel].Y - 96, Easing.OutQuad));
                            usel = (usel + (selopts.Count - 1)) % selopts.Count;
                            selopts[usel].Y = 128 + 96;
                            selopts[usel].AddSubOperation(SpritePatterns.Alpha(15, 1, Easing.Linear));
                            selopts[usel].AddSubOperation(SpritePatterns.Move(15, selopts[usel].X, selopts[usel].Y - 96, Easing.OutQuad));
                            if (usel < avu) RefreshOptionInformation(false);
                            smsel = 0;
                            mc.AddSubOperation(SpritePatterns.VerticalMove(10, uvsmal[smsel].Y, Easing.OutQuad));
                            CommonObjects.SoundMenuSelect.Play();
                        }
                        if ((tstate.Direction & GamepadDirection.Down) != 0)
                        {
                            selopts[usel].AddSubOperation(SpritePatterns.Alpha(15, 0, Easing.Linear));
                            selopts[usel].AddSubOperation(SpritePatterns.Move(15, selopts[usel].X, selopts[usel].Y + 96, Easing.OutQuad));
                            usel = (usel + 1) % selopts.Count;
                            selopts[usel].Y = 128 - 96;
                            selopts[usel].AddSubOperation(SpritePatterns.Alpha(15, 1, Easing.Linear));
                            selopts[usel].AddSubOperation(SpritePatterns.Move(15, selopts[usel].X, selopts[usel].Y + 96, Easing.OutQuad));
                            if (usel < avu) RefreshOptionInformation(false);
                            smsel = 0;
                            mc.AddSubOperation(SpritePatterns.VerticalMove(10, uvsmal[smsel].Y, Easing.OutQuad));
                            CommonObjects.SoundMenuSelect.Play();
                        }
                        break;
                    case 1:
                        SubMenuOperation();
                        break;
                    case 2:
                        if (!UserValueInputOperation())
                        {
                            var ivs = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Red) { Value = "入力値が不正です!", X = seluvs[smsel].X, Y = seluvs[smsel].Y };
                            ivs.AddSubOperation(SpritePatterns.VerticalFadeOut(60, -64, Easing.OutQuad, Easing.Linear));
                            Manager.Add(ivs, 3);
                        }
                        break;
                }
                prevstate = state;
                yield return true;
            }
            EXIT: ;
        }
Beispiel #2
0
 public override IEnumerator<bool> Tick()
 {
     prevstate = Gamepad.GetState();
     while (true)
     {
         state = Gamepad.GetState();
         tstate = state.GetTriggerStateWith(prevstate);
         Operation.MoveNext();
         Manager.TickAll();
         Children.TickAll();
         prevstate = state;
         yield return true;
     }
 }
Beispiel #3
0
        public override IEnumerator<bool> Execute()
        {
            Manager.OffsetX = backing ? -640 : 640;
            Manager.OffsetY = 240;

            if (ainfo.Accounts.Length == 0)
            {
                Manager.Add(new StringSprite(CommonObjects.FontSystemSmall, CommonObjects.Colors.Red) { X = 16, Y = 120, Value = "アカウントがありません。Kbtter4で登録してください。" }, 2);
                for (int i = 0; i < 40; i++)
                {
                    Manager.OffsetX = Easing.OutQuad(i, 40, 640, -640);
                    yield return true;
                }
                Manager.OffsetX = 0;
                while (true) yield return true;
            }

            LoadUsers();
            var sel = 0;
            Manager.AddRangeTo(uips, 1);
            for (int i = 0; i < uips.Length; i++)
            {
                uips[i].Y = 240 * i;
                if (i != sel) uips[i].Alpha = 0;
            }

            Manager.Add(new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "アカウント選択", X = 250, Y = 8 }, 0);
            udc = new[]
            {
                new MultiAdditionalCoroutineSprite(){HomeX=64,HomeY=64,ScaleX=0.8,ScaleY=0.4,Image=CommonObjects.ImageCursor128[2],X=64,Y=48},
                new MultiAdditionalCoroutineSprite(){HomeX=64,HomeY=64,ScaleX=0.8,ScaleY=0.4,Image=CommonObjects.ImageCursor128[3],X=64,Y=208},
            };
            Manager.AddRangeTo(udc, 2);
            foreach (var i in udc) i.AddSubOperation(SpritePatterns.Blink(30, 0.8, Easing.Linear));

            for (int i = 0; i < 40; i++)
            {
                Manager.OffsetX = Easing.OutQuad(i, 40, backing ? -640 : 640, backing ? 640 : -640);
                yield return true;
            }
            Manager.OffsetX = 0;

            prevstate = Gamepad.GetState();
            while (true)
            {
                state = Gamepad.GetState();
                tstate = state.GetTriggerStateWith(prevstate);
                if (tstate.Buttons[1])
                {
                    Parent.SendChildMessage("ReturnToMenuSelect");
                    CommonObjects.SoundMenuCancel.Play();
                    for (int i = 0; i < 40; i++)
                    {
                        Manager.OffsetX = Easing.OutQuad(i, 40, 0, 640);
                        yield return true;
                    }
                    break;
                }
                if (tstate.Buttons[0] && uinfo[sel] != null)
                {
                    Parent.SendChildMessage("GoToOptionEdit:" + sel.ToString());
                    CommonObjects.SoundMenuOK.Play();
                    for (int i = 0; i < 40; i++)
                    {
                        Manager.OffsetX = Easing.OutQuad(i, 40, 0, -640);
                        yield return true;
                    }
                    break;
                }
                if ((tstate.Direction & GamepadDirection.Up) != 0)
                {
                    uips[sel].AddSubOperation(SpritePatterns.Move(15, 0, -120, Easing.OutQuad));
                    uips[sel].AddSubOperation(SpritePatterns.Alpha(15, 0, Easing.OutQuad));
                    sel = (sel + uips.Length - 1) % uips.Length;
                    uips[sel].Y = 120;
                    uips[sel].AddSubOperation(SpritePatterns.Move(15, 0, 0, Easing.OutQuad));
                    uips[sel].AddSubOperation(SpritePatterns.Alpha(15, 1, Easing.OutQuad));
                    CommonObjects.SoundMenuSelect.Play();

                }
                if ((tstate.Direction & GamepadDirection.Down) != 0)
                {
                    uips[sel].AddSubOperation(SpritePatterns.Move(15, 0, 120, Easing.OutQuad));
                    uips[sel].AddSubOperation(SpritePatterns.Alpha(15, 0, Easing.OutQuad));
                    sel = (sel + 1) % uips.Length;
                    uips[sel].Y = -120;
                    uips[sel].AddSubOperation(SpritePatterns.Move(15, 0, 0, Easing.OutQuad));
                    uips[sel].AddSubOperation(SpritePatterns.Alpha(15, 1, Easing.OutQuad));
                    CommonObjects.SoundMenuSelect.Play();
                }

                prevstate = state;
                yield return true;
            }
        }
Beispiel #4
0
        public override IEnumerator<bool> Execute()
        {
            Manager.OffsetX = 640;
            Manager.OffsetY = 240;

            Manager.Add(new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "オプションユーザー選択", X = 210, Y = 8 }, 0);
            Manager.AddRangeTo(opod, 0);
            Manager.AddRangeTo(opsn, 0);
            Manager.Add(opop, 0);
            Manager.Add(next, 0);

            Manager.Add(new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 320, Y = 64 - 8, Value = "検索:" }, 1);
            Manager.Add(valid, 0);

            mc.AddSubOperation(SpritePatterns.Blink(30, 0.5, Easing.Linear));
            Manager.Add(mc, 1);
            mc.X = mal[msel].X;
            mc.Y = mal[msel].Y;

            Manager.AddRangeTo(okcancel, 1);
            Manager.Add(ouip, 1);

            //突入
            for (int i = 0; i < 40; i++)
            {
                Manager.OffsetX = Easing.OutQuad(i, 40, b ? -640 : 640, b ? 640 : -640);
                yield return true;
            }
            Manager.OffsetX = 0;

            prevstate = Gamepad.GetState();
            while (true)
            {
                state = Gamepad.GetState();
                tstate = state.GetTriggerStateWith(prevstate);

                switch (cs)
                {
                    case 0:
                        if (tstate.Buttons[1])
                        {
                            Parent.SendChildMessage("ReturnToAccountSelect");
                            CommonObjects.SoundMenuCancel.Play();
                            for (int i = 0; i < 40; i++)
                            {
                                Manager.OffsetX = Easing.OutQuad(i, 40, 0, 640);
                                yield return true;
                            }
                            goto EXIT;
                        }
                        if (tstate.Buttons[0])
                        {
                            CommonObjects.SoundMenuOK.Play();
                            if (msel < 5)
                            {
                                GoToOptionOperationSelect();
                            }
                            else
                            {
                                Parent.SendChildMessage("GoToOptionSetting");
                                for (int i = 0; i < 40; i++)
                                {
                                    Manager.OffsetX = Easing.OutQuad(i, 40, 0, -640);
                                    yield return true;
                                }
                                goto EXIT;
                            }
                        }
                        OptionUserOrderSelectionOperation();
                        break;
                    case 1:
                        OptionScreenNameInputOperation();
                        break;
                    case 2:
                        OptionDecisionOperation();
                        break;
                    case 3:
                        //本当はScreenNameInputの前だけどゆるして
                        OptionOperationSelectionOperation();
                        break;
                }
                prevstate = state;
                yield return true;
            }
            EXIT: ;
        }