Exemple #1
0
 void PreviewPlayDialog_LostFocused(IFocusable sender, FocusEventArgs args)
 {
     back.Stop();
     back.PlayType = Effect2D.EffectManager.PlayType.ReverseOnce;
     back.Finish  += back_ReverseFinish;
     back.Play();
 }
Exemple #2
0
 void TweetDialog_LostFocused(IFocusable sender, FocusEventArgs args)
 {
     message.Hidden = content.Hidden = buttons[0].Hidden = buttons[1].Hidden = true;
     back.Stop();
     back.PlayType = Effect2D.EffectManager.PlayType.ReverseOnce;
     back.Finish  += back_ReverseFinish;
     back.Play();
 }
Exemple #3
0
 /// <summary>
 /// 消える
 /// </summary>
 public void Vanish()
 {
     state        = State.vanishing;
     sprite.Alpha = 0;
     confirm.Stop();
     confirm.PlayType = Effect2D.EffectManager.PlayType.ReverseOnce;
     confirm.Play();
 }
Exemple #4
0
 public void Focus(object sender, EventArgs e)
 {
     this.Focused = true;
     state        = State.notappeared;
     confirm.Stop();
     confirm.PlayType = Effect2D.EffectManager.PlayType.Once;
     confirm.Play();
 }
Exemple #5
0
 void ReviewDialog_LostFocused(IFocusable sender, FocusEventArgs args)
 {
     foreach (GameComponent hidden in hiddenList)
     {
         hidden.Hidden = true;
     }
     back.Stop();
     back.PlayType = Effect2D.EffectManager.PlayType.ReverseOnce;
     back.Finish  += back_ReverseFinish;
     back.Play();
 }
Exemple #6
0
 public override void Load()
 {
     resource      = new Dictionary <string, ImageResource>();
     anim          = new EffectObject("img\\default\\Loading.etd", 700, 420, resource, Device);
     anim.PlayType = Effect2D.EffectManager.PlayType.Loop;
     anim.Play();
 }
Exemple #7
0
        public MenuSelectSong(Device device, Sprite sprite, Menu m, string directory)
        {
            this.device    = device;
            this.sprite    = sprite;
            this.m         = m;
            state          = State.NotAppeared;
            Focused        = true;
            resource       = new Dictionary <string, ImageResource>();
            pictureobjects = new ArrayList();
            anim           = new EffectObject("img\\default\\selectback.etd", 0, 0, resource, device);
            anim.PlayType  = Effect2D.EffectManager.PlayType.Loop;
            anim.Alignment = EffectObject.EffectAlignment.TopLeft;
            anim.Play();
            string        filename = "img\\default\\selectback.png";
            ImageResource p        = new ImageResource(filename, device);

            height = p.Height;
            width  = p.Width;
            resource.Add(filename, p);
            back     = new PictureObject(filename, 800, 0, resource, device);
            filename = "img\\default\\folder.png";
            p        = new ImageResource(filename, device);
            resource.Add(filename, p);
            folder = new PictureObject(filename, 0, 0, resource, device);
        }
Exemple #8
0
 public SongNameComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, bool isSelected) : base(device)
 {
     AddChild(folder = new PictureObject(device, resourceManager, Utility.Path.Combine("folder.png")));
     AddChild(ac     = new PictureObject(device, resourceManager, Utility.Path.Combine("ac.png"))
     {
         Position = new Vector2(30, -10)
     });
     AddChild(ft = new PictureObject(device, resourceManager, Utility.Path.Combine("ft.png"))
     {
         Position = new Vector2(70, -10)
     });
     AddChild(perfect = new PictureObject(device, resourceManager, Utility.Path.Combine("perfect.png"))
     {
         Position = new Vector2(110, -10)
     });
     AddChild(text = new TextureString(device, "", 20, 390, PPDColors.White)
     {
         Position = new Vector2(40, 5)
     });
     if (isSelected)
     {
         anim = new EffectObject(device, resourceManager, Utility.Path.Combine("selectback.etd"))
         {
             PlayType  = Effect2D.EffectManager.PlayType.Loop,
             Alignment = EffectObject.EffectAlignment.TopLeft
         };
         anim.Play();
         AddChild(anim);
     }
     else
     {
         back = new PictureObject(device, resourceManager, Utility.Path.Combine("selectback.png"));
         AddChild(back);
     }
 }
Exemple #9
0
        public bool SetPressing(ButtonType buttonType, bool isPressing, long currentTime)
        {
            bool ret = false;

            IsHolding = false;
            bool pressed = false;

            if (!isPressing)
            {
                IsHolding    = false;
                IsMaxHolding = false;
                Clear();
                isDrawn = true;
                OnHoldEnd(new HoldInfo(0, 0, GetPressingMarkTypes()));
            }
            else
            {
                if (IsMaxHolding && !pressingButtons[(int)buttonType])
                {
                    ret          = true;
                    IsMaxHolding = false;
                    Clear();
                    OnHoldEnd(new HoldInfo(0, 0, GetPressingMarkTypes()));
                }
                if (PressingCount == 0)
                {
                    holdnumber.Value = 0;
                }
                isDrawn   = false;
                IsHolding = true;
                if (!pressingButtons[(int)buttonType])
                {
                    IsMaxHolding = false;
                    pressed      = true;
                    pressingInfos[(int)buttonType].Count          = 0;
                    pressingInfos[(int)buttonType].PressStartTime = currentTime;
                    for (int i = 0; i < pressingInfos.Length; i++)
                    {
                        if (pressingButtons[i])
                        {
                            pressingInfos[i].Count          = 0;
                            pressingInfos[i].PressStartTime = pressingInfos[(int)buttonType].PressStartTime;
                        }
                    }
                    pressingButtons[(int)buttonType] = isPressing;
                    OnHoldStart(new HoldInfo((int)holdnumber.Value, 0, GetPressingMarkTypes()));
                }
            }
            pressingButtons[(int)buttonType] = isPressing;
            if (pressed)
            {
                holdeffect.Stop();
                holdeffect.Play();
                UpdateMarksPos();
                Show();
            }
            return(ret);
        }
