Skip to content

Commit 94b8391

Browse files
committed
chore: Move Vibration Multiplier to Vibes tab
Doesn't really need its own tab. Affects #374
1 parent 10ada5c commit 94b8391

8 files changed

Lines changed: 36 additions & 81 deletions

File tree

Buttplug.Apps.GameVibrationRouter.GUI/Buttplug.Apps.GameVibrationRouter.GUI.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080
<Generator>MSBuild:Compile</Generator>
8181
<SubType>Designer</SubType>
8282
</ApplicationDefinition>
83-
<Compile Include="VibeConfigTab.xaml.cs">
84-
<DependentUpon>VibeConfigTab.xaml</DependentUpon>
85-
</Compile>
8683
<Compile Include="VibeGraphTab.xaml.cs">
8784
<DependentUpon>VibeGraphTab.xaml</DependentUpon>
8885
</Compile>
@@ -98,10 +95,6 @@
9895
<DependentUpon>MainWindow.xaml</DependentUpon>
9996
<SubType>Code</SubType>
10097
</Compile>
101-
<Page Include="VibeConfigTab.xaml">
102-
<Generator>MSBuild:Compile</Generator>
103-
<SubType>Designer</SubType>
104-
</Page>
10598
<Page Include="ProcessTab.xaml">
10699
<Generator>MSBuild:Compile</Generator>
107100
<SubType>Designer</SubType>

Buttplug.Apps.GameVibrationRouter.GUI/MainWindow.xaml.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ public partial class MainWindow
3636
[NotNull]
3737
private readonly VibeGraphTab _graphTab;
3838

39-
[NotNull]
40-
private readonly VibeConfigTab _vibeTab;
41-
4239
private IpcServerChannel _xinputHookServer;
4340
private string _channelName;
4441
private List<ButtplugDeviceInfo> _devices = new List<ButtplugDeviceInfo>();
@@ -74,9 +71,7 @@ public MainWindow()
7471
ButtplugTab.AddDevicePanel(_bpServer);
7572
ButtplugTab.SelectedDevicesChanged += OnSelectedDevicesChanged;
7673

77-
_vibeTab = new VibeConfigTab();
78-
_vibeTab.MultiplierChanged += MultiplierChanged;
79-
ButtplugTab.SetOtherTab2("Vibe Config", _vibeTab);
74+
_graphTab.MultiplierChanged += MultiplierChanged;
8075

8176
var config = new ButtplugConfig("Buttplug");
8277
ButtplugTab.GetAboutControl().CheckUpdate(config, "buttplug-csharp");

Buttplug.Apps.GameVibrationRouter.GUI/VibeConfigTab.xaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

Buttplug.Apps.GameVibrationRouter.GUI/VibeConfigTab.xaml.cs

Lines changed: 0 additions & 30 deletions
This file was deleted.

Buttplug.Apps.GameVibrationRouter.GUI/VibeGraphTab.xaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,37 @@
99
d:DesignHeight="300" d:DesignWidth="300">
1010
<Grid Background="#FFE5E5E5">
1111
<Grid.RowDefinitions>
12+
<RowDefinition Height="auto" />
1213
<RowDefinition Height="*" />
1314
<RowDefinition Height="*" />
1415
</Grid.RowDefinitions>
15-
<wpf:CartesianChart Name="LowPowerChart" Grid.Row="0" Series="{Binding LowPowerSeriesCollection}" Background="Black" DisableAnimations="True" Hoverable="False" DataTooltip="{x:Null}">
16+
17+
<Grid>
18+
<Grid.RowDefinitions>
19+
<RowDefinition Height="*" />
20+
<RowDefinition Height="*" />
21+
</Grid.RowDefinitions>
22+
23+
<GroupBox Header="Vibration Multiplier" Grid.Row="0">
24+
<Grid Row="0" RenderTransformOrigin="0.841,0.517">
25+
<Grid.ColumnDefinitions>
26+
<ColumnDefinition Width="*"></ColumnDefinition>
27+
<ColumnDefinition Width="auto"></ColumnDefinition>
28+
</Grid.ColumnDefinitions>
29+
<Slider x:Name="multiplierSlider" Foreground="Black" Grid.Column="0" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" TickPlacement="BottomRight" ValueChanged="multiplierSlider_ValueChanged" Value="1" Maximum="5" TickFrequency="0.1" IsSnapToTickEnabled="True" Margin="0,2,0,1.667"/>
30+
<TextBlock Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding ElementName=multiplierSlider, Path=Value, StringFormat='x\{0:0.0\}'}" Height="16" Margin="15.333,0,14,0.333" Width="auto"></TextBlock>
31+
</Grid>
32+
</GroupBox>
33+
</Grid>
34+
<wpf:CartesianChart Name="LowPowerChart" Grid.Row="1" Series="{Binding LowPowerSeriesCollection}" Background="Black" DisableAnimations="True" Hoverable="False" DataTooltip="{x:Null}">
1635
<wpf:CartesianChart.AxisY>
1736
<wpf:Axis MinValue="0" MaxValue="65535" ShowLabels="False"></wpf:Axis>
1837
</wpf:CartesianChart.AxisY>
1938
<wpf:CartesianChart.AxisX>
2039
<wpf:Axis MinValue="0" MaxRange="200" ShowLabels="False"></wpf:Axis>
2140
</wpf:CartesianChart.AxisX>
2241
</wpf:CartesianChart>
23-
<wpf:CartesianChart Name="HighPowerChart" Grid.Row="1" Series="{Binding HighPowerSeriesCollection}" Background="Black" DisableAnimations="True" Hoverable="False" DataTooltip="{x:Null}">
42+
<wpf:CartesianChart Name="HighPowerChart" Grid.Row="2" Series="{Binding HighPowerSeriesCollection}" Background="Black" DisableAnimations="True" Hoverable="False" DataTooltip="{x:Null}">
2443
<wpf:CartesianChart.AxisY>
2544
<wpf:Axis MinValue="0" MaxValue="65535" ShowLabels="False"></wpf:Axis>
2645
</wpf:CartesianChart.AxisY>

