Skip to content

Commit 10ad0c0

Browse files
authored
Merge branch 'dev' into feature/variable-modul
2 parents bf6350e + f89028b commit 10ad0c0

29 files changed

+343
-132
lines changed

Project-Aurora/Project-Aurora/Controls/GameStateParameterPicker.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private static void SelectedPathDPChanged(DependencyObject sender, DependencyPro
118118
}
119119

120120
// Raise an event informing subscribers
121-
picker.SelectedPathChanged?.Invoke(picker, new SelectedPathChangedEventArgs(e.OldValue.ToString(), e.NewValue.ToString()));
121+
picker.SelectedPathChanged?.Invoke(picker, new SelectedPathChangedEventArgs(e.OldValue?.ToString() ?? "", e.NewValue?.ToString() ?? ""));
122122
}
123123
#endregion
124124

Project-Aurora/Project-Aurora/Controls/KeySequence.xaml.cs

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Windows.Controls;
77
using System.Windows.Media;
88

9-
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
109
namespace Aurora.Controls
1110
{
1211
public partial class KeySequence : UserControl
@@ -62,42 +61,43 @@ public List<Devices.DeviceKeys> List
6261
}
6362
private bool allowListRefresh = true;
6463

64+
#region Sequence Dependency Property
6565
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
66-
public static readonly DependencyProperty SequenceProperty = DependencyProperty.Register("Sequence", typeof(Settings.KeySequence), typeof(UserControl));
66+
public static readonly DependencyProperty SequenceProperty = DependencyProperty.Register("Sequence", typeof(Settings.KeySequence), typeof(UserControl), new PropertyMetadata(new Settings.KeySequence(), SequencePropertyChanged));
6767

68-
public Settings.KeySequence Sequence
69-
{
70-
get
71-
{
72-
return (Settings.KeySequence)GetValue(SequenceProperty);
73-
}
74-
set
75-
{
76-
if (value == null)
77-
value = new Settings.KeySequence();
68+
public Settings.KeySequence Sequence {
69+
get => (Settings.KeySequence)GetValue(SequenceProperty);
70+
set => SetValue(SequenceProperty, value);
71+
}
7872

79-
if (!value.Equals(Sequence))
80-
{
81-
sequence_removeFromLayerEditor();
82-
}
73+
private static void SequencePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) {
74+
var source = (KeySequence)sender;
75+
if (!(e.NewValue is Settings.KeySequence@new)) {
76+
source.Sequence = new Settings.KeySequence();
77+
return;
78+
}
8379

84-
SetValue(SequenceProperty, value);
80+
// If the old sequence is a region, remove that region from the editor
81+
if (e.OldValue is Settings.KeySequence old && old.type == Settings.KeySequenceType.FreeForm)
82+
LayerEditor.RemoveKeySequenceElement(old.freeform);
8583

86-
sequence_updateToLayerEditor();
84+
// Handle the new sequence. If a region, this will add it to the editor
85+
source.sequence_updateToLayerEditor();
8786

88-
if (allowListRefresh)
89-
{
90-
this.keys_keysequence.Items.Clear();
91-
foreach (var key in value.keys)
92-
this.keys_keysequence.Items.Add(key);
93-
}
87+
// Manually update the keysequence list. Gross
88+
if (source.allowListRefresh) {
89+
source.keys_keysequence.Items.Clear();
90+
foreach (var key in @new.keys)
91+
source.keys_keysequence.Items.Add(key);
92+
}
9493

95-
this.sequence_freestyle_checkbox.IsChecked = (value.type == Settings.KeySequenceType.FreeForm ? true : false);
94+
// Manually update the "Use freestyle instead" checkbox state
95+
source.sequence_freestyle_checkbox.IsChecked = @new.type == Settings.KeySequenceType.FreeForm;
9696

97-
if (SequenceUpdated != null)
98-
SequenceUpdated(this, new EventArgs());
99-
}
97+
// Fire an event? Dunno if this is really neccessary but since it was already there I feel like I should keep it
98+
source.SequenceUpdated?.Invoke(source, new EventArgs());
10099
}
100+
#endregion
101101

102102
public IEnumerable<Devices.DeviceKeys> SelectedItems => keys_keysequence.SelectedItems.Cast<Devices.DeviceKeys>();
103103

@@ -365,5 +365,3 @@ private void UserControl_IsVisibleChanged(object sender, DependencyPropertyChang
365365
}
366366
}
367367
}
368-
369-
#pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

Project-Aurora/Project-Aurora/Controls/LayerEditor.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private static ContentControl FindElementByTag(FreeFormObject tag)
110110

111111
foreach (var child in static_canvas.Children)
112112
{
113-
if (child is ContentControl && tag.Equals((child as ContentControl).Tag))
113+
if (child is ContentControl && ReferenceEquals(tag, (child as ContentControl).Tag))
114114
{
115115
foundElement = child as ContentControl;
116116
break;

Project-Aurora/Project-Aurora/EffectsEngine/EffectLayer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public EffectLayer(string name, Color color)
225225
}
226226
else
227227
{
228-
(brush as LinearGradientBrush).ScaleTransform(Effects.canvas_height, Effects.canvas_height);
228+
(brush as LinearGradientBrush).ScaleTransform(Effects.canvas_height * 100 / effect_config.gradient_size, Effects.canvas_height * 100 / effect_config.gradient_size);
229229
}
230230

231231
(brush as LinearGradientBrush).RotateTransform(effect_config.angle);
@@ -253,7 +253,7 @@ public EffectLayer(string name, Color color)
253253
}
254254
else
255255
{
256-
(brush as PathGradientBrush).ScaleTransform(Effects.canvas_height + x_offset, Effects.canvas_height + y_offset);
256+
(brush as PathGradientBrush).ScaleTransform((Effects.canvas_height + x_offset) * 100 / effect_config.gradient_size, (Effects.canvas_height + y_offset) * 100 / effect_config.gradient_size);
257257
}
258258
}
259259
else
@@ -265,7 +265,7 @@ public EffectLayer(string name, Color color)
265265
}
266266
else
267267
{
268-
(brush as PathGradientBrush).ScaleTransform(Effects.canvas_height, Effects.canvas_height);
268+
(brush as PathGradientBrush).ScaleTransform(Effects.canvas_height * 100 / effect_config.gradient_size, Effects.canvas_height * 100 / effect_config.gradient_size);
269269
}
270270
}
271271

