diff --git a/Entities/Multilingual.cs b/Entities/Multilingual.cs index 3e97169b2..f1577809f 100644 --- a/Entities/Multilingual.cs +++ b/Entities/Multilingual.cs @@ -177,6 +177,7 @@ public static class Multilingual { {"level_no_statistical_data", " No statistical data"}, {"leaderboard_menu_title", "Leaderboard"}, + {"leaderboard_choose_a_round", "Choose a round"}, {"leaderboard_total_players_prefix", ""}, {"leaderboard_total_players_suffix", " total players"}, {"leaderboard_see_full_rankings_in_fallalytics", "See full rankings in FALLALYTICS"}, @@ -666,6 +667,7 @@ public static class Multilingual { {"level_no_statistical_data", " Aucune donnée statistique"}, {"leaderboard_menu_title", "Classement"}, + {"leaderboard_choose_a_round", "Choisissez un manche"}, {"leaderboard_total_players_prefix", ""}, {"leaderboard_total_players_suffix", " joueurs au total"}, {"leaderboard_see_full_rankings_in_fallalytics", "Voir le classement complet dans FALLALYTICS"}, @@ -774,7 +776,7 @@ public static class Multilingual { {"message_check_internet_connection", "S'il vous plait, vérifiez votre connexion internet."}, {"message_changelog_caption", "journal des modifications"}, {"message_changelog_bugfix_and_program_optimization", "Correction de bugs et optimisation du programme"}, - {"message_changelog_updated_new_show_and_round_names", "Nouveaux noms de spectacles et de rondes mis à jour"}, + {"message_changelog_updated_new_show_and_round_names", "Nouveaux noms de spectacles et de manche mis à jour"}, {"message_changelog_overlay_display_improvements", "Améliorations de l'affichage en l'overlay"}, {"message_changelog_added_and_improved_win_per_day_graph_feature", "Fonctionnalité graphique des victoire par jour ajoutée et améliorée"}, {"message_changelog_released_the_fallalytics_speedrun_leaderboard", "Publication du classement du speedrun FALLALYTICS"}, @@ -1155,6 +1157,7 @@ public static class Multilingual { {"level_no_statistical_data", " 통계 데이터 없음"}, {"leaderboard_menu_title", "리더보드"}, + {"leaderboard_choose_a_round", "라운드를 선택하세요"}, {"leaderboard_total_players_prefix", "총 "}, {"leaderboard_total_players_suffix", " 명의 플레이어"}, {"leaderboard_see_full_rankings_in_fallalytics", "폴라리틱스에서 전체 순위 보기"}, @@ -1644,6 +1647,7 @@ public static class Multilingual { {"level_no_statistical_data", " 統計データなし"}, {"leaderboard_menu_title", "リーダーボード"}, + {"leaderboard_choose_a_round", "ラウンドを選択してください。"}, {"leaderboard_total_players_prefix", "合計"}, {"leaderboard_total_players_suffix", "人のプレイヤー"}, {"leaderboard_see_full_rankings_in_fallalytics", "FALLALYTICS で完全なランキングを見る"}, @@ -2133,6 +2137,7 @@ public static class Multilingual { {"level_no_statistical_data", " 无统计数据"}, {"leaderboard_menu_title", "排行榜"}, + {"leaderboard_choose_a_round", "选择一轮。"}, {"leaderboard_total_players_prefix", "总共 "}, {"leaderboard_total_players_suffix", " 名玩家"}, {"leaderboard_see_full_rankings_in_fallalytics", "请参阅 FALLALYTICS 中的完整排名"}, @@ -2622,6 +2627,7 @@ public static class Multilingual { {"level_no_statistical_data", " 無統計數據"}, {"leaderboard_menu_title", "排行榜"}, + {"leaderboard_choose_a_round", "選擇一輪。"}, {"leaderboard_total_players_prefix", "總共 "}, {"leaderboard_total_players_suffix", " 名玩家"}, {"leaderboard_see_full_rankings_in_fallalytics", "請參閱 FALLALYTICS 中的完整排名"}, diff --git a/Views/LeaderboardDisplay.Designer.cs b/Views/LeaderboardDisplay.Designer.cs index 307461e0c..9f0f4ce16 100644 --- a/Views/LeaderboardDisplay.Designer.cs +++ b/Views/LeaderboardDisplay.Designer.cs @@ -31,6 +31,7 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LeaderboardDisplay)); this.mpsSpinner = new MetroFramework.Controls.MetroProgressSpinner(); this.lblTotalPlayers = new MetroFramework.Controls.MetroLabel(); + this.lblSearchDescription = new MetroFramework.Controls.MetroLabel(); this.mlVisitFallalytics = new MetroFramework.Controls.MetroLink(); this.cboRoundList = new FallGuysStats.ImageComboBox(); this.gridDetails = new FallGuysStats.Grid(); @@ -67,6 +68,18 @@ private void InitializeComponent() this.lblTotalPlayers.Text = "Total 500 players"; this.lblTotalPlayers.Visible = false; // + // lblSearchDescription + // + this.lblSearchDescription.AutoSize = true; + this.lblSearchDescription.FontSize = MetroFramework.MetroLabelSize.Tall; + this.lblSearchDescription.FontWeight = MetroFramework.MetroLabelWeight.Regular; + this.lblSearchDescription.Location = new System.Drawing.Point(423, 60); + this.lblSearchDescription.Name = "lblSearchDescription"; + this.lblSearchDescription.Size = new System.Drawing.Size(145, 25); + this.lblSearchDescription.TabIndex = 3; + this.lblSearchDescription.Text = "Choose a round"; + this.lblSearchDescription.Visible = false; + // // mlVisitFallalytics // this.mlVisitFallalytics.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -142,6 +155,7 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(1200, 805); this.Controls.Add(this.mpsSpinner); this.Controls.Add(this.lblTotalPlayers); + this.Controls.Add(this.lblSearchDescription); this.Controls.Add(this.mlVisitFallalytics); this.Controls.Add(this.cboRoundList); this.Controls.Add(this.gridDetails); @@ -166,6 +180,7 @@ private void InitializeComponent() private MetroFramework.Controls.MetroProgressSpinner mpsSpinner; private MetroFramework.Controls.MetroLabel lblTotalPlayers; + private MetroFramework.Controls.MetroLabel lblSearchDescription; private MetroFramework.Controls.MetroLink mlVisitFallalytics; private FallGuysStats.ImageComboBox cboRoundList; private FallGuysStats.Grid gridDetails; diff --git a/Views/LeaderboardDisplay.cs b/Views/LeaderboardDisplay.cs index 19e0f093a..3f67b09cb 100644 --- a/Views/LeaderboardDisplay.cs +++ b/Views/LeaderboardDisplay.cs @@ -14,7 +14,7 @@ public partial class LeaderboardDisplay : MetroFramework.Forms.MetroForm { DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle(); private readonly string LEADERBOARD_API_URL = "https://data.fallalytics.com/api/leaderboard"; private string key = String.Empty; - private int totalRank = 0; + private int totalPlayers; private List roundlist; private List recordholders; private List nodata = new List(); @@ -41,12 +41,16 @@ private void LeaderboardDisplay_Shown(object sender, EventArgs e) { private void LeaderboardDisplay_Resize(object sender, EventArgs e) { this.mpsSpinner.Location = new Point((this.ClientSize.Width - this.mpsSpinner.Width) / 2, (this.ClientSize.Height - this.mpsSpinner.Height) / 2); + this.lblSearchDescription.Location = new Point((this.ClientSize.Width - this.lblSearchDescription.Width) / 2, (this.ClientSize.Height - this.lblSearchDescription.Height) / 2); } private void SetTheme(MetroThemeStyle theme) { this.SuspendLayout(); this.lblTotalPlayers.Theme = theme; this.lblTotalPlayers.Location = new Point(this.cboRoundList.Right + 15, this.cboRoundList.Location.Y); + this.lblSearchDescription.Theme = theme; + this.lblSearchDescription.Text = $"{Multilingual.GetWord("leaderboard_choose_a_round")}"; + this.lblSearchDescription.Location = new Point((this.ClientSize.Width - this.lblSearchDescription.Width) / 2, (this.ClientSize.Height - this.lblSearchDescription.Height) / 2); 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); @@ -123,6 +127,7 @@ private void cboRoundList_SelectedIndexChanged(object sender, EventArgs e) { this.key = ((ImageItem)((ImageComboBox)sender).SelectedItem).DataArray[0]; this.lblTotalPlayers.Visible = false; this.lblTotalPlayers.Text = ""; + this.lblSearchDescription.Visible = false; this.mpsSpinner.Visible = true; this.gridDetails.DataSource = null; Task.Run(() => this.DataLoad(this.key)).ContinueWith(prevTask => { @@ -131,7 +136,8 @@ private void cboRoundList_SelectedIndexChanged(object sender, EventArgs e) { this.Text = $@" {Multilingual.GetWord("leaderboard_menu_title")} - {((ImageItem)((ImageComboBox)sender).SelectedItem).Text}"; this.mpsSpinner.Visible = false; this.gridDetails.DataSource = this.recordholders; - this.lblTotalPlayers.Text = $"{Multilingual.GetWord("leaderboard_total_players_prefix")}{this.totalRank}{Multilingual.GetWord("leaderboard_total_players_suffix")}"; + // 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.Visible = true; this.Refresh(); @@ -141,6 +147,7 @@ private void cboRoundList_SelectedIndexChanged(object sender, EventArgs e) { this.gridDetails.DataSource = this.nodata; this.lblTotalPlayers.Visible = false; this.mlVisitFallalytics.Visible = false; + this.lblSearchDescription.Visible = true; this.Refresh(); } }); @@ -155,6 +162,7 @@ private void SetRoundList() { this.BeginInvoke((MethodInvoker)delegate { if (prevTask.Result) { this.mpsSpinner.Visible = false; + this.lblSearchDescription.Visible = true; List roundItemList = new List(); foreach (RankRound round in this.roundlist) { foreach (var id in round.ids) { @@ -193,13 +201,13 @@ private bool DataLoad(string round = null) { Leaderboard leaderboard = JsonSerializer.Deserialize(json, options); result = leaderboard.found; if (result) { - this.totalRank = leaderboard.total; + this.totalPlayers = leaderboard.total; for (var i = 0; i < leaderboard.recordholders.Count; i++) { leaderboard.recordholders[i].rank = i + 1; } this.recordholders = leaderboard.recordholders; } else { - this.totalRank = 0; + this.totalPlayers = 0; } } } @@ -304,7 +312,7 @@ private void gridDetails_CellFormatting(object sender, DataGridViewCellFormattin if (info.rank == 1) { e.Value = Properties.Resources.medal_gold_grid_icon; } else { - double percentage = ((double)(info.rank - 1) / (this.totalRank - 1)) * 100; + double percentage = ((double)(info.rank - 1) / (this.totalPlayers - 1)) * 100; if (percentage <= 20) { e.Value = Properties.Resources.medal_silver_grid_icon; } else if (percentage <= 50) { diff --git a/Views/Stats.Designer.cs b/Views/Stats.Designer.cs index 6dd7156e6..85ccc805b 100644 --- a/Views/Stats.Designer.cs +++ b/Views/Stats.Designer.cs @@ -609,7 +609,7 @@ private void InitializeComponent() // this.lblLeaderboard.ForeColor = System.Drawing.Color.Blue; this.lblLeaderboard.Image = global::FallGuysStats.Properties.Resources.leaderboard_icon; - this.lblLeaderboard.Margin = new System.Windows.Forms.Padding(10, 1, 0, 2); + this.lblLeaderboard.Margin = new System.Windows.Forms.Padding(15, 1, 0, 2); this.lblLeaderboard.Name = "lblLeaderboard"; this.lblLeaderboard.Size = new System.Drawing.Size(69, 16); this.lblLeaderboard.Text = "Leaderboard";