1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Fixed a crash on LUA editor save

Added default profiles for F1 2017
Added link to wiki in F1 2017 module
Adjusted default overlay profile to use fade
Adjusted Overwatch profile to automatically work with any new character
This commit is contained in:
SpoinkyNL 2017-11-12 23:44:19 +01:00
parent be621b0867
commit 37be36119b
7 changed files with 23 additions and 5 deletions

View File

@ -89,6 +89,7 @@ namespace Artemis.DeviceProviders.Corsair
}
Logger.Debug("Corsair SDK reported device as: {0}", _keyboard.DeviceInfo.Model);
_keyboard.Brush = _keyboardBrush ?? (_keyboardBrush = new ImageBrush());
}

View File

@ -26,6 +26,7 @@ namespace Artemis.Models
private readonly WindowService _windowService;
private FileSystemWatcher _watcher;
private ModuleModel _luaModule;
private ProfileModel _luaEditorProfile;
public ProfileEditorModel(WindowService windowService, MetroDialogService dialogService, DeviceManager deviceManager, LuaManager luaManager)
{
@ -290,6 +291,9 @@ namespace Artemis.Models
public void OpenLuaEditor(ModuleModel moduleModel)
{
if (moduleModel.ProfileModel == null)
return;
// Clean up old environment
DisposeLuaWatcher();
@ -305,6 +309,7 @@ namespace Artemis.Models
// Watch the file for changes
_luaModule = moduleModel;
_luaEditorProfile = moduleModel.ProfileModel;
_watcher = new FileSystemWatcher(Path.GetTempPath(), fileName);
_watcher.Changed += LuaFileChanged;
_watcher.EnableRaisingEvents = true;
@ -332,12 +337,13 @@ namespace Artemis.Models
{
using (var sr = new StreamReader(fs))
{
_luaModule.ProfileModel.LuaScript = sr.ReadToEnd();
_luaEditorProfile.LuaScript = sr.ReadToEnd();
}
}
ProfileProvider.AddOrUpdate(_luaModule.ProfileModel);
_luaManager.SetupLua(_luaModule.ProfileModel);
ProfileProvider.AddOrUpdate(_luaEditorProfile);
if (_luaManager.ProfileModel == _luaEditorProfile)
_luaManager.SetupLua(_luaModule.ProfileModel);
}
}

View File

@ -22,13 +22,16 @@
<!-- Header -->
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontSize="20" HorizontalAlignment="Left">
<Label.Content>
<AccessText TextWrapping="Wrap" Text="There is currently no default profile available for F1 2017." />
<AccessText TextWrapping="Wrap" Text="Turns your keyboard into F1 steering wheel, 'nuff said!" />
</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>
<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. For help with this see <Hyperlink RequestNavigate="Hyperlink_RequestNavigate" NavigateUri="https://github.com/SpoinkyNL/Artemis/wiki/F1-2017">the wiki</Hyperlink>.
</TextBlock>
<!-- Enable -->

View File

@ -1,4 +1,5 @@
using System.Windows.Controls;
using System.Windows.Navigation;
namespace Artemis.Modules.Games.FormulaOne2017
{
@ -8,5 +9,10 @@ namespace Artemis.Modules.Games.FormulaOne2017
{
InitializeComponent();
}
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
System.Diagnostics.Process.Start(e.Uri.ToString());
}
}
}

View File

@ -8,6 +8,7 @@ namespace Artemis.Modules.Games.Overwatch
{
public OverwatchStatus Status { get; set; }
public OverwatchCharacter Character { get; set; }
public string CharacterColor { get; set; }
public bool UltimateReady { get; set; }
public bool Ability1Ready { get; set; }
public bool Ability2Ready { get; set; }

View File

@ -223,6 +223,7 @@ namespace Artemis.Modules.Games.Overwatch
// Update the datamodel
gameDataModel.Character = characterMatch.Character;
gameDataModel.CharacterColor = colors[0, 20].ToHex();
return characterMatch;
}