mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Smoothed out keyboard changing process. Settings flyout now closes when clicking outside of it, resolves #40
This commit is contained in:
parent
5c6e393dd5
commit
d1e17c8dcd
@ -224,7 +224,7 @@
|
|||||||
<value>TypeWave</value>
|
<value>TypeWave</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="LastKeyboard" serializeAs="String">
|
<setting name="LastKeyboard" serializeAs="String">
|
||||||
<value>Logitech G910 RGB</value>
|
<value />
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="EnablePointersUpdate" serializeAs="String">
|
<setting name="EnablePointersUpdate" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
@ -238,6 +238,12 @@
|
|||||||
<setting name="Suspended" serializeAs="String">
|
<setting name="Suspended" serializeAs="String">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="ShowOnStartup" serializeAs="String">
|
||||||
|
<value>True</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="CheckForUpdates" serializeAs="String">
|
||||||
|
<value>True</value>
|
||||||
|
</setting>
|
||||||
</Artemis.Settings.General>
|
</Artemis.Settings.General>
|
||||||
</userSettings>
|
</userSettings>
|
||||||
<runtime>
|
<runtime>
|
||||||
|
|||||||
@ -12,6 +12,8 @@ namespace Artemis.Managers
|
|||||||
{
|
{
|
||||||
private readonly IEventAggregator _events;
|
private readonly IEventAggregator _events;
|
||||||
private readonly MainManager _mainManager;
|
private readonly MainManager _mainManager;
|
||||||
|
private bool _clearing;
|
||||||
|
private EffectModel _pauseEffect;
|
||||||
|
|
||||||
public EffectManager(MainManager mainManager, IEventAggregator events)
|
public EffectManager(MainManager mainManager, IEventAggregator events)
|
||||||
{
|
{
|
||||||
@ -23,7 +25,6 @@ namespace Artemis.Managers
|
|||||||
|
|
||||||
public List<EffectModel> EffectModels { get; set; }
|
public List<EffectModel> EffectModels { get; set; }
|
||||||
public EffectModel ActiveEffect { get; private set; }
|
public EffectModel ActiveEffect { get; private set; }
|
||||||
public EffectModel PauseEffect { get; private set; }
|
|
||||||
|
|
||||||
public IEnumerable<OverlayModel> EnabledOverlays
|
public IEnumerable<OverlayModel> EnabledOverlays
|
||||||
{
|
{
|
||||||
@ -83,27 +84,27 @@ namespace Artemis.Managers
|
|||||||
|
|
||||||
private void ChangeEffectWithPause(EffectModel effectModel)
|
private void ChangeEffectWithPause(EffectModel effectModel)
|
||||||
{
|
{
|
||||||
if (PauseEffect != null)
|
if (_pauseEffect != null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PauseEffect = effectModel;
|
_pauseEffect = effectModel;
|
||||||
_mainManager.Pause();
|
_mainManager.Pause();
|
||||||
_mainManager.PauseCallback += MainManagerOnPauseCallback;
|
_mainManager.PauseCallback += ChangeEffectPauseCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainManagerOnPauseCallback()
|
private void ChangeEffectPauseCallback()
|
||||||
{
|
{
|
||||||
// Change effect logic
|
// Change effect logic
|
||||||
ActiveEffect?.Dispose();
|
ActiveEffect?.Dispose();
|
||||||
|
|
||||||
ActiveEffect = PauseEffect;
|
ActiveEffect = _pauseEffect;
|
||||||
ActiveEffect.Enable();
|
ActiveEffect.Enable();
|
||||||
|
|
||||||
// Let the ViewModels know
|
// Let the ViewModels know
|
||||||
_events.PublishOnUIThread(new ActiveEffectChanged(ActiveEffect.Name));
|
_events.PublishOnUIThread(new ActiveEffectChanged(ActiveEffect.Name));
|
||||||
|
|
||||||
PauseEffect = null;
|
|
||||||
_mainManager.Unpause();
|
_mainManager.Unpause();
|
||||||
|
_pauseEffect = null;
|
||||||
|
|
||||||
if (ActiveEffect is GameModel)
|
if (ActiveEffect is GameModel)
|
||||||
return;
|
return;
|
||||||
@ -118,18 +119,32 @@ namespace Artemis.Managers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void ClearEffect()
|
public void ClearEffect()
|
||||||
{
|
{
|
||||||
|
if (_clearing)
|
||||||
|
return;
|
||||||
|
|
||||||
// Don't mess with the ActiveEffect if in the process of changing the effect.
|
// Don't mess with the ActiveEffect if in the process of changing the effect.
|
||||||
if (PauseEffect != null)
|
if (_pauseEffect != null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ActiveEffect == null)
|
if (ActiveEffect == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
_clearing = true;
|
||||||
|
|
||||||
|
_mainManager.Pause();
|
||||||
|
_mainManager.PauseCallback += ClearEffectPauseCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearEffectPauseCallback()
|
||||||
|
{
|
||||||
ActiveEffect.Dispose();
|
ActiveEffect.Dispose();
|
||||||
ActiveEffect = null;
|
ActiveEffect = null;
|
||||||
|
|
||||||
General.Default.LastEffect = null;
|
General.Default.LastEffect = null;
|
||||||
General.Default.Save();
|
General.Default.Save();
|
||||||
|
|
||||||
|
_clearing = false;
|
||||||
|
_mainManager.Unpause();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -9,6 +9,7 @@ namespace Artemis.Managers
|
|||||||
public class KeyboardManager
|
public class KeyboardManager
|
||||||
{
|
{
|
||||||
private readonly MainManager _mainManager;
|
private readonly MainManager _mainManager;
|
||||||
|
private KeyboardProvider _pauseKeyboard;
|
||||||
|
|
||||||
public KeyboardManager(MainManager mainManager)
|
public KeyboardManager(MainManager mainManager)
|
||||||
{
|
{
|
||||||
@ -19,29 +20,41 @@ namespace Artemis.Managers
|
|||||||
public List<KeyboardProvider> KeyboardProviders { get; set; }
|
public List<KeyboardProvider> KeyboardProviders { get; set; }
|
||||||
public KeyboardProvider ActiveKeyboard { get; set; }
|
public KeyboardProvider ActiveKeyboard { get; set; }
|
||||||
|
|
||||||
public bool LoadLastKeyboard()
|
/// <summary>
|
||||||
|
/// Enables the last keyboard according to the settings file
|
||||||
|
/// </summary>
|
||||||
|
public void EnableLastKeyboard()
|
||||||
{
|
{
|
||||||
|
if (General.Default.LastKeyboard == null)
|
||||||
|
return;
|
||||||
|
if (General.Default.LastKeyboard == "")
|
||||||
|
return;
|
||||||
|
|
||||||
var keyboard = KeyboardProviders.FirstOrDefault(k => k.Name == General.Default.LastKeyboard);
|
var keyboard = KeyboardProviders.FirstOrDefault(k => k.Name == General.Default.LastKeyboard);
|
||||||
return ChangeKeyboard(keyboard ?? KeyboardProviders.First());
|
EnableKeyboard(keyboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ChangeKeyboard(KeyboardProvider keyboardProvider)
|
/// <summary>
|
||||||
|
/// Enables the given keyboard
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="keyboardProvider"></param>
|
||||||
|
public void EnableKeyboard(KeyboardProvider keyboardProvider)
|
||||||
{
|
{
|
||||||
|
ReleaseActiveKeyboard();
|
||||||
|
|
||||||
if (keyboardProvider == null)
|
if (keyboardProvider == null)
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
if (ActiveKeyboard != null)
|
if (ActiveKeyboard != null)
|
||||||
if (keyboardProvider.Name == ActiveKeyboard.Name)
|
if (keyboardProvider.Name == ActiveKeyboard.Name)
|
||||||
return true;
|
return;
|
||||||
|
|
||||||
ReleaseActiveKeyboard();
|
|
||||||
|
|
||||||
// Disable everything if there's no active keyboard found
|
// Disable everything if there's no active keyboard found
|
||||||
if (!keyboardProvider.CanEnable())
|
if (!keyboardProvider.CanEnable())
|
||||||
{
|
{
|
||||||
MessageBox.Show(keyboardProvider.CantEnableText, "Artemis (╯°□°)╯︵ ┻━┻", MessageBoxButtons.OK,
|
MessageBox.Show(keyboardProvider.CantEnableText, "Artemis (╯°□°)╯︵ ┻━┻", MessageBoxButtons.OK,
|
||||||
MessageBoxIcon.Warning);
|
MessageBoxIcon.Warning);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveKeyboard = keyboardProvider;
|
ActiveKeyboard = keyboardProvider;
|
||||||
@ -49,10 +62,11 @@ namespace Artemis.Managers
|
|||||||
|
|
||||||
General.Default.LastKeyboard = ActiveKeyboard.Name;
|
General.Default.LastKeyboard = ActiveKeyboard.Name;
|
||||||
General.Default.Save();
|
General.Default.Save();
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Releases the active keyboard
|
||||||
|
/// </summary>
|
||||||
public void ReleaseActiveKeyboard()
|
public void ReleaseActiveKeyboard()
|
||||||
{
|
{
|
||||||
if (ActiveKeyboard == null)
|
if (ActiveKeyboard == null)
|
||||||
@ -61,5 +75,20 @@ namespace Artemis.Managers
|
|||||||
ActiveKeyboard.Disable();
|
ActiveKeyboard.Disable();
|
||||||
ActiveKeyboard = null;
|
ActiveKeyboard = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Changes the active keyboard
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="keyboardProvider"></param>
|
||||||
|
public void ChangeKeyboard(KeyboardProvider keyboardProvider)
|
||||||
|
{
|
||||||
|
if (keyboardProvider == ActiveKeyboard)
|
||||||
|
return;
|
||||||
|
|
||||||
|
General.Default.LastKeyboard = keyboardProvider?.Name;
|
||||||
|
General.Default.Save();
|
||||||
|
|
||||||
|
_mainManager.Restart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -16,6 +16,7 @@ namespace Artemis.Managers
|
|||||||
|
|
||||||
private readonly int _fps;
|
private readonly int _fps;
|
||||||
private bool _paused;
|
private bool _paused;
|
||||||
|
private bool _restarting;
|
||||||
|
|
||||||
public MainManager(IEventAggregator events)
|
public MainManager(IEventAggregator events)
|
||||||
{
|
{
|
||||||
@ -78,7 +79,8 @@ namespace Artemis.Managers
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Only continue if a keyboard was loaded
|
// Only continue if a keyboard was loaded
|
||||||
if (!KeyboardManager.LoadLastKeyboard())
|
KeyboardManager.EnableLastKeyboard();
|
||||||
|
if (KeyboardManager.ActiveKeyboard == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Running = true;
|
Running = true;
|
||||||
@ -128,6 +130,41 @@ namespace Artemis.Managers
|
|||||||
PauseCallback = null;
|
PauseCallback = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Shutdown()
|
||||||
|
{
|
||||||
|
Stop();
|
||||||
|
ProcessWorker.CancelAsync();
|
||||||
|
GameStateWebServer.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Restart()
|
||||||
|
{
|
||||||
|
if (_restarting)
|
||||||
|
return;
|
||||||
|
if (!Running)
|
||||||
|
{
|
||||||
|
Start();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_restarting = true;
|
||||||
|
|
||||||
|
UpdateWorker.RunWorkerCompleted += FinishRestart;
|
||||||
|
Stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FinishRestart(object sender, RunWorkerCompletedEventArgs e)
|
||||||
|
{
|
||||||
|
UpdateWorker.RunWorkerCompleted -= FinishRestart;
|
||||||
|
|
||||||
|
if (e.Error != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Start();
|
||||||
|
|
||||||
|
_restarting = false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the last active effect and starts the program
|
/// Loads the last active effect and starts the program
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -148,13 +185,6 @@ namespace Artemis.Managers
|
|||||||
Events.PublishOnUIThread(new ToggleEnabled(ProgramEnabled));
|
Events.PublishOnUIThread(new ToggleEnabled(ProgramEnabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Shutdown()
|
|
||||||
{
|
|
||||||
Stop();
|
|
||||||
ProcessWorker.CancelAsync();
|
|
||||||
GameStateWebServer.Stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Workers
|
#region Workers
|
||||||
|
|
||||||
private void UpdateWorker_DoWork(object sender, DoWorkEventArgs e)
|
private void UpdateWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||||
|
|||||||
220
Artemis/Artemis/Settings/General.Designer.cs
generated
220
Artemis/Artemis/Settings/General.Designer.cs
generated
@ -1,98 +1,122 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.42000
|
// Runtime Version:4.0.30319.42000
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Artemis.Settings {
|
namespace Artemis.Settings {
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||||
internal sealed partial class General : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class General : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static General defaultInstance = ((General)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new General())));
|
private static General defaultInstance = ((General)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new General())));
|
||||||
|
|
||||||
public static General Default {
|
public static General Default {
|
||||||
get {
|
get {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("TypeWave")]
|
[global::System.Configuration.DefaultSettingValueAttribute("TypeWave")]
|
||||||
public string LastEffect {
|
public string LastEffect {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["LastEffect"]));
|
return ((string)(this["LastEffect"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["LastEffect"] = value;
|
this["LastEffect"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Logitech G910 RGB")]
|
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||||
public string LastKeyboard {
|
public string LastKeyboard {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["LastKeyboard"]));
|
return ((string)(this["LastKeyboard"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["LastKeyboard"] = value;
|
this["LastKeyboard"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
public bool EnablePointersUpdate {
|
public bool EnablePointersUpdate {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["EnablePointersUpdate"]));
|
return ((bool)(this["EnablePointersUpdate"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["EnablePointersUpdate"] = value;
|
this["EnablePointersUpdate"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("51364")]
|
[global::System.Configuration.DefaultSettingValueAttribute("51364")]
|
||||||
public int GamestatePort {
|
public int GamestatePort {
|
||||||
get {
|
get {
|
||||||
return ((int)(this["GamestatePort"]));
|
return ((int)(this["GamestatePort"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["GamestatePort"] = value;
|
this["GamestatePort"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
public bool Autorun {
|
public bool Autorun {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["Autorun"]));
|
return ((bool)(this["Autorun"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["Autorun"] = value;
|
this["Autorun"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||||
public bool Suspended {
|
public bool Suspended {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["Suspended"]));
|
return ((bool)(this["Suspended"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["Suspended"] = value;
|
this["Suspended"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
|
public bool ShowOnStartup {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["ShowOnStartup"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["ShowOnStartup"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
|
public bool CheckForUpdates {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["CheckForUpdates"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["CheckForUpdates"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,26 +1,30 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="General">
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
<Profiles />
|
||||||
GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="General">
|
<Settings>
|
||||||
<Profiles />
|
<Setting Name="LastEffect" Type="System.String" Scope="User">
|
||||||
<Settings>
|
<Value Profile="(Default)">TypeWave</Value>
|
||||||
<Setting Name="LastEffect" Type="System.String" Scope="User">
|
</Setting>
|
||||||
<Value Profile="(Default)">TypeWave</Value>
|
<Setting Name="LastKeyboard" Type="System.String" Scope="User">
|
||||||
</Setting>
|
<Value Profile="(Default)" />
|
||||||
<Setting Name="LastKeyboard" Type="System.String" Scope="User">
|
</Setting>
|
||||||
<Value Profile="(Default)">Logitech G910 RGB</Value>
|
<Setting Name="EnablePointersUpdate" Type="System.Boolean" Scope="User">
|
||||||
</Setting>
|
<Value Profile="(Default)">True</Value>
|
||||||
<Setting Name="EnablePointersUpdate" Type="System.Boolean" Scope="User">
|
</Setting>
|
||||||
<Value Profile="(Default)">True</Value>
|
<Setting Name="GamestatePort" Type="System.Int32" Scope="User">
|
||||||
</Setting>
|
<Value Profile="(Default)">51364</Value>
|
||||||
<Setting Name="GamestatePort" Type="System.Int32" Scope="User">
|
</Setting>
|
||||||
<Value Profile="(Default)">51364</Value>
|
<Setting Name="Autorun" Type="System.Boolean" Scope="User">
|
||||||
</Setting>
|
<Value Profile="(Default)">True</Value>
|
||||||
<Setting Name="Autorun" Type="System.Boolean" Scope="User">
|
</Setting>
|
||||||
<Value Profile="(Default)">True</Value>
|
<Setting Name="Suspended" Type="System.Boolean" Scope="User">
|
||||||
</Setting>
|
<Value Profile="(Default)">False</Value>
|
||||||
<Setting Name="Suspended" Type="System.Boolean" Scope="User">
|
</Setting>
|
||||||
<Value Profile="(Default)">False</Value>
|
<Setting Name="ShowOnStartup" Type="System.Boolean" Scope="User">
|
||||||
</Setting>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Settings>
|
</Setting>
|
||||||
|
<Setting Name="CheckForUpdates" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">True</Value>
|
||||||
|
</Setting>
|
||||||
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -38,6 +38,26 @@ namespace Artemis.Settings
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CheckForUpdates
|
||||||
|
{
|
||||||
|
get { return General.Default.CheckForUpdates; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (General.Default.CheckForUpdates == value) return;
|
||||||
|
General.Default.CheckForUpdates = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ShowOnStartup
|
||||||
|
{
|
||||||
|
get { return General.Default.ShowOnStartup; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (General.Default.ShowOnStartup == value) return;
|
||||||
|
General.Default.ShowOnStartup = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void ApplyGamestatePort()
|
private void ApplyGamestatePort()
|
||||||
{
|
{
|
||||||
// TODO: Restart Gamestate server with new port
|
// TODO: Restart Gamestate server with new port
|
||||||
@ -71,6 +91,8 @@ namespace Artemis.Settings
|
|||||||
GamestatePort = 51364;
|
GamestatePort = 51364;
|
||||||
EnablePointersUpdate = true;
|
EnablePointersUpdate = true;
|
||||||
Autorun = true;
|
Autorun = true;
|
||||||
|
CheckForUpdates = true;
|
||||||
|
ShowOnStartup = true;
|
||||||
|
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,15 @@ namespace Artemis.ViewModels.Flyouts
|
|||||||
public MainManager MainManager { get; set; }
|
public MainManager MainManager { get; set; }
|
||||||
|
|
||||||
public BindableCollection<string> KeyboardProviders
|
public BindableCollection<string> KeyboardProviders
|
||||||
=> new BindableCollection<string>(MainManager.KeyboardManager.KeyboardProviders.Select(k => k.Name));
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var collection = new BindableCollection<string>(MainManager.KeyboardManager.KeyboardProviders
|
||||||
|
.Select(k => k.Name));
|
||||||
|
collection.Insert(0, "None");
|
||||||
|
return collection;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string SelectedKeyboardProvider
|
public string SelectedKeyboardProvider
|
||||||
{
|
{
|
||||||
@ -52,7 +60,8 @@ namespace Artemis.ViewModels.Flyouts
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
MainManager.KeyboardManager.ChangeKeyboard(
|
MainManager.KeyboardManager.ChangeKeyboard(
|
||||||
MainManager.KeyboardManager.KeyboardProviders.First(k => k.Name == _selectedKeyboardProvider));
|
MainManager.KeyboardManager.KeyboardProviders.FirstOrDefault(
|
||||||
|
k => k.Name == _selectedKeyboardProvider));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +108,9 @@ namespace Artemis.ViewModels.Flyouts
|
|||||||
|
|
||||||
protected override void HandleOpen()
|
protected override void HandleOpen()
|
||||||
{
|
{
|
||||||
SelectedKeyboardProvider = MainManager.KeyboardManager.ActiveKeyboard?.Name;
|
SelectedKeyboardProvider = MainManager.KeyboardManager.ActiveKeyboard != null
|
||||||
|
? MainManager.KeyboardManager.ActiveKeyboard.Name
|
||||||
|
: "None";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,5 +47,10 @@ namespace Artemis.ViewModels
|
|||||||
{
|
{
|
||||||
Flyouts.First().IsOpen = !Flyouts.First().IsOpen;
|
Flyouts.First().IsOpen = !Flyouts.First().IsOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CloseSettings()
|
||||||
|
{
|
||||||
|
Flyouts.First().IsOpen = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,7 +62,7 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
|
Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
|
||||||
</Grid.Resources>
|
</Grid.Resources>
|
||||||
<TabControl Margin="0,10,10,10" TabStripPlacement="Left" x:Name="Items">
|
<TabControl Margin="0,10,10,10" TabStripPlacement="Left" x:Name="Items" cal:Message.Attach="[Event GotFocus] = [Action CloseSettings]">
|
||||||
<TabControl.ItemTemplate>
|
<TabControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding DisplayName}" />
|
<TextBlock Text="{Binding DisplayName}" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user