mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Merge branch 'development'
This commit is contained in:
commit
edeffeda21
@ -1,93 +1,61 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio 14
|
# Visual Studio 14
|
||||||
VisualStudioVersion = 14.0.23107.0
|
VisualStudioVersion = 14.0.24720.0
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis", "Artemis\Artemis.csproj", "{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis", "Artemis\Artemis.csproj", "{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{6141683F-8A12-4E36-9623-2EB02B2C2303}") = "ArtemisSetup", "ArtemisSetup\ArtemisSetup.isproj", "{9E76B2E0-12AE-431D-8FA5-2233D6853F29}"
|
Global
|
||||||
EndProject
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Global
|
CD_ROM|Any CPU = CD_ROM|Any CPU
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
CD_ROM|x64 = CD_ROM|x64
|
||||||
CD_ROM|Any CPU = CD_ROM|Any CPU
|
CD_ROM|x86 = CD_ROM|x86
|
||||||
CD_ROM|x64 = CD_ROM|x64
|
Debug|Any CPU = Debug|Any CPU
|
||||||
CD_ROM|x86 = CD_ROM|x86
|
Debug|x64 = Debug|x64
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|x86 = Debug|x86
|
||||||
Debug|x64 = Debug|x64
|
DVD-5|Any CPU = DVD-5|Any CPU
|
||||||
Debug|x86 = Debug|x86
|
DVD-5|x64 = DVD-5|x64
|
||||||
DVD-5|Any CPU = DVD-5|Any CPU
|
DVD-5|x86 = DVD-5|x86
|
||||||
DVD-5|x64 = DVD-5|x64
|
Release|Any CPU = Release|Any CPU
|
||||||
DVD-5|x86 = DVD-5|x86
|
Release|x64 = Release|x64
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|x86 = Release|x86
|
||||||
Release|x64 = Release|x64
|
SingleImage|Any CPU = SingleImage|Any CPU
|
||||||
Release|x86 = Release|x86
|
SingleImage|x64 = SingleImage|x64
|
||||||
SingleImage|Any CPU = SingleImage|Any CPU
|
SingleImage|x86 = SingleImage|x86
|
||||||
SingleImage|x64 = SingleImage|x64
|
EndGlobalSection
|
||||||
SingleImage|x86 = SingleImage|x86
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
EndGlobalSection
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|Any CPU.ActiveCfg = Release|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x64.ActiveCfg = Release|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|Any CPU.Build.0 = Release|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x64.Build.0 = Release|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x64.ActiveCfg = Release|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x86.ActiveCfg = Release|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x64.Build.0 = Release|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x86.Build.0 = Release|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x86.ActiveCfg = Release|x86
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.CD_ROM|x86.Build.0 = Release|x86
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x64.Build.0 = Debug|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x64.ActiveCfg = Debug|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x64.Build.0 = Debug|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x86.Build.0 = Debug|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x86.ActiveCfg = Debug|x86
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Debug|x86.Build.0 = Debug|x86
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|Any CPU.ActiveCfg = Debug|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x64.ActiveCfg = Debug|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|Any CPU.Build.0 = Debug|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x64.Build.0 = Debug|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x64.ActiveCfg = Debug|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x86.ActiveCfg = Debug|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x64.Build.0 = Debug|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x86.Build.0 = Debug|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x86.ActiveCfg = Debug|x86
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.DVD-5|x86.Build.0 = Debug|x86
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x64.ActiveCfg = Release|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x64.Build.0 = Release|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x64.ActiveCfg = Release|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x86.ActiveCfg = Release|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x64.Build.0 = Release|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x86.Build.0 = Release|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x86.ActiveCfg = Release|x86
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.Release|x86.Build.0 = Release|x86
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|Any CPU.Build.0 = Release|Any CPU
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|Any CPU.ActiveCfg = Release|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x64.ActiveCfg = Release|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|Any CPU.Build.0 = Release|Any CPU
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x64.Build.0 = Release|x64
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x64.ActiveCfg = Release|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x86.ActiveCfg = Release|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x64.Build.0 = Release|x64
|
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x86.Build.0 = Release|x86
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x86.ActiveCfg = Release|x86
|
EndGlobalSection
|
||||||
{ED9997A2-E54C-4E9F-9350-62BE672C3ABE}.SingleImage|x86.Build.0 = Release|x86
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.CD_ROM|Any CPU.ActiveCfg = CD_ROM
|
HideSolutionNode = FALSE
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.CD_ROM|Any CPU.Build.0 = CD_ROM
|
EndGlobalSection
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.CD_ROM|x64.ActiveCfg = CD_ROM
|
EndGlobal
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.CD_ROM|x64.Build.0 = CD_ROM
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.CD_ROM|x86.ActiveCfg = CD_ROM
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.CD_ROM|x86.Build.0 = CD_ROM
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Debug|Any CPU.ActiveCfg = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Debug|Any CPU.Build.0 = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Debug|x64.ActiveCfg = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Debug|x64.Build.0 = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Debug|x86.ActiveCfg = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Debug|x86.Build.0 = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.DVD-5|Any CPU.ActiveCfg = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.DVD-5|Any CPU.Build.0 = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.DVD-5|x64.ActiveCfg = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.DVD-5|x64.Build.0 = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.DVD-5|x86.ActiveCfg = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.DVD-5|x86.Build.0 = DVD-5
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Release|Any CPU.ActiveCfg = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Release|Any CPU.Build.0 = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Release|x64.ActiveCfg = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Release|x64.Build.0 = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Release|x86.ActiveCfg = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.Release|x86.Build.0 = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.SingleImage|Any CPU.ActiveCfg = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.SingleImage|Any CPU.Build.0 = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.SingleImage|x64.ActiveCfg = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.SingleImage|x64.Build.0 = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.SingleImage|x86.ActiveCfg = SingleImage
|
|
||||||
{9E76B2E0-12AE-431D-8FA5-2233D6853F29}.SingleImage|x86.Build.0 = SingleImage
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
|
|||||||
@ -2,44 +2,19 @@
|
|||||||
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<sectionGroup name="userSettings"
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague"
|
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
<section name="Artemis.Settings.Offsets" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Modules.Games.Witcher3.Witcher3" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Settings.Offsets"
|
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Settings.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Games.Witcher3.Witcher3"
|
<section name="Artemis.Settings.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
<section name="Artemis.Settings.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization"
|
<section name="Artemis.Settings.TypeWave" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
<section name="Artemis.Settings.General" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.CounterStrike"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.VolumeDisplay"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.AudioVisualization"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.RocketLeague"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Properties.Settings"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.TypeWave"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
<section name="Artemis.Settings.General"
|
|
||||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
|
||||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
</configSections>
|
</configSections>
|
||||||
<connectionStrings />
|
<connectionStrings />
|
||||||
@ -47,6 +22,17 @@
|
|||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||||
</startup>
|
</startup>
|
||||||
<userSettings>
|
<userSettings>
|
||||||
|
<Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay>
|
||||||
|
<setting name="Enabled" serializeAs="String">
|
||||||
|
<value>True</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="MainColor" serializeAs="String">
|
||||||
|
<value>#FFFF2900</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="SecondaryColor" serializeAs="String">
|
||||||
|
<value>#FF26F600</value>
|
||||||
|
</setting>
|
||||||
|
</Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay>
|
||||||
<Artemis.Modules.Games.RocketLeague.RocketLeague>
|
<Artemis.Modules.Games.RocketLeague.RocketLeague>
|
||||||
<setting name="Enabled" serializeAs="String">
|
<setting name="Enabled" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
@ -57,6 +43,9 @@
|
|||||||
<setting name="SecondaryColor" serializeAs="String">
|
<setting name="SecondaryColor" serializeAs="String">
|
||||||
<value>#FFFF0000</value>
|
<value>#FFFF0000</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="ContextualColor" serializeAs="String">
|
||||||
|
<value>False</value>
|
||||||
|
</setting>
|
||||||
</Artemis.Modules.Games.RocketLeague.RocketLeague>
|
</Artemis.Modules.Games.RocketLeague.RocketLeague>
|
||||||
<Artemis.Settings.Offsets>
|
<Artemis.Settings.Offsets>
|
||||||
<setting name="RocketLeague" serializeAs="String">
|
<setting name="RocketLeague" serializeAs="String">
|
||||||
@ -95,6 +84,9 @@
|
|||||||
</setting>
|
</setting>
|
||||||
</Artemis.Modules.Effects.AudioVisualizer.AudioVisualization>
|
</Artemis.Modules.Effects.AudioVisualizer.AudioVisualization>
|
||||||
<Artemis.Modules.Games.CounterStrike.CounterStrike>
|
<Artemis.Modules.Games.CounterStrike.CounterStrike>
|
||||||
|
<setting name="Enabled" serializeAs="String">
|
||||||
|
<value>True</value>
|
||||||
|
</setting>
|
||||||
<setting name="GameDirectory" serializeAs="String">
|
<setting name="GameDirectory" serializeAs="String">
|
||||||
<value />
|
<value />
|
||||||
</setting>
|
</setting>
|
||||||
@ -119,9 +111,6 @@
|
|||||||
<setting name="LowHpEnabled" serializeAs="String">
|
<setting name="LowHpEnabled" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="Enabled" serializeAs="String">
|
|
||||||
<value>True</value>
|
|
||||||
</setting>
|
|
||||||
</Artemis.Modules.Games.CounterStrike.CounterStrike>
|
</Artemis.Modules.Games.CounterStrike.CounterStrike>
|
||||||
<Artemis.Settings.CounterStrike>
|
<Artemis.Settings.CounterStrike>
|
||||||
<setting name="GameDirectory" serializeAs="String">
|
<setting name="GameDirectory" serializeAs="String">
|
||||||
@ -149,17 +138,6 @@
|
|||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
</Artemis.Settings.CounterStrike>
|
</Artemis.Settings.CounterStrike>
|
||||||
<Artemis.Settings.VolumeDisplay>
|
|
||||||
<setting name="MainColor" serializeAs="String">
|
|
||||||
<value>#FFFF2900</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="SecondaryColor" serializeAs="String">
|
|
||||||
<value>#FF26F600</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="Enabled" serializeAs="String">
|
|
||||||
<value>True</value>
|
|
||||||
</setting>
|
|
||||||
</Artemis.Settings.VolumeDisplay>
|
|
||||||
<Artemis.Settings.AudioVisualization>
|
<Artemis.Settings.AudioVisualization>
|
||||||
<setting name="Sensitivity" serializeAs="String">
|
<setting name="Sensitivity" serializeAs="String">
|
||||||
<value>4</value>
|
<value>4</value>
|
||||||
@ -221,7 +199,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>
|
||||||
@ -230,11 +208,17 @@
|
|||||||
<value>51364</value>
|
<value>51364</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="Autorun" serializeAs="String">
|
<setting name="Autorun" serializeAs="String">
|
||||||
<value>True</value>
|
<value>False</value>
|
||||||
</setting>
|
</setting>
|
||||||
<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>
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
<Application x:Class="Artemis.App"
|
<Application x:Class="Artemis.App"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="clr-namespace:Artemis"
|
xmlns:artemis="clr-namespace:Artemis"
|
||||||
DispatcherUnhandledException="Application_DispatcherUnhandledException"
|
DispatcherUnhandledException="Application_DispatcherUnhandledException"
|
||||||
ShutdownMode="OnExplicitShutdown">
|
ShutdownMode="OnExplicitShutdown">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<local:ArtemisBootstrapper x:Key="ArtemisBootstrapper" />
|
<artemis:ArtemisBootstrapper x:Key="ArtemisBootstrapper" />
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
|
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
|
||||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||||
<NuGetPackageImportStamp>
|
<NuGetPackageImportStamp>
|
||||||
</NuGetPackageImportStamp>
|
</NuGetPackageImportStamp>
|
||||||
<PublishUrl>C:\Users\spoin\Desktop\Artemis builds\</PublishUrl>
|
<PublishUrl>C:\Users\Robert\Desktop\Artemis builds\</PublishUrl>
|
||||||
<Install>true</Install>
|
<Install>true</Install>
|
||||||
<InstallFrom>Disk</InstallFrom>
|
<InstallFrom>Disk</InstallFrom>
|
||||||
<UpdateEnabled>false</UpdateEnabled>
|
<UpdateEnabled>false</UpdateEnabled>
|
||||||
@ -35,9 +35,13 @@
|
|||||||
<UpdatePeriodically>false</UpdatePeriodically>
|
<UpdatePeriodically>false</UpdatePeriodically>
|
||||||
<UpdateRequired>false</UpdateRequired>
|
<UpdateRequired>false</UpdateRequired>
|
||||||
<MapFileExtensions>true</MapFileExtensions>
|
<MapFileExtensions>true</MapFileExtensions>
|
||||||
|
<SupportUrl>https://github.com/SpoinkyNL/Artemis/wiki/Frequently-Asked-Questions-%28FAQ%29</SupportUrl>
|
||||||
|
<ProductName>Artemis</ProductName>
|
||||||
|
<PublisherName>Artemis</PublisherName>
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
<ApplicationVersion>1.0.0.0</ApplicationVersion>
|
<ApplicationVersion>1.0.2.0</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
|
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -74,7 +78,7 @@
|
|||||||
<SignManifests>false</SignManifests>
|
<SignManifests>false</SignManifests>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ApplicationIcon>logo.ico</ApplicationIcon>
|
<ApplicationIcon>Resources\logo.ico</ApplicationIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@ -135,12 +139,8 @@
|
|||||||
<HintPath>..\packages\Colore.4.0.0\lib\net35\Corale.Colore.dll</HintPath>
|
<HintPath>..\packages\Colore.4.0.0\lib\net35\Corale.Colore.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="CUE.NET, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="CUE.NET, Version=1.0.2.1, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\CUE.NET.1.0.2\lib\net45\CUE.NET.dll</HintPath>
|
<HintPath>..\packages\CUE.NET.1.0.2.1\lib\net45\CUE.NET.dll</HintPath>
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Gma.System.MouseKeyHook, Version=5.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\MouseKeyHook.5.4.0\lib\net40\Gma.System.MouseKeyHook.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
@ -172,10 +172,7 @@
|
|||||||
<Reference Include="System.Runtime.Serialization" />
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||||
<HintPath>..\packages\MahApps.Metro.1.2.4.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
@ -189,6 +186,10 @@
|
|||||||
<HintPath>..\packages\WpfExceptionViewer.1.0.0.0\lib\VioletTape.WpfExceptionViewer.dll</HintPath>
|
<HintPath>..\packages\WpfExceptionViewer.1.0.0.0\lib\VioletTape.WpfExceptionViewer.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="VirtualInput, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\VirtualInput.1.0.1\lib\net20\VirtualInput.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
@ -228,7 +229,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ArtemisBootstrapper.cs" />
|
<Compile Include="ArtemisBootstrapper.cs" />
|
||||||
<Compile Include="Events\ToggleEnabled.cs" />
|
<Compile Include="Events\ToggleEnabled.cs" />
|
||||||
<Compile Include="Events\ChangeActiveEffect.cs" />
|
<Compile Include="Events\ActiveEffectChanged.cs" />
|
||||||
<Compile Include="Events\ChangeBitmap.cs" />
|
<Compile Include="Events\ChangeBitmap.cs" />
|
||||||
<Compile Include="KeyboardProviders\Corsair\CorsairRGB.cs" />
|
<Compile Include="KeyboardProviders\Corsair\CorsairRGB.cs" />
|
||||||
<Compile Include="KeyboardProviders\KeyboardProvider.cs" />
|
<Compile Include="KeyboardProviders\KeyboardProvider.cs" />
|
||||||
@ -241,8 +242,12 @@
|
|||||||
<Compile Include="KeyboardProviders\ProviderHelper.cs" />
|
<Compile Include="KeyboardProviders\ProviderHelper.cs" />
|
||||||
<Compile Include="KeyboardProviders\Razer\BlackWidow.cs" />
|
<Compile Include="KeyboardProviders\Razer\BlackWidow.cs" />
|
||||||
<Compile Include="KeyboardProviders\Razer\Utilities\RazerUtilities.cs" />
|
<Compile Include="KeyboardProviders\Razer\Utilities\RazerUtilities.cs" />
|
||||||
|
<Compile Include="Managers\EffectManager.cs" />
|
||||||
|
<Compile Include="Managers\KeyboardManager.cs" />
|
||||||
|
<Compile Include="Managers\MainManager.cs" />
|
||||||
<Compile Include="Models\EffectModel.cs" />
|
<Compile Include="Models\EffectModel.cs" />
|
||||||
<Compile Include="Models\GamePointersCollectionModel.cs" />
|
<Compile Include="Models\EffectSettings.cs" />
|
||||||
|
<Compile Include="Models\GameSettings.cs" />
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualization.Designer.cs">
|
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualization.Designer.cs">
|
||||||
<DependentUpon>AudioVisualization.settings</DependentUpon>
|
<DependentUpon>AudioVisualization.settings</DependentUpon>
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
@ -271,25 +276,23 @@
|
|||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Modules\Games\RocketLeague\RocketLeagueModel.cs" />
|
<Compile Include="Modules\Games\RocketLeague\RocketLeagueModel.cs" />
|
||||||
<Compile Include="Modules\Games\Witcher3\RocketLeagueSettings.cs" />
|
<Compile Include="Modules\Games\Witcher3\Witcher3Settings.cs" />
|
||||||
<Compile Include="Modules\Games\Witcher3\Witcher3.Designer.cs">
|
<Compile Include="Modules\Games\Witcher3\Witcher3.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
<DependentUpon>Witcher3.settings</DependentUpon>
|
<DependentUpon>Witcher3.settings</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Modules\Games\Witcher3\Witcher3Model.cs" />
|
<Compile Include="Modules\Games\Witcher3\Witcher3Model.cs" />
|
||||||
<Compile Include="Models\MainModel.cs" />
|
|
||||||
<Compile Include="Models\OverlayModel.cs" />
|
<Compile Include="Models\OverlayModel.cs" />
|
||||||
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplay.cs" />
|
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplay.cs" />
|
||||||
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplay.Designer.cs">
|
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplay.Designer.cs">
|
||||||
<DependentUpon>VolumeDisplay.settings</DependentUpon>
|
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
|
<DependentUpon>VolumeDisplay.settings</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplayModel.cs" />
|
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplayModel.cs" />
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerSettings.cs" />
|
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerSettings.cs" />
|
||||||
<Compile Include="Modules\Effects\Debug\DebugEffectSettings.cs" />
|
<Compile Include="Modules\Effects\Debug\DebugEffectSettings.cs" />
|
||||||
<Compile Include="Models\EffectSettings.cs" />
|
|
||||||
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplaySettings.cs" />
|
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplaySettings.cs" />
|
||||||
<Compile Include="Modules\Games\RocketLeague\RocketLeagueSettings.cs" />
|
<Compile Include="Modules\Games\RocketLeague\RocketLeagueSettings.cs" />
|
||||||
<Compile Include="Modules\Effects\TypeWave\TypeWaveSettings.cs" />
|
<Compile Include="Modules\Effects\TypeWave\TypeWaveSettings.cs" />
|
||||||
@ -299,6 +302,8 @@
|
|||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
<DependentUpon>Resources.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Services\DialogService.cs" />
|
||||||
|
<Compile Include="Services\MetroDialogService.cs" />
|
||||||
<Compile Include="Settings\General.Designer.cs">
|
<Compile Include="Settings\General.Designer.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||||
@ -317,12 +322,16 @@
|
|||||||
<Compile Include="Utilities\GameState\GameStateWebServer.cs" />
|
<Compile Include="Utilities\GameState\GameStateWebServer.cs" />
|
||||||
<Compile Include="Utilities\ImageUtilities.cs" />
|
<Compile Include="Utilities\ImageUtilities.cs" />
|
||||||
<Compile Include="Utilities\Keyboard\KeyboardHook.cs" />
|
<Compile Include="Utilities\Keyboard\KeyboardHook.cs" />
|
||||||
|
<Compile Include="Utilities\Memory\GamePointer.cs" />
|
||||||
<Compile Include="Utilities\Memory\Memory.cs" />
|
<Compile Include="Utilities\Memory\Memory.cs" />
|
||||||
<Compile Include="Utilities\Memory\MemoryHelpers.cs" />
|
<Compile Include="Utilities\Memory\MemoryHelpers.cs" />
|
||||||
<Compile Include="Utilities\Memory\Win32.cs" />
|
<Compile Include="Utilities\Memory\Win32.cs" />
|
||||||
<Compile Include="Utilities\Keyboard\Key.cs" />
|
<Compile Include="Utilities\Keyboard\Key.cs" />
|
||||||
<Compile Include="Utilities\Keyboard\KeyboardRectangle.cs" />
|
<Compile Include="Utilities\Keyboard\KeyboardRectangle.cs" />
|
||||||
<Compile Include="Utilities\ShellLink.cs" />
|
<Compile Include="Utilities\ShellLink.cs" />
|
||||||
|
<Compile Include="Utilities\Updater.cs" />
|
||||||
|
<Compile Include="ViewModels\Abstract\EffectViewModel.cs" />
|
||||||
|
<Compile Include="ViewModels\Abstract\GameViewModel.cs" />
|
||||||
<Compile Include="ViewModels\EffectsViewModel.cs" />
|
<Compile Include="ViewModels\EffectsViewModel.cs" />
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerViewModel.cs" />
|
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerViewModel.cs" />
|
||||||
<Compile Include="Modules\Effects\Debug\DebugEffectViewModel.cs" />
|
<Compile Include="Modules\Effects\Debug\DebugEffectViewModel.cs" />
|
||||||
@ -426,9 +435,13 @@
|
|||||||
<Resource Include="Resources\bow.png" />
|
<Resource Include="Resources\bow.png" />
|
||||||
<Resource Include="Resources\WindowsIcons-license.txt" />
|
<Resource Include="Resources\WindowsIcons-license.txt" />
|
||||||
<Resource Include="Resources\Entypo-license.txt" />
|
<Resource Include="Resources\Entypo-license.txt" />
|
||||||
|
<Content Include="logo.ico">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Resource Include="Resources\logo.ico" />
|
||||||
|
<Resource Include="Resources\logo-disabled.ico" />
|
||||||
<Content Include="Resources\Witcher3\playerWitcher.txt" />
|
<Content Include="Resources\Witcher3\playerWitcher.txt" />
|
||||||
<Content Include="Resources\Witcher3\artemis.txt" />
|
<Content Include="Resources\Witcher3\artemis.txt" />
|
||||||
<Resource Include="logo-disabled.ico" />
|
|
||||||
<Resource Include="Resources\Entypo.ttf" />
|
<Resource Include="Resources\Entypo.ttf" />
|
||||||
<None Include="Settings\Offsets.settings">
|
<None Include="Settings\Offsets.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
@ -519,9 +532,6 @@
|
|||||||
<Content Include="RzChromaSDK64.dll">
|
<Content Include="RzChromaSDK64.dll">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<Resource Include="logo.ico">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</Resource>
|
|
||||||
<Content Include="Resources\CounterStrike\gamestateConfiguration.txt" />
|
<Content Include="Resources\CounterStrike\gamestateConfiguration.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -537,12 +547,12 @@
|
|||||||
</BootstrapperPackage>
|
</BootstrapperPackage>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="..\packages\CUE.NET.1.0.2\build\net45\CUE.NET.targets" Condition="Exists('..\packages\CUE.NET.1.0.2\build\net45\CUE.NET.targets')" />
|
<Import Project="..\packages\CUE.NET.1.0.2.1\build\net45\CUE.NET.targets" Condition="Exists('..\packages\CUE.NET.1.0.2.1\build\net45\CUE.NET.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\CUE.NET.1.0.2\build\net45\CUE.NET.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CUE.NET.1.0.2\build\net45\CUE.NET.targets'))" />
|
<Error Condition="!Exists('..\packages\CUE.NET.1.0.2.1\build\net45\CUE.NET.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CUE.NET.1.0.2.1\build\net45\CUE.NET.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
namespace Artemis.Events
|
namespace Artemis.Events
|
||||||
{
|
{
|
||||||
public class ChangeActiveEffect
|
public class ActiveEffectChanged
|
||||||
{
|
{
|
||||||
public ChangeActiveEffect(string activeEffect)
|
public ActiveEffectChanged(string activeEffect)
|
||||||
{
|
{
|
||||||
ActiveEffect = activeEffect;
|
ActiveEffect = activeEffect;
|
||||||
}
|
}
|
||||||
@ -16,8 +16,8 @@ namespace Artemis.KeyboardProviders.Corsair
|
|||||||
public CorsairRGB()
|
public CorsairRGB()
|
||||||
{
|
{
|
||||||
Name = "Corsair RGB Keyboards";
|
Name = "Corsair RGB Keyboards";
|
||||||
CantEnableText = "Couldn't connect to your Corsair keyboard.\n " +
|
CantEnableText = "Couldn't connect to your Corsair keyboard.\n" +
|
||||||
"Please check your cables and/or drivers (could be outdated) and that Corsair Utility Engine is running.\n\n " +
|
"Please check your cables and/or drivers (could be outdated) and that Corsair Utility Engine is running.\n\n" +
|
||||||
"If needed, you can select a different keyboard in Artemis under settings.";
|
"If needed, you can select a different keyboard in Artemis under settings.";
|
||||||
KeyboardRegions = new List<KeyboardRegion>();
|
KeyboardRegions = new List<KeyboardRegion>();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,15 +4,15 @@ namespace Artemis.KeyboardProviders
|
|||||||
{
|
{
|
||||||
public class KeyboardRegion
|
public class KeyboardRegion
|
||||||
{
|
{
|
||||||
public string RegionName { get; set; }
|
|
||||||
public Point TopLeft { get; set; }
|
|
||||||
public Point BottomRight { get; set; }
|
|
||||||
|
|
||||||
public KeyboardRegion(string regionName, Point topLeft, Point bottomRight)
|
public KeyboardRegion(string regionName, Point topLeft, Point bottomRight)
|
||||||
{
|
{
|
||||||
RegionName = regionName;
|
RegionName = regionName;
|
||||||
TopLeft = topLeft;
|
TopLeft = topLeft;
|
||||||
BottomRight = bottomRight;
|
BottomRight = bottomRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string RegionName { get; set; }
|
||||||
|
public Point TopLeft { get; set; }
|
||||||
|
public Point BottomRight { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,52 +1,62 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Artemis.KeyboardProviders.Logitech.Utilities;
|
using Artemis.KeyboardProviders.Logitech.Utilities;
|
||||||
|
|
||||||
namespace Artemis.KeyboardProviders.Logitech
|
namespace Artemis.KeyboardProviders.Logitech
|
||||||
{
|
{
|
||||||
internal class Orion : KeyboardProvider
|
internal class Orion : KeyboardProvider
|
||||||
{
|
{
|
||||||
public Orion()
|
public Orion()
|
||||||
{
|
{
|
||||||
Name = "Logitech G910 RGB";
|
Name = "Logitech G910 RGB";
|
||||||
CantEnableText = "Couldn't connect to your Logitech G910.\n " +
|
CantEnableText = "Couldn't connect to your Logitech G910.\n " +
|
||||||
"Please check your cables and updating the Logitech Gaming Software.\n\n " +
|
"Please check your cables and updating the Logitech Gaming Software\n" +
|
||||||
"If needed, you can select a different keyboard in Artemis under settings.";
|
"A minimum version of 8.81.15 is required).\n\n " +
|
||||||
Height = 6;
|
"If needed, you can select a different keyboard in Artemis under settings.";
|
||||||
Width = 21;
|
Height = 6;
|
||||||
KeyboardRegions = new List<KeyboardRegion> {new KeyboardRegion("TopRow", new Point(0, 0), new Point(0, 16))};
|
Width = 21;
|
||||||
}
|
KeyboardRegions = new List<KeyboardRegion> {new KeyboardRegion("TopRow", new Point(0, 0), new Point(0, 16))};
|
||||||
|
}
|
||||||
public override bool CanEnable()
|
|
||||||
{
|
public override bool CanEnable()
|
||||||
// TODO
|
{
|
||||||
return true;
|
int majorNum = 0, minorNum = 0, buildNum = 0;
|
||||||
}
|
|
||||||
|
LogitechGSDK.LogiLedInit();
|
||||||
public override void Enable()
|
LogitechGSDK.LogiLedSetLightingForKeyWithKeyName(KeyboardNames.A, 100, 100, 100);
|
||||||
{
|
LogitechGSDK.LogiLedGetSdkVersion(ref majorNum, ref minorNum, ref buildNum);
|
||||||
// Initialize the SDK
|
LogitechGSDK.LogiLedRestoreLighting();
|
||||||
LogitechGSDK.LogiLedInit();
|
LogitechGSDK.LogiLedShutdown();
|
||||||
Thread.Sleep(200);
|
|
||||||
|
// Turn it into one long number...
|
||||||
LogitechGSDK.LogiLedSaveCurrentLighting();
|
var version = int.Parse($"{majorNum}{minorNum}{buildNum}");
|
||||||
LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_PERKEY_RGB);
|
return version >= 88115;
|
||||||
|
}
|
||||||
// Disable keys we can't color
|
|
||||||
LogitechGSDK.LogiLedSetLighting(0, 0, 0);
|
public override void Enable()
|
||||||
}
|
{
|
||||||
|
// Initialize the SDK
|
||||||
public override void Disable()
|
LogitechGSDK.LogiLedInit();
|
||||||
{
|
Thread.Sleep(200);
|
||||||
// Shutdown the SDK
|
|
||||||
LogitechGSDK.LogiLedRestoreLighting();
|
LogitechGSDK.LogiLedSaveCurrentLighting();
|
||||||
LogitechGSDK.LogiLedShutdown();
|
LogitechGSDK.LogiLedSetTargetDevice(LogitechGSDK.LOGI_DEVICETYPE_PERKEY_RGB);
|
||||||
}
|
|
||||||
|
// Disable keys we can't color
|
||||||
public override void DrawBitmap(Bitmap bitmap)
|
LogitechGSDK.LogiLedSetLighting(0, 0, 0);
|
||||||
{
|
}
|
||||||
LogitechGSDK.LogiLedSetLightingFromBitmap(OrionUtilities.BitmapToByteArray(bitmap));
|
|
||||||
}
|
public override void Disable()
|
||||||
}
|
{
|
||||||
|
// Shutdown the SDK
|
||||||
|
LogitechGSDK.LogiLedRestoreLighting();
|
||||||
|
LogitechGSDK.LogiLedShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void DrawBitmap(Bitmap bitmap)
|
||||||
|
{
|
||||||
|
LogitechGSDK.LogiLedSetLightingFromBitmap(OrionUtilities.BitmapToByteArray(bitmap));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
177
Artemis/Artemis/Managers/EffectManager.cs
Normal file
177
Artemis/Artemis/Managers/EffectManager.cs
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Artemis.Events;
|
||||||
|
using Artemis.Models;
|
||||||
|
using Artemis.Settings;
|
||||||
|
using Caliburn.Micro;
|
||||||
|
|
||||||
|
namespace Artemis.Managers
|
||||||
|
{
|
||||||
|
public class EffectManager
|
||||||
|
{
|
||||||
|
private readonly IEventAggregator _events;
|
||||||
|
private readonly MainManager _mainManager;
|
||||||
|
private bool _clearing;
|
||||||
|
private EffectModel _pauseEffect;
|
||||||
|
|
||||||
|
public EffectManager(MainManager mainManager, IEventAggregator events)
|
||||||
|
{
|
||||||
|
_mainManager = mainManager;
|
||||||
|
_events = events;
|
||||||
|
|
||||||
|
EffectModels = new List<EffectModel>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<EffectModel> EffectModels { get; set; }
|
||||||
|
public EffectModel ActiveEffect { get; private set; }
|
||||||
|
|
||||||
|
public IEnumerable<OverlayModel> EnabledOverlays
|
||||||
|
{
|
||||||
|
get { return EffectModels.OfType<OverlayModel>().Where(o => o.Enabled); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<GameModel> EnabledGames
|
||||||
|
{
|
||||||
|
get { return EffectModels.OfType<GameModel>().Where(g => g.Enabled); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads the last active effect from settings and enables it.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Whether enabling was successful or not.</returns>
|
||||||
|
public EffectModel GetLastEffect()
|
||||||
|
{
|
||||||
|
if (General.Default.LastEffect == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var effect = EffectModels.FirstOrDefault(e => e.Name == General.Default.LastEffect);
|
||||||
|
|
||||||
|
// Fall back to the first effect found, in case settings are messed up
|
||||||
|
return effect ?? EffectModels.First();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables the current effect and changes it to the provided effect.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="effectModel"></param>
|
||||||
|
/// <param name="force">Changes the effect, even if it's already running (effectively restarting it)</param>
|
||||||
|
public void ChangeEffect(EffectModel effectModel, bool force = false)
|
||||||
|
{
|
||||||
|
if (effectModel is OverlayModel)
|
||||||
|
throw new ArgumentException("Can't set an Overlay effect as the active effect");
|
||||||
|
|
||||||
|
// Game models are only used if they are enabled
|
||||||
|
var gameModel = effectModel as GameModel;
|
||||||
|
if (gameModel != null)
|
||||||
|
if (!gameModel.Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ActiveEffect != null)
|
||||||
|
if (effectModel.Name == ActiveEffect.Name && !force)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// If the main manager is running, pause it and safely change the effect
|
||||||
|
if (_mainManager.Running)
|
||||||
|
{
|
||||||
|
ChangeEffectWithPause(effectModel);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it's not running start it, and let the next recursion handle changing the effect
|
||||||
|
_mainManager.Start(effectModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeEffectWithPause(EffectModel effectModel)
|
||||||
|
{
|
||||||
|
if (_pauseEffect != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_pauseEffect = effectModel;
|
||||||
|
_mainManager.Pause();
|
||||||
|
_mainManager.PauseCallback += ChangeEffectPauseCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeEffectPauseCallback()
|
||||||
|
{
|
||||||
|
// Change effect logic
|
||||||
|
ActiveEffect?.Dispose();
|
||||||
|
|
||||||
|
ActiveEffect = _pauseEffect;
|
||||||
|
ActiveEffect.Enable();
|
||||||
|
|
||||||
|
// Let the ViewModels know
|
||||||
|
_events.PublishOnUIThread(new ActiveEffectChanged(ActiveEffect.Name));
|
||||||
|
|
||||||
|
_mainManager.Unpause();
|
||||||
|
_pauseEffect = null;
|
||||||
|
|
||||||
|
if (ActiveEffect is GameModel)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Non-game effects are stored as the new LastEffect.
|
||||||
|
General.Default.LastEffect = ActiveEffect.Name;
|
||||||
|
General.Default.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears the current effect
|
||||||
|
/// </summary>
|
||||||
|
public void ClearEffect()
|
||||||
|
{
|
||||||
|
if (_clearing)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Don't mess with the ActiveEffect if in the process of changing the effect.
|
||||||
|
if (_pauseEffect != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ActiveEffect == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_clearing = true;
|
||||||
|
|
||||||
|
_mainManager.Pause();
|
||||||
|
_mainManager.PauseCallback += ClearEffectPauseCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClearEffectPauseCallback()
|
||||||
|
{
|
||||||
|
ActiveEffect.Dispose();
|
||||||
|
ActiveEffect = null;
|
||||||
|
|
||||||
|
General.Default.LastEffect = null;
|
||||||
|
General.Default.Save();
|
||||||
|
|
||||||
|
_events.PublishOnUIThread(new ActiveEffectChanged(""));
|
||||||
|
|
||||||
|
_clearing = false;
|
||||||
|
_mainManager.Unpause();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables the given game
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="activeEffect"></param>
|
||||||
|
public void DisableGame(EffectModel activeEffect)
|
||||||
|
{
|
||||||
|
if (GetLastEffect() == null)
|
||||||
|
ClearEffect();
|
||||||
|
else
|
||||||
|
ChangeEffect(GetLastEffect());
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Disables the current ActiveEffect if it's a game that is disabled.
|
||||||
|
/// </summary>
|
||||||
|
public void DisableInactiveGame()
|
||||||
|
{
|
||||||
|
if (!(ActiveEffect is GameModel))
|
||||||
|
return;
|
||||||
|
if (EnabledGames.Contains(ActiveEffect))
|
||||||
|
return;
|
||||||
|
|
||||||
|
DisableGame(ActiveEffect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
92
Artemis/Artemis/Managers/KeyboardManager.cs
Normal file
92
Artemis/Artemis/Managers/KeyboardManager.cs
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using Artemis.KeyboardProviders;
|
||||||
|
using Artemis.Settings;
|
||||||
|
|
||||||
|
namespace Artemis.Managers
|
||||||
|
{
|
||||||
|
public class KeyboardManager
|
||||||
|
{
|
||||||
|
private readonly MainManager _mainManager;
|
||||||
|
|
||||||
|
public KeyboardManager(MainManager mainManager)
|
||||||
|
{
|
||||||
|
_mainManager = mainManager;
|
||||||
|
KeyboardProviders = ProviderHelper.GetKeyboardProviders();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<KeyboardProvider> KeyboardProviders { get; set; }
|
||||||
|
public KeyboardProvider ActiveKeyboard { get; set; }
|
||||||
|
|
||||||
|
/// <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);
|
||||||
|
EnableKeyboard(keyboard);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enables the given keyboard
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="keyboardProvider"></param>
|
||||||
|
public void EnableKeyboard(KeyboardProvider keyboardProvider)
|
||||||
|
{
|
||||||
|
ReleaseActiveKeyboard();
|
||||||
|
|
||||||
|
if (keyboardProvider == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ActiveKeyboard != null)
|
||||||
|
if (keyboardProvider.Name == ActiveKeyboard.Name)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Disable everything if there's no active keyboard found
|
||||||
|
if (!keyboardProvider.CanEnable())
|
||||||
|
{
|
||||||
|
_mainManager.DialogService.ShowErrorMessageBox(keyboardProvider.CantEnableText);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ActiveKeyboard = keyboardProvider;
|
||||||
|
ActiveKeyboard.Enable();
|
||||||
|
|
||||||
|
General.Default.LastKeyboard = ActiveKeyboard.Name;
|
||||||
|
General.Default.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Releases the active keyboard
|
||||||
|
/// </summary>
|
||||||
|
public void ReleaseActiveKeyboard()
|
||||||
|
{
|
||||||
|
if (ActiveKeyboard == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ActiveKeyboard.Disable();
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
298
Artemis/Artemis/Managers/MainManager.cs
Normal file
298
Artemis/Artemis/Managers/MainManager.cs
Normal file
@ -0,0 +1,298 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using Artemis.Events;
|
||||||
|
using Artemis.Models;
|
||||||
|
using Artemis.Services;
|
||||||
|
using Artemis.Utilities.GameState;
|
||||||
|
using Artemis.Utilities.Keyboard;
|
||||||
|
using Caliburn.Micro;
|
||||||
|
|
||||||
|
namespace Artemis.Managers
|
||||||
|
{
|
||||||
|
public class MainManager
|
||||||
|
{
|
||||||
|
public delegate void PauseCallbackHandler();
|
||||||
|
|
||||||
|
private readonly int _fps;
|
||||||
|
private bool _paused;
|
||||||
|
private bool _restarting;
|
||||||
|
|
||||||
|
public MainManager(IEventAggregator events, MetroDialogService dialogService)
|
||||||
|
{
|
||||||
|
Events = events;
|
||||||
|
DialogService = dialogService;
|
||||||
|
|
||||||
|
KeyboardManager = new KeyboardManager(this);
|
||||||
|
EffectManager = new EffectManager(this, Events);
|
||||||
|
KeyboardHook = new KeyboardHook();
|
||||||
|
|
||||||
|
_fps = 25;
|
||||||
|
UpdateWorker = new BackgroundWorker {WorkerSupportsCancellation = true};
|
||||||
|
ProcessWorker = new BackgroundWorker {WorkerSupportsCancellation = true};
|
||||||
|
|
||||||
|
UpdateWorker.DoWork += UpdateWorker_DoWork;
|
||||||
|
UpdateWorker.RunWorkerCompleted += BackgroundWorkerExceptionCatcher;
|
||||||
|
|
||||||
|
ProcessWorker.DoWork += ProcessWorker_DoWork;
|
||||||
|
ProcessWorker.RunWorkerCompleted += BackgroundWorkerExceptionCatcher;
|
||||||
|
|
||||||
|
// Process worker will always run (and just do nothing when ProgramEnabled is false)
|
||||||
|
ProcessWorker.RunWorkerAsync();
|
||||||
|
|
||||||
|
ProgramEnabled = false;
|
||||||
|
Running = false;
|
||||||
|
|
||||||
|
// Create and start the web server
|
||||||
|
GameStateWebServer = new GameStateWebServer();
|
||||||
|
GameStateWebServer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
public BackgroundWorker UpdateWorker { get; set; }
|
||||||
|
public BackgroundWorker ProcessWorker { get; set; }
|
||||||
|
|
||||||
|
public KeyboardManager KeyboardManager { get; set; }
|
||||||
|
public EffectManager EffectManager { get; set; }
|
||||||
|
|
||||||
|
public KeyboardHook KeyboardHook { get; set; }
|
||||||
|
|
||||||
|
public GameStateWebServer GameStateWebServer { get; set; }
|
||||||
|
public IEventAggregator Events { get; set; }
|
||||||
|
public MetroDialogService DialogService { get; set; }
|
||||||
|
|
||||||
|
public bool ProgramEnabled { get; private set; }
|
||||||
|
public bool Suspended { get; set; }
|
||||||
|
|
||||||
|
public bool Running { get; private set; }
|
||||||
|
public event PauseCallbackHandler PauseCallback;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Take control of the keyboard and start sending data to it
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Whether starting was successful or not</returns>
|
||||||
|
public bool Start(EffectModel effect = null)
|
||||||
|
{
|
||||||
|
// Can't take control when not enabled
|
||||||
|
if (!ProgramEnabled || UpdateWorker.CancellationPending || UpdateWorker.IsBusy || _paused)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
// Do nothing if already running
|
||||||
|
if (Running)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Only continue if a keyboard was loaded
|
||||||
|
KeyboardManager.EnableLastKeyboard();
|
||||||
|
if (KeyboardManager.ActiveKeyboard == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Running = true;
|
||||||
|
if (effect != null)
|
||||||
|
EffectManager.ChangeEffect(effect);
|
||||||
|
|
||||||
|
// Start the update worker
|
||||||
|
if (!UpdateWorker.IsBusy)
|
||||||
|
UpdateWorker.RunWorkerAsync();
|
||||||
|
|
||||||
|
return Running;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Releases control of the keyboard and stop sending data to it
|
||||||
|
/// </summary>
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
if (!Running || UpdateWorker.CancellationPending || _paused)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Stop the update worker
|
||||||
|
UpdateWorker.CancelAsync();
|
||||||
|
UpdateWorker.RunWorkerCompleted += FinishStop;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FinishStop(object sender, RunWorkerCompletedEventArgs e)
|
||||||
|
{
|
||||||
|
KeyboardManager.ReleaseActiveKeyboard();
|
||||||
|
Running = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Pause()
|
||||||
|
{
|
||||||
|
if (!Running || UpdateWorker.CancellationPending || _paused)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_paused = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Unpause()
|
||||||
|
{
|
||||||
|
if (!_paused)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_paused = false;
|
||||||
|
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>
|
||||||
|
/// Loads the last active effect and starts the program
|
||||||
|
/// </summary>
|
||||||
|
public void EnableProgram()
|
||||||
|
{
|
||||||
|
ProgramEnabled = true;
|
||||||
|
Start(EffectManager.GetLastEffect());
|
||||||
|
Events.PublishOnUIThread(new ToggleEnabled(ProgramEnabled));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops the program
|
||||||
|
/// </summary>
|
||||||
|
public void DisableProgram()
|
||||||
|
{
|
||||||
|
Stop();
|
||||||
|
ProgramEnabled = false;
|
||||||
|
Events.PublishOnUIThread(new ToggleEnabled(ProgramEnabled));
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Workers
|
||||||
|
|
||||||
|
private void UpdateWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||||
|
{
|
||||||
|
var sw = new Stopwatch();
|
||||||
|
while (!UpdateWorker.CancellationPending)
|
||||||
|
{
|
||||||
|
// Skip frame when paused
|
||||||
|
if (_paused)
|
||||||
|
{
|
||||||
|
PauseCallback?.Invoke();
|
||||||
|
Thread.Sleep(1000/_fps);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stop if no keyboard/effect are present
|
||||||
|
if (KeyboardManager.ActiveKeyboard == null || EffectManager.ActiveEffect == null)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000/_fps);
|
||||||
|
Stop();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't stop when the effect is still initialized, just skip this frame
|
||||||
|
if (!EffectManager.ActiveEffect.Initialized)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000/_fps);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
sw.Start();
|
||||||
|
|
||||||
|
// Update the current effect
|
||||||
|
if (EffectManager.ActiveEffect.Initialized)
|
||||||
|
EffectManager.ActiveEffect.Update();
|
||||||
|
|
||||||
|
// Get ActiveEffect's bitmap
|
||||||
|
var bitmap = EffectManager.ActiveEffect.Initialized
|
||||||
|
? EffectManager.ActiveEffect.GenerateBitmap()
|
||||||
|
: null;
|
||||||
|
|
||||||
|
// Draw enabled overlays on top
|
||||||
|
foreach (var overlayModel in EffectManager.EnabledOverlays)
|
||||||
|
{
|
||||||
|
overlayModel.Update();
|
||||||
|
bitmap = bitmap != null ? overlayModel.GenerateBitmap(bitmap) : overlayModel.GenerateBitmap();
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it exists, send bitmap to the device
|
||||||
|
if (bitmap != null && KeyboardManager.ActiveKeyboard != null)
|
||||||
|
{
|
||||||
|
KeyboardManager.ActiveKeyboard.DrawBitmap(bitmap);
|
||||||
|
|
||||||
|
// debugging TODO: Disable when window isn't shown
|
||||||
|
Events.PublishOnUIThread(new ChangeBitmap(bitmap));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sleep according to time left this frame
|
||||||
|
var sleep = (int) (1000/_fps - sw.ElapsedMilliseconds);
|
||||||
|
if (sleep > 0)
|
||||||
|
Thread.Sleep(sleep);
|
||||||
|
sw.Reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void BackgroundWorkerExceptionCatcher(object sender, RunWorkerCompletedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.Error != null)
|
||||||
|
throw e.Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProcessWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||||
|
{
|
||||||
|
while (!ProcessWorker.CancellationPending)
|
||||||
|
{
|
||||||
|
if (!ProgramEnabled)
|
||||||
|
{
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var runningProcesses = Process.GetProcesses();
|
||||||
|
|
||||||
|
// If the currently active effect is a disabled game, get rid of it.
|
||||||
|
if (EffectManager.ActiveEffect != null)
|
||||||
|
EffectManager.DisableInactiveGame();
|
||||||
|
|
||||||
|
// If the currently active effect is a no longer running game, get rid of it.
|
||||||
|
var activeGame = EffectManager.ActiveEffect as GameModel;
|
||||||
|
if (activeGame != null)
|
||||||
|
if (runningProcesses.All(p => p.ProcessName != activeGame.ProcessName))
|
||||||
|
EffectManager.DisableGame(activeGame);
|
||||||
|
|
||||||
|
// Look for running games, stopping on the first one that's found.
|
||||||
|
var newGame = EffectManager.EnabledGames
|
||||||
|
.FirstOrDefault(g => runningProcesses.Any(p => p.ProcessName == g.ProcessName));
|
||||||
|
|
||||||
|
// If it's not already enabled, do so.
|
||||||
|
if (newGame != null && EffectManager.ActiveEffect != newGame)
|
||||||
|
EffectManager.ChangeEffect(newGame);
|
||||||
|
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,31 +1,32 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using Artemis.Managers;
|
||||||
namespace Artemis.Models
|
|
||||||
{
|
namespace Artemis.Models
|
||||||
public abstract class EffectModel : IDisposable
|
{
|
||||||
{
|
public abstract class EffectModel : IDisposable
|
||||||
public delegate void SettingsUpdateHandler(EffectSettings settings);
|
{
|
||||||
|
public delegate void SettingsUpdateHandler(EffectSettings settings);
|
||||||
public MainModel MainModel;
|
|
||||||
public string Name;
|
public bool Initialized;
|
||||||
|
|
||||||
protected EffectModel(MainModel mainModel)
|
public MainManager MainManager;
|
||||||
{
|
public string Name;
|
||||||
MainModel = mainModel;
|
|
||||||
}
|
protected EffectModel(MainManager mainManager)
|
||||||
|
{
|
||||||
public abstract void Dispose();
|
MainManager = mainManager;
|
||||||
|
}
|
||||||
public event SettingsUpdateHandler SettingsUpdateEvent;
|
|
||||||
|
public abstract void Dispose();
|
||||||
// Called on creation
|
|
||||||
public abstract void Enable();
|
// Called on creation
|
||||||
|
public abstract void Enable();
|
||||||
// Called every iteration
|
|
||||||
public abstract void Update();
|
// Called every iteration
|
||||||
|
public abstract void Update();
|
||||||
// Called after every update
|
|
||||||
public abstract Bitmap GenerateBitmap();
|
// Called after every update
|
||||||
}
|
public abstract Bitmap GenerateBitmap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -1,11 +1,13 @@
|
|||||||
namespace Artemis.Models
|
using Artemis.Managers;
|
||||||
|
|
||||||
|
namespace Artemis.Models
|
||||||
{
|
{
|
||||||
public abstract class GameModel : EffectModel
|
public abstract class GameModel : EffectModel
|
||||||
{
|
{
|
||||||
public bool Enabled;
|
public bool Enabled;
|
||||||
public string ProcessName;
|
public string ProcessName;
|
||||||
|
|
||||||
protected GameModel(MainModel mainModel) : base(mainModel)
|
protected GameModel(MainManager mainManager) : base(mainManager)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
Artemis/Artemis/Models/GameSettings.cs
Normal file
7
Artemis/Artemis/Models/GameSettings.cs
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
namespace Artemis.Models
|
||||||
|
{
|
||||||
|
public abstract class GameSettings : EffectSettings
|
||||||
|
{
|
||||||
|
public bool Enabled { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,314 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using Artemis.Events;
|
|
||||||
using Artemis.KeyboardProviders;
|
|
||||||
using Artemis.Settings;
|
|
||||||
using Artemis.Utilities.GameState;
|
|
||||||
using Artemis.Utilities.Keyboard;
|
|
||||||
using Artemis.Utilities.Memory;
|
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.Models
|
|
||||||
{
|
|
||||||
public class MainModel
|
|
||||||
{
|
|
||||||
private readonly int _fps;
|
|
||||||
private readonly BackgroundWorker _processWorker;
|
|
||||||
private readonly BackgroundWorker _updateWorker;
|
|
||||||
|
|
||||||
private EffectModel _activeEffect;
|
|
||||||
private bool _wasSuspendedBeforeGame;
|
|
||||||
|
|
||||||
public MainModel(IEventAggregator events)
|
|
||||||
{
|
|
||||||
EffectModels = new List<EffectModel>();
|
|
||||||
KeyboardProviders = ProviderHelper.GetKeyboardProviders();
|
|
||||||
GameStateWebServer = new GameStateWebServer();
|
|
||||||
KeyboardHook = new KeyboardHook();
|
|
||||||
Suspended = false;
|
|
||||||
|
|
||||||
Events = events;
|
|
||||||
|
|
||||||
_fps = 25;
|
|
||||||
_updateWorker = new BackgroundWorker {WorkerSupportsCancellation = true};
|
|
||||||
_processWorker = new BackgroundWorker {WorkerSupportsCancellation = true};
|
|
||||||
_updateWorker.DoWork += UpdateWorker_DoWork;
|
|
||||||
_processWorker.DoWork += ProcessWorker_DoWork;
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeyboardHook KeyboardHook { get; set; }
|
|
||||||
public KeyboardProvider ActiveKeyboard { get; set; }
|
|
||||||
public List<EffectModel> EffectModels { get; set; }
|
|
||||||
public List<KeyboardProvider> KeyboardProviders { get; set; }
|
|
||||||
public GameStateWebServer GameStateWebServer { get; set; }
|
|
||||||
public IEventAggregator Events { get; set; }
|
|
||||||
public bool Enabled { get; private set; }
|
|
||||||
public bool Suspended { get; private set; }
|
|
||||||
|
|
||||||
#region Effect methods
|
|
||||||
|
|
||||||
public void StartEffects()
|
|
||||||
{
|
|
||||||
if (Enabled)
|
|
||||||
return;
|
|
||||||
if (_updateWorker.IsBusy || _processWorker.IsBusy)
|
|
||||||
{
|
|
||||||
Events.PublishOnUIThread(new ToggleEnabled(Enabled));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LoadLastKeyboard();
|
|
||||||
// If no keyboard was loaded, don't enable effects.
|
|
||||||
if (ActiveKeyboard == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Start the webserver
|
|
||||||
GameStateWebServer.Start();
|
|
||||||
|
|
||||||
// Load last non-game effect and enable
|
|
||||||
LoadLastEffect();
|
|
||||||
|
|
||||||
// Start the Background Workers
|
|
||||||
_updateWorker.RunWorkerAsync();
|
|
||||||
_processWorker.RunWorkerAsync();
|
|
||||||
|
|
||||||
Enabled = true;
|
|
||||||
Events.PublishOnUIThread(new ToggleEnabled(Enabled));
|
|
||||||
|
|
||||||
if (General.Default.Suspended && !Suspended)
|
|
||||||
ToggleSuspension();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ShutdownEffects()
|
|
||||||
{
|
|
||||||
if (!Enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Stop the Background Worker
|
|
||||||
_updateWorker.CancelAsync();
|
|
||||||
_processWorker.CancelAsync();
|
|
||||||
|
|
||||||
// Dispose the current active effect
|
|
||||||
_activeEffect?.Dispose();
|
|
||||||
_activeEffect = null;
|
|
||||||
|
|
||||||
ActiveKeyboard?.Disable();
|
|
||||||
ActiveKeyboard = null;
|
|
||||||
|
|
||||||
Enabled = false;
|
|
||||||
Events.PublishOnUIThread(new ToggleEnabled(Enabled));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LoadLastEffect()
|
|
||||||
{
|
|
||||||
var effect = EffectModels.FirstOrDefault(e => e.Name == General.Default.LastEffect);
|
|
||||||
ChangeEffect(effect ?? EffectModels.First(e => e.Name == "TypeWave"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ChangeEffect(EffectModel effectModel)
|
|
||||||
{
|
|
||||||
if (effectModel is OverlayModel)
|
|
||||||
throw new ArgumentException("Can't set an Overlay effect as the active effect");
|
|
||||||
|
|
||||||
// Game models are only used if they are enabled
|
|
||||||
var gameModel = effectModel as GameModel;
|
|
||||||
if (gameModel != null)
|
|
||||||
if (!gameModel.Enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_activeEffect != null && effectModel.Name == _activeEffect.Name)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_activeEffect?.Dispose();
|
|
||||||
|
|
||||||
// If needed, unsuspend when loading a new effect
|
|
||||||
if (Suspended)
|
|
||||||
{
|
|
||||||
_wasSuspendedBeforeGame = true;
|
|
||||||
ToggleSuspension();
|
|
||||||
}
|
|
||||||
|
|
||||||
_activeEffect = effectModel;
|
|
||||||
_activeEffect.Enable();
|
|
||||||
|
|
||||||
if (_activeEffect is GameModel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Non-game effects are stored as the new LastEffect.
|
|
||||||
General.Default.LastEffect = _activeEffect.Name;
|
|
||||||
General.Default.Save();
|
|
||||||
|
|
||||||
// Let the ViewModels know
|
|
||||||
Events.PublishOnUIThread(new ChangeActiveEffect(_activeEffect.Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void EnableEffect(EffectModel effectModel)
|
|
||||||
{
|
|
||||||
if (effectModel is GameModel || effectModel is OverlayModel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ChangeEffect(effectModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ToggleSuspension()
|
|
||||||
{
|
|
||||||
if (Suspended)
|
|
||||||
{
|
|
||||||
LoadLastKeyboard();
|
|
||||||
Suspended = false;
|
|
||||||
General.Default.Suspended = false;
|
|
||||||
General.Default.Save();
|
|
||||||
Events.PublishOnUIThread(new ChangeActiveEffect(_activeEffect?.Name));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Suspended = true;
|
|
||||||
General.Default.Suspended = true;
|
|
||||||
General.Default.Save();
|
|
||||||
ActiveKeyboard?.Disable();
|
|
||||||
ActiveKeyboard = null;
|
|
||||||
Events.PublishOnUIThread(new ChangeActiveEffect(_activeEffect?.Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsEnabled(EffectModel effectModel)
|
|
||||||
{
|
|
||||||
if (Suspended)
|
|
||||||
return false;
|
|
||||||
if (effectModel is GameModel)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return General.Default.LastEffect == effectModel.Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Keyboard methods
|
|
||||||
|
|
||||||
private void LoadLastKeyboard()
|
|
||||||
{
|
|
||||||
var keyboard = KeyboardProviders.FirstOrDefault(k => k.Name == General.Default.LastKeyboard);
|
|
||||||
ChangeKeyboard(keyboard ?? KeyboardProviders.First());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ChangeKeyboard(KeyboardProvider keyboardProvider)
|
|
||||||
{
|
|
||||||
if (ActiveKeyboard != null && keyboardProvider.Name == ActiveKeyboard.Name)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ActiveKeyboard?.Disable();
|
|
||||||
|
|
||||||
// Disable everything if there's no active keyboard found
|
|
||||||
if (!keyboardProvider.CanEnable())
|
|
||||||
{
|
|
||||||
ActiveKeyboard = null;
|
|
||||||
MessageBox.Show(keyboardProvider.CantEnableText, "Artemis (╯°□°)╯︵ ┻━┻",
|
|
||||||
MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
ShutdownEffects();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ActiveKeyboard = keyboardProvider;
|
|
||||||
ActiveKeyboard.Enable();
|
|
||||||
|
|
||||||
General.Default.LastKeyboard = ActiveKeyboard.Name;
|
|
||||||
General.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Workers
|
|
||||||
|
|
||||||
private void UpdateWorker_DoWork(object sender, DoWorkEventArgs e)
|
|
||||||
{
|
|
||||||
var sw = new Stopwatch();
|
|
||||||
while (!_updateWorker.CancellationPending)
|
|
||||||
{
|
|
||||||
if (ActiveKeyboard == null || Suspended || _activeEffect == null)
|
|
||||||
{
|
|
||||||
Thread.Sleep(1000/_fps);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
sw.Start();
|
|
||||||
|
|
||||||
// Update the current effect
|
|
||||||
_activeEffect.Update();
|
|
||||||
|
|
||||||
// Get ActiveEffect's bitmap
|
|
||||||
var bitmap = _activeEffect.GenerateBitmap();
|
|
||||||
|
|
||||||
// Draw enabled overlays on top
|
|
||||||
foreach (var overlayModel in EffectModels.OfType<OverlayModel>()
|
|
||||||
.Where(overlayModel => overlayModel.Enabled))
|
|
||||||
{
|
|
||||||
overlayModel.Update();
|
|
||||||
bitmap = bitmap != null ? overlayModel.GenerateBitmap(bitmap) : overlayModel.GenerateBitmap();
|
|
||||||
}
|
|
||||||
|
|
||||||
// If it exists, send bitmap to the device
|
|
||||||
if (bitmap != null && ActiveKeyboard != null)
|
|
||||||
{
|
|
||||||
ActiveKeyboard.DrawBitmap(bitmap);
|
|
||||||
|
|
||||||
// debugging TODO: Disable when window isn't shown
|
|
||||||
Events.PublishOnUIThread(new ChangeBitmap(bitmap));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sleep according to time left this frame
|
|
||||||
var sleep = (int) (1000/_fps - sw.ElapsedMilliseconds);
|
|
||||||
if (sleep > 0)
|
|
||||||
Thread.Sleep(sleep);
|
|
||||||
sw.Reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProcessWorker_DoWork(object sender, DoWorkEventArgs e)
|
|
||||||
{
|
|
||||||
while (!_processWorker.CancellationPending)
|
|
||||||
{
|
|
||||||
var foundProcess = false;
|
|
||||||
|
|
||||||
// ReSharper disable once LoopCanBePartlyConvertedToQuery
|
|
||||||
foreach (var effectModel in EffectModels.OfType<GameModel>())
|
|
||||||
{
|
|
||||||
var process = MemoryHelpers.GetProcessIfRunning(effectModel.ProcessName);
|
|
||||||
if (process == null)
|
|
||||||
continue;
|
|
||||||
if (process.HasExited)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// If the active effect is a disabled game model, disable it
|
|
||||||
var model = _activeEffect as GameModel;
|
|
||||||
if (model != null && !model.Enabled)
|
|
||||||
LoadLastEffect();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ChangeEffect(effectModel);
|
|
||||||
foundProcess = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// If no game process is found, but the active effect still belongs to a game,
|
|
||||||
// set it to a normal effect, and if needed, suspend again.
|
|
||||||
if (!foundProcess && _activeEffect is GameModel)
|
|
||||||
{
|
|
||||||
LoadLastEffect();
|
|
||||||
if (_wasSuspendedBeforeGame)
|
|
||||||
{
|
|
||||||
ToggleSuspension();
|
|
||||||
_wasSuspendedBeforeGame = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread.Sleep(1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using Artemis.Managers;
|
||||||
|
|
||||||
namespace Artemis.Models
|
namespace Artemis.Models
|
||||||
{
|
{
|
||||||
@ -7,11 +8,10 @@ namespace Artemis.Models
|
|||||||
private bool _enabled;
|
private bool _enabled;
|
||||||
public string ProcessName;
|
public string ProcessName;
|
||||||
|
|
||||||
protected OverlayModel(MainModel mainModel) : base(mainModel)
|
protected OverlayModel(MainManager mainManager) : base(mainManager)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overlay Enabled() and Dispose() is called when changing the Enabled value
|
|
||||||
public bool Enabled
|
public bool Enabled
|
||||||
{
|
{
|
||||||
get { return _enabled; }
|
get { return _enabled; }
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.Utilities.Audio;
|
using Artemis.Utilities.Audio;
|
||||||
@ -16,16 +17,19 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
{
|
{
|
||||||
private const int FftLength = 2048;
|
private const int FftLength = 2048;
|
||||||
private readonly SampleAggregator _sampleAggregator = new SampleAggregator(FftLength);
|
private readonly SampleAggregator _sampleAggregator = new SampleAggregator(FftLength);
|
||||||
|
private bool _fromBottom;
|
||||||
private bool _generating;
|
private bool _generating;
|
||||||
|
private int _sensitivity;
|
||||||
private IWaveIn _waveIn;
|
private IWaveIn _waveIn;
|
||||||
|
|
||||||
public AudioVisualizerModel(MainModel mainModel, AudioVisualizerSettings settings) : base(mainModel)
|
public AudioVisualizerModel(MainManager mainManager, AudioVisualizerSettings settings) : base(mainManager)
|
||||||
{
|
{
|
||||||
Settings = settings;
|
Settings = settings;
|
||||||
Name = "Audiovisualizer";
|
Name = "Audiovisualizer";
|
||||||
DeviceIds = new List<string>();
|
DeviceIds = new List<string>();
|
||||||
SpectrumData = new List<byte>();
|
SpectrumData = new List<byte>();
|
||||||
Scale = 4;
|
Scale = 4;
|
||||||
|
Initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Lines { get; set; }
|
public int Lines { get; set; }
|
||||||
@ -41,6 +45,7 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
|
Initialized = false;
|
||||||
_sampleAggregator.PerformFFT = false;
|
_sampleAggregator.PerformFFT = false;
|
||||||
_sampleAggregator.FftCalculated -= FftCalculated;
|
_sampleAggregator.FftCalculated -= FftCalculated;
|
||||||
|
|
||||||
@ -51,18 +56,20 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
|
|
||||||
public override void Enable()
|
public override void Enable()
|
||||||
{
|
{
|
||||||
Lines = MainModel.ActiveKeyboard.Width;
|
Initialized = false;
|
||||||
|
Lines = MainManager.KeyboardManager.ActiveKeyboard.Width;
|
||||||
|
|
||||||
// TODO: Device selection
|
// TODO: Device selection
|
||||||
SelectedDeviceId = new MMDeviceEnumerator()
|
SelectedDeviceId = new MMDeviceEnumerator()
|
||||||
.EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active)
|
.EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active)
|
||||||
.FirstOrDefault()?.ID;
|
.FirstOrDefault()?.ID;
|
||||||
|
|
||||||
|
// Apply settings
|
||||||
SoundRectangles = new List<KeyboardRectangle>();
|
SoundRectangles = new List<KeyboardRectangle>();
|
||||||
for (var i = 0; i < Lines; i++)
|
for (var i = 0; i < Lines; i++)
|
||||||
{
|
{
|
||||||
SoundRectangles.Add(new KeyboardRectangle(
|
SoundRectangles.Add(new KeyboardRectangle(
|
||||||
MainModel.ActiveKeyboard,
|
MainManager.KeyboardManager.ActiveKeyboard,
|
||||||
0, 0, new List<Color>
|
0, 0, new List<Color>
|
||||||
{
|
{
|
||||||
ColorHelpers.ToDrawingColor(Settings.TopColor),
|
ColorHelpers.ToDrawingColor(Settings.TopColor),
|
||||||
@ -71,13 +78,17 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
},
|
},
|
||||||
LinearGradientMode.Vertical) {ContainedBrush = false, Height = 0});
|
LinearGradientMode.Vertical) {ContainedBrush = false, Height = 0});
|
||||||
}
|
}
|
||||||
|
_sensitivity = Settings.Sensitivity;
|
||||||
|
_fromBottom = Settings.FromBottom;
|
||||||
_sampleAggregator.FftCalculated += FftCalculated;
|
_sampleAggregator.FftCalculated += FftCalculated;
|
||||||
_sampleAggregator.PerformFFT = true;
|
_sampleAggregator.PerformFFT = true;
|
||||||
|
|
||||||
|
// Start listening for sound data
|
||||||
_waveIn = new WasapiLoopbackCapture();
|
_waveIn = new WasapiLoopbackCapture();
|
||||||
_waveIn.DataAvailable += OnDataAvailable;
|
_waveIn.DataAvailable += OnDataAvailable;
|
||||||
_waveIn.StartRecording();
|
_waveIn.StartRecording();
|
||||||
|
|
||||||
|
Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
@ -107,8 +118,9 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
height = (int) Math.Round(SpectrumData[i]/2.55);
|
height = (int) Math.Round(SpectrumData[i]/2.55);
|
||||||
|
|
||||||
// Apply Sensitivity setting
|
// Apply Sensitivity setting
|
||||||
height = height*Settings.Sensitivity;
|
height = height*_sensitivity;
|
||||||
var keyboardHeight = (int) Math.Round(MainModel.ActiveKeyboard.Height/100.00*height*Scale);
|
var keyboardHeight =
|
||||||
|
(int) Math.Round(MainManager.KeyboardManager.ActiveKeyboard.Height/100.00*height*Scale);
|
||||||
if (keyboardHeight > SoundRectangles[i].Height)
|
if (keyboardHeight > SoundRectangles[i].Height)
|
||||||
SoundRectangles[i].Height = keyboardHeight;
|
SoundRectangles[i].Height = keyboardHeight;
|
||||||
else
|
else
|
||||||
@ -117,8 +129,9 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
SoundRectangles[i].X = i*Scale;
|
SoundRectangles[i].X = i*Scale;
|
||||||
SoundRectangles[i].Width = Scale;
|
SoundRectangles[i].Width = Scale;
|
||||||
|
|
||||||
if (Settings.FromBottom)
|
if (_fromBottom)
|
||||||
SoundRectangles[i].Y = MainModel.ActiveKeyboard.Height*Scale - SoundRectangles[i].Height;
|
SoundRectangles[i].Y = MainManager.KeyboardManager.ActiveKeyboard.Height*Scale -
|
||||||
|
SoundRectangles[i].Height;
|
||||||
}
|
}
|
||||||
_generating = false;
|
_generating = false;
|
||||||
}
|
}
|
||||||
@ -131,7 +144,7 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
// Lock the _spectrumData array while busy with it
|
// Lock the _spectrumData array while busy with it
|
||||||
_generating = true;
|
_generating = true;
|
||||||
|
|
||||||
var bitmap = MainModel.ActiveKeyboard.KeyboardBitmap(Scale);
|
var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(Scale);
|
||||||
using (var g = Graphics.FromImage(bitmap))
|
using (var g = Graphics.FromImage(bitmap))
|
||||||
{
|
{
|
||||||
foreach (var soundRectangle in SoundRectangles)
|
foreach (var soundRectangle in SoundRectangles)
|
||||||
|
|||||||
@ -37,17 +37,17 @@
|
|||||||
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||||
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
||||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||||
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
cal:Message.Attach="[Event Click] = [Action ToggleEffect]"
|
||||||
|
ToolTip="Note: You can't enable an effect when Artemis is disabled" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Top color -->
|
<!-- Top color -->
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,8">
|
Height="16" Margin="0,8">
|
||||||
Color used on top
|
Color used on top
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<xctk:ColorPicker x:Name="TopColor"
|
<xctk:ColorPicker x:Name="TopColor"
|
||||||
SelectedColor="{Binding Path=AudioVisualizerSettings.TopColor, Mode=TwoWay}"
|
SelectedColor="{Binding Path=EffectSettings.TopColor, Mode=TwoWay}"
|
||||||
Grid.Row="1" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
Grid.Row="1" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
@ -57,7 +57,7 @@
|
|||||||
Color used in the middle
|
Color used in the middle
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<xctk:ColorPicker x:Name="MiddleColor"
|
<xctk:ColorPicker x:Name="MiddleColor"
|
||||||
SelectedColor="{Binding Path=AudioVisualizerSettings.MiddleColor, Mode=TwoWay}"
|
SelectedColor="{Binding Path=EffectSettings.MiddleColor, Mode=TwoWay}"
|
||||||
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
@ -67,19 +67,18 @@
|
|||||||
Color used on the bottom
|
Color used on the bottom
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<xctk:ColorPicker x:Name="Bottom"
|
<xctk:ColorPicker x:Name="Bottom"
|
||||||
SelectedColor="{Binding Path=AudioVisualizerSettings.BottomColor, Mode=TwoWay}"
|
SelectedColor="{Binding Path=EffectSettings.BottomColor, Mode=TwoWay}"
|
||||||
Grid.Row="3" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
Grid.Row="3" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
<!-- Bar direction -->
|
<!-- Bar direction -->
|
||||||
<TextBlock Grid.Row="4" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
<TextBlock Grid.Row="4" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||||
Height="16" Margin="0,9,0,10">
|
Height="16" Margin="0,9,0,10">
|
||||||
Grow bars bottom (broken, sorry!)
|
Grow bars bottom
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=AudioVisualizerSettings.FromBottom, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=EffectSettings.FromBottom, Mode=TwoWay}"
|
||||||
Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
|
Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
|
||||||
OffLabel="No"
|
OffLabel="No" Margin="0,0,-5,0" Width="114" />
|
||||||
Margin="0,0,-5,0" Width="114" IsEnabled="False" />
|
|
||||||
|
|
||||||
<!-- Bars amount -->
|
<!-- Bars amount -->
|
||||||
<TextBlock Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
<TextBlock Grid.Row="5" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||||
@ -88,7 +87,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="Bars" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="Bars" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
||||||
Value="{Binding Path=AudioVisualizerSettings.Bars, Mode=TwoWay}" Minimum="2" Maximum="21"
|
Value="{Binding Path=EffectSettings.Bars, Mode=TwoWay}" Minimum="2" Maximum="21"
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" />
|
SmallChange="1" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- Sensitivity -->
|
<!-- Sensitivity -->
|
||||||
@ -98,7 +97,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="Sensitivity" Grid.Row="6" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="Sensitivity" Grid.Row="6" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
||||||
Value="{Binding Path=AudioVisualizerSettings.Sensitivity, Mode=TwoWay}" Minimum="1" Maximum="10"
|
Value="{Binding Path=EffectSettings.Sensitivity, Mode=TwoWay}" Minimum="1" Maximum="10"
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" />
|
SmallChange="1" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- Fade speed -->
|
<!-- Fade speed -->
|
||||||
@ -108,7 +107,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="FadeSpeed" Grid.Row="7" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="FadeSpeed" Grid.Row="7" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
||||||
Value="{Binding Path=AudioVisualizerSettings.FadeSpeed, Mode=TwoWay}" Minimum="1" Maximum="3"
|
Value="{Binding Path=EffectSettings.FadeSpeed, Mode=TwoWay}" Minimum="1" Maximum="3"
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" />
|
SmallChange="1" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
|
|||||||
@ -1,74 +1,31 @@
|
|||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.AudioVisualizer
|
namespace Artemis.Modules.Effects.AudioVisualizer
|
||||||
{
|
{
|
||||||
public class AudioVisualizerViewModel : Screen, IHandle<ChangeActiveEffect>
|
public class AudioVisualizerViewModel : EffectViewModel, IHandle<ActiveEffectChanged>
|
||||||
{
|
{
|
||||||
private AudioVisualizerSettings _audioVisualizerSettings;
|
public AudioVisualizerViewModel(MainManager mainManager)
|
||||||
|
|
||||||
public AudioVisualizerViewModel(MainModel mainModel)
|
|
||||||
{
|
{
|
||||||
// Subscribe to main model
|
// Subscribe to main model
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
MainModel.Events.Subscribe(this);
|
MainManager.Events.Subscribe(this);
|
||||||
|
|
||||||
// Settings are loaded from file by class
|
// Settings are loaded from file by class
|
||||||
AudioVisualizerSettings = new AudioVisualizerSettings();
|
EffectSettings = new AudioVisualizerSettings();
|
||||||
|
|
||||||
// Create effect model and add it to MainModel
|
// Create effect model and add it to MainManager
|
||||||
AudioVisualizerModel = new AudioVisualizerModel(mainModel, AudioVisualizerSettings);
|
EffectModel = new AudioVisualizerModel(mainManager, (AudioVisualizerSettings) EffectSettings);
|
||||||
MainModel.EffectModels.Add(AudioVisualizerModel);
|
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
|
||||||
public AudioVisualizerModel AudioVisualizerModel { get; set; }
|
|
||||||
|
|
||||||
public static string Name => "Audio Visualizer";
|
public static string Name => "Audio Visualizer";
|
||||||
public bool EffectEnabled => MainModel.IsEnabled(AudioVisualizerModel);
|
|
||||||
|
|
||||||
public AudioVisualizerSettings AudioVisualizerSettings
|
public void Handle(ActiveEffectChanged message)
|
||||||
{
|
|
||||||
get { return _audioVisualizerSettings; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (Equals(value, _audioVisualizerSettings)) return;
|
|
||||||
_audioVisualizerSettings = value;
|
|
||||||
NotifyOfPropertyChange(() => AudioVisualizerSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Handle(ChangeActiveEffect message)
|
|
||||||
{
|
{
|
||||||
NotifyOfPropertyChange(() => EffectEnabled);
|
NotifyOfPropertyChange(() => EffectEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleEffect()
|
|
||||||
{
|
|
||||||
if (EffectEnabled && !MainModel.Suspended)
|
|
||||||
MainModel.ToggleSuspension();
|
|
||||||
else if (!EffectEnabled && !MainModel.Suspended)
|
|
||||||
MainModel.EnableEffect(AudioVisualizerModel);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MainModel.ToggleSuspension();
|
|
||||||
MainModel.EnableEffect(AudioVisualizerModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SaveSettings()
|
|
||||||
{
|
|
||||||
AudioVisualizerSettings?.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ResetSettings()
|
|
||||||
{
|
|
||||||
// TODO: Confirmation dialog (Generic MVVM approach)
|
|
||||||
AudioVisualizerSettings.ToDefault();
|
|
||||||
NotifyOfPropertyChange(() => AudioVisualizerSettings);
|
|
||||||
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Utilities.Keyboard;
|
using Artemis.Utilities.Keyboard;
|
||||||
|
|
||||||
@ -8,11 +9,12 @@ namespace Artemis.Modules.Effects.Debug
|
|||||||
{
|
{
|
||||||
internal class DebugEffectModel : EffectModel
|
internal class DebugEffectModel : EffectModel
|
||||||
{
|
{
|
||||||
public DebugEffectModel(MainModel mainModel, DebugEffectSettings settings) : base(mainModel)
|
public DebugEffectModel(MainManager mainManager, DebugEffectSettings settings) : base(mainManager)
|
||||||
{
|
{
|
||||||
Name = "Debug Effect";
|
Name = "Debug Effect";
|
||||||
Settings = settings;
|
Settings = settings;
|
||||||
Scale = 4;
|
Scale = 4;
|
||||||
|
Initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Scale { get; set; }
|
public int Scale { get; set; }
|
||||||
@ -23,11 +25,14 @@ namespace Artemis.Modules.Effects.Debug
|
|||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
|
Initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Enable()
|
public override void Enable()
|
||||||
{
|
{
|
||||||
KeyboardRectangle = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, 0, new List<Color>
|
Initialized = false;
|
||||||
|
|
||||||
|
KeyboardRectangle = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List<Color>
|
||||||
{
|
{
|
||||||
Color.Red,
|
Color.Red,
|
||||||
Color.OrangeRed,
|
Color.OrangeRed,
|
||||||
@ -37,6 +42,8 @@ namespace Artemis.Modules.Effects.Debug
|
|||||||
Color.Purple,
|
Color.Purple,
|
||||||
Color.DeepPink
|
Color.DeepPink
|
||||||
}, LinearGradientMode.Horizontal);
|
}, LinearGradientMode.Horizontal);
|
||||||
|
|
||||||
|
Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
|
|||||||
@ -35,7 +35,9 @@
|
|||||||
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||||
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
||||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||||
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
cal:Message.Attach="[Event Click] = [Action ToggleEffect]"
|
||||||
|
ToolTip="Note: You can't enable an effect when Artemis is disabled"
|
||||||
|
ToolTipService.ShowOnDisabled="True" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
@ -54,7 +56,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="Width" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="Width" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1"
|
||||||
Value="{Binding Path=DebugEffectSettings.Width, Mode=TwoWay}" Minimum="0" Maximum="84"
|
Value="{Binding Path=EffectSettings.Width, Mode=TwoWay}" Minimum="0" Maximum="84"
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" />
|
SmallChange="1" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- Height -->
|
<!-- Height -->
|
||||||
@ -64,7 +66,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="Height" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="Height" Grid.Row="3" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1"
|
||||||
Value="{Binding Path=DebugEffectSettings.Height, Mode=TwoWay}" Minimum="0" Maximum="24"
|
Value="{Binding Path=EffectSettings.Height, Mode=TwoWay}" Minimum="0" Maximum="24"
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" />
|
SmallChange="1" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- Scale -->
|
<!-- Scale -->
|
||||||
@ -74,7 +76,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="Scale" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="Scale" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
||||||
Value="{Binding Path=DebugEffectSettings.Scale, Mode=TwoWay}" Minimum="1" Maximum="4"
|
Value="{Binding Path=EffectSettings.Scale, Mode=TwoWay}" Minimum="1" Maximum="4"
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" />
|
SmallChange="1" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- Color rotation -->
|
<!-- Color rotation -->
|
||||||
@ -82,7 +84,7 @@
|
|||||||
Height="16" Margin="0,9,0,10">
|
Height="16" Margin="0,9,0,10">
|
||||||
Rotate colors on debug-rectangle
|
Rotate colors on debug-rectangle
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=DebugEffectSettings.Rotate, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=EffectSettings.Rotate, Mode=TwoWay}"
|
||||||
Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
|
Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
|
||||||
OffLabel="No"
|
OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|||||||
@ -5,49 +5,33 @@ using System.IO;
|
|||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.Debug
|
namespace Artemis.Modules.Effects.Debug
|
||||||
{
|
{
|
||||||
internal class DebugEffectViewModel : Screen, IHandle<ChangeBitmap>, IHandle<ChangeActiveEffect>
|
internal class DebugEffectViewModel : EffectViewModel, IHandle<ChangeBitmap>, IHandle<ActiveEffectChanged>
|
||||||
{
|
{
|
||||||
private DebugEffectSettings _debugEffectSettings;
|
|
||||||
private ImageSource _imageSource;
|
private ImageSource _imageSource;
|
||||||
private string _selectedRectangleType;
|
private string _selectedRectangleType;
|
||||||
|
|
||||||
public DebugEffectViewModel(MainModel mainModel)
|
public DebugEffectViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
// Subscribe to main model
|
// Subscribe to main model
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
MainModel.Events.Subscribe(this);
|
MainManager.Events.Subscribe(this);
|
||||||
|
|
||||||
// Settings are loaded from file by class
|
// Settings are loaded from file by class
|
||||||
DebugEffectSettings = new DebugEffectSettings();
|
EffectSettings = new DebugEffectSettings();
|
||||||
|
|
||||||
// Create effect model and add it to MainModel
|
// Create effect model and add it to MainManager
|
||||||
DebugEffectModel = new DebugEffectModel(mainModel, DebugEffectSettings);
|
EffectModel = new DebugEffectModel(mainManager, (DebugEffectSettings) EffectSettings);
|
||||||
MainModel.EffectModels.Add(DebugEffectModel);
|
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
|
||||||
public DebugEffectModel DebugEffectModel { get; set; }
|
|
||||||
|
|
||||||
public static string Name => "Type Waves";
|
public static string Name => "Debug Effect";
|
||||||
public bool EffectEnabled => MainModel.IsEnabled(DebugEffectModel);
|
|
||||||
|
|
||||||
public DebugEffectSettings DebugEffectSettings
|
|
||||||
{
|
|
||||||
get { return _debugEffectSettings; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (Equals(value, _debugEffectSettings)) return;
|
|
||||||
_debugEffectSettings = value;
|
|
||||||
NotifyOfPropertyChange(() => DebugEffectSettings);
|
|
||||||
|
|
||||||
SelectedRectangleType = value.Type.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BindableCollection<string> RectangleTypes
|
public BindableCollection<string> RectangleTypes
|
||||||
=> new BindableCollection<string>(Enum.GetNames(typeof (LinearGradientMode)));
|
=> new BindableCollection<string>(Enum.GetNames(typeof (LinearGradientMode)));
|
||||||
@ -61,7 +45,8 @@ namespace Artemis.Modules.Effects.Debug
|
|||||||
_selectedRectangleType = value;
|
_selectedRectangleType = value;
|
||||||
NotifyOfPropertyChange(() => SelectedRectangleType);
|
NotifyOfPropertyChange(() => SelectedRectangleType);
|
||||||
|
|
||||||
DebugEffectSettings.Type = (LinearGradientMode) Enum.Parse(typeof (LinearGradientMode), value);
|
((DebugEffectSettings) EffectSettings).Type =
|
||||||
|
(LinearGradientMode) Enum.Parse(typeof (LinearGradientMode), value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,14 +60,13 @@ namespace Artemis.Modules.Effects.Debug
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Handle(ChangeActiveEffect message)
|
public void Handle(ActiveEffectChanged message)
|
||||||
{
|
{
|
||||||
NotifyOfPropertyChange(() => EffectEnabled);
|
NotifyOfPropertyChange(() => EffectEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Handle(ChangeBitmap message)
|
public void Handle(ChangeBitmap message)
|
||||||
{
|
{
|
||||||
// Doesn't show transparancy
|
|
||||||
using (var memory = new MemoryStream())
|
using (var memory = new MemoryStream())
|
||||||
{
|
{
|
||||||
message.Bitmap.Save(memory, ImageFormat.Png);
|
message.Bitmap.Save(memory, ImageFormat.Png);
|
||||||
@ -97,25 +81,5 @@ namespace Artemis.Modules.Effects.Debug
|
|||||||
ImageSource = bitmapImage;
|
ImageSource = bitmapImage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleEffect()
|
|
||||||
{
|
|
||||||
if (EffectEnabled && !MainModel.Suspended)
|
|
||||||
MainModel.ToggleSuspension();
|
|
||||||
else if (!EffectEnabled && !MainModel.Suspended)
|
|
||||||
MainModel.EnableEffect(DebugEffectModel);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MainModel.ToggleSuspension();
|
|
||||||
MainModel.EnableEffect(DebugEffectModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ResetSettings()
|
|
||||||
{
|
|
||||||
// TODO: Confirmation dialog (Generic MVVM approach)
|
|
||||||
DebugEffectSettings.ToDefault();
|
|
||||||
NotifyOfPropertyChange(() => DebugEffectSettings);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,21 +1,31 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.TypeHole
|
namespace Artemis.Modules.Effects.TypeHole
|
||||||
{
|
{
|
||||||
public class TypeHoleModel : EffectModel
|
public class TypeHoleModel : EffectModel
|
||||||
{
|
{
|
||||||
public TypeHoleModel(MainModel mainModel) : base(mainModel)
|
public TypeHoleModel(MainManager mainManager) : base(mainManager)
|
||||||
{
|
{
|
||||||
Name = "TypeHole";
|
Name = "TypeHole";
|
||||||
|
Initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
|
Initialized = false;
|
||||||
|
|
||||||
|
// Disable logic
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Enable()
|
public override void Enable()
|
||||||
{
|
{
|
||||||
|
Initialized = false;
|
||||||
|
|
||||||
|
// Enable logic
|
||||||
|
|
||||||
|
Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
|
|||||||
@ -31,9 +31,17 @@
|
|||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||||
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
||||||
IsChecked="{Binding Path=EffectEnabled, Mode=OneWay}"
|
|
||||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||||
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
||||||
|
<Popup PlacementTarget="{Binding ElementName=EffectEnabled}"
|
||||||
|
IsOpen="{Binding Path=ShowDisabledPopup, Mode=TwoWay}" Placement="Left" VerticalOffset="-10"
|
||||||
|
PopupAnimation="Fade" StaysOpen="False">
|
||||||
|
<Border Margin="1">
|
||||||
|
<TextBlock Background="{DynamicResource AccentColorBrush}"
|
||||||
|
Foreground="{DynamicResource IdealForegroundColorBrush}"
|
||||||
|
Text="You can't enable an effect when Artemis is disabled" Padding="4" />
|
||||||
|
</Border>
|
||||||
|
</Popup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -1,44 +1,28 @@
|
|||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.TypeHole
|
namespace Artemis.Modules.Effects.TypeHole
|
||||||
{
|
{
|
||||||
public class TypeHoleViewModel : Screen, IHandle<ChangeActiveEffect>
|
public class TypeHoleViewModel : EffectViewModel, IHandle<ActiveEffectChanged>
|
||||||
{
|
{
|
||||||
public TypeHoleViewModel(MainModel mainModel)
|
public TypeHoleViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
// Subscribe to main model
|
// Subscribe to main model
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
MainModel.Events.Subscribe(this);
|
MainManager.Events.Subscribe(this);
|
||||||
|
|
||||||
// Create effect model and add it to MainModel
|
// Create effect model and add it to MainManager
|
||||||
TypeHoleModel = new TypeHoleModel(mainModel);
|
EffectModel = new TypeHoleModel(mainManager);
|
||||||
MainModel.EffectModels.Add(TypeHoleModel);
|
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
|
||||||
public TypeHoleModel TypeHoleModel { get; set; }
|
|
||||||
|
|
||||||
public static string Name => "Type Holes (NYI)";
|
public static string Name => "Type Holes (NYI)";
|
||||||
public bool EffectEnabled => MainModel.IsEnabled(TypeHoleModel);
|
|
||||||
|
|
||||||
public void Handle(ChangeActiveEffect message)
|
public void Handle(ActiveEffectChanged message)
|
||||||
{
|
{
|
||||||
NotifyOfPropertyChange(() => EffectEnabled);
|
NotifyOfPropertyChange(() => EffectEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleEffect()
|
|
||||||
{
|
|
||||||
if (EffectEnabled && !MainModel.Suspended)
|
|
||||||
MainModel.ToggleSuspension();
|
|
||||||
else if (!EffectEnabled && !MainModel.Suspended)
|
|
||||||
MainModel.EnableEffect(TypeHoleModel);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MainModel.ToggleSuspension();
|
|
||||||
MainModel.EnableEffect(TypeHoleModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2,10 +2,10 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Artemis.KeyboardProviders.Corsair;
|
using Artemis.KeyboardProviders.Corsair;
|
||||||
using Artemis.KeyboardProviders.Logitech.Utilities;
|
using Artemis.KeyboardProviders.Logitech.Utilities;
|
||||||
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
|
|
||||||
@ -16,25 +16,50 @@ namespace Artemis.Modules.Effects.TypeWave
|
|||||||
private readonly List<Wave> _waves;
|
private readonly List<Wave> _waves;
|
||||||
private Color _randomColor;
|
private Color _randomColor;
|
||||||
|
|
||||||
public TypeWaveModel(MainModel mainModel, TypeWaveSettings settings) : base(mainModel)
|
public TypeWaveModel(MainManager mainManager, TypeWaveSettings settings) : base(mainManager)
|
||||||
{
|
{
|
||||||
Name = "TypeWave";
|
Name = "TypeWave";
|
||||||
_waves = new List<Wave>();
|
_waves = new List<Wave>();
|
||||||
_randomColor = Color.Red;
|
_randomColor = Color.Red;
|
||||||
Settings = settings;
|
Settings = settings;
|
||||||
|
Initialized = false;
|
||||||
|
Scale = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int Scale { get; set; }
|
||||||
|
|
||||||
public TypeWaveSettings Settings { get; set; }
|
public TypeWaveSettings Settings { get; set; }
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
MainModel.KeyboardHook.Unsubscribe(HandleKeypress);
|
Initialized = false;
|
||||||
|
MainManager.KeyboardHook.KeyDownCallback -= KeyboardHookOnKeyDownCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void KeyboardHookOnKeyDownCallback(KeyEventArgs e)
|
||||||
|
{
|
||||||
|
// More than 25 waves is pointless
|
||||||
|
if (_waves.Count >= 25)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var keyMatch = KeyMap.UsEnglishOrionKeys.FirstOrDefault(k => k.KeyCode == e.KeyCode);
|
||||||
|
if (keyMatch == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_waves.Add(Settings.IsRandomColors
|
||||||
|
? new Wave(new Point(keyMatch.PosX * Scale, keyMatch.PosY * Scale), 0, _randomColor)
|
||||||
|
: new Wave(new Point(keyMatch.PosX * Scale, keyMatch.PosY * Scale), 0,
|
||||||
|
ColorHelpers.ToDrawingColor(Settings.WaveColor)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Enable()
|
public override void Enable()
|
||||||
{
|
{
|
||||||
|
Initialized = false;
|
||||||
|
|
||||||
// Listener won't start unless the effect is active
|
// Listener won't start unless the effect is active
|
||||||
MainModel.KeyboardHook.Subscribe(HandleKeypress);
|
MainManager.KeyboardHook.KeyDownCallback += KeyboardHookOnKeyDownCallback;
|
||||||
|
|
||||||
|
Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
@ -47,7 +72,7 @@ namespace Artemis.Modules.Effects.TypeWave
|
|||||||
// TODO: Get from settings
|
// TODO: Get from settings
|
||||||
var fps = 25;
|
var fps = 25;
|
||||||
|
|
||||||
_waves[i].Size += Settings.SpreadSpeed;
|
_waves[i].Size += Settings.SpreadSpeed * Scale;
|
||||||
|
|
||||||
if (Settings.IsShiftColors)
|
if (Settings.IsShiftColors)
|
||||||
_waves[i].Color = ColorHelpers.ShiftColor(_waves[i].Color, Settings.ShiftColorSpeed);
|
_waves[i].Color = ColorHelpers.ShiftColor(_waves[i].Color, Settings.ShiftColorSpeed);
|
||||||
@ -71,13 +96,13 @@ namespace Artemis.Modules.Effects.TypeWave
|
|||||||
if (_waves.Count == 0)
|
if (_waves.Count == 0)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var bitmap = MainModel.ActiveKeyboard.KeyboardBitmap();
|
var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(Scale);
|
||||||
using (var g = Graphics.FromImage(bitmap))
|
using (var g = Graphics.FromImage(bitmap))
|
||||||
{
|
{
|
||||||
g.Clear(Color.Transparent);
|
g.Clear(Color.Transparent);
|
||||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||||
|
|
||||||
// Don't want a foreach, collection is changed in different thread
|
// Don't want a for-each, collection is changed in different thread
|
||||||
// ReSharper disable once ForCanBeConvertedToForeach
|
// ReSharper disable once ForCanBeConvertedToForeach
|
||||||
for (var i = 0; i < _waves.Count; i++)
|
for (var i = 0; i < _waves.Count; i++)
|
||||||
{
|
{
|
||||||
@ -88,7 +113,7 @@ namespace Artemis.Modules.Effects.TypeWave
|
|||||||
_waves[i].Size, _waves[i].Size);
|
_waves[i].Size, _waves[i].Size);
|
||||||
|
|
||||||
Color fillColor;
|
Color fillColor;
|
||||||
if (MainModel.ActiveKeyboard is CorsairRGB)
|
if (MainManager.KeyboardManager.ActiveKeyboard is CorsairRGB)
|
||||||
fillColor = Color.Black;
|
fillColor = Color.Black;
|
||||||
else
|
else
|
||||||
fillColor = Color.Transparent;
|
fillColor = Color.Transparent;
|
||||||
@ -109,27 +134,6 @@ namespace Artemis.Modules.Effects.TypeWave
|
|||||||
}
|
}
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleKeypress(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
Task.Factory.StartNew(() => KeyPressTask(e));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void KeyPressTask(KeyEventArgs e)
|
|
||||||
{
|
|
||||||
// More than 25 waves is pointless
|
|
||||||
if (_waves.Count >= 25)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var keyMatch = KeyMap.UsEnglishOrionKeys.FirstOrDefault(k => k.KeyCode == e.KeyCode);
|
|
||||||
if (keyMatch == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_waves.Add(Settings.IsRandomColors
|
|
||||||
? new Wave(new Point(keyMatch.PosX, keyMatch.PosY), 0, _randomColor)
|
|
||||||
: new Wave(new Point(keyMatch.PosX, keyMatch.PosY), 0,
|
|
||||||
ColorHelpers.ToDrawingColor(Settings.WaveColor)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Wave
|
public class Wave
|
||||||
|
|||||||
@ -22,7 +22,6 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
@ -35,8 +34,17 @@
|
|||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||||
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
||||||
cal:Message.Attach="[Event Click] = [Action ToggleEffect]"
|
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||||
Style="{DynamicResource MetroCircleToggleButtonStyle}" />
|
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
||||||
|
<Popup PlacementTarget="{Binding ElementName=EffectEnabled}"
|
||||||
|
IsOpen="{Binding Path=ShowDisabledPopup, Mode=TwoWay}" Placement="Left" VerticalOffset="-10"
|
||||||
|
PopupAnimation="Fade" StaysOpen="False">
|
||||||
|
<Border Margin="1">
|
||||||
|
<TextBlock Background="{DynamicResource AccentColorBrush}"
|
||||||
|
Foreground="{DynamicResource IdealForegroundColorBrush}"
|
||||||
|
Text="You can't enable an effect when Artemis is disabled" Padding="4" />
|
||||||
|
</Border>
|
||||||
|
</Popup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
@ -46,7 +54,7 @@
|
|||||||
Wave color
|
Wave color
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<xctk:ColorPicker x:Name="MiddleColor"
|
<xctk:ColorPicker x:Name="MiddleColor"
|
||||||
SelectedColor="{Binding Path=TypeWaveSettings.WaveColor, Mode=TwoWay}"
|
SelectedColor="{Binding Path=EffectSettings.WaveColor, Mode=TwoWay}"
|
||||||
Grid.Row="1" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
Grid.Row="1" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
@ -55,7 +63,7 @@
|
|||||||
Height="16" Margin="0,8">
|
Height="16" Margin="0,8">
|
||||||
Use random colors
|
Use random colors
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=TypeWaveSettings.IsRandomColors, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=EffectSettings.IsRandomColors, Mode=TwoWay}"
|
||||||
Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
|
Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
|
||||||
OffLabel="No"
|
OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
@ -65,7 +73,7 @@
|
|||||||
Height="16" Margin="0,8">
|
Height="16" Margin="0,8">
|
||||||
Shift through colors as the wave grows
|
Shift through colors as the wave grows
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=TypeWaveSettings.IsShiftColors, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=EffectSettings.IsShiftColors, Mode=TwoWay}"
|
||||||
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
|
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
|
||||||
OffLabel="No"
|
OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
@ -77,7 +85,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="ColorShiftSpeed" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="ColorShiftSpeed" Grid.Row="4" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1"
|
||||||
Value="{Binding Path=TypeWaveSettings.ShiftColorSpeed, Mode=TwoWay}" Minimum="1" Maximum="200"
|
Value="{Binding Path=EffectSettings.ShiftColorSpeed, Mode=TwoWay}" Minimum="1" Maximum="200"
|
||||||
SmallChange="45" IsSnapToTickEnabled="True" />
|
SmallChange="45" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- TTL -->
|
<!-- TTL -->
|
||||||
@ -87,7 +95,7 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="TimeToLive" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="TimeToLive" Grid.Row="5" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="None" TickFrequency="1"
|
||||||
Value="{Binding Path=TypeWaveSettings.TimeToLive, Mode=TwoWay}" Minimum="100" Maximum="2000"
|
Value="{Binding Path=EffectSettings.TimeToLive, Mode=TwoWay}" Minimum="100" Maximum="2000"
|
||||||
SmallChange="45" IsSnapToTickEnabled="True" />
|
SmallChange="45" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- Growth speed -->
|
<!-- Growth speed -->
|
||||||
@ -97,11 +105,11 @@
|
|||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Slider x:Name="SpreadSpeed" Grid.Row="6" Grid.Column="1" VerticalAlignment="Center"
|
<Slider x:Name="SpreadSpeed" Grid.Row="6" Grid.Column="1" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
HorizontalAlignment="Right" Width="110" TickPlacement="BottomRight" TickFrequency="1"
|
||||||
Value="{Binding Path=TypeWaveSettings.SpreadSpeed, Mode=TwoWay}" Minimum="1" Maximum="6"
|
Value="{Binding Path=EffectSettings.SpreadSpeed, Mode=TwoWay}" Minimum="1" Maximum="6"
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" />
|
SmallChange="1" IsSnapToTickEnabled="True" />
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
<StackPanel Grid.Column="0" Grid.Row="7" Orientation="Horizontal" VerticalAlignment="Bottom">
|
<StackPanel Grid.Column="0" Grid.Row="8" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||||
|
|||||||
@ -1,77 +1,31 @@
|
|||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.TypeWave
|
namespace Artemis.Modules.Effects.TypeWave
|
||||||
{
|
{
|
||||||
public class TypeWaveViewModel : Screen, IHandle<ChangeActiveEffect>
|
public class TypeWaveViewModel : EffectViewModel, IHandle<ActiveEffectChanged>
|
||||||
{
|
{
|
||||||
private TypeWaveSettings _typeWaveSettings;
|
public TypeWaveViewModel(MainManager mainManager)
|
||||||
|
|
||||||
public TypeWaveViewModel(MainModel mainModel)
|
|
||||||
{
|
{
|
||||||
// Subscribe to main model
|
// Subscribe to main model
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
MainModel.Events.Subscribe(this);
|
MainManager.Events.Subscribe(this);
|
||||||
|
|
||||||
// Settings are loaded from file by class
|
// Settings are loaded from file by class
|
||||||
TypeWaveSettings = new TypeWaveSettings();
|
EffectSettings = new TypeWaveSettings();
|
||||||
|
|
||||||
// Create effect model and add it to MainModel
|
// Create effect model and add it to MainManager
|
||||||
TypeWaveModel = new TypeWaveModel(mainModel, TypeWaveSettings);
|
EffectModel = new TypeWaveModel(mainManager, (TypeWaveSettings) EffectSettings);
|
||||||
MainModel.EffectModels.Add(TypeWaveModel);
|
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
|
||||||
public TypeWaveModel TypeWaveModel { get; set; }
|
|
||||||
|
|
||||||
public static string Name => "Type Waves";
|
public static string Name => "Type Waves";
|
||||||
public bool EffectEnabled => MainModel.IsEnabled(TypeWaveModel);
|
|
||||||
|
|
||||||
public TypeWaveSettings TypeWaveSettings
|
public void Handle(ActiveEffectChanged message)
|
||||||
{
|
|
||||||
get { return _typeWaveSettings; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (Equals(value, _typeWaveSettings)) return;
|
|
||||||
_typeWaveSettings = value;
|
|
||||||
NotifyOfPropertyChange(() => TypeWaveSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Handle(ChangeActiveEffect message)
|
|
||||||
{
|
{
|
||||||
NotifyOfPropertyChange(() => EffectEnabled);
|
NotifyOfPropertyChange(() => EffectEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleEffect()
|
|
||||||
{
|
|
||||||
if (EffectEnabled && !MainModel.Suspended)
|
|
||||||
MainModel.ToggleSuspension();
|
|
||||||
else if (!EffectEnabled && !MainModel.Suspended)
|
|
||||||
MainModel.EnableEffect(TypeWaveModel);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MainModel.ToggleSuspension();
|
|
||||||
MainModel.EnableEffect(TypeWaveModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SaveSettings()
|
|
||||||
{
|
|
||||||
if (TypeWaveModel == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
TypeWaveSettings.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ResetSettings()
|
|
||||||
{
|
|
||||||
// TODO: Confirmation dialog (Generic MVVM approach)
|
|
||||||
TypeWaveSettings.ToDefault();
|
|
||||||
NotifyOfPropertyChange(() => TypeWaveSettings);
|
|
||||||
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,134 +1,134 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <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.Modules.Games.CounterStrike {
|
namespace Artemis.Modules.Games.CounterStrike {
|
||||||
|
|
||||||
|
|
||||||
[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 CounterStrike : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class CounterStrike : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static CounterStrike defaultInstance = ((CounterStrike)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new CounterStrike())));
|
private static CounterStrike defaultInstance = ((CounterStrike)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new CounterStrike())));
|
||||||
|
|
||||||
public static CounterStrike Default {
|
public static CounterStrike 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("True")]
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
public bool Enabled {
|
public bool Enabled {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["Enabled"]));
|
return ((bool)(this["Enabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["Enabled"] = value;
|
this["Enabled"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
||||||
public string GameDirectory {
|
public string GameDirectory {
|
||||||
get {
|
get {
|
||||||
return ((string)(this["GameDirectory"]));
|
return ((string)(this["GameDirectory"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["GameDirectory"] = value;
|
this["GameDirectory"] = 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 AmmoEnabled {
|
public bool AmmoEnabled {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["AmmoEnabled"]));
|
return ((bool)(this["AmmoEnabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["AmmoEnabled"] = value;
|
this["AmmoEnabled"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF2900")]
|
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF2900")]
|
||||||
public global::System.Windows.Media.Color AmmoMainColor {
|
public global::System.Windows.Media.Color AmmoMainColor {
|
||||||
get {
|
get {
|
||||||
return ((global::System.Windows.Media.Color)(this["AmmoMainColor"]));
|
return ((global::System.Windows.Media.Color)(this["AmmoMainColor"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["AmmoMainColor"] = value;
|
this["AmmoMainColor"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FF26F600")]
|
[global::System.Configuration.DefaultSettingValueAttribute("#FF26F600")]
|
||||||
public global::System.Windows.Media.Color AmmoSecondaryColor {
|
public global::System.Windows.Media.Color AmmoSecondaryColor {
|
||||||
get {
|
get {
|
||||||
return ((global::System.Windows.Media.Color)(this["AmmoSecondaryColor"]));
|
return ((global::System.Windows.Media.Color)(this["AmmoSecondaryColor"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["AmmoSecondaryColor"] = value;
|
this["AmmoSecondaryColor"] = 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 TeamColorEnabled {
|
public bool TeamColorEnabled {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["TeamColorEnabled"]));
|
return ((bool)(this["TeamColorEnabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["TeamColorEnabled"] = value;
|
this["TeamColorEnabled"] = 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 FlashEnabled {
|
public bool FlashEnabled {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["FlashEnabled"]));
|
return ((bool)(this["FlashEnabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["FlashEnabled"] = value;
|
this["FlashEnabled"] = 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 SmokeEnabled {
|
public bool SmokeEnabled {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["SmokeEnabled"]));
|
return ((bool)(this["SmokeEnabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["SmokeEnabled"] = value;
|
this["SmokeEnabled"] = 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 LowHpEnabled {
|
public bool LowHpEnabled {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["LowHpEnabled"]));
|
return ((bool)(this["LowHpEnabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["LowHpEnabled"] = value;
|
this["LowHpEnabled"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,35 +1,35 @@
|
|||||||
<?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)"
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||||
GeneratedClassNamespace="Artemis.Modules.Games.CounterStrike" GeneratedClassName="CounterStrike">
|
GeneratedClassNamespace="Artemis.Modules.Games.CounterStrike" GeneratedClassName="CounterStrike">
|
||||||
<Profiles />
|
<Profiles />
|
||||||
<Settings>
|
<Settings>
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="GameDirectory" Type="System.String" Scope="User">
|
<Setting Name="GameDirectory" Type="System.String" Scope="User">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)" />
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="AmmoEnabled" Type="System.Boolean" Scope="User">
|
<Setting Name="AmmoEnabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="AmmoMainColor" Type="System.Windows.Media.Color" Scope="User">
|
<Setting Name="AmmoMainColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
<Value Profile="(Default)">#FFFF2900</Value>
|
<Value Profile="(Default)">#FFFF2900</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="AmmoSecondaryColor" Type="System.Windows.Media.Color" Scope="User">
|
<Setting Name="AmmoSecondaryColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
<Value Profile="(Default)">#FF26F600</Value>
|
<Value Profile="(Default)">#FF26F600</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="TeamColorEnabled" Type="System.Boolean" Scope="User">
|
<Setting Name="TeamColorEnabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="FlashEnabled" Type="System.Boolean" Scope="User">
|
<Setting Name="FlashEnabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="SmokeEnabled" Type="System.Boolean" Scope="User">
|
<Setting Name="SmokeEnabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="LowHpEnabled" Type="System.Boolean" Scope="User">
|
<Setting Name="LowHpEnabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -4,8 +4,7 @@ using System.Drawing;
|
|||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.KeyboardProviders;
|
using Artemis.KeyboardProviders;
|
||||||
using Artemis.KeyboardProviders.Corsair;
|
using Artemis.Managers;
|
||||||
using Artemis.KeyboardProviders.Logitech;
|
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.Utilities.GameState;
|
using Artemis.Utilities.GameState;
|
||||||
@ -19,13 +18,14 @@ namespace Artemis.Modules.Games.CounterStrike
|
|||||||
{
|
{
|
||||||
private KeyboardRegion _topRow;
|
private KeyboardRegion _topRow;
|
||||||
|
|
||||||
public CounterStrikeModel(MainModel mainModel, CounterStrikeSettings settings) : base(mainModel)
|
public CounterStrikeModel(MainManager mainManager, CounterStrikeSettings settings) : base(mainManager)
|
||||||
{
|
{
|
||||||
Settings = settings;
|
Settings = settings;
|
||||||
Name = "CounterStrike";
|
Name = "CounterStrike";
|
||||||
ProcessName = "csgo";
|
ProcessName = "csgo";
|
||||||
Scale = 4;
|
Scale = 4;
|
||||||
Enabled = Settings.Enabled;
|
Enabled = Settings.Enabled;
|
||||||
|
Initialized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CounterStrikeSettings Settings { get; set; }
|
public CounterStrikeSettings Settings { get; set; }
|
||||||
@ -42,20 +42,34 @@ namespace Artemis.Modules.Games.CounterStrike
|
|||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
MainModel.GameStateWebServer.GameDataReceived -= HandleGameData;
|
Initialized = false;
|
||||||
|
MainManager.GameStateWebServer.GameDataReceived -= HandleGameData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Enable()
|
public override void Enable()
|
||||||
{
|
{
|
||||||
|
Initialized = false;
|
||||||
|
|
||||||
// Some keyboards have a different baseline, Corsair F-keys start at row 1
|
// Some keyboards have a different baseline, Corsair F-keys start at row 1
|
||||||
_topRow = MainModel.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "TopRow");
|
_topRow = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "TopRow");
|
||||||
AmmoRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, _topRow.TopLeft.X, new List<Color>(),
|
AmmoRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, _topRow.TopLeft.X,
|
||||||
|
new List<Color>(),
|
||||||
LinearGradientMode.Horizontal) {Height = Scale, ContainedBrush = false};
|
LinearGradientMode.Horizontal) {Height = Scale, ContainedBrush = false};
|
||||||
TeamRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, _topRow.TopLeft.X + 1, new List<Color>(),
|
TeamRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, _topRow.TopLeft.X + 1,
|
||||||
LinearGradientMode.Horizontal) {Height = MainModel.ActiveKeyboard.Height*Scale - Scale};
|
new List<Color>(),
|
||||||
EventRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, _topRow.TopLeft.X + 1, new List<Color>(),
|
LinearGradientMode.Horizontal)
|
||||||
LinearGradientMode.Horizontal) {Height = MainModel.ActiveKeyboard.Height*Scale - Scale};
|
{
|
||||||
MainModel.GameStateWebServer.GameDataReceived += HandleGameData;
|
Height = MainManager.KeyboardManager.ActiveKeyboard.Height*Scale - Scale
|
||||||
|
};
|
||||||
|
EventRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, _topRow.TopLeft.X + 1,
|
||||||
|
new List<Color>(),
|
||||||
|
LinearGradientMode.Horizontal)
|
||||||
|
{
|
||||||
|
Height = MainManager.KeyboardManager.ActiveKeyboard.Height*Scale - Scale
|
||||||
|
};
|
||||||
|
MainManager.GameStateWebServer.GameDataReceived += HandleGameData;
|
||||||
|
|
||||||
|
Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
@ -152,7 +166,7 @@ namespace Artemis.Modules.Games.CounterStrike
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var ammoPercentage = (int) Math.Ceiling(100.00/maxAmmo)*ammo;
|
var ammoPercentage = (int) Math.Ceiling(100.00/maxAmmo)*ammo;
|
||||||
AmmoRect.Width = (int) Math.Floor(_topRow.BottomRight.Y / 100.00*ammoPercentage)*Scale;
|
AmmoRect.Width = (int) Math.Floor(_topRow.BottomRight.Y/100.00*ammoPercentage)*Scale;
|
||||||
AmmoRect.Colors = new List<Color>
|
AmmoRect.Colors = new List<Color>
|
||||||
{
|
{
|
||||||
ColorHelpers.ToDrawingColor(Settings.AmmoMainColor),
|
ColorHelpers.ToDrawingColor(Settings.AmmoMainColor),
|
||||||
@ -168,7 +182,7 @@ namespace Artemis.Modules.Games.CounterStrike
|
|||||||
|
|
||||||
public override Bitmap GenerateBitmap()
|
public override Bitmap GenerateBitmap()
|
||||||
{
|
{
|
||||||
var bitmap = MainModel.ActiveKeyboard.KeyboardBitmap(Scale);
|
var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(Scale);
|
||||||
|
|
||||||
using (var g = Graphics.FromImage(bitmap))
|
using (var g = Graphics.FromImage(bitmap))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,14 +3,13 @@ using Artemis.Models;
|
|||||||
|
|
||||||
namespace Artemis.Modules.Games.CounterStrike
|
namespace Artemis.Modules.Games.CounterStrike
|
||||||
{
|
{
|
||||||
public class CounterStrikeSettings : EffectSettings
|
public class CounterStrikeSettings : GameSettings
|
||||||
{
|
{
|
||||||
public CounterStrikeSettings()
|
public CounterStrikeSettings()
|
||||||
{
|
{
|
||||||
Load();
|
Load();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
public string GameDirectory { get; set; }
|
public string GameDirectory { get; set; }
|
||||||
|
|
||||||
public bool AmmoEnabled { get; set; }
|
public bool AmmoEnabled { get; set; }
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||||
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
||||||
IsChecked="{Binding Path=CounterStrikeSettings.Enabled, Mode=TwoWay}"
|
IsChecked="{Binding Path=GameSettings.Enabled, Mode=TwoWay}"
|
||||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||||
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@ -50,7 +50,7 @@
|
|||||||
Width="130" HorizontalAlignment="Left" />
|
Width="130" HorizontalAlignment="Left" />
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||||
Text="{Binding Path=CounterStrikeSettings.GameDirectory, Mode=TwoWay}"
|
Text="{Binding Path=GameSettings.GameDirectory, Mode=TwoWay}"
|
||||||
cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
||||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||||
HorizontalAlignment="Right" Width="25"
|
HorizontalAlignment="Right" Width="25"
|
||||||
@ -63,7 +63,7 @@
|
|||||||
Height="16" Margin="0,10,0,9">
|
Height="16" Margin="0,10,0,9">
|
||||||
Display ammo on F-keys
|
Display ammo on F-keys
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.AmmoEnabled, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.AmmoEnabled, Mode=TwoWay}"
|
||||||
Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
@ -73,7 +73,7 @@
|
|||||||
Main ammo color
|
Main ammo color
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<xctk:ColorPicker x:Name="MainColor"
|
<xctk:ColorPicker x:Name="MainColor"
|
||||||
SelectedColor="{Binding Path=CounterStrikeSettings.AmmoMainColor, Mode=TwoWay}"
|
SelectedColor="{Binding Path=GameSettings.AmmoMainColor, Mode=TwoWay}"
|
||||||
Grid.Row="3" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
Grid.Row="3" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
@ -83,7 +83,7 @@
|
|||||||
Secondary ammo color
|
Secondary ammo color
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<xctk:ColorPicker x:Name="SecondaryColor"
|
<xctk:ColorPicker x:Name="SecondaryColor"
|
||||||
SelectedColor="{Binding Path=CounterStrikeSettings.AmmoSecondaryColor, Mode=TwoWay}"
|
SelectedColor="{Binding Path=GameSettings.AmmoSecondaryColor, Mode=TwoWay}"
|
||||||
Grid.Row="4" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
Grid.Row="4" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
|
|
||||||
@ -92,7 +92,7 @@
|
|||||||
Height="16" Margin="0,9,0,10">
|
Height="16" Margin="0,9,0,10">
|
||||||
Display smoked effect
|
Display smoked effect
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.SmokeEnabled, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.SmokeEnabled, Mode=TwoWay}"
|
||||||
Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
@ -101,7 +101,7 @@
|
|||||||
Height="16" Margin="0,10,0,9">
|
Height="16" Margin="0,10,0,9">
|
||||||
Display flashed effect
|
Display flashed effect
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.FlashEnabled, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.FlashEnabled, Mode=TwoWay}"
|
||||||
Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
@ -110,7 +110,7 @@
|
|||||||
Height="16" Margin="0,9,0,10">
|
Height="16" Margin="0,9,0,10">
|
||||||
Color keyboard according to team
|
Color keyboard according to team
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.TeamColorEnabled, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.TeamColorEnabled, Mode=TwoWay}"
|
||||||
Grid.Row="7" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="7" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
@ -119,7 +119,7 @@
|
|||||||
Height="16" Margin="0,10,0,9">
|
Height="16" Margin="0,10,0,9">
|
||||||
Color keyboard red on low HP
|
Color keyboard red on low HP
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=CounterStrikeSettings.LowHpEnabled, Mode=TwoWay}"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.LowHpEnabled, Mode=TwoWay}"
|
||||||
Grid.Row="8" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
Grid.Row="8" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Margin="0,0,-5,0" Width="114" />
|
Margin="0,0,-5,0" Width="114" />
|
||||||
|
|
||||||
|
|||||||
@ -1,93 +1,64 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Artemis.Properties;
|
using Artemis.Properties;
|
||||||
using Screen = Caliburn.Micro.Screen;
|
using Artemis.ViewModels.Abstract;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.CounterStrike
|
namespace Artemis.Modules.Games.CounterStrike
|
||||||
{
|
{
|
||||||
public class CounterStrikeViewModel : Screen
|
public class CounterStrikeViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
private CounterStrikeSettings _counterStrikeSettings;
|
public CounterStrikeViewModel(MainManager mainManager)
|
||||||
|
|
||||||
public CounterStrikeViewModel(MainModel mainModel)
|
|
||||||
{
|
{
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
|
|
||||||
// Settings are loaded from file by class
|
// Settings are loaded from file by class
|
||||||
CounterStrikeSettings = new CounterStrikeSettings();
|
GameSettings = new CounterStrikeSettings();
|
||||||
|
|
||||||
// Create effect model and add it to MainModel
|
// Create effect model and add it to MainManager
|
||||||
CounterStrikeModel = new CounterStrikeModel(mainModel, CounterStrikeSettings);
|
GameModel = new CounterStrikeModel(mainManager, (CounterStrikeSettings) GameSettings);
|
||||||
MainModel.EffectModels.Add(CounterStrikeModel);
|
MainManager.EffectManager.EffectModels.Add(GameModel);
|
||||||
PlaceConfigFile();
|
PlaceConfigFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CounterStrikeSettings CounterStrikeSettings
|
|
||||||
{
|
|
||||||
get { return _counterStrikeSettings; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (Equals(value, _counterStrikeSettings)) return;
|
|
||||||
_counterStrikeSettings = value;
|
|
||||||
NotifyOfPropertyChange(() => CounterStrikeSettings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public CounterStrikeModel CounterStrikeModel { get; set; }
|
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
|
||||||
|
|
||||||
public static string Name => "CS:GO";
|
public static string Name => "CS:GO";
|
||||||
public string Content => "Counter-Strike: GO Content";
|
public string Content => "Counter-Strike: GO Content";
|
||||||
|
|
||||||
public void SaveSettings()
|
|
||||||
{
|
|
||||||
CounterStrikeSettings?.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ResetSettings()
|
|
||||||
{
|
|
||||||
// TODO: Confirmation dialog (Generic MVVM approach)
|
|
||||||
CounterStrikeSettings.ToDefault();
|
|
||||||
NotifyOfPropertyChange(() => CounterStrikeSettings);
|
|
||||||
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ToggleEffect()
|
|
||||||
{
|
|
||||||
CounterStrikeModel.Enabled = _counterStrikeSettings.Enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void BrowseDirectory()
|
public void BrowseDirectory()
|
||||||
{
|
{
|
||||||
var dialog = new FolderBrowserDialog {SelectedPath = CounterStrikeSettings.GameDirectory};
|
var dialog = new FolderBrowserDialog {SelectedPath = ((CounterStrikeSettings) GameSettings).GameDirectory};
|
||||||
var result = dialog.ShowDialog();
|
var result = dialog.ShowDialog();
|
||||||
if (result != DialogResult.OK)
|
if (result != DialogResult.OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CounterStrikeSettings.GameDirectory = dialog.SelectedPath;
|
((CounterStrikeSettings) GameSettings).GameDirectory = dialog.SelectedPath;
|
||||||
NotifyOfPropertyChange(() => CounterStrikeSettings);
|
NotifyOfPropertyChange(() => GameSettings);
|
||||||
|
|
||||||
|
GameSettings.Save();
|
||||||
PlaceConfigFile();
|
PlaceConfigFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlaceConfigFile()
|
public void PlaceConfigFile()
|
||||||
{
|
{
|
||||||
if (CounterStrikeSettings.GameDirectory == string.Empty)
|
if (((CounterStrikeSettings) GameSettings).GameDirectory == string.Empty)
|
||||||
return;
|
return;
|
||||||
if (Directory.Exists(CounterStrikeSettings.GameDirectory + "/csgo/cfg"))
|
if (Directory.Exists(((CounterStrikeSettings) GameSettings).GameDirectory + "/csgo/cfg"))
|
||||||
{
|
{
|
||||||
var cfgFile = Resources.gamestateConfiguration.Replace("{{port}}",
|
var cfgFile = Resources.gamestateConfiguration.Replace("{{port}}",
|
||||||
MainModel.GameStateWebServer.Port.ToString());
|
MainManager.GameStateWebServer.Port.ToString());
|
||||||
File.WriteAllText(CounterStrikeSettings.GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg",
|
File.WriteAllText(
|
||||||
|
((CounterStrikeSettings) GameSettings).GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg",
|
||||||
cfgFile);
|
cfgFile);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageBox.Show("Please select a valid CS:GO directory");
|
MainManager.DialogService.ShowErrorMessageBox("Please select a valid CS:GO directory\n\n" +
|
||||||
CounterStrikeSettings.GameDirectory = string.Empty;
|
@"By default CS:GO is in \SteamApps\common\Counter-Strike Global Offensive");
|
||||||
NotifyOfPropertyChange(() => CounterStrikeSettings);
|
((CounterStrikeSettings) GameSettings).GameDirectory = string.Empty;
|
||||||
|
NotifyOfPropertyChange(() => GameSettings);
|
||||||
|
|
||||||
|
GameSettings.Save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,17 +1,15 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Caliburn.Micro;
|
using Artemis.ViewModels.Abstract;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Dota2
|
namespace Artemis.Modules.Games.Dota2
|
||||||
{
|
{
|
||||||
public class Dota2ViewModel : Screen
|
public class Dota2ViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
public Dota2ViewModel(MainModel mainModel)
|
public Dota2ViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
|
||||||
|
|
||||||
public static string Name => "Dota 2 (NYI)";
|
public static string Name => "Dota 2 (NYI)";
|
||||||
public string Content => "Dota 2 Content";
|
public string Content => "Dota 2 Content";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,62 +1,74 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <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.Modules.Games.RocketLeague {
|
namespace Artemis.Modules.Games.RocketLeague {
|
||||||
|
|
||||||
|
|
||||||
[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 RocketLeague : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class RocketLeague : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static RocketLeague defaultInstance = ((RocketLeague)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new RocketLeague())));
|
private static RocketLeague defaultInstance = ((RocketLeague)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new RocketLeague())));
|
||||||
|
|
||||||
public static RocketLeague Default {
|
public static RocketLeague 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("True")]
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
public bool Enabled {
|
public bool Enabled {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["Enabled"]));
|
return ((bool)(this["Enabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["Enabled"] = value;
|
this["Enabled"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF5000")]
|
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF5000")]
|
||||||
public global::System.Windows.Media.Color MainColor {
|
public global::System.Windows.Media.Color MainColor {
|
||||||
get {
|
get {
|
||||||
return ((global::System.Windows.Media.Color)(this["MainColor"]));
|
return ((global::System.Windows.Media.Color)(this["MainColor"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["MainColor"] = value;
|
this["MainColor"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF0000")]
|
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF0000")]
|
||||||
public global::System.Windows.Media.Color SecondaryColor {
|
public global::System.Windows.Media.Color SecondaryColor {
|
||||||
get {
|
get {
|
||||||
return ((global::System.Windows.Media.Color)(this["SecondaryColor"]));
|
return ((global::System.Windows.Media.Color)(this["SecondaryColor"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["SecondaryColor"] = value;
|
this["SecondaryColor"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||||
|
public bool ContextualColor {
|
||||||
|
get {
|
||||||
|
return ((bool)(this["ContextualColor"]));
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
this["ContextualColor"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,17 +1,20 @@
|
|||||||
<?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)"
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||||
GeneratedClassNamespace="Artemis.Modules.Games.RocketLeague" GeneratedClassName="RocketLeague">
|
GeneratedClassNamespace="Artemis.Modules.Games.RocketLeague" GeneratedClassName="RocketLeague">
|
||||||
<Profiles />
|
<Profiles />
|
||||||
<Settings>
|
<Settings>
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="MainColor" Type="System.Windows.Media.Color" Scope="User">
|
<Setting Name="MainColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
<Value Profile="(Default)">#FFFF5000</Value>
|
<Value Profile="(Default)">#FFFF5000</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="SecondaryColor" Type="System.Windows.Media.Color" Scope="User">
|
<Setting Name="SecondaryColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
<Value Profile="(Default)">#FFFF0000</Value>
|
<Value Profile="(Default)">#FFFF0000</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
</Settings>
|
<Setting Name="ContextualColor" Type="System.Boolean" Scope="User">
|
||||||
|
<Value Profile="(Default)">False</Value>
|
||||||
|
</Setting>
|
||||||
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -1,149 +1,153 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Artemis.Settings;
|
using Artemis.Models;
|
||||||
using Artemis.Utilities;
|
using Artemis.Settings;
|
||||||
using Artemis.Utilities.Keyboard;
|
using Artemis.Utilities;
|
||||||
using Artemis.Utilities.Memory;
|
using Artemis.Utilities.Keyboard;
|
||||||
using Newtonsoft.Json;
|
using Artemis.Utilities.Memory;
|
||||||
|
using Newtonsoft.Json;
|
||||||
namespace Artemis.Modules.Games.RocketLeague
|
|
||||||
{
|
namespace Artemis.Modules.Games.RocketLeague
|
||||||
public class RocketLeagueModel : GameModel
|
{
|
||||||
{
|
public class RocketLeagueModel : GameModel
|
||||||
private int _boostAmount;
|
{
|
||||||
private bool _boostGrowing;
|
private int _boostAmount;
|
||||||
private KeyboardRectangle _boostRect;
|
private bool _boostGrowing;
|
||||||
private Memory _memory;
|
private KeyboardRectangle _boostRect;
|
||||||
private GamePointersCollectionModel _pointer;
|
private bool _contextualColor;
|
||||||
private int _previousBoost;
|
private Memory _memory;
|
||||||
|
private GamePointersCollection _pointer;
|
||||||
public RocketLeagueModel(MainModel mainModel, RocketLeagueSettings settings) : base(mainModel)
|
private int _previousBoost;
|
||||||
{
|
|
||||||
Settings = settings;
|
public RocketLeagueModel(MainManager mainManager, RocketLeagueSettings settings) : base(mainManager)
|
||||||
Name = "RocketLeague";
|
{
|
||||||
ProcessName = "RocketLeague";
|
Settings = settings;
|
||||||
Scale = 4;
|
Name = "RocketLeague";
|
||||||
Enabled = Settings.Enabled;
|
ProcessName = "RocketLeague";
|
||||||
}
|
Scale = 4;
|
||||||
|
Enabled = Settings.Enabled;
|
||||||
public RocketLeagueSettings Settings { get; set; }
|
Initialized = false;
|
||||||
|
}
|
||||||
public int Scale { get; set; }
|
|
||||||
|
public RocketLeagueSettings Settings { get; set; }
|
||||||
public override void Dispose()
|
|
||||||
{
|
public int Scale { get; set; }
|
||||||
_memory = null;
|
|
||||||
}
|
public override void Dispose()
|
||||||
|
{
|
||||||
public override void Enable()
|
Initialized = false;
|
||||||
{
|
_memory = null;
|
||||||
_boostRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, 0, new List<Color>
|
}
|
||||||
{
|
|
||||||
ColorHelpers.ToDrawingColor(Settings.MainColor),
|
public override void Enable()
|
||||||
ColorHelpers.ToDrawingColor(Settings.SecondaryColor)
|
{
|
||||||
}, LinearGradientMode.Horizontal);
|
Initialized = false;
|
||||||
|
|
||||||
MemoryHelpers.GetPointers();
|
_contextualColor = Settings.ContextualColor;
|
||||||
_pointer = JsonConvert.DeserializeObject<GamePointersCollectionModel>(Offsets.Default.RocketLeague);
|
|
||||||
|
_boostRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List<Color>
|
||||||
//var test =
|
{
|
||||||
// JsonConvert.SerializeObject(new List<GamePointersCollectionModel>
|
ColorHelpers.ToDrawingColor(Settings.MainColor),
|
||||||
// {
|
ColorHelpers.ToDrawingColor(Settings.SecondaryColor)
|
||||||
// new GamePointersCollectionModel
|
}, LinearGradientMode.Horizontal);
|
||||||
// {
|
|
||||||
// Game = "RocketLeague",
|
Updater.GetPointers();
|
||||||
// GameVersion = "1.12",
|
_pointer = JsonConvert.DeserializeObject<GamePointersCollection>(Offsets.Default.RocketLeague);
|
||||||
// GameAddresses = new List<GamePointer> {new GamePointer
|
|
||||||
// {
|
var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName);
|
||||||
// Description = "Boost",
|
_memory = new Memory(tempProcess);
|
||||||
// BasePointer = new IntPtr(0x01581AF4),
|
|
||||||
// Offsets = new []{0xB4, 0x104, 0x320, 0x708, 0x21C}
|
Initialized = true;
|
||||||
// }}
|
}
|
||||||
// }
|
|
||||||
// });
|
public override void Update()
|
||||||
var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName);
|
{
|
||||||
_memory = new Memory(tempProcess);
|
if (_boostGrowing)
|
||||||
}
|
return;
|
||||||
|
if (_memory == null)
|
||||||
public override void Update()
|
return;
|
||||||
{
|
|
||||||
if (_boostGrowing)
|
var offsets = _pointer.GameAddresses.First(ga => ga.Description == "Boost").ToString();
|
||||||
return;
|
var boostAddress = _memory.GetAddress("\"RocketLeague.exe\"" + offsets);
|
||||||
if (_memory == null)
|
var boostFloat = _memory.ReadFloat(boostAddress)*100/3;
|
||||||
return;
|
|
||||||
|
_previousBoost = _boostAmount;
|
||||||
var offsets = _pointer.GameAddresses.First(ga => ga.Description == "Boost").ToString();
|
_boostAmount = (int) Math.Ceiling(boostFloat);
|
||||||
var boostAddress = _memory.GetAddress("\"RocketLeague.exe\"" + offsets);
|
|
||||||
var boostFloat = _memory.ReadFloat(boostAddress)*100/3;
|
// Take care of any reading errors resulting in an OutOfMemory on draw
|
||||||
|
if (_boostAmount < 0)
|
||||||
_previousBoost = _boostAmount;
|
_boostAmount = 0;
|
||||||
_boostAmount = (int) Math.Ceiling(boostFloat);
|
if (_boostAmount > 100)
|
||||||
|
_boostAmount = 100;
|
||||||
// Take care of any reading errors resulting in an OutOfMemory on draw
|
|
||||||
if (_boostAmount < 0)
|
_boostRect.Width =
|
||||||
_boostAmount = 0;
|
(int) Math.Ceiling(MainManager.KeyboardManager.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
|
||||||
if (_boostAmount > 100)
|
|
||||||
_boostAmount = 100;
|
if (_contextualColor)
|
||||||
|
{
|
||||||
_boostRect.Width = (int) Math.Ceiling(MainModel.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
|
if (_boostAmount < 33)
|
||||||
_boostRect.Colors = new List<Color>
|
_boostRect.Colors = new List<Color> {Color.Red};
|
||||||
{
|
else if (_boostAmount >= 33 && _boostAmount < 66)
|
||||||
ColorHelpers.ToDrawingColor(Settings.MainColor),
|
_boostRect.Colors = new List<Color> {Color.Yellow};
|
||||||
ColorHelpers.ToDrawingColor(Settings.SecondaryColor)
|
else if (_boostAmount >= 66)
|
||||||
};
|
_boostRect.Colors = new List<Color> {Color.Lime};
|
||||||
|
}
|
||||||
Task.Run(() => GrowIfHigher());
|
|
||||||
}
|
Task.Run(() => GrowIfHigher());
|
||||||
|
}
|
||||||
private void GrowIfHigher()
|
|
||||||
{
|
private void GrowIfHigher()
|
||||||
if (_boostAmount <= _previousBoost || _boostGrowing)
|
{
|
||||||
return;
|
if (_boostAmount <= _previousBoost || _boostGrowing)
|
||||||
|
return;
|
||||||
_boostGrowing = true;
|
|
||||||
const int amountOfSteps = 6;
|
_boostGrowing = true;
|
||||||
|
const int amountOfSteps = 6;
|
||||||
var difference = _boostAmount - _previousBoost;
|
|
||||||
var differenceStep = difference/amountOfSteps;
|
var difference = _boostAmount - _previousBoost;
|
||||||
var differenceStepRest = difference%amountOfSteps;
|
var differenceStep = difference/amountOfSteps;
|
||||||
_boostAmount = _previousBoost;
|
var differenceStepRest = difference%amountOfSteps;
|
||||||
_boostRect.Width = (int) Math.Ceiling(MainModel.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
|
_boostAmount = _previousBoost;
|
||||||
|
_boostRect.Width =
|
||||||
for (var i = 0; i < amountOfSteps; i++)
|
(int) Math.Ceiling(MainManager.KeyboardManager.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
|
||||||
{
|
|
||||||
if (differenceStepRest > 0)
|
for (var i = 0; i < amountOfSteps; i++)
|
||||||
{
|
{
|
||||||
differenceStepRest -= 1;
|
if (differenceStepRest > 0)
|
||||||
_boostAmount += 1;
|
{
|
||||||
_boostRect.Width = (int) Math.Ceiling(MainModel.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
|
differenceStepRest -= 1;
|
||||||
}
|
_boostAmount += 1;
|
||||||
_boostAmount += differenceStep;
|
_boostRect.Width =
|
||||||
_boostRect.Width = (int) Math.Ceiling(MainModel.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
|
(int) Math.Ceiling(MainManager.KeyboardManager.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
|
||||||
|
}
|
||||||
Thread.Sleep(50);
|
_boostAmount += differenceStep;
|
||||||
}
|
_boostRect.Width =
|
||||||
|
(int) Math.Ceiling(MainManager.KeyboardManager.ActiveKeyboard.Width*Scale/100.00*_boostAmount);
|
||||||
_boostGrowing = false;
|
|
||||||
}
|
Thread.Sleep(50);
|
||||||
|
}
|
||||||
public override Bitmap GenerateBitmap()
|
|
||||||
{
|
_boostGrowing = false;
|
||||||
var bitmap = MainModel.ActiveKeyboard.KeyboardBitmap(Scale);
|
}
|
||||||
if (_boostRect == null)
|
|
||||||
return null;
|
public override Bitmap GenerateBitmap()
|
||||||
|
{
|
||||||
using (var g = Graphics.FromImage(bitmap))
|
var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(Scale);
|
||||||
{
|
if (_boostRect == null)
|
||||||
g.Clear(Color.Transparent);
|
return null;
|
||||||
_boostRect.Draw(g);
|
|
||||||
}
|
using (var g = Graphics.FromImage(bitmap))
|
||||||
return bitmap;
|
{
|
||||||
}
|
g.Clear(Color.Transparent);
|
||||||
}
|
_boostRect.Draw(g);
|
||||||
|
}
|
||||||
|
return bitmap;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -3,22 +3,23 @@ using Artemis.Models;
|
|||||||
|
|
||||||
namespace Artemis.Modules.Games.RocketLeague
|
namespace Artemis.Modules.Games.RocketLeague
|
||||||
{
|
{
|
||||||
public class RocketLeagueSettings : EffectSettings
|
public class RocketLeagueSettings : GameSettings
|
||||||
{
|
{
|
||||||
public RocketLeagueSettings()
|
public RocketLeagueSettings()
|
||||||
{
|
{
|
||||||
Load();
|
Load();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
public Color MainColor { get; set; }
|
public Color MainColor { get; set; }
|
||||||
public Color SecondaryColor { get; set; }
|
public Color SecondaryColor { get; set; }
|
||||||
|
public bool ContextualColor { get; set; }
|
||||||
|
|
||||||
public sealed override void Load()
|
public sealed override void Load()
|
||||||
{
|
{
|
||||||
Enabled = RocketLeague.Default.Enabled;
|
Enabled = RocketLeague.Default.Enabled;
|
||||||
MainColor = RocketLeague.Default.MainColor;
|
MainColor = RocketLeague.Default.MainColor;
|
||||||
SecondaryColor = RocketLeague.Default.SecondaryColor;
|
SecondaryColor = RocketLeague.Default.SecondaryColor;
|
||||||
|
ContextualColor = RocketLeague.Default.ContextualColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed override void Save()
|
public sealed override void Save()
|
||||||
@ -26,6 +27,7 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
RocketLeague.Default.Enabled = Enabled;
|
RocketLeague.Default.Enabled = Enabled;
|
||||||
RocketLeague.Default.MainColor = MainColor;
|
RocketLeague.Default.MainColor = MainColor;
|
||||||
RocketLeague.Default.SecondaryColor = SecondaryColor;
|
RocketLeague.Default.SecondaryColor = SecondaryColor;
|
||||||
|
RocketLeague.Default.ContextualColor = ContextualColor;
|
||||||
|
|
||||||
RocketLeague.Default.Save();
|
RocketLeague.Default.Save();
|
||||||
}
|
}
|
||||||
@ -35,6 +37,7 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
Enabled = true;
|
Enabled = true;
|
||||||
MainColor = Color.FromArgb(255, 255, 80, 0);
|
MainColor = Color.FromArgb(255, 255, 80, 0);
|
||||||
SecondaryColor = Color.FromArgb(255, 255, 0, 0);
|
SecondaryColor = Color.FromArgb(255, 255, 0, 0);
|
||||||
|
ContextualColor = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,83 +1,94 @@
|
|||||||
<UserControl x:Class="Artemis.Modules.Games.RocketLeague.RocketLeagueView"
|
<UserControl x:Class="Artemis.Modules.Games.RocketLeague.RocketLeagueView"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:cal="http://www.caliburnproject.org"
|
xmlns:cal="http://www.caliburnproject.org"
|
||||||
mc:Ignorable="d"
|
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
mc:Ignorable="d"
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||||
<Grid Margin="15, 5, 15, 5">
|
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid Margin="15, 5, 15, 5">
|
||||||
<ColumnDefinition Width="Auto" />
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition />
|
||||||
<Grid.RowDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
<RowDefinition Height="*" />
|
||||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
|
||||||
<Label FontSize="20" HorizontalAlignment="Left">
|
</Grid.RowDefinitions>
|
||||||
<Label.Content>
|
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||||
<AccessText TextWrapping="Wrap"
|
<Label FontSize="20" HorizontalAlignment="Left">
|
||||||
Text="Shows your boost amount on the keyboard." />
|
<Label.Content>
|
||||||
</Label.Content>
|
<AccessText TextWrapping="Wrap"
|
||||||
</Label>
|
Text="Shows your boost amount on the keyboard." />
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
</Label.Content>
|
||||||
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
</Label>
|
||||||
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
IsChecked="{Binding Path=RocketLeagueSettings.Enabled, Mode=TwoWay}"
|
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
||||||
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
IsChecked="{Binding Path=GameSettings.Enabled, Mode=TwoWay}"
|
||||||
</StackPanel>
|
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||||
</StackPanel>
|
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
||||||
|
</StackPanel>
|
||||||
<!-- Main color -->
|
</StackPanel>
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
|
||||||
Height="16" Margin="0,8">
|
<!-- Main color -->
|
||||||
Main boost display color
|
<TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||||
</TextBlock>
|
Height="16" Margin="0,8">
|
||||||
<xctk:ColorPicker x:Name="MainColor"
|
Main boost display color
|
||||||
SelectedColor="{Binding Path=RocketLeagueSettings.MainColor, Mode=TwoWay}"
|
</TextBlock>
|
||||||
Grid.Row="1" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
<xctk:ColorPicker x:Name="MainColor"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
SelectedColor="{Binding Path=GameSettings.MainColor, Mode=TwoWay}"
|
||||||
|
Grid.Row="1" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
<!-- Secondary color -->
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
|
||||||
Height="16" Margin="0,8">
|
<!-- Secondary color -->
|
||||||
Secondary boost display color
|
<TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||||
</TextBlock>
|
Height="16" Margin="0,8">
|
||||||
<xctk:ColorPicker x:Name="SecondaryColor"
|
Secondary boost display color
|
||||||
SelectedColor="{Binding Path=RocketLeagueSettings.SecondaryColor, Mode=TwoWay}"
|
</TextBlock>
|
||||||
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
<xctk:ColorPicker x:Name="SecondaryColor"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
SelectedColor="{Binding Path=GameSettings.SecondaryColor, Mode=TwoWay}"
|
||||||
|
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
<TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
||||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
|
||||||
Foreground="#535353" MaxWidth="510" TextAlignment="Justify">
|
<!-- Secondary color -->
|
||||||
Tip: To find a color combination you like, start an exhibition match, pickup 100 boost and play around with the colors.
|
<TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"
|
||||||
They'll appear on your keyboard immediately! Once you're satisfied don't forget to click save changes.
|
Height="16" Margin="0,8">
|
||||||
</TextBlock>
|
Color bar according to boost amount
|
||||||
<TextBlock Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
</TextBlock>
|
||||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ContextualColor, Mode=TwoWay}"
|
||||||
Foreground="#535353" MaxWidth="510" TextAlignment="Justify">
|
Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No"
|
||||||
Note: Requires patch x.x. When a new patch is released Artemis downloads new pointers for the latest version (unless disabled in settings).
|
Margin="0,0,-5,0" Width="114" />
|
||||||
</TextBlock>
|
|
||||||
|
<!-- Info text -->
|
||||||
<!-- Buttons -->
|
<TextBlock Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
||||||
<StackPanel Grid.Column="0" Grid.Row="9" Orientation="Horizontal" VerticalAlignment="Bottom">
|
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
MaxWidth="510" TextAlignment="Justify">
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
Tip: To find a color combination you like, start an exhibition match, pickup 100 boost and play around with the colors.
|
||||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
They'll appear on your keyboard immediately! Once you're satisfied don't forget to click save changes.
|
||||||
Margin="10,0,0,0"
|
</TextBlock>
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
<TextBlock x:Name="VersionText" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center"
|
||||||
</StackPanel>
|
Margin="0,8"
|
||||||
</Grid>
|
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||||
</ScrollViewer>
|
Foreground="{DynamicResource HighlightBrush}" MaxWidth="510" TextAlignment="Justify" />
|
||||||
|
|
||||||
|
<!-- Buttons -->
|
||||||
|
<StackPanel Grid.Column="0" Grid.Row="9" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||||
|
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||||
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
|
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -1,60 +1,60 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Caliburn.Micro;
|
using Artemis.Settings;
|
||||||
|
using Artemis.Utilities;
|
||||||
|
using Artemis.Utilities.Memory;
|
||||||
|
using Artemis.ViewModels.Abstract;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.RocketLeague
|
namespace Artemis.Modules.Games.RocketLeague
|
||||||
{
|
{
|
||||||
public class RocketLeagueViewModel : Screen
|
public class RocketLeagueViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
private RocketLeagueSettings _rocketLeagueSettings;
|
private string _versionText;
|
||||||
|
|
||||||
public RocketLeagueViewModel(MainModel mainModel)
|
public RocketLeagueViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
|
|
||||||
// Settings are loaded from file by class
|
// Settings are loaded from file by class
|
||||||
RocketLeagueSettings = new RocketLeagueSettings();
|
GameSettings = new RocketLeagueSettings();
|
||||||
|
|
||||||
// Create effect model and add it to MainModel
|
// Create effect model and add it to MainManager
|
||||||
RocketLeagueModel = new RocketLeagueModel(mainModel, RocketLeagueSettings);
|
GameModel = new RocketLeagueModel(mainManager, (RocketLeagueSettings) GameSettings);
|
||||||
MainModel.EffectModels.Add(RocketLeagueModel);
|
MainManager.EffectManager.EffectModels.Add(GameModel);
|
||||||
|
|
||||||
|
SetVersionText();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string Name => "Rocket League";
|
public static string Name => "Rocket League";
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
public string VersionText
|
||||||
public RocketLeagueModel RocketLeagueModel { get; set; }
|
|
||||||
|
|
||||||
public RocketLeagueSettings RocketLeagueSettings
|
|
||||||
{
|
{
|
||||||
get { return _rocketLeagueSettings; }
|
get { return _versionText; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (Equals(value, _rocketLeagueSettings)) return;
|
if (value == _versionText) return;
|
||||||
_rocketLeagueSettings = value;
|
_versionText = value;
|
||||||
NotifyOfPropertyChange(() => RocketLeagueSettings);
|
NotifyOfPropertyChange(() => VersionText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SaveSettings()
|
public RocketLeagueModel RocketLeagueModel { get; set; }
|
||||||
|
|
||||||
|
private void SetVersionText()
|
||||||
{
|
{
|
||||||
if (RocketLeagueModel == null)
|
if (!General.Default.EnablePointersUpdate)
|
||||||
|
{
|
||||||
|
VersionText = "Note: You disabled pointer updates, this could result in the " +
|
||||||
|
"Rocket League effect not working after a game update.";
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RocketLeagueSettings.Save();
|
Updater.GetPointers();
|
||||||
}
|
var version = JsonConvert
|
||||||
|
.DeserializeObject<GamePointersCollection>(Offsets.Default.RocketLeague)
|
||||||
public void ResetSettings()
|
.GameVersion;
|
||||||
{
|
VersionText = $"Note: Requires patch {version}. When a new patch is released Artemis downloads " +
|
||||||
// TODO: Confirmation dialog (Generic MVVM approach)
|
"new pointers for the latest version (unless disabled in settings).";
|
||||||
RocketLeagueSettings.ToDefault();
|
|
||||||
NotifyOfPropertyChange(() => RocketLeagueSettings);
|
|
||||||
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ToggleEffect()
|
|
||||||
{
|
|
||||||
RocketLeagueModel.Enabled = _rocketLeagueSettings.Enabled;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,38 +1,38 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <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.Modules.Games.Witcher3 {
|
namespace Artemis.Modules.Games.Witcher3 {
|
||||||
|
|
||||||
|
|
||||||
[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 Witcher3 : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class Witcher3 : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static Witcher3 defaultInstance = ((Witcher3)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Witcher3())));
|
private static Witcher3 defaultInstance = ((Witcher3)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Witcher3())));
|
||||||
|
|
||||||
public static Witcher3 Default {
|
public static Witcher3 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("True")]
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
public bool Enabled {
|
public bool Enabled {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["Enabled"]));
|
return ((bool)(this["Enabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["Enabled"] = value;
|
this["Enabled"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<?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)"
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||||
GeneratedClassNamespace="Artemis.Modules.Games.Witcher3" GeneratedClassName="Witcher3">
|
GeneratedClassNamespace="Artemis.Modules.Games.Witcher3" GeneratedClassName="Witcher3">
|
||||||
<Profiles />
|
<Profiles />
|
||||||
<Settings>
|
<Settings>
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -5,6 +5,7 @@ using System.Drawing;
|
|||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Utilities.Keyboard;
|
using Artemis.Utilities.Keyboard;
|
||||||
|
|
||||||
@ -17,13 +18,14 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
private KeyboardRectangle _signRect;
|
private KeyboardRectangle _signRect;
|
||||||
private string _witcherSettings;
|
private string _witcherSettings;
|
||||||
|
|
||||||
public Witcher3Model(MainModel mainModel, Witcher3Settings settings) : base(mainModel)
|
public Witcher3Model(MainManager mainManager, Witcher3Settings settings) : base(mainManager)
|
||||||
{
|
{
|
||||||
Settings = settings;
|
Settings = settings;
|
||||||
Name = "Witcher3";
|
Name = "Witcher3";
|
||||||
ProcessName = "witcher3";
|
ProcessName = "witcher3";
|
||||||
Scale = 4;
|
Scale = 4;
|
||||||
Enabled = Settings.Enabled;
|
Enabled = Settings.Enabled;
|
||||||
|
Initialized = false;
|
||||||
|
|
||||||
_updateSw = new Stopwatch();
|
_updateSw = new Stopwatch();
|
||||||
_signRegex = new Regex("ActiveSign=(.*)", RegexOptions.Compiled);
|
_signRegex = new Regex("ActiveSign=(.*)", RegexOptions.Compiled);
|
||||||
@ -35,6 +37,7 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
|
Initialized = false;
|
||||||
_witcherSettings = null;
|
_witcherSettings = null;
|
||||||
|
|
||||||
_updateSw.Reset();
|
_updateSw.Reset();
|
||||||
@ -42,7 +45,9 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
|
|
||||||
public override void Enable()
|
public override void Enable()
|
||||||
{
|
{
|
||||||
_signRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, 0, new List<Color>(),
|
Initialized = false;
|
||||||
|
|
||||||
|
_signRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List<Color>(),
|
||||||
LinearGradientMode.Horizontal)
|
LinearGradientMode.Horizontal)
|
||||||
{
|
{
|
||||||
Rotate = true,
|
Rotate = true,
|
||||||
@ -56,6 +61,8 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
_witcherSettings = witcherSettings;
|
_witcherSettings = witcherSettings;
|
||||||
|
|
||||||
_updateSw.Start();
|
_updateSw.Start();
|
||||||
|
|
||||||
|
Initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
@ -102,7 +109,7 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
|
|
||||||
public override Bitmap GenerateBitmap()
|
public override Bitmap GenerateBitmap()
|
||||||
{
|
{
|
||||||
var bitmap = MainModel.ActiveKeyboard.KeyboardBitmap(Scale);
|
var bitmap = MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(Scale);
|
||||||
using (var g = Graphics.FromImage(bitmap))
|
using (var g = Graphics.FromImage(bitmap))
|
||||||
{
|
{
|
||||||
g.Clear(Color.Transparent);
|
g.Clear(Color.Transparent);
|
||||||
|
|||||||
@ -2,15 +2,13 @@
|
|||||||
|
|
||||||
namespace Artemis.Modules.Games.Witcher3
|
namespace Artemis.Modules.Games.Witcher3
|
||||||
{
|
{
|
||||||
public class Witcher3Settings : EffectSettings
|
public class Witcher3Settings : GameSettings
|
||||||
{
|
{
|
||||||
public Witcher3Settings()
|
public Witcher3Settings()
|
||||||
{
|
{
|
||||||
Load();
|
Load();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
|
|
||||||
public sealed override void Load()
|
public sealed override void Load()
|
||||||
{
|
{
|
||||||
Enabled = Witcher3.Default.Enabled;
|
Enabled = Witcher3.Default.Enabled;
|
||||||
@ -29,21 +29,21 @@
|
|||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||||
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
||||||
IsChecked="{Binding Path=Witcher3Settings.Enabled, Mode=TwoWay}"
|
IsChecked="{Binding Path=GameSettings.Enabled, Mode=TwoWay}"
|
||||||
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||||
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
||||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||||
Foreground="#535353" MaxWidth="510" TextAlignment="Justify">
|
MaxWidth="510" TextAlignment="Justify">
|
||||||
Artemis requires the latest Witcher 3 version and mod to be installed in order to work. If you don't use any (conflicting) Witcher 3 mods, the mod can automatically be installed.
|
Artemis requires the latest Witcher 3 version and mod to be installed in order to work. If you don't use any (conflicting) Witcher 3 mods, the mod can automatically be installed.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
<TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
||||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||||
Foreground="#535353" MaxWidth="510" TextAlignment="Justify">
|
Foreground="{DynamicResource HighlightBrush}" MaxWidth="510" TextAlignment="Justify">
|
||||||
If you do use conflicting mods, we'll let you know what to do.
|
Note: If you do use conflicting mods, we'll let you know what to do.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<Button Grid.Row="3" Grid.Column="0" x:Name="AutoInstall" Content="Try automatic mod install" Width="160"
|
<Button Grid.Row="3" Grid.Column="0" x:Name="AutoInstall" Content="Try automatic mod install" Width="160"
|
||||||
Style="{DynamicResource SquareButtonStyle}" HorizontalAlignment="Left" Margin="0,20,0,0" />
|
Style="{DynamicResource SquareButtonStyle}" HorizontalAlignment="Left" Margin="0,20,0,0" />
|
||||||
|
|||||||
@ -3,67 +3,29 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Artemis.Properties;
|
using Artemis.Properties;
|
||||||
using Screen = Caliburn.Micro.Screen;
|
using Artemis.ViewModels.Abstract;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Witcher3
|
namespace Artemis.Modules.Games.Witcher3
|
||||||
{
|
{
|
||||||
public class Witcher3ViewModel : Screen
|
public class Witcher3ViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
private Witcher3Settings _witcher3Settings;
|
public Witcher3ViewModel(MainManager mainManager)
|
||||||
|
|
||||||
public Witcher3ViewModel(MainModel mainModel)
|
|
||||||
{
|
{
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
|
|
||||||
// Settings are loaded from file by class
|
// Settings are loaded from file by class
|
||||||
Witcher3Settings = new Witcher3Settings();
|
GameSettings = new Witcher3Settings();
|
||||||
|
|
||||||
// Create effect model and add it to MainModel
|
// Create effect model and add it to MainManager
|
||||||
Witcher3Model = new Witcher3Model(mainModel, Witcher3Settings);
|
GameModel = new Witcher3Model(mainManager, (Witcher3Settings) GameSettings);
|
||||||
MainModel.EffectModels.Add(Witcher3Model);
|
MainManager.EffectManager.EffectModels.Add(GameModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string Name => "The Witcher 3";
|
public static string Name => "The Witcher 3";
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
public async void AutoInstall()
|
||||||
public Witcher3Model Witcher3Model { get; set; }
|
|
||||||
|
|
||||||
public Witcher3Settings Witcher3Settings
|
|
||||||
{
|
|
||||||
get { return _witcher3Settings; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (Equals(value, _witcher3Settings)) return;
|
|
||||||
_witcher3Settings = value;
|
|
||||||
NotifyOfPropertyChange(() => Witcher3Settings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SaveSettings()
|
|
||||||
{
|
|
||||||
if (Witcher3Model == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Witcher3Settings.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ResetSettings()
|
|
||||||
{
|
|
||||||
// TODO: Confirmation dialog (Generic MVVM approach)
|
|
||||||
Witcher3Settings.ToDefault();
|
|
||||||
NotifyOfPropertyChange(() => Witcher3Settings);
|
|
||||||
|
|
||||||
SaveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ToggleEffect()
|
|
||||||
{
|
|
||||||
Witcher3Model.Enabled = _witcher3Settings.Enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AutoInstall()
|
|
||||||
{
|
{
|
||||||
// Request The Witcher 3 folder
|
// Request The Witcher 3 folder
|
||||||
var dialog = new FolderBrowserDialog
|
var dialog = new FolderBrowserDialog
|
||||||
@ -77,15 +39,16 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
// If the subfolder doesn't contain witcher3.exe, it's the wrong folder.
|
// If the subfolder doesn't contain witcher3.exe, it's the wrong folder.
|
||||||
if (!File.Exists(dialog.SelectedPath + @"\bin\x64\witcher3.exe"))
|
if (!File.Exists(dialog.SelectedPath + @"\bin\x64\witcher3.exe"))
|
||||||
{
|
{
|
||||||
var error = MessageBox.Show("That's not a valid Witcher 3 directory\n\n" +
|
var retry = await
|
||||||
"Default directories:\n" +
|
MainManager.DialogService.ShowQuestionMessageBox("Installation error",
|
||||||
"Steam: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Witcher 3\n" +
|
"That's not a valid Witcher 3 directory\n\n" +
|
||||||
"GOG: C:\\GOG Games\\The Witcher 3 Wild Hunt", "Installation error",
|
"Default directories:\n" +
|
||||||
MessageBoxButtons.RetryCancel);
|
"Steam: \\SteamApps\\common\\The Witcher 3\n" +
|
||||||
if (error == DialogResult.Retry)
|
"GOG: C:\\GOG Games\\The Witcher 3 Wild Hunt\n\n" +
|
||||||
|
"Retry?");
|
||||||
|
if (retry.Value)
|
||||||
AutoInstall();
|
AutoInstall();
|
||||||
else
|
return;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Look for any conflicting mods
|
// Look for any conflicting mods
|
||||||
@ -99,27 +62,33 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
// Don't trip over our own mod
|
// Don't trip over our own mod
|
||||||
if (!file.Contains("modArtemis"))
|
if (!file.Contains("modArtemis"))
|
||||||
{
|
{
|
||||||
MessageBox.Show("Oh no, you have a conflicting mod!\n\n" +
|
var viewHelp = await
|
||||||
"Conflicting file: " + file.Remove(0, dialog.SelectedPath.Length) +
|
MainManager.DialogService.ShowQuestionMessageBox("Conflicting mod found",
|
||||||
"\n\nOnce you press OK you will be taken to an instructions page.",
|
"Oh no, you have a conflicting mod!\n\n" +
|
||||||
"Conflicting mod found");
|
"Conflicting file: " + file.Remove(0, dialog.SelectedPath.Length) +
|
||||||
|
"\n\nWould you like to view instructions on how to manually install the mod?");
|
||||||
|
if (!viewHelp.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
// Put the mod in the documents folder instead
|
// Put the mod in the documents folder instead
|
||||||
// Create the directory structure
|
// Create the directory structure
|
||||||
var folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis";
|
var folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis";
|
||||||
if (
|
if (
|
||||||
!Directory.Exists(folder + @"\Witcher3\mods\modArtemis\content\scripts\game\player"))
|
!Directory.Exists(folder + @"\Witcher3\mods\modArtemis\content\scripts\game\player"))
|
||||||
Directory.CreateDirectory(folder + @"\Witcher3\mods\modArtemis\content\scripts\game\player");
|
Directory.CreateDirectory(folder +
|
||||||
|
@"\Witcher3\mods\modArtemis\content\scripts\game\player");
|
||||||
if (
|
if (
|
||||||
!Directory.Exists(folder + @"\Witcher3\bin\config\r4game\user_config_matrix\pc"))
|
!Directory.Exists(folder + @"\Witcher3\bin\config\r4game\user_config_matrix\pc"))
|
||||||
Directory.CreateDirectory(folder + @"\Witcher3\bin\config\r4game\user_config_matrix\pc");
|
Directory.CreateDirectory(folder + @"\Witcher3\bin\config\r4game\user_config_matrix\pc");
|
||||||
|
|
||||||
// Install the mod files
|
// Install the mod files
|
||||||
File.WriteAllText(folder + @"\Witcher3\bin\config\r4game\user_config_matrix\pc\artemis.xml",Resources.artemisXml);
|
File.WriteAllText(folder + @"\Witcher3\bin\config\r4game\user_config_matrix\pc\artemis.xml",
|
||||||
File.WriteAllText(folder + @"\Witcher3\mods\modArtemis\content\scripts\game\player\playerWitcher.ws",Resources.playerWitcherWs);
|
Resources.artemisXml);
|
||||||
|
File.WriteAllText(
|
||||||
|
folder + @"\Witcher3\mods\modArtemis\content\scripts\game\player\playerWitcher.ws",
|
||||||
|
Resources.playerWitcherWs);
|
||||||
|
|
||||||
Process.Start(new ProcessStartInfo("https://github.com/SpoinkyNL/Artemis/wiki/The-Witcher-3"));
|
Process.Start(new ProcessStartInfo("https://github.com/SpoinkyNL/Artemis/wiki/The-Witcher-3"));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,7 +106,7 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
File.WriteAllText(dialog.SelectedPath + @"\mods\modArtemis\content\scripts\game\player\playerWitcher.ws",
|
File.WriteAllText(dialog.SelectedPath + @"\mods\modArtemis\content\scripts\game\player\playerWitcher.ws",
|
||||||
Resources.playerWitcherWs);
|
Resources.playerWitcherWs);
|
||||||
|
|
||||||
MessageBox.Show("The mod was successfully installed!", "Success");
|
MainManager.DialogService.ShowMessageBox("Success", "The mod was successfully installed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,62 +1,62 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <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.Modules.Overlays.VolumeDisplay {
|
||||||
|
|
||||||
|
|
||||||
[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 VolumeDisplay : global::System.Configuration.ApplicationSettingsBase {
|
internal sealed partial class VolumeDisplay : global::System.Configuration.ApplicationSettingsBase {
|
||||||
|
|
||||||
private static VolumeDisplay defaultInstance = ((VolumeDisplay)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new VolumeDisplay())));
|
private static VolumeDisplay defaultInstance = ((VolumeDisplay)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new VolumeDisplay())));
|
||||||
|
|
||||||
public static VolumeDisplay Default {
|
public static VolumeDisplay 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("#FFFF2900")]
|
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
||||||
public global::System.Windows.Media.Color MainColor {
|
public bool Enabled {
|
||||||
get {
|
get {
|
||||||
return ((global::System.Windows.Media.Color)(this["MainColor"]));
|
return ((bool)(this["Enabled"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["MainColor"] = value;
|
this["Enabled"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FF26F600")]
|
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF2900")]
|
||||||
public global::System.Windows.Media.Color SecondaryColor {
|
public global::System.Windows.Media.Color MainColor {
|
||||||
get {
|
get {
|
||||||
return ((global::System.Windows.Media.Color)(this["SecondaryColor"]));
|
return ((global::System.Windows.Media.Color)(this["MainColor"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["SecondaryColor"] = value;
|
this["MainColor"] = 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("#FF26F600")]
|
||||||
public bool Enabled {
|
public global::System.Windows.Media.Color SecondaryColor {
|
||||||
get {
|
get {
|
||||||
return ((bool)(this["Enabled"]));
|
return ((global::System.Windows.Media.Color)(this["SecondaryColor"]));
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
this["Enabled"] = value;
|
this["SecondaryColor"] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,23 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.Utilities.Keyboard;
|
using Artemis.Utilities.Keyboard;
|
||||||
|
|
||||||
namespace Artemis.Modules.Overlays.VolumeDisplay
|
namespace Artemis.Modules.Overlays.VolumeDisplay
|
||||||
{
|
{
|
||||||
public class VolumeDisplay
|
public class VolumeBar
|
||||||
{
|
{
|
||||||
public VolumeDisplay(MainModel mainModel, VolumeDisplaySettings settings)
|
public VolumeBar(MainManager mainManager, VolumeDisplaySettings settings)
|
||||||
{
|
{
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
Settings = settings;
|
Settings = settings;
|
||||||
Transparancy = 255;
|
Transparancy = 255;
|
||||||
Scale = 4;
|
Scale = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
public MainManager MainManager { get; set; }
|
||||||
|
|
||||||
public VolumeDisplaySettings Settings { get; set; }
|
public VolumeDisplaySettings Settings { get; set; }
|
||||||
|
|
||||||
@ -30,14 +30,14 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
|
|||||||
|
|
||||||
public void Draw(Graphics g)
|
public void Draw(Graphics g)
|
||||||
{
|
{
|
||||||
var volumeRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, 0, new List<Color>
|
var volumeRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List<Color>
|
||||||
{
|
{
|
||||||
ColorHelpers.ToDrawingColor(Settings.SecondaryColor),
|
ColorHelpers.ToDrawingColor(Settings.SecondaryColor),
|
||||||
ColorHelpers.ToDrawingColor(Settings.MainColor)
|
ColorHelpers.ToDrawingColor(Settings.MainColor)
|
||||||
},
|
},
|
||||||
LinearGradientMode.Horizontal)
|
LinearGradientMode.Horizontal)
|
||||||
{
|
{
|
||||||
Width = (int) (MainModel.ActiveKeyboard.Width*Scale/100.00*Volume),
|
Width = (int) (MainManager.KeyboardManager.ActiveKeyboard.Width*Scale/100.00*Volume),
|
||||||
ContainedBrush = false
|
ContainedBrush = false
|
||||||
};
|
};
|
||||||
volumeRect.Draw(g);
|
volumeRect.Draw(g);
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
<?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)"
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||||
GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="VolumeDisplay">
|
GeneratedClassNamespace="Artemis.Modules.Overlays.VolumeDisplay" GeneratedClassName="VolumeDisplay">
|
||||||
<Profiles />
|
<Profiles />
|
||||||
<Settings>
|
<Settings>
|
||||||
<Setting Name="MainColor" Type="System.Windows.Media.Color" Scope="User">
|
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">#FFFF2900</Value>
|
<Value Profile="(Default)">True</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="SecondaryColor" Type="System.Windows.Media.Color" Scope="User">
|
<Setting Name="MainColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
<Value Profile="(Default)">#FF26F600</Value>
|
<Value Profile="(Default)">#FFFF2900</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
<Setting Name="SecondaryColor" Type="System.Windows.Media.Color" Scope="User">
|
||||||
<Value Profile="(Default)">True</Value>
|
<Value Profile="(Default)">#FF26F600</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using NAudio.CoreAudioApi;
|
using NAudio.CoreAudioApi;
|
||||||
|
|
||||||
@ -9,28 +9,28 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
|
|||||||
{
|
{
|
||||||
public class VolumeDisplayModel : OverlayModel
|
public class VolumeDisplayModel : OverlayModel
|
||||||
{
|
{
|
||||||
public VolumeDisplayModel(MainModel mainModel, VolumeDisplaySettings settings) : base(mainModel)
|
public VolumeDisplayModel(MainManager mainManager, VolumeDisplaySettings settings) : base(mainManager)
|
||||||
{
|
{
|
||||||
Settings = settings;
|
Settings = settings;
|
||||||
Name = "VolumeDisplay";
|
Name = "VolumeDisplay";
|
||||||
Enabled = Settings.Enabled;
|
Enabled = Settings.Enabled;
|
||||||
|
|
||||||
VolumeDisplay = new VolumeDisplay(mainModel, settings);
|
VolumeDisplay = new VolumeBar(mainManager, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
public VolumeDisplay VolumeDisplay { get; set; }
|
public VolumeBar VolumeDisplay { get; set; }
|
||||||
|
|
||||||
public VolumeDisplaySettings Settings { get; set; }
|
public VolumeDisplaySettings Settings { get; set; }
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
MainModel.KeyboardHook.Unsubscribe(HandleKeypress);
|
MainManager.KeyboardHook.KeyDownCallback -= KeyPressTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Enable()
|
public override void Enable()
|
||||||
{
|
{
|
||||||
// Listener won't start unless the effect is active
|
// Listener won't start unless the effect is active
|
||||||
MainModel.KeyboardHook.Subscribe(HandleKeypress);
|
MainManager.KeyboardHook.KeyDownCallback += KeyPressTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
@ -63,7 +63,7 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
|
|||||||
|
|
||||||
public override Bitmap GenerateBitmap()
|
public override Bitmap GenerateBitmap()
|
||||||
{
|
{
|
||||||
return GenerateBitmap(MainModel.ActiveKeyboard.KeyboardBitmap(4));
|
return GenerateBitmap(MainManager.KeyboardManager.ActiveKeyboard.KeyboardBitmap(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Bitmap GenerateBitmap(Bitmap bitmap)
|
public override Bitmap GenerateBitmap(Bitmap bitmap)
|
||||||
@ -79,11 +79,6 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
|
|||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleKeypress(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
Task.Factory.StartNew(() => KeyPressTask(e));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void KeyPressTask(KeyEventArgs e)
|
private void KeyPressTask(KeyEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.KeyCode != Keys.VolumeUp && e.KeyCode != Keys.VolumeDown)
|
if (e.KeyCode != Keys.VolumeUp && e.KeyCode != Keys.VolumeDown)
|
||||||
|
|||||||
@ -16,18 +16,18 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
|
|||||||
|
|
||||||
public sealed override void Load()
|
public sealed override void Load()
|
||||||
{
|
{
|
||||||
Enabled = Settings.VolumeDisplay.Default.Enabled;
|
Enabled = VolumeDisplay.Default.Enabled;
|
||||||
MainColor = Settings.VolumeDisplay.Default.MainColor;
|
MainColor = VolumeDisplay.Default.MainColor;
|
||||||
SecondaryColor = Settings.VolumeDisplay.Default.SecondaryColor;
|
SecondaryColor = VolumeDisplay.Default.SecondaryColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed override void Save()
|
public sealed override void Save()
|
||||||
{
|
{
|
||||||
Settings.VolumeDisplay.Default.Enabled = Enabled;
|
VolumeDisplay.Default.Enabled = Enabled;
|
||||||
Settings.VolumeDisplay.Default.MainColor = MainColor;
|
VolumeDisplay.Default.MainColor = MainColor;
|
||||||
Settings.VolumeDisplay.Default.SecondaryColor = SecondaryColor;
|
VolumeDisplay.Default.SecondaryColor = SecondaryColor;
|
||||||
|
|
||||||
Settings.VolumeDisplay.Default.Save();
|
VolumeDisplay.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
public sealed override void ToDefault()
|
||||||
|
|||||||
@ -55,17 +55,23 @@
|
|||||||
<xctk:ColorPicker x:Name="SecondaryColor"
|
<xctk:ColorPicker x:Name="SecondaryColor"
|
||||||
SelectedColor="{Binding Path=VolumeDisplaySettings.SecondaryColor, Mode=TwoWay}"
|
SelectedColor="{Binding Path=VolumeDisplaySettings.SecondaryColor, Mode=TwoWay}"
|
||||||
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
Grid.Row="2" Grid.Column="1" Width="110" HorizontalAlignment="Right"
|
||||||
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22" />
|
VerticalAlignment="Center" Margin="0,5,-1,5" Height="22">
|
||||||
|
<xctk:ColorPicker.Template>
|
||||||
|
<ControlTemplate>
|
||||||
|
<Rectangle />
|
||||||
|
</ControlTemplate>
|
||||||
|
</xctk:ColorPicker.Template>
|
||||||
|
</xctk:ColorPicker>
|
||||||
|
|
||||||
<TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
<TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
||||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||||
Foreground="#535353" MaxWidth="520" TextAlignment="Justify">
|
MaxWidth="520" TextAlignment="Justify">
|
||||||
Note: This is an overlay. It will go over any other active effect, and is only shown at certain moments (in this case when changing volume). Please also note that it won't work if there aren't any active effects.
|
Note: This is an overlay. It will go over any other active effect, and is only shown at certain moments (in this case when changing volume). Please also note that it won't work if there aren't any active effects.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
<TextBlock Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
<TextBlock Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
||||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
||||||
Foreground="#B50000" MaxWidth="520" TextAlignment="Justify">
|
Foreground="{DynamicResource HighlightBrush}" MaxWidth="520" TextAlignment="Justify">
|
||||||
Please also note that it won't work if there aren't any active effects.
|
Please also note that it won't work if there aren't any active effects.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
namespace Artemis.Modules.Overlays.VolumeDisplay
|
namespace Artemis.Modules.Overlays.VolumeDisplay
|
||||||
@ -7,21 +7,21 @@ namespace Artemis.Modules.Overlays.VolumeDisplay
|
|||||||
{
|
{
|
||||||
private VolumeDisplaySettings _volumeDisplaySettings;
|
private VolumeDisplaySettings _volumeDisplaySettings;
|
||||||
|
|
||||||
public VolumeDisplayViewModel(MainModel mainModel)
|
public VolumeDisplayViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
|
|
||||||
// Settings are loaded from file by class
|
// Settings are loaded from file by class
|
||||||
VolumeDisplaySettings = new VolumeDisplaySettings();
|
VolumeDisplaySettings = new VolumeDisplaySettings();
|
||||||
|
|
||||||
// Create effect model and add it to MainModel
|
// Create effect model and add it to MainManager
|
||||||
VolumeDisplayModel = new VolumeDisplayModel(mainModel, VolumeDisplaySettings);
|
VolumeDisplayModel = new VolumeDisplayModel(mainManager, VolumeDisplaySettings);
|
||||||
MainModel.EffectModels.Add(VolumeDisplayModel);
|
MainManager.EffectManager.EffectModels.Add(VolumeDisplayModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string Name => "Volume Display";
|
public static string Name => "Volume Display";
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
public MainManager MainManager { get; set; }
|
||||||
public VolumeDisplayModel VolumeDisplayModel { get; set; }
|
public VolumeDisplayModel VolumeDisplayModel { get; set; }
|
||||||
|
|
||||||
public VolumeDisplaySettings VolumeDisplaySettings
|
public VolumeDisplaySettings VolumeDisplaySettings
|
||||||
|
|||||||
250
Artemis/Artemis/Properties/Resources.Designer.cs
generated
250
Artemis/Artemis/Properties/Resources.Designer.cs
generated
@ -1,66 +1,66 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <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.Properties {
|
namespace Artemis.Properties {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
// class via a tool like ResGen or Visual Studio.
|
// class via a tool like ResGen or Visual Studio.
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
// with the /str option, or rebuild your VS project.
|
// with the /str option, or rebuild your VS project.
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
internal class Resources {
|
internal class Resources {
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
private static global::System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal Resources() {
|
internal Resources() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Artemis.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Artemis.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
/// resource lookups using this strongly typed resource class.
|
/// resource lookups using this strongly typed resource class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
internal static global::System.Globalization.CultureInfo Culture {
|
||||||
get {
|
get {
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
resourceCulture = value;
|
resourceCulture = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-16"?>
|
/// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-16"?>
|
||||||
///<!-- Used by Artemis to get the active Sign -->
|
///<!-- Used by Artemis to get the active Sign -->
|
||||||
///<UserConfig>
|
///<UserConfig>
|
||||||
@ -69,25 +69,25 @@ namespace Artemis.Properties {
|
|||||||
/// <Var id="ActiveSign" displayName="ActiveSign" displayType="SLIDER:0:1:1000000"/>
|
/// <Var id="ActiveSign" displayName="ActiveSign" displayType="SLIDER:0:1:1000000"/>
|
||||||
/// </VisibleVars>
|
/// </VisibleVars>
|
||||||
/// </Group>
|
/// </Group>
|
||||||
///</UserConfig>.
|
///</UserConfig>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string artemisXml {
|
internal static string artemisXml {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("artemisXml", resourceCulture);
|
return ResourceManager.GetString("artemisXml", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static System.Drawing.Bitmap bow {
|
internal static System.Drawing.Bitmap bow {
|
||||||
get {
|
get {
|
||||||
object obj = ResourceManager.GetObject("bow", resourceCulture);
|
object obj = ResourceManager.GetObject("bow", resourceCulture);
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
return ((System.Drawing.Bitmap)(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to "Artemis"
|
/// Looks up a localized string similar to "Artemis"
|
||||||
///{
|
///{
|
||||||
/// "uri" "http://localhost:{{port}}/csgo_game_event"
|
/// "uri" "http://localhost:{{port}}/csgo_game_event"
|
||||||
@ -105,36 +105,56 @@ namespace Artemis.Properties {
|
|||||||
/// "player_weapons" "1"
|
/// "player_weapons" "1"
|
||||||
/// "player_match_stats" "1"
|
/// "player_match_stats" "1"
|
||||||
/// }
|
/// }
|
||||||
///}.
|
///}.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string gamestateConfiguration {
|
internal static string gamestateConfiguration {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("gamestateConfiguration", resourceCulture);
|
return ResourceManager.GetString("gamestateConfiguration", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to /***********************************************************************/
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
////** © 2015 CD PROJEKT S.A. All rights reserved.
|
/// </summary>
|
||||||
////** THE WITCHER® is a trademark of CD PROJEKT S. A.
|
internal static System.Drawing.Icon logo {
|
||||||
////** The Witcher game is based on the prose of Andrzej Sapkowski.
|
get {
|
||||||
////***********************************************************************/
|
object obj = ResourceManager.GetObject("logo", resourceCulture);
|
||||||
///
|
return ((System.Drawing.Icon)(obj));
|
||||||
///
|
}
|
||||||
///
|
}
|
||||||
///
|
|
||||||
///statemachine class W3PlayerWitcher extends CR4Player
|
/// <summary>
|
||||||
///{
|
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
||||||
///
|
/// </summary>
|
||||||
/// private saved var craftingSchematics : array<name>;
|
internal static System.Drawing.Icon logo_disabled {
|
||||||
///
|
get {
|
||||||
///
|
object obj = ResourceManager.GetObject("logo_disabled", resourceCulture);
|
||||||
/// private saved var alchemyRecipes : array<name>; [rest of string was truncated]";.
|
return ((System.Drawing.Icon)(obj));
|
||||||
/// </summary>
|
}
|
||||||
internal static string playerWitcherWs {
|
}
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("playerWitcherWs", resourceCulture);
|
/// <summary>
|
||||||
}
|
/// Looks up a localized string similar to /***********************************************************************/
|
||||||
}
|
////** © 2015 CD PROJEKT S.A. All rights reserved.
|
||||||
}
|
////** THE WITCHER® is a trademark of CD PROJEKT S. A.
|
||||||
}
|
////** The Witcher game is based on the prose of Andrzej Sapkowski.
|
||||||
|
////***********************************************************************/
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///
|
||||||
|
///statemachine class W3PlayerWitcher extends CR4Player
|
||||||
|
///{
|
||||||
|
///
|
||||||
|
/// private saved var craftingSchematics : array<name>;
|
||||||
|
///
|
||||||
|
///
|
||||||
|
/// private saved var alchemyRecipes : array<name>; [rest of string was truncated]";.
|
||||||
|
/// </summary>
|
||||||
|
internal static string playerWitcherWs {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("playerWitcherWs", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,133 +1,139 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<root>
|
<root>
|
||||||
<!--
|
<!--
|
||||||
Microsoft ResX Schema
|
Microsoft ResX Schema
|
||||||
|
|
||||||
Version 2.0
|
Version 2.0
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
The primary goals of this format is to allow a simple XML format
|
||||||
that is mostly human readable. The generation and parsing of the
|
that is mostly human readable. The generation and parsing of the
|
||||||
various data types are done through the TypeConverter classes
|
various data types are done through the TypeConverter classes
|
||||||
associated with the data types.
|
associated with the data types.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
... ado.net/XML headers & schema ...
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
<resheader name="version">2.0</resheader>
|
<resheader name="version">2.0</resheader>
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
<comment>This is a comment</comment>
|
<comment>This is a comment</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
There are any number of "resheader" rows that contain simple
|
||||||
name/value pairs.
|
name/value pairs.
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
Each data row contains a name, and value. The row also contains a
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
text/value conversion through the TypeConverter architecture.
|
text/value conversion through the TypeConverter architecture.
|
||||||
Classes that don't support this are serialized and stored with the
|
Classes that don't support this are serialized and stored with the
|
||||||
mimetype set.
|
mimetype set.
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
The mimetype is used for serialized objects, and tells the
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
read any of the formats listed below.
|
read any of the formats listed below.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
value : The object must be serialized with
|
value : The object must be serialized with
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
value : The object must be serialized into a byte array
|
value : The object must be serialized into a byte array
|
||||||
: using a System.ComponentModel.TypeConverter
|
: using a System.ComponentModel.TypeConverter
|
||||||
: and then encoded with base64 encoding.
|
: and then encoded with base64 encoding.
|
||||||
-->
|
-->
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:choice maxOccurs="unbounded">
|
<xsd:choice maxOccurs="unbounded">
|
||||||
<xsd:element name="metadata">
|
<xsd:element name="metadata">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="assembly">
|
<xsd:element name="assembly">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="data">
|
<xsd:element name="data">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
<xsd:attribute ref="xml:space" />
|
<xsd:attribute ref="xml:space" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
<xsd:element name="resheader">
|
<xsd:element name="resheader">
|
||||||
<xsd:complexType>
|
<xsd:complexType>
|
||||||
<xsd:sequence>
|
<xsd:sequence>
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
</xsd:sequence>
|
</xsd:sequence>
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:choice>
|
</xsd:choice>
|
||||||
</xsd:complexType>
|
</xsd:complexType>
|
||||||
</xsd:element>
|
</xsd:element>
|
||||||
</xsd:schema>
|
</xsd:schema>
|
||||||
<resheader name="resmimetype">
|
<resheader name="resmimetype">
|
||||||
<value>text/microsoft-resx</value>
|
<value>text/microsoft-resx</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="version">
|
<resheader name="version">
|
||||||
<value>2.0</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<resheader name="reader">
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
<data name="artemisXml" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="artemisXml" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\witcher3\artemis.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
<value>..\resources\witcher3\artemis.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="bow" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="bow" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\bow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
<value>..\Resources\bow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="gamestateConfiguration" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="gamestateConfiguration" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\counterstrike\gamestateconfiguration.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
<value>..\resources\counterstrike\gamestateconfiguration.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="playerWitcherWs" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\resources\witcher3\playerwitcher.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
|
<value>..\Resources\logo.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="logo_disabled" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\logo-disabled.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="playerWitcherWs" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\resources\witcher3\playerwitcher.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 361 KiB |
BIN
Artemis/Artemis/Resources/logo.ico
Normal file
BIN
Artemis/Artemis/Resources/logo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 361 KiB |
48
Artemis/Artemis/Services/DialogService.cs
Normal file
48
Artemis/Artemis/Services/DialogService.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
//The MIT License(MIT)
|
||||||
|
|
||||||
|
//Copyright(c) 2015 ihtfw
|
||||||
|
|
||||||
|
//Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
//of this software and associated documentation files (the "Software"), to deal
|
||||||
|
//in the Software without restriction, including without limitation the rights
|
||||||
|
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
//copies of the Software, and to permit persons to whom the Software is
|
||||||
|
//furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
//The above copyright notice and this permission notice shall be included in all
|
||||||
|
//copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
//SOFTWARE.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Artemis.Services
|
||||||
|
{
|
||||||
|
public abstract class DialogService
|
||||||
|
{
|
||||||
|
public void ShowErrorMessageBox(Exception e)
|
||||||
|
{
|
||||||
|
ShowErrorMessageBox(e.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowErrorMessageBox(string message)
|
||||||
|
{
|
||||||
|
ShowMessageBox("Error", message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void ShowMessageBox(string title, string message);
|
||||||
|
|
||||||
|
public abstract bool ShowOpenDialog(out string path, string defaultExt, string filter, string initialDir = null);
|
||||||
|
|
||||||
|
public abstract Task<string> ShowInputDialog(string title, string message);
|
||||||
|
|
||||||
|
public abstract Task<bool?> ShowQuestionMessageBox(string title, string message);
|
||||||
|
}
|
||||||
|
}
|
||||||
143
Artemis/Artemis/Services/MetroDialogService.cs
Normal file
143
Artemis/Artemis/Services/MetroDialogService.cs
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
//The MIT License(MIT)
|
||||||
|
|
||||||
|
//Copyright(c) 2015 ihtfw
|
||||||
|
|
||||||
|
//Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
//of this software and associated documentation files (the "Software"), to deal
|
||||||
|
//in the Software without restriction, including without limitation the rights
|
||||||
|
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
//copies of the Software, and to permit persons to whom the Software is
|
||||||
|
//furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
//The above copyright notice and this permission notice shall be included in all
|
||||||
|
//copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
//IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
//FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
//AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
//LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
//SOFTWARE.
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
using Artemis.ViewModels;
|
||||||
|
using Caliburn.Micro;
|
||||||
|
using MahApps.Metro.Controls;
|
||||||
|
using MahApps.Metro.Controls.Dialogs;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
|
namespace Artemis.Services
|
||||||
|
{
|
||||||
|
public class MetroDialogService : DialogService
|
||||||
|
{
|
||||||
|
private readonly ShellViewModel _shellViewModel;
|
||||||
|
|
||||||
|
public MetroDialogService(ShellViewModel shellViewModel)
|
||||||
|
{
|
||||||
|
_shellViewModel = shellViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MetroWindow GetActiveWindow()
|
||||||
|
{
|
||||||
|
MetroWindow window = null;
|
||||||
|
|
||||||
|
Execute.OnUIThread(() =>
|
||||||
|
{
|
||||||
|
window = Application.Current.Windows.OfType<MetroWindow>().FirstOrDefault(w => w.IsActive);
|
||||||
|
if (window == null)
|
||||||
|
{
|
||||||
|
window = Application.Current.Windows.OfType<MetroWindow>().FirstOrDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return window;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ShowMessageBox(string title, string message)
|
||||||
|
{
|
||||||
|
if (_shellViewModel.IsActive == false)
|
||||||
|
return;
|
||||||
|
|
||||||
|
Execute.OnUIThread(() => GetActiveWindow().ShowMessageAsync(title, message));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task<bool?> ShowQuestionMessageBox(string title, string message)
|
||||||
|
{
|
||||||
|
if (_shellViewModel.IsActive == false)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var metroDialogSettings = new MetroDialogSettings {AffirmativeButtonText = "Yes", NegativeButtonText = "No"};
|
||||||
|
var result =
|
||||||
|
await
|
||||||
|
GetActiveWindow()
|
||||||
|
.ShowMessageAsync(title, message, MessageDialogStyle.AffirmativeAndNegative, metroDialogSettings);
|
||||||
|
switch (result)
|
||||||
|
{
|
||||||
|
case MessageDialogResult.Negative:
|
||||||
|
return false;
|
||||||
|
case MessageDialogResult.Affirmative:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override Task<string> ShowInputDialog(string title, string message)
|
||||||
|
{
|
||||||
|
if (_shellViewModel.IsActive == false)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return GetActiveWindow().ShowInputAsync(title, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool ShowOpenDialog(out string path, string defaultExt, string filter, string initialDir = null)
|
||||||
|
{
|
||||||
|
if (_shellViewModel.IsActive == false)
|
||||||
|
{
|
||||||
|
path = null;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool? res = null;
|
||||||
|
string lPath = null;
|
||||||
|
|
||||||
|
Execute.OnUIThread(() =>
|
||||||
|
{
|
||||||
|
var ofd = new OpenFileDialog
|
||||||
|
{
|
||||||
|
DefaultExt = defaultExt,
|
||||||
|
Filter = filter
|
||||||
|
};
|
||||||
|
|
||||||
|
if (initialDir != null)
|
||||||
|
{
|
||||||
|
ofd.InitialDirectory = initialDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Application.Current.MainWindow != null)
|
||||||
|
{
|
||||||
|
res = ofd.ShowDialog(Application.Current.MainWindow);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res = ofd.ShowDialog();
|
||||||
|
}
|
||||||
|
if (res == true)
|
||||||
|
{
|
||||||
|
lPath = ofd.FileName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
path = lPath;
|
||||||
|
|
||||||
|
return res.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
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("False")]
|
||||||
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)">False</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();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
using System.IO;
|
using System;
|
||||||
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Windows.Forms;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
@ -29,11 +31,18 @@ namespace Artemis.Utilities.GameState
|
|||||||
if (Running)
|
if (Running)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_listener.Prefixes.Clear();
|
try
|
||||||
Port = General.Default.GamestatePort;
|
{
|
||||||
_listener.Prefixes.Add($"http://localhost:{Port}/");
|
_listener.Prefixes.Clear();
|
||||||
|
Port = General.Default.GamestatePort;
|
||||||
_listener.Start();
|
_listener.Prefixes.Add($"http://localhost:{Port}/");
|
||||||
|
|
||||||
|
_listener.Start();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Couldn't start the webserver. CS:GO effect won't work :c \n\nTry changing the port in Settings and restart Artemis.");
|
||||||
|
}
|
||||||
|
|
||||||
ThreadPool.QueueUserWorkItem(o =>
|
ThreadPool.QueueUserWorkItem(o =>
|
||||||
{
|
{
|
||||||
@ -74,6 +83,11 @@ namespace Artemis.Utilities.GameState
|
|||||||
Running = true;
|
Running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Stop()
|
||||||
|
{
|
||||||
|
_listener.Stop();
|
||||||
|
}
|
||||||
|
|
||||||
private string HandleRequest(HttpListenerRequest request)
|
private string HandleRequest(HttpListenerRequest request)
|
||||||
{
|
{
|
||||||
object json;
|
object json;
|
||||||
|
|||||||
@ -1,31 +1,24 @@
|
|||||||
using System.Windows.Forms;
|
using System.Threading.Tasks;
|
||||||
using Gma.System.MouseKeyHook;
|
using System.Windows.Forms;
|
||||||
|
using VirtualInput;
|
||||||
|
|
||||||
namespace Artemis.Utilities.Keyboard
|
namespace Artemis.Utilities.Keyboard
|
||||||
{
|
{
|
||||||
public class KeyboardHook
|
public class KeyboardHook
|
||||||
{
|
{
|
||||||
private IKeyboardMouseEvents _mGlobalHook;
|
public delegate void KeyDownCallbackHandler(KeyEventArgs e);
|
||||||
public int Subscriptions { get; set; }
|
|
||||||
|
|
||||||
public void Subscribe(KeyEventHandler handleKeypress)
|
public KeyboardHook()
|
||||||
{
|
{
|
||||||
if (Subscriptions < 1)
|
VirtualKeyboard.KeyDown += VirtualKeyboardOnKeyDown;
|
||||||
_mGlobalHook = Hook.GlobalEvents();
|
VirtualKeyboard.StartInterceptor();
|
||||||
|
|
||||||
_mGlobalHook.KeyDown += handleKeypress;
|
|
||||||
Subscriptions++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Unsubscribe(KeyEventHandler handleKeypress)
|
private void VirtualKeyboardOnKeyDown(object sender, KeyEventArgs keyEventArgs)
|
||||||
{
|
{
|
||||||
_mGlobalHook.KeyDown -= handleKeypress;
|
Task.Factory.StartNew(() => { KeyDownCallback?.Invoke(keyEventArgs); });
|
||||||
Subscriptions--;
|
|
||||||
|
|
||||||
if (Subscriptions >= 1)
|
|
||||||
return;
|
|
||||||
_mGlobalHook.Dispose();
|
|
||||||
_mGlobalHook = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event KeyDownCallbackHandler KeyDownCallback;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,26 +1,26 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Artemis.Models
|
namespace Artemis.Utilities.Memory
|
||||||
{
|
{
|
||||||
public class GamePointersCollectionModel
|
public class GamePointer
|
||||||
{
|
{
|
||||||
public string Game { get; set; }
|
public string Description { get; set; }
|
||||||
public string GameVersion { get; set; }
|
public IntPtr BasePointer { get; set; }
|
||||||
public List<GamePointer> GameAddresses { get; set; }
|
public int[] Offsets { get; set; }
|
||||||
}
|
|
||||||
|
public override string ToString()
|
||||||
public class GamePointer
|
{
|
||||||
{
|
return Offsets.Aggregate(BasePointer.ToString("X"),
|
||||||
public string Description { get; set; }
|
(current, offset) => current + $"+{offset.ToString("X")}");
|
||||||
public IntPtr BasePointer { get; set; }
|
}
|
||||||
public int[] Offsets { get; set; }
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public class GamePointersCollection
|
||||||
{
|
{
|
||||||
return Offsets.Aggregate(BasePointer.ToString("X"),
|
public string Game { get; set; }
|
||||||
(current, offset) => current + $"+{offset.ToString("X")}");
|
public string GameVersion { get; set; }
|
||||||
}
|
public List<GamePointer> GameAddresses { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,12 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Artemis.Models;
|
|
||||||
using Artemis.Settings;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace Artemis.Utilities.Memory
|
namespace Artemis.Utilities.Memory
|
||||||
{
|
{
|
||||||
@ -18,8 +12,8 @@ namespace Artemis.Utilities.Memory
|
|||||||
|
|
||||||
public static Process GetProcessIfRunning(string processName)
|
public static Process GetProcessIfRunning(string processName)
|
||||||
{
|
{
|
||||||
var rlProcess = Process.GetProcessesByName(processName);
|
var processes = Process.GetProcessesByName(processName);
|
||||||
return rlProcess.Length >= 1 ? rlProcess[0] : null;
|
return processes.Length >= 1 ? processes[0] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IntPtr FindAddress(IntPtr pHandle, IntPtr baseAddress, IntPtr staticPointer, int[] offsets)
|
public static IntPtr FindAddress(IntPtr pHandle, IntPtr baseAddress, IntPtr staticPointer, int[] offsets)
|
||||||
@ -43,35 +37,5 @@ namespace Artemis.Utilities.Memory
|
|||||||
}
|
}
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void GetPointers()
|
|
||||||
{
|
|
||||||
if (!General.Default.EnablePointersUpdate)
|
|
||||||
return;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var jsonClient = new WebClient();
|
|
||||||
// Random number to get around cache issues
|
|
||||||
var rand = new Random(DateTime.Now.Millisecond);
|
|
||||||
var json =
|
|
||||||
jsonClient.DownloadString(
|
|
||||||
"https://raw.githubusercontent.com/SpoinkyNL/Artemis/master/pointers.json?random=" + rand.Next());
|
|
||||||
|
|
||||||
// Get a list of pointers
|
|
||||||
var pointers = JsonConvert.DeserializeObject<List<GamePointersCollectionModel>>(json);
|
|
||||||
// Assign each pointer to the settings file
|
|
||||||
var rlPointers = JsonConvert.SerializeObject(pointers.FirstOrDefault(p => p.Game == "RocketLeague"));
|
|
||||||
if (rlPointers != null)
|
|
||||||
{
|
|
||||||
Offsets.Default.RocketLeague = rlPointers;
|
|
||||||
Offsets.Default.Save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
// ignored
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
104
Artemis/Artemis/Utilities/Updater.cs
Normal file
104
Artemis/Artemis/Utilities/Updater.cs
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.Services;
|
||||||
|
using Artemis.Settings;
|
||||||
|
using Artemis.Utilities.Memory;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
|
namespace Artemis.Utilities
|
||||||
|
{
|
||||||
|
public static class Updater
|
||||||
|
{
|
||||||
|
public static int CurrentVersion = 102;
|
||||||
|
|
||||||
|
public static async Task<Action> CheckForUpdate(MetroDialogService dialogService)
|
||||||
|
{
|
||||||
|
if (!General.Default.CheckForUpdates)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var newRelease = IsUpdateAvailable();
|
||||||
|
if (newRelease == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var viewUpdate = await
|
||||||
|
dialogService.ShowQuestionMessageBox("Update available",
|
||||||
|
$"A new version of Artemis is available, version {newRelease["tag_name"].Value<string>()}.\n" +
|
||||||
|
"Do you wish to view the update on GitHub now?\n\n" +
|
||||||
|
"Note: You can disable update notifications in the settings menu");
|
||||||
|
|
||||||
|
if (viewUpdate.Value)
|
||||||
|
Process.Start(new ProcessStartInfo(newRelease["html_url"].Value<string>()));
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JObject IsUpdateAvailable()
|
||||||
|
{
|
||||||
|
if (!General.Default.EnablePointersUpdate)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var jsonClient = new WebClient();
|
||||||
|
|
||||||
|
// GitHub trips if we don't add a user agent
|
||||||
|
jsonClient.Headers.Add("user-agent",
|
||||||
|
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
|
||||||
|
|
||||||
|
// Random number to get around cache issues
|
||||||
|
var rand = new Random(DateTime.Now.Millisecond);
|
||||||
|
var json =
|
||||||
|
jsonClient.DownloadString("https://api.github.com/repos/SpoinkyNL/Artemis/releases/latest?random=" +
|
||||||
|
rand.Next());
|
||||||
|
|
||||||
|
// Get a list of pointers
|
||||||
|
var release = JsonConvert.DeserializeObject<JObject>(json);
|
||||||
|
|
||||||
|
// Parse a version number string to an int
|
||||||
|
var remoteVersion = int.Parse(release["tag_name"].Value<string>().Replace(".", ""));
|
||||||
|
|
||||||
|
return remoteVersion > CurrentVersion ? release : null;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GetPointers()
|
||||||
|
{
|
||||||
|
if (!General.Default.EnablePointersUpdate)
|
||||||
|
return;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var jsonClient = new WebClient();
|
||||||
|
|
||||||
|
// Random number to get around cache issues
|
||||||
|
var rand = new Random(DateTime.Now.Millisecond);
|
||||||
|
var json =
|
||||||
|
jsonClient.DownloadString(
|
||||||
|
"https://raw.githubusercontent.com/SpoinkyNL/Artemis/master/pointers.json?random=" + rand.Next());
|
||||||
|
|
||||||
|
// Get a list of pointers
|
||||||
|
var pointers = JsonConvert.DeserializeObject<List<GamePointersCollection>>(json);
|
||||||
|
// Assign each pointer to the settings file
|
||||||
|
var rlPointers = JsonConvert.SerializeObject(pointers.FirstOrDefault(p => p.Game == "RocketLeague"));
|
||||||
|
if (rlPointers != null)
|
||||||
|
{
|
||||||
|
Offsets.Default.RocketLeague = rlPointers;
|
||||||
|
Offsets.Default.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
79
Artemis/Artemis/ViewModels/Abstract/EffectViewModel.cs
Normal file
79
Artemis/Artemis/ViewModels/Abstract/EffectViewModel.cs
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
using Artemis.Managers;
|
||||||
|
using Artemis.Models;
|
||||||
|
using Caliburn.Micro;
|
||||||
|
|
||||||
|
namespace Artemis.ViewModels.Abstract
|
||||||
|
{
|
||||||
|
public abstract class EffectViewModel : Screen
|
||||||
|
{
|
||||||
|
private EffectSettings _effectSettings;
|
||||||
|
private bool _showDisabledPopup;
|
||||||
|
|
||||||
|
public EffectModel EffectModel { get; set; }
|
||||||
|
public MainManager MainManager { get; set; }
|
||||||
|
|
||||||
|
public EffectSettings EffectSettings
|
||||||
|
{
|
||||||
|
get { return _effectSettings; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (Equals(value, _effectSettings)) return;
|
||||||
|
_effectSettings = value;
|
||||||
|
NotifyOfPropertyChange(() => EffectSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool EffectEnabled => MainManager.EffectManager.ActiveEffect == EffectModel;
|
||||||
|
|
||||||
|
public bool ShowDisabledPopup
|
||||||
|
{
|
||||||
|
get { return _showDisabledPopup; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == _showDisabledPopup) return;
|
||||||
|
_showDisabledPopup = value;
|
||||||
|
NotifyOfPropertyChange(() => ShowDisabledPopup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToggleEffect()
|
||||||
|
{
|
||||||
|
if (!MainManager.ProgramEnabled)
|
||||||
|
{
|
||||||
|
NotifyOfPropertyChange(() => EffectEnabled);
|
||||||
|
ShowDisabledPopup = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EffectEnabled)
|
||||||
|
MainManager.EffectManager.ClearEffect();
|
||||||
|
else
|
||||||
|
MainManager.EffectManager.ChangeEffect(EffectModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveSettings()
|
||||||
|
{
|
||||||
|
EffectSettings?.Save();
|
||||||
|
if (!EffectEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Restart the effect if it's currently running to apply settings.
|
||||||
|
MainManager.EffectManager.ChangeEffect(EffectModel, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void ResetSettings()
|
||||||
|
{
|
||||||
|
var resetConfirm = await
|
||||||
|
MainManager.DialogService.ShowQuestionMessageBox("Reset effect settings",
|
||||||
|
"Are you sure you wish to reset this effect's settings? \nAny changes you made will be lost.");
|
||||||
|
|
||||||
|
if (!resetConfirm.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
EffectSettings.ToDefault();
|
||||||
|
NotifyOfPropertyChange(() => EffectSettings);
|
||||||
|
|
||||||
|
SaveSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
57
Artemis/Artemis/ViewModels/Abstract/GameViewModel.cs
Normal file
57
Artemis/Artemis/ViewModels/Abstract/GameViewModel.cs
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
using Artemis.Managers;
|
||||||
|
using Artemis.Models;
|
||||||
|
using Caliburn.Micro;
|
||||||
|
|
||||||
|
namespace Artemis.ViewModels.Abstract
|
||||||
|
{
|
||||||
|
public abstract class GameViewModel : Screen
|
||||||
|
{
|
||||||
|
private GameSettings _gameSettings;
|
||||||
|
|
||||||
|
public GameModel GameModel { get; set; }
|
||||||
|
public MainManager MainManager { get; set; }
|
||||||
|
|
||||||
|
public GameSettings GameSettings
|
||||||
|
{
|
||||||
|
get { return _gameSettings; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (Equals(value, _gameSettings)) return;
|
||||||
|
_gameSettings = value;
|
||||||
|
NotifyOfPropertyChange(() => GameSettings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool GameEnabled => MainManager.EffectManager.ActiveEffect == GameModel;
|
||||||
|
|
||||||
|
public void ToggleEffect()
|
||||||
|
{
|
||||||
|
GameModel.Enabled = GameSettings.Enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveSettings()
|
||||||
|
{
|
||||||
|
GameSettings?.Save();
|
||||||
|
if (!GameEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Restart the game if it's currently running to apply settings.
|
||||||
|
MainManager.EffectManager.ChangeEffect(GameModel, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async void ResetSettings()
|
||||||
|
{
|
||||||
|
var resetConfirm = await
|
||||||
|
MainManager.DialogService.ShowQuestionMessageBox("Reset effect settings",
|
||||||
|
"Are you sure you wish to reset this effect's settings? \nAny changes you made will be lost.");
|
||||||
|
|
||||||
|
if (!resetConfirm.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
GameSettings.ToDefault();
|
||||||
|
NotifyOfPropertyChange(() => GameSettings);
|
||||||
|
|
||||||
|
SaveSettings();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Artemis.Modules.Effects.AudioVisualizer;
|
using Artemis.Modules.Effects.AudioVisualizer;
|
||||||
using Artemis.Modules.Effects.Debug;
|
using Artemis.Modules.Effects.Debug;
|
||||||
using Artemis.Modules.Effects.TypeHole;
|
using Artemis.Modules.Effects.TypeHole;
|
||||||
@ -14,12 +14,12 @@ namespace Artemis.ViewModels
|
|||||||
private readonly TypeHoleViewModel _typeHoleVm;
|
private readonly TypeHoleViewModel _typeHoleVm;
|
||||||
private readonly TypeWaveViewModel _typeWaveVm;
|
private readonly TypeWaveViewModel _typeWaveVm;
|
||||||
|
|
||||||
public EffectsViewModel(MainModel mainModel)
|
public EffectsViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
_typeWaveVm = new TypeWaveViewModel(mainModel) {DisplayName = "Type Waves"};
|
_typeWaveVm = new TypeWaveViewModel(mainManager) {DisplayName = "Type Waves"};
|
||||||
//_typeHoleVm = new TypeHoleViewModel(mainModel) {DisplayName = "Type Holes (NYI)"};
|
//_typeHoleVm = new TypeHoleViewModel(MainManager) {DisplayName = "Type Holes (NYI)"};
|
||||||
_audioVisualizerVm = new AudioVisualizerViewModel(mainModel) {DisplayName = "Audio Visualization"};
|
_audioVisualizerVm = new AudioVisualizerViewModel(mainManager) {DisplayName = "Audio Visualization"};
|
||||||
_debugVm = new DebugEffectViewModel(mainModel) {DisplayName = "Debug Effect"};
|
_debugVm = new DebugEffectViewModel(mainManager) {DisplayName = "Debug Effect"};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnActivate()
|
protected override void OnActivate()
|
||||||
|
|||||||
@ -1,27 +1,28 @@
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
using MahApps.Metro.Controls;
|
using MahApps.Metro.Controls;
|
||||||
|
|
||||||
namespace Artemis.ViewModels.Flyouts
|
namespace Artemis.ViewModels.Flyouts
|
||||||
{
|
{
|
||||||
public class FlyoutSettingsViewModel : FlyoutBaseViewModel, IHandle<ToggleEnabled>
|
public class FlyoutSettingsViewModel : FlyoutBaseViewModel, IHandle<ToggleEnabled>, IHandle<ActiveEffectChanged>
|
||||||
{
|
{
|
||||||
|
private string _activeEffectName;
|
||||||
private bool _enabled;
|
private bool _enabled;
|
||||||
private GeneralSettings _generalSettings;
|
private GeneralSettings _generalSettings;
|
||||||
private string _selectedKeyboardProvider;
|
private string _selectedKeyboardProvider;
|
||||||
|
|
||||||
public FlyoutSettingsViewModel(MainModel mainModel)
|
public FlyoutSettingsViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
MainModel = mainModel;
|
MainManager = mainManager;
|
||||||
Header = "settings";
|
Header = "Settings";
|
||||||
Position = Position.Right;
|
Position = Position.Right;
|
||||||
GeneralSettings = new GeneralSettings();
|
GeneralSettings = new GeneralSettings();
|
||||||
|
|
||||||
MainModel.Events.Subscribe(this);
|
MainManager.Events.Subscribe(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeneralSettings GeneralSettings
|
public GeneralSettings GeneralSettings
|
||||||
@ -35,10 +36,18 @@ namespace Artemis.ViewModels.Flyouts
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
public MainManager MainManager { get; set; }
|
||||||
|
|
||||||
public BindableCollection<string> KeyboardProviders
|
public BindableCollection<string> KeyboardProviders
|
||||||
=> new BindableCollection<string>(MainModel.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
|
||||||
{
|
{
|
||||||
@ -51,33 +60,52 @@ namespace Artemis.ViewModels.Flyouts
|
|||||||
if (value == null)
|
if (value == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MainModel.ChangeKeyboard(MainModel.KeyboardProviders.First(k => k.Name == _selectedKeyboardProvider));
|
MainManager.KeyboardManager.ChangeKeyboard(
|
||||||
|
MainManager.KeyboardManager.KeyboardProviders.FirstOrDefault(
|
||||||
|
k => k.Name == _selectedKeyboardProvider));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Enabled
|
public bool Enabled
|
||||||
{
|
{
|
||||||
get { return _enabled; }
|
get { return MainManager.ProgramEnabled; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value == _enabled) return;
|
if (value)
|
||||||
_enabled = value;
|
MainManager.EnableProgram();
|
||||||
|
else
|
||||||
NotifyOfPropertyChange(() => Enabled);
|
MainManager.DisableProgram();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ActiveEffectName
|
||||||
|
{
|
||||||
|
get { return _activeEffectName; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == _activeEffectName) return;
|
||||||
|
_activeEffectName = value;
|
||||||
|
NotifyOfPropertyChange(() => ActiveEffectName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(ActiveEffectChanged message)
|
||||||
|
{
|
||||||
|
var effectDisplay = message.ActiveEffect.Length > 0 ? message.ActiveEffect : "none";
|
||||||
|
ActiveEffectName = $"Active effect: {effectDisplay}";
|
||||||
|
}
|
||||||
|
|
||||||
public void Handle(ToggleEnabled message)
|
public void Handle(ToggleEnabled message)
|
||||||
{
|
{
|
||||||
Enabled = message.Enabled;
|
NotifyOfPropertyChange(() => Enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleEnabled()
|
public void ToggleEnabled()
|
||||||
{
|
{
|
||||||
if (Enabled)
|
if (Enabled)
|
||||||
MainModel.ShutdownEffects();
|
MainManager.DisableProgram();
|
||||||
else
|
else
|
||||||
MainModel.StartEffects();
|
MainManager.EnableProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResetSettings()
|
public void ResetSettings()
|
||||||
@ -98,7 +126,9 @@ namespace Artemis.ViewModels.Flyouts
|
|||||||
|
|
||||||
protected override void HandleOpen()
|
protected override void HandleOpen()
|
||||||
{
|
{
|
||||||
SelectedKeyboardProvider = MainModel.ActiveKeyboard?.Name;
|
SelectedKeyboardProvider = General.Default.LastKeyboard.Length > 0
|
||||||
|
? General.Default.LastKeyboard
|
||||||
|
: "None";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Artemis.Modules.Games.CounterStrike;
|
using Artemis.Modules.Games.CounterStrike;
|
||||||
using Artemis.Modules.Games.Dota2;
|
using Artemis.Modules.Games.Dota2;
|
||||||
using Artemis.Modules.Games.RocketLeague;
|
using Artemis.Modules.Games.RocketLeague;
|
||||||
@ -14,12 +14,12 @@ namespace Artemis.ViewModels
|
|||||||
private readonly RocketLeagueViewModel _rocketLeagueVm;
|
private readonly RocketLeagueViewModel _rocketLeagueVm;
|
||||||
private readonly Witcher3ViewModel _witcher3Vm;
|
private readonly Witcher3ViewModel _witcher3Vm;
|
||||||
|
|
||||||
public GamesViewModel(MainModel mainModel)
|
public GamesViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
_rocketLeagueVm = new RocketLeagueViewModel(mainModel) {DisplayName = "Rocket League"};
|
_rocketLeagueVm = new RocketLeagueViewModel(mainManager) {DisplayName = "Rocket League"};
|
||||||
_counterStrikeVm = new CounterStrikeViewModel(mainModel) {DisplayName = "CS:GO"};
|
_counterStrikeVm = new CounterStrikeViewModel(mainManager) {DisplayName = "CS:GO"};
|
||||||
//_dota2Vm = new Dota2ViewModel(mainModel) {DisplayName = "Dota 2 (NYI)"};
|
//_dota2Vm = new Dota2ViewModel(MainManager) {DisplayName = "Dota 2 (NYI)"};
|
||||||
_witcher3Vm = new Witcher3ViewModel(mainModel) {DisplayName = "The Witcher 3"};
|
_witcher3Vm = new Witcher3ViewModel(mainManager) {DisplayName = "The Witcher 3"};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnActivate()
|
protected override void OnActivate()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Managers;
|
||||||
using Artemis.Modules.Overlays.VolumeDisplay;
|
using Artemis.Modules.Overlays.VolumeDisplay;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
@ -6,12 +6,12 @@ namespace Artemis.ViewModels
|
|||||||
{
|
{
|
||||||
public class OverlaysViewModel : Conductor<IScreen>.Collection.OneActive
|
public class OverlaysViewModel : Conductor<IScreen>.Collection.OneActive
|
||||||
{
|
{
|
||||||
private readonly MainModel _mainModel;
|
private readonly MainManager _mainManager;
|
||||||
private VolumeDisplayViewModel _volumeDisplayVm;
|
private VolumeDisplayViewModel _volumeDisplayVm;
|
||||||
|
|
||||||
public OverlaysViewModel(MainModel mainModel)
|
public OverlaysViewModel(MainManager mainManager)
|
||||||
{
|
{
|
||||||
_mainModel = mainModel;
|
_mainManager = mainManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnActivate()
|
protected override void OnActivate()
|
||||||
@ -21,7 +21,7 @@ namespace Artemis.ViewModels
|
|||||||
Items.Clear();
|
Items.Clear();
|
||||||
|
|
||||||
// This VM appears to be going out of scope, so recreating it every time just to be sure.
|
// This VM appears to be going out of scope, so recreating it every time just to be sure.
|
||||||
_volumeDisplayVm = new VolumeDisplayViewModel(_mainModel) { DisplayName = "Volume Display" };
|
_volumeDisplayVm = new VolumeDisplayViewModel(_mainManager) {DisplayName = "Volume Display"};
|
||||||
ActivateItem(_volumeDisplayVm);
|
ActivateItem(_volumeDisplayVm);
|
||||||
ActiveItem = _volumeDisplayVm;
|
ActiveItem = _volumeDisplayVm;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System.Linq;
|
||||||
using System.Linq;
|
using Artemis.Managers;
|
||||||
using System.Windows;
|
using Artemis.Services;
|
||||||
using Artemis.Models;
|
|
||||||
using Artemis.ViewModels.Flyouts;
|
using Artemis.ViewModels.Flyouts;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
@ -16,22 +15,24 @@ namespace Artemis.ViewModels
|
|||||||
|
|
||||||
public ShellViewModel()
|
public ShellViewModel()
|
||||||
{
|
{
|
||||||
|
var dialogService = new MetroDialogService(this);
|
||||||
IEventAggregator events = new EventAggregator();
|
IEventAggregator events = new EventAggregator();
|
||||||
MainModel = new MainModel(events);
|
|
||||||
|
MainManager = new MainManager(events, dialogService);
|
||||||
DisplayName = "Artemis";
|
DisplayName = "Artemis";
|
||||||
|
|
||||||
_welcomeVm = new WelcomeViewModel {DisplayName = "Welcome"};
|
_welcomeVm = new WelcomeViewModel {DisplayName = "Welcome"};
|
||||||
_effectsVm = new EffectsViewModel(MainModel) {DisplayName = "Effects"};
|
_effectsVm = new EffectsViewModel(MainManager) {DisplayName = "Effects"};
|
||||||
_gamesVm = new GamesViewModel(MainModel) {DisplayName = "Games"};
|
_gamesVm = new GamesViewModel(MainManager) {DisplayName = "Games"};
|
||||||
_overlaysVm = new OverlaysViewModel(MainModel) {DisplayName = "Overlays"};
|
_overlaysVm = new OverlaysViewModel(MainManager) {DisplayName = "Overlays"};
|
||||||
|
|
||||||
Flyouts.Add(new FlyoutSettingsViewModel(MainModel));
|
Flyouts.Add(new FlyoutSettingsViewModel(MainManager));
|
||||||
}
|
}
|
||||||
|
|
||||||
public IObservableCollection<FlyoutBaseViewModel> Flyouts { get; set; } =
|
public IObservableCollection<FlyoutBaseViewModel> Flyouts { get; set; } =
|
||||||
new BindableCollection<FlyoutBaseViewModel>();
|
new BindableCollection<FlyoutBaseViewModel>();
|
||||||
|
|
||||||
public MainModel MainModel { get; set; }
|
public MainManager MainManager { get; set; }
|
||||||
|
|
||||||
protected override void OnActivate()
|
protected override void OnActivate()
|
||||||
{
|
{
|
||||||
@ -45,15 +46,14 @@ namespace Artemis.ViewModels
|
|||||||
ActiveItem = _welcomeVm;
|
ActiveItem = _welcomeVm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnClose(EventArgs e)
|
|
||||||
{
|
|
||||||
MainModel.ShutdownEffects();
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Settings()
|
public void Settings()
|
||||||
{
|
{
|
||||||
Flyouts.First().IsOpen = !Flyouts.First().IsOpen;
|
Flyouts.First().IsOpen = !Flyouts.First().IsOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CloseSettings()
|
||||||
|
{
|
||||||
|
Flyouts.First().IsOpen = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,5 +1,9 @@
|
|||||||
using System.Windows;
|
using System;
|
||||||
|
using System.Windows;
|
||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
|
using Artemis.Properties;
|
||||||
|
using Artemis.Settings;
|
||||||
|
using Artemis.Utilities;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
|
|
||||||
namespace Artemis.ViewModels
|
namespace Artemis.ViewModels
|
||||||
@ -9,31 +13,22 @@ namespace Artemis.ViewModels
|
|||||||
private readonly ShellViewModel _shellViewModel;
|
private readonly ShellViewModel _shellViewModel;
|
||||||
|
|
||||||
private readonly IWindowManager _windowManager;
|
private readonly IWindowManager _windowManager;
|
||||||
|
private string _activeIcon;
|
||||||
|
private bool _checkedForUpdate;
|
||||||
private bool _enabled;
|
private bool _enabled;
|
||||||
private string _toggleText;
|
private string _toggleText;
|
||||||
/*
|
|
||||||
* NOTE: In this sample the system tray view-model doesn't receive any notification
|
|
||||||
* when the other window gets closed by pressing the top right 'x'.
|
|
||||||
* Thus no property notification is invoked, and system tray context-menu appears
|
|
||||||
* out of sync, still allowing 'Hide' and disabling 'Show'.
|
|
||||||
* Given the purpose of the sample - integrating Caliburn.Micro with WPF NotifyIcon -
|
|
||||||
* sync'ing the two view-models is not of interest here.
|
|
||||||
* */
|
|
||||||
|
|
||||||
public SystemTrayViewModel(IWindowManager windowManager, ShellViewModel shellViewModel)
|
public SystemTrayViewModel(IWindowManager windowManager, ShellViewModel shellViewModel)
|
||||||
{
|
{
|
||||||
_windowManager = windowManager;
|
_windowManager = windowManager;
|
||||||
_shellViewModel = shellViewModel;
|
_shellViewModel = shellViewModel;
|
||||||
_shellViewModel.MainModel.Events.Subscribe(this);
|
_shellViewModel.MainManager.Events.Subscribe(this);
|
||||||
|
_shellViewModel.MainManager.EnableProgram();
|
||||||
|
_checkedForUpdate = false;
|
||||||
|
//ActiveIcon = "../logo.ico";
|
||||||
|
|
||||||
/*
|
if (General.Default.ShowOnStartup)
|
||||||
* By now Effects are added to the MainModel so we can savely start
|
ShowWindow();
|
||||||
* This is done from here to make sure all UI elements listening to
|
|
||||||
* events will receive the first ToggleEnabled event
|
|
||||||
* */
|
|
||||||
_shellViewModel.MainModel.StartEffects();
|
|
||||||
|
|
||||||
// TODO: Check if show on startup is enabled, if so, show window.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanShowWindow => !_shellViewModel.IsActive;
|
public bool CanShowWindow => !_shellViewModel.IsActive;
|
||||||
@ -49,10 +44,21 @@ namespace Artemis.ViewModels
|
|||||||
_enabled = value;
|
_enabled = value;
|
||||||
|
|
||||||
ToggleText = _enabled ? "Disable Artemis" : "Enable Artemis";
|
ToggleText = _enabled ? "Disable Artemis" : "Enable Artemis";
|
||||||
|
ActiveIcon = _enabled ? "../Resources/logo.ico" : "../Resources/logo-disabled.ico";
|
||||||
NotifyOfPropertyChange(() => Enabled);
|
NotifyOfPropertyChange(() => Enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ActiveIcon
|
||||||
|
{
|
||||||
|
get { return _activeIcon; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_activeIcon = value;
|
||||||
|
NotifyOfPropertyChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string ToggleText
|
public string ToggleText
|
||||||
{
|
{
|
||||||
get { return _toggleText; }
|
get { return _toggleText; }
|
||||||
@ -72,9 +78,9 @@ namespace Artemis.ViewModels
|
|||||||
public void ToggleEnabled()
|
public void ToggleEnabled()
|
||||||
{
|
{
|
||||||
if (Enabled)
|
if (Enabled)
|
||||||
_shellViewModel.MainModel.ShutdownEffects();
|
_shellViewModel.MainManager.DisableProgram();
|
||||||
else
|
else
|
||||||
_shellViewModel.MainModel.StartEffects();
|
_shellViewModel.MainManager.EnableProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnActivate()
|
protected override void OnActivate()
|
||||||
@ -95,8 +101,15 @@ namespace Artemis.ViewModels
|
|||||||
|
|
||||||
NotifyOfPropertyChange(() => CanShowWindow);
|
NotifyOfPropertyChange(() => CanShowWindow);
|
||||||
NotifyOfPropertyChange(() => CanHideWindow);
|
NotifyOfPropertyChange(() => CanHideWindow);
|
||||||
|
|
||||||
|
if (_checkedForUpdate)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_checkedForUpdate = true;
|
||||||
|
Updater.CheckForUpdate(_shellViewModel.MainManager.DialogService);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void HideWindow()
|
public void HideWindow()
|
||||||
{
|
{
|
||||||
if (!CanHideWindow)
|
if (!CanHideWindow)
|
||||||
@ -110,8 +123,11 @@ namespace Artemis.ViewModels
|
|||||||
|
|
||||||
public void ExitApplication()
|
public void ExitApplication()
|
||||||
{
|
{
|
||||||
_shellViewModel.MainModel.ShutdownEffects();
|
_shellViewModel.MainManager.Shutdown();
|
||||||
Application.Current.Shutdown();
|
Application.Current.Shutdown();
|
||||||
|
|
||||||
|
// Sometimes you need to be rough.
|
||||||
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,7 +6,7 @@
|
|||||||
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
|
||||||
xmlns:cal="http://www.caliburnproject.org"
|
xmlns:cal="http://www.caliburnproject.org"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300" d:DesignWidth="300"
|
d:DesignHeight="600" d:DesignWidth="300"
|
||||||
Width="300">
|
Width="300">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
|
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
|
||||||
@ -24,6 +24,8 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
@ -32,8 +34,7 @@
|
|||||||
Content="Enable Artemis:" />
|
Content="Enable Artemis:" />
|
||||||
<controls:ToggleSwitch Grid.Row="0" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
|
<controls:ToggleSwitch Grid.Row="0" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125"
|
||||||
IsChecked="{Binding Path=Enabled, Mode=OneWay}"
|
IsChecked="{Binding Path=Enabled, Mode=TwoWay}" />
|
||||||
cal:Message.Attach="[Event Unchecked] = [Action ToggleEnabled]; [Event Checked] = [Action ToggleEnabled]" />
|
|
||||||
|
|
||||||
<!-- Startup with Windows -->
|
<!-- Startup with Windows -->
|
||||||
<Label Grid.Row="1" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
<Label Grid.Row="1" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
@ -42,38 +43,52 @@
|
|||||||
IsChecked="{Binding Path=GeneralSettings.Autorun, Mode=TwoWay}"
|
IsChecked="{Binding Path=GeneralSettings.Autorun, Mode=TwoWay}"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125" />
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125" />
|
||||||
|
|
||||||
<!-- Keyboard selection -->
|
<!-- Show on startup -->
|
||||||
<Label Grid.Row="2" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
<Label Grid.Row="2" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
|
Content="Show on startup:" />
|
||||||
|
<controls:ToggleSwitch Grid.Row="2" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
|
||||||
|
IsChecked="{Binding Path=GeneralSettings.ShowOnStartup, Mode=TwoWay}"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125" />
|
||||||
|
|
||||||
|
<!-- Keyboard selection -->
|
||||||
|
<Label Grid.Row="3" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
Content="Keyboard:" />
|
Content="Keyboard:" />
|
||||||
<ComboBox Grid.Row="2" Grid.Column="1" x:Name="KeyboardProviders" Margin="10" VerticalAlignment="Center"
|
<ComboBox Grid.Row="3" Grid.Column="1" x:Name="KeyboardProviders" Margin="10" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Width="140" />
|
Width="140" />
|
||||||
<!-- TODO: Ugly -->
|
<!-- TODO: Ugly -->
|
||||||
|
|
||||||
<!-- Gamestate port -->
|
<!-- Gamestate port -->
|
||||||
<Label Grid.Row="3" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
<Label Grid.Row="4" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
Content="Gamestate server port:" />
|
Content="Gamestate server port:" />
|
||||||
<controls:NumericUpDown Grid.Row="3" Grid.Column="1" Margin="10" VerticalAlignment="Center"
|
<controls:NumericUpDown Grid.Row="4" Grid.Column="1" Margin="10" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Right" Width="120"
|
HorizontalAlignment="Right" Width="120"
|
||||||
Value="{Binding Path=GeneralSettings.GamestatePort, Mode=TwoWay}" />
|
Value="{Binding Path=GeneralSettings.GamestatePort, Mode=TwoWay}" />
|
||||||
|
|
||||||
|
<!-- Updates check -->
|
||||||
|
<Label Grid.Row="5" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
|
Content="Check for updates:" />
|
||||||
|
<controls:ToggleSwitch Grid.Row="5" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125"
|
||||||
|
IsChecked="{Binding Path=GeneralSettings.CheckForUpdates, Mode=TwoWay}" />
|
||||||
|
|
||||||
<!-- Update pointers -->
|
<!-- Update pointers -->
|
||||||
<Label Grid.Row="4" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
<Label Grid.Row="6" Grid.Column="0" Margin="5" VerticalAlignment="Center" HorizontalAlignment="Left"
|
||||||
Content="Download pointers:" />
|
Content="Download pointers:" />
|
||||||
<controls:ToggleSwitch Grid.Row="4" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
|
<controls:ToggleSwitch Grid.Row="6" Grid.Column="1" Margin="5" OnLabel="Yes" OffLabel="No"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="125"
|
||||||
IsChecked="{Binding Path=GeneralSettings.EnablePointersUpdate, Mode=TwoWay}" />
|
IsChecked="{Binding Path=GeneralSettings.EnablePointersUpdate, Mode=TwoWay}" />
|
||||||
|
|
||||||
<!-- Buttons -->
|
<!-- Buttons -->
|
||||||
<Button Grid.Row="5" Grid.Column="0" Margin="10" x:Name="ResetSettings" Content="Reset settings"
|
<Button Grid.Row="7" Grid.Column="0" Margin="10" x:Name="ResetSettings" Content="Reset settings"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Left" Width="120"
|
VerticalAlignment="Center" HorizontalAlignment="Left" Width="120"
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
<Button Grid.Row="5" Grid.Column="1" Margin="10" x:Name="SaveSettings" Content="Save changes"
|
<Button Grid.Row="7" Grid.Column="1" Margin="10" x:Name="SaveSettings" Content="Save changes"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Right" Width="120"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="120"
|
||||||
Style="{DynamicResource SquareButtonStyle}" />
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
|
|
||||||
<!-- Version -->
|
<!-- Version -->
|
||||||
<Grid Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="10" VerticalAlignment="Bottom">
|
<Grid Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="10" VerticalAlignment="Bottom">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
@ -82,11 +97,14 @@
|
|||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="Artemis 1.0.0" VerticalAlignment="Center"
|
<TextBlock Grid.Row="0" Grid.ColumnSpan="2" x:Name="ActiveEffectName" />
|
||||||
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="Artemis 1.0.2" VerticalAlignment="Center"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
<Button Grid.Row="0" Grid.Column="1" Focusable="False" Style="{StaticResource AccentedSquareButtonStyle}"
|
<Button Grid.Row="1" Grid.Column="1" Focusable="False"
|
||||||
|
Style="{StaticResource AccentedSquareButtonStyle}"
|
||||||
cal:Message.Attach="[Action NavigateTo('https://github.com/SpoinkyNL/Artemis')]"
|
cal:Message.Attach="[Action NavigateTo('https://github.com/SpoinkyNL/Artemis')]"
|
||||||
Content="View on GitHub" Margin="5,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
Content="View on GitHub" Margin="5,0,0,0" VerticalAlignment="Center"
|
||||||
|
HorizontalAlignment="Right" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@ -5,10 +5,12 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
|
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
|
||||||
xmlns:cal="http://www.caliburnproject.org"
|
xmlns:cal="http://www.caliburnproject.org"
|
||||||
|
xmlns:dialogs="clr-namespace:MahApps.Metro.Controls.Dialogs;assembly=MahApps.Metro"
|
||||||
|
dialogs:DialogParticipation.Register="{Binding RelativeSource={RelativeSource Self}, Path=DataContext}"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Artemis" Height="670" Width="690"
|
Title="Artemis" Height="670" Width="690"
|
||||||
MinWidth="500" MinHeight="400"
|
MinWidth="500" MinHeight="400"
|
||||||
GlowBrush="{DynamicResource AccentColorBrush}" Icon="/Artemis;component/logo.ico">
|
GlowBrush="{DynamicResource AccentColorBrush}" Icon="../logo.ico">
|
||||||
<!-- Bit of extra code to use a different icon than in the taskbar -->
|
<!-- Bit of extra code to use a different icon than in the taskbar -->
|
||||||
<Controls:MetroWindow.IconTemplate>
|
<Controls:MetroWindow.IconTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@ -62,7 +64,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}" />
|
||||||
|
|||||||
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<!-- the application main system tray icon -->
|
<!-- the application main system tray icon -->
|
||||||
<tb:TaskbarIcon x:Key="SystemTrayIcon"
|
<tb:TaskbarIcon x:Key="SystemTrayIcon"
|
||||||
IconSource="../logo.ico"
|
IconSource="{Binding Path=ActiveIcon, Mode=OneWay}"
|
||||||
ToolTipText="Artemis"
|
ToolTipText="Artemis"
|
||||||
cal:Message.Attach="[Event TrayMouseDoubleClick] = [Action ShowWindow]"
|
cal:Message.Attach="[Event TrayMouseDoubleClick] = [Action ShowWindow]"
|
||||||
ContextMenu="{StaticResource MainSysTrayMenu}" />
|
ContextMenu="{StaticResource MainSysTrayMenu}" />
|
||||||
|
|||||||
@ -28,8 +28,8 @@
|
|||||||
</Label>
|
</Label>
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
|
||||||
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
|
TextWrapping="Wrap" HorizontalAlignment="Left"
|
||||||
Foreground="#070707" MaxWidth="520" TextAlignment="Justify">
|
MaxWidth="520" TextAlignment="Justify">
|
||||||
Hello, <LineBreak /><LineBreak />
|
Hello, <LineBreak /><LineBreak />
|
||||||
Thanks a bunch for downloading this application. You're going to enjoy this! :)<LineBreak />
|
Thanks a bunch for downloading this application. You're going to enjoy this! :)<LineBreak />
|
||||||
<LineBreak />
|
<LineBreak />
|
||||||
|
|||||||
@ -1,19 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Autofac" version="4.0.0-rc1-177" targetFramework="net452" />
|
<package id="Autofac" version="4.0.0-rc1-177" targetFramework="net452" />
|
||||||
<package id="Caliburn.Micro" version="2.0.2" targetFramework="net452" />
|
<package id="Caliburn.Micro" version="2.0.2" targetFramework="net452" />
|
||||||
<package id="Caliburn.Micro.AutofacBootstrap" version="2.0.9-beta" targetFramework="net452" />
|
<package id="Caliburn.Micro.AutofacBootstrap" version="2.0.9-beta" targetFramework="net452" />
|
||||||
<package id="Caliburn.Micro.Core" version="2.0.2" targetFramework="net452" />
|
<package id="Caliburn.Micro.Core" version="2.0.2" targetFramework="net452" />
|
||||||
<package id="Colore" version="4.0.0" targetFramework="net452" />
|
<package id="Colore" version="4.0.0" targetFramework="net452" />
|
||||||
<package id="CUE.NET" version="1.0.2" targetFramework="net452" />
|
<package id="CUE.NET" version="1.0.2.1" targetFramework="net452" />
|
||||||
<package id="Extended.Wpf.Toolkit" version="2.6" targetFramework="net452" />
|
<package id="Extended.Wpf.Toolkit" version="2.6" targetFramework="net452" />
|
||||||
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.5" targetFramework="net452" />
|
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.5" targetFramework="net452" />
|
||||||
<package id="log4net" version="2.0.5" targetFramework="net452" />
|
<package id="log4net" version="2.0.5" targetFramework="net452" />
|
||||||
<package id="MahApps.Metro" version="1.2.4.0" targetFramework="net452" />
|
<package id="MahApps.Metro" version="1.2.4.0" targetFramework="net452" />
|
||||||
<package id="MahApps.Metro.Resources" version="0.4.0.0" targetFramework="net452" />
|
<package id="MahApps.Metro.Resources" version="0.4.0.0" targetFramework="net452" />
|
||||||
<package id="MouseKeyHook" version="5.4.0" targetFramework="net452" />
|
|
||||||
<package id="NAudio" version="1.7.3" targetFramework="net452" />
|
<package id="NAudio" version="1.7.3" targetFramework="net452" />
|
||||||
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net452" />
|
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net452" />
|
||||||
|
<package id="VirtualInput" version="1.0.1" targetFramework="net452" />
|
||||||
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
||||||
</packages>
|
</packages>
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,31 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<!-- Select a Product Configuration -->
|
|
||||||
<InstallShieldProductConfiguration>Express</InstallShieldProductConfiguration>
|
|
||||||
<!-- Select a Visual Studio Configuration / InstallShield Release -->
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<InstallShieldRelease>$(Configuration)</InstallShieldRelease>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<!-- The InstallShieldProject item selects the project to build -->
|
|
||||||
<InstallShieldProject Include="$(MSBuildProjectDirectory)\$(MSBuildProjectName).isl"/>
|
|
||||||
<!-- The InstallShieldReleaseFlags sets Release Flags -->
|
|
||||||
<!--<InstallShieldReleaseFlags Include=""/>-->
|
|
||||||
<!-- The InstallShieldMergeModulePath specifies what directories are
|
|
||||||
searched for Merge Modules -->
|
|
||||||
<!--<InstallShieldMergeModulePath Include=""/>-->
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<!-- The ProjectReference items refer to any Visual Studio solutions you want to automatically probe for Project Output Groups. -->
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<!-- The TaggedOutputs items allow you to explicitly add extra files to output groups. Each item must include both Name and OutputGroup, as well as TargetPath metadata values. -->
|
|
||||||
<!--<TaggedOutputs Include="C:\My Test Exe.exe">
|
|
||||||
<Name>My Test Project</Name>
|
|
||||||
<OutputGroup>Primary output</OutputGroup>
|
|
||||||
<TargetPath>My Test Exe.exe</TargetPath>
|
|
||||||
</TaggedOutputs> -->
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildExtensionsPath32)\InstallShield\2015Limited\InstallShield.targets"/>
|
|
||||||
</Project>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user