1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-01-02 10:43:31 +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:
SpoinkyNL 2017-11-12 11:22:58 +01:00
parent 53b88be937
commit 06eaf42590
7 changed files with 225 additions and 204 deletions

View File

@ -196,11 +196,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
public float LateralG { 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]

View File

@ -13,7 +13,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
{
private bool _mustListen;
private UdpClient _udpClient;
private UdpClient _udpListener;
private DateTime _lastUpdate;
private int _revAtZeroFrames;
@ -105,11 +104,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
dataModel.Car.Details.LateralG = msg.m_gforce_lat;
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;
// It's unknown in time trial but lets overwrite that to race
if (dataModel.Session.SessionType == SessionType.Unknown && dataModel.Car.SpeedMph > 0)

View File

@ -22,10 +22,15 @@
<!-- Header -->
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
<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>
<!-- 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 -->
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
<Label Content="Enable module" HorizontalAlignment="Right" Margin="0,0,0,3" />

View File

@ -41,7 +41,7 @@ namespace Artemis.Modules.Games.RocketLeague
}
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).";
}
}

View File

@ -16,7 +16,7 @@
<!-- Header -->
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
<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>

View File

@ -53,7 +53,7 @@ namespace Artemis.Profiles.Layers.Models
if (!Enabled)
return false;
_fadeTweener?.Update(40);
FadeTweener?.Update(40);
var conditionsMet = LayerCondition.ConditionsMet(this, dataModel);
if (conditionsMet && !_conditionsMetLastFrame)
OnLayerConditionsMet();
@ -61,7 +61,7 @@ namespace Artemis.Profiles.Layers.Models
OnLayerConditionsUnmet();
_conditionsMetLastFrame = conditionsMet;
return _fadeTweener != null && _fadeTweener.Running || conditionsMet;
return FadeTweener != null && FadeTweener.Running || conditionsMet;
}
/// <summary>
@ -114,12 +114,37 @@ namespace Artemis.Profiles.Layers.Models
if (Brush == null || !preview && !RenderAllowed)
return;
// If fading in/out, push transparency on the entire context
if (_fadeTweener != null && _fadeTweener.Running)
c.PushOpacity(_fadeTweener.Value);
ApplyHierarchyOpacity(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();
var current = this;
while (current.Parent != null)
{
current = current.Parent;
if (current.FadeTweener != null && current.FadeTweener.Running)
c.Pop();
}
}
/// <summary>
@ -330,11 +355,11 @@ namespace Artemis.Profiles.Layers.Models
{
if (FadeInTime <= 0)
return;
if (_fadeTweener != null && _fadeTweener.Running)
_fadeTweener = new Tweener<float>(_fadeTweener.Value, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
if (FadeTweener != null && FadeTweener.Running)
FadeTweener = new Tweener<float>(FadeTweener.Value, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
else
_fadeTweener = new Tweener<float>(0, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
_fadeTweener.Start();
FadeTweener = new Tweener<float>(0, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
FadeTweener.Start();
}
private void OnLayerConditionsUnmet(object sender, EventArgs eventArgs)
@ -342,11 +367,11 @@ namespace Artemis.Profiles.Layers.Models
if (FadeOutTime <= 0)
return;
if (_fadeTweener != null && _fadeTweener.Running)
_fadeTweener = new Tweener<float>(_fadeTweener.Value, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
if (FadeTweener != null && FadeTweener.Running)
FadeTweener = new Tweener<float>(FadeTweener.Value, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
else
_fadeTweener = new Tweener<float>(1, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
_fadeTweener.Start();
FadeTweener = new Tweener<float>(1, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
FadeTweener.Start();
}
#region Properties
@ -390,7 +415,9 @@ namespace Artemis.Profiles.Layers.Models
[JsonIgnore] private Brush _brush;
[JsonIgnore] private bool _conditionsMetLastFrame;
[JsonIgnore] private Tweener<float> _fadeTweener;
[JsonIgnore]
public Tweener<float> FadeTweener { get; set; }
[JsonIgnore]
public double X { get; set; }