merge master branch

This commit is contained in:
mika-n 2018-12-23 13:14:22 +02:00
commit 4678e14408
9 changed files with 59 additions and 74 deletions

View File

@ -147,7 +147,7 @@ namespace DS4Windows
Monitor.Wait(busThrLck);
}
});
tempThread.Priority = ThreadPriority.AboveNormal;
tempThread.Priority = ThreadPriority.Normal;
tempThread.IsBackground = true;
tempThread.Start();
//while (_udpServer == null)

View File

@ -781,28 +781,28 @@ namespace DS4Windows
if (absX <= 0.4)
{
outputX = 0.49 * absX;
outputX = 0.544 * absX;
}
else if (absX <= 0.75)
{
outputX = absX - 0.204;
outputX = absX - 0.1824;
}
else if (absX > 0.75)
{
outputX = (absX * 1.816) - 0.816;
outputX = (absX * 1.7296) - 0.7296;
}
if (absY <= 0.4)
{
outputY = 0.49 * absY;
outputY = 0.544 * absY;
}
else if (absY <= 0.75)
{
outputY = absY - 0.204;
outputY = absY - 0.1824;
}
else if (absY > 0.75)
{
outputY = (absY * 1.816) - 0.816;
outputY = (absY * 1.7296) - 0.7296;
}
dState.LX = (byte)(outputX * signX * 127.5 + 127.5);
@ -841,28 +841,28 @@ namespace DS4Windows
if (absX <= 0.4)
{
outputX = 0.49 * absX;
outputX = 0.544 * absX;
}
else if (absX <= 0.75)
{
outputX = absX - 0.204;
outputX = absX - 0.1824;
}
else if (absX > 0.75)
{
outputX = (absX * 1.816) - 0.816;
outputX = (absX * 1.7296) - 0.7296;
}
if (absY <= 0.4)
{
outputY = 0.49 * absY;
outputY = 0.544 * absY;
}
else if (absY <= 0.75)
{
outputY = absY - 0.204;
outputY = absY - 0.1824;
}
else if (absY > 0.75)
{
outputY = (absY * 1.816) - 0.816;
outputY = (absY * 1.7296) - 0.7296;
}
dState.RX = (byte)(outputX * signX * 127.5 + 127.5);

View File

