EnabledLineSeries AddFlag(bool value, EnabledLineSeries flag) { if (value) { return(flag); } return(0); }
public EnabledLineSeriesSettingsVM(EnabledLineSeries series) { TotalDPSEnabled = series.HasFlag(EnabledLineSeries.TotalDPS); TotalDamageEnabled = series.HasFlag(EnabledLineSeries.TotalDamageDealt); TakenDamageEnabled = series.HasFlag(EnabledLineSeries.TotalDamageTaken); InstanceDPSEnabled = series.HasFlag(EnabledLineSeries.InstanceDPS); MPAAverageEnabled = series.HasFlag(EnabledLineSeries.AverageMPADPS); }
private void setSeriesVisibility(LineSeries series, EnabledLineSeries flag) { //Workaround for Visibility throwing NullReferenceException. //LiveCharts bug https://github.com/Live-Charts/Live-Charts/issues/693 try { series.Visibility = enabledSeries.HasFlag(flag) ? Visibility.Visible : Visibility.Hidden; } catch (NullReferenceException) { } }
public void SetEnabledLineSeries(EnabledLineSeries newSeries) { enabledSeries = newSeries; setSeriesVisibility(totalDamageSeries, EnabledLineSeries.TotalDamageDealt); setSeriesVisibility(totalDPSSeries, EnabledLineSeries.TotalDPS); setSeriesVisibility(totalDamageTakenSeries, EnabledLineSeries.TotalDamageTaken); setSeriesVisibility(updateDPSSeries, EnabledLineSeries.InstanceDPS); setSeriesVisibility(averageMPASeries, EnabledLineSeries.AverageMPADPS); }
public EnabledLineSeries GetEnumValue() { EnabledLineSeries retVal = new EnabledLineSeries(); retVal |= AddFlag(TotalDPSEnabled, EnabledLineSeries.TotalDPS); retVal |= AddFlag(TotalDamageEnabled, EnabledLineSeries.TotalDamageDealt); retVal |= AddFlag(TakenDamageEnabled, EnabledLineSeries.TotalDamageTaken); retVal |= AddFlag(InstanceDPSEnabled, EnabledLineSeries.InstanceDPS); retVal |= AddFlag(MPAAverageEnabled, EnabledLineSeries.AverageMPADPS); return(retVal); }
private void loadSettings() { HighlightDPS = Settings.Default.HighlightDPS; ShortenDPSReadout = Settings.Default.ShortenDPSReadout; OpenGraphForSelfAutomatically = Settings.Default.OpenGraphForSelf; AnonymizePlayers = Settings.Default.AnonymizePlayers; EnabledLineSeries val = EnabledLineSeries.All; DetailedDamageVisibleColumns val2 = DetailedDamageVisibleColumns.All; PSO2DamageTrackers hiddenTrackers = PSO2DamageTrackers.None; PSO2DamageTrackers splitTrackers = PSO2DamageTrackers.None; if (!Enum.TryParse <EnabledLineSeries>(Settings.Default.EnabledLineSeries, out val)) { val = EnabledLineSeries.All; } if (!Enum.TryParse <DetailedDamageVisibleColumns>(Settings.Default.DetailedDamageVisibleColumns, out val2)) { val2 = DetailedDamageVisibleColumns.All; } if (!Enum.TryParse <PSO2DamageTrackers>(Settings.Default.HiddenDamageTypes, out hiddenTrackers)) { hiddenTrackers = PSO2DamageTrackers.None; } if (!Enum.TryParse <PSO2DamageTrackers>(Settings.Default.SplitDamageTypes, out splitTrackers)) { splitTrackers = PSO2DamageTrackers.None; } if (!string.IsNullOrWhiteSpace(Settings.Default.BackgroundImagePath)) { BackgroundImagePath = Settings.Default.BackgroundImagePath; } LineSeriesSettings = new EnabledLineSeriesSettingsVM(val); DetailedDamageVisibleSettings = new ColumnVisibilityVM(val2); DamageTypesSettings = new HiddenSplitTypesSettingsVM(splitTrackers, hiddenTrackers); DamageTypesSettings.HideSettingsChanged += DamageTypesSettings_HideSettingsChanged; DamageTypesSettings.SplitSettingsChanged += DamageTypesSettings_SplitSettingsChanged; LineSeriesSettings.SeriesEnabledStateChangedEvent += LineSeriesSettings_SeriesEnabledStateChangedEvent; }