Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/58 update keybinding names #87

Merged
merged 3 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions DCS-SR-Client/Input/InputDeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -690,15 +690,15 @@ public void StartDetectPtt(DetectPttCallback callback)
{
//run on main
Application.Current.Dispatcher.Invoke(
() => { _toggleOverlayCallback(false, 8); });
break;
() => { _toggleOverlayCallback(false, 8); }); // Change second digit to match overlay window number you want to open
break; // TODO Replace "8" with 10T panel ID number
}
else if (bindState.IsActive && bindState.MainDevice.InputBind == InputBinding.AwacsOverlayToggle)
{
//run on main
Application.Current.Dispatcher.Invoke(
() => { _toggleOverlayCallback(false, 7); });
break;
() => { _toggleOverlayCallback(false, 7); }); // Change second digit to match overlay window number you want to open
break;
}
else if ((int)bindState.MainDevice.InputBind >= (int)InputBinding.Up100 &&
(int)bindState.MainDevice.InputBind <= (int)InputBinding.AwacsOverlayToggle)
Expand Down
18 changes: 13 additions & 5 deletions DCS-SR-Client/UI/ClientWindow/InputBindingControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
xmlns:local="clr-namespace:Ciribob.DCS.SimpleRadio.Standalone.Client.UI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="100"
d:DesignWidth="300"
d:DesignWidth="500"
BorderBrush="Black"
BorderThickness="0,1,0,0"
mc:Ignorable="d">

<Grid>


<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="1.2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
Expand All @@ -29,10 +31,13 @@
Grid.Row="0"
Grid.Column="0"
VerticalContentAlignment="Center"
BorderBrush="Black"
BorderThickness="0,0,1,0"
Content="Control" />
<TextBox x:Name="Device"
Grid.Row="0"
Grid.Column="1"
TextWrapping="Wrap"
VerticalContentAlignment="Center"
IsEnabled="False"
Text="None"
Expand Down Expand Up @@ -61,11 +66,14 @@
Grid.Row="1"
Grid.Column="0"
VerticalContentAlignment="Center"
BorderBrush="Black"
BorderThickness="0,0,1,0"
Content="Control" />
<TextBox x:Name="ModifierDevice"
Grid.Row="1"
Grid.Column="1"
VerticalContentAlignment="Center"
TextWrapping="Wrap"
IsEnabled="False"
Text="None"
TextAlignment="Center" />
Expand Down
2 changes: 1 addition & 1 deletion DCS-SR-Client/UI/ClientWindow/InputBindingControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public InputDeviceManager InputDeviceManager
public void LoadInputSettings()
{
DeviceLabel.Content = InputName;
ModifierLabel.Content = InputName + " Modifier";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure i follow what is going on in this line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

I removed the input name being included before the name modifier and put in a lot of spaces to "tab" modifier over

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally it said


Radio 2
Radio 2 Modifier

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is spaces the best way to achieve layout in this situation?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was cheap and very easy to accomplish. Additionally, it's very easy to revert back to something else without needing to change the main XAML formatting. We can always move the different cells around in XAML, but this was pretty easy and involved merely seconds to create.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

ModifierLabel.Content = " + Modifier";
ModifierBinding = (InputBinding)((int)ControlInputBinding) + 100; //add 100 gets the enum of the modifier

var currentInputProfile = GlobalSettingsStore.Instance.ProfileSettingsStore.GetCurrentInputProfile();
Expand Down
Loading
Loading