Project-Aurora/Project-Aurora/Profiles/Minecraft/Control_Minecraft.xaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,18 @@
1212
<StackPanel Margin="10">
1313
<CheckBox x:Name="GameEnabled" Content="Enable Aurora to provide lighting effects with Minecraft. Ensure you have read the below text." Checked="GameEnabled_Checked" Unchecked="GameEnabled_Checked" />
1414
<TextBlock HorizontalAlignment="Left" Margin="0,10" TextWrapping="Wrap" MaxWidth="824">
15-
<Run Text="Support for Minecraft requires a mod so that Aurora is able to fetch the variables from the game. Currently this mod requires Forge mod loader, though other options may become available in future." />
16-
<LineBreak /><LineBreak />
15+
<Run Text="Support for Minecraft requires a mod so that Aurora is able to fetch the variables from the game."/>
16+
<LineBreak />
17+
<LineBreak />
18+
<Run Text="Currently this mod requires either Forge or Fabric mod loader, depending on the version of the game."/>
19+
<LineBreak />
20+
<LineBreak />
1721
<Run Text="These mods are not authored by the main Aurora developers and any issues with these mods should not be directed at them, but posted on the relevant GitLab repo for the mod." />
1822
</TextBlock>
1923

2024
<Button Content="Minecraft Forge download" HorizontalAlignment="Left" Padding="10,2" Click="GoToForgePage_Click" />
25+
26+
<Button Content="Minecraft Fabric download" HorizontalAlignment="Left" Padding="10,2" Margin="0,10" Click="GoToFabricDownloadPage"/>
2127

2228
<TextBlock Margin="0,10,0,0" Text="Supported versions:" FontSize="13" FontWeight="Bold" />
2329

@@ -35,7 +41,7 @@
3541
<ColumnDefinition Width="Auto" />
3642
<ColumnDefinition Width="Auto" />
3743
</Grid.ColumnDefinitions>
38-
44+
3945
<TextBlock Text="{Binding Path=Name}" FontWeight="SemiBold" HorizontalAlignment="Stretch" Grid.Column="0" />
4046
<TextBlock Grid.Column="1">
4147
<Run Text="{Binding Path=Version}" />
@@ -87,7 +93,7 @@
8793

8894
<Label Content="Health:" Grid.Row="2" HorizontalAlignment="Right" Margin="8,0" />
8995
<Slider Grid.Row="2" Grid.Column="1" Margin="0,4" ValueChanged="HealthSlider_ValueChanged" Minimum="0" Maximum="20" TickFrequency="1" IsSnapToTickEnabled="True" />
90-
96+
9197
<Label Content="Absorption:" Grid.Row="3" HorizontalAlignment="Right" Margin="8,0" />
9298
<Slider Grid.Row="3" Grid.Column="1" Margin="0,4" ValueChanged="Slider_ValueChanged" Minimum="0" Maximum="20" TickFrequency="1" IsSnapToTickEnabled="True" />
9399

Project-Aurora/Project-Aurora/Profiles/Minecraft/Control_Minecraft.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ private void GoToModDownloadPage_Click(object sender, RoutedEventArgs e) {
6363
Process.Start(((sender as Button).DataContext as ModDetails).Link);
6464
}
6565

66+
private void GoToFabricDownloadPage(object sender, RoutedEventArgs e) {
67+
Process.Start(@"https://fabricmc.net/");
68+
}
69+
6670
private async void PopulateModList() {
6771
ModList.Clear();
6872
try {

Project-Aurora/Project-Aurora/Profiles/Minecraft/Layers/MinecraftBurnLayerHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using System.Windows.Controls;
1313

1414
namespace Aurora.Profiles.Minecraft.Layers {
15-
15+
[Obsolete("This layer is obselete and has been replaced by the Overrides system.")]
1616
public class MinecraftBurnLayerHandler : LayerHandler<LayerHandlerProperties> {
1717

1818
private List<FireParticle> particles = new List<FireParticle>();

Project-Aurora/Project-Aurora/Profiles/Minecraft/Layers/MinecraftHealthBarLayerHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using System.Windows.Controls;
1212

1313
namespace Aurora.Profiles.Minecraft.Layers {
14-
14+
[Obsolete("This layer is obselete and has been replaced by the Overrides system.")]
1515
public class MinecraftHealthBarLayerHandlerProperties : LayerHandlerProperties<MinecraftHealthBarLayerHandlerProperties> {
1616

1717
[JsonIgnore]

Project-Aurora/Project-Aurora/Profiles/Minecraft/Layers/MinecraftRainLayerHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using System.Windows.Controls;
1313

1414
namespace Aurora.Profiles.Minecraft.Layers {
15-
15+
[Obsolete("This layer is obselete and has been replaced by the Overrides system.")]
1616
public class MinecraftRainLayerHandlerProperties : LayerHandlerProperties<MinecraftRainLayerHandlerProperties> {
1717

1818
[JsonIgnore]

0 commit comments

Comments
 (0)