Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
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.º 3
0
        public GameInterfaceTop(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PPDGameUtility ppdgameutility) : base(device)
        {
            top       = new PictureObject(device, resourceManager, Utility.Path.Combine("top.png"));
            topdanger = new PictureObject(device, resourceManager, Utility.Path.Combine("topred.png"))
            {
                Hidden = true
            };
            onpu       = new PictureObject(device, resourceManager, Utility.Path.Combine("toponpu.png"));
            songname   = new TextureString(device, ppdgameutility.SongInformation.DirectoryName, 20, 270, PPDColors.White);
            sco        = new Score(device, resourceManager);
            difficulty = new TextureString(device, String.Format("-{0}-", ppdgameutility.Difficulty.ToString().ToUpper()), 20, true, PPDColors.White);

            this.AddChild(difficulty);
            this.AddChild(songname);
            this.AddChild(onpu);
            this.AddChild(sco);
            this.AddChild(top);
            this.AddChild(topdanger);
            InitializeComponentPosition();
        }
Ejemplo n.º 4
0
        private void InnerStruct(PPDGameUtility gameutility, PPDFramework.Resource.ResourceManager resourceManager, RandomChangeManager randomChangeManager, PPDEffectManager ppdem, MarkImagePathsBase imagepathes, MainGameConfigBase config, FlowScriptManager scriptManager)
        {
            this.gameutility         = gameutility;
            this.randomChangeManager = randomChangeManager;
            this.ppdem           = ppdem;
            this.imagepathes     = imagepathes;
            this.resourceManager = resourceManager;
            this.config          = config;
            this.scriptManager   = scriptManager;
            externalMarks        = new List <MarkData>();

            evals = new float[] { PPDSetting.Setting.CoolArea, PPDSetting.Setting.GoodArea, PPDSetting.Setting.SafeArea, PPDSetting.Setting.SadArea };
            Logger.Instance.AddLog("CoolArea:{0}", PPDSetting.Setting.CoolArea);
            Logger.Instance.AddLog("GoodArea:{0}", PPDSetting.Setting.GoodArea);
            Logger.Instance.AddLog("SafeArea:{0}", PPDSetting.Setting.SafeArea);
            Logger.Instance.AddLog("SadArea:{0}", PPDSetting.Setting.SadArea);
            adjustgaptime = PPDSetting.Setting.AdjustGapTime;
            CreateResource();

            MarkLayer            = new SpriteObject(device);
            ConnectLayer         = new SpriteObject(device);
            postDrawManager      = new PostDrawManager(device);
            markConnectionCommon = new MarkConnectionCommon(device, resourceManager);
            this.AddChild(markConnectionCommon);
            if (PPDSetting.Setting.DrawConnectUnderAllMark)
            {
                this.AddChild(postDrawManager);
                this.AddChild(MarkLayer);
                this.AddChild(ConnectLayer);
            }
            else
            {
                this.AddChild(postDrawManager);
                this.AddChild(ConnectLayer);
                this.AddChild(MarkLayer);
            }
            ConnectLayer.CanDraw += (obj, context, depth, childIndex) =>
            {
                return(gameutility.Connect || gameutility.Profile.Connect);
            };
        }
Ejemplo n.º 5
0
            public GameInfoComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, GameLoader gameLoader) : base(device)
            {
                this.GameLoader = gameLoader;

                var gameInfo = gameLoader.GetGameInformation();

                this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("gameicon", gameInfo.GameIconPath))
                {
                    Position = new Vector2(13, 13)
                });
                this.AddChild(new TextureString(device, gameInfo.GameName, 20, PPDColors.White)
                {
                    Position = new Vector2(102, 5)
                });
                this.AddChild(new TextureString(device, gameInfo.GameDescription, 14, 500, 60, true, PPDColors.White)
                {
                    Position = new Vector2(102, 32)
                });
                this.AddChild(new TextureString(device, Utility.Language["PlayingTime"], 12, PPDColors.White)
                {
                    Position = new Vector2(630, 8)
                });
                playingTimeText = new TextureString(device, "", 12, PPDColors.White)
                {
                    Position  = new Vector2(795, 8),
                    Alignment = Alignment.Right
                };
                this.AddChild(playingTimeText);
                this.AddChild(new TextureString(device, Utility.Language["Version"], 12, PPDColors.White)
                {
                    Position = new Vector2(630, 25)
                });
                var vertionText = new TextureString(device, gameLoader.Version, 12, PPDColors.White)
                {
                    Position  = new Vector2(795, 25),
                    Alignment = Alignment.Right
                };

                this.AddChild(vertionText);
                this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("gamelist_back.png")));
            }
Ejemplo n.º 6
0
            public UseItemComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ItemType itemType) : base(device)
            {
                this.resourceManager = resourceManager;
                ItemType             = itemType;

                this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("item", String.Format("{0}.png", itemType)))
                {
                    Position = new Vector2(0, 2)
                });
                this.AddChild(nameString = new TextureString(device, Utility.Language[itemType.ToString()], 16, PPDColors.White)
                {
                    Position = new Vector2(20, 0)
                });
                this.AddChild(rectangle = new RectangleComponent(device, resourceManager, PPDColors.White)
                {
                    Position        = new Vector2(20, 0),
                    RectangleHeight = 20,
                    RectangleWidth  = nameString.Width,
                    Hidden          = true
                });
            }
Ejemplo n.º 7
0
        public CheckBoxComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text) : base(device)
        {
            this.AddChild(check = new PictureObject(device, resourceManager, pathManager.Combine("optioncheck.png"))
            {
                Position = new Vector2(0, -5),
                Scale    = new Vector2(0.5f),
                Hidden   = true
            });
            this.AddChild(checkBox = new PictureObject(device, resourceManager, pathManager.Combine("optioncheckbox.png"))
            {
                Position = new Vector2(7, 7),
                Scale    = new Vector2(0.5f),
                Alpha    = 0
            });
            TextureString str;

            this.AddChild(str = new TextureString(device, text, 20, PPDColors.White)
            {
                Position = new Vector2(30, 0)
            });
        }
Ejemplo n.º 8
0
        public LeftMenu(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, DxTextBox textBox, SelectSongManager ssm, ISound sound) : base(device)
        {
            this.gameHost        = gameHost;
            this.resourceManager = resourceManager;
            this.sound           = sound;
            this.textBox         = textBox;
            this.ssm             = ssm;

            scoreUpdateCountBack = new PictureObject(device, resourceManager, Utility.Path.Combine("update_count_back.png"))
            {
                Position = new Vector2(20, 90),
                Hidden   = true,
                Alpha    = 0.75f
            };
            scoreUpdateCountBack.AddChild(scoreUpdateCount = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("result", "scoresmall.png"))
            {
                Position  = new Vector2(17, 5),
                Alignment = PPDFramework.Alignment.Center,
                MaxDigit  = -1,
                Scale     = new Vector2(0.75f)
            });
            modUpdateCountBack = new PictureObject(device, resourceManager, Utility.Path.Combine("update_count_back.png"))
            {
                Position = new Vector2(20, 330),
                Hidden   = true,
                Alpha    = 0.75f
            };
            modUpdateCountBack.AddChild(modUpdateCount = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("result", "scoresmall.png"))
            {
                Position  = new Vector2(17, 5),
                Alignment = PPDFramework.Alignment.Center,
                MaxDigit  = -1,
                Scale     = new Vector2(0.75f)
            });
            WebSongInformationManager.Instance.Updated += Instance_Updated;
            WebSongInformationManager.Instance.Update(true);

            this.Inputed    += LeftMenu_Inputed;
            this.GotFocused += LeftMenu_GotFocused;
        }
Ejemplo n.º 9
0
 public ListBoxComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text, params object[] items) : base(device)
 {
     if (items.Length == 1 && items[0].GetType().IsArray)
     {
         var array = (Array)items[0];
         this.items = new object[array.Length];
         for (int i = 0; i < array.Length; i++)
         {
             this.items[i] = array.GetValue(i);
         }
     }
     else
     {
         this.items = items;
     }
     this.AddChild(right = new PictureObject(device, resourceManager, pathManager.Combine("optionlistboxright.png"))
     {
         Scale = new Vector2(0.5f),
         Alpha = 0
     });
     this.AddChild(left = new PictureObject(device, resourceManager, pathManager.Combine("optionlistboxleft.png"))
     {
         Scale = new Vector2(0.5f),
         Alpha = 0
     });
     this.AddChild(str = new TextureString(device, text, 20, PPDColors.White));
     str.Update();
     this.strItems = new TextureString[this.items.Length];
     for (int i = 0; i < this.items.Length; i++)
     {
         this.AddChild(strItems[i] = new TextureString(device, this.items[i].ToString(), 20, PPDColors.White)
         {
             Hidden = true
         });
         strItems[i].Update();
     }
     left.Position = new Vector2(str.Width + 20, -5);
     AdjustPosition();
 }
Ejemplo n.º 10
0
        public MenuRankingBoard(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
        {
            this.resourceManager = resourceManager;
            PictureObject info;

            this.AddChild(info         = new PictureObject(device, resourceManager, Utility.Path.Combine("infoboard2.png")));
            this.AddChild(yourRankText = new TextureString(device, "", 12, PPDColors.White)
            {
                Position  = new SharpDX.Vector2(280, -10),
                Alignment = Alignment.Right,
                Border    = new Border
                {
                    Color     = PPDColors.Black,
                    Thickness = 1
                }
            });
            this.AddChild(rankKindText = new TextureString(device, "", 12, PPDColors.White)
            {
                Position = new SharpDX.Vector2(5, -10),
                Border   = new Border
                {
                    Color     = PPDColors.Black,
                    Thickness = 1
                }
            });
            ranks = new RankingChild[3];
            info.AddChild(ranks[0] = new RankingChild(device, resourceManager)
            {
                Position = new SharpDX.Vector2(15, 10)
            });
            info.AddChild(ranks[1] = new RankingChild(device, resourceManager)
            {
                Position = new SharpDX.Vector2(15, 30)
            });
            info.AddChild(ranks[2] = new RankingChild(device, resourceManager)
            {
                Position = new SharpDX.Vector2(15, 50)
            });
        }
Ejemplo n.º 11
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.º 12
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);
        }
Ejemplo n.º 13
0
 public ModSettingComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager,
                            ModSetting modSetting, string currentValue) : base(device)
 {
     this.AddChild(nameText = new TextureString(device, modSetting.Name, 24, 500, PPDColors.White)
     {
         AllowScroll = false
     });
     this.AddChild(infoText = new TextureString(device, GetInfoText(modSetting), 12, PPDColors.White)
     {
         Position  = new Vector2(690, 30),
         Alignment = Alignment.Right
     });
     this.AddChild(descriptionText = new TextureString(device, modSetting.Description, 18, 660, int.MaxValue, true, PPDColors.White)
     {
         Position = new Vector2(15, 40)
     });
     this.AddChild(valueText = new TextureString(device, currentValue, 24, 400, PPDColors.White)
     {
         Position  = new Vector2(690, 0),
         Alignment = Alignment.Right
     });
 }
Ejemplo n.º 14
0
 public MainGame(PPDDevice device, MyGame mygame, PPDFramework.Resource.ResourceManager resourceManager, SquareGrid squareGrid) : base(device)
 {
     this.resourceManager = resourceManager;
     AddChild(mpd         = new MarkPointDrawer(device, resourceManager));
     AddChild(kasi        = new TextureString(device, "", 20, true, PPDColors.White)
     {
         Position = new Vector2(400, 415)
     });
     AddChild(mgt         = new MainGameTop(device, resourceManager));
     AddChild(mgb         = new MainGameBottom(device, resourceManager));
     AddChild(up          = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "up.png")));
     AddChild(upSelect    = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "upselect.png")));
     AddChild(right       = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "right.png")));
     AddChild(rightSelect = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "rightselect.png")));
     AddChild(area        = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "area.png")));
     AddChild(angleLine   = new LineComponent(device, resourceManager, PPDColors.Blue)
     {
         LineWidth = 3
     });
     AddChild(dummy = new DummyDrawComponent(device));
     AddChild(grid  = new GridComponent(device, resourceManager, squareGrid));
 }
Ejemplo n.º 15
0
 public Mark(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, MarkImagePathsBase filenames, MarkData md, ButtonType type, float[] eval,
             float gap, DisplayState dState, NoteType noteType, int sameTimingMarks, KeyValuePair <string, string>[] parameters, PostDrawManager postDrawManager) : base(device)
 {
     Position             = new Vector2(md.X, md.Y);
     Angle                = md.Angle;
     Time                 = md.Time;
     this.resourceManager = resourceManager;
     this.eval            = eval;
     this.filenames       = filenames;
     this.adjustGapTime   = gap;
     this.sameTimingMarks = sameTimingMarks;
     this.ButtonType      = type;
     this.displayState    = dState;
     this.NoteType        = noteType;
     this.ID              = md.ID;
     Parameters           = new Dictionary <object, object>();
     foreach (var parameter in parameters)
     {
         Parameters[parameter.Key] = parameter.Value;
     }
     this.postDrawManager = postDrawManager;
 }
Ejemplo n.º 16
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.º 17
0
        public HomeBottomMenu(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.resourceManager = resourceManager;
            this.sound           = sound;

            back          = new PictureObject(device, resourceManager, Utility.Path.Combine("bottom_back.png"));
            back.Position = new SharpDX.Vector2(400 - back.Width / 2, 0);

            icons   = new PictureObject[ModeArray.Length];
            strings = new TextureString[ModeArray.Length];
            for (int i = 0; i < icons.Length; i++)
            {
                icons[i] = new PictureObject(device, resourceManager, Utility.Path.Combine(String.Format("{0}_icon.png", ((Mode)i))), true);
                this.AddChild(icons[i]);
                strings[i] = new TextureString(device, Utility.Language[((Mode)i).ToString()], 20, true, PPDColors.White);
                this.AddChild(strings[i]);
            }

            this.AddChild(back);

            this.Position        = new SharpDX.Vector2(0, 421);
            HandleOverFocusInput = true;
            Inputed += HomeUnderMenu_Inputed;
        }
Ejemplo n.º 18
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.º 19
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.º 20
0
 public TextButton(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
 {
     this.AddChild((textString = new TextureString(device, "", 12, true, PPDColors.White)));
     this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("keysettingbutton.png"), true));
     textString.Position = new SharpDX.Vector2(0, -textString.Height / 2);
 }
Ejemplo n.º 21
0
        /// <summary>
        /// DirectXを初期化します。
        /// </summary>
        /// <returns></returns>
        public bool InitializeDirectX(int?width = 800, int?height = 450, int?expectedWidth = 800, int?expectedHeight = 450, float?expectedAspectRatio = 16f / 9)
        {
            try
            {
                if (width <= 0)
                {
                    width = 800;
                }
                if (height <= 0)
                {
                    height = 450;
                }
                Control.Size = new System.Drawing.Size(width.Value, height.Value);
                InitializeUI();

                device = PPDDevice.Initialize(Control.Handle, width.Value, height.Value, expectedWidth.Value, expectedHeight.Value, expectedAspectRatio.Value);
                device.RegisterModule(new AlphaBlendContextCache(1024));
                device.RegisterModule(new ShaderCommon(device));
                device.RegisterModule(new ColorTextureAllcator(device));
                device.RegisterModule(new CharCacheManager(device));
                device.RegisterModule(new AlphaBlend(device));
                device.RegisterModule(new GaussianFilter(device));
                device.RegisterModule(new ColorScreenFilter());
                device.RegisterModule(new GlassFilter(device));
                device.RegisterModule(new BorderFilter(device));
                device.RegisterModule(new MosaicFilter(device));
                device.GetModule <ShaderCommon>().InitializeScreenVertex(device);
                resourceManager = new PPDFramework.Resource.ResourceManager();
                blackRectangles = new RectangleComponent[2];
                for (var i = 0; i < blackRectangles.Length; i++)
                {
                    blackRectangles[i] = new RectangleComponent(device, resourceManager, PPDColors.Black);
                }
                var invScale = 1 / device.Scale.X;
                if (device.Offset.X == 0)
                {
                    blackRectangles[0].Position        = new Vector2(0, -device.Offset.Y * invScale);
                    blackRectangles[0].RectangleWidth  = width.Value * invScale;
                    blackRectangles[0].RectangleHeight = device.Offset.Y * invScale;
                    blackRectangles[1].Position        = new Vector2(0, device.ExpectedHeight);
                    blackRectangles[1].RectangleWidth  = width.Value * invScale;
                    blackRectangles[1].RectangleHeight = device.Offset.Y * invScale;
                }
                else
                {
                    blackRectangles[0].Position        = new Vector2(-device.Offset.X * invScale, 0);
                    blackRectangles[0].RectangleWidth  = device.Offset.X * invScale;
                    blackRectangles[0].RectangleHeight = height.Value * invScale;
                    blackRectangles[1].Position        = new Vector2(device.ExpectedWidth, 0);
                    blackRectangles[1].RectangleWidth  = device.Offset.X * invScale;
                    blackRectangles[1].RectangleHeight = height.Value * invScale;
                }
                blackRectangles[0].Update();
                blackRectangles[1].Update();
                return(true);
            }
#if DEBUG
            catch (Exception e)
            {
                MessageBox.Show(e.StackTrace);
                throw;
#else
            catch
            {
                //初期化失敗
                return(false);
#endif
            }
        }
Ejemplo n.º 22
0
        public OptionControl(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.resourceManager = resourceManager;
            this.sound           = sound;

            back     = new PictureObject(device, resourceManager, Utility.Path.Combine("option.png"));
            width    = back.Width;
            Position = new Vector2(-width, 0);
            string[] langs = { "Auto", "ExceptSlide", "Random", "MuteSE", "Connect", "PerfectTrial", "RivalGhost", "RivalGhostCount", "Speed", "Profile" };
            selectables = new SelectableComponent[langs.Length];
            for (int i = 0; i < selectables.Length; i++)
            {
                if (i >= (int)State.RivalGhostCount)
                {
                    switch ((State)i)
                    {
                    case State.RivalGhostCount:
                        var counts = new int[SkinSetting.MaxRivalGhostCount];
                        for (var j = 0; j < counts.Length; j++)
                        {
                            counts[j] = j + 1;
                        }
                        this.AddChild(selectables[i] = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language[langs[i]], counts)
                        {
                            Position      = new Vector2(60, 80 + i * 30),
                            SelectedIndex = SkinSetting.Setting.RivalGhostCount - 1
                        });
                        break;

                    case State.Speed:
                        this.AddChild(selectables[i] = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language[langs[i]],
                                                                            speeds.Select(s => String.Format("x{0:F2}", s)).ToArray())
                        {
                            Position      = new Vector2(60, 80 + i * 30),
                            SelectedIndex = 2
                        });
                        break;

                    case State.Profile:
                        this.AddChild(selectables[i] = new ListBoxComponent(device, resourceManager, Utility.Path, Utility.Language[langs[i]],
                                                                            ProfileManager.Instance.Profiles.Select(p => p.DisplayText).ToArray())
                        {
                            Position = new Vector2(60, 80 + i * 30)
                        });
                        break;
                    }
                }
                else
                {
                    float xOffset = i == 1 ? 30 : 0;
                    this.AddChild(selectables[i] = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language[langs[i]])
                    {
                        Position = new Vector2(30 + xOffset, 80 + i * 30)
                    });
                }
            }
            selectables[0].Selected = true;

            this.AddChild(new TextureString(device, Utility.Language["Option"], 32, PPDColors.White)
            {
                Position = new Vector2(40, 30)
            });
            this.AddChild(back);

            Inputed += OptionControl_Inputed;
        }
Ejemplo n.º 23
0
 public ItemOverrayComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ItemManagerComponent itemManagerComponent) : base(device)
 {
     this.resourceManager      = resourceManager;
     this.itemManagerComponent = itemManagerComponent;
 }
Ejemplo n.º 24
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;
        }
Ejemplo n.º 25
0
        public ItemManagerComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, GameRule gameRule) : base(device)
        {
            this.resourceManager = resourceManager;
            stopwatch            = new Stopwatch();
            stopwatch.Start();

            queue   = new List <ItemType>();
            effects = new List <ItemEffect>();

            var itemTypeArray = (ItemType[])Enum.GetValues(typeof(ItemType));

            itemWeight = new int[itemTypeArray.Length - 1];
            int sum = 0;

            for (int i = 1; i < itemTypeArray.Length; i++)
            {
                int weight = 0;
                switch ((ItemType)i)
                {
                case ItemType.Auto:
                    weight = 1;
                    break;

                case ItemType.Barrier:
                    weight = 50;
                    break;

                case ItemType.DoubleBPM:
                    weight = 20;
                    break;

                case ItemType.DoubleCombo:
                    weight = 100;
                    break;

                case ItemType.DoubleScore:
                    weight = 100;
                    break;

                case ItemType.FogFilter:
                    weight = 20;
                    break;

                case ItemType.HalfScore:
                    weight = 20;
                    break;

                case ItemType.HatenaBox:
                    weight = 10;
                    break;

                case ItemType.Hidden:
                    weight = 20;
                    break;

                case ItemType.StripeFilter:
                    weight = 20;
                    break;

                case ItemType.Sudden:
                    weight = 20;
                    break;

                case ItemType.TripleCombo:
                    weight = 20;
                    break;

                case ItemType.TripleScore:
                    weight = 20;
                    break;

                case ItemType.Stealth:
                    weight = 50;
                    break;

                case ItemType.PingPong:
                    weight = 20;
                    break;
                }

                sum += weight;
                itemWeight[i - 1] = sum;
            }

            this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("item", "frame.png")));
            lockPicture = new PictureObject[6];
            for (int i = 0; i < 6; i++)
            {
                this.AddChild(lockPicture[i] = new PictureObject(device, resourceManager, Utility.Path.Combine("item", "lock.png"))
                {
                    Position = new Vector2(3 + i * 19, 3)
                });
            }
            ChangeLockPictureVisibility();
            this.AddChild(itemSprite = new SpriteObject(device));

            MaxItemCount = gameRule.MaxItemCount;
        }
Ejemplo n.º 26
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.º 27
0
 public HoldExMark(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, MarkImagePathsBase filenames, ExMarkData emd, ButtonType type, float[] eval,
                   float gap, DisplayState dState, NoteType noteType, int sameTimingMarks, KeyValuePair <string, string>[] parameters, PostDrawManager postDrawManager)
     : base(device, resourceManager, filenames, emd, type, eval, gap, dState, noteType, sameTimingMarks, parameters, postDrawManager)
 {
 }
Ejemplo n.º 28
0
        public HoldManager(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
        {
            pressingButtons = new bool[10];
            pressingInfos   = new PressInfo[10];

            marks    = new PictureObject[10];
            marks[0] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "sikakuc.png"), true);
            marks[1] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "batuc.png"), true);
            marks[2] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "maruc.png"), true);
            marks[3] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "sankakuc.png"), true);
            marks[4] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "hidaric.png"), true);
            marks[5] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "sitac.png"), true);
            marks[6] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "migic.png"), true);
            marks[7] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "uec.png"), true);
            marks[8] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "Rc.png"), true);
            marks[9] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "Lc.png"), true);
            for (int i = 0; i < marks.Length; i++)
            {
                marks[i].Position = new Vector2(385 + 17 * i, 336);
                this.AddChild(marks[i]);
            }
            this.AddChild(maxplus = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "maxplus.png"))
            {
                Position = new Vector2(0, 354)
            });
            this.AddChild(maxnumber = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("hold", "maxnumber.png"))
            {
                Position  = new Vector2(550, 352),
                Alignment = Alignment.Right,
                MaxDigit  = -1
            });
            this.AddChild(holdbonus = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "holdbonus.png"), true)
            {
                Position = new Vector2(345, 359)
            });
            this.AddChild(maxeffect = new EffectObject(device, resourceManager, Utility.Path.Combine("hold\\maxback.etd"))
            {
                Position = new Vector2(400, 360)
            });
            maxeffect.PlayType    = Effect2D.EffectManager.PlayType.Once;
            this.AddChild(maxback = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "maxback.png"), true)
            {
                Position = new Vector2(400, 360)
            });
            this.AddChild(holdplus = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "holdplus.png"))
            {
                Position = new Vector2(0, 327)
            });
            this.AddChild(holdnumber = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("hold", "holdnumber.png"))
            {
                Position  = new Vector2(600, 326),
                Alignment = Alignment.Right,
                MaxDigit  = -1
            });
            numbers = new PictureObject[6];
            bonuses = new PictureObject[6];
            for (int i = 1; i <= 6; i++)
            {
                numbers[i - 1] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", String.Format("{0}.png", i)), true)
                {
                    Position = new Vector2(195, 335)
                };
                bonuses[i - 1] = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", String.Format("{0}bonus.png", i)))
                {
                    Position = new Vector2(210, 325)
                };
                bonuses[i - 1].Position = new Vector2(210, (int)(337 - bonuses[i - 1].Height / 2));
                this.AddChild(numbers[i - 1]);
                this.AddChild(bonuses[i - 1]);
            }
            this.AddChild(holdeffect = new EffectObject(device, resourceManager, Utility.Path.Combine("hold\\holdback.etd"))
            {
                Position = new Vector2(400, 335)
            });
            holdeffect.PlayType    = Effect2D.EffectManager.PlayType.Once;
            this.AddChild(holdback = new PictureObject(device, resourceManager, Utility.Path.Combine("hold", "holdback.png"), true)
            {
                Position = new Vector2(400, 335)
            });

            Hide();
        }
Ejemplo n.º 29
0
 public UserListComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
 {
     this.resourceManager = resourceManager;
 }
Ejemplo n.º 30
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;
        }