Skip to content
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
22 changes: 20 additions & 2 deletions Knossos.NET/Models/CustomLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,28 @@ public static class CustomLauncher

/// <summary>
/// Starting width size of the launcher window
/// This is also the min width
/// null for auto
/// </summary>
public static int? WindowWidth { get; private set; } = 1024;

/// <summary>
/// Starting height size of the launcher window
/// This is also the min height
/// null for auto
/// </summary>
public static int? WindowHeight { get; private set; } = 540;

/// <summary>
/// This is the min width for the launcher
/// null for auto
/// </summary>
public static int? MinWindowWidth { get; private set; } = 900;

/// <summary>
/// This is the min height for the launcher
/// null for auto
/// </summary>
public static int? MinWindowHeight { get; private set; } = 500;

/// <summary>
/// Configurable option to show the task buttom at the end of the menu buttom list
/// instead of at the beginning.
Expand Down Expand Up @@ -290,6 +300,12 @@ private static void ReadCustomFile()
if (customData.WindowHeight != null)
WindowHeight = customData.WindowHeight;

if (customData.MinWindowWidth != null)
MinWindowWidth = customData.MinWindowWidth;

if (customData.MinWindowHeight != null)
MinWindowHeight = customData.MinWindowHeight;

if (customData.MenuTaskButtonAtTheEnd.HasValue)
MenuTaskButtonAtTheEnd = customData.MenuTaskButtonAtTheEnd.Value;

Expand Down Expand Up @@ -357,6 +373,8 @@ struct CustomFileData
public string? NebulaTextToolTip { get; set; }
public int? WindowWidth { get; set; }
public int? WindowHeight { get; set; }
public int? MinWindowWidth { get; set; }
public int? MinWindowHeight { get; set; }
public bool? MenuTaskButtonAtTheEnd { get; set; }
public bool? MenuOpenFirstTime { get; set; }
public bool? MenuDisplayEngineEntry { get; set; }
Expand Down
8 changes: 8 additions & 0 deletions Knossos.NET/ViewModels/Windows/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ public partial class MainWindowViewModel : ViewModelBase
[ObservableProperty]
internal int? windowHeight = null;
[ObservableProperty]
internal int? minWindowWidth = null;
[ObservableProperty]
internal int? minWindowHeight = null;
[ObservableProperty]
internal ModListViewModel? installedModsView;
[ObservableProperty]
internal NebulaModListViewModel? nebulaModsView;
Expand Down Expand Up @@ -109,6 +113,8 @@ public MainWindowViewModel()
}
if (!CustomLauncher.IsCustomMode)
{
MinWindowWidth = 900;
MinWindowHeight = 500;
placeholderTileImage = new Bitmap(AssetLoader.Open(new Uri("avares://Knossos.NET/Assets/general/NebulaDefault.png")));
InstalledModsView = new ModListViewModel();
NebulaModsView = new NebulaModListViewModel();
Expand All @@ -127,6 +133,8 @@ public MainWindowViewModel()
AppTitle = CustomLauncher.WindowTitle + " v" + Knossos.AppVersion;
WindowHeight = CustomLauncher.WindowHeight;
WindowWidth = CustomLauncher.WindowWidth;
MinWindowWidth = CustomLauncher.MinWindowWidth;
MinWindowHeight = CustomLauncher.MinWindowHeight;
CustomHomeVM = new CustomHomeViewModel();
if (CustomLauncher.MenuDisplayEngineEntry)
FsoBuildsView = new FsoBuildsViewModel();
Expand Down
4 changes: 2 additions & 2 deletions Knossos.NET/Views/Windows/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
xmlns:v="using:Knossos.NET.Views"
Width="{Binding WindowWidth}"
Height="{Binding WindowHeight}"
MinWidth="{Binding WindowWidth}"
MinHeight="{Binding WindowHeight}"
MinWidth="{Binding MinWindowWidth}"
MinHeight="{Binding MinWindowHeight}"
x:DataType="vm:MainWindowViewModel"
mc:Ignorable="d" d:DesignWidth="1000" d:DesignHeight="900"
x:Class="Knossos.NET.Views.MainWindow"
Expand Down