Exemple #10
0
        public bool SetPressing(ButtonType buttontype, bool isPressing)
        {
            bool ret = false;

            holding = false;
            bool pressed = false;

            if (!isPressing)
            {
                if (pressingButtons[(int)buttontype])
                {
                    holding  = false;
                    maxbonus = false;
                    Clear();
                    Hidden = true;
                }
            }
            else
            {
                if (maxbonus && !pressingButtons[(int)buttontype])
                {
                    ret      = true;
                    maxbonus = false;
                    Clear();
                }
                if (PressingCount == 0)
                {
                    holdnumber.Value = 0;
                }
                Hidden  = false;
                holding = true;
                if (!pressingButtons[(int)buttontype])
                {
                    maxbonus = false;
                    pressed  = true;
                    pressingInfos[(int)buttontype].Count          = 0;
                    pressingInfos[(int)buttontype].PressStartTime = Win32API.timeGetTime();
                    for (int i = 0; i < pressingInfos.Length; i++)
                    {
                        if (pressingButtons[i])
                        {
                            pressingInfos[i].Count          = 0;
                            pressingInfos[i].PressStartTime = pressingInfos[(int)buttontype].PressStartTime;
                        }
                    }
                }
            }
            pressingButtons[(int)buttontype] = isPressing;
            if (pressed)
            {
                holdeffect.Stop();
                holdeffect.Play();
                UpdateMarksPos();
                Show();
            }
            return(ret);
        }
Exemple #11
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;
        }
Exemple #12
0
        public override bool Load()
        {
            anim = new EffectObject(device, ResourceManager, Utility.Path.Combine("Loading.etd"))
            {
                Position = new SharpDX.Vector2(700, 420)
            };
            anim.PlayType = Effect2D.EffectManager.PlayType.Loop;
            anim.Play();
            AddChild(anim);

            return(true);
        }
Exemple #13
0
            public LoadablePictureComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, SongInformation songInfo) : base(device)
            {
                this.resourceManager = resourceManager;
                this.songInfo        = songInfo;

                this.AddChild(new TextureString(device, songInfo.DirectoryName, 12, 150, 30, true, true, PPDColors.White)
                {
                    Position = new Vector2(-75, 35)
                });
                this.AddChild((loading = new EffectObject(device, resourceManager, Utility.Path.Combine("loading.etd"))));
                loading.PlayType = Effect2D.EffectManager.PlayType.Loop;
                loading.Play();
                loading.Scale = new SharpDX.Vector2(0.5f, 0.5f);
                if (songInfo.IsPPDSong)
                {
                    thumbPath = Path.Combine(songInfo.DirectoryPath, "thumb.png");
                    if (File.Exists(thumbPath))
                    {
                        if (!resourceManager.HasResource <ImageResourceBase>(thumbPath))
                        {
                            var thread = ThreadManager.Instance.GetThread(LoadTexture);
                            thread.Start();
                        }
                        else
                        {
                            LoadTexture();
                        }
                    }
                    else
                    {
                        picture = new PictureObject(device, resourceManager, Utility.Path.Combine("noimage.png"), true)
                        {
                            Scale = new SharpDX.Vector2(0.25f, 0.25f),
                            Alpha = 0
                        };
                        this.AddChild(picture);
                    }
                }
                else
                {
                    picture = new PictureObject(device, resourceManager, Utility.Path.Combine("bigfolder.png"), true)
                    {
                        Scale = new SharpDX.Vector2(0.25f, 0.25f),
                        Alpha = 0
                    };
                    this.AddChild(picture);
                }
            }
Exemple #14
0
            public FeedComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, Feed feed) : base(device)
            {
                this.resourceManager = resourceManager;
                this.feed            = feed;

                var thread = ThreadManager.Instance.GetThread(Load);

                thread.Start();
                loading = new EffectObject(device, resourceManager, Utility.Path.Combine("loading.etd"))
                {
                    Position = new SharpDX.Vector2(300, 225),
                    PlayType = Effect2D.EffectManager.PlayType.Loop
                };
                loading.Play();
                this.AddChild(loading);

                Alpha = 0;
            }
Exemple #15
0
        public Moviethumb(Device device, Sprite sprite)
        {
            resource       = new Dictionary <string, ImageResource>();
            this.device    = device;
            this.sprite    = sprite;
            flare          = new EffectObject("img\\default\\lightmodeflare.etd", 0, 0, resource, device);
            flare.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
            flare.Play();
            gloss          = new EffectObject("img\\default\\lightmodegloss.etd", 0, 0, resource, device);
            gloss.PlayType = Effect2D.EffectManager.PlayType.Loop;
            gloss.Play();
            ImageResource pic = new ImageResource(noimage, device);

            resource.Add(noimage, pic);
            pic = new ImageResource(folder, device);
            resource.Add(folder, pic);
            refrect = new Reflection(device);
        }
Exemple #16
0
        public ButtonComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text) : base(device)
        {
            TextureString str;

            this.AddChild(str = new TextureString(device, text, 20, PPDColors.White)
            {
                Position = new Vector2(30, 0)
            });

            select = new EffectObject(device, resourceManager, pathManager.Combine("greenflare.etd"))
            {
                Position = new Vector2(13, 13)
            };
            select.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
            select.Play();
            select.Alignment = EffectObject.EffectAlignment.Center;
            select.Scale     = new Vector2(0.4f, 0.4f);
            this.AddChild(select);
        }
