-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UI explanation and toggle for launching games
Adds 'autostart game' toggle. User can turn it off and `--launch=` will be ignored. When `--launch=` option is passed explanation dialog will appear with option to launch game or not and hide the dialog on subsequent runs. This allows launchers like Rai Pal to always pass `--launch=` along with `--attach=`.
- Loading branch information
Showing
5 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<Window x:Class="UEVR.GameAutoStartExplanationDialog" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:UEVR" | ||
TextElement.Foreground="{DynamicResource MaterialDesignBody}" | ||
TextElement.FontWeight="Regular" | ||
TextElement.FontSize="13" | ||
TextOptions.TextFormattingMode="Ideal" | ||
TextOptions.TextRenderingMode="Auto" | ||
FontFamily="{DynamicResource MaterialDesignFont}" | ||
Background="#FF1A1B1C" | ||
SizeToContent="WidthAndHeight" ResizeMode="NoResize" Icon="/UEVR2.png" | ||
WindowStartupLocation="CenterScreen" | ||
WindowStyle="None" | ||
Title="Game autostart" Height="200" Width="400"> | ||
<StackPanel> | ||
<TextBlock Text="Game auto start attempt detected.
You can configure autostart by toggling 'Autostart game' in settings" Margin="10" /> | ||
<CheckBox x:Name="chkRememberChoice" Content="Remember my choice" Margin="10" /> | ||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="10"> | ||
<Button x:Name="btnStartGame" Content="Start game" Width="125" Margin="5" Click="btnStartGame_Click"/> | ||
<Button x:Name="btnWaitForGameStart" Content="I'll start it myself" Width="140" Margin="5" Click="btnWaitForGameStart_Click"/> | ||
</StackPanel> | ||
</StackPanel> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace UEVR { | ||
public partial class GameAutoStartExplanationDialog : Window { | ||
public bool HideAutostartWarning { get; private set; } | ||
public bool DialogResultStartGame { get; private set; } | ||
|
||
public GameAutoStartExplanationDialog() { | ||
InitializeComponent(); | ||
} | ||
|
||
private void btnStartGame_Click(object sender, RoutedEventArgs e) { | ||
HideAutostartWarning = chkRememberChoice.IsChecked == true; | ||
DialogResultStartGame = true; | ||
this.Close(); | ||
} | ||
|
||
private void btnWaitForGameStart_Click(object sender, RoutedEventArgs e) { | ||
HideAutostartWarning = chkRememberChoice.IsChecked == true; | ||
DialogResultStartGame = false; | ||
this.Close(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters