Ejemplo n.º 1
0
        public override void Load()
        {
            OnLoadProgressed(0);
            var temp = new SpriteObject(device);

            OnLoadProgressed(10);
            this.AddChild((controllerSprite = new SpriteObject(device)));
            movieController = new MovieController(device, resourceManager, null);
            controllerSprite.AddChild(movieController);
            OnLoadProgressed(20);
            this.AddChild(temp);
            OnLoadProgressed(30);
            temp.AddChild((selection = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth = 180, RectangleHeight = 100, Position = new SharpDX.Vector2(10, 190)
            }));
            OnLoadProgressed(50);
            temp.AddChild((thumbSprite = new SpriteObject(device)));
            OnLoadProgressed(60);
            temp.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("leftmenu.png"))
            {
                Alpha = 0.5f, Scale = new SharpDX.Vector2(1.2f, 1)
            });
            OnLoadProgressed(80);
            this.AddChild((movieSprite = new SpriteObject(device)));
            OnLoadProgressed(90);

            GotFocused += MoviePanel_GotFocused;
            Inputed    += MoviePanel_Inputed;
            OnLoadProgressed(100);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 3
0
        public void AddUser(UserPlayState userPlayState)
        {
            var playUserIcon = new PlayUserIcon(device, resourceManager, userPlayState)
            {
                Position = new SharpDX.Vector2(0, ChildrenCount * ItemHeight)
            };

            iconSprite.AddChild(playUserIcon);
        }
Ejemplo n.º 4
0
        public ReplayListComponent(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.gameHost        = gameHost;
            this.resourceManager = resourceManager;
            this.sound           = sound;
            PictureObject back;

            waitSprite = new SpriteObject(device)
            {
                Hidden = true
            };
            this.AddChild(waitSprite);
            waitSprite.AddChild(new TextureString(device, Utility.Language["LoadingReplays"], 20, true, PPDColors.White)
            {
                Position = new Vector2(400, 220)
            });
            waitSprite.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            });
            rectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                Hidden          = true,
                RectangleWidth  = 700,
                RectangleHeight = ItemHeight
            };
            this.AddChild(rectangle);
            mainSprite = new SpriteObject(device)
            {
                Position = new Vector2(50, SpriteY),
                Clip     = new ClipInfo(gameHost)
                {
                    PositionX = 40,
                    PositionY = ClipY,
                    Width     = 750,
                    Height    = ClipHeight
                }
            };
            this.AddChild(mainSprite);
            this.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.80f
            });
            back.AddChild(new TextureString(device, Utility.Language["ReplayList"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            Inputed    += ReplayListComponent_Inputed;
            GotFocused += ReplayListComponent_GotFocused;
        }
Ejemplo n.º 5
0
 public BezierDrawer(Control control) : base(PPDExecuteArg.Empty, control)
 {
     InitializeDirectX(control.Width, control.Height, control.Width, control.Height, 1);
     Initialize();
     ResourceManager = new ResourceManager();
     spriteObject    = new SpriteObject(device);
     spriteObject.AddChild(DrawTarget = new SpriteObject(device));
     spriteObject.AddChild(Background = new SpriteObject(device));
     spriteObject.AddChild(back       = new RectangleComponent(device, ResourceManager, PPDColors.White)
     {
         RectangleHeight = control.Height,
         RectangleWidth  = control.Width
     });
 }
Ejemplo n.º 6
0
        void slideSprite_Selected(object sender, EventArgs e)
        {
            var slideSprite = sender as SlideSprite;

            switch (slideSprite.CurrentSelection)
            {
            case 0:
                GameHost.Exit();
                break;

            case 1:
                GameHost.CancelExit();
                break;

            case 2:
                currentIndex++;
                RemoveNext();

                var keyButtonSprite = new SlideSprite(device, ResourceManager, Sound)
                {
                    Position = new SharpDX.Vector2(800 * currentIndex, 0)
                };
                keyButtonSprite.Selected    += keyButtonSprite_Selected;
                keyButtonSprite.LostFocused += slideSprite_LostFocused;
                keyButtonSprite.AddSelection(Utility.Language["ChangeCurrentController"]);
                keyButtonSprite.AddSelection(Utility.Language["ChangeCurrentSetting"]);
                allSlideSprite.AddChild(keyButtonSprite);
                focusManager.Focus(keyButtonSprite);
                break;

            case 3:
                currentIndex++;
                RemoveNext();

                var changeVolumeSprite = new ChangeVolumeSprite(device, ResourceManager, myGame, Sound)
                {
                    Position = new SharpDX.Vector2(800 * currentIndex, 0)
                };
                changeVolumeSprite.LostFocused += slideSprite_LostFocused;
                allSlideSprite.AddChild(changeVolumeSprite);
                focusManager.Focus(changeVolumeSprite);
                break;

            case 4:
                GameHost.GoHome();
                break;
            }
        }
Ejemplo n.º 7
0
        public override bool Load()
        {
            myGame = GameHost as MyGame;

            this.AddChild((allSlideSprite = new SpriteObject(device)));

            firstSprite = new SlideSprite(device, ResourceManager, Sound)
            {
                FirstSlide = true
            };

            firstSprite.AddSelection(Utility.Language["Exit"]);
            firstSprite.AddSelection(Utility.Language["Back"]);
            firstSprite.AddSelection(Utility.Language["KeyAndButtonSetting"]);
            firstSprite.AddSelection(Utility.Language["VolumeSetting"]);
            firstSprite.AddSelection(Utility.Language["GoHome"]);

            allSlideSprite.AddChild(firstSprite);

            focusManager = new FocusManager();
            focusManager.Focus(firstSprite);

            firstSprite.Selected += slideSprite_Selected;
            this.MouseRightClick += CloseOverlay_MouseRightClick;

            this.AddChild(new RectangleComponent(device, ResourceManager, PPDColors.Black)
            {
                Alpha           = 0.65f,
                RectangleHeight = 450,
                RectangleWidth  = 800
            });
            return(true);
        }
Ejemplo n.º 8
0
        public UserSelectComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, ChangableList <User> users) : base(device)
        {
            this.resourceManager = resourceManager;
            this.sound           = sound;
            this.AddChild(back   = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            back.AddChild(new TextureString(device, Utility.Language["PlayerManager"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });
            back.AddChild(userSprite = new SpriteObject(device)
            {
                Position = new Vector2(40, 80)
            });
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.75f
            });

            Inputed    += ItemSettingComponent_Inputed;
            GotFocused += ItemSettingComponent_GotFocused;

            foreach (var user in users)
            {
                if (user.IsSelf)
                {
                    continue;
                }
                userSprite.AddChild(new UserComponent(device, resourceManager, user));
            }
            AdjustPosition();
            users.ItemChanged += users_ItemChanged;
        }
Ejemplo n.º 9
0
        public void AddItem()
        {
            if (queue.Count < MaxItemCount)
            {
                var r    = new Random();
                var rand = r.Next(0, itemWeight[itemWeight.Length - 1] + 1);

                int index = -1;
                for (int i = 0; i < itemWeight.Length; i++)
                {
                    if (rand <= itemWeight[i])
                    {
                        index = i;
                        break;
                    }
                }

                if (index >= 0)
                {
                    itemSprite.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("item", String.Format("{0}.png", (ItemType)(index + 1))), true)
                    {
                        Position = new Vector2(11 + queue.Count * 19, 11),
                        Scale    = new Vector2(0),
                        Alpha    = 0
                    });
                    queue.Add((ItemType)(index + 1));
                }
                else
                {
                    // error
                    Console.WriteLine("Error");
                }
            }
        }
