From 03264fcee784aed5582faa6d34d27c4b722268a5 Mon Sep 17 00:00:00 2001 From: SpoinkyNL Date: Mon, 23 Jan 2017 14:45:50 +0100 Subject: [PATCH] Fixed Truck Simulator directory selection Made render scale configurable per type and set non-keyboard types to 1 instead of 4 Fixed overlay enable/disable Added changed/increased/decreased to layer event triggers Fixed layer condition changes in UI always applying --- Artemis/Artemis/Managers/MainManager.cs | 10 +- .../Modules/Abstract/ModuleViewModel.cs | 2 +- .../EurotruckSimulator2Model.cs | 18 +- .../EurotruckSimulator2View.xaml | 4 +- .../EurotruckSimulator2ViewModel.cs | 32 +- .../OverlayProfile/OverlayProfileDataModel.cs | 13 +- .../OverlayProfile/OverlayProfileModel.cs | 42 +- .../Layers/Animations/GrowAnimation.cs | 8 +- .../Layers/Animations/NoneAnimation.cs | 2 +- .../Layers/Animations/PulseAnimation.cs | 8 +- .../Layers/Animations/SlideDownAnimation.cs | 15 +- .../Layers/Animations/SlideLeftAnimation.cs | 13 +- .../Layers/Animations/SlideRightAnimation.cs | 17 +- .../Layers/Animations/SlideUpAnimation.cs | 13 +- .../Layers/Interfaces/ILayerAnimation.cs | 2 +- .../Profiles/Layers/Interfaces/ILayerType.cs | 7 +- .../Layers/Models/LayerConditionModel.cs | 103 +++- .../Types/AmbientLight/AmbientLightType.cs | 8 +- .../Profiles/Layers/Types/Audio/AudioType.cs | 8 +- .../Types/ConicalBrush/ConicalBrushType.cs | 9 +- .../Layers/Types/Folder/FolderType.cs | 1 + .../Layers/Types/Generic/GenericType.cs | 5 +- .../Layers/Types/Headset/HeadsetType.cs | 5 +- .../Layers/Types/KeyPress/KeyPressType.cs | 1 + .../Layers/Types/Keyboard/KeyboardType.cs | 5 +- .../Types/KeyboardGif/KeyboardGifType.cs | 1 + .../Profiles/Layers/Types/Mouse/MouseType.cs | 5 +- .../Layers/Types/Mousemat/MousematType.cs | 5 +- .../ViewModels/LayerEditorViewModel.cs | 12 +- .../ViewModels/ProfileEditorViewModel.cs | 2 + .../Profiles/LayerConditionViewModel.cs | 509 +++++++++--------- Artemis/Artemis/Views/LayerEditorView.xaml | 2 +- Artemis/Artemis/Views/ProfileEditorView.xaml | 3 +- 33 files changed, 497 insertions(+), 393 deletions(-) diff --git a/Artemis/Artemis/Managers/MainManager.cs b/Artemis/Artemis/Managers/MainManager.cs index 9c754e270..c266bb4d8 100644 --- a/Artemis/Artemis/Managers/MainManager.cs +++ b/Artemis/Artemis/Managers/MainManager.cs @@ -105,16 +105,12 @@ namespace Artemis.Managers /// /// Loads the last active effect and starts the program /// - public void EnableProgram() + public async void EnableProgram() { Logger.Debug("Enabling program"); ProgramEnabled = true; - LoopManager.StartAsync(); - foreach (var overlayModule in ModuleManager.OverlayModules) - { - if (overlayModule.Settings.IsEnabled) - overlayModule.Enable(); - } + await LoopManager.StartAsync(); + RaiseEnabledChangedEvent(new EnabledChangedEventArgs(ProgramEnabled)); } diff --git a/Artemis/Artemis/Modules/Abstract/ModuleViewModel.cs b/Artemis/Artemis/Modules/Abstract/ModuleViewModel.cs index e20501ac8..ff70eba65 100644 --- a/Artemis/Artemis/Modules/Abstract/ModuleViewModel.cs +++ b/Artemis/Artemis/Modules/Abstract/ModuleViewModel.cs @@ -68,7 +68,7 @@ namespace Artemis.Modules.Abstract { get { - if (ModuleModel.IsBoundToProcess || ModuleModel.IsBoundToProcess) + if (ModuleModel.IsBoundToProcess || ModuleModel.IsOverlay) return Settings.IsEnabled; return _generalSettings.LastModule == ModuleModel.Name; } diff --git a/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2Model.cs b/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2Model.cs index 5006d126f..3c7b18606 100644 --- a/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2Model.cs +++ b/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2Model.cs @@ -59,7 +59,7 @@ namespace Artemis.Modules.Games.EurotruckSimulator2 Settings.Save(); if (!File.Exists(dir + "/plugins/ets2-telemetry-server.dll")) - PlacePlugins(); + PlaceTruckSimulatorPlugin(dir, "eurotrucks2.exe"); } public void FindAtsGameDir() @@ -76,22 +76,14 @@ namespace Artemis.Modules.Games.EurotruckSimulator2 Settings.Save(); if (!File.Exists(dir + "/plugins/ets2-telemetry-server.dll")) - PlacePlugins(); + PlaceTruckSimulatorPlugin(dir, "amtrucks.exe"); } - public void PlacePlugins() + public void PlaceTruckSimulatorPlugin(string path, string game) { - var ets2Path = ((EurotruckSimulator2Settings) Settings).Ets2GameDirectory; - if (!string.IsNullOrEmpty(ets2Path)) - PlaceTruckSimulatorPlugin(ets2Path, "eurotrucks2.exe"); + if (string.IsNullOrEmpty(path)) + return; - var atsPath = ((EurotruckSimulator2Settings) Settings).AtsGameDirectory; - if (!string.IsNullOrEmpty(atsPath)) - PlaceTruckSimulatorPlugin(atsPath, "amtrucks.exe"); - } - - private void PlaceTruckSimulatorPlugin(string path, string game) - { // Ensure the selected directory exists if (!Directory.Exists(path)) { diff --git a/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2View.xaml b/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2View.xaml index c8c7588cf..281aa5825 100644 --- a/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2View.xaml +++ b/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2View.xaml @@ -68,7 +68,7 @@ + cal:Message.Attach="[Event LostFocus] = [Action Ets2PlacePlugin]" />