diff --git a/Controls/ImageComboBox.cs b/Controls/ImageComboBox.cs index 2bed38b53..4a96ef60c 100644 --- a/Controls/ImageComboBox.cs +++ b/Controls/ImageComboBox.cs @@ -8,7 +8,7 @@ using MetroFramework; namespace FallGuysStats { - public class ImageComboBox : ComboBox { + public sealed class ImageComboBox : ComboBox { protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; @@ -25,34 +25,59 @@ public MetroThemeStyle Theme { _theme = value; SetBlur(); Invalidate(); + Update(); + } + } + } + + private string _name = String.Empty; + public string SelectedName { + get { return _name; } + set { + if (_name != value) { + _name = value; + } + } + } + + private Image _image; + public Image SelectedImage { + get { return _image; } + set { + if (_image != value) { + _image = value; } } } private Color _borderColor = Color.Gray; - public Color BorderColor { + private Color BorderColor { get { return _borderColor; } set { if (_borderColor != value) { _borderColor = value; Invalidate(); + Update(); } } } - public string ImageName { get; set; } - private Color buttonColor = Color.DarkGray; - public Color ButtonColor + + private Color _buttonColor = Color.DarkGray; + private Color ButtonColor { - get { return buttonColor; } + get { return _buttonColor; } set { - if (buttonColor != value) { - buttonColor = value; + if (_buttonColor != value) { + _buttonColor = value; Invalidate(); + Update(); } } } + protected override void WndProc(ref Message m) { - if (m.Msg == WM_PAINT && DropDownStyle != ComboBoxStyle.Simple) { + // if (m.Msg == WM_PAINT && DropDownStyle != ComboBoxStyle.Simple) { + if (m.Msg == WM_PAINT) { Rectangle clientRect = ClientRectangle; int dropDownButtonWidth = SystemInformation.HorizontalScrollBarArrowWidth; Rectangle outerBorder = new Rectangle(clientRect.Location, new Size(clientRect.Width - 1, clientRect.Height - 1)); @@ -118,10 +143,12 @@ protected override void WndProc(ref Message m) { } private const int WM_PAINT = 0xF; + [StructLayout(LayoutKind.Sequential)] public struct RECT { public int L, T, R, B; } + [StructLayout(LayoutKind.Sequential)] public struct PAINTSTRUCT { public IntPtr hdc; @@ -212,6 +239,8 @@ public void SetImageItemData(List imageItemArray) { this.GotFocus += ImageItemComboBox_GotFocus; this.LostFocus += ImageItemComboBox_LostFocus; + this.SelectedIndexChanged += ImageItemComboBox_SelectedIndexChanged; + SetBlur(); } #endregion @@ -233,7 +262,6 @@ private void ColorComboBox_DrawItem(object sender, DrawItemEventArgs e) { ); ComboBox comboBox = sender as ComboBox; - this.ImageName = comboBox.SelectedText; Color color = (Color)comboBox.Items[e.Index]; using(SolidBrush brush = new SolidBrush(color)) { @@ -264,7 +292,6 @@ private void ImageComboBox_MeasureItem(object sender, MeasureItemEventArgs e) { if (e.Index < 0) { return; } ComboBox comboBox = sender as ComboBox; - this.ImageName = comboBox.SelectedText; Image image = (Image)comboBox.Items[e.Index]; e.ItemHeight = image.Height + 2 * IMAGE_ITEM_MARGIN_HEIGHT; @@ -278,7 +305,6 @@ private void ImageComboBox_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); ComboBox comboBox = sender as ComboBox; - this.ImageName = comboBox.SelectedText; Image image = (Image)comboBox.Items[e.Index]; float height = e.Bounds.Height - 2 * IMAGE_ITEM_MARGIN_HEIGHT; @@ -306,7 +332,6 @@ private void ImageItemComboBox_MeasureItem(object sender, MeasureItemEventArgs e ComboBox comboBox = sender as ComboBox; ImageItem item = (ImageItem)comboBox.Items[e.Index]; - this.ImageName = item.Text; item.MeasureItem(e); } #endregion @@ -317,7 +342,6 @@ private void ImageItemComboBox_DrawItem(object sender, DrawItemEventArgs e) { ComboBox comboBox = sender as ComboBox; ImageItem item = (ImageItem)comboBox.Items[e.Index]; - this.ImageName = item.Text; item.DrawItem(e, this.ForeColor, this.Theme == MetroThemeStyle.Light ? Color.White : Color.FromArgb(17, 17, 17)); } @@ -336,6 +360,11 @@ private void ImageItemComboBox_GotFocus(object sender, EventArgs e) { private void ImageItemComboBox_LostFocus(object sender, EventArgs e) { this.SetBlur(); } + + private void ImageItemComboBox_SelectedIndexChanged(object sender, EventArgs e) { + this.SelectedName = ((ImageItem)((ImageComboBox)sender).SelectedItem).Text; + this.SelectedImage = ((ImageItem)((ImageComboBox)sender).SelectedItem).Image; + } private void SetFocus() { this.ForeColor = this.Theme == MetroThemeStyle.Light ? Color.Black : Color.FromArgb(204, 204, 204); diff --git a/Entities/ImageItem.cs b/Entities/ImageItem.cs index b81af32c9..5358dde8f 100644 --- a/Entities/ImageItem.cs +++ b/Entities/ImageItem.cs @@ -8,7 +8,7 @@ namespace FallGuysStats { public class ImageItem { #region Public Field public Image Image { get; set; } - public string[] DataArray { get; set; } + public string[] Data { get; set; } public string Text { get; set; } public Font Font { get; set; } public bool IsCustomized { get; set; } @@ -20,13 +20,13 @@ public class ImageItem { private const int MARGIN_HEIGHT = 2; private int width; private int height; - private bool sizeCalculated = false; + private bool sizeCalculated; #endregion #region Public Constructor - ImageItem(image, text, font) public ImageItem(Image image, string text, Font font, string[] dataArray = null, bool isCustomized = false) { this.Image = image; - this.DataArray = dataArray; + this.Data = dataArray; this.Text = text; this.Font = font; this.IsCustomized = isCustomized; diff --git a/Views/LeaderboardDisplay.Designer.cs b/Views/LeaderboardDisplay.Designer.cs index 9f0f4ce16..92f130ec8 100644 --- a/Views/LeaderboardDisplay.Designer.cs +++ b/Views/LeaderboardDisplay.Designer.cs @@ -73,11 +73,13 @@ private void InitializeComponent() this.lblSearchDescription.AutoSize = true; this.lblSearchDescription.FontSize = MetroFramework.MetroLabelSize.Tall; this.lblSearchDescription.FontWeight = MetroFramework.MetroLabelWeight.Regular; + this.lblSearchDescription.ForeColor = System.Drawing.Color.FromArgb(0, 174, 219); this.lblSearchDescription.Location = new System.Drawing.Point(423, 60); this.lblSearchDescription.Name = "lblSearchDescription"; - this.lblSearchDescription.Size = new System.Drawing.Size(145, 25); + this.lblSearchDescription.Size = new System.Drawing.Size(139, 25); this.lblSearchDescription.TabIndex = 3; this.lblSearchDescription.Text = "Choose a round"; + this.lblSearchDescription.UseCustomForeColor = true; this.lblSearchDescription.Visible = false; // // mlVisitFallalytics @@ -86,16 +88,18 @@ private void InitializeComponent() this.mlVisitFallalytics.AutoSize = true; this.mlVisitFallalytics.Cursor = System.Windows.Forms.Cursors.Hand; this.mlVisitFallalytics.FontSize = MetroFramework.MetroLinkSize.Tall; - this.mlVisitFallalytics.ForeColor = System.Drawing.Color.Black; + this.mlVisitFallalytics.ForeColor = System.Drawing.Color.FromArgb(0, 174, 219); this.mlVisitFallalytics.Image = global::FallGuysStats.Properties.Resources.fallalytics_icon; this.mlVisitFallalytics.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.mlVisitFallalytics.ImageSize = 20; this.mlVisitFallalytics.Location = new System.Drawing.Point(836, 60); this.mlVisitFallalytics.Name = "mlVisitFallalytics"; - this.mlVisitFallalytics.Size = new System.Drawing.Size(312, 29); + this.mlVisitFallalytics.Size = new System.Drawing.Size(310, 29); this.mlVisitFallalytics.TabIndex = 7; this.mlVisitFallalytics.Text = "See full rankings in FALLALYTICS"; this.mlVisitFallalytics.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.mlVisitFallalytics.UseCustomBackColor = true; + this.mlVisitFallalytics.UseCustomForeColor = true; this.mlVisitFallalytics.UseSelectable = true; this.mlVisitFallalytics.UseStyleColors = true; this.mlVisitFallalytics.Visible = false; @@ -103,18 +107,17 @@ private void InitializeComponent() // // cboRoundList // - this.cboRoundList.BorderColor = System.Drawing.Color.Gray; - this.cboRoundList.ButtonColor = System.Drawing.Color.DarkGray; this.cboRoundList.Cursor = System.Windows.Forms.Cursors.Hand; this.cboRoundList.DropDownHeight = 414; this.cboRoundList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboRoundList.FormattingEnabled = true; - this.cboRoundList.ImageName = null; + this.cboRoundList.IntegralHeight = false; this.cboRoundList.ItemHeight = 23; this.cboRoundList.Location = new System.Drawing.Point(11, 61); this.cboRoundList.Name = "cboRoundList"; this.cboRoundList.Size = new System.Drawing.Size(400, 20); this.cboRoundList.TabIndex = 1; + this.cboRoundList.Theme = MetroFramework.MetroThemeStyle.Light; this.cboRoundList.SelectedIndexChanged += new System.EventHandler(this.cboRoundList_SelectedIndexChanged); // // gridDetails @@ -122,7 +125,7 @@ private void InitializeComponent() this.gridDetails.AllowUserToDeleteRows = false; this.gridDetails.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gridDetails.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.gridDetails.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single; + this.gridDetails.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.BackColor = System.Drawing.Color.LightGray; dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); @@ -140,11 +143,10 @@ private void InitializeComponent() this.gridDetails.RowHeadersVisible = false; this.gridDetails.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.gridDetails.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.gridDetails.Size = new System.Drawing.Size(1179, 692); + this.gridDetails.Size = new System.Drawing.Size(1179, 696); this.gridDetails.TabIndex = 2; this.gridDetails.DataSourceChanged += new System.EventHandler(this.gridDetails_DataSourceChanged); this.gridDetails.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.gridDetails_CellFormatting); - // this.gridDetails.ColumnHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.gridDetails_ColumnHeaderMouseClick); this.gridDetails.SelectionChanged += new System.EventHandler(this.gridDetails_SelectionChanged); // // LeaderboardDisplay @@ -152,7 +154,7 @@ private void InitializeComponent() this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255))))); - this.ClientSize = new System.Drawing.Size(1200, 805); + this.ClientSize = new System.Drawing.Size(1200, 809); this.Controls.Add(this.mpsSpinner); this.Controls.Add(this.lblTotalPlayers); this.Controls.Add(this.lblSearchDescription); @@ -162,6 +164,9 @@ private void InitializeComponent() this.ForeColor = System.Drawing.Color.Black; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; + this.MaximizeBox = false; + this.MaximumSize = new System.Drawing.Size(1200, 1287); + this.MinimumSize = new System.Drawing.Size(1200, 413); this.Name = "LeaderboardDisplay"; this.Padding = new System.Windows.Forms.Padding(23, 60, 23, 18); this.ShadowType = MetroFramework.Forms.MetroFormShadowType.AeroShadow; diff --git a/Views/LeaderboardDisplay.cs b/Views/LeaderboardDisplay.cs index eb21603e6..54aa77249 100644 --- a/Views/LeaderboardDisplay.cs +++ b/Views/LeaderboardDisplay.cs @@ -46,6 +46,7 @@ private void LeaderboardDisplay_Resize(object sender, EventArgs e) { private void SetTheme(MetroThemeStyle theme) { this.SuspendLayout(); + this.cboRoundList.Theme = theme; this.lblTotalPlayers.Theme = theme; this.lblTotalPlayers.Location = new Point(this.cboRoundList.Right + 15, this.cboRoundList.Location.Y); this.lblSearchDescription.Theme = theme; @@ -54,12 +55,12 @@ private void SetTheme(MetroThemeStyle theme) { this.mpsSpinner.BackColor = theme == MetroThemeStyle.Light ? Color.White : Color.FromArgb(17, 17, 17); // this.mpsSpinner.Location = new Point(this.cboRoundList.Right + 15, this.cboRoundList.Location.Y); this.mpsSpinner.Location = new Point((this.ClientSize.Width - this.mpsSpinner.Width) / 2, (this.ClientSize.Height - this.mpsSpinner.Height) / 2 + 20); - this.cboRoundList.Theme = theme; this.gridDetails.Theme = theme; this.gridDetails.BackgroundColor = theme == MetroThemeStyle.Light ? Color.White : Color.FromArgb(17, 17, 17); this.gridDetails.ColumnHeadersDefaultCellStyle = this.dataGridViewCellStyle1; this.gridDetails.DefaultCellStyle = this.dataGridViewCellStyle2; + this.gridDetails.RowTemplate.Height = 32; this.dataGridViewCellStyle1.Font = Overlay.GetMainFont(12); this.dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleLeft; @@ -79,7 +80,8 @@ private void SetTheme(MetroThemeStyle theme) { this.gridDetails.SetContextMenuTheme(); - this.mlVisitFallalytics.Theme = theme; + // this.mlVisitFallalytics.Theme = theme; + this.mlVisitFallalytics.BackColor = theme == MetroThemeStyle.Light ? Color.White : Color.FromArgb(17, 17, 17); this.mlVisitFallalytics.Text = $@" {Multilingual.GetWord("leaderboard_see_full_rankings_in_fallalytics")}"; switch (Stats.CurrentLanguage) { case Language.English: @@ -104,26 +106,30 @@ private void SetTheme(MetroThemeStyle theme) { this.Theme = theme; this.ResumeLayout(); + this.Refresh(); } private void cboRoundList_SelectedIndexChanged(object sender, EventArgs e) { - if ((ImageItem)((ImageComboBox)sender).SelectedItem == null || ((ImageItem)((ImageComboBox)sender).SelectedItem).DataArray[0].Equals(this.key)) { return; } - this.key = ((ImageItem)((ImageComboBox)sender).SelectedItem).DataArray[0]; + if ((ImageItem)((ImageComboBox)sender).SelectedItem == null || ((ImageItem)((ImageComboBox)sender).SelectedItem).Data[0].Equals(this.key)) { return; } + this.key = ((ImageItem)((ImageComboBox)sender).SelectedItem).Data[0]; + this.cboRoundList.Enabled = false; this.lblTotalPlayers.Visible = false; this.lblTotalPlayers.Text = ""; this.lblSearchDescription.Visible = false; this.mpsSpinner.Visible = true; - this.gridDetails.DataSource = null; + this.gridDetails.DataSource = this.nodata; Task.Run(() => this.DataLoad(this.key)).ContinueWith(prevTask => { this.BeginInvoke((MethodInvoker)delegate { if (prevTask.Result) { - this.Text = $@" {Multilingual.GetWord("leaderboard_menu_title")} - {((ImageItem)((ImageComboBox)sender).SelectedItem).Text}"; + this.Text = $@" {Multilingual.GetWord("leaderboard_menu_title")} - {((ImageComboBox)sender).SelectedName}"; this.mpsSpinner.Visible = false; this.gridDetails.DataSource = this.recordholders; // this.lblTotalPlayers.Location = new Point(this.cboRoundList.Right + 15, this.cboRoundList.Location.Y); this.lblTotalPlayers.Text = $"{Multilingual.GetWord("leaderboard_total_players_prefix")}{this.totalPlayers}{Multilingual.GetWord("leaderboard_total_players_suffix")}"; this.lblTotalPlayers.Visible = true; + // this.mlVisitFallalytics.Image = ((ImageComboBox)sender).SelectedImage; this.mlVisitFallalytics.Visible = true; + this.cboRoundList.Enabled = true; this.Refresh(); } else { this.Text = $@" {Multilingual.GetWord("leaderboard_menu_title")}"; @@ -159,10 +165,10 @@ private void SetRoundList() { roundItemList.Sort((x, y) => String.CompareOrdinal(x.Text, y.Text)); this.cboRoundList.SetImageItemData(roundItemList); this.cboRoundList.Enabled = true; - this.cboRoundList.Invalidate(); + this.cboRoundList.Refresh(); } else { this.mpsSpinner.Visible = false; - this.cboRoundList.Invalidate(); + this.cboRoundList.Refresh(); } }); }); diff --git a/Views/Settings.Designer.cs b/Views/Settings.Designer.cs index 3507770da..b2979b741 100644 --- a/Views/Settings.Designer.cs +++ b/Views/Settings.Designer.cs @@ -880,13 +880,10 @@ private void InitializeComponent() // // cboMultilingual // - this.cboMultilingual.BorderColor = System.Drawing.Color.Gray; - this.cboMultilingual.ButtonColor = System.Drawing.Color.DarkGray; this.cboMultilingual.Cursor = System.Windows.Forms.Cursors.Hand; this.cboMultilingual.DropDownHeight = 414; this.cboMultilingual.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboMultilingual.FormattingEnabled = true; - this.cboMultilingual.ImageName = null; this.cboMultilingual.ItemHeight = 23; this.cboMultilingual.Location = new System.Drawing.Point(53, 412); this.cboMultilingual.Name = "cboMultilingual"; @@ -1395,13 +1392,10 @@ private void InitializeComponent() // // cboOverlayBackground // - this.cboOverlayBackground.BorderColor = System.Drawing.Color.Gray; - this.cboOverlayBackground.ButtonColor = System.Drawing.Color.DarkGray; this.cboOverlayBackground.Cursor = System.Windows.Forms.Cursors.Hand; this.cboOverlayBackground.DropDownHeight = 414; this.cboOverlayBackground.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboOverlayBackground.FormattingEnabled = true; - this.cboOverlayBackground.ImageName = null; this.cboOverlayBackground.ItemHeight = 23; this.cboOverlayBackground.Location = new System.Drawing.Point(203, 348); this.cboOverlayBackground.Name = "cboOverlayBackground"; diff --git a/Views/Settings.cs b/Views/Settings.cs index afd6e7ab3..c9408e5a0 100644 --- a/Views/Settings.cs +++ b/Views/Settings.cs @@ -10,14 +10,6 @@ namespace FallGuysStats { public partial class Settings : MetroFramework.Forms.MetroForm { - protected override CreateParams CreateParams { - get { - CreateParams cp = base.CreateParams; - cp.ExStyle |= 0x02000000; - return cp; - } - } - private string overlayFontSerialized = string.Empty; private string overlayFontColorSerialized = string.Empty; public UserSettings CurrentSettings { get; set; } @@ -185,14 +177,14 @@ private void Settings_Load(object sender, EventArgs e) { bool isSelected = false; if (this.CurrentSettings.IsOverlayBackgroundCustomized) { for (int i = 0; i < overlayItemArray.Count; i++) { - if (!((ImageItem)overlayItemArray[i]).DataArray[0].Equals(this.CurrentSettings.OverlayBackgroundResourceName)) { continue; } + if (!overlayItemArray[i].Data[0].Equals(this.CurrentSettings.OverlayBackgroundResourceName)) { continue; } this.cboOverlayBackground.SelectedIndex = i; isSelected = true; break; } } else { for (int i = overlayItemArray.Count - 1; i >= 0; i--) { - if (!((ImageItem)overlayItemArray[i]).DataArray[0].Equals(this.CurrentSettings.OverlayBackgroundResourceName)) { continue; } + if (!overlayItemArray[i].Data[0].Equals(this.CurrentSettings.OverlayBackgroundResourceName)) { continue; } this.cboOverlayBackground.SelectedIndex = i; isSelected = true; break; @@ -334,7 +326,7 @@ private void SetTheme(MetroThemeStyle theme) { } this.Theme = theme; this.ResumeLayout(); - this.Invalidate(true); + this.Refresh(); } private void btnPlayNotificationSounds_Click(object sender, EventArgs e) { @@ -357,7 +349,7 @@ private void btnPlayNotificationSounds_Click(object sender, EventArgs e) { private void cboTheme_SelectedIndexChanged(object sender, EventArgs e) { this.SetTheme(((ComboBox)sender).SelectedIndex == 0 ? MetroThemeStyle.Light : ((ComboBox)sender).SelectedIndex == 1 ? MetroThemeStyle.Dark : MetroThemeStyle.Default); - this.Invalidate(true); + this.Refresh(); } private void btnSave_Click(object sender, EventArgs e) { @@ -483,8 +475,8 @@ private void btnSave_Click(object sender, EventArgs e) { this.CurrentSettings.HideOverlayPercentages = this.chkHidePercentages.Checked; this.CurrentSettings.HoopsieHeros = this.chkChangeHoopsieLegends.Checked; - this.CurrentSettings.OverlayBackgroundResourceName = ((ImageItem)this.cboOverlayBackground.SelectedItem).DataArray[0]; - this.CurrentSettings.OverlayTabResourceName = ((ImageItem)this.cboOverlayBackground.SelectedItem).DataArray[1]; + this.CurrentSettings.OverlayBackgroundResourceName = ((ImageItem)this.cboOverlayBackground.SelectedItem).Data[0]; + this.CurrentSettings.OverlayTabResourceName = ((ImageItem)this.cboOverlayBackground.SelectedItem).Data[1]; this.CurrentSettings.OverlayBackground = this.cboOverlayBackground.SelectedIndex; this.CurrentSettings.IsOverlayBackgroundCustomized = ((ImageItem)this.cboOverlayBackground.SelectedItem).IsCustomized; @@ -743,7 +735,9 @@ private void btnResetOverlayFont_Click(object sender, EventArgs e) { private void cboMultilingual_SelectedIndexChanged(object sender, EventArgs e) { if (this.DisplayLang == (Language)((ImageComboBox)sender).SelectedIndex) return; - this.ChangeLanguage((Language)((ImageComboBox)sender).SelectedIndex); + this.BeginInvoke((MethodInvoker)delegate { + this.ChangeLanguage((Language)((ImageComboBox)sender).SelectedIndex); + }); } private void trkOverlayOpacity_ValueChanged(object sender, EventArgs e) { @@ -1019,7 +1013,7 @@ private void ChangeLanguage(Language lang) { this.chkAutoUpdate.Visible = false; #endif Stats.CurrentLanguage = tempLanguage; - this.Invalidate(true); + // this.Invalidate(true); } private void ChangeTab(object sender, EventArgs e) { @@ -1045,30 +1039,18 @@ private void ChangeTab(object sender, EventArgs e) { if (sender.Equals(this.tileProgram)) { this.tileProgram.Style = MetroColorStyle.Teal; this.panelProgram.Visible = true; - } - if (sender.Equals(this.tileDisplay)) { + } else if (sender.Equals(this.tileDisplay)) { this.tileDisplay.Style = MetroColorStyle.Teal; this.panelDisplay.Visible = true; - } - if (sender.Equals(this.tileOverlay)) { + } else if (sender.Equals(this.tileOverlay)) { this.tileOverlay.Style = MetroColorStyle.Teal; this.panelOverlay.Visible = true; - } - if (sender.Equals(this.tileFallGuys)) { + } else if (sender.Equals(this.tileFallGuys)) { this.tileFallGuys.Style = MetroColorStyle.Teal; this.panelFallGuys.Visible = true; - } - if (sender.Equals(this.tileAbout)) { + } else if (sender.Equals(this.tileAbout)) { this.tileAbout.Style = MetroColorStyle.Teal; - this.panelAbout.Visible = true; - } - if (sender.Equals(this.tileFallalytics)) { - this.tileFallalytics.Style = MetroColorStyle.Teal; - this.panelFallalytics.Visible = true; - } - - if (sender.Equals(this.tileAbout)) { -#if AllowUpdate + #if AllowUpdate this.lblupdateNote.Text = Multilingual.GetWord("settings_checking_for_updates"); using (ZipWebClient web = new ZipWebClient()) { string assemblyInfo = web.DownloadString(@"https://raw.githubusercontent.com/ShootMe/FallGuysStats/master/Properties/AssemblyInfo.cs"); @@ -1097,8 +1079,12 @@ private void ChangeTab(object sender, EventArgs e) { this.lblupdateNote.Text = $"{Multilingual.GetWord("main_update_prefix_tooltip", this.DisplayLang).Trim()}{Environment.NewLine}{Multilingual.GetWord("main_update_suffix_tooltip", this.DisplayLang).Trim()}"; this.lblupdateNote.ForeColor = this.Theme == MetroThemeStyle.Light ? Color.Black : Color.WhiteSmoke; #endif + this.panelAbout.Visible = true; + } else if (sender.Equals(this.tileFallalytics)) { + this.tileFallalytics.Style = MetroColorStyle.Teal; + this.panelFallalytics.Visible = true; } - this.Invalidate(true); + this.Refresh(); }); }