From d1361a7460981cc746d35c3aa91d9fd47c4ab22f Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sun, 22 Dec 2019 15:10:25 -0600 Subject: [PATCH 01/10] Fixed tray middle click close when Close Minimizes option is enabled --- DS4Windows/DS4Forms/MainWindow.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DS4Windows/DS4Forms/MainWindow.xaml.cs b/DS4Windows/DS4Forms/MainWindow.xaml.cs index be6db00..826985f 100644 --- a/DS4Windows/DS4Forms/MainWindow.xaml.cs +++ b/DS4Windows/DS4Forms/MainWindow.xaml.cs @@ -1213,6 +1213,7 @@ Properties.Resources.DS4Update, MessageBoxButton.YesNo, MessageBoxImage.Question private void NotifyIcon_TrayMiddleMouseDown(object sender, RoutedEventArgs e) { + contextclose = true; Close(); } From aa7bf76d36a4b1bbf07b3ad403eb0bf4688aa7c5 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Sun, 22 Dec 2019 16:30:13 -0600 Subject: [PATCH 02/10] Allow Rainbow mode to change lightbar brush --- DS4Windows/DS4Forms/ProfileEditor.xaml | 2 +- .../ViewModels/ProfileSettingsViewModel.cs | 44 ++++++++++++++++++ DS4Windows/DS4WinWPF.csproj | 2 + DS4Windows/Resources/rainbowCCrop.png | Bin 0 -> 2634 bytes 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 DS4Windows/Resources/rainbowCCrop.png diff --git a/DS4Windows/DS4Forms/ProfileEditor.xaml b/DS4Windows/DS4Forms/ProfileEditor.xaml index 45ee8ad..b4d2f48 100644 --- a/DS4Windows/DS4Forms/ProfileEditor.xaml +++ b/DS4Windows/DS4Forms/ProfileEditor.xaml @@ -100,7 +100,7 @@ - diff --git a/DS4Windows/DS4Forms/ViewModels/ProfileSettingsViewModel.cs b/DS4Windows/DS4Forms/ViewModels/ProfileSettingsViewModel.cs index 9587918..5e2e153 100644 --- a/DS4Windows/DS4Forms/ViewModels/ProfileSettingsViewModel.cs +++ b/DS4Windows/DS4Forms/ViewModels/ProfileSettingsViewModel.cs @@ -20,6 +20,36 @@ namespace DS4WinWPF.DS4Forms.ViewModels private int funcDevNum; public int FuncDevNum { get => funcDevNum; } + private ImageBrush lightbarImgBrush = new ImageBrush(); + private SolidColorBrush lightbarColBrush = new SolidColorBrush(); + + public System.Windows.Media.Brush LightbarBrush + { + get + { + System.Windows.Media.Brush tempBrush; + ref DS4Color color = ref Global.MainColor[device]; + if (!RainbowExists) + { + lightbarColBrush.Color = new System.Windows.Media.Color() + { + A = 255, + R = color.red, + G = color.green, + B = color.blue + }; + tempBrush = lightbarColBrush as System.Windows.Media.Brush; + } + else + { + tempBrush = lightbarImgBrush as System.Windows.Media.Brush; + } + + return tempBrush; + } + } + public event EventHandler LightbarBrushChanged; + public System.Windows.Media.Color MainColor { get @@ -1372,21 +1402,34 @@ namespace DS4WinWPF.DS4Forms.ViewModels Global.outDevTypeTemp[device] = OutContType.X360; tempBtPollRate = Global.BTPollRate[device]; + ImageSourceConverter sourceConverter = new ImageSourceConverter(); + ImageSource temp = sourceConverter. + ConvertFromString("pack://application:,,,/DS4Windows;component/Resources/rainbowCCrop.png") as ImageSource; + lightbarImgBrush.ImageSource = temp.Clone(); + MainColorChanged += ProfileSettingsViewModel_MainColorChanged; MainColorRChanged += (sender, args) => { MainColorRStringChanged?.Invoke(this, EventArgs.Empty); MainColorStringChanged?.Invoke(this, EventArgs.Empty); + LightbarBrushChanged?.Invoke(this, EventArgs.Empty); }; MainColorGChanged += (sender, args) => { MainColorGStringChanged?.Invoke(this, EventArgs.Empty); MainColorStringChanged?.Invoke(this, EventArgs.Empty); + LightbarBrushChanged?.Invoke(this, EventArgs.Empty); }; MainColorBChanged += (sender, args) => { MainColorBStringChanged?.Invoke(this, EventArgs.Empty); MainColorStringChanged?.Invoke(this, EventArgs.Empty); + LightbarBrushChanged?.Invoke(this, EventArgs.Empty); + }; + + RainbowChanged += (sender, args) => + { + LightbarBrushChanged?.Invoke(this, EventArgs.Empty); }; } @@ -1396,6 +1439,7 @@ namespace DS4WinWPF.DS4Forms.ViewModels MainColorRChanged?.Invoke(this, EventArgs.Empty); MainColorGChanged?.Invoke(this, EventArgs.Empty); MainColorBChanged?.Invoke(this, EventArgs.Empty); + LightbarBrushChanged?.Invoke(this, EventArgs.Empty); } public void UpdateFlashColor(System.Windows.Media.Color color) diff --git a/DS4Windows/DS4WinWPF.csproj b/DS4Windows/DS4WinWPF.csproj index 0501d8e..6843a66 100644 --- a/DS4Windows/DS4WinWPF.csproj +++ b/DS4Windows/DS4WinWPF.csproj @@ -410,6 +410,8 @@ PreserveNewest + + diff --git a/DS4Windows/Resources/rainbowCCrop.png b/DS4Windows/Resources/rainbowCCrop.png new file mode 100644 index 0000000000000000000000000000000000000000..38e581e31fd582b18fe2918010b1ed4da9c28175 GIT binary patch literal 2634 zcmV-Q3bpl#P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3yqvLh)Bg#UAjIRX+$g5$6$Vs0?Up9EL=*>CCT zju=xrQWXT_Z1|c%0F!9*NM|JB7Uz>zlZuNvimIV>#@3) z6^iOb)DfHRVbBl@%jtAeT!y#cvz@ErDzU`@%V!+1;~G?n;fe>!G^vr(I?q7^A!c4| zcrp)8r>rF7%Huef_eIVI4`(XyZ}1A+v&7F>=*(Nse1i&Ro`j}M7;M}A;}w2Y`6pL! zA6p{YVsbxPAuirrBaH3bzM~ZkA-{Z+Bk+A)_Qw~nfGQl6BXhw5TkMY^y3hw(>G+(` zPVjteAqqCH0U#0P76d~H4n(CSq!f+Wh@fMEK@E{}%G}`qiSR^_oKsQ`#)bFX=wo!+ zvas?lMs9);g56~B2D=Pqaqu70`xz%{yDW2y?7>Cewr#8HHZ&SOL$1up2L@`= z^P0X~4698uA|W`|p4zHVw43)SD=zMauo88s?`kjYW-T7pa;R0Nn#1wesEA*t(%a0#A1xf|T5${@Eh)5JJ);uhYhQ}@vYc@YEG%Yn z$6>U(?;vst6Am^ccxyYd1!>a4&k3w>#?rg(_Dl{bt4HtvwaOkw`+#9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(g~nToi-YJuK)whWU>-9ig>{S?%eYIC=`^WxMhZqcw(h;$W?)7U_JR1vF1UV<&79 zmv-+G@`s+$L)2%xiceDlwlHb$C@tp)NVGCR7zCo;6MXAG0#(hce6D@x!Jf s&t?Zyk*pP!Okt7i6i8(QR{xLi4+k3Y5zbZCxBvhE07*qoM6N<$f}k$%^Z)<= literal 0 HcmV?d00001 From c468514002b0fa8da07b48bf4f7b2b6ab463cb06 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Mon, 23 Dec 2019 21:49:05 -0600 Subject: [PATCH 03/10] Updated URL of Visual C++ Redis download --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93779cc..034cd2d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ website at [ds4windows.com](http://ds4windows.com). - Windows 7 SP1 or newer - [Microsoft .NET 4.6.2 or higher (needed to unzip the driver and for macros to work properly)](https://www.microsoft.com/en-us/download/details.aspx?id=53344) -- Visual C++ 2017 Redistributable. [x64](https://aka.ms/vs/15/release/vc_redist.x64.exe) or [x86](https://aka.ms/vs/15/release/vc_redist.x86.exe) +- Visual C++ 2015-2019 Redistributable. [x64](https://aka.ms/vs/16/release/vc_redist.x64.exe) or [x86](https://aka.ms/vs/16/release/vc_redist.x86.exe) - ViGEmBus driver (DS4Windows will install it for you) - Microsoft 360 Driver (link inside DS4Windows, already installed by Windows if you've used a 360 controller before) From 1e148ba121c2b91530dfe6e3bfde8e9bf976e566 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 24 Dec 2019 17:46:25 -0600 Subject: [PATCH 04/10] Switch active profile when new profile is created --- DS4Windows/DS4Forms/MainWindow.xaml.cs | 5 +++++ DS4Windows/DS4Forms/ProfileEditor.xaml.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/DS4Windows/DS4Forms/MainWindow.xaml.cs b/DS4Windows/DS4Forms/MainWindow.xaml.cs index 826985f..21bfcd4 100644 --- a/DS4Windows/DS4Forms/MainWindow.xaml.cs +++ b/DS4Windows/DS4Forms/MainWindow.xaml.cs @@ -1284,6 +1284,11 @@ Properties.Resources.DS4Update, MessageBoxButton.YesNo, MessageBoxImage.Question private void Editor_CreatedProfile(ProfileEditor sender, string profile) { profileListHolder.AddProfileSort(profile); + int devnum = sender.DeviceNum; + if (devnum >= 0 && devnum+1 <= conLvViewModel.ControllerCol.Count) + { + conLvViewModel.ControllerCol[devnum].ChangeSelectedProfile(profile); + } } private void NotifyIcon_TrayMouseDoubleClick(object sender, RoutedEventArgs e) diff --git a/DS4Windows/DS4Forms/ProfileEditor.xaml.cs b/DS4Windows/DS4Forms/ProfileEditor.xaml.cs index 8fb8448..aac3450 100644 --- a/DS4Windows/DS4Forms/ProfileEditor.xaml.cs +++ b/DS4Windows/DS4Forms/ProfileEditor.xaml.cs @@ -52,6 +52,7 @@ namespace DS4WinWPF.DS4Forms private bool keepsize; private bool controllerReadingsTabActive = false; public bool Keepsize { get => keepsize; } + public int DeviceNum { get => deviceNum; } private NonFormTimer inputTimer; From 69cda376b939324b20f9ea3f172ca19a5b4cbd4e Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Wed, 25 Dec 2019 02:15:01 -0600 Subject: [PATCH 05/10] Added some bounds to controls --- DS4Windows/DS4Forms/BindingWindow.xaml | 12 ++++++++---- DS4Windows/DS4Forms/ProfileEditor.xaml | 13 ++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/DS4Windows/DS4Forms/BindingWindow.xaml b/DS4Windows/DS4Forms/BindingWindow.xaml index d6c5301..9827ab8 100644 --- a/DS4Windows/DS4Forms/BindingWindow.xaml +++ b/DS4Windows/DS4Forms/BindingWindow.xaml @@ -25,12 +25,14 @@ @@ -52,12 +54,14 @@ - + diff --git a/DS4Windows/DS4Forms/ProfileEditor.xaml b/DS4Windows/DS4Forms/ProfileEditor.xaml index b4d2f48..2c9eff3 100644 --- a/DS4Windows/DS4Forms/ProfileEditor.xaml +++ b/DS4Windows/DS4Forms/ProfileEditor.xaml @@ -620,7 +620,8 @@ - +