public override OverlayItemBase GetItem() { if (this.GameComboBox.SelectedIndex < 0) { return(null); } if (this.CategoryComboBox.Visibility == Visibility.Visible && this.CategoryComboBox.SelectedIndex < 0) { return(null); } if (string.IsNullOrEmpty(this.UsernameTextBox.Text)) { return(null); } if (this.PlatformComboBox.SelectedIndex < 0) { return(null); } GameStatsPlatformTypeEnum platform = EnumHelper.GetEnumValueFromString <GameStatsPlatformTypeEnum>((string)this.PlatformComboBox.SelectedItem); string borderColor = this.BorderColorComboBox.Text; if (ColorSchemes.ColorSchemeDictionary.ContainsKey(borderColor)) { borderColor = ColorSchemes.ColorSchemeDictionary[borderColor]; } string backgroundColor = this.BackgroundColorComboBox.Text; if (ColorSchemes.ColorSchemeDictionary.ContainsKey(backgroundColor)) { backgroundColor = ColorSchemes.ColorSchemeDictionary[backgroundColor]; } string textColor = this.TextColorComboBox.Text; if (ColorSchemes.ColorSchemeDictionary.ContainsKey(textColor)) { textColor = ColorSchemes.ColorSchemeDictionary[textColor]; } if (string.IsNullOrEmpty(this.TextFontComboBox.Text)) { return(null); } if (string.IsNullOrEmpty(this.TextSizeComboBox.Text) || !int.TryParse(this.TextSizeComboBox.Text, out int textSize)) { return(null); } if (string.IsNullOrEmpty(this.HTMLText.Text)) { return(null); } GameStatsSetupBase setup = null; if (this.GameComboBox.SelectedIndex >= 0) { string gameName = (string)this.GameComboBox.SelectedItem; switch (gameName) { case RainboxSixSiegeGameStatsSetup.GameName: setup = new RainboxSixSiegeGameStatsSetup(this.UsernameTextBox.Text, platform); break; case FortniteGameStatsSetup.GameName: setup = new FortniteGameStatsSetup(this.UsernameTextBox.Text, platform, (string)this.CategoryComboBox.SelectedItem); break; case CallOfDutyBlackOps4GameStatsSetup.GameName: setup = new CallOfDutyBlackOps4GameStatsSetup(this.UsernameTextBox.Text, platform, (string)this.CategoryComboBox.SelectedItem); break; } } if (setup == null) { return(null); } return(new OverlayGameStats(this.HTMLText.Text, setup, borderColor, backgroundColor, textColor, this.TextFontComboBox.Text, textSize)); }
public CallOfDutyBlackOps4GameStatsSetup(string username, GameStatsPlatformTypeEnum platform, string category) : base(username, platform) { this.Category = category; }
public FortniteGameStatsSetup(string username, GameStatsPlatformTypeEnum platform, string category) : base(username, platform) { this.Category = category; }
public RainboxSixSiegeGameStatsSetup(string username, GameStatsPlatformTypeEnum platform) : base(username, platform) { }
protected GameStatsSetupBase(string username, GameStatsPlatformTypeEnum platform, string category) : this(username, platform) { this.Category = category; }
protected GameStatsSetupBase(string username, GameStatsPlatformTypeEnum platform) { this.Username = username; this.Platform = platform; }