diff --git a/MFIGamepadFeeder/App.config b/MFIGamepadFeeder/App.config
index 8a48343..4f8adab 100644
--- a/MFIGamepadFeeder/App.config
+++ b/MFIGamepadFeeder/App.config
@@ -58,6 +58,12 @@
False
+
+ False
+
+
+ False
+
diff --git a/MFIGamepadFeeder/MFIGamepadFeeder.csproj b/MFIGamepadFeeder/MFIGamepadFeeder.csproj
index 0283347..ce5d125 100644
--- a/MFIGamepadFeeder/MFIGamepadFeeder.csproj
+++ b/MFIGamepadFeeder/MFIGamepadFeeder.csproj
@@ -15,7 +15,8 @@
4
true
false
- D:\Users\axadiw\Desktop\MFIGamepad\
+ 11e577087eab47da8e602d846426c923
+ C:\Repos\MFIGamepadRelease\
true
Disk
false
@@ -25,13 +26,11 @@
false
false
true
- true
- 2
+ 3
1.0.0.%2a
false
true
true
- 11e577087eab47da8e602d846426c923
icon.ico
@@ -43,7 +42,7 @@
MFIGamepadFeeder_1_TemporaryKey.pfx
- false
+ true
false
@@ -225,9 +224,16 @@
MainWindow.xaml
Code
+
+ Designer
+ MSBuild:Compile
+
+
+ OptionsWindow.xaml
+
Code
diff --git a/MFIGamepadFeeder/MainWindow.xaml b/MFIGamepadFeeder/MainWindow.xaml
index aa5f9e3..a6728f5 100644
--- a/MFIGamepadFeeder/MainWindow.xaml
+++ b/MFIGamepadFeeder/MainWindow.xaml
@@ -7,7 +7,8 @@
mc:Ignorable="d"
Title="MFI Gamepad Feeder" Width="800" Height="350"
ResizeMode="CanResizeWithGrip" Icon="icon.ico" Closing="Window_Closing" WindowStartupLocation="CenterScreen"
- StateChanged="Window_StateChanged" MinWidth="500" MinHeight="250">
+ StateChanged="Window_StateChanged" MinWidth="500" MinHeight="250"
+ >
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MFIGamepadFeeder/MainWindow.xaml.cs b/MFIGamepadFeeder/MainWindow.xaml.cs
index f4fdf6d..8a8756a 100644
--- a/MFIGamepadFeeder/MainWindow.xaml.cs
+++ b/MFIGamepadFeeder/MainWindow.xaml.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq;
@@ -61,7 +60,10 @@ private void SetupUi()
private void Grid_Loaded(object sender, RoutedEventArgs e)
{
- // WindowState = WindowState.Minimized;
+ if (Settings.Default.StartMinimized)
+ {
+ WindowState = WindowState.Minimized;
+ }
HidDeviceCombobox1.ItemsSource = ViewModel.HidManager.FoundDevices;
HidDeviceCombobox2.ItemsSource = ViewModel.HidManager.FoundDevices;
@@ -108,16 +110,33 @@ private void Grid_Loaded(object sender, RoutedEventArgs e)
ControllerActiveCheckbox2.IsChecked = Settings.Default.ControllerActive2;
ControllerActiveCheckbox3.IsChecked = Settings.Default.ControllerActive3;
ControllerActiveCheckbox4.IsChecked = Settings.Default.ControllerActive4;
+
+ if (Settings.Default.AutoPlugIn)
+ {
+ StartButton_Click(null, null);
+ }
}
private void DeviceId_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
try
{
- if (DeviceIdComboBox1.SelectedItem != null && ReferenceEquals(sender, DeviceIdComboBox1)) Settings.Default.SelectedControllerId1 = (uint)DeviceIdComboBox1.SelectedItem;
- if (DeviceIdComboBox2.SelectedItem != null && ReferenceEquals(sender, DeviceIdComboBox2)) Settings.Default.SelectedControllerId2 = (uint)DeviceIdComboBox2.SelectedItem;
- if (DeviceIdComboBox3.SelectedItem != null && ReferenceEquals(sender, DeviceIdComboBox3)) Settings.Default.SelectedControllerId3 = (uint)DeviceIdComboBox3.SelectedItem;
- if (DeviceIdComboBox4.SelectedItem != null && ReferenceEquals(sender, DeviceIdComboBox4)) Settings.Default.SelectedControllerId4 = (uint)DeviceIdComboBox4.SelectedItem;
+ if ((DeviceIdComboBox1.SelectedItem != null) && ReferenceEquals(sender, DeviceIdComboBox1))
+ {
+ Settings.Default.SelectedControllerId1 = (uint) DeviceIdComboBox1.SelectedItem;
+ }
+ if ((DeviceIdComboBox2.SelectedItem != null) && ReferenceEquals(sender, DeviceIdComboBox2))
+ {
+ Settings.Default.SelectedControllerId2 = (uint) DeviceIdComboBox2.SelectedItem;
+ }
+ if ((DeviceIdComboBox3.SelectedItem != null) && ReferenceEquals(sender, DeviceIdComboBox3))
+ {
+ Settings.Default.SelectedControllerId3 = (uint) DeviceIdComboBox3.SelectedItem;
+ }
+ if ((DeviceIdComboBox4.SelectedItem != null) && ReferenceEquals(sender, DeviceIdComboBox4))
+ {
+ Settings.Default.SelectedControllerId4 = (uint) DeviceIdComboBox4.SelectedItem;
+ }
Settings.Default.Save();
}
@@ -129,28 +148,64 @@ private void DeviceId_SelectionChanged(object sender, SelectionChangedEventArgs
private void ControllerActiveCheckbox_IsCheckedChanged(object sender, RoutedEventArgs routedEventArgs)
{
- if (ControllerActiveCheckbox1.IsChecked != null && ReferenceEquals(sender, ControllerActiveCheckbox1)) Settings.Default.ControllerActive1 = ControllerActiveCheckbox1.IsChecked.Value;
- if (ControllerActiveCheckbox2.IsChecked != null && ReferenceEquals(sender, ControllerActiveCheckbox2)) Settings.Default.ControllerActive2 = ControllerActiveCheckbox2.IsChecked.Value;
- if (ControllerActiveCheckbox3.IsChecked != null && ReferenceEquals(sender, ControllerActiveCheckbox3)) Settings.Default.ControllerActive3 = ControllerActiveCheckbox3.IsChecked.Value;
- if (ControllerActiveCheckbox4.IsChecked != null && ReferenceEquals(sender, ControllerActiveCheckbox4)) Settings.Default.ControllerActive4 = ControllerActiveCheckbox4.IsChecked.Value;
+ if ((ControllerActiveCheckbox1.IsChecked != null) && ReferenceEquals(sender, ControllerActiveCheckbox1))
+ {
+ Settings.Default.ControllerActive1 = ControllerActiveCheckbox1.IsChecked.Value;
+ }
+ if ((ControllerActiveCheckbox2.IsChecked != null) && ReferenceEquals(sender, ControllerActiveCheckbox2))
+ {
+ Settings.Default.ControllerActive2 = ControllerActiveCheckbox2.IsChecked.Value;
+ }
+ if ((ControllerActiveCheckbox3.IsChecked != null) && ReferenceEquals(sender, ControllerActiveCheckbox3))
+ {
+ Settings.Default.ControllerActive3 = ControllerActiveCheckbox3.IsChecked.Value;
+ }
+ if ((ControllerActiveCheckbox4.IsChecked != null) && ReferenceEquals(sender, ControllerActiveCheckbox4))
+ {
+ Settings.Default.ControllerActive4 = ControllerActiveCheckbox4.IsChecked.Value;
+ }
Settings.Default.Save();
}
private void HidDeviceCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
- if (ReferenceEquals(sender, HidDeviceCombobox1)) Settings.Default.SelectedHidDevice1 = JsonConvert.SerializeObject(HidDeviceCombobox1.SelectedItem);
- if (ReferenceEquals(sender, HidDeviceCombobox2)) Settings.Default.SelectedHidDevice2 = JsonConvert.SerializeObject(HidDeviceCombobox2.SelectedItem);
- if (ReferenceEquals(sender, HidDeviceCombobox3)) Settings.Default.SelectedHidDevice3 = JsonConvert.SerializeObject(HidDeviceCombobox3.SelectedItem);
- if (ReferenceEquals(sender, HidDeviceCombobox4)) Settings.Default.SelectedHidDevice4 = JsonConvert.SerializeObject(HidDeviceCombobox4.SelectedItem);
+ if (ReferenceEquals(sender, HidDeviceCombobox1))
+ {
+ Settings.Default.SelectedHidDevice1 = JsonConvert.SerializeObject(HidDeviceCombobox1.SelectedItem);
+ }
+ if (ReferenceEquals(sender, HidDeviceCombobox2))
+ {
+ Settings.Default.SelectedHidDevice2 = JsonConvert.SerializeObject(HidDeviceCombobox2.SelectedItem);
+ }
+ if (ReferenceEquals(sender, HidDeviceCombobox3))
+ {
+ Settings.Default.SelectedHidDevice3 = JsonConvert.SerializeObject(HidDeviceCombobox3.SelectedItem);
+ }
+ if (ReferenceEquals(sender, HidDeviceCombobox4))
+ {
+ Settings.Default.SelectedHidDevice4 = JsonConvert.SerializeObject(HidDeviceCombobox4.SelectedItem);
+ }
Settings.Default.Save();
}
private void MappingFileCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
- if (ReferenceEquals(sender, MappingFileCombobox1)) Settings.Default.SelectedConfigFile1 = MappingFileCombobox1.SelectedItem as string;
- if (ReferenceEquals(sender, MappingFileCombobox2)) Settings.Default.SelectedConfigFile2 = MappingFileCombobox2.SelectedItem as string;
- if (ReferenceEquals(sender, MappingFileCombobox3)) Settings.Default.SelectedConfigFile3 = MappingFileCombobox3.SelectedItem as string;
- if (ReferenceEquals(sender, MappingFileCombobox4)) Settings.Default.SelectedConfigFile4 = MappingFileCombobox4.SelectedItem as string;
+ if (ReferenceEquals(sender, MappingFileCombobox1))
+ {
+ Settings.Default.SelectedConfigFile1 = MappingFileCombobox1.SelectedItem as string;
+ }
+ if (ReferenceEquals(sender, MappingFileCombobox2))
+ {
+ Settings.Default.SelectedConfigFile2 = MappingFileCombobox2.SelectedItem as string;
+ }
+ if (ReferenceEquals(sender, MappingFileCombobox3))
+ {
+ Settings.Default.SelectedConfigFile3 = MappingFileCombobox3.SelectedItem as string;
+ }
+ if (ReferenceEquals(sender, MappingFileCombobox4))
+ {
+ Settings.Default.SelectedConfigFile4 = MappingFileCombobox4.SelectedItem as string;
+ }
Settings.Default.Save();
}
@@ -167,13 +222,10 @@ private void Log(string message)
LogLabel.Text += $"{DateTime.Now}: {message}{Environment.NewLine}";
LogLabel.ScrollToEnd();
});
- }
+ }
private void StartButton_Click(object sender, RoutedEventArgs e)
{
- StartButton.Content = "Processing...";
- StartButton.UpdateLayout();
-
if (!ViewModel.IsRunning.Value)
{
var activeGamepads = GamepadControls.Keys.Where(box => (box.IsChecked != null) && box.IsChecked.Value).ToList();
@@ -206,7 +258,7 @@ private void StartButton_Click(object sender, RoutedEventArgs e)
{
ViewModel.Stop();
}
- }
+ }
private void Window_Closing(object sender, CancelEventArgs e)
@@ -235,5 +287,15 @@ private void Window_StateChanged(object sender, EventArgs e)
}
}
+ private void OptionsButton_Click(object sender, RoutedEventArgs e)
+ {
+ var optionsWindow = new OptionsWindow();
+ optionsWindow.ShowDialog();
+ }
+
+ private void EditorButton_Click(object sender, RoutedEventArgs e)
+ {
+
+ }
}
}
\ No newline at end of file
diff --git a/MFIGamepadFeeder/OptionsWindow.xaml b/MFIGamepadFeeder/OptionsWindow.xaml
new file mode 100644
index 0000000..d225e0a
--- /dev/null
+++ b/MFIGamepadFeeder/OptionsWindow.xaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MFIGamepadFeeder/OptionsWindow.xaml.cs b/MFIGamepadFeeder/OptionsWindow.xaml.cs
new file mode 100644
index 0000000..e5771e4
--- /dev/null
+++ b/MFIGamepadFeeder/OptionsWindow.xaml.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using MFIGamepadFeeder.Properties;
+
+namespace MFIGamepadFeeder
+{
+ ///
+ /// Interaction logic for OptionsWindow.xaml
+ ///
+ public partial class OptionsWindow : Window
+ {
+ public OptionsWindow()
+ {
+ InitializeComponent();
+ }
+
+ private void Grid_Loaded(object sender, RoutedEventArgs e)
+ {
+ AutoPlugInCheckBox.IsChecked = Settings.Default.AutoPlugIn;
+ StartMinimizedCheckBox.IsChecked = Settings.Default.StartMinimized;
+ }
+
+ private void SaveButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (AutoPlugInCheckBox.IsChecked != null) Settings.Default.AutoPlugIn = AutoPlugInCheckBox.IsChecked.Value;
+ if (StartMinimizedCheckBox.IsChecked != null) Settings.Default.StartMinimized = StartMinimizedCheckBox.IsChecked.Value;
+ Settings.Default.Save();
+ Close();
+ }
+
+ private void StartMinimized_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ StartMinimizedCheckBox.IsChecked = !StartMinimizedCheckBox.IsChecked;
+ }
+
+ private void AutoPlugIn_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ AutoPlugInCheckBox.IsChecked = !AutoPlugInCheckBox.IsChecked;
+ }
+ }
+}
diff --git a/MFIGamepadFeeder/Properties/Settings.Designer.cs b/MFIGamepadFeeder/Properties/Settings.Designer.cs
index a2931bb..9b153be 100644
--- a/MFIGamepadFeeder/Properties/Settings.Designer.cs
+++ b/MFIGamepadFeeder/Properties/Settings.Designer.cs
@@ -214,5 +214,29 @@ public bool ControllerActive4 {
this["ControllerActive4"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool StartMinimized {
+ get {
+ return ((bool)(this["StartMinimized"]));
+ }
+ set {
+ this["StartMinimized"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool AutoPlugIn {
+ get {
+ return ((bool)(this["AutoPlugIn"]));
+ }
+ set {
+ this["AutoPlugIn"] = value;
+ }
+ }
}
}
diff --git a/MFIGamepadFeeder/Properties/Settings.settings b/MFIGamepadFeeder/Properties/Settings.settings
index bcc152b..cbeb5c8 100644
--- a/MFIGamepadFeeder/Properties/Settings.settings
+++ b/MFIGamepadFeeder/Properties/Settings.settings
@@ -50,5 +50,11 @@
False
+
+ False
+
+
+ False
+
\ No newline at end of file