Exemple #17
0
        public override void Load()
        {
            resource         = new Dictionary <string, ImageResource>();
            select           = new EffectObject("img\\default\\difficulty.etd", 380, 150, resource, Device);
            select.Alignment = EffectObject.EffectAlignment.TopLeft;
            select.PlayType  = Effect2D.EffectManager.PlayType.Loop;
            select.Play();
            ImageResource pic = new ImageResource("img\\default\\difficulty.png", Device);

            resource.Add("img\\default\\difficulty.png", pic);
            selects = new PictureObject[3];
            for (int i = 0; i < 3; i++)
            {
                PictureObject po = new PictureObject("img\\default\\difficulty.png", 380, 150 + 60 * i, resource, Device);
                po.Position = new Vector2(400 - po.Width / 2, po.Position.Y);
                selects[i]  = po;
                switch (i)
                {
                case 0:
                    resume = new StringObject("RESUME", 370, 150 + 60 * i + 5, 20, new Color4(1, 1, 1, 1), Device, Sprite);
                    break;

                case 1:
                    retry = new StringObject("RETRY", 375, 150 + 60 * i + 5, 20, new Color4(1, 1, 1, 1), Device, Sprite);
                    break;

                case 2:
                    retur = new StringObject("RETURN", 370, 150 + 60 * i + 5, 20, new Color4(1, 1, 1, 1), Device, Sprite);
                    break;
                }
            }
            pic = new ImageResource("img\\default\\confirmpause.png", Device);
            resource.Add("img\\default\\confirmpause.png", pic);
            conf = new PictureObject("img\\default\\confirmpause.png", 266, 118, resource, Device);
            pic  = new ImageResource("img\\default\\conftop.png", Device);
            resource.Add("img\\default\\conftop.png", pic);
            top = new PictureObject("img\\default\\conftop.png", 266, 225 - 107, resource, Device);
            pic = new ImageResource("img\\default\\confbottom.png", Device);
            resource.Add("img\\default\\confbottom.png", pic);
            bottom          = new PictureObject("img\\default\\confbottom.png", 266, 225 + 107 - 17, resource, Device);
            select.Position = new Vector2(selects[(int)pausetype].Position.X - 4, selects[(int)pausetype].Position.Y - 4);
            Hidden          = false;
        }
Exemple #18
0
        private void ReadEffect(XmlReader reader)
        {
            var filePath = Utility.Path.Combine(reader.GetAttribute("Path"));

            if (File.Exists(filePath))
            {
                var eo = new EffectObject(device, resourceManager, filePath)
                {
                    Position = new SharpDX.Vector2(ReadAttribute(reader, "X", 0), ReadAttribute(reader, "Y", 0))
                };
                eo.Alignment = reader.GetAttribute("Center") == "1" ? EffectObject.EffectAlignment.Center : EffectObject.EffectAlignment.TopLeft;
                eo.Alpha     = ReadAttribute(reader, "Alpha", 1);
                eo.Scale     = new SharpDX.Vector2(ReadAttribute(reader, "ScaleX", 1), ReadAttribute(reader, "ScaleY", 1));
                eo.Rotation  = ReadAttribute(reader, "Rotation", 0);
                eo.PlayType  = ParsePlayType(reader.GetAttribute("PlayType"));
                eo.Play();
                this.AddChild(eo);
            }
        }
Exemple #19
0
        public RoomListComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, IGameHost gameHost) : base(device)
        {
            this.resourceManager = resourceManager;
            this.sound           = sound;
            this.gameHost        = gameHost;

            this.AddChild(back    = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            back.AddChild(loading = new EffectObject(device, resourceManager, Utility.Path.Combine("loading_icon.etd"))
            {
                Position = new Vector2(700, 60)
            });
            back.AddChild(scrollBar = new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                Position        = new Vector2(756, 80),
                RectangleHeight = 330,
                RectangleWidth  = 5
            });
            back.AddChild(selectRectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth = 714, RectangleHeight = 28
            });
            back.AddChild(new TextureString(device, Utility.Language["RoomList"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });
            back.AddChild(listSprite = new SpriteObject(device)
            {
                Position = new SharpDX.Vector2(38, 77)
            });

            loading.PlayType = Effect2D.EffectManager.PlayType.Loop;
            loading.Play();
            loading.Scale  = new Vector2(0.125f);
            loading.Hidden = true;

            getRoomListExecutor           = new GetRoomListExecutor();
            getRoomListExecutor.Finished += getRoomListExecutor_Finished;

            timerID = gameHost.AddTimerCallBack(timerCallBack, 15000, false, true);

            Inputed     += RoomListComponent_Inputed;
            LostFocused += RoomListComponent_LostFocused;
        }
Exemple #20
0
        public override bool Load()
        {
            anim = new EffectObject(device, ResourceManager, Utility.Path.Combine("Loading.etd"))
            {
                Position = new Vector2(700, 420)
            };
            anim.PlayType = Effect2D.EffectManager.PlayType.Loop;
            anim.Play();
            progressText = new TextureString(device, "", 20, PPDColors.White)
            {
                Position = new Vector2(10, 420)
            };
            progressText.Border = new Border
            {
                Color     = PPDColors.Black,
                Thickness = 1
            };
            AddChild(anim);
            AddChild(progressText);

            return(true);
        }
Exemple #21
0
        public Button(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text) : base(device)
        {
            this.resourceManager = resourceManager;
            textureString        = new TextureString(device, text, 20, true, PPDColors.White)
            {
                Position = new Vector2(0, -10)
            };
            button = new EffectObject(device, resourceManager, pathManager.Combine("difficulty.etd"))
            {
                Alignment = EffectObject.EffectAlignment.Center,
                PlayType  = Effect2D.EffectManager.PlayType.Loop
            };
            button.Play();
            disableButton = new PictureObject(device, resourceManager, pathManager.Combine("difficulty.png"), true)
            {
                Hidden = true
            };

            this.AddChild(textureString);
            this.AddChild(button);
            this.AddChild(disableButton);
        }
Exemple #22
0
        private void factory(int selectnum)
        {
            ImageResource back = new ImageResource("img\\default\\back.png", Device);

            resource.Add("img\\default\\back.png", back);
            background = new PictureObject("img\\default\\back.png", 0, 0, this.resource, Device);
            ImageResource p = new ImageResource("img\\default\\top.png", Device);

            resource.Add("img\\default\\top.png", p);
            PictureObject po = new PictureObject("img\\default\\top.png", 0, 0, resource, Device);

            pictureobjects.Add(po);
            p = new ImageResource("img\\default\\bottom.png", Device);
            resource.Add("img\\default\\bottom.png", p);
            po = new PictureObject("img\\default\\bottom.png", 0, 450 - p.Height, resource, Device);
            pictureobjects.Add(po);
            wave          = new EffectObject("img\\default\\wave.etd", 340, 400, resource, Device);
            wave.PlayType = Effect2D.EffectManager.PlayType.Loop;
            wave.Play();
            modetext   = new StringObject("", 20, 425, 20, new Color4(1, 1, 1, 1), Device, Sprite);
            autotext   = new StringObject("", 670, 5, 15, new Color4(1, 1, 1, 1), Device, Sprite);
            speedtext  = new StringObject("", 200, 5, 30, new Color4(1, 1, 1, 1), Device, Sprite);
            randomtext = new StringObject("", 670, 20, 15, new Color4(1, 1, 1, 1), Device, Sprite);
        }