@ -37,7 +37,6 @@ namespace DS4Windows
private ToolStripMenuItem[] shortcuts;
private ToolStripMenuItem[] disconnectShortcuts;
protected CheckBox[] linkedProfileCB;
WebClient wc = new WebClient();
NonFormTimer hotkeysTimer = new NonFormTimer();
NonFormTimer autoProfilesTimer = new NonFormTimer();
string tempProfileProgram = string.Empty;
@ -151,11 +150,6 @@ namespace DS4Windows
blankControllerTab();
Program.rootHub.Debug += On_Debug;
AppLogger.GuiLog += On_Debug;
AppLogger.TrayIconLog += ShowNotification;
Directory.CreateDirectory(appdatapath);
if (!Save()) //if can't write to file
{
@ -254,10 +248,9 @@ namespace DS4Windows
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version = fvi.FileVersion;
AppLogger.LogToGui("DS4Windows version " + version, false);
LogDebug(DateTime.Now, "DS4Windows version " + version, false);
LoadP();
LoadLinkedProfiles();
Global.BatteryStatusChange += BatteryStatusUpdate;
Global.ControllerRemoved += ControllerRemovedChange;
@ -298,6 +291,7 @@ namespace DS4Windows
if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen))
{
WebClient wc = new WebClient();
wc.DownloadFileAsync(url, appdatapath + "\\version.txt");
wc.DownloadFileCompleted += (sender, e) => { TaskRunner.Run(() => Check_Version(sender, e)); };
LastChecked = DateTime.Now;
@ -351,8 +345,6 @@ namespace DS4Windows
}
}
TaskRunner.Run(() => { UpdateTheUpdater(); });
StartWindowsCheckBox.CheckedChanged += new EventHandler(StartWindowsCheckBox_CheckedChanged);
new ToolTip().SetToolTip(StartWindowsCheckBox, Properties.Resources.RunAtStartup);
@ -398,9 +390,26 @@ namespace DS4Windows
instance = this;
this.Resize += Form_Resize;
this.LocationChanged += TrackLocationChanged;
if (!(StartMinimized || mini))
Form_Resize(null, null);
Program.rootHub.Debug += On_Debug;
AppLogger.GuiLog += On_Debug;
AppLogger.TrayIconLog += ShowNotification;
LoadLinkedProfiles();
TaskRunner.Delay(50).ContinueWith((t) =>
{
UpdateTheUpdater();
});
if (btnStartStop.Enabled && start)
TaskRunner.Delay(50).ContinueWith((t) => this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked())));
{
TaskRunner.Delay(50).ContinueWith((t) => {
this.BeginInvoke((System.Action)(() => BtnStartStop_Clicked()));
});
}
}
private void populateHoverTextDict()
@ -548,6 +557,8 @@ namespace DS4Windows
void Hotkeys(object sender, EventArgs e)
{
hotkeysTimer.Stop();
if (SwipeProfiles)
{
for (int i = 0; i < 4; i++)
@ -599,6 +610,8 @@ namespace DS4Windows
private void CheckAutoProfiles(object sender, EventArgs e)
{
autoProfilesTimer.Stop();
//Check for process for auto profiles
if (string.IsNullOrEmpty(tempProfileProgram))
{
@ -747,14 +760,14 @@ namespace DS4Windows
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version = fvi.FileVersion;
string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim();
if (version.Replace(',', '.').CompareTo(newversion) == -1)
if (version.Replace(',', '.').CompareTo(newversion) != 0)
{
if ((DialogResult)this.Invoke(new Func<DialogResult>(() => {
return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes)
{
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo("1.1.0.0") == -1)))
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo("1.1.0.0") != 0)))
{
Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}");
WebClient wc2 = new WebClient();
@ -2064,7 +2077,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version2 = fvi.FileVersion;
string newversion2 = File.ReadAllText(appdatapath + "\\version.txt").Trim();
if (version2.Replace(',', '.').CompareTo(newversion2) == -1)
if (version2.Replace(',', '.').CompareTo(newversion2) != 0)
{
if ((DialogResult)this.Invoke(new Func<DialogResult>(() =>
{
@ -2073,7 +2086,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
})) == DialogResult.Yes)
{
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) == -1)))
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) != 0)))
{
Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}");
WebClient wc2 = new WebClient();

View File

@ -1072,20 +1072,11 @@
<EmbeddedResource Include="Properties\Resources.zh-Hant.resx" />
<None Include="app.manifest" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />

View File

@ -33,7 +33,7 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.18")]
[assembly: AssemblyFileVersion("1.5.18")]
[assembly: AssemblyVersion("1.6.0")]
[assembly: AssemblyFileVersion("1.6.0")]
[assembly: NeutralResourcesLanguage("en")]

View File

@ -1,26 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DS4Windows.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -6,7 +6,7 @@
// The PropertyChanged event is raised after a setting's value is changed.
// The SettingsLoaded event is raised after the setting values are loaded.
// The SettingsSaving event is raised before the setting values are saved.
internal sealed partial class Settings {
public sealed partial class Settings {
public Settings() {
// // To add event handlers for saving and changing settings, uncomment the lines below:

View File

@ -27,6 +27,7 @@ you've used a 360 controller before)
- Bluetooth 2.1+ (via an
[adapter like this](https://www.newegg.com/Product/Product.aspx?Item=N82E16833166126)
or built in pc). Toshiba's adapters currently do not work.
- Disable Steam Controller Mapping support in Steam
## Device Detection Issue
@ -50,6 +51,19 @@ DualShock 4 device. Right click the device item and select "Enable device"
from the menu. That will re-enable the device and be seen by applications
again.
## Disable Steam Controller Mapping Support
With recent updates to the Steam client at the time writing this (2018-12-13),
Steam has enabled Xbox Configuration Support in the Steam client by default.
What this means is that Steam will automatically map a detected Xbox 360
controller to KB+M bindings initially (Desktop Mode) before launching Steam
Big Picture Mode or launching a game. This presents a problem for DS4Windows
since the created virtual Xbox 360 controller will be mapped to KB+M actions
for desktop mode and games launched outside of the Steam client. In order to
use DS4Windows properly, you have to open Steam Big Picture Mode, navigate to
Settings > Controller> Controller Settings and uncheck **Xbox Configuration
Support** along with **PlayStation Configuration Support**.
## Pull Requests
Pull requests for DS4Windows are welcome. Before making a pull request, please