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; }
public FilterControl(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, SongSelectFilter filter) : base(device) { this.sound = sound; this.filter = filter; selection = new GridSelection(); PictureObject back; var mainSprite = new SpriteObject(device); mainSprite.AddChild(new TextureString(device, Utility.Language["SortField"], 22, PPDColors.White) { Position = new Vector2(50, 80) }); var sortFieldSprite = new SpriteObject(device); this.AddChild(sortFieldSprite); sortFieldSprite.AddChild(nameRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Name"]) { Position = new Vector2(80, 120), Selected = true }); nameRadio.Update(); sortFieldSprite.AddChild(timeRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Time"]) { Position = new Vector2(nameRadio.Position.X + nameRadio.Width + Margin, 120) }); timeRadio.Update(); sortFieldSprite.AddChild(updateDateRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["UpdateDate"]) { Position = new Vector2(timeRadio.Position.X + timeRadio.Width + Margin, 120) }); updateDateRadio.Update(); sortFieldSprite.AddChild(bpmRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["BPM"]) { Position = new Vector2(updateDateRadio.Position.X + updateDateRadio.Width + Margin, 120) }); bpmRadio.Update(); sortFieldSprite.AddChild(authorRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Author"]) { Position = new Vector2(bpmRadio.Position.X + bpmRadio.Width + Margin, 120) }); mainSprite.AddChild(new TextureString(device, Utility.Language["SortOrder"], 22, PPDColors.White) { Position = new Vector2(50, 160) }); var sortOrderSprite = new SpriteObject(device); this.AddChild(sortOrderSprite); sortOrderSprite.AddChild(ascRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Ascendant"]) { Position = new Vector2(80, 200) }); nameRadio.Update(); sortOrderSprite.AddChild(descRadio = new RadioBoxComponent(device, resourceManager, Utility.Path, Utility.Language["Descendant"]) { Position = new Vector2(ascRadio.Position.X + ascRadio.Width + Margin, 200) }); mainSprite.AddChild(new TextureString(device, Utility.Language["Type"], 22, PPDColors.White) { Position = new Vector2(50, 240) }); mainSprite.AddChild(easyCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "EASY") { Position = new Vector2(80, 280) }); easyCheck.Update(); mainSprite.AddChild(normalCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "NORMAL") { Position = new Vector2(easyCheck.Position.X + easyCheck.Width + Margin, 280) }); normalCheck.Update(); mainSprite.AddChild(hardCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "HARD") { Position = new Vector2(normalCheck.Position.X + normalCheck.Width + Margin, 280) }); hardCheck.Update(); mainSprite.AddChild(extremeCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, "EXTREME") { Position = new Vector2(hardCheck.Position.X + hardCheck.Width + Margin, 280) }); mainSprite.AddChild(normalScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["NormalScore"]) { Position = new Vector2(80, 320) }); normalScoreCheck.Update(); mainSprite.AddChild(acScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ACScore"]) { Position = new Vector2(normalScoreCheck.Position.X + normalScoreCheck.Width + Margin, 320) }); acScoreCheck.Update(); mainSprite.AddChild(acftScoreCheck = new CheckBoxComponent(device, resourceManager, Utility.Path, Utility.Language["ACFTScore"]) { Position = new Vector2(acScoreCheck.Position.X + acScoreCheck.Width + Margin, 320) }); mainSprite.AddChild(setDefaultButton = new ButtonComponent(device, resourceManager, Utility.Path, Utility.Language["SetDefault"]) { Position = new Vector2(300, 370) }); selectList = new SelectableComponent[] { nameRadio, timeRadio, updateDateRadio, bpmRadio, authorRadio, ascRadio, descRadio, easyCheck, normalCheck, hardCheck, extremeCheck, normalScoreCheck, acScoreCheck, acftScoreCheck, setDefaultButton }; foreach (SelectableComponent comp in selectList) { selection.Add(comp.Position); } 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.65f }); back.AddChild(new TextureString(device, Utility.Language["Filter"], 30, PPDColors.White) { Position = new Vector2(35, 30) }); Inputed += FilterControl_Inputed; GotFocused += FilterControl_GotFocused; LostFocused += FilterControl_LostFocused; }