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; }
public UpdateScoreControl(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device) { this.resourceManager = resourceManager; this.sound = sound; mainSprite = new SpriteObject(device) { Position = new Vector2(40, 80) }; this.AddChild(scrollBar = new RectangleComponent(device, resourceManager, PPDColors.White) { Position = new Vector2(755, 80), RectangleHeight = 330, RectangleWidth = 5 }); 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["UpdateScore"], 30, PPDColors.White) { Position = new Vector2(35, 30) }); GotFocused += UpdateScoreControl_GotFocused; Inputed += UpdateScoreControl_Inputed; }
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; }
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; }
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) }); }
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; }
public override void Load() { OnLoadProgressed(0); this.AddChild((left = new PictureObject(device, resourceManager, Utility.Path.Combine("leftmenu.png")))); OnLoadProgressed(20); left.AddChild((leftSelection = new PictureObject(device, resourceManager, Utility.Path.Combine("right.png"), true) { Position = new SharpDX.Vector2(30, 0), Scale = new SharpDX.Vector2(0.5f, 0.5f) })); OnLoadProgressed(40); this.AddChild((errorString = new TextureString(device, Utility.Language["ErrorInFeedLoading"], 20, true, PPDColors.White) { Position = new SharpDX.Vector2(400, 220), Alpha = 0 })); OnLoadProgressed(60); this.AddChild((feedSprite = new SpriteObject(device) { Position = new SharpDX.Vector2(200, 0), Clip = new ClipInfo(gameHost) { PositionX = 200, PositionY = 0, Width = 600, Height = 450 } })); loader = new FeedListLoader(); OnLoadProgressed(80); Inputed += FeedPanel_Inputed; GotFocused += FeedPanel_GotFocused; OnLoadProgressed(100); }
public GameResultScore(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PPDGameUtility ppdGameUtility, ISound sound, ITweetManager tweetManager, IReviewManager reviewManager, IGameHost gameHost) : base(device) { this.ppdGameUtility = ppdGameUtility; this.TweetManager = tweetManager; this.ReviewManager = reviewManager; this.Sound = sound; this.gameHost = gameHost; menuRanking = new MenuRanking(device, resourceManager) { Position = new Vector2(455, 100) }; td = new TweetDialog(device, resourceManager, sound, tweetManager); rd = new ReviewDialog(device, resourceManager, sound, reviewManager); this.AddChild(td); this.AddChild(rd); result = new EffectObject[6]; for (int i = 0; i < result.Length; i++) { int x = 220; int y = 74; var anim = new EffectObject(device, resourceManager, Utility.Path.Combine("result", String.Format("{0}.etd", ((ResultEvaluateType)i).ToString().ToLower()))) { Position = new Vector2(x, y) }; anim.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop; anim.Play(); result[i] = anim; } string filename = ""; switch (ppdGameUtility.Difficulty) { case Difficulty.Easy: filename = "easy.png"; break; case Difficulty.Normal: filename = "normal.png"; break; case Difficulty.Hard: filename = "hard.png"; break; case Difficulty.Extreme: filename = "extreme.png"; break; default: filename = "normal.png"; break; } difficulty = new PictureObject(device, resourceManager, Utility.Path.Combine("result", filename)) { Position = new Vector2(45, 105) }; high = new EffectObject(device, resourceManager, Utility.Path.Combine("result", "high.etd")) { Position = new Vector2(-25, 300) }; high.PlayType = Effect2D.EffectManager.PlayType.Loop; high.Play(); high.Alignment = EffectObject.EffectAlignment.TopLeft; scoresmalls = new NumberPictureObject[6]; for (int i = 0; i < scoresmalls.Length; i++) { scoresmalls[i] = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("result", "scoresmall.png")) { Position = new Vector2(scorex, scorey[i]), Alignment = Alignment.Right, MaxDigit = -1 }; } scorebig = new NumberPictureObject(device, resourceManager, Utility.Path.Combine("result", "scorebig.png")) { Position = new Vector2(scorex, scorey[6]), Alignment = Alignment.Right, MaxDigit = -1 }; scoreboard = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "score.png")) { Position = new Vector2(18, 52) }; scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "cool.png"), true) { Position = new Vector2(105, 108), Scale = new Vector2(0.75f, 0.75f) }); scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "good.png"), true) { Position = new Vector2(105, 138), Scale = new Vector2(0.75f, 0.75f) }); scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "safe.png"), true) { Position = new Vector2(105, 168), Scale = new Vector2(0.75f, 0.75f) }); scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "sad.png"), true) { Position = new Vector2(105, 198), Scale = new Vector2(0.75f, 0.75f) }); scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "worst.png"), true) { Position = new Vector2(105, 228), Scale = new Vector2(0.75f, 0.75f) }); scoreboard.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "combo.png"), true) { Position = new Vector2(105, 258), Scale = new Vector2(0.75f, 0.75f) }); top = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "top.png")); top.AddChild(new TextureString(device, Utility.Language["Result"], 20, PPDColors.White) { Position = new Vector2(70, 2) }); bottom = new PictureObject(device, resourceManager, Utility.Path.Combine("result", "bottom.png")); bottom.AddChild(new TextureString(device, Utility.Language["Move"], 16, PPDColors.White) { Position = new Vector2(587, 21) }); bottom.AddChild(new TextureString(device, Utility.Language["Decide"], 16, PPDColors.White) { Position = new Vector2(708, 21) }); bottom.Position = new Vector2(0, 450 - bottom.Height + 1); black = new RectangleComponent(device, resourceManager, PPDColors.Black) { RectangleHeight = 450, RectangleWidth = 800 }; black.Alpha = 0; buttons = new Button[5]; for (int i = 0; i < buttons.Length; i++) { string text = ""; switch (i) { case 0: text = "TWEET"; break; case 1: text = "REVIEW"; break; case 2: text = "RETRY"; break; case 3: text = "REPLAY"; break; case 4: text = "RETURN"; break; } Vector2 pos; if (i >= 2) { pos = new Vector2(500 + ((i - 2) % 3) * 100, 380); } else { pos = new Vector2(500 + (i % 2) * 100, 340); } buttons[i] = new Button(device, resourceManager, Utility.Path, text) { Position = pos }; gridSelection.Add(pos); buttons[i].Selected = false; this.AddChild(buttons[i]); } gridSelection.Initialize(); songname = new TextureString(device, ppdGameUtility.SongInformation.DirectoryName, 20, 500, PPDColors.White) { Position = new Vector2(35, 4) }; songname.Position = new Vector2(790 - songname.JustWidth, songname.Position.Y); difficultstring = new TextureString(device, ppdGameUtility.DifficultString, 24, 200, PPDColors.White) { Position = new Vector2(35, 103), AllowScroll = true }; difficultstring.Position = new Vector2(400 - Math.Min(200, difficultstring.Width), difficultstring.Position.Y); bgd = new BackGroundDisplay(device, resourceManager, "skins\\PPDSingle_BackGround.xml", "Result"); Inputed += GameResultScore_Inputed; GotFocused += GameResultScore_GotFocused; this.AddChild(menuRanking); this.AddChild(high); this.AddChild(difficulty); for (int i = 0; i < result.Length; i++) { this.AddChild(result[i]); } for (int i = 0; i < scoresmalls.Length; i++) { this.AddChild(scoresmalls[i]); } this.AddChild(scorebig); this.AddChild(difficultstring); this.AddChild(scoreboard); this.AddChild(songname); this.AddChild(top); this.AddChild(bottom); this.AddChild(bgd); this.InsertChild(black, 0); }
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; }
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; }
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; }
public override bool Load() { PPDFramework.Web.WebModInfo[] webMods = null; Action[] actions = { () => { webMods = PPDFramework.Web.WebManager.Instance.GetMods(); }, PPDScoreManager.Manager.Initialize, }; Parallel.ForEach(actions, (action) => action()); allowedModList = new AllowedModList { WebMods = webMods }; logger = new Logger(String.Format("{0}.txt", DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss"))); Sound.AddSound(notifySoundPath); version = FileVersionInfo.GetVersionInfo(Assembly.GetAssembly(this.GetType()).Location).FileVersion; userList = new ChangableList <User>(); userList.ItemChanged += userList_ItemChanged; movieManager = new MovieManager(device, GameHost); movieManager.MovieChanged += MovieManager_MovieChanged; movieManager.MovieChangeFailed += MovieManager_MovieChangeFailed; clientHandledData = new Queue <NetworkData>(); selfUser = new User { Name = PPDFramework.Web.WebManager.Instance.CurrentUserName, AccountId = PPDFramework.Web.WebManager.Instance.CurrentAccountId, CurrentState = UserState.NotReady, Color = RandomColorGenerator.GetColor(), IsSelf = true, IsHost = (bool)this.Param["AsHost"] }; this.AddChild(gameResultComponent = new GameResultComponent(device, GameHost, ResourceManager, Sound)); this.AddChild(leftMenu = new LeftMenu(device, GameHost, ResourceManager, Sound, movieManager, selfUser, userList, allowedModList)); leftMenu.SongSelected += leftMenu_SongSelected; leftMenu.ShowResult += leftMenu_ShowResult; leftMenu.UpdateScoreDB += leftMenu_UpdateScoreDB; leftMenu.RuleChanged += leftMenu_RuleChanged; leftMenu.TryToPlayGame += leftMenu_TryToPlayGame; leftMenu.ChangeLeader += leftMenu_ChangeLeader; leftMenu.KickUser += leftMenu_KickUser; this.AddChild(textBox = new DxTextBox(device, GameHost, ResourceManager)); this.AddChild((chatComponent = new ChatComponent(device, ResourceManager, GameHost) { Position = new SharpDX.Vector2(430, 0) })); this.AddChild(userListComponent = new UserListComponent(device, ResourceManager) { Position = new SharpDX.Vector2(10, 10) }); PictureObject bottom; this.AddChild(bottom = new PictureObject(device, ResourceManager, Utility.Path.Combine("menu_bottom.png")) { Position = new SharpDX.Vector2(0, 421) }); bottom.AddChild(new PictureObject(device, ResourceManager, Utility.Path.Combine("bottom_triangle.png")) { Position = new SharpDX.Vector2(7, 7) }); bottom.AddChild(new TextureString(device, Utility.Language["Menu"], 16, PPDColors.White) { Position = new SharpDX.Vector2(30, 5) }); bottom.AddChild(new PictureObject(device, ResourceManager, Utility.Path.Combine("bottom_circle.png")) { Position = new SharpDX.Vector2(157, 7) }); bottom.AddChild(stateString = new TextureString(device, Utility.Language["ChangeReadyState"], 16, PPDColors.White) { Position = new SharpDX.Vector2(180, 5) }); this.AddChild((bgd = new BackGroundDisplay(device, ResourceManager, "skins\\PPDMulti_BackGround.xml", "Menu"))); focusManager = new FocusManager(); focusManager.Focus(chatComponent); userList.Add(selfUser); chatComponent.Inputed += chatComponent_Inputed; textBox.LostFocused += textBox_LostFocused; leftMenu.Closed += leftMenu_Closed; if (selfUser.IsHost) { WebManager webManager = null; if (this.Param.ContainsKey("WebManager")) { webManager = this.Param["WebManager"] as WebManager; } RoomInfo roomInfo = null; if (this.Param.ContainsKey("RoomInfo")) { roomInfo = this.Param["RoomInfo"] as RoomInfo; } server = new PPDServer((int)Param["Port"], webManager, roomInfo, GameHost); server.FailedToCreateRoom += server_FailedToCreateRoom; client = new Client { Address = "127.0.0.1", Port = (int)Param["Port"] }; timer = new Timer(state => { server.Update(); }, null, 0, 1); } else { client = new Client { Address = (string)Param["IP"], Port = (int)Param["Port"] }; } client.Closed += client_Closed; client.Read += client_Read; byteReader = new TcpByteReader(); byteReader.ByteReaded += TcpByteReader_ByteReaded; if (server != null) { server.Start(); } client.Start(); if (client.HasConnection) { // send login data client.Write(MessagePackSerializer.Serialize(new AddUserNetworkData { UserName = selfUser.Name, AccountId = selfUser.AccountId, State = selfUser.CurrentState, Version = version })); } else { chatComponent.AddSystemMessage(Utility.Language["CannotConnectToHost"]); } // load SongInformation.All.ToArray(); return(true); }
public LeftMenu(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound, MovieManager movieManager, User user, ChangableList <User> users, AllowedModList allowedModList) : base(device) { this.gameHost = gameHost; this.resourceManager = resourceManager; this.sound = sound; this.movieManager = movieManager; this.user = user; this.users = users; this.allowedModList = allowedModList; this.AddChild(songSelectSprite = new SpriteObject(device)); this.AddChild(gameRuleSprite = new SpriteObject(device)); this.AddChild(userSelectSprite = new SpriteObject(device)); this.AddChild(itemSettingSprite = new SpriteObject(device)); this.AddChild(modSprite = new SpriteObject(device)); this.AddChild(leftSprite = new SpriteObject(device)); leftSprite.AddChild(back = new PictureObject(device, resourceManager, Utility.Path.Combine("leftmenu.png"))); enables = new bool[] { false, false, false, true, true, true, true, true, true, true, true }; user.PropertyChanged += (name) => { if (name == "IsLeader") { enables[0] = enables[1] = enables[2] = user.IsLeader; if (!user.IsLeader) { if (mode >= Mode.SongSelect && mode <= Mode.UserManage) { mode = Mode.ItemSetting; } } (back[0] as TextureString).Color = GetTextColor(0); (back[1] as TextureString).Color = GetTextColor(1); (back[2] as TextureString).Color = GetTextColor(2); } }; back.AddChild(new TextureString(device, Utility.Language["ChangeScore"], 16, GetTextColor()) { Position = new Vector2(30, 70) }); back.AddChild(new TextureString(device, Utility.Language["ChangeRule"], 16, GetTextColor()) { Position = new Vector2(30, 100) }); back.AddChild(new TextureString(device, Utility.Language["PlayerManager"], 16, GetTextColor()) { Position = new Vector2(30, 130) }); back.AddChild(new TextureString(device, Utility.Language["ItemUseSetting"], 16, GetTextColor()) { Position = new Vector2(30, 160) }); back.AddChild(new TextureString(device, Utility.Language["TryToPlayGame"], 16, GetTextColor()) { Position = new Vector2(30, 190) }); back.AddChild(new TextureString(device, String.Format("{0}:{1}", Utility.Language["MuteSE"], Utility.Language["OFF"]), 16, GetTextColor()) { Position = new Vector2(30, 220) }); back.AddChild(new TextureString(device, String.Format("{0}:{1}", Utility.Language["Connect"], Utility.Language["OFF"]), 16, GetTextColor()) { Position = new Vector2(30, 250) }); back.AddChild(new TextureString(device, Utility.Language["Result"], 16, GetTextColor()) { Position = new Vector2(30, 280) }); back.AddChild(new TextureString(device, Utility.Language["UpdateDB"], 16, GetTextColor()) { Position = new Vector2(30, 310) }); back.AddChild(new TextureString(device, Utility.Language["Mod"], 16, GetTextColor()) { Position = new Vector2(30, 340) }); back.AddChild(new TextureString(device, user.IsHost ? Utility.Language["FinishHost"] : Utility.Language["LeaveRoom"], 16, GetTextColor()) { Position = new Vector2(30, 370) }); Connect = SkinSetting.Setting.Connect; (back[(int)Mode.Connect] as TextureString).Text = String.Format("{0}:{1}", Utility.Language["Connect"], Connect ? Utility.Language["ON"] : Utility.Language["OFF"]); mode = Mode.ItemSetting; select = new EffectObject(device, resourceManager, Utility.Path.Combine("greenflare.etd")) { Position = new Vector2(15, back[(int)mode].Position.Y + selectDiffY) }; select.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop; select.Play(); select.Alignment = EffectObject.EffectAlignment.Center; select.Scale = new Vector2(0.4f, 0.4f); back.AddChild(select); leftSprite.Position = new Vector2(-back.Width, 0); Inputed += LeftMenu_Inputed; }
public PlayRecord(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device) { this.sound = sound; this.resourceManager = resourceManager; graphNameStrings = new string[] { Utility.Language["Score"], "Cool", "Good", "Safe", "Sad", "Worst", "MaxCombo", Utility.Language["FinishTime"] }; back = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "back.png")); back.AddChild(new TextureString(device, Utility.Language["PlayRecord"], 20, PPDColors.White) { Position = new Vector2(30, 28) }); top = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "recordtop.png")) { Position = new Vector2(440, 70) }; top.AddChild(new TextureString(device, Utility.Language["Difficulty"], 14, true, PPDColors.White) { Position = new Vector2(33, 4) }); top.AddChild(new TextureString(device, Utility.Language["Score"], 14, true, PPDColors.White) { Position = new Vector2(105, 4) }); top.AddChild(new TextureString(device, Utility.Language["Result"], 14, true, PPDColors.White) { Position = new Vector2(181, 4) }); top.AddChild(new TextureString(device, Utility.Language["PlayDate"], 14, true, PPDColors.White) { Position = new Vector2(269, 4) }); bottom = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "recordbottom.png")) { Position = new Vector2(440, 364) }; triangle = new PictureObject(device, resourceManager, Utility.Path.Combine("playrecord", "triangle.png"), true) { Position = new Vector2(300, 410), Hidden = true }; black = new RectangleComponent(device, resourceManager, PPDColors.Black) { RectangleHeight = 450, RectangleWidth = 800, Alpha = 0.65f }; cursor = new EffectObject(device, resourceManager, Utility.Path.Combine("playrecord", "cursor.etd")) { PlayType = Effect2D.EffectManager.PlayType.ReverseLoop }; cursor.Play(); cool = new TextureString(device, "", 14, PPDColors.White) { Position = new Vector2(510, 369) }; good = new TextureString(device, "", 14, PPDColors.White) { Position = new Vector2(510, 388) }; safe = new TextureString(device, "", 14, PPDColors.White) { Position = new Vector2(510, 409) }; sad = new TextureString(device, "", 14, PPDColors.White) { Position = new Vector2(705, 369) }; worst = new TextureString(device, "", 14, PPDColors.White) { Position = new Vector2(705, 388) }; maxCombo = new TextureString(device, "", 14, PPDColors.White) { Position = new Vector2(705, 409) }; songname = new TextureString(device, "", 20, PPDColors.White) { Position = new Vector2(250, 30) }; difficulty = new TextureString(device, "Easy", 20, PPDColors.White); difficulty.Position = new Vector2(240 - difficulty.Width / 2, 80 - difficulty.CharacterHeight / 2); gd = new GraphDrawer(device, resourceManager) { Position = new Vector2(30, 120), GraphWidth = 390, Name = Utility.Language["Score"], NamePositionCenter = new Vector2(220, 285) }; sprite = new SpriteObject(device) { Position = new Vector2(440, 98) }; rectangle = new LineRectangleComponent(device, resourceManager, PPDColors.Selection) { RectangleWidth = 314, RectangleHeight = 16, BorderThickness = 2 }; Inputed += PlayRecord_Inputed; GotFocused += PlayRecord_GotFocused; this.AddChild(cursor); this.AddChild(gd); this.AddChild(difficulty); this.AddChild(songname); this.AddChild(cool); this.AddChild(good); this.AddChild(safe); this.AddChild(sad); this.AddChild(worst); this.AddChild(maxCombo); this.AddChild(triangle); this.AddChild(top); this.AddChild(bottom); this.AddChild(rectangle); this.AddChild(sprite); this.AddChild(back); this.AddChild(black); }
public GameResultComponent(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device) { this.gameHost = gameHost; 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(resultSprite = new SpriteObject(device) { Position = new SharpDX.Vector2(50, SpriteY), Clip = new ClipInfo(gameHost) { PositionX = 40, PositionY = SpriteY, Width = 750, Height = ClipHeight } }); back.AddChild(scrollBar = new RectangleComponent(device, resourceManager, PPDColors.White) { Position = new Vector2(755, SpriteY), RectangleHeight = ScrollBarHeight, RectangleWidth = 5 }); back.AddChild(new TextureString(device, Utility.Language["Result"], 30, PPDColors.White) { Position = new SharpDX.Vector2(35, 30) }); back.AddChild(new TextureString(device, Utility.Language["Rank"], 14, PPDColors.White) { Position = new SharpDX.Vector2(50, 80) }); back.AddChild(new TextureString(device, Utility.Language["Player"], 14, PPDColors.White) { Position = new SharpDX.Vector2(150, 80) }); back.AddChild(new TextureString(device, Utility.Language["Score"], 14, PPDColors.White) { Position = new SharpDX.Vector2(270, 80) }); back.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "cool.png")) { Position = new SharpDX.Vector2(350, 82), Scale = new SharpDX.Vector2(0.5f) }); back.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "good.png")) { Position = new SharpDX.Vector2(410, 82), Scale = new SharpDX.Vector2(0.5f) }); back.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "safe.png")) { Position = new SharpDX.Vector2(470, 82), Scale = new SharpDX.Vector2(0.5f) }); back.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "sad.png")) { Position = new SharpDX.Vector2(530, 82), Scale = new SharpDX.Vector2(0.5f) }); back.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "worst.png")) { Position = new SharpDX.Vector2(580, 82), Scale = new SharpDX.Vector2(0.5f) }); back.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("eva", "combo.png")) { Position = new SharpDX.Vector2(650, 82), Scale = new SharpDX.Vector2(0.5f) }); Inputed += GameResultComponent_Inputed; GotFocused += GameResultComponent_GotFocused; Alpha = 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; }
public override bool Load() { WebManager.Instance.UpdateAccountInfo(); //init var list = SongInformation.All; int selectnum = 0; string initialdirectory = PPDSetting.Setting.SongDir; ContestInfo contestInfo = null; WebSongInformation[] activeScores = null; ListInfo[] lists = null; Action[] actions = { () => { contestInfo = WebManager.Instance.GetContestInfo(); }, () => { activeScores = WebManager.Instance.GetScores(true); }, () => { lists = WebManager.Instance.GetListInfos(); }, PerfectTrialCache.Instance.Update }; Parallel.ForEach(actions, (action) => action()); // 前のメニューからのパラメーターを調べる if (PreviousParam.TryGetValue("PPDGameUtility", out object temp)) { var gameutility = temp as PPDGameUtility; initialdirectory = gameutility.SongInformation.ParentDirectory; } ssm = new SelectSongManager(contestInfo, activeScores, lists); ssm.SongChanged += ssm_SongChanged; ssm.DirectoryChanged += ssm_DirectoryChanged; ssm.ModeChanged += ssm_ModeChanged; ssm.Filter.Desc = SkinSetting.Setting.Desc; ssm.Filter.Difficulty = SkinSetting.Setting.Difficulty; ssm.Filter.Field = SkinSetting.Setting.SortField; ssm.Filter.Type = SkinSetting.Setting.ScoreType; textBox = new DxTextBox(device, GameHost, ResourceManager); mss = new MenuSelectSong(device, ResourceManager, this); mss.Inputed += mss_Inputed; mss.GotFocused += mss_GotFocused; sic = new SongInfoControl(device, ResourceManager); sic.Inputed += sic_Inputed; cc = new ConfirmControl(device, ResourceManager); cc.Inputed += cc_Inputed; oc = new OptionControl(device, ResourceManager, Sound); lm = new LeftMenu(device, GameHost, ResourceManager, textBox, ssm, Sound); lm.RandomSelected += lm_RandomSelected; lm.FilterChanged += lm_FilterChanged; ss = new ScoreSearcher(device, ResourceManager, textBox, ssm.Filter); obd = new OpenBrowserDialog(device, ResourceManager, Sound); fm = new FocusManager(this); fm.Focus(mss); mss.DisapperFinish += cc.Show; bgd = new BackGroundDisplay(device, ResourceManager, "skins\\PPDSingle_BackGround.xml", "Menu"); black = new RectangleComponent(device, ResourceManager, PPDColors.Black) { RectangleHeight = 450, RectangleWidth = 800, Alpha = 0 }; menuMovie = new MenuMovie(device); this.AddChild(black); this.AddChild(textBox); this.AddChild(obd); this.AddChild(cc); this.AddChild(oc); this.AddChild(ss); this.AddChild(lm); this.AddChild(sic); this.AddChild(mss); var po = new PictureObject(device, ResourceManager, Utility.Path.Combine("bottom.png")); po.Position = new Vector2(0, 450 - po.Height + 1); po.AddChild(new TextureString(device, Utility.Language["SearchScore"], 14, PPDColors.Gray) { Position = new Vector2(85, 7) }); po.AddChild(new TextureString(device, Utility.Language["Move"], 14, PPDColors.Gray) { Position = new Vector2(205, 7) }); po.AddChild(new TextureString(device, Utility.Language["Menu"], 14, PPDColors.Gray) { Position = new Vector2(325, 7) }); po.AddChild(new TextureString(device, Utility.Language["Option"], 14, PPDColors.Gray) { Position = new Vector2(445, 7) }); po.AddChild(new TextureString(device, Utility.Language["Decide"], 14, PPDColors.Gray) { Position = new Vector2(565, 7) }); po.AddChild(new TextureString(device, Utility.Language["Back"], 14, PPDColors.Gray) { Position = new Vector2(685, 7) }); this.AddChild(po); this.AddChild(menuMovie); this.AddChild(bgd); oc.Connect = SkinSetting.Setting.Connect; oc.RivalGhost = SkinSetting.Setting.RivalGhost; ssm.CurrentRoot = SongInformation.Root; ssm.CurrentLogicRoot = LogicFolderInfomation.Root; if (PreviousParam.TryGetValue("CurrentRoot", out temp)) { var root = temp as SongInformation; ssm.CurrentRoot = root; } if (PreviousParam.TryGetValue("CurrentLogicRoot", out temp)) { var root = temp as LogicFolderInfomation; ssm.CurrentLogicRoot = root; } if (PreviousParam.TryGetValue("CurrentMode", out temp)) { var mode = (SelectSongManager.Mode)temp; ssm.ChangeMode(mode); } if (PreviousParam.TryGetValue("SelectedIndex", out temp)) { selectnum = (int)temp; } ssm.SelectedIndex = selectnum; return(true); }
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; }
public ItemSettingComponent(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(new TextureString(device, Utility.Language["ManualUse"], 16, true, PPDColors.White) { Position = new Vector2(200, 80) }); back.AddChild(new TextureString(device, Utility.Language["AutoUse"], 16, true, PPDColors.White) { Position = new Vector2(600, 80) }); back.AddChild(new LineRectangleComponent(device, resourceManager, PPDColors.White) { Position = new SharpDX.Vector2(50, 100), RectangleHeight = 310, RectangleWidth = 300 }); back.AddChild(new LineRectangleComponent(device, resourceManager, PPDColors.White) { Position = new SharpDX.Vector2(450, 100), RectangleHeight = 310, RectangleWidth = 300 }); back.AddChild(manualUseSprite = new SpriteObject(device) { Position = new SharpDX.Vector2(60, 105) }); back.AddChild(autoUseSprite = new SpriteObject(device) { Position = new SharpDX.Vector2(460, 105) }); back.AddChild(new TextureString(device, Utility.Language["ItemUseSetting"], 30, PPDColors.White) { Position = new Vector2(35, 30) }); Inputed += ItemSettingComponent_Inputed; GotFocused += ItemSettingComponent_GotFocused; for (int i = 0; i < ItemUseManager.Manager.AutoUseItemTypes.Length; i++) { autoUseSprite.AddChild(new UseItemComponent(device, resourceManager, ItemUseManager.Manager.AutoUseItemTypes[i]) { Position = new SharpDX.Vector2(0, i * 20) }); } var itemTypeArray = (ItemType[])Enum.GetValues(typeof(ItemType)); int addedCount = 0; for (int i = 1; i < itemTypeArray.Length; i++) { if (Array.IndexOf(ItemUseManager.Manager.AutoUseItemTypes, itemTypeArray[i]) < 0) { manualUseSprite.AddChild(new UseItemComponent(device, resourceManager, itemTypeArray[i]) { Position = new SharpDX.Vector2(0, addedCount * 20) }); addedCount++; } } if (manualUseSprite.ChildrenCount > 0) { current = manualUseSprite[0] as UseItemComponent; } else { current = autoUseSprite[0] as UseItemComponent; } current.Selected = true; }