Exemple #23
0
        public ReviewDialog(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, IReviewManager reviewManager) : base(device)
        {
            this.ReviewManager            = reviewManager;
            reviewManager.ReviewFinished += reviewManager_ReviewFinished;
            this.Sound = sound;
            back       = new EffectObject(device, resourceManager, Utility.Path.Combine("tweetconfirm.etd"))
            {
                Position = new Vector2(400, 225)
            };
            rate = new TextureString(device, String.Format("{0}:", Utility.Language["Evaluate"]), 16, PPDColors.White)
            {
                Position = new Vector2(250, 130)
            };
            content = new TextureString(device, String.Format("{0}:", Utility.Language["ReviewContent"]), 16, PPDColors.White)
            {
                Position = new Vector2(250, 160)
            };
            review = new TextureString(device, "", 16, 300, 100, true, PPDColors.White)
            {
                Position = new Vector2(250, 190)
            };
            processing = new TextureString(device, Utility.Language["Processing"], 16, PPDColors.White)
            {
                Position = new Vector2(400, 300)
            };
            processing.Position = new Vector2(400 - processing.Width / 2, processing.Position.Y);
            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800
            };

            select = new EffectObject(device, resourceManager, Utility.Path.Combine("greenflare.etd"))
            {
                Position = new Vector2(235, 140),
                Scale    = new Vector2(0.5f, 0.5f)
            };
            select.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
            select.Play();

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

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

            stars = new StarObject[5];
            for (int i = 0; i < stars.Length; i++)
            {
                stars[i] = new StarObject(device, resourceManager)
                {
                    Position = new Vector2(420 + i * 30, 130)
                };
                this.AddChild(stars[i]);
            }

            black.Alpha       = 0;
            back.Hidden       = true;
            processing.Hidden = true;
            hiddenList        = new GameComponent[] {
                content,
                rate,
                buttons[0],
                buttons[1],
                stars[0],
                stars[1],
                stars[2],
                stars[3],
                stars[4],
                select,
                review
            };

            foreach (GameComponent hidden in hiddenList)
            {
                hidden.Hidden = true;
            }

            GotFocused  += ReviewDialog_GotFocused;
            LostFocused += ReviewDialog_LostFocused;
            Inputed     += ReviewDialog_Inputed;

            this.AddChild(select);
            this.AddChild(content);
            this.AddChild(rate);
            this.AddChild(review);
            this.AddChild(processing);
            this.AddChild(back);
            this.AddChild(black);

            Rate = 3;
        }
Exemple #24
0
        public void Update(long currentTime)
        {
            if (IsHolding)
            {
                for (int i = 0; i < pressingInfos.Length; i++)
                {
                    if (pressingButtons[i])
                    {
                        var num = (int)((currentTime - pressingInfos[i].PressStartTime) * 60 / 1000);
                        if (num >= 300)
                        {
                            num = 300;
                            if (!IsMaxHolding)
                            {
                                IsMaxHolding = true;
                                maxeffect.Stop();
                                maxeffect.Play();
                                int gain = PressingCount * 1500;
                                maxnumber.Value = (uint)(gain);
                                GainScore(gain);
                                OnHoldMaxHold(new HoldInfo((int)holdnumber.Value, gain, GetPressingMarkTypes()));
                            }
                        }
                        if (num > pressingInfos[i].Count)
                        {
                            var gain = (int)(10 * (num - pressingInfos[i].Count));
                            GainScore(gain);
                            holdnumber.Value      += (uint)gain;
                            pressingInfos[i].Count = num;
                        }
                    }
                }
                OnHoldChange(new HoldInfo((int)holdnumber.Value, 0, GetPressingMarkTypes()));
            }
            holdplus.Position = new Vector2(holdnumber.Position.X - holdnumber.DigitWidth * holdnumber.Value.ToString().Length - holdplus.Width, holdplus.Position.Y);
            maxplus.Position  = new Vector2(maxnumber.Position.X - maxnumber.DigitWidth * maxnumber.Value.ToString().Length - maxplus.Width, maxplus.Position.Y);
            if (IsMaxHolding)
            {
                notMaxBonusCount = 0;
                maxback.Alpha    = (maxHoldFrames++ % 3) == 0 ? 1 : 0.5f;
                maxplus.Alpha    = holdbonus.Alpha = maxnumber.Alpha = 1;
            }
            else
            {
                notMaxBonusCount++;
                if (notMaxBonusCount >= 60)
                {
                    DecreaseAlpha(maxback, 0.1f);
                    DecreaseAlpha(maxplus, 0.1f);
                    DecreaseAlpha(holdbonus, 0.1f);
                    DecreaseAlpha(maxnumber, 0.1f);
                }
            }
            if (isDrawn)
            {
                foreach (PictureObject p in numbers)
                {
                    DecreaseAlpha(p);
                }
                foreach (PictureObject p in bonuses)
                {
                    DecreaseAlpha(p);
                }
                foreach (PictureObject p in marks)
                {
                    DecreaseAlpha(p);
                }

                DecreaseAlpha(holdback);

                DecreaseAlpha(holdplus);

                DecreaseAlpha(holdnumber);
            }
            for (var i = 0; i < bonuses.Length; i++)
            {
                bonuses[i].Hidden = numbers[i].Hidden = true;
            }
            var pressCount = PressingCount;

            if (pressCount > 0)
            {
                bonuses[pressCount - 1].Hidden = numbers[pressCount - 1].Hidden = false;
            }
            Update();
        }