Ejemplo n.º 10
0
        public override bool Load()
        {
            this.AddChild((allSlideSprite = new SpriteObject(device)));

            LoadLastCreatedRoom();

            firstSprite = new SlideSprite(device, ResourceManager, Sound)
            {
                FirstSlide = true
            };

            firstSprite.AddSelection(Utility.Language["CreateRoom"]);
            firstSprite.AddSelection(Utility.Language["EnterRoom"]);
            firstSprite.AddSelection(Utility.Language["WaitPlayerAsHost"]);
            firstSprite.AddSelection(Utility.Language["ConnectToHost"]);

            allSlideSprite.AddChild(firstSprite);

            focusManager = new FocusManager();
            focusManager.Focus(firstSprite);

            this.AddChild(new PictureObject(device, ResourceManager, Utility.Path.Combine("background.png")));

            firstSprite.Selected += slideSprite_Selected;

            return(true);
        }
Ejemplo n.º 11
0
        public ConfirmControl(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
        {
            state   = State.notappeared;
            confirm = new EffectObject(device, resourceManager, Utility.Path.Combine("confirm.etd"))
            {
                Position = new Vector2(400, 225)
            };
            confirm.Finish += confirm_Finish;
            black           = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0
            };
            sprite   = new SpriteObject(device);
            songname = new TextureString(device, "", 20, 210, PPDColors.White)
            {
                Position = new Vector2(400, 150)
            };
            difficulty = new TextureString(device, "", 20, true, PPDColors.White)
            {
                Position = new Vector2(400, 190)
            };

            this.AddChild(sprite);
            sprite.AddChild(songname);
            sprite.AddChild(difficulty);
            sprite.AddChild(new TextureString(device, Utility.Language["IsGoingToBePlayed"], 20, true, PPDColors.White)
            {
                Position = new Vector2(400, 230)
            });
            sprite.AddChild(new TextureString(device, Utility.Language["Yes"], 20, true, PPDColors.White)
            {
                Position = new Vector2(352, 262)
            });
            sprite.AddChild(new TextureString(device, Utility.Language["No"], 20, true, PPDColors.White)
            {
                Position = new Vector2(466, 262)
            });
            this.AddChild(confirm);
            this.AddChild(black);
        }
Ejemplo n.º 12
0
        public override bool Load()
        {
            SpriteObject sprite;

            AddChild(sprite = new SpriteObject(device)
            {
                Position = new SharpDX.Vector2(100, 100),
                Alpha    = 0.5f
            });
            sprite.AddChild(new PictureObject(device, ResourceManager, Utility.Path.Combine("confirm.png"))
            {
                Position = new SharpDX.Vector2(100, 100),
                Alpha    = 0.5f
            });
            sprite.AddChild(new TextureString(device, "AAAAAAAAAAAAAAAAAA", 20, 200, PPDColors.White)
            {
                Position = new Vector2(0, 200)
            });
            return(true);
        }
Ejemplo n.º 13
0
        private void ChangeResultTableDifficulty()
        {
            currentDifficultyRecults.Clear();
            sprite.ClearChildren();
            for (int i = 0; i < results.Length; i++)
            {
                if (selectedDifficulty == results[i].Difficulty)
                {
                    currentDifficultyRecults.Add(results[i]);
                }
            }

            int iter = 0;

            foreach (PPDFramework.ResultInfo result in currentDifficultyRecults)
            {
                var tempSprite = new SpriteObject(device)
                {
                    Position = new Vector2(0, iter * 19)
                };
                tempSprite.AddChild(new TextureString(device, result.Difficulty.ToString(), 12, true, PPDColors.White)
                {
                    Position = new Vector2(35, 2)
                });
                tempSprite.AddChild(new TextureString(device, String.Format("{0:D7}", result.Score), 12, true, PPDColors.White)
                {
                    Position = new Vector2(105, 2)
                });
                tempSprite.AddChild(new TextureString(device, result.ResultEvaluate.ToString(), 12, true, PPDColors.White)
                {
                    Position = new Vector2(180, 2)
                });
                tempSprite.AddChild(new TextureString(device, result.Date.ToShortDateString(), 12, true, PPDColors.White)
                {
                    Position = new Vector2(270, 2)
                });
                tempSprite.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "recordcontent.png")));
                sprite.AddChild(tempSprite);
            }
        }
Ejemplo n.º 14
0
            public UserMenuDialog(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
            {
                this.resourceManager = resourceManager;

                this.AddChild(new TextureString(device, Utility.Language["Menu"], 14, PPDColors.White)
                {
                    Position = new Vector2(10, 7)
                });
                this.AddChild(textSprite = new SpriteObject(device)
                {
                    Position = new Vector2(5, 35)
                });
                this.AddChild(selectRectangle = new RectangleComponent(device, resourceManager, PPDColors.White)
                {
                    RectangleWidth  = 100,
                    RectangleHeight = 22
                });
                this.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("small_dialog_back.png")));
                this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
                {
                    RectangleWidth  = back.Width,
                    RectangleHeight = back.Height,
                    Alpha           = 0.75f
                });

                textSprite.AddChild(new TextureString(device, Utility.Language["ChangeLeader"], 16, 80, PPDColors.White)
                {
                    Position = new Vector2(10, 0)
                });
                textSprite.AddChild(new TextureString(device, Utility.Language["KickPlayer"], 16, 80, PPDColors.White)
                {
                    Position = new Vector2(10, 25)
                });
                index = 0;

                ChangeSelect();

                Inputed += DifficultyDialog_Inputed;
            }
Ejemplo n.º 15
0
 public void AddMenu(MenuItem menuItem)
 {
     menuSprite.AddChild(menuItem);
     if (menuSprite.ChildrenCount == 1)
     {
         menuItem.Selected = true;
     }
     else
     {
         menuItem.Selected = false;
     }
     menuItem.Position = new Vector2(0, (menuSprite.ChildrenCount - 1) * 22);
 }
Ejemplo n.º 16
0
 public override void Initialize(CreateMarkFunc createMark, GetScriptAllowedButtonsFunc getScriptAllowedButtons)
 {
     base.Initialize(createMark, getScriptAllowedButtons);
     if (!isMarkCreated)
     {
         var markIndex = -1;
         markIndex = this.IndexOf(mark);
         this.RemoveChild(mark);
         mark.Dispose();
         mark = new SpriteObject(device)
         {
             Scale = Vector2.Zero
         };
         filenames.GetHoldInfo(out PathObject fn, out float x, out float y);
         mark.AddChild(new PictureObject(device, resourceManager, fn, true)
         {
             Position = new Vector2(x, y)
         });
         mark.AddChild(new PictureObject(device, resourceManager, filenames.GetMarkImagePath(ButtonType), true));
         this.InsertChild(mark, markIndex);
     }
 }
Ejemplo n.º 17
0
 public void ChangeData(Vector2[] positions, float[] angles)
 {
     positionSprite.ClearChildren();
     angleSprite.ClearChildren();
     for (var i = 0; i < positions.Length; i++)
     {
         positionSprite.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "circle.png"), true)
         {
             Position = positions[i]
         });
         angleSprite.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "arrow.png"), true)
         {
             Rotation = -angles[i],
             Position = positions[i]
         });
         var str = $"{i + 1}";
         positionSprite.AddChild(new TextureString(device, str, FontHeight, PPDColors.Black)
         {
             Position = positions[i] - new Vector2(FontHeight * str.Length / 4, FontHeight / 2)
         });
     }
 }
Ejemplo n.º 18
0
        public void AddSelection(string text)
        {
            var textureString = new TextureString(device, text, 18, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 0)
            };

            textureString.MouseEnter     += textureString_MouseEnter;
            textureString.MouseLeftClick += textureString_MouseLeftClick;
            textSprite.AddChild(textureString);
            modified = true;
            menuEnabled.Add(true);
            selectCount++;
            currentIndex = 0;
        }
Ejemplo n.º 19
0
        public void CreateOnpu(int num)
        {
            var r = new Random();

            for (int i = 0; i < num; i++)
            {
                var po    = new OnpuObject(device, resourceManager, Utility.Path.Combine("lifegage", "onpu", String.Format("{0}.png", r.Next(1, 6))), 5 + i * 3, 12, true);
                var scale = (float)(r.NextDouble() / 2 + 0.5);
                po.Scale = new Vector2(scale, scale);
                var rotation = (float)((r.NextDouble() - 0.5) * Math.PI / 8);
                po.Rotation = rotation;
                po.VelX     = (float)((r.NextDouble() + 0.5) * 2);
                onpus.Add(po);
                onpuSprite.AddChild(po);
            }
        }
Ejemplo n.º 20
0
        public static void UpdateButton(LoadScreen __instance, ref SpriteObject ____creditsButton)
        {
            if (!BaseHunieModPlugin.newVersionAvailable)
            {
                return;
            }
            SpriteObject spr = GameUtil.ImageFileToSprite("update.png", "updatesprite");

            if (spr != null)
            {
                ____creditsButton.SetLightness(0f);
                ____creditsButton.AddChild(spr);

                updateSprite = ____creditsButton.GetChildren(true)[____creditsButton.GetChildren().Length - 1] as SpriteObject;
                updateSprite.SetLocalPosition(-83, 24);
                updateSprite.SetOwnChildIndex(3);
                updateSprite.spriteAlpha = 0f;
            }
        }
Ejemplo n.º 21
0
        public MenuSelectSong(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, Menu menu) : base(device)
        {
            this.menu      = menu;
            state          = State.NotAppeared;
            pictureobjects = new ArrayList();

            mode = new PictureObject(device, resourceManager, Utility.Path.Combine("modeselect.png"))
            {
                Position = new Vector2(-10, 20)
            };
            modeStringLeft = new TextureString(device, Utility.Language["List"], 16, true, PPDColors.Gray)
            {
                Position = new Vector2(50, 25)
            };
            modeStringCenter = new TextureString(device, Utility.Language["Score"], 16, true, PPDColors.White)
            {
                Position = new Vector2(170, 25)
            };
            modeStringRight = new TextureString(device, Utility.Language["Link"], 16, true, PPDColors.Gray)
            {
                Position = new Vector2(290, 25)
            };
            songNameSprite = new SpriteObject(device)
            {
                Position = new Vector2(0, ItemsDefaultY)
            };
            songNames = new SongNameComponent[ItemCount];
            for (var i = 0; i < songNames.Length; i++)
            {
                songNames[i] = new SongNameComponent(device, resourceManager, i == (ItemCount / 2))
                {
                    Position  = new Vector2(0, (SongNameComponent.ItemHeight + 5) * i + (i > (ItemCount / 2) ? 10 : 0)),
                    ItemAlpha = (float)1 / (Math.Abs(i - (ItemCount / 2)) + 1)
                };
                songNameSprite.AddChild(songNames[i]);
            }
            this.AddChild(songNameSprite);

            this.AddChild(modeStringLeft);
            this.AddChild(modeStringCenter);
            this.AddChild(modeStringRight);
            this.AddChild(mode);
        }
Ejemplo n.º 22
0
        public override void Load()
        {
            OnLoadProgressed(0);
            this.AddChild((allSlideSprite = new SpriteObject(device)));
            OnLoadProgressed(10);
            firstSprite = new SlideSprite(device, resourceManager, sound)
            {
                FirstSlide = true
            };
            OnLoadProgressed(40);
            firstSprite.AddSelection(Utility.Language["KeyAndButtonSetting"]);
            OnLoadProgressed(60);
            firstSprite.AddSelection(Utility.Language["AccountSetting"]);
            firstSprite.AddSelection(Utility.Language["VolumeSetting"]);
            allSlideSprite.AddChild(firstSprite);
            OnLoadProgressed(90);

            firstSprite.Selected += slideSprite_Selected;
            GotFocused           += SettingPanel_GotFocused;
            OnLoadProgressed(100);
        }
Ejemplo n.º 23
0
        public ChatComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, IGameHost gameHost) : base(device)
        {
            this.resourceManager = resourceManager;
            this.gameHost        = gameHost;

            SpriteObject scrollSprite;

            this.AddChild((messageSprite = new SpriteObject(device)
            {
                Clip = new ClipInfo(gameHost)
                {
                    PositionX = 450,
                    PositionY = 0,
                    Width = 340,
                    Height = 374
                }
            }));
            this.AddChild(scrollSprite = new SpriteObject(device)
            {
                Position = new Vector2(352, 5)
            });
            scrollSprite.AddChild((scrollBar = new PictureObject(device, resourceManager, Utility.Path.Combine("chat_scrollbar.png"))));
            this.AddChild((back = new PictureObject(device, resourceManager, Utility.Path.Combine("chat_back.png"))));
        }
Ejemplo n.º 24
0
        public ModSettingPanel(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, ModInfo modInfo) : base(device)
        {
            this.gameHost        = gameHost;
            this.sound           = sound;
            this.resourceManager = resourceManager;
            this.modInfo         = modInfo;

            back  = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png"));
            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            };
            back.AddChild(new TextureString(device, String.Format("{0}-{1}", Utility.Language["ModSetting"], modInfo.FileName), 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });
            StackObject stackObject;

            back.AddChild(stackObject = new StackObject(device,
                                                        new StackObject(device,
                                                                        new SpaceObject(device, 0, 2),
                                                                        new PictureObject(device, resourceManager, Utility.Path.Combine("circle.png")))
            {
                IsHorizontal = false
            },
                                                        new TextureString(device, String.Format(":{0}", Utility.Language["ChangeSetting"]), 18, PPDColors.White))
            {
                IsHorizontal = true
            });
            stackObject.Update();
            stackObject.Position = new Vector2(760 - stackObject.Width, 50);

            settingSprite = new SpriteObject(device)
            {
                Position = new Vector2(50, SpriteY)
            };
            settingSprite.AddChild(settingListSprite = new SpriteObject(device)
            {
                Clip = new ClipInfo(gameHost)
                {
                    PositionX = 40,
                    PositionY = ClipY,
                    Width     = 750,
                    Height    = ClipHeight
                }
            });

            float height = 0;

            foreach (ModSetting modSetting in modInfo.Settings)
            {
                var component = new ModSettingComponent(device, resourceManager, modSetting,
                                                        modSetting.GetStringValue(modInfo.ModSettingManager[modSetting.Key]))
                {
                    Position = new Vector2(0, height)
                };
                component.Update();
                settingListSprite.AddChild(component);
                height += component.Height + 10;
            }
            CurrentComponent.IsSelected = true;

            settingSprite.AddChild(rectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                RectangleWidth  = 700,
                RectangleHeight = 100
            });

            this.AddChild(settingSprite);
            this.AddChild(back);
            this.AddChild(black);

            UpdateBorderPosition(true);

            Inputed += ModSettingPanel_Inputed;
        }
Ejemplo n.º 25
0
        public StartPanel(PPDDevice device, MyGame myGame, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
        {
            this.myGame          = myGame;
            this.resourceManager = resourceManager;

            contentSprite = new SpriteObject(device);
            this.AddChild(contentSprite);

            var sprite = new SpriteObject(device);

            sprite.AddChild(new TextureString(device, Utility.Language["WelcomeToPPD"], 20, true, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 200)
            });
            sprite.AddChild(new TextureString(device, Utility.Language["StartInitialSetting"], 16, true, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 240)
            });
            Add(sprite);

            sprite = new SpriteObject(device);
            sprite.AddChild(new TextureString(device, Utility.Language["StartKeyButtonSetting"], 20, true, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 200)
            });
            sprite.AddChild(new TextureString(device, Utility.Language["InsertKeyboardAndController"], 16, true, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 240)
            });
            Add(sprite);

            sprite = new SpriteObject(device);
            sprite.AddChild((controllerNameText = new TextureString(device, "", 14, true, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 10)
            }));
            reload = new FadableButton(device, resourceManager, Utility.Path.Combine("reload.png"), Utility.Path.Combine("reload_select.png"), "");
            reload.MouseLeftClick += reload_MouseLeftClick;
            up = new FadableButton(device, resourceManager, Utility.Path.Combine("up.png"), Utility.Path.Combine("up_select.png"), "");
            up.MouseLeftClick += up_MouseLeftClick;
            down = new FadableButton(device, resourceManager, Utility.Path.Combine("down.png"), Utility.Path.Combine("down_select.png"), "");
            down.MouseLeftClick += down_MouseLeftClick;
            sprite.AddChild(up);
            sprite.AddChild(down);
            sprite.AddChild(reload);
            up.Position = down.Position = reload.Position = new SharpDX.Vector2(400, 225);
            sprite.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("keysettinggrid.png"))
            {
                Position = new SharpDX.Vector2(290, 30)
            });
            sprite.AddChild(new TextButton(device, resourceManager)
            {
                Position = new SharpDX.Vector2(320, 390), Text = Utility.Language["Start"]
            });
            sprite.AddChild(new TextButton(device, resourceManager)
            {
                Position = new SharpDX.Vector2(320, 420), Text = Utility.Language["Home"]
            });
            keys    = new TextureString[ButtonUtility.Array.Length];
            buttons = new TextureString[ButtonUtility.Array.Length];
            if (myGame.KeyConfigManager.Configs.Length > 0)
            {
                keyConfig = myGame.KeyConfigManager[0];
            }
            for (int i = 0; i < ButtonUtility.Array.Length; i++)
            {
                var textButton = new TextButton(device, resourceManager)
                {
                    Position = new SharpDX.Vector2(530, 90 + i * 30), Text = Utility.Language["Change"], Index = i
                };
                textButton.MouseLeftDown += textButton_MouseLeftDown;

                keys[i] = new TextureString(device, keyConfig.GetKeyMap((ButtonType)i).ToString(), 14, true, PPDColors.White)
                {
                    Position = new SharpDX.Vector2(388, 82 + i * 30)
                };
                buttons[i] = new TextureString(device, keyConfig.GetButtonMap((ButtonType)i).ToString(), 14, true, PPDColors.White)
                {
                    Position = new SharpDX.Vector2(460, 82 + i * 30)
                };
                sprite.AddChild(textButton);
                sprite.AddChild(keys[i]);
                sprite.AddChild(buttons[i]);
            }
            Add(sprite);

            sprite = new SpriteObject(device);
            sprite.AddChild(new TextureString(device, Utility.Language["SettingCompleted"], 20, true, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 200)
            });
            sprite.AddChild(new TextureString(device, Utility.Language["UserKeyboardOrController"], 16, true, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 240)
            });
            Add(sprite);

            right = new FadableButton(device, resourceManager, Utility.Path.Combine("right.png"), Utility.Path.Combine("right_select.png"), "Next")
            {
                Position = new SharpDX.Vector2(770, 225)
            };
            this.AddChild(right);
            left = new FadableButton(device, resourceManager, Utility.Path.Combine("left.png"), Utility.Path.Combine("left_select.png"), "Back")
            {
                Position = new SharpDX.Vector2(30, 225)
            };
            this.AddChild(left);

            left.MouseLeftClick  += left_MouseLeftClick;
            right.MouseLeftClick += right_MouseLeftClick;

            focusManager = new FocusManager();
            focusManager.Focus(this);

            left.Alpha = 0;
            this.Alpha = 0;
        }
