Merge branch 'jay' of https://github.com/Ryochan7/DS4Windows into jay-bezierCurveOutput

This commit is contained in:
mika-n 2019-07-14 22:31:53 +03:00
commit 7015a4d1b9
2 changed files with 16 additions and 9 deletions

View File

@ -2435,7 +2435,7 @@ namespace DS4Windows
if (now >= oldnow + TimeSpan.FromMilliseconds(10) && !pressagain) if (now >= oldnow + TimeSpan.FromMilliseconds(10) && !pressagain)
{ {
oldnow = now; oldnow = now;
InputMethods.MouseWheel((int)(getByteMapping(device, control, cState, eState, tp) / 1.5f * (down ? -1 : 1)), 0); InputMethods.MouseWheel((int)(getByteMapping(device, control, cState, eState, tp) / 8.0f * (down ? -1 : 1)), 0);
} }
} }

View File

@ -802,12 +802,14 @@ namespace DS4Windows.Forms
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
string version = fvi.FileVersion; string version = fvi.FileVersion;
string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim(); string newversion = File.ReadAllText(appdatapath + "\\version.txt").Trim();
bool launchUpdate = false;
if (!string.IsNullOrWhiteSpace(newversion) && version.Replace(',', '.').CompareTo(newversion) != 0) if (!string.IsNullOrWhiteSpace(newversion) && version.Replace(',', '.').CompareTo(newversion) != 0)
{ {
if ((DialogResult)this.Invoke(new Func<DialogResult>(() => { if ((DialogResult)this.Invoke(new Func<DialogResult>(() => {
return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion), return MessageBox.Show(Properties.Resources.DownloadVersion.Replace("*number*", newversion),
Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes) Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question); })) == DialogResult.Yes)
{ {
launchUpdate = true;
if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe") if (!File.Exists(exepath + "\\DS4Updater.exe") || (File.Exists(exepath + "\\DS4Updater.exe")
&& (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) != 0))) && (FileVersionInfo.GetVersionInfo(exepath + "\\DS4Updater.exe").FileVersion.CompareTo(UPDATER_VERSION) != 0)))
{ {
@ -816,6 +818,17 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
if (appdatapath == exepath) if (appdatapath == exepath)
{ {
wc2.DownloadFile(url2, exepath + "\\DS4Updater.exe"); wc2.DownloadFile(url2, exepath + "\\DS4Updater.exe");
}
else
{
this.BeginInvoke((System.Action)(() => MessageBox.Show(Properties.Resources.PleaseDownloadUpdater)));
Process.Start($"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}");
launchUpdate = false;
}
}
if (launchUpdate)
{
Process p = new Process(); Process p = new Process();
p.StartInfo.FileName = exepath + "\\DS4Updater.exe"; p.StartInfo.FileName = exepath + "\\DS4Updater.exe";
p.StartInfo.Arguments = "-autolaunch"; p.StartInfo.Arguments = "-autolaunch";
@ -825,12 +838,6 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
try { p.Start(); Close(); } try { p.Start(); Close(); }
catch { } catch { }
} }
else
{
this.BeginInvoke((System.Action)(() => MessageBox.Show(Properties.Resources.PleaseDownloadUpdater)));
Process.Start($"https://github.com/Ryochan7/DS4Updater/releases/download/v{UPDATER_VERSION}/{updaterExe}");
}
}
} }
else else
File.Delete(appdatapath + "\\version.txt"); File.Delete(appdatapath + "\\version.txt");