Skip to content

Commit

Permalink
fix Payday 2 States layer crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Aug 30, 2024
1 parent f40f1df commit fb73820
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" Loaded="UserControl_Loaded">
mc:Ignorable="d">

<Grid>
<Label HorizontalAlignment="Left" Padding="0" Content="Downed Color:" VerticalAlignment="Top" Margin="0,3,0,0"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
using System.Windows;
using System.Windows.Controls;

namespace AuroraRgb.Profiles.Payday_2.Layers
namespace AuroraRgb.Profiles.Payday_2.Layers;

/// <summary>
/// Interaction logic for Control_PD2StatesLayer.xaml
/// </summary>
public partial class Control_PD2StatesLayer
{
/// <summary>
/// Interaction logic for Control_PD2StatesLayer.xaml
/// </summary>
public partial class Control_PD2StatesLayer : UserControl
public Control_PD2StatesLayer()
{
private bool settingsset = false;
private bool profileset = false;

public Control_PD2StatesLayer()
{
InitializeComponent();
}

public Control_PD2StatesLayer(PD2StatesLayerHandler datacontext)
{
this.DataContext = datacontext.Properties;
InitializeComponent();
}

private void UserControl_Loaded(object? sender, RoutedEventArgs e)
{
InitializeComponent();
}

this.Loaded -= UserControl_Loaded;
}
public Control_PD2StatesLayer(PD2StatesLayerHandler datacontext)
{
DataContext = datacontext.Properties;
InitializeComponent();
}

private void sldSwanSongSpeed_ValueChanged(object? sender, RoutedPropertyChangedEventArgs<double> e)
{
this.lblSwanSongSpeed.Content = $"x {sldSwanSongSpeed.Value.ToString("0.00")}";
}
private void sldSwanSongSpeed_ValueChanged(object? sender, RoutedPropertyChangedEventArgs<double> e)
{
lblSwanSongSpeed.Content = $"x {sldSwanSongSpeed.Value:0.00}";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,47 @@ public partial class PD2StatesLayerHandlerProperties : LayerHandlerProperties2Co
private Color? _downedColor;

[JsonProperty("_DownedColor")]
public Color DownedColor => Logic?._DownedColor ?? _downedColor ?? Color.Empty;
public Color DownedColor
{
get => Logic?._DownedColor ?? _downedColor ?? Color.Empty;
set => _downedColor = value;
}

private Color? _arrestedColor;

[JsonProperty("_ArrestedColor")]
public Color ArrestedColor => Logic?._ArrestedColor ?? _arrestedColor ?? Color.Empty;
public Color ArrestedColor
{
get => Logic?._ArrestedColor ?? _arrestedColor ?? Color.Empty;
set => _arrestedColor = value;
}

private Color? _swanSongColor;

[JsonProperty("_SwanSongColor")]
public Color SwanSongColor => Logic?._SwanSongColor ?? _swanSongColor ?? Color.Empty;
public Color SwanSongColor
{
get => Logic?._SwanSongColor ?? _swanSongColor ?? Color.Empty;
set => _swanSongColor = value;
}

private bool? _showSwanSong;

[JsonProperty("_ShowSwanSong")]
public bool ShowSwanSong => Logic?._ShowSwanSong ?? _showSwanSong ?? false;
public bool ShowSwanSong
{
get => Logic?._ShowSwanSong ?? _showSwanSong ?? false;
set => _showSwanSong = value;
}

private float? _swanSongSpeedMultiplier;

[JsonProperty("_SwanSongSpeedMultiplier")]
public float SwanSongSpeedMultiplier => Logic?._SwanSongSpeedMultiplier ?? _swanSongSpeedMultiplier ?? 0.0F;
public float SwanSongSpeedMultiplier
{
get => Logic?._SwanSongSpeedMultiplier ?? _swanSongSpeedMultiplier ?? 0.0F;
set => _swanSongSpeedMultiplier = value;
}

public PD2StatesLayerHandlerProperties()
{ }
Expand Down

0 comments on commit fb73820

Please sign in to comment.