Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qubqub committed Nov 16, 2023
1 parent 99fa123 commit e5bfa94
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions Views/LeaderboardDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void SetRoundList() {
foreach (RankRound round in this.roundlist) {
foreach (string id in round.ids) {
if (LevelStats.ALL.TryGetValue(id, out LevelStats levelStats)) {
roundItemList.Add(new ImageItem(Utils.ResizeImageHeight(levelStats.RoundBigIcon, 23), levelStats.Name, Overlay.GetMainFont(14), new[] { round.queryname }));
roundItemList.Add(new ImageItem(Utils.ResizeImageHeight(levelStats.RoundBigIcon, 23), levelStats.Name, Overlay.GetMainFont(14), new[] { round.queryname, levelStats.Id }));
break;
}
}
Expand Down Expand Up @@ -160,6 +160,7 @@ private void SetGridList(string queryKey) {
this.Text = $@" {Multilingual.GetWord("leaderboard_menu_title")} - {this.cboRoundList.SelectedName}";
this.mpsSpinner.Visible = false;
this.gridDetails.DataSource = this.recordholders;
this.BackImage = LevelStats.ALL.TryGetValue(((ImageItem)this.cboRoundList.SelectedItem).Data[1], out LevelStats levelStats) ? levelStats.RoundBigIcon : ((ImageItem)this.cboRoundList.SelectedItem).Image;
this.lblTotalPlayers.Text = $@"{Multilingual.GetWord("leaderboard_total_players_prefix")}{this.totalPlayers}{Multilingual.GetWord("leaderboard_total_players_suffix")}";
this.lblTotalPlayers.Visible = true;
this.mlRefreshList.Location = new Point(this.lblTotalPlayers.Right + 5, this.mlRefreshList.Location.Y);
Expand All @@ -183,6 +184,7 @@ private void SetGridList(string queryKey) {
this.lblTotalPlayers.Visible = false;
this.mlRefreshList.Visible = false;
this.mlVisitFallalytics.Visible = false;
this.BackImage = this.Theme == MetroThemeStyle.Light ? Properties.Resources.leaderboard_icon : Properties.Resources.leaderboard_gray_icon;
this.lblSearchDescription.Text = Multilingual.GetWord("level_detail_no_data_caption");
this.lblSearchDescription.Visible = true;
this.lblPagingInfo.Visible = false;
Expand Down Expand Up @@ -304,19 +306,14 @@ private void gridDetails_CellFormatting(object sender, DataGridViewCellFormattin
// this.gridDetails.Rows[e.RowIndex].DefaultCellStyle.Font = Overlay.GetMainFont(14f, FontStyle.Bold);
}
if (this.gridDetails.Columns[e.ColumnIndex].Name == "rank") {
e.CellStyle.Font = Overlay.GetMainFont(18f);
e.CellStyle.Font = Overlay.GetMainFont(16f, FontStyle.Bold);
} else if (this.gridDetails.Columns[e.ColumnIndex].Name == "show") {
if (!string.IsNullOrEmpty((string)e.Value)) {
e.Value = Multilingual.GetShowName((string)e.Value) ?? e.Value;
}
} else if (this.gridDetails.Columns[e.ColumnIndex].Name == "flag") {
if ("1".Equals(info.onlineServiceType) && "oank20".Equals(info.onlineServiceId)) {
this.gridDetails.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = Multilingual.GetCountryName("SA");
e.Value = Properties.Resources.country_sa_icon;
} else {
if (!info.isAnonymous && !string.IsNullOrEmpty(info.country)) this.gridDetails.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = Multilingual.GetCountryName(info.country);
e.Value = info.isAnonymous ? Properties.Resources.country_unknown_icon : (string.IsNullOrEmpty(info.country) ? Properties.Resources.country_unknown_icon : (Image)Properties.Resources.ResourceManager.GetObject($"country_{info.country.ToLower()}_icon"));
}
if (!info.isAnonymous && !string.IsNullOrEmpty(info.country)) this.gridDetails.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = Multilingual.GetCountryName(info.country);
e.Value = info.isAnonymous ? Properties.Resources.country_unknown_icon : (string.IsNullOrEmpty(info.country) ? Properties.Resources.country_unknown_icon : (Image)Properties.Resources.ResourceManager.GetObject($"country_{info.country.ToLower()}_icon"));
} else if (this.gridDetails.Columns[e.ColumnIndex].Name == "platform") {
if (!info.isAnonymous) {
this.gridDetails.Rows[e.RowIndex].Cells[e.ColumnIndex].ToolTipText = Multilingual.GetWord((info.onlineServiceType == "0" ? "level_detail_online_platform_eos" : "level_detail_online_platform_steam"));
Expand Down

0 comments on commit e5bfa94

Please sign in to comment.