Exemple #1
0
        public void refersh_history_table()
        {
            if (!force_refresh)
            {
                new_selection = Filter.FilterString(filter_selections);

                if (new_selection == previous_selection)
                {
                    return;
                }
            }

            force_refresh      = false;
            previous_selection = new_selection;
            Filter.ResetFilters(filter_selections);

            dg_match_history_view.Rows.Clear();
            dg_match_history_view.AllowUserToAddRows = true;
            foreach (FileTraceManagment.MatchRecord match in history.ToList())
            {
                if (!Filter.CheckFilters(filter_selections, match, build_records, session, translations))
                {
                    continue;
                }

                DataGridViewRow row      = (DataGridViewRow)dg_match_history_view.Rows[0].Clone();
                TimeSpan        duration = match.MatchData.MatchEnd - match.MatchData.MatchStart;
                row.Cells[0].Value  = FileTraceManagment.DecodeMatchType(match.MatchData.MatchType);
                row.Cells[1].Value  = match.MatchData.MatchStart;
                row.Cells[2].Value  = match.MatchData.MatchEnd - match.MatchData.MatchStart;
                row.Cells[3].Value  = Translate.TranslateString(match.MatchData.MapDesc, session, translations);
                row.Cells[4].Value  = match.MatchData.LocalPlayer.BuildHash;
                row.Cells[5].Value  = match.MatchData.LocalPlayer.PowerScore;
                row.Cells[6].Value  = match.MatchData.LocalPlayer.Stats.Score;
                row.Cells[7].Value  = match.MatchData.LocalPlayer.Stats.Kills;
                row.Cells[8].Value  = match.MatchData.LocalPlayer.Stats.Assists;
                row.Cells[9].Value  = match.MatchData.LocalPlayer.Stats.DroneKills;
                row.Cells[10].Value = Math.Round(match.MatchData.LocalPlayer.Stats.Damage, 1);
                row.Cells[11].Value = Math.Round(match.MatchData.LocalPlayer.Stats.DamageTaken, 1);
                row.Cells[12].Value = match.MatchData.GameResult;
                row.Cells[13].Value = string.Join(",", match.MatchData.MatchRewards.Where(x => x.Key.ToLower().Contains("xp") == false && x.Key != "score").Select(x => Translate.TranslateString(x.Key, session, translations) + ":" + x.Value.ToString()));


                dg_match_history_view.Rows.Add(row);
            }

            dg_match_history_view.AllowUserToAddRows = false;
            dg_match_history_view.Sort(dg_match_history_view.SortedColumn ?? dg_match_history_view.Columns[1], ((int)dg_match_history_view.SortOrder) != 1 ? ListSortDirection.Descending : ListSortDirection.Ascending);

            Filter.PopulateFilters(filter_selections, cb_game_modes, cb_grouped, cb_power_score, cb_versions, cb_weapons, cb_movement, cb_cabins, cb_modules);
        }