forked from Artemis-RGB/Artemis.Plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General module - Decreased active window update rate
General module - Added option to disable active window detection
- Loading branch information
1 parent
90341c6
commit c86cd39
Showing
5 changed files
with
113 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/Modules/Artemis.Plugins.Modules.General/Bootstrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Artemis.Core; | ||
using Artemis.Plugins.Modules.General.ViewModels; | ||
using Artemis.UI.Shared; | ||
|
||
namespace Artemis.Plugins.Modules.General | ||
{ | ||
public class Bootstrapper : IPluginBootstrapper | ||
{ | ||
public void Enable(Plugin plugin) | ||
{ | ||
plugin.ConfigurationDialog = new PluginConfigurationDialog<GeneralModuleConfigurationViewModel>(); | ||
} | ||
|
||
public void Disable(Plugin plugin) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...Modules/Artemis.Plugins.Modules.General/ViewModels/GeneralModuleConfigurationViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using Artemis.Core; | ||
using Artemis.UI.Shared; | ||
|
||
namespace Artemis.Plugins.Modules.General.ViewModels | ||
{ | ||
public class GeneralModuleConfigurationViewModel : PluginConfigurationViewModel | ||
{ | ||
public GeneralModuleConfigurationViewModel(Plugin plugin, PluginSettings settings) : base(plugin) | ||
{ | ||
EnableActiveWindow = settings.GetSetting("EnableActiveWindow", true); | ||
} | ||
|
||
public PluginSetting<bool> EnableActiveWindow { get; set; } | ||
|
||
protected override void OnInitialActivate() | ||
{ | ||
EnableActiveWindow.AutoSave = true; | ||
base.OnInitialActivate(); | ||
} | ||
|
||
protected override void OnClose() | ||
{ | ||
EnableActiveWindow.AutoSave = false; | ||
base.OnClose(); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/Modules/Artemis.Plugins.Modules.General/Views/GeneralModuleConfigurationView.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<UserControl x:Class="Artemis.Plugins.Modules.General.Views.GeneralModuleConfigurationView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:viewModels="clr-namespace:Artemis.Plugins.Modules.General.ViewModels" | ||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800" | ||
d:DataContext="{d:DesignInstance viewModels:GeneralModuleConfigurationViewModel}"> | ||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" Background="{StaticResource MaterialDesignPaper}"> | ||
<StackPanel Margin="15" MaxWidth="800"> | ||
<!-- General settings --> | ||
<TextBlock Style="{StaticResource MaterialDesignHeadline5TextBlock}" Margin="0 15">General</TextBlock> | ||
<materialDesign:Card materialDesign:ShadowAssist.ShadowDepth="Depth1" VerticalAlignment="Stretch" Margin="0,0,5,0"> | ||
<StackPanel Margin="15"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
<StackPanel Grid.Column="0"> | ||
<TextBlock Style="{StaticResource MaterialDesignTextBlock}">Monitor active window</TextBlock> | ||
<TextBlock Style="{StaticResource MaterialDesignTextBlock}" Foreground="{DynamicResource MaterialDesignNavigationItemSubheader}" TextWrapping="Wrap"> | ||
Enables or disables the active window data model property. <LineBreak /> | ||
Data is not stored and is never shared. Disabling this can increase performance | ||
</TextBlock> | ||
</StackPanel> | ||
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"> | ||
<ToggleButton Style="{StaticResource MaterialDesignSwitchToggleButton}" IsChecked="{Binding EnableActiveWindow.Value}" /> | ||
</StackPanel> | ||
</Grid> | ||
</StackPanel> | ||
</materialDesign:Card> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</UserControl> |