Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
1,302 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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.4.33213.308 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LOMV2", "LOMV2\LOMV2.csproj", "{FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{FA3491CE-5EF8-40DE-8E19-218ECAEBB7A5}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {3B58DAEB-67E9-42DF-BA8A-0A1916C669C5} | ||
EndGlobalSection | ||
EndGlobal |
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,9 @@ | ||
<Application x:Class="LOM.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:LOM" | ||
Startup="OnStartup"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
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,38 @@ | ||
using LOM.Services; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace LOM; | ||
|
||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
private ServiceProvider serviceProvider; | ||
|
||
public App() | ||
{ | ||
IServiceCollection services = new ServiceCollection(); | ||
ConfigureServices(services); | ||
serviceProvider = services.BuildServiceProvider(); | ||
} | ||
|
||
private void ConfigureServices(IServiceCollection services) | ||
{ | ||
services.AddSingleton<MainWindow, MainWindow>(); | ||
services.AddScoped<ISystemIO, SystemIO>(); | ||
} | ||
|
||
private void OnStartup(object sender, StartupEventArgs e) | ||
{ | ||
var mainWindow = serviceProvider.GetService<MainWindow>(); | ||
mainWindow.Show(); | ||
} | ||
} |
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,10 @@ | ||
using System.Windows; | ||
|
||
[assembly: ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
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,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
using System.Windows; | ||
|
||
namespace LOM.Converters; | ||
|
||
[ValueConversion(typeof(String), typeof(Double))] | ||
public class StringBoolDataConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
double doValue = (double)value; | ||
return doValue.ToString(); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
string strValue = value as string; | ||
if (double.TryParse(strValue, out double result)) | ||
{ | ||
return result; | ||
} | ||
return DependencyProperty.UnsetValue; | ||
} | ||
} |
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 @@ | ||
<Window x:Class="LOM.InputDialog" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Title="Input" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen" | ||
ContentRendered="Window_ContentRendered"> | ||
<Grid Margin="15"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
|
||
<!--<Image Source="/WpfTutorialSamples;component/Images/question32.png" Width="32" Height="32" Grid.RowSpan="2" Margin="20,0" />--> | ||
|
||
<Label Name="lblQuestion" Grid.Column="1">Question:</Label> | ||
<TextBox Name="txtAnswer" Grid.Column="1" Grid.Row="1" MinWidth="250">Answer</TextBox> | ||
|
||
<WrapPanel Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Right" Margin="0,15,0,0"> | ||
<Button IsDefault="True" Name="btnDialogOk" Click="btnDialogOk_Click" MinWidth="60" Margin="0,0,10,0">_Ok</Button> | ||
<Button IsCancel="True" MinWidth="60">_Cancel</Button> | ||
</WrapPanel> | ||
</Grid> | ||
</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,45 @@ | ||
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.Shapes; | ||
|
||
namespace LOM | ||
{ | ||
/// <summary> | ||
/// Interaction logic for InputDialog.xaml | ||
/// </summary> | ||
public partial class InputDialog : Window | ||
{ | ||
public InputDialog(string question, string defaultAnswer = "") | ||
{ | ||
InitializeComponent(); | ||
lblQuestion.Content = question; | ||
txtAnswer.Text = defaultAnswer; | ||
} | ||
|
||
private void btnDialogOk_Click(object sender, RoutedEventArgs e) | ||
{ | ||
this.DialogResult = true; | ||
} | ||
|
||
private void Window_ContentRendered(object sender, EventArgs e) | ||
{ | ||
txtAnswer.SelectAll(); | ||
txtAnswer.Focus(); | ||
} | ||
|
||
public string Answer | ||
{ | ||
get { return txtAnswer.Text; } | ||
} | ||
} | ||
} |
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,32 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net7.0-windows</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<UseWPF>true</UseWPF> | ||
<AssemblyName>LOMV2</AssemblyName> | ||
<RootNamespace>LOM</RootNamespace> | ||
<UseWindowsForms>True</UseWindowsForms> | ||
<ApplicationIcon>exeIcon2.ico</ApplicationIcon> | ||
<Version>0.8.0</Version> | ||
<PackageIcon>exeIcon2.png</PackageIcon> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Include="exeIcon2.ico" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" /> | ||
<PackageReference Include="SevenZipExtractor" Version="1.0.17" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="exeIcon2.png"> | ||
<Pack>True</Pack> | ||
<PackagePath>\</PackagePath> | ||
</None> | ||
</ItemGroup> | ||
|
||
</Project> |
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,173 @@ | ||
<Window x:Class="LOM.MainWindow" | ||
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:LOM" | ||
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" | ||
xmlns:src="clr-namespace:LOM.Converters" | ||
mc:Ignorable="d" | ||
Title="MainWindow" Height="400" Width="1050" MinWidth="1050"> | ||
<Window.Resources> | ||
<src:StringBoolDataConverter x:Key="dateConverter"/> | ||
<Style TargetType="Button" x:Key="RoundButton"> | ||
<Style.Resources> | ||
<Style TargetType="Border"> | ||
<Setter Property="CornerRadius" Value="3" /> | ||
<Setter Property="Margin" Value="5,5,5,5" /> | ||
<Setter Property="UseLayoutRounding" Value="True" /> | ||
<Setter Property="Padding" Value="5,5,5,5" /> | ||
</Style> | ||
</Style.Resources> | ||
</Style> | ||
</Window.Resources> | ||
<DockPanel Drop="Window_Drop" AllowDrop="True"> | ||
<Menu DockPanel.Dock="Top"> | ||
<MenuItem Header="Select _Main Mods Folder" Click="Select_Main_Mods_Folder"/> | ||
<MenuItem Header="Add _Secondary Mods Folder" Click="Add_Secondary_Mods_Folder"/> | ||
<MenuItem Header="Info"/> | ||
</Menu> | ||
<StackPanel DockPanel.Dock="Top"> | ||
<StackPanel Orientation="Horizontal"> | ||
<Label Content="Main Folder"/> | ||
<Label x:Name="MainFolderLabel" Content="{Binding MainModsFolder}"></Label> | ||
</StackPanel> | ||
</StackPanel> | ||
<Grid DockPanel.Dock="Top" Margin="2,4,2,2"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="150"> | ||
</ColumnDefinition> | ||
<ColumnDefinition Width="*"> | ||
</ColumnDefinition> | ||
<ColumnDefinition Width="400"> | ||
</ColumnDefinition> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="auto"> | ||
</RowDefinition> | ||
<RowDefinition Height="*"> | ||
</RowDefinition> | ||
</Grid.RowDefinitions> | ||
<Grid Grid.Column="0" Grid.Row="1" Margin="2,30,2,0"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="auto"> | ||
</ColumnDefinition> | ||
<ColumnDefinition Width="auto"> | ||
</ColumnDefinition> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="auto"> | ||
</RowDefinition> | ||
<RowDefinition Height="auto"> | ||
</RowDefinition> | ||
<RowDefinition Height="auto"> | ||
</RowDefinition> | ||
<RowDefinition Height="auto"> | ||
</RowDefinition> | ||
<RowDefinition Height="auto"> | ||
</RowDefinition> | ||
<RowDefinition Height="auto"> | ||
</RowDefinition> | ||
</Grid.RowDefinitions> | ||
<Button Style="{DynamicResource RoundButton}" Grid.Column="0" Grid.ColumnSpan="99" Click="Refresh_Button_Click" >Refresh</Button> | ||
<Button Style="{DynamicResource RoundButton}" Grid.Column="0" Grid.Row="1" Click="Upp_Button_Click">Up</Button> | ||
<Button Style="{DynamicResource RoundButton}" Grid.Column="0" Grid.Row="2" Click="Down_Button_Click">Down</Button> | ||
<Button Style="{DynamicResource RoundButton}" Grid.Column="0" Grid.Row="3" Click="Apply">Apply</Button> | ||
<Button Style="{DynamicResource RoundButton}" Grid.Column="0" Grid.Row="4" Click="Remove_Button_Click">Remove</Button> | ||
<Grid Grid.Column="1" Grid.Row="2" Grid.RowSpan="2" VerticalAlignment="Center"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="*"> | ||
</RowDefinition> | ||
<RowDefinition Height="*"> | ||
</RowDefinition> | ||
</Grid.RowDefinitions> | ||
<Button Style="{DynamicResource RoundButton}" Grid.Row="0" Click="Enable_All_Button_Click">Enable All</Button> | ||
<Button Style="{DynamicResource RoundButton}" Grid.Row="1" Click="Disable_All_Button_Click">Disable All</Button> | ||
</Grid> | ||
|
||
</Grid> | ||
|
||
<DataGrid Grid.Column="1" Grid.Row="1" | ||
x:Name="ModItemDataGrid" | ||
DataContext="{Binding ViewModel}" | ||
ItemsSource="{Binding ModInfos, Mode=TwoWay, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True, UpdateSourceTrigger=PropertyChanged}" | ||
SelectedItem="{Binding SelectedMod, Mode=TwoWay}" | ||
SelectedCellsChanged="ModItemDataGrid_SelectedCellsChanged" | ||
AutoGenerateColumns="False" | ||
SelectionMode="Single" | ||
IsReadOnly="False" | ||
CanUserAddRows="False" | ||
CanUserDeleteRows="False" | ||
CanUserReorderColumns="False" | ||
PreviewTextInput="ModItemDataGrid_PreviewTextInput" Margin="2,0,2,0"> | ||
<DataGrid.RowStyle> | ||
<Style TargetType="DataGridRow"> | ||
<Style.Triggers> | ||
<DataTrigger Binding="{Binding IsOverriden}" Value="true"> | ||
<Setter Property="Background" Value="Red"></Setter> | ||
</DataTrigger> | ||
<DataTrigger Binding="{Binding IsOverriding}" Value="true"> | ||
<Setter Property="Background" Value="Green"></Setter> | ||
</DataTrigger> | ||
</Style.Triggers> | ||
</Style> | ||
</DataGrid.RowStyle> | ||
<DataGrid.Columns> | ||
<DataGridTemplateColumn Header="X" CanUserSort="False" IsReadOnly="False"> | ||
<DataGridTemplateColumn.CellTemplate> | ||
<DataTemplate> | ||
<CheckBox Click="Enabled_CheckBox_Clicked" IsChecked="{Binding Enabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True, NotifyOnTargetUpdated=True}"/> | ||
</DataTemplate> | ||
</DataGridTemplateColumn.CellTemplate> | ||
</DataGridTemplateColumn> | ||
<DataGridTextColumn Header="Load Order" Binding="{Binding DefaultLoadOrder}" CanUserSort="False" IsReadOnly="True"/> | ||
<DataGridTextColumn Header="Display Name" Binding="{Binding DisplayName}" CanUserSort="False" IsReadOnly="True"/> | ||
<DataGridTextColumn Header="Author" Binding="{Binding Author}" CanUserSort="False" IsReadOnly="True"/> | ||
<DataGridTextColumn Header="Folder" Binding="{Binding FolderNameShort}" CanUserSort="False" IsReadOnly="True"/> | ||
</DataGrid.Columns> | ||
</DataGrid> | ||
|
||
<TabControl Grid.Column="2" Grid.Row="1"> | ||
<TabItem Header="Presets"> | ||
<DockPanel> | ||
<Button Click="Save_Preset_Button_Click" DockPanel.Dock="Top" Style="{StaticResource RoundButton}" Content="Save Preset"/> | ||
<Button Click="Load_Preset_Button_Click" DockPanel.Dock="Top" Style="{StaticResource RoundButton}" Content="Load Preset"/> | ||
<Button Click="Remove_Preset_Button_Click" DockPanel.Dock="Top" Style="{StaticResource RoundButton}" Content="Remove Preset"/> | ||
<ListBox ItemsSource="{Binding PresetNames}" DockPanel.Dock="Top" x:Name="PresetListBox" MinHeight="120" Margin="5,0,5,0"/> | ||
</DockPanel> | ||
</TabItem> | ||
<TabItem Header="Overriding Info"> | ||
<StackPanel MinHeight="100"> | ||
<Label Name="SelectedMod" Content="{Binding SelectedModLabel}"> | ||
</Label> | ||
<Grid MinHeight="100"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*"/> | ||
<ColumnDefinition Width="*"/> | ||
</Grid.ColumnDefinitions> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="auto"/> | ||
<RowDefinition Height="100"/> | ||
<RowDefinition Height="auto"/> | ||
<RowDefinition Height="*" MaxHeight="110"/> | ||
</Grid.RowDefinitions> | ||
<Label Content="Overriding" Grid.Row="0" Grid.Column="0"/> | ||
<ListBox Grid.Row="1" Grid.Column="0" ItemsSource="{Binding SelectedMod.OverridingLabls}" Margin="2,0,2,0" SelectionChanged="Overriding_ListBox_Selected"/> | ||
<Label Grid.Row="0" Grid.Column="1" Content="Overriden By"/> | ||
<ListBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding SelectedMod.OverridenByModsLabels}" Margin="2,0,2,0" SelectionChanged="OverridenBy_ListBox_Selected"/> | ||
<Label Content="Manifest" Grid.Row="2"/> | ||
<ListBox x:Name="ManifestListBox" Grid.Row="3" Grid.ColumnSpan="99" MinHeight="110" Margin="2,0,2,0"/> | ||
</Grid> | ||
</StackPanel> | ||
</TabItem> | ||
<TabItem Header="Secondary Folders"> | ||
<DockPanel> | ||
<Button Click="Remove_Secondary_Folder_Button_Click" DockPanel.Dock="Top" Style="{StaticResource RoundButton}" Content="Remove Selected"/> | ||
<ListBox DockPanel.Dock="Top" x:Name="SecondaryFoldersListBox" ItemsSource="{Binding ModSourcesNames}"/> | ||
</DockPanel> | ||
</TabItem> | ||
</TabControl> | ||
</Grid> | ||
</DockPanel> | ||
|
||
</Window> |
Oops, something went wrong.