Ejemplo n.º 26
0
 private void Add(GameComponent gc)
 {
     gc.Position = new SharpDX.Vector2(contentSprite.ChildrenCount * 800, 0);
     contentSprite.AddChild(gc);
 }
Ejemplo n.º 27
0
        public ItemListComponent(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.gameHost        = gameHost;
            this.resourceManager = resourceManager;
            this.sound           = sound;
            PictureObject back;

            waitSprite = new SpriteObject(device)
            {
                Hidden = true
            };
            this.AddChild(waitSprite);
            waitSprite.AddChild(new TextureString(device, Utility.Language["LoadingItems"], 20, true, PPDColors.White)
            {
                Position = new Vector2(400, 220)
            });
            waitSprite.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            });

            this.AddChild(stackObject = new StackObject(device,
                                                        new PictureObject(device, resourceManager, Utility.Path.Combine("delta.png")),
                                                        new TextureString(device, String.Format(":{0}", Utility.Language["CancelUsingItem"]), 15, PPDColors.White)
                                                        )
            {
                IsHorizontal = true
            });
            stackObject.Update();
            stackObject.Position = new Vector2(760 - stackObject.Width, 50);
            rectangle            = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                Hidden          = true,
                RectangleWidth  = 700,
                RectangleHeight = ItemHeight
            };
            this.AddChild(rectangle);
            mainSprite = new SpriteObject(device)
            {
                Position = new Vector2(50, SpriteY),
                Clip     = new ClipInfo(gameHost)
                {
                    PositionX = 40,
                    PositionY = ClipY,
                    Width     = 750,
                    Height    = ClipHeight
                }
            };
            this.AddChild(mainSprite);
            this.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.80f
            });
            back.AddChild(new TextureString(device, Utility.Language["ItemList"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            Inputed    += ItemComponent_Inputed;
            GotFocused += ItemComponent_GotFocused;
        }
Ejemplo n.º 28
0
        public GameRuleComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.resourceManager = resourceManager;
            this.sound           = sound;

            this.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png")));
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.75f
            });

            back.AddChild(ruleSprite = new SpriteObject(device));
            ruleSprite.AddChild(itemSupplyTypeSprite = new SpriteObject(device));
            back.AddChild(new TextureString(device, Utility.Language["ChangeRule"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });

            ruleSprite.AddChild(resultSort = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["RankOrder"], Utility.Language["Score"], Utility.Language["Accuracy"])
            {
                Position = new SharpDX.Vector2(80, 80),
                Selected = true
            });
            ruleSprite.AddChild(itemAvailable = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemAvailable"])
            {
                Position = new SharpDX.Vector2(50, 120)
            });
            ruleSprite.AddChild(okButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["OK"])
            {
                Position = new Vector2(270, 380)
            });
            ruleSprite.AddChild(cancelButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["Cancel"])
            {
                Position = new Vector2(470, 380)
            });
            ruleSprite.AddChild(maxItemCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["MaxItemCount"], 1, 2, 3, 4, 5, 6)
            {
                Position = new Vector2(110, 160)
            });
            itemSupplyTypeSprite.AddChild(comboSupply = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["DependentOnComboOrWorst"])
            {
                Position = new Vector2(80, 200)
            });
            ruleSprite.AddChild(comboSupplyCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemPerCombo"], 50, 60, 70, 80, 90, 100)
            {
                Position = new Vector2(130, 240)
            });
            ruleSprite.AddChild(worstSupplyCount = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ItemPerWorst"], 50, 60, 70, 80, 90, 100)
            {
                Position = new Vector2(130, 280)
            });
            itemSupplyTypeSprite.AddChild(rankSupply = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["DependentOnRank"])
            {
                Position = new Vector2(80, 320)
            });

            selectList = new SelectableComponent[] {
                resultSort,
                itemAvailable,
                maxItemCount,
                comboSupply,
                comboSupplyCount,
                worstSupplyCount,
                rankSupply,
                okButton,
                cancelButton
            };
            gridSelection = new GridSelection();
            foreach (SelectableComponent comp in selectList)
            {
                gridSelection.Add(comp.Position);
            }
            resultSort.SelectedItem       = Utility.Language[gameRule.ResultSortType.ToString()];
            itemAvailable.Checked         = gameRule.ItemAvailable;
            comboSupply.Checked           = gameRule.ItemSupplyType == ItemSupplyType.ComboWorstCount;
            rankSupply.Checked            = gameRule.ItemSupplyType == ItemSupplyType.Rank;
            comboSupplyCount.SelectedItem = gameRule.ItemSupplyComboCount;
            worstSupplyCount.SelectedItem = gameRule.ItemSupplyWorstCount;
            maxItemCount.SelectedItem     = gameRule.MaxItemCount;

            Inputed    += ItemSettingComponent_Inputed;
            GotFocused += ItemSettingComponent_GotFocused;
        }