Buttplug.Apps.GameVibrationRouter.GUI/VibeGraphTab.xaml.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
using System.Threading.Tasks;
1+
using System;
2+
using System.Threading.Tasks;
3+
using System.Windows;
24
using LiveCharts;
35
using LiveCharts.Wpf;
46
using System.Windows.Controls;
@@ -21,6 +23,7 @@ public partial class VibeGraphTab : UserControl
2123
public SeriesCollection HighPowerSeriesCollection { get; set; }
2224
private readonly ChartValues<double> LowPowerValues;
2325
private readonly ChartValues<double> HighPowerValues;
26+
public event EventHandler<double> MultiplierChanged;
2427

2528
public VibeGraphTab()
2629
{
@@ -58,8 +61,9 @@ public VibeGraphTab()
5861
HighPowerChart.UpdaterState = UpdaterState.Paused;
5962
LowPowerChart.UpdaterState = UpdaterState.Paused;
6063
});
64+
6165
}
62-
66+
6367
public void AddVibrationValue(double aLowPower, double aHighPower)
6468
{
6569
LowPowerValues.RemoveAt(0);
@@ -81,5 +85,10 @@ public void AddVibrationValue(double aLowPower, double aHighPower)
8185
}
8286
}
8387

88+
89+
private void multiplierSlider_ValueChanged(object aSender, System.Windows.RoutedPropertyChangedEventArgs<double> aArgs)
90+
{
91+
MultiplierChanged?.Invoke(this, aArgs.NewValue);
92+
}
8493
}
8594
}

Buttplug.Components.Controls/ButtplugTabControl.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
<TabItem Header="Devices" Name="DevicesTab">
1313
<local:ButtplugDeviceControl x:Name="DeviceControl" />
1414
</TabItem>
15-
<TabItem Name="OtherTab" Visibility="Collapsed">
16-
</TabItem>
17-
<TabItem Name="OtherTab2" Visibility="Collapsed">
15+
<TabItem Name="OtherTab" Visibility="Collapsed">
1816
</TabItem>
1917
<TabItem Header="Logs">
2018
<local:ButtplugLogControl x:Name="LogControl" />

Buttplug.Components.Controls/ButtplugTabControl.xaml.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,11 @@ private ButtplugServer InitializeButtplugServer(string aServerName, uint aMaxPin
143143
bpServer.AddDeviceSubtypeManager(aLogger => new ETSerialManager(aLogger));
144144
bpServer.AddDeviceSubtypeManager(aLogger => new WinUSBManager(aLogger));
145145
bpServer.AddDeviceSubtypeManager(aLogger => new HidManager(aLogger));
146+
/*
146147
#if DEBUG
147148
bpServer.AddDeviceSubtypeManager(aLogger => new SimulatorManager(aLogger));
148149
#endif
149-
150+
*/
150151
return bpServer;
151152
}
152153

@@ -241,12 +242,6 @@ public void SetOtherTab(string aTabName, UserControl aTabControl)
241242
OtherTab.Content = aTabControl;
242243
OtherTab.Visibility = Visibility.Visible;
243244
}
244-
public void SetOtherTab2(string aTabName, UserControl aTabControl)
245-
{
246-
OtherTab2.Header = aTabName;
247-
OtherTab2.Content = aTabControl;
248-
OtherTab2.Visibility = Visibility.Visible;
249-
}
250245

251246
public ButtplugLogControl GetLogControl()
252247
{

0 commit comments

Comments
 (0)