mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-01-01 18:23:32 +00:00
Cleaned up F1 2017 module
Cleaned up WoW module Fixed Rocket League module crash Added fade support to entire folders
This commit is contained in:
parent
53b88be937
commit
06eaf42590
@ -196,11 +196,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
|
|||||||
|
|
||||||
public float LateralG { get; set; }
|
public float LateralG { get; set; }
|
||||||
public float LongitudinalG { get; set; }
|
public float LongitudinalG { get; set; }
|
||||||
|
|
||||||
public float WheelSpeedFrontLeft { get; set; }
|
|
||||||
public float WheelSpeedFrontRight { get; set; }
|
|
||||||
public float WheelSpeedRearLeft { get; set; }
|
|
||||||
public float WheelSpeedRearRight { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[MoonSharpUserData]
|
[MoonSharpUserData]
|
||||||
|
|||||||
@ -13,7 +13,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
|
|||||||
{
|
{
|
||||||
private bool _mustListen;
|
private bool _mustListen;
|
||||||
private UdpClient _udpClient;
|
private UdpClient _udpClient;
|
||||||
private UdpClient _udpListener;
|
|
||||||
private DateTime _lastUpdate;
|
private DateTime _lastUpdate;
|
||||||
private int _revAtZeroFrames;
|
private int _revAtZeroFrames;
|
||||||
|
|
||||||
@ -105,11 +104,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
|
|||||||
dataModel.Car.Details.LateralG = msg.m_gforce_lat;
|
dataModel.Car.Details.LateralG = msg.m_gforce_lat;
|
||||||
dataModel.Car.Details.LongitudinalG = msg.m_gforce_lon;
|
dataModel.Car.Details.LongitudinalG = msg.m_gforce_lon;
|
||||||
|
|
||||||
// dataModel.Car.Details.WheelSpeedFrontLeft = msg.m_wheel_speed_fl;
|
|
||||||
// dataModel.Car.Details.WheelSpeedFrontRight = msg.m_wheel_speed_fr;
|
|
||||||
// dataModel.Car.Details.WheelSpeedRearLeft = msg.m_wheel_speed_bl;
|
|
||||||
// dataModel.Car.Details.WheelSpeedRearRight = msg.m_wheel_speed_br;
|
|
||||||
|
|
||||||
dataModel.Session.SessionType = (SessionType) msg.m_sessionType;
|
dataModel.Session.SessionType = (SessionType) msg.m_sessionType;
|
||||||
// It's unknown in time trial but lets overwrite that to race
|
// It's unknown in time trial but lets overwrite that to race
|
||||||
if (dataModel.Session.SessionType == SessionType.Unknown && dataModel.Car.SpeedMph > 0)
|
if (dataModel.Session.SessionType == SessionType.Unknown && dataModel.Car.SpeedMph > 0)
|
||||||
|
|||||||
@ -22,10 +22,15 @@
|
|||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||||
<Label.Content>
|
<Label.Content>
|
||||||
<AccessText TextWrapping="Wrap" Text="By default shows RPM on the F-keys, gear on the other keys and track flags on the numpad." />
|
<AccessText TextWrapping="Wrap" Text="There is currently no default profile available for F1 2017." />
|
||||||
</Label.Content>
|
</Label.Content>
|
||||||
</Label>
|
</Label>
|
||||||
|
|
||||||
|
<!-- Sub header -->
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold" TextAlignment="Justify" Margin="5,0,0,10">
|
||||||
|
The F1 2017 module requires UDP Telemetry to be enabled in the ingame settings menu.
|
||||||
|
</TextBlock>
|
||||||
|
|
||||||
<!-- Enable -->
|
<!-- Enable -->
|
||||||
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||||
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />
|
||||||
|
|||||||
@ -41,7 +41,7 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
}
|
}
|
||||||
|
|
||||||
Updater.GetPointers();
|
Updater.GetPointers();
|
||||||
var version = SettingsProvider.Load<OffsetSettings>().RocketLeague.GameVersion;
|
var version = SettingsProvider.Load<OffsetSettings>().RocketLeague?.GameVersion;
|
||||||
VersionText = $"Requires patch {version}. When a new patch is released Artemis downloads new pointers for the latest version (unless disabled in settings).";
|
VersionText = $"Requires patch {version}. When a new patch is released Artemis downloads new pointers for the latest version (unless disabled in settings).";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
|
||||||
<Label.Content>
|
<Label.Content>
|
||||||
<AccessText TextWrapping="Wrap" Text="Fight the Legion in style with reactive lighting." />
|
<AccessText TextWrapping="Wrap" Text="There is currently no default profile available for World of Warcraft." />
|
||||||
</Label.Content>
|
</Label.Content>
|
||||||
</Label>
|
</Label>
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ namespace Artemis.Profiles.Layers.Models
|
|||||||
if (!Enabled)
|
if (!Enabled)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_fadeTweener?.Update(40);
|
FadeTweener?.Update(40);
|
||||||
var conditionsMet = LayerCondition.ConditionsMet(this, dataModel);
|
var conditionsMet = LayerCondition.ConditionsMet(this, dataModel);
|
||||||
if (conditionsMet && !_conditionsMetLastFrame)
|
if (conditionsMet && !_conditionsMetLastFrame)
|
||||||
OnLayerConditionsMet();
|
OnLayerConditionsMet();
|
||||||
@ -61,7 +61,7 @@ namespace Artemis.Profiles.Layers.Models
|
|||||||
OnLayerConditionsUnmet();
|
OnLayerConditionsUnmet();
|
||||||
|
|
||||||
_conditionsMetLastFrame = conditionsMet;
|
_conditionsMetLastFrame = conditionsMet;
|
||||||
return _fadeTweener != null && _fadeTweener.Running || conditionsMet;
|
return FadeTweener != null && FadeTweener.Running || conditionsMet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -114,12 +114,37 @@ namespace Artemis.Profiles.Layers.Models
|
|||||||
if (Brush == null || !preview && !RenderAllowed)
|
if (Brush == null || !preview && !RenderAllowed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If fading in/out, push transparency on the entire context
|
ApplyHierarchyOpacity(c);
|
||||||
if (_fadeTweener != null && _fadeTweener.Running)
|
|
||||||
c.PushOpacity(_fadeTweener.Value);
|
|
||||||
LayerType.Draw(this, c);
|
LayerType.Draw(this, c);
|
||||||
if (_fadeTweener != null && _fadeTweener.Running)
|
PopHierarchyOpacity(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ApplyHierarchyOpacity(DrawingContext c)
|
||||||
|
{
|
||||||
|
if (FadeTweener != null && FadeTweener.Running)
|
||||||
|
c.PushOpacity(FadeTweener.Value);
|
||||||
|
|
||||||
|
var current = this;
|
||||||
|
while (current.Parent != null)
|
||||||
|
{
|
||||||
|
current = current.Parent;
|
||||||
|
if (current.FadeTweener != null && current.FadeTweener.Running)
|
||||||
|
c.PushOpacity(current.FadeTweener.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PopHierarchyOpacity(DrawingContext c)
|
||||||
|
{
|
||||||
|
if (FadeTweener != null && FadeTweener.Running)
|
||||||
c.Pop();
|
c.Pop();
|
||||||
|
|
||||||
|
var current = this;
|
||||||
|
while (current.Parent != null)
|
||||||
|
{
|
||||||
|
current = current.Parent;
|
||||||
|
if (current.FadeTweener != null && current.FadeTweener.Running)
|
||||||
|
c.Pop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -330,11 +355,11 @@ namespace Artemis.Profiles.Layers.Models
|
|||||||
{
|
{
|
||||||
if (FadeInTime <= 0)
|
if (FadeInTime <= 0)
|
||||||
return;
|
return;
|
||||||
if (_fadeTweener != null && _fadeTweener.Running)
|
if (FadeTweener != null && FadeTweener.Running)
|
||||||
_fadeTweener = new Tweener<float>(_fadeTweener.Value, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
|
FadeTweener = new Tweener<float>(FadeTweener.Value, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
|
||||||
else
|
else
|
||||||
_fadeTweener = new Tweener<float>(0, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
|
FadeTweener = new Tweener<float>(0, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
|
||||||
_fadeTweener.Start();
|
FadeTweener.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnLayerConditionsUnmet(object sender, EventArgs eventArgs)
|
private void OnLayerConditionsUnmet(object sender, EventArgs eventArgs)
|
||||||
@ -342,11 +367,11 @@ namespace Artemis.Profiles.Layers.Models
|
|||||||
if (FadeOutTime <= 0)
|
if (FadeOutTime <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_fadeTweener != null && _fadeTweener.Running)
|
if (FadeTweener != null && FadeTweener.Running)
|
||||||
_fadeTweener = new Tweener<float>(_fadeTweener.Value, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
|
FadeTweener = new Tweener<float>(FadeTweener.Value, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
|
||||||
else
|
else
|
||||||
_fadeTweener = new Tweener<float>(1, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
|
FadeTweener = new Tweener<float>(1, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
|
||||||
_fadeTweener.Start();
|
FadeTweener.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
@ -390,7 +415,9 @@ namespace Artemis.Profiles.Layers.Models
|
|||||||
|
|
||||||
[JsonIgnore] private Brush _brush;
|
[JsonIgnore] private Brush _brush;
|
||||||
[JsonIgnore] private bool _conditionsMetLastFrame;
|
[JsonIgnore] private bool _conditionsMetLastFrame;
|
||||||
[JsonIgnore] private Tweener<float> _fadeTweener;
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public Tweener<float> FadeTweener { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public double X { get; set; }
|
public double X { get; set; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user