Ejemplo n.º 29
0
        private void AddEffect(ItemType itemType, int userID)
        {
            ItemEffect itemEffect = null;

            if (itemManagerComponent.ContainEffect(ItemType.Barrier))
            {
                // Reflect to person
                client.Write(MessagePackSerializer.Serialize(new AddEffectToPlayerNetworkData {
                    UserId = userID, ItemType = itemType
                }));
            }
            else if (itemManagerComponent.ContainEffect(ItemType.Stealth))
            {
                // Nothing to do
            }
            else
            {
                switch (itemType)
                {
                case ItemType.DoubleBPM:
                    if (itemManagerComponent.ContainEffect(ItemType.DoubleBPM))
                    {
                        var effect = itemManagerComponent.GetEffect(ItemType.DoubleBPM);
                        effect.AddEffect();
                    }
                    else
                    {
                        itemEffect = new DoubleBPMEffect();
                    }
                    break;

                case ItemType.FogFilter:
                    if (itemManagerComponent.ContainEffect(ItemType.FogFilter))
                    {
                        var effect = itemManagerComponent.GetEffect(ItemType.FogFilter);
                        effect.AddEffect();
                    }
                    else
                    {
                        var fogComponent = new FogEffectComponent(device, ResourceManager);
                        itemEffect = new FogFilterEffect(fogComponent);
                        filterSprite.AddChild(fogComponent);
                    }
                    break;

                case ItemType.HalfScore:
                    itemEffect = new HalfScoreEffect();
                    break;

                case ItemType.Hidden:
                    itemEffect = new HiddenEffect();
                    break;

                case ItemType.StripeFilter:
                    if (itemManagerComponent.ContainEffect(ItemType.StripeFilter))
                    {
                        var effect = itemManagerComponent.GetEffect(ItemType.StripeFilter);
                        effect.AddEffect();
                    }
                    else
                    {
                        var stripeComponent = new StripeEffectComponent(device, ResourceManager);
                        itemEffect = new StripeFilterEffect(stripeComponent);
                        filterSprite.AddChild(stripeComponent);
                    }
                    break;

                case ItemType.Sudden:
                    itemEffect = new SuddenEffect();
                    break;

                case ItemType.PingPong:
                    if (itemManagerComponent.ContainEffect(ItemType.PingPong))
                    {
                        var effect = itemManagerComponent.GetEffect(ItemType.PingPong);
                        effect.AddEffect();
                    }
                    else
                    {
                        var pingPongComponent = new PingPongEffectComponent(device, ResourceManager);
                        itemEffect = new PingPongEffect(pingPongComponent);
                        filterSprite.AddChild(pingPongComponent);
                    }
                    break;

                case ItemType.Stealth:
                    itemEffect = new StealthEffect();
                    var userPlayState = FindUserPlayState(userID);
                    if (userPlayState != null)
                    {
                        userPlayState.IsStealth = true;
                    }
                    itemEffect.Removed += (sender, e) =>
                    {
                        userPlayState.IsStealth = false;
                    };
                    itemManagerComponent.AddOthersEffect(itemEffect);
                    itemEffect = null;
                    break;
                }
            }

            if (itemEffect != null)
            {
                itemManagerComponent.AddEffect(itemEffect);
            }

            if (expansionClient != null)
            {
                expansionClient.Send(new ItemInfo
                {
                    CurrentTime = mainGameComponent.MoviePosition,
                    ItemType    = itemType,
                    PlayerId    = userID
                });
            }
        }
Ejemplo n.º 30
0
        public ModPanel(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, AllowedModList allowedModList) : base(device)
        {
            this.gameHost        = gameHost;
            this.sound           = sound;
            this.resourceManager = resourceManager;
            this.allowedModList  = allowedModList;

            waitSprite = new SpriteObject(device);
            this.AddChild(waitSprite);
            waitSprite.AddChild(new TextureString(device, Utility.Language["InitializingMod"], 20, true, PPDColors.White)
            {
                Position = new Vector2(400, 220)
            });
            waitSprite.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            });

            updateSprite = new SpriteObject(device)
            {
                Hidden = true
            };
            this.AddChild(updateSprite);
            updateSprite.AddChild(new TextureString(device, Utility.Language["UpdatingMod"], 20, true, PPDColors.White)
            {
                Position = new Vector2(400, 220)
            });
            updateSprite.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            });

            back  = new PictureObject(device, resourceManager, Utility.Path.Combine("dialog_back.png"));
            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.65f
            };
            back.AddChild(new TextureString(device, Utility.Language["Mod"], 30, PPDColors.White)
            {
                Position = new Vector2(35, 30)
            });
            var stackObject = new StackObject(device,
                                              updateMenu = new StackObject(device,
                                                                           new StackObject(device,
                                                                                           new SpaceObject(device, 0, 2),
                                                                                           new PictureObject(device, resourceManager, Utility.Path.Combine("square.png")))
            {
                IsHorizontal = false
            },
                                                                           new TextureString(device, String.Format(":{0}", Utility.Language["Update"]), 18, PPDColors.White))
            {
                IsHorizontal = true
            },
                                              new SpaceObject(device, 20, 0),
                                              settingMenu = new StackObject(device,
                                                                            new StackObject(device,
                                                                                            new SpaceObject(device, 0, 2),
                                                                                            new PictureObject(device, resourceManager, Utility.Path.Combine("delta.png")))
            {
                IsHorizontal = false
            },
                                                                            new TextureString(device, String.Format(":{0}", Utility.Language["Setting"]), 18, PPDColors.White))
            {
                IsHorizontal = true
            },
                                              new SpaceObject(device, 20, 0),
                                              new StackObject(device,
                                                              new SpaceObject(device, 0, 2),
                                                              new PictureObject(device, resourceManager, Utility.Path.Combine("checkgreen.png")))
            {
                Position     = new Vector2(0, 50),
                IsHorizontal = false
            },
                                              new TextureString(device, String.Format(":{0}", Utility.Language["Available"]), 18, PPDColors.White)
            {
                Position = new Vector2(35, 50)
            })
            {
                IsHorizontal = true
            };

            back.AddChild(stackObject);
            stackObject.Update();
            stackObject.Position = new Vector2(760 - stackObject.Width, 50);

            var sprite = new SpriteObject(device)
            {
                Position = new Vector2(50, 80)
            };

            modListSprite = new SpriteObject(device);
            sprite.AddChild(modListSprite);
            sprite.AddChild(new TextureString(device, String.Format("{0}:", Utility.Language["Author"]), 20, PPDColors.White)
            {
                Position = new Vector2(425, 0)
            });
            sprite.AddChild(author = new TextureString(device, "", 20, PPDColors.White)
            {
                Position = new Vector2(450, 30)
            });
            sprite.AddChild(new TextureString(device, String.Format("{0}:", Utility.Language["Version"]), 20, PPDColors.White)
            {
                Position = new Vector2(425, 60)
            });
            sprite.AddChild(version = new TextureString(device, "", 20, PPDColors.White)
            {
                Position = new Vector2(450, 90)
            });
            sprite.AddChild(new TextureString(device, String.Format("{0}:", Utility.Language["Filename"]), 20, PPDColors.White)
            {
                Position = new Vector2(425, 120)
            });
            sprite.AddChild(filename = new TextureString(device, "", 20, 240, PPDColors.White)
            {
                Position = new Vector2(450, 150)
            });
            sprite.AddChild(notAvailable = new TextureString(device, Utility.Language["ModWarning"], 20, 280, 280, true, PPDColors.Red)
            {
                Position = new Vector2(425, 180),
                Hidden   = true
            });

            this.AddChild(scrollBar = new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                Position        = new Vector2(456, 80),
                RectangleHeight = 330,
                RectangleWidth  = 5
            });
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                Position        = new Vector2(465, 80),
                RectangleHeight = 330,
                RectangleWidth  = 1
            });
            this.AddChild(sprite);
            this.AddChild(back);
            this.AddChild(black);

            Inputed    += ModPanel_Inputed;
            GotFocused += ModPanel_GotFocused;
        }