Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
34 changes: 18 additions & 16 deletions MapTP.App/InspectorWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ public partial class InspectorWindow : Window
public _TriggerEvent MainWindow_Start;
public _TriggerEvent MainWindow_Turtle;

private readonly int X,Y, eX, eY;
private readonly int X, Y, eX, eY;

public InspectorWindow(int X, int Y, int eX, int eY)
{
InitializeComponent();
this.X= X;
this.Y= Y;
this.eX= eX;
this.eY= eY;
this.X = X;
this.Y = Y;
this.eX = eX;
this.eY = eY;
}

protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
this.LocationChanged+= OnTransformChanged;
this.LocationChanged += OnTransformChanged;
this.SizeChanged += OnTransformChanged;
this.DpiRatio=ScreenManager.GetDpiRatio(this);
this.DpiRatio = ScreenManager.GetDpiRatio(this);
this.Loaded += OnLoaded;
}

Expand All @@ -67,12 +67,14 @@ private void OnTransformChanged(object sender, EventArgs e)
var y = (int)(this.Top * DpiRatio);
var ex = (int)((this.Left + this.width) * DpiRatio);
var ey = (int)((this.Top + this.height) * DpiRatio);
if (x >= 0 && y >= 0 && ex <= ScreenManager.GetScreenWidth() && ey <= ScreenManager.GetScreenHeight()) {
TitleBar.Background = new SolidColorBrush(Color.FromArgb(0x33,0xff,0xff,0xff));
SendScreenArea(x, y, ex, ey);
if (x >= 0 && y >= 0 && ex <= ScreenManager.GetScreenWidth() && ey <= ScreenManager.GetScreenHeight())
{
TitleBar.Background = new SolidColorBrush(Color.FromArgb(0x33, 0xff, 0xff, 0xff));
SendScreenArea(x, y, ex, ey);
}
else {
TitleBar.Background = new SolidColorBrush(Color.FromArgb(0x33,0xff,0x00,0x00));
else
{
TitleBar.Background = new SolidColorBrush(Color.FromArgb(0x33, 0xff, 0x00, 0x00));
}
}

Expand Down Expand Up @@ -102,8 +104,8 @@ private void StartButtonClick(object sender, RoutedEventArgs e)
{
MainWindow_Start(sender, e);
}
this.StopButton.Visibility=Visibility.Visible;
this.StartButton.Visibility=Visibility.Collapsed;
this.StopButton.Visibility = Visibility.Visible;
this.StartButton.Visibility = Visibility.Collapsed;
}

private void StopButtonClick(object sender, RoutedEventArgs e)
Expand All @@ -112,8 +114,8 @@ private void StopButtonClick(object sender, RoutedEventArgs e)
{
MainWindow_Stop(sender, e);
}
this.StopButton.Visibility=Visibility.Collapsed;
this.StartButton.Visibility=Visibility.Visible;
this.StopButton.Visibility = Visibility.Collapsed;
this.StartButton.Visibility = Visibility.Visible;
}

}
Expand Down
17 changes: 17 additions & 0 deletions MapTP.App/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<TextBlock HorizontalAlignment="Left" Margin="5" Text="Options" Style="{StaticResource TextBlockTitle}"/>
<StackPanel Orientation="Horizontal" Grid.Row="1">
Expand All @@ -114,6 +115,22 @@
<CheckBox x:Name="TrayCB" Content="Enable Tray icon" Margin="10,0,0,0" IsChecked="True" Click="TrayCBClick"></CheckBox>
<CheckBox x:Name="HideCB" Content="Hide to tray when minimized" Margin="10,0,0,0" IsChecked="True"></CheckBox>
</StackPanel>
<!-- Sensitivity settings -->
<StackPanel Orientation="Horizontal" Margin="0,10,0,10" Grid.Row="3">
<StackPanel Margin="0,0,15,0">
<TextBlock Text="Tap Time (ms)" />
<TextBox x:Name="TapTimeBox" Width="80" Text="180" PreviewTextInput="limitnumber" />
</StackPanel>
<StackPanel Margin="0,0,15,0">
<TextBlock Text="Tap Move X (abs)" />
<TextBox x:Name="TapMoveXBox" Width="80" Text="1200" PreviewTextInput="limitnumber" />
</StackPanel>
<StackPanel Margin="0,0,15,0">
<TextBlock Text="Tap Move Y (abs)" />
<TextBox x:Name="TapMoveYBox" Width="80" Text="1200" PreviewTextInput="limitnumber" />
</StackPanel>
<Button Content="Apply" Click="OnApplySensitivityClick" />
</StackPanel>
</Grid>
</Border>
</Grid>
Expand Down
Loading