Exemple #25
0
        public override void Load()
        {
            this.dir         = PPDGameUtility.SongInformation.DirectoryPath;
            this.diff        = PPDGameUtility.Difficulty;
            resource         = new Dictionary <string, ImageResource>();
            result           = new EffectObject[6];
            this.updatescore = !PPDGameUtility.Auto && PPDGameUtility.Profile.Index == 0;
            for (int i = 0; i < result.Length; i++)
            {
                string filename = "img\\default\\result\\";
                int    x        = 220;
                int    y        = 74;
                switch ((ResultEvaluateType)i)
                {
                case ResultEvaluateType.Mistake:
                    filename += "mistake";
                    break;

                case ResultEvaluateType.Cheap:
                    filename += "cheap";
                    break;

                case ResultEvaluateType.Standard:
                    filename += "standard";
                    break;

                case ResultEvaluateType.Great:
                    filename += "great";
                    break;

                case ResultEvaluateType.Excellent:
                    filename += "excellent";
                    break;

                case ResultEvaluateType.Perfect:
                    filename += "perfect";
                    break;
                }
                EffectObject anim = new EffectObject(filename + ".etd", x, y, resource, Device);
                anim.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
                anim.Play();
                result[i] = anim;
            }
            string fn = "img\\default\\result\\";

            switch (diff)
            {
            case Difficulty.Easy:
                fn += "easy.png";
                break;

            case Difficulty.Normal:
                fn += "normal.png";
                break;

            case Difficulty.Hard:
                fn += "hard.png";
                break;

            case Difficulty.Extreme:
                fn += "hard.png";
                break;

            default:
                fn += "normal.png";
                break;
            }
            ImageResource temp = new ImageResource(fn, Device);

            resource.Add(fn, temp);
            difficulty      = new PictureObject(fn, 45, 105, resource, Device);
            select          = new EffectObject("img\\default\\difficulty.etd", 444, 332, resource, Device);
            select.PlayType = Effect2D.EffectManager.PlayType.Loop;
            select.Play();
            select.Alignment = EffectObject.EffectAlignment.TopLeft;
            high             = new EffectObject("img\\default\\result\\high.etd", -25, 300, resource, Device);
            high.PlayType    = Effect2D.EffectManager.PlayType.Loop;
            high.Play();
            high.Alignment = EffectObject.EffectAlignment.TopLeft;
            ImageResource pic = new ImageResource("img\\default\\result\\scoresmall.png", Device);

            resource.Add("img\\default\\result\\scoresmall.png", pic);
            scoresmalls = new NumberPictureObject[6];
            for (int i = 0; i < scoresmalls.Length; i++)
            {
                scoresmalls[i] = new NumberPictureObject("img\\default\\result\\scoresmall.png", scorex, scorey[i], NumberPictureObject.Alignment.Right, -1, resource, Device);
            }
            pic = new ImageResource("img\\default\\result\\scorebig.png", Device);
            resource.Add("img\\default\\result\\scorebig.png", pic);
            scorebig = new NumberPictureObject("img\\default\\result\\scorebig.png", scorex, scorey[6], NumberPictureObject.Alignment.Right, -1, resource, Device);
            pic      = new ImageResource("img\\default\\result\\score.png", Device);
            resource.Add("img\\default\\result\\score.png", pic);
            scoreboard = new PictureObject("img\\default\\result\\score.png", 18, 52, resource, Device);
            pic        = new ImageResource("img\\default\\result\\top.png", Device);
            resource.Add("img\\default\\result\\top.png", pic);
            top = new PictureObject("img\\default\\result\\top.png", 0, 0, resource, Device);
            pic = new ImageResource("img\\default\\result\\bottom.png", Device);
            resource.Add("img\\default\\result\\bottom.png", pic);
            bottom = new PictureObject("img\\default\\result\\bottom.png", 0, 405, false, resource, Device);
            pic    = new ImageResource("img\\default\\back.png", Device);
            resource.Add("img\\default\\back.png", pic);
            back = new PictureObject("img\\default\\back.png", 0, 0, resource, Device);
            pic  = new ImageResource("img\\default\\black.png", Device);
            resource.Add("img\\default\\black.png", pic);
            black       = new PictureObject("img\\default\\black.png", 0, 0, resource, Device);
            black.Alpha = 0;
            pic         = new ImageResource("img\\default\\difficulty.png", Device);
            resource.Add("img\\default\\difficulty.png", pic);
            selects = new PictureObject[2];
            for (int i = 0; i < selects.Length; i++)
            {
                PictureObject temppo = new PictureObject("img\\default\\difficulty.png", 520 + i * 130, 372, resource, Device);
                selects[i] = temppo;
            }
            select.Position          = new Vector2(selects[currentselect].Position.X - 4, selects[currentselect].Position.Y - 4);
            songname                 = new StringObject(PPDGameUtility.SongInformation.DirectoryName, 35, 8, 20, 500, new Color4(1, 1, 1, 1), Device, Sprite);
            songname.Position        = new Vector2(790 - songname.JustWidth, songname.Position.Y);
            difficultstring          = new StringObject(PPDGameUtility.DifficultString, 35, 105, 28, new Color4(1, 1, 1, 1), Device, Sprite);
            difficultstring.Position = new Vector2(400 - difficultstring.Width, difficultstring.Position.Y);
            retry      = new StringObject("RETRY", 535, 377, 20, new Color4(1, 1, 1, 1), Device, Sprite);
            retur      = new StringObject("RETURN", 660, 377, 20, new Color4(1, 1, 1, 1), Device, Sprite);
            ResultSet += new EventHandler(GameResult_ResultSet);
        }
