Move launcher settings to separate assembly
This commit is contained in:
parent
cac403544e
commit
d6577564db
32 changed files with 137 additions and 128 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using LANCommander.Launcher.Models.Enums;
|
||||
using LANCommander.Launcher.Settings.Enums;
|
||||
using LANCommander.SDK.Enums;
|
||||
using LANCommander.SDK.Models;
|
||||
|
||||
|
|
@ -10,13 +10,13 @@ namespace LANCommander.Launcher.Models
|
|||
public GroupBy GroupBy { get; set; } = GroupBy.None;
|
||||
public SortBy SortBy { get; set; } = SortBy.Title;
|
||||
public SortDirection SortDirection { get; set; } = SortDirection.Ascending;
|
||||
public ICollection<Collection> Collections { get; set; }
|
||||
public ICollection<Engine> Engines { get; set; }
|
||||
public ICollection<Genre> Genres { get; set; }
|
||||
public ICollection<Tag> Tags { get; set; }
|
||||
public ICollection<Platform> Platforms { get; set; }
|
||||
public ICollection<Company> Developers { get; set; }
|
||||
public ICollection<Company> Publishers { get; set; }
|
||||
public ICollection<Collection> Collections { get; set; } = [];
|
||||
public ICollection<Engine> Engines { get; set; } = [];
|
||||
public ICollection<Genre> Genres { get; set; } = [];
|
||||
public ICollection<Tag> Tags { get; set; } = [];
|
||||
public ICollection<Platform> Platforms { get; set; } = [];
|
||||
public ICollection<Company> Developers { get; set; } = [];
|
||||
public ICollection<Company> Publishers { get; set; } = [];
|
||||
public int? MinPlayers { get; set; }
|
||||
public int? MaxPlayers { get; set; }
|
||||
public bool Installed { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LANCommander.Launcher.Models.Enums
|
||||
{
|
||||
public enum GroupBy
|
||||
{
|
||||
None,
|
||||
Collection,
|
||||
Genre,
|
||||
Platform
|
||||
}
|
||||
}
|
||||
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LANCommander.Launcher.Data\LANCommander.Launcher.Data.csproj" />
|
||||
<ProjectReference Include="..\LANCommander.Launcher.Settings\LANCommander.Launcher.Settings.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
using LANCommander.Launcher.Data.Models;
|
||||
using LANCommander.Launcher.Models.Enums;
|
||||
using LANCommander.Launcher.Settings.Enums;
|
||||
using LANCommander.SDK.Enums;
|
||||
|
||||
namespace LANCommander.Launcher.Models
|
||||
|
|
@ -10,12 +10,12 @@ namespace LANCommander.Launcher.Models
|
|||
public GroupBy GroupBy { get; set; } = GroupBy.Collection;
|
||||
public SortBy SortBy { get; set; } = SortBy.Title;
|
||||
public SortDirection SortDirection { get; set; } = SortDirection.Ascending;
|
||||
public ICollection<Engine> Engines { get; set; }
|
||||
public ICollection<Genre> Genres { get; set; }
|
||||
public ICollection<Tag> Tags { get; set; }
|
||||
public ICollection<Platform> Platforms { get; set; }
|
||||
public ICollection<Company> Developers { get; set; }
|
||||
public ICollection<Company> Publishers { get; set; }
|
||||
public ICollection<Engine> Engines { get; set; } = [];
|
||||
public ICollection<Genre> Genres { get; set; } = [];
|
||||
public ICollection<Tag> Tags { get; set; } = [];
|
||||
public ICollection<Platform> Platforms { get; set; } = [];
|
||||
public ICollection<Company> Developers { get; set; } = [];
|
||||
public ICollection<Company> Publishers { get; set; } = [];
|
||||
public int? MinPlayers { get; set; }
|
||||
public int? MaxPlayers { get; set; }
|
||||
public bool Installed { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
using LANCommander.Launcher.Models.Enums;
|
||||
using LANCommander.SDK.Enums;
|
||||
|
||||
namespace LANCommander.Launcher.Models
|
||||
{
|
||||
public class Settings : SDK.Models.Settings
|
||||
{
|
||||
public int LaunchCount { get; set; } = 0;
|
||||
|
||||
public DatabaseSettings Database { get; set; } = new DatabaseSettings();
|
||||
public FilterSettings Filter { get; set; } = new FilterSettings();
|
||||
public WindowSettings Window { get; set; } = new WindowSettings();
|
||||
}
|
||||
|
||||
public class DatabaseSettings
|
||||
{
|
||||
public string ConnectionString { get; set; } = "Data Source=LANCommander.db;Cache=Shared";
|
||||
public string BackupsPath { get; set; } = "Backups";
|
||||
}
|
||||
|
||||
public class FilterSettings
|
||||
{
|
||||
public string? Title { get; set; }
|
||||
public GroupBy GroupBy { get; set; } = GroupBy.Collection;
|
||||
public SortBy SortBy { get; set; } = SortBy.Title;
|
||||
public SortDirection SortDirection { get; set; } = SortDirection.Ascending;
|
||||
public IEnumerable<string> Engines { get; set; }
|
||||
public IEnumerable<string> Genres { get; set; }
|
||||
public IEnumerable<string> Tags { get; set; }
|
||||
public IEnumerable<string> Platforms { get; set; }
|
||||
public IEnumerable<string> Developers { get; set; }
|
||||
public IEnumerable<string> Publishers { get; set; }
|
||||
public int? MinPlayers { get; set; }
|
||||
public int? MaxPlayers { get; set; }
|
||||
public bool Installed { get; set; } = false;
|
||||
}
|
||||
|
||||
public class WindowSettings
|
||||
{
|
||||
public bool Maximized { get; set; } = false;
|
||||
public int Width { get; set; } = 1024;
|
||||
public int Height { get; set; } = 768;
|
||||
public int X { get; set; } = 0;
|
||||
public int Y { get; set; } = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ namespace LANCommander.Launcher.Services
|
|||
break;
|
||||
|
||||
case SDK.Enums.ScriptType.NameChange:
|
||||
await client.Scripts.RunNameChangeScriptAsync(options.InstallDirectory, options.GameId, options.NewPlayerAlias ?? Settings.DEFAULT_GAME_USERNAME);
|
||||
await client.Scripts.RunNameChangeScriptAsync(options.InstallDirectory, options.GameId, options.NewPlayerAlias ?? Settings.Settings.DEFAULT_GAME_USERNAME);
|
||||
break;
|
||||
|
||||
case SDK.Enums.ScriptType.KeyChange:
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace LANCommander.Launcher.Services.Extensions
|
|||
{
|
||||
public static IServiceProvider InitializeLANCommander(this IServiceProvider serviceProvider)
|
||||
{
|
||||
var settingsProvider = serviceProvider.GetService<SettingsProvider<Settings>>();
|
||||
var settingsProvider = serviceProvider.GetService<SettingsProvider<Settings.Settings>>();
|
||||
|
||||
var connectionStringBuilder = new DbConnectionStringBuilder();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using LANCommander.Launcher.Data.Models;
|
||||
using LANCommander.Launcher.Models;
|
||||
using LANCommander.SDK.Extensions;
|
||||
using LANCommander.SDK.Providers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace LANCommander.Launcher.Services
|
||||
|
|
@ -9,7 +8,7 @@ namespace LANCommander.Launcher.Services
|
|||
public class FilterService(
|
||||
ILogger<FilterService> logger,
|
||||
LibraryService libraryService,
|
||||
SettingsProvider<Settings> settingsProvider) : BaseService(logger)
|
||||
SettingsProvider<Settings.Settings> settingsProvider) : BaseService(logger)
|
||||
{
|
||||
public LibraryFilterModel Filter { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ using Media = LANCommander.Launcher.Data.Models.Media;
|
|||
using MultiplayerMode = LANCommander.Launcher.Data.Models.MultiplayerMode;
|
||||
using Platform = LANCommander.Launcher.Data.Models.Platform;
|
||||
using PlaySession = LANCommander.Launcher.Data.Models.PlaySession;
|
||||
using Settings = LANCommander.Launcher.Models.Settings;
|
||||
using Settings = LANCommander.Launcher.Settings.Settings;
|
||||
using Tag = LANCommander.Launcher.Data.Models.Tag;
|
||||
|
||||
namespace LANCommander.Launcher.Services
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ using System.Linq;
|
|||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using LANCommander.Launcher.Settings.Enums;
|
||||
|
||||
namespace LANCommander.Launcher.Models
|
||||
{
|
||||
|
|
@ -92,17 +93,17 @@ namespace LANCommander.Launcher.Models
|
|||
|
||||
switch (SelectedOptions.SortBy)
|
||||
{
|
||||
case Enums.SortBy.Title:
|
||||
case SortBy.Title:
|
||||
items = items.OrderByTitle(i => i.Name ?? i.SortName, SelectedOptions.SortDirection);
|
||||
break;
|
||||
|
||||
case Enums.SortBy.DateAdded:
|
||||
case SortBy.DateAdded:
|
||||
items = items.OrderBy(i =>
|
||||
(i.DataItem as DepotGame)?.CreatedOn ?? DateTime.MinValue,
|
||||
SelectedOptions.SortDirection);
|
||||
break;
|
||||
|
||||
case Enums.SortBy.DateReleased:
|
||||
case SortBy.DateReleased:
|
||||
items = items.OrderBy(i =>
|
||||
(i.DataItem as DepotGame)?.ReleasedOn ?? DateTime.MinValue,
|
||||
SelectedOptions.SortDirection);
|
||||
|
|
@ -111,11 +112,11 @@ namespace LANCommander.Launcher.Models
|
|||
|
||||
switch (SelectedOptions.GroupBy)
|
||||
{
|
||||
case Enums.GroupBy.None:
|
||||
case GroupBy.None:
|
||||
GroupSelector = (g) => Array.Empty<string>();
|
||||
break;
|
||||
|
||||
case Enums.GroupBy.Collection:
|
||||
case GroupBy.Collection:
|
||||
GroupSelector = (g) =>
|
||||
DataSource.Collections
|
||||
.Where(c => (g.DataItem as DepotGame).Collections.Any(gc => gc.Id == c.Id))
|
||||
|
|
@ -123,7 +124,7 @@ namespace LANCommander.Launcher.Models
|
|||
.ToArray() ?? Array.Empty<string>();
|
||||
break;
|
||||
|
||||
case Enums.GroupBy.Genre:
|
||||
case GroupBy.Genre:
|
||||
GroupSelector = (g) =>
|
||||
DataSource.Genres
|
||||
.Where(ge => (g.DataItem as DepotGame).Genres.Any(gge => gge.Id == ge.Id))
|
||||
|
|
@ -131,7 +132,7 @@ namespace LANCommander.Launcher.Models
|
|||
.ToArray() ?? Array.Empty<string>();
|
||||
break;
|
||||
|
||||
case Enums.GroupBy.Platform:
|
||||
case GroupBy.Platform:
|
||||
GroupSelector = (g) =>
|
||||
DataSource.Platforms
|
||||
.Where(p => (g.DataItem as DepotGame).Platforms.Any(gp => gp.Id == p.Id))
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using System.Linq;
|
|||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using LANCommander.Launcher.Settings.Enums;
|
||||
|
||||
namespace LANCommander.Launcher.Models
|
||||
{
|
||||
|
|
@ -117,23 +118,23 @@ namespace LANCommander.Launcher.Models
|
|||
|
||||
switch (SelectedOptions.SortBy)
|
||||
{
|
||||
case Enums.SortBy.Title:
|
||||
case SortBy.Title:
|
||||
items = items.OrderByTitle(i => i.Name ?? i.SortName, SelectedOptions.SortDirection);
|
||||
break;
|
||||
|
||||
case Enums.SortBy.DateAdded:
|
||||
case SortBy.DateAdded:
|
||||
items = items.OrderBy(i =>
|
||||
(i.DataItem as Game)?.CreatedOn ?? DateTime.MinValue,
|
||||
SelectedOptions.SortDirection);
|
||||
break;
|
||||
|
||||
case Enums.SortBy.DateReleased:
|
||||
case SortBy.DateReleased:
|
||||
items = items.OrderBy(i =>
|
||||
(i.DataItem as Game)?.ReleasedOn ?? DateTime.MinValue,
|
||||
SelectedOptions.SortDirection);
|
||||
break;
|
||||
|
||||
case Enums.SortBy.RecentActivity:
|
||||
case SortBy.RecentActivity:
|
||||
items = items.OrderBy(i =>
|
||||
(i.DataItem as Game)?.PlaySessions?
|
||||
.Where(ps => ps?.End != null)
|
||||
|
|
@ -142,7 +143,7 @@ namespace LANCommander.Launcher.Models
|
|||
SelectedOptions.SortDirection);
|
||||
break;
|
||||
|
||||
case Enums.SortBy.MostPlayed:
|
||||
case SortBy.MostPlayed:
|
||||
items = items.OrderBy(i =>
|
||||
(i.DataItem as Game)?.PlaySessions?.Sum(
|
||||
ps => ps.End.Value.Subtract(ps.Start.Value).TotalSeconds), SelectedOptions.SortDirection);
|
||||
|
|
@ -151,11 +152,11 @@ namespace LANCommander.Launcher.Models
|
|||
|
||||
switch (SelectedOptions.GroupBy)
|
||||
{
|
||||
case Enums.GroupBy.None:
|
||||
case GroupBy.None:
|
||||
GroupSelector = (g) => Array.Empty<string>();
|
||||
break;
|
||||
|
||||
case Enums.GroupBy.Collection:
|
||||
case GroupBy.Collection:
|
||||
GroupSelector = (g) =>
|
||||
(g.DataItem as Game)?.Collections?
|
||||
.Where(c => c?.Name != null)
|
||||
|
|
@ -163,7 +164,7 @@ namespace LANCommander.Launcher.Models
|
|||
.ToArray() ?? Array.Empty<string>();
|
||||
break;
|
||||
|
||||
case Enums.GroupBy.Genre:
|
||||
case GroupBy.Genre:
|
||||
GroupSelector = (g) =>
|
||||
(g.DataItem as Game)?.Genres?
|
||||
.Where(ge => ge?.Name != null)
|
||||
|
|
@ -171,7 +172,7 @@ namespace LANCommander.Launcher.Models
|
|||
.ToArray() ?? Array.Empty<string>();
|
||||
break;
|
||||
|
||||
case Enums.GroupBy.Platform:
|
||||
case GroupBy.Platform:
|
||||
GroupSelector = (g) =>
|
||||
(g.DataItem as Game)?.Platforms?
|
||||
.Where(p => p?.Name != null)
|
||||
|
|
|
|||
7
LANCommander.Launcher.Settings/DatabaseSettings.cs
Normal file
7
LANCommander.Launcher.Settings/DatabaseSettings.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
namespace LANCommander.Launcher.Settings;
|
||||
|
||||
public class DatabaseSettings
|
||||
{
|
||||
public string ConnectionString { get; set; } = "Data Source=LANCommander.db;Cache=Shared";
|
||||
public string BackupsPath { get; set; } = "Backups";
|
||||
}
|
||||
10
LANCommander.Launcher.Settings/Enums/GroupBy.cs
Normal file
10
LANCommander.Launcher.Settings/Enums/GroupBy.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
namespace LANCommander.Launcher.Settings.Enums
|
||||
{
|
||||
public enum GroupBy
|
||||
{
|
||||
None,
|
||||
Collection,
|
||||
Genre,
|
||||
Platform
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace LANCommander.Launcher.Models.Enums
|
||||
namespace LANCommander.Launcher.Settings.Enums
|
||||
{
|
||||
public enum SortBy
|
||||
{
|
||||
21
LANCommander.Launcher.Settings/FilterSettings.cs
Normal file
21
LANCommander.Launcher.Settings/FilterSettings.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using LANCommander.Launcher.Settings.Enums;
|
||||
using LANCommander.SDK.Enums;
|
||||
|
||||
namespace LANCommander.Launcher.Settings;
|
||||
|
||||
public class FilterSettings
|
||||
{
|
||||
public string? Title { get; set; }
|
||||
public GroupBy GroupBy { get; set; } = GroupBy.Collection;
|
||||
public SortBy SortBy { get; set; } = SortBy.Title;
|
||||
public SortDirection SortDirection { get; set; } = SortDirection.Ascending;
|
||||
public IEnumerable<string> Engines { get; set; } = [];
|
||||
public IEnumerable<string> Genres { get; set; } = [];
|
||||
public IEnumerable<string> Tags { get; set; } = [];
|
||||
public IEnumerable<string> Platforms { get; set; } = [];
|
||||
public IEnumerable<string> Developers { get; set; } = [];
|
||||
public IEnumerable<string> Publishers { get; set; } = [];
|
||||
public int? MinPlayers { get; set; }
|
||||
public int? MaxPlayers { get; set; }
|
||||
public bool Installed { get; set; } = false;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
11
LANCommander.Launcher.Settings/Settings.cs
Normal file
11
LANCommander.Launcher.Settings/Settings.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace LANCommander.Launcher.Settings
|
||||
{
|
||||
public class Settings : SDK.Models.Settings
|
||||
{
|
||||
public int LaunchCount { get; set; } = 0;
|
||||
|
||||
public DatabaseSettings Database { get; set; } = new();
|
||||
public FilterSettings Filter { get; set; } = new();
|
||||
public WindowSettings Window { get; set; } = new();
|
||||
}
|
||||
}
|
||||
10
LANCommander.Launcher.Settings/WindowSettings.cs
Normal file
10
LANCommander.Launcher.Settings/WindowSettings.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
namespace LANCommander.Launcher.Settings;
|
||||
|
||||
public class WindowSettings
|
||||
{
|
||||
public bool Maximized { get; set; } = false;
|
||||
public int Width { get; set; } = 1024;
|
||||
public int Height { get; set; } = 768;
|
||||
public int X { get; set; } = 0;
|
||||
public int Y { get; set; } = 0;
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ namespace LANCommander.Launcher
|
|||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var connectionClient = scope.ServiceProvider.GetService<IConnectionClient>();
|
||||
var settingsProvider = scope.ServiceProvider.GetService<SettingsProvider<Settings>>();
|
||||
var settingsProvider = scope.ServiceProvider.GetService<SettingsProvider<Settings.Settings>>();
|
||||
var databaseContext = scope.ServiceProvider.GetService<DatabaseContext>();
|
||||
|
||||
if (!(await connectionClient.PingAsync()))
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace LANCommander.Launcher.Services
|
|||
{
|
||||
private readonly ResourceManager _resourceManager;
|
||||
|
||||
public LocalizationService(IOptions<Settings> settings)
|
||||
public LocalizationService(IOptions<Settings.Settings> settings)
|
||||
{
|
||||
_resourceManager = new ResourceManager("LANCommander.Launcher.Resources.SharedResources", typeof(LocalizationService).Assembly);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using LANCommander.SDK.Providers;
|
|||
using LANCommander.SDK.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Photino.Blazor;
|
||||
using Photino.Blazor.CustomWindow.Extensions;
|
||||
using Photino.NET;
|
||||
|
|
@ -43,7 +44,7 @@ internal static class WindowService
|
|||
builder.Services.AddCustomWindow();
|
||||
builder.Services.AddAntDesign();
|
||||
builder.Services.AddSingleton<LocalizationService>();
|
||||
builder.Services.AddLANCommanderClient<Settings>();
|
||||
builder.Services.AddLANCommanderClient<Settings.Settings>();
|
||||
builder.Services.AddLANCommanderLauncher(options =>
|
||||
{
|
||||
|
||||
|
|
@ -90,7 +91,7 @@ internal static class WindowService
|
|||
|
||||
static PhotinoBlazorApp RegisterMediaHandler(this PhotinoBlazorApp app)
|
||||
{
|
||||
var settingsProvider = app.Services.GetService<SettingsProvider<Settings>>();
|
||||
var settings = app.Services.GetService<IOptions<Settings.Settings>>();
|
||||
|
||||
app.MainWindow.RegisterCustomSchemeHandler("media",
|
||||
(object sender, string scheme, string url, out string contentType) =>
|
||||
|
|
@ -108,7 +109,7 @@ internal static class WindowService
|
|||
|
||||
contentType = mime;
|
||||
|
||||
var filePath = Path.Combine(settingsProvider.CurrentValue.Media.StoragePath, $"{fileId}-{crc32}");
|
||||
var filePath = Path.Combine(settings.Value.Media.StoragePath, $"{fileId}-{crc32}");
|
||||
|
||||
if (File.Exists(filePath))
|
||||
return new FileStream(filePath, FileMode.Open, FileAccess.Read);
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ public static class ApplicationSettings
|
|||
|
||||
var configurationBuilder = new ConfigurationBuilder();
|
||||
|
||||
var configuration = configurationBuilder.ReadFromFile<Settings>();
|
||||
var refresher = configurationBuilder.ReadFromServer<Settings>(configuration);
|
||||
var configuration = configurationBuilder.ReadFromFile<Settings.Settings>();
|
||||
var refresher = configurationBuilder.ReadFromServer<Settings.Settings>(configuration);
|
||||
|
||||
configuration = configurationBuilder.Build();
|
||||
|
||||
builder.Services.Configure<Settings>(configuration);
|
||||
builder.Services.Configure<Settings.Settings>(configuration);
|
||||
builder.Services.AddSingleton(refresher);
|
||||
|
||||
Log.Debug("Validating settings");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public static class MainWindow
|
|||
|
||||
public static PhotinoBlazorApp RegisterMediaHandler(this PhotinoBlazorApp app)
|
||||
{
|
||||
var settingsProvider = app.Services.GetService<SettingsProvider<Settings>>();
|
||||
var settingsProvider = app.Services.GetService<SettingsProvider<Settings.Settings>>();
|
||||
|
||||
app.MainWindow.RegisterCustomSchemeHandler("media",
|
||||
(object sender, string scheme, string url, out string contentType) =>
|
||||
|
|
@ -116,7 +116,7 @@ public static class MainWindow
|
|||
|
||||
public static PhotinoBlazorApp RestoreWindowPosition(this PhotinoBlazorApp app)
|
||||
{
|
||||
var settingsProvider = app.Services.GetService<SettingsProvider<Settings>>();
|
||||
var settingsProvider = app.Services.GetService<SettingsProvider<Settings.Settings>>();
|
||||
|
||||
if (settingsProvider.CurrentValue.Window.Maximized)
|
||||
app.MainWindow.SetMaximized(true);
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.Launcher.Settings
|
||||
@using LANCommander.SDK.Services
|
||||
@inject InstallService InstallService
|
||||
@inject LibraryService LibraryService
|
||||
@inject GameClient GameClient
|
||||
@inject SettingsProvider<Models.Settings> SettingsProvider
|
||||
@inject SettingsProvider<Settings> SettingsProvider
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject LocalizationService LocalizationService
|
||||
@inject ConfirmService ConfirmService
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
@using LANCommander.Launcher.Data.Models
|
||||
@using LANCommander.Launcher.Models
|
||||
@using System.Diagnostics
|
||||
@using LANCommander.Launcher.Settings
|
||||
@using LANCommander.SDK
|
||||
@using LANCommander.SDK.Helpers
|
||||
@using LANCommander.SDK.Services
|
||||
|
|
@ -304,7 +305,7 @@ else
|
|||
|
||||
foreach (var manifest in manifests)
|
||||
{
|
||||
await Client.Scripts.RunNameChangeScriptAsync(Game.InstallDirectory, Game.Id, user.GetUserNameSafe ?? Models.Settings.DEFAULT_GAME_USERNAME);
|
||||
await Client.Scripts.RunNameChangeScriptAsync(Game.InstallDirectory, Game.Id, user.GetUserNameSafe ?? Settings.DEFAULT_GAME_USERNAME);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,8 @@
|
|||
@using LANCommander.Launcher.Data.Models
|
||||
@using LANCommander.Launcher.Models.Enums
|
||||
@using LANCommander.Launcher.Models
|
||||
@using System.Collections.ObjectModel
|
||||
@using LANCommander.Launcher.Settings.Enums
|
||||
@namespace LANCommander.Launcher.UI
|
||||
@inject LibraryService LibraryService
|
||||
@inject EngineService EngineService
|
||||
@inject GenreService GenreService
|
||||
@inject TagService TagService
|
||||
@inject MessageBusService MessageBusService
|
||||
@inject LocalizationService LocalizationService
|
||||
|
||||
<Flex>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
@using LANCommander.Launcher.Data.Models
|
||||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.Launcher.Settings
|
||||
@using LANCommander.SDK.Services
|
||||
@inject UserService UserService
|
||||
@inject ProfileService ProfileService
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
@using LANCommander.Launcher.Models.Enums
|
||||
@using LANCommander.Launcher.Settings.Enums
|
||||
@using LANCommander.SDK.Models
|
||||
@namespace LANCommander.Launcher.UI.Components
|
||||
@inject DepotService DepotService
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
@using LANCommander.Launcher.Models
|
||||
@using LANCommander.Launcher.Settings
|
||||
@using LANCommander.SDK
|
||||
@using LANCommander.SDK.Services
|
||||
@using Button = AntDesign.Button
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
@inject IMessageService MessageService
|
||||
@inject ILogger<Index> Logger
|
||||
@inject LocalizationService LocalizationService
|
||||
@inject SettingsProvider<Models.Settings> SettingsProvider
|
||||
@inject SettingsProvider<Launcher.Settings.Settings> SettingsProvider
|
||||
|
||||
<div style="flex-grow: 1">
|
||||
<PageHeader Title="Settings" OnBack="@(() => { NavigationManager.NavigateTo("/"); })" Style="padding-top: 48px">
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
</Flex>
|
||||
|
||||
@code {
|
||||
Settings _settings;
|
||||
Launcher.Settings.Settings _settings;
|
||||
List<InstallDirectory> _installDirectories = new();
|
||||
|
||||
string[] _supportedCultures = new[]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
@using Photino.Blazor.CustomWindow.Components
|
||||
@using LANCommander.Launcher.Settings
|
||||
@using Photino.Blazor.CustomWindow.Components
|
||||
@inherits LayoutComponentBase
|
||||
@inject ProfileService ProfileService
|
||||
@inject AuthenticationService AuthenticationService
|
||||
|
|
@ -31,7 +32,7 @@
|
|||
</CustomWindow>
|
||||
|
||||
@code {
|
||||
Models.Settings Settings = null;
|
||||
Settings Settings = null;
|
||||
|
||||
string RandomQuip = "";
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<Project Path="LANCommander.Launcher.Data\LANCommander.Launcher.Data.csproj" />
|
||||
<Project Path="LANCommander.Launcher.Models\LANCommander.Launcher.Models.csproj" />
|
||||
<Project Path="LANCommander.Launcher.Services\LANCommander.Launcher.Services.csproj" />
|
||||
<Project Path="LANCommander.Launcher.Settings\LANCommander.Launcher.Settings.csproj" Type="Classic C#" />
|
||||
<Project Path="LANCommander.Launcher\LANCommander.Launcher.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/LANCommander.Server/">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue