public override void OnApplicationStarted() { // Add code to be executed when Playnite is initialized. if (settings.EnableIntegrationButton) { foreach (Button bt in Tools.FindVisualChildren <Button>(Application.Current.MainWindow)) { if (bt.Name == "PART_ButtonSteamFriends") { logger.Debug("Statistics - PART_ButtonSteamFriends find"); Button sBt = new StatisticsButton(TransformIcon.Get("statistics")); sBt.Click += sBt_ClickEvent; sBt.Width = bt.ActualWidth; DockPanel.SetDock(sBt, Dock.Right); DockPanel ControlParent = ((DockPanel)bt.Parent); for (int i = 0; i < ControlParent.Children.Count; i++) { if (((FrameworkElement)ControlParent.Children[i]).Name == "PART_ButtonSteamFriends") { logger.Debug("Statistics - sBt add"); ControlParent.Children.Insert((i - 1), sBt); i = 200; } } break; } else { logger.Debug("Statistics - PART_ButtonSteamFriends not find"); } } } }
void ReleaseDesignerOutlets() { if (BackgroundView != null) { BackgroundView.Dispose(); BackgroundView = null; } if (BasicButton != null) { BasicButton.Dispose(); BasicButton = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (DefenseButton != null) { DefenseButton.Dispose(); DefenseButton = null; } if (DescriptionButton != null) { DescriptionButton.Dispose(); DescriptionButton = null; } if (FeatsButton != null) { FeatsButton.Dispose(); FeatsButton = null; } if (HeaderLabel != null) { HeaderLabel.Dispose(); HeaderLabel = null; } if (HeaderView != null) { HeaderView.Dispose(); HeaderView = null; } if (OffenseButton != null) { OffenseButton.Dispose(); OffenseButton = null; } if (OKButton != null) { OKButton.Dispose(); OKButton = null; } if (PageBorderView != null) { PageBorderView.Dispose(); PageBorderView = null; } if (PageView != null) { PageView.Dispose(); PageView = null; } if (SpecialButton != null) { SpecialButton.Dispose(); SpecialButton = null; } if (StatisticsButton != null) { StatisticsButton.Dispose(); StatisticsButton = null; } }
public override void build() { base.build(); background = new StaticObject(".\\Sprites\\rufusConcept"); background.init(content); addChild(background); outt = false; ButtonModel playModel = new ButtonModel(".\\Sprites\\GUI\\playButtonNew\\playButtonNew", ".\\Sprites\\GUI\\playButtonNew\\playButtonNewXML", null); soundButton = new SoundButton(null); soundButton.init(content); soundButton.position.X = 700f; soundButton.position.Y = 40f; infoButton = new InfoButton(Game1.showDevCard); infoButton.init(content); infoButton.position.X = 40f; infoButton.position.Y = 40f; playButton = new SimpleButton(playModel, "", new Point(), gotoGame); playButton.fontMargin = new Vector2(55, 15); playButton.fontScale = 1; playButton.init(content); playButton.position.Y = 480; playButton.position.X = 500; playButton.tweener = new Tweener(playButton.position.Y, 350f, TimeSpan.FromSeconds(1.0f), Back.EaseOut); playButton.tweener.Start(); ButtonModel shopModel = new ButtonModel(".\\Sprites\\GUI\\shopButton\\shopButton", ".\\Sprites\\GUI\\shopButton\\shopButtonXML", null); shopButton = new SimpleButton(shopModel, "", new Point(), gotoShop); shopButton.fontMargin = new Vector2(55, 15); shopButton.fontScale = 1; shopButton.init(content); shopButton.position.Y = 480; shopButton.position.X = 148; shopButton.tweener = new Tweener(shopButton.position.Y, 350f, TimeSpan.FromSeconds(1.0f), Back.EaseOut); shopButton.tweener.Start(); statisticsButton = new StatisticsButton(openStatistic); statisticsButton.init(content); statisticsButton.position.Y = 480; statisticsButton.position.X = 40; statisticsButton.tweener = new Tweener(statisticsButton.position.Y, 350f, TimeSpan.FromSeconds(1.0f), Back.EaseOut); statisticsButton.tweener.Start(); ButtonModel logoModel = new ButtonModel(".\\Sprites\\GUI\\rufusLogo", "", null); logoButton = new SimpleButton(logoModel, "", new Point(), null); logoButton.init(content); logoButton.position.Y = -100; logoButton.position.X = 140; logoButton.tweener = new Tweener(logoButton.position.Y, 20f, TimeSpan.FromSeconds(1.0f), Back.EaseOut); logoButton.tweener.Start(); starsLabel = new IncrementalLabel(0, ButtonFactory.spriteFont); starsLabel.init(content); starsLabel.newValue(GameModel.currentPoints); starsLabel.position.Y = shopButton.position.Y + 25; starsLabel.position.X = shopButton.position.X + 72; starsLabel.fontSize = 0.8f; addChild(playButton); addChild(shopButton); addChild(statisticsButton); addChild(logoButton); addChild(starsLabel); addChild(soundButton); addChild(infoButton); }