mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-11 15:59:08 +01:00
Merge branch 'jay' of https://github.com/Ryochan7/DS4Windows into jay
This commit is contained in:
commit
853b1ac650
@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
namespace DS4Windows
|
||||
{
|
||||
[SuppressUnmanagedCodeSecurity]
|
||||
class InputMethods
|
||||
{
|
||||
public static void MoveCursorBy(int x, int y)
|
||||
|
@ -2490,7 +2490,7 @@ namespace DS4Windows
|
||||
if (now >= oldnow + TimeSpan.FromMilliseconds(10) && !pressagain)
|
||||
{
|
||||
oldnow = now;
|
||||
InputMethods.MouseWheel((int)(getByteMapping(device, control, cState, eState, tp) / 51f * (down ? -1 : 1)), 0);
|
||||
InputMethods.MouseWheel((int)(getByteMapping(device, control, cState, eState, tp) / 1.5f * (down ? -1 : 1)), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,10 +63,10 @@ namespace DS4Windows
|
||||
{ "DS4Windows v" + FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion,
|
||||
string.Empty, string.Empty, string.Empty, string.Empty };
|
||||
|
||||
private const string UPDATER_VERSION = "1.2.8.0";
|
||||
private const string UPDATER_VERSION = "1.3.0";
|
||||
private const int WM_QUERYENDSESSION = 0x11;
|
||||
private const int WM_CLOSE = 0x10;
|
||||
internal string updaterExe = Environment.Is64BitProcess ? "DS4Updater.exe" : "DS4Updater_x86.exe";
|
||||
internal string updaterExe = Environment.Is64BitProcess ? "DS4Updater_x64.exe" : "DS4Updater_x86.exe";
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern IntPtr GetForegroundWindow();
|
||||
@ -183,6 +183,7 @@ namespace DS4Windows
|
||||
cBUseWhiteIcon.Checked = UseWhiteIcon;
|
||||
Icon = Properties.Resources.DS4W;
|
||||
notifyIcon1.Icon = UseWhiteIcon ? Properties.Resources.DS4W___White : Properties.Resources.DS4W;
|
||||
populateNotifyText();
|
||||
foreach (ToolStripMenuItem t in shortcuts)
|
||||
t.DropDownItemClicked += Profile_Changed_Menu;
|
||||
|
||||
@ -287,16 +288,6 @@ namespace DS4Windows
|
||||
nUDUpdateTime.Value = checkwhen;
|
||||
}
|
||||
|
||||
Uri url = new Uri("http://23.239.26.40/ds4windows/files/builds/newest.txt"); // Sorry other devs, gonna have to find your own server
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
if (File.Exists(exepath + "\\Updater.exe"))
|
||||
{
|
||||
Thread.Sleep(2000);
|
||||
@ -401,6 +392,19 @@ namespace DS4Windows
|
||||
|
||||
TaskRunner.Delay(50).ContinueWith((t) =>
|
||||
{
|
||||
if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen))
|
||||
{
|
||||
this.BeginInvoke((System.Action)(() =>
|
||||
{
|
||||
// Sorry other devs, gonna have to find your own server
|
||||
Uri url = new Uri("https://raw.githubusercontent.com/Ryochan7/DS4Windows/jay/DS4Windows/newest.txt");
|
||||
WebClient wc = new WebClient();
|
||||
wc.DownloadFileAsync(url, appdatapath + "\\version.txt");
|
||||
wc.DownloadFileCompleted += (sender, e) => { TaskRunner.Run(() => Check_Version(sender, e)); };
|
||||
LastChecked = DateTime.Now;
|
||||
}));
|
||||
}
|
||||
|
||||
UpdateTheUpdater();
|
||||
});
|
||||
|
||||
@ -767,16 +771,16 @@ namespace DS4Windows
|
||||
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") != 0)))
|
||||
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) != 0)))
|
||||
{
|
||||
Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}");
|
||||
Uri url2 = new Uri($"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}");
|
||||
WebClient wc2 = new WebClient();
|
||||
if (appdatapath == exepath)
|
||||
wc2.DownloadFile(url2, exepath + "\\DS4Updater.exe");
|
||||
else
|
||||
{
|
||||
this.BeginInvoke((System.Action)(() => MessageBox.Show(Properties.Resources.PleaseDownloadUpdater)));
|
||||
Process.Start($"http://23.239.26.40/ds4windows/files/{updaterExe}");
|
||||
Process.Start($"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1163,7 +1167,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
string temp = Program.rootHub.getShortDS4ControllerInfo(i);
|
||||
if (temp != Properties.Resources.NoneText)
|
||||
{
|
||||
notifyText[i + 1] = (i + 1) + ": " + temp; // Carefully stay under the 63 character limit.
|
||||
notifyText[i + 1] = (i + 1) + ": " + temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1179,7 +1183,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
string temp = Program.rootHub.getShortDS4ControllerInfo(index);
|
||||
if (temp != Properties.Resources.NoneText)
|
||||
{
|
||||
notifyText[index + 1] = (index + 1) + ": " + temp; // Carefully stay under the 63 character limit.
|
||||
notifyText[index + 1] = (index + 1) + ": " + temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1195,14 +1199,11 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
string temp = notifyText[i];
|
||||
if (!string.IsNullOrEmpty(temp))
|
||||
{
|
||||
tooltip += "\n" + notifyText[i]; // Carefully stay under the 63 character limit.
|
||||
tooltip += "\n" + notifyText[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (tooltip.Length > 63)
|
||||
notifyIcon1.Text = tooltip.Substring(0, 63);
|
||||
else
|
||||
notifyIcon1.Text = tooltip;
|
||||
notifyIcon1.Text = tooltip.Length > 63 ? tooltip.Substring(0, 63) : tooltip; // Carefully stay under the 63 character limit.
|
||||
}
|
||||
|
||||
protected void DeviceSerialChanged(object sender, SerialChangeArgs args)
|
||||
@ -2060,7 +2061,7 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
private void lLBUpdate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
// Sorry other devs, gonna have to find your own server
|
||||
Uri url = new Uri("http://23.239.26.40/ds4windows/files/builds/newest.txt");
|
||||
Uri url = new Uri("https://raw.githubusercontent.com/Ryochan7/DS4Windows/jay/DS4Windows/newest.txt");
|
||||
WebClient wct = new WebClient();
|
||||
wct.DownloadFileAsync(url, appdatapath + "\\version.txt");
|
||||
wct.DownloadFileCompleted += (sender2, e2) => TaskRunner.Run(() => wct_DownloadFileCompleted(sender2, e2));
|
||||
@ -2088,14 +2089,14 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
||||
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
|
||||
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) != 0)))
|
||||
{
|
||||
Uri url2 = new Uri($"http://23.239.26.40/ds4windows/files/{updaterExe}");
|
||||
Uri url2 = new Uri($"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}");
|
||||
WebClient wc2 = new WebClient();
|
||||
if (appdatapath == exepath)
|
||||
wc2.DownloadFile(url2, exepath + "\\DS4Updater.exe");
|
||||
else
|
||||
{
|
||||
this.BeginInvoke((System.Action)(() => MessageBox.Show(Properties.Resources.PleaseDownloadUpdater)));
|
||||
Process.Start($"http://23.239.26.40/ds4windows/files/{updaterExe}");
|
||||
Process.Start($"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -418,7 +418,7 @@
|
||||
<value>System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="notifyIcon1.Text" xml:space="preserve">
|
||||
<value>DS4 Xinput Tool</value>
|
||||
<value>DS4Windows</value>
|
||||
</data>
|
||||
<data name="notifyIcon1.Visible" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
|
@ -43,7 +43,7 @@ namespace DS4Windows
|
||||
WebClient wb = new WebClient();
|
||||
if (!driverinstalling)
|
||||
{
|
||||
wb.DownloadFileAsync(new Uri("http://23.239.26.40/ds4windows/files/Virtual Bus Driver.zip"), exepath + "\\VBus.zip");
|
||||
wb.DownloadFileAsync(new Uri("https://github.com/Ryochan7/DS4Windows/raw/jay/extras/Virtual Bus Driver.zip"), exepath + "\\VBus.zip");
|
||||
wb.DownloadProgressChanged += wb_DownloadProgressChanged;
|
||||
wb.DownloadFileCompleted += wb_DownloadFileCompleted;
|
||||
driverinstalling = true;
|
||||
|
@ -42,7 +42,8 @@ namespace DS4Windows
|
||||
new VidPidInfo(NACON_VID, 0x0D01),
|
||||
new VidPidInfo(NACON_VID, 0x0D02),
|
||||
new VidPidInfo(HORI_VID, 0x00EE), // Hori PS4 Mini Wired Gamepad
|
||||
new VidPidInfo(0x7545, 0x0104)
|
||||
new VidPidInfo(0x7545, 0x0104),
|
||||
new VidPidInfo(0x2E95, 0x7725), // Scuf Vantage gamepad
|
||||
};
|
||||
|
||||
private static string devicePathToInstanceId(string devicePath)
|
||||
|
@ -82,7 +82,7 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<DefineConstants>WIN64</DefineConstants>
|
||||
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
||||
<LangVersion>6</LangVersion>
|
||||
<LangVersion>7.2</LangVersion>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
@ -107,7 +107,7 @@
|
||||
<ErrorReport>none</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>true</Prefer32Bit>
|
||||
<LangVersion>6</LangVersion>
|
||||
<LangVersion>7.2</LangVersion>
|
||||
<GenerateSerializationAssemblies>On</GenerateSerializationAssemblies>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<WarningLevel>1</WarningLevel>
|
||||
@ -1178,7 +1178,19 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="PostBuildMacros">
|
||||
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
|
||||
<Output TaskParameter="Assemblies" ItemName="Targets" />
|
||||
</GetAssemblyIdentity>
|
||||
<ItemGroup>
|
||||
<VersionNumber Include="$([System.Text.RegularExpressions.Regex]::Replace("%(Targets.Version)", "^(.+?)(\.0+)$", "$1"))" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<PostBuildEventDependsOn>
|
||||
$(PostBuildEventDependsOn);
|
||||
PostBuildMacros;
|
||||
</PostBuildEventDependsOn>
|
||||
<PostBuildEvent>rem Copy compiled l18n assemblies to alt folder
|
||||
GOTO END
|
||||
if not exist $(TargetDir)Lang mkdir $(TargetDir)Lang
|
||||
@ -1190,7 +1202,10 @@ for %25%25l in (%25langs%25) do (
|
||||
xcopy $(TargetDir)%25%25l $(TargetDir)Lang\%25%25l\ /s /y
|
||||
)
|
||||
|
||||
:END</PostBuildEvent>
|
||||
echo @(VersionNumber)> $(ProjectDir)\newest.txt
|
||||
|
||||
:END
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- 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.
|
||||
|
@ -11,7 +11,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("DS4Windows")]
|
||||
[assembly: AssemblyCopyright("Copyright © Scarlet.Crush Productions 2012, 2013; InhexSTER, HecticSeptic, electrobrains 2013, 2014; Jays2Kings 2013, 2014, 2015, 2016; Ryochan7 2017, 2018")]
|
||||
[assembly: AssemblyCopyright("Copyright © Scarlet.Crush Productions 2012, 2013; InhexSTER, HecticSeptic, electrobrains 2013, 2014; Jays2Kings 2013, 2014, 2015, 2016; Ryochan7 2017, 2018, 2019")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@ -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.6.0")]
|
||||
[assembly: AssemblyFileVersion("1.6.0")]
|
||||
[assembly: AssemblyVersion("1.6.2")]
|
||||
[assembly: AssemblyFileVersion("1.6.2")]
|
||||
[assembly: NeutralResourcesLanguage("en")]
|
||||
|
||||
|
1
DS4Windows/newest.txt
Normal file
1
DS4Windows/newest.txt
Normal file
@ -0,0 +1 @@
|
||||
1.6.2
|
BIN
extras/Virtual Bus Driver.zip
Normal file
BIN
extras/Virtual Bus Driver.zip
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user