-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a settings window, display the version in the main window title
- Loading branch information
1 parent
8843ac7
commit 9778327
Showing
10 changed files
with
209 additions
and
17 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
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,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Controls; | ||
using System.Windows.Input; | ||
|
||
namespace DivinityModManager.Controls | ||
{ | ||
public partial class UnfocusableTextBox : TextBox | ||
{ | ||
public UnfocusableTextBox() | ||
{ | ||
//InitializeComponent(); | ||
} | ||
|
||
protected override void OnKeyDown(KeyEventArgs e) | ||
{ | ||
base.OnKeyDown(e); | ||
if (e.Key == Key.Return) | ||
{ | ||
Keyboard.ClearFocus(); | ||
} | ||
} | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<reactiveui:ReactiveWindow x:Class="DivinityModManager.Views.SettingsWindow" | ||
x:TypeArguments="data:DivinityModManagerSettings" | ||
xmlns:reactiveui="http://reactiveui.net" | ||
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:DivinityModManager.Views" | ||
xmlns:c="clr-namespace:DivinityModManager.Controls" | ||
xmlns:conv="clr-namespace:DivinityModManager.Converters" | ||
xmlns:vm="clr-namespace:DivinityModManager.ViewModels" | ||
xmlns:data="clr-namespace:DivinityModManager.Models;assembly=DivinityModManagerCore" | ||
xmlns:dd="urn:gong-wpf-dragdrop" | ||
xmlns:autogrid="clr-namespace:WpfAutoGrid;assembly=WpfAutoGrid" | ||
mc:Ignorable="d" | ||
Title="Preferences" Height="450" Width="600"> | ||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="*" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
<TabControl> | ||
<TabItem Header="General"> | ||
<autogrid:AutoGrid | ||
ColumnCount="2" | ||
Columns="auto,*" | ||
ChildMargin="2" | ||
Margin="20" | ||
RowHeight="*" | ||
RowCount="3" | ||
Rows="auto,auto" | ||
> | ||
<Label Content="Game Data Path:" ToolTip="The path to the DOS2DE Data folder, for loading editor mods.
Example: Divinity Original Sin 2/DefEd/Data"/> | ||
<c:UnfocusableTextBox Text="{Binding GameDataPath, UpdateSourceTrigger=PropertyChanged, FallbackValue='Path'}" TextAlignment="Left" VerticalAlignment="Center" /> | ||
<Label Content="Saved Load Orders Path:" ToolTip="The folder to save and load load orders to." /> | ||
<c:UnfocusableTextBox Text="{Binding LoadOrderPath, UpdateSourceTrigger=PropertyChanged, FallbackValue='Load Order'}" TextAlignment="Left" VerticalAlignment="Center" /> | ||
</autogrid:AutoGrid> | ||
</TabItem> | ||
</TabControl> | ||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="10"> | ||
<Button x:Name="SaveSettingsButton" Content="Save" Padding="20,2" Command="{Binding SaveSettingsCommand}" /> | ||
</StackPanel> | ||
</Grid> | ||
</reactiveui:ReactiveWindow> |
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,45 @@ | ||
using DivinityModManager.Models; | ||
using DivinityModManager.Util; | ||
using DivinityModManager.ViewModels; | ||
using ReactiveUI; | ||
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.Navigation; | ||
using System.Windows.Shapes; | ||
using System.Reactive.Disposables; | ||
using DynamicData; | ||
using DynamicData.Binding; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
|
||
namespace DivinityModManager.Views | ||
{ | ||
/// <summary> | ||
/// Interaction logic for SettingsWindow.xaml | ||
/// </summary> | ||
public partial class SettingsWindow : ReactiveWindow<DivinityModManagerSettings> | ||
{ | ||
public SettingsWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public void Init(DivinityModManagerSettings vm) | ||
{ | ||
ViewModel = vm; | ||
DataContext = ViewModel; | ||
|
||
this.OneWayBind(ViewModel, x => x.SaveSettingsCommand, view => view.SaveSettingsButton.Command); | ||
} | ||
} | ||
} |
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