コード例 #1
0
        /// <summary>
        /// Called by owner VM to indicate that the parser has ticked
        /// </summary>
        public void ParserUpdate()
        {
            Name = AssociatedPlayer.Name;
            double totalDamagePercent = AssociatedPlayer.RelativeDPS;

            TotalDamagePercent = (totalDamagePercent * 100.0).ToString("0.00");
            TotalDamageDealt   = $"{AssociatedPlayer.FilteredDamage.TotalDamage:#,##0}";
            TotalDamageTaken   = $"{AssociatedPlayer.DamageTaken.TotalDamage:#,##0}";
            TotalDPS           = DamageParser.FormatDPSNumber(AssociatedPlayer.FilteredDamage.TotalDPS);
            JustAttackPercent  = $"{AssociatedPlayer.FilteredDamage.JustAttackPercent:0.00}";
            CritPercent        = $"{AssociatedPlayer.FilteredDamage.CritPercent:0.00}";
            MaxHitInfo         = $"{AssociatedPlayer.MaxHit:#,##0} {AssociatedPlayer.MaxHitName}";

            TotalDamage = AssociatedPlayer.FilteredDamage.TotalDamage;

            if (totalDamagePercent > 0)
            {
                var scaledDamagePercent = totalDamagePercent;
                if (parser.HighestDpsPlayer != null)
                {
                    double highestPlayerDamagePercent = parser.HighestDpsPlayer.RelativeDPS;
                    scaledDamagePercent /= highestPlayerDamagePercent;
                }
                if (parent.HighlightDPS)
                {
                    BackgroundBrush.GradientStops.Clear();
                    BackgroundBrush.GradientStops.Add(new GradientStop(HighlightColor, 0));
                    BackgroundBrush.GradientStops.Add(new GradientStop(HighlightColor, scaledDamagePercent));
                    BackgroundBrush.GradientStops.Add(new GradientStop(Colors.Transparent, scaledDamagePercent));
                    BackgroundBrush.GradientStops.Add(new GradientStop(Colors.Transparent, 1));
                }
                else if (BackgroundBrush.GradientStops.Count > 0)
                {
                    BackgroundBrush.GradientStops.Clear();                                               //no highlight dps, but we have leftover gradient stops, clear em all out.
                }
            }
        }
コード例 #2
0
ファイル: MainWindowViewModel.cs プロジェクト: wssh/ApexParse
 private void Parser_UpdateTick(object sender, UpdateTickEventArgs e)
 {
     StatusBarText = $"{e.ElapsedTime.ToString(@"h\:mm\:ss")} - Total Damage : {CurrentDamageParser.TotalFriendlyDamage:#,##0} - {DamageParser.FormatDPSNumber(CurrentDamageParser.TotalFriendlyDPS)} DPS";
     App.Current.Dispatcher.Invoke(synchronizeTabState); //ew.
 }