Beispiel #1
0
 /// <summary>
 /// 強制的に可視状態にする
 /// </summary>
 public void ForceShow()
 {
     black.Alpha   = 0.5f;
     state         = State.appeared;
     sprite.Alpha  = 1;
     confirm.Alpha = 1;
     confirm.Seek(EffectObject.SeekPosition.End);
 }
Beispiel #2
0
        public OpenBrowserDialog(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.sound = sound;

            confirm = new EffectObject(device, resourceManager, Utility.Path.Combine("tweetconfirm.etd"))
            {
                Position = new Vector2(400, 225)
            };
            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.5f
            };
            sprite = new SpriteObject(device);
            text   = new TextureString(device, Utility.Language["NotHaveScoreDownload"], 16, 300, 200, true, PPDColors.White)
            {
                Position = new Vector2(240, 120)
            };

            buttons = new Button[2];
            for (int i = 0; i < buttons.Length; i++)
            {
                string str = "";
                switch (i)
                {
                case 0:
                    str = Utility.Language["OK"];
                    break;

                case 1:
                    str = Utility.Language["Cancel"];
                    break;
                }
                buttons[i] = new Button(device, resourceManager, Utility.Path, str)
                {
                    Position = new Vector2(300 + i * 200, 315)
                };
                buttons[i].Selected = false;
                this.AddChild(buttons[i]);
            }

            buttons[0].Selected = true;

            this.AddChild(sprite);
            sprite.AddChild(text);
            sprite.AddChild(buttons[0]);
            sprite.AddChild(buttons[1]);
            this.AddChild(confirm);
            this.AddChild(black);

            confirm.PlayType = Effect2D.EffectManager.PlayType.Once;
            confirm.Play();
            confirm.Seek(EffectObject.SeekPosition.End);

            Inputed += OpenBrowserDialog_Inputed;
        }
Beispiel #3
0
        void ReviewDialog_Inputed(IFocusable sender, InputEventArgs args)
        {
            if (reviewWaiting)
            {
                return;
            }
            if (opening)
            {
                if (args.AnyPressed)
                {
                    back.Seek(EffectObject.SeekPosition.End);
                    return;
                }
            }

            if (args.InputInfo.IsPressed(ButtonType.Circle))
            {
                if (buttons[0].Selected)
                {
                    Sound.Play(PPDSetting.DefaultSounds[1], -1000);
                    reviewWaiting     = true;
                    processing.Hidden = false;
                    buttons[0].Hidden = buttons[1].Hidden = true;
                    ReviewManager.Review(review.Text, Rate);
                }
                else if (buttons[1].Selected)
                {
                    Sound.Play(PPDSetting.DefaultSounds[2], -1000);
                    FocusManager.RemoveFocus();
                }
            }
            else if (args.InputInfo.IsPressed(ButtonType.Cross))
            {
                Sound.Play(PPDSetting.DefaultSounds[2], -1000);
                FocusManager.RemoveFocus();
            }
            else if (args.InputInfo.IsPressed(ButtonType.Left))
            {
                switch (selection)
                {
                case 0:
                    Rate--;
                    Sound.Play(PPDSetting.DefaultSounds[3], -1000);
                    break;

                case 1:
                    ReviewSelection--;
                    Sound.Play(PPDSetting.DefaultSounds[3], -1000);
                    break;

                case 2:
                    bool temp = buttons[0].Selected;
                    buttons[0].Selected = buttons[1].Selected;
                    buttons[1].Selected = temp;
                    Sound.Play(PPDSetting.DefaultSounds[0], -1000);
                    break;
                }
            }
            else if (args.InputInfo.IsPressed(ButtonType.Right))
            {
                switch (selection)
                {
                case 0:
                    Rate++;
                    Sound.Play(PPDSetting.DefaultSounds[3], -1000);
                    break;

                case 1:
                    ReviewSelection++;
                    Sound.Play(PPDSetting.DefaultSounds[3], -1000);
                    break;

                case 2:
                    bool temp = buttons[0].Selected;
                    buttons[0].Selected = buttons[1].Selected;
                    buttons[1].Selected = temp;
                    Sound.Play(PPDSetting.DefaultSounds[0], -1000);
                    break;
                }
            }
            else if (args.InputInfo.IsPressed(ButtonType.Up))
            {
                selection--;
                if (selection < 0)
                {
                    selection = 2;
                }
                select.Position = new Vector2(235, 140 + 30 * selection);
                select.Hidden   = selection == 2;
                if (selection == 2)
                {
                    buttons[0].Selected = true;
                    buttons[1].Selected = false;
                }
                else
                {
                    buttons[0].Selected = buttons[1].Selected = false;
                }
                Sound.Play(PPDSetting.DefaultSounds[0], -1000);
            }
            else if (args.InputInfo.IsPressed(ButtonType.Down))
            {
                selection++;
                if (selection > 2)
                {
                    selection = 0;
                }
                select.Position = new Vector2(235, 140 + 30 * selection);
                select.Hidden   = selection == 2;
                if (selection == 2)
                {
                    buttons[0].Selected = true;
                    buttons[1].Selected = false;
                }
                else
                {
                    buttons[0].Selected = buttons[1].Selected = false;
                }
                Sound.Play(PPDSetting.DefaultSounds[0], -1000);
            }
        }
Beispiel #4
0
        void TweetDialog_Inputed(IFocusable sender, InputEventArgs args)
        {
            if (tweetWaiting)
            {
                return;
            }
            if (opening)
            {
                if (args.AnyPressed)
                {
                    back.Seek(EffectObject.SeekPosition.End);
                    return;
                }
            }

            if (args.InputInfo.IsPressed(ButtonType.Circle))
            {
                switch (selection)
                {
                case 0:
                    Sound.Play(PPDSetting.DefaultSounds[1], -1000);
                    tweetWaiting      = true;
                    processing.Hidden = false;
                    buttons[0].Hidden = buttons[1].Hidden = true;
                    TweetManager.Tweet();
                    break;

                case 1:
                    Sound.Play(PPDSetting.DefaultSounds[2], -1000);
                    FocusManager.RemoveFocus();
                    break;
                }
            }
            else if (args.InputInfo.IsPressed(ButtonType.Cross))
            {
                Sound.Play(PPDSetting.DefaultSounds[2], -1000);
                FocusManager.RemoveFocus();
            }
            else if (args.InputInfo.IsPressed(ButtonType.Left))
            {
                buttons[selection].Selected = false;
                selection--;
                if (selection < 0)
                {
                    selection = 1;
                }
                buttons[selection].Selected = true;
                Sound.Play(PPDSetting.DefaultSounds[0], -1000);
            }
            else if (args.InputInfo.IsPressed(ButtonType.Right))
            {
                buttons[selection].Selected = false;
                selection++;
                if (selection > 1)
                {
                    selection = 0;
                }
                buttons[selection].Selected = true;
                Sound.Play(PPDSetting.DefaultSounds[0], -1000);
            }
        }