Exemple #26
0
        public GameResultScore(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager,
                               PPDGameUtility ppdGameUtility, ISound sound, ITweetManager tweetManager, IReviewManager reviewManager, IGameHost gameHost) : base(device)
        {
            this.ppdGameUtility = ppdGameUtility;
            this.TweetManager   = tweetManager;
            this.ReviewManager  = reviewManager;
            this.Sound          = sound;
            this.gameHost       = gameHost;
            menuRanking         = new MenuRanking(device, resourceManager)
            {
                Position = new Vector2(455, 100)
            };
            td = new TweetDialog(device, resourceManager, sound, tweetManager);
            rd = new ReviewDialog(device, resourceManager, sound, reviewManager);
            this.AddChild(td);
            this.AddChild(rd);
            result = new EffectObject[6];
            for (int i = 0; i < result.Length; i++)
            {
                int x    = 220;
                int y    = 74;
                var anim = new EffectObject(device, resourceManager, Utility.Path.Combine("result", String.Format("{0}.etd", ((ResultEvaluateType)i).ToString().ToLower())))
                {
                    Position = new Vector2(x, y)
                };
                anim.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
                anim.Play();
                result[i] = anim;
            }
            string filename = "";

            switch (ppdGameUtility.Difficulty)
            {
            case Difficulty.Easy:
                filename = "easy.png";
                break;

            case Difficulty.Normal:
                filename = "normal.png";
                break;

            case Difficulty.Hard:
                filename = "hard.png";
                break;

            case Difficulty.Extreme:
                filename = "extreme.png";
                break;

            default:
                filename = "normal.png";
                break;
            }
            difficulty = new PictureObject(device, resourceManager, Utility.Path.Combine("result", filename))
            {
                Position = new Vector2(45, 105)
            };
            high = new EffectObject(device, resourceManager, Utility.Path.Combine("result", "high.etd"))
            {
                Position = new Vector2(-25, 300)
            };
            high.PlayType = Effect2D.EffectManager.PlayType.Loop;
            high.Play();
            high.Alignment = EffectObject.EffectAlignment.TopLeft;
            scoresmalls    = new NumberPictureObject[6];
            for (int i = 0; i < scoresmalls.Length; i++)
            {
                scoresmalls[i] = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("result", "scoresmall.png"))
                {
                    Position  = new Vector2(scorex, scorey[i]),
                    Alignment = Alignment.Right,
                    MaxDigit  = -1
                };
            }
            scorebig = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("result", "scorebig.png"))
            {
                Position  = new Vector2(scorex, scorey[6]),
                Alignment = Alignment.Right,
                MaxDigit  = -1
            };
            scoreboard = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "score.png"))
            {
                Position = new Vector2(18, 52)
            };
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "cool.png"), true)
            {
                Position = new Vector2(105, 108),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "good.png"), true)
            {
                Position = new Vector2(105, 138),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "safe.png"), true)
            {
                Position = new Vector2(105, 168),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "sad.png"), true)
            {
                Position = new Vector2(105, 198),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "worst.png"), true)
            {
                Position = new Vector2(105, 228),
                Scale    = new Vector2(0.75f, 0.75f)
            });
            scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "combo.png"), true)
            {
                Position = new Vector2(105, 258),
                Scale    = new Vector2(0.75f, 0.75f)
            });

            top = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "top.png"));
            top.AddChild(new TextureString(device, Utility.Language["Result"], 20, PPDColors.White)
            {
                Position = new Vector2(70, 2)
            });
            bottom = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "bottom.png"));
            bottom.AddChild(new TextureString(device, Utility.Language["Move"], 16, PPDColors.White)
            {
                Position = new Vector2(587, 21)
            });
            bottom.AddChild(new TextureString(device, Utility.Language["Decide"], 16, PPDColors.White)
            {
                Position = new Vector2(708, 21)
            });
            bottom.Position = new Vector2(0, 450 - bottom.Height + 1);
            black           = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800
            };
            black.Alpha = 0;
            buttons     = new Button[5];
            for (int i = 0; i < buttons.Length; i++)
            {
                string text = "";
                switch (i)
                {
                case 0:
                    text = "TWEET";
                    break;

                case 1:
                    text = "REVIEW";
                    break;

                case 2:
                    text = "RETRY";
                    break;

                case 3:
                    text = "REPLAY";
                    break;

                case 4:
                    text = "RETURN";
                    break;
                }
                Vector2 pos;
                if (i >= 2)
                {
                    pos = new Vector2(500 + ((i - 2) % 3) * 100, 380);
                }
                else
                {
                    pos = new Vector2(500 + (i % 2) * 100, 340);
                }
                buttons[i] = new Button(device, resourceManager, Utility.Path, text)
                {
                    Position = pos
                };
                gridSelection.Add(pos);
                buttons[i].Selected = false;
                this.AddChild(buttons[i]);
            }
            gridSelection.Initialize();
            songname = new TextureString(device, ppdGameUtility.SongInformation.DirectoryName, 20, 500, PPDColors.White)
            {
                Position = new Vector2(35, 4)
            };
            songname.Position = new Vector2(790 - songname.JustWidth, songname.Position.Y);
            difficultstring   = new TextureString(device, ppdGameUtility.DifficultString, 24, 200, PPDColors.White)
            {
                Position    = new Vector2(35, 103),
                AllowScroll = true
            };
            difficultstring.Position = new Vector2(400 - Math.Min(200, difficultstring.Width), difficultstring.Position.Y);

            bgd = new BackGroundDisplay(device, resourceManager, "skins\\PPDSingle_BackGround.xml", "Result");

            Inputed    += GameResultScore_Inputed;
            GotFocused += GameResultScore_GotFocused;

            this.AddChild(menuRanking);
            this.AddChild(high);
            this.AddChild(difficulty);
            for (int i = 0; i < result.Length; i++)
            {
                this.AddChild(result[i]);
            }
            for (int i = 0; i < scoresmalls.Length; i++)
            {
                this.AddChild(scoresmalls[i]);
            }
            this.AddChild(scorebig);
            this.AddChild(difficultstring);
            this.AddChild(scoreboard);
            this.AddChild(songname);
            this.AddChild(top);
            this.AddChild(bottom);
            this.AddChild(bgd);

            this.InsertChild(black, 0);
        }
