Beispiel #1
0
        private void targetListView_SelectionChanged( object sender, SelectionChangedEventArgs e )
        {
            if( this.targetListView.SelectedItem == null ) return;

            this.ClearPanes();

            ListViewItem lvi = (ListViewItem)this.targetListView.SelectedItem;
            if( lvi == null ) return;

            CombatLogAnalyzer analyzer = (CombatLogAnalyzer)lvi.Content;
            if( analyzer == null ) return;

            this.activeAnalyzer = analyzer;

            foreach( AbilityData abilityData in analyzer.SortedAbilityBreakdown )
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat( "{0}: total {1:N0}, ", abilityData.DataName, abilityData.Total );
                sb.AppendFormat( "median hit {0:N0}, ", abilityData.Median );
                sb.AppendFormat( "{0:N0}% critical, ", abilityData.CriticalPercentage * 100.0 );
                sb.Append( "data set: (" );
                for( int i = abilityData.DataPoints.Count - 1; i >= 0; i-- )
                {
                    sb.AppendFormat( "{0:N0}", abilityData.DataPoints[i] );
                    if( i > 0 ) sb.Append( ", " );
                }
                sb.Append( ")" );
                breakdownListBox.Items.Add( sb.ToString().Trim() );
            }

            abilityChart.Visibility = Visibility.Visible;
            damageChart.Visibility = Visibility.Visible;

            this.abilityChart.DataContext = analyzer.SortedAbilityBreakdown;
            this.damageChart.DataContext = analyzer.SortedDamageTypeBreakdown;

            this.PopulateLog( analyzer.Log );
        }
Beispiel #2
0
        private void PopulateEncounterTargets( CombatEncounter encounter )
        {
            encounter.Sort(); // this sort used to take a long time

            ListViewItem viewItem = null;

            this.activeAnalyzer = null;

            targetListView.Items.Clear();
            foreach( CombatTarget target in encounter.Entities )
            {
                if( this.grpSelf.IsChecked == true )
                {
                    if( !target.Entity.Id.IsPlayer
                        && !(target.Entity.Parent != null && target.Entity.Parent.Id.IsPlayer) ) continue;
                }
                else if( this.grpGroup.IsChecked == true )
                {
                    if( !target.Entity.Id.IsPlayer && !target.Entity.Id.IsGroup ) continue;
                }
                else if( this.grpRaid.IsChecked == true )
                {
                    if( !target.Entity.Id.IsPlayer && !target.Entity.Id.IsRaid ) continue;
                }

                ListViewItem item = new ListViewItem();
                item.Content = target.Analyzer;

                if( target.Entity.Id.IsPlayer
                    || (target.Entity.Parent != null && target.Entity.Parent.Id.IsPlayer) )
                    item.Background = Brushes.Yellow;
                else if( target.Entity.Id.IsGroup )
                    item.Background = Brushes.LimeGreen;
                else if( target.Entity.Id.IsRaid )
                    item.Background = Brushes.LightGreen;

                if( target.Entity.Id.IsPlayer )
                    viewItem = item;

                targetListView.Items.Add( item );
            }

            if( viewItem != null )
            {
                this.targetListView.ScrollIntoView( viewItem );
                viewItem.IsSelected = true;
            }
        }