Exemple #27
0
        public PlayRecord(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.sound           = sound;
            this.resourceManager = resourceManager;

            graphNameStrings = new string[] { Utility.Language["Score"], "Cool", "Good", "Safe", "Sad", "Worst", "MaxCombo", Utility.Language["FinishTime"] };

            back = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "back.png"));
            back.AddChild(new TextureString(device, Utility.Language["PlayRecord"], 20, PPDColors.White)
            {
                Position = new Vector2(30, 28)
            });
            top = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "recordtop.png"))
            {
                Position = new Vector2(440, 70)
            };
            top.AddChild(new TextureString(device, Utility.Language["Difficulty"], 14, true, PPDColors.White)
            {
                Position = new Vector2(33, 4)
            });
            top.AddChild(new TextureString(device, Utility.Language["Score"], 14, true, PPDColors.White)
            {
                Position = new Vector2(105, 4)
            });
            top.AddChild(new TextureString(device, Utility.Language["Result"], 14, true, PPDColors.White)
            {
                Position = new Vector2(181, 4)
            });
            top.AddChild(new TextureString(device, Utility.Language["PlayDate"], 14, true, PPDColors.White)
            {
                Position = new Vector2(269, 4)
            });
            bottom = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "recordbottom.png"))
            {
                Position = new Vector2(440, 364)
            };
            triangle = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "triangle.png"), true)
            {
                Position = new Vector2(300, 410),
                Hidden   = true
            };
            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            };
            cursor = new EffectObject(device, resourceManager, Utility.Path.Combine("playrecord", "cursor.etd"))
            {
                PlayType = Effect2D.EffectManager.PlayType.ReverseLoop
            };
            cursor.Play();

            cool = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(510, 369)
            };
            good = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(510, 388)
            };
            safe = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(510, 409)
            };
            sad = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(705, 369)
            };
            worst = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(705, 388)
            };
            maxCombo = new TextureString(device, "", 14, PPDColors.White)
            {
                Position = new Vector2(705, 409)
            };

            songname = new TextureString(device, "", 20, PPDColors.White)
            {
                Position = new Vector2(250, 30)
            };

            difficulty          = new TextureString(device, "Easy", 20, PPDColors.White);
            difficulty.Position = new Vector2(240 - difficulty.Width / 2, 80 - difficulty.CharacterHeight / 2);

            gd = new GraphDrawer(device, resourceManager)
            {
                Position           = new Vector2(30, 120),
                GraphWidth         = 390,
                Name               = Utility.Language["Score"],
                NamePositionCenter = new Vector2(220, 285)
            };

            sprite = new SpriteObject(device)
            {
                Position = new Vector2(440, 98)
            };

            rectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth  = 314,
                RectangleHeight = 16,
                BorderThickness = 2
            };

            Inputed    += PlayRecord_Inputed;
            GotFocused += PlayRecord_GotFocused;

            this.AddChild(cursor);
            this.AddChild(gd);
            this.AddChild(difficulty);
            this.AddChild(songname);
            this.AddChild(cool);
            this.AddChild(good);
            this.AddChild(safe);
            this.AddChild(sad);
            this.AddChild(worst);
            this.AddChild(maxCombo);
            this.AddChild(triangle);
            this.AddChild(top);
            this.AddChild(bottom);
            this.AddChild(rectangle);
            this.AddChild(sprite);
            this.AddChild(back);
            this.AddChild(black);
        }
Exemple #28
0
        void LeftMenu_GotFocused(IFocusable sender, FocusEventArgs args)
        {
            if (!initialized)
            {
                back          = new PictureObject(device, resourceManager, Utility.Path.Combine("leftmenu.png"));
                width         = (int)back.Width;
                this.Position = new Vector2(-width, 0);

                sm               = new ScoreManager(device, resourceManager, textBox, sound, ssm.Filter);
                pr               = new PlayRecord(device, resourceManager, sound);
                mp               = new ModPanel(device, gameHost, resourceManager, sound);
                mp.LostFocused  += mp_LostFocused;
                fc               = new FilterControl(device, resourceManager, sound, ssm.Filter);
                fc.Changed      += fc_Changed;
                usc              = new UpdateScoreControl(device, resourceManager, sound);
                usc.LostFocused += usc_LostFocused;
                ilc              = new ItemListComponent(device, gameHost, resourceManager, sound);
                rlc              = new ReplayListComponent(device, gameHost, resourceManager, sound);

                updateScore = new TextureString(device, Utility.Language["UpdateScore"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 100)
                };
                filter = new TextureString(device, Utility.Language["Filter"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 130)
                };
                scoreManage = new TextureString(device, Utility.Language["ScoreManager"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 160)
                };
                playRecord = new TextureString(device, Utility.Language["PlayRecord"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 190)
                };
                replay = new TextureString(device, Utility.Language["Replay"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 220)
                };
                randomSelect = new MultiSelectableText(device, gameHost, resourceManager, Utility.Language["Random"],
                                                       new string[] { Utility.Language["InAll"], Utility.Language["InList"] }, 16)
                {
                    Position = new Vector2(30, 250)
                };
                randomSelect.Selected += randomSelect_Selected;
                itemList = new TextureString(device, Utility.Language["ItemList"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 280)
                };
                updateScoreDB = new TextureString(device, Utility.Language["UpdateDB"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 310)
                };
                mod = new TextureString(device, Utility.Language["Mod"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 340)
                };
                finish = new TextureString(device, Utility.Language["Exit"], 16, PPDColors.White)
                {
                    Position = new Vector2(30, 370)
                };

                select = new EffectObject(device, resourceManager, Utility.Path.Combine("greenflare.etd"))
                {
                    Position = new Vector2(15, scoreManage.Position.Y + selectDiffY)
                };
                select.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
                select.Play();
                select.Alignment = EffectObject.EffectAlignment.Center;
                select.Scale     = new Vector2(0.4f, 0.4f);

                this.AddChild(usc);
                this.AddChild(sm);
                this.AddChild(pr);
                this.AddChild(mp);
                this.AddChild(fc);
                this.AddChild(ilc);
                this.AddChild(rlc);
                this.AddChild(scoreUpdateCountBack);
                this.AddChild(modUpdateCountBack);
                this.AddChild(updateScore);
                this.AddChild(filter);
                this.AddChild(randomSelect);
                this.AddChild(scoreManage);
                this.AddChild(playRecord);
                this.AddChild(replay);
                this.AddChild(itemList);
                this.AddChild(updateScoreDB);
                this.AddChild(mod);
                this.AddChild(finish);
                this.AddChild(select);
                this.AddChild(back);
                initialized = true;
            }
            PlayRecordAvailable = ssm.SelectedSongInformation != null && ssm.SelectedSongInformation.SongInfo != null && !ssm.SelectedSongInformation.IsFolder;
        }
Exemple #29
0
        public override void Update()
        {
            if (holding && !IsPaused)
            {
                long currentTime = Win32API.timeGetTime();
                for (int i = 0; i < pressingInfos.Length; i++)
                {
                    if (pressingButtons[i])
                    {
                        int num = (int)((currentTime - pressingInfos[i].PressStartTime) * 60 / 1000);
                        if (num > 300)
                        {
                            num = 300;
                            if (!maxbonus)
                            {
                                maxbonus = true;
                                maxeffect.Stop();
                                maxeffect.Play();
                                int gain = PressingCount * 1500;
                                maxnumber.Value = (uint)(gain);
                                GainScore(gain);
                            }
                        }
                        if (num > pressingInfos[i].Count)
                        {
                            int gain = (int)(10 * (num - pressingInfos[i].Count));
                            GainScore(gain);
                            holdnumber.Value      += (uint)gain;
                            pressingInfos[i].Count = num;
                        }
                    }
                }
            }
            holdplus.Position = new Vector2(holdnumber.Position.X - holdnumber.DigitWidth * holdnumber.Value.ToString().Length - holdplus.Width, holdplus.Position.Y);
            maxplus.Position  = new Vector2(maxnumber.Position.X - maxnumber.DigitWidth * maxnumber.Value.ToString().Length - maxplus.Width, maxplus.Position.Y);
            if (maxbonus)
            {
                maxback.Hidden = !maxback.Hidden;
            }
            if (Hidden)
            {
                foreach (PictureObject p in numbers)
                {
                    DecreaseAlpha(p);
                }
                foreach (PictureObject p in bonuses)
                {
                    DecreaseAlpha(p);
                }
                foreach (PictureObject p in marks)
                {
                    DecreaseAlpha(p);
                }

                DecreaseAlpha(holdback);
                DecreaseAlpha(maxback);

                DecreaseAlpha(holdplus);
                DecreaseAlpha(maxplus);
                DecreaseAlpha(holdbonus);

                DecreaseAlpha(holdnumber);
                DecreaseAlpha(maxnumber);
            }
            base.Update();
        }
Exemple #30
0
        public LeftMenu(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager,
                        ISound sound, MovieManager movieManager, User user, ChangableList <User> users, AllowedModList allowedModList) : base(device)
        {
            this.gameHost        = gameHost;
            this.resourceManager = resourceManager;
            this.sound           = sound;
            this.movieManager    = movieManager;
            this.user            = user;
            this.users           = users;
            this.allowedModList  = allowedModList;

            this.AddChild(songSelectSprite  = new SpriteObject(device));
            this.AddChild(gameRuleSprite    = new SpriteObject(device));
            this.AddChild(userSelectSprite  = new SpriteObject(device));
            this.AddChild(itemSettingSprite = new SpriteObject(device));
            this.AddChild(modSprite         = new SpriteObject(device));
            this.AddChild(leftSprite        = new SpriteObject(device));
            leftSprite.AddChild(back        = new PictureObject(device, resourceManager, Utility.Path.Combine("leftmenu.png")));

            enables = new bool[] {
                false,
                false,
                false,
                true,
                true,
                true,
                true,
                true,
                true,
                true,
                true
            };

            user.PropertyChanged += (name) =>
            {
                if (name == "IsLeader")
                {
                    enables[0] = enables[1] = enables[2] = user.IsLeader;
                    if (!user.IsLeader)
                    {
                        if (mode >= Mode.SongSelect && mode <= Mode.UserManage)
                        {
                            mode = Mode.ItemSetting;
                        }
                    }
                    (back[0] as TextureString).Color = GetTextColor(0);
                    (back[1] as TextureString).Color = GetTextColor(1);
                    (back[2] as TextureString).Color = GetTextColor(2);
                }
            };

            back.AddChild(new TextureString(device, Utility.Language["ChangeScore"], 16, GetTextColor())
            {
                Position = new Vector2(30, 70)
            });
            back.AddChild(new TextureString(device, Utility.Language["ChangeRule"], 16, GetTextColor())
            {
                Position = new Vector2(30, 100)
            });
            back.AddChild(new TextureString(device, Utility.Language["PlayerManager"], 16, GetTextColor())
            {
                Position = new Vector2(30, 130)
            });
            back.AddChild(new TextureString(device, Utility.Language["ItemUseSetting"], 16, GetTextColor())
            {
                Position = new Vector2(30, 160)
            });
            back.AddChild(new TextureString(device, Utility.Language["TryToPlayGame"], 16, GetTextColor())
            {
                Position = new Vector2(30, 190)
            });
            back.AddChild(new TextureString(device, String.Format("{0}:{1}", Utility.Language["MuteSE"], Utility.Language["OFF"]), 16, GetTextColor())
            {
                Position = new Vector2(30, 220)
            });
            back.AddChild(new TextureString(device, String.Format("{0}:{1}", Utility.Language["Connect"], Utility.Language["OFF"]), 16, GetTextColor())
            {
                Position = new Vector2(30, 250)
            });
            back.AddChild(new TextureString(device, Utility.Language["Result"], 16, GetTextColor())
            {
                Position = new Vector2(30, 280)
            });
            back.AddChild(new TextureString(device, Utility.Language["UpdateDB"], 16, GetTextColor())
            {
                Position = new Vector2(30, 310)
            });
            back.AddChild(new TextureString(device, Utility.Language["Mod"], 16, GetTextColor())
            {
                Position = new Vector2(30, 340)
            });
            back.AddChild(new TextureString(device, user.IsHost ? Utility.Language["FinishHost"] : Utility.Language["LeaveRoom"], 16, GetTextColor())
            {
                Position = new Vector2(30, 370)
            });
            Connect = SkinSetting.Setting.Connect;
            (back[(int)Mode.Connect] as TextureString).Text = String.Format("{0}:{1}", Utility.Language["Connect"], Connect ? Utility.Language["ON"] : Utility.Language["OFF"]);

            mode = Mode.ItemSetting;

            select = new EffectObject(device, resourceManager, Utility.Path.Combine("greenflare.etd"))
            {
                Position = new Vector2(15, back[(int)mode].Position.Y + selectDiffY)
            };
            select.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
            select.Play();
            select.Alignment = EffectObject.EffectAlignment.Center;
            select.Scale     = new Vector2(0.4f, 0.4f);

            back.AddChild(select);

            leftSprite.Position = new Vector2(-back.Width, 0);

            Inputed += LeftMenu_Inputed;
        }