mirror of
https://github.com/rfvgyhn/min-ed-launcher.git
synced 2026-02-04 14:55:33 +00:00
@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- Add support for specifying Elite's language instead of just using the system default
|
||||||
|
|
||||||
## [0.2.0] - 2020-12-13
|
## [0.2.0] - 2020-12-13
|
||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
|
|||||||
16
README.md
16
README.md
@ -112,13 +112,14 @@ Windows: `%LOCALAPPDATA%\min-ed-launcher\settings.json`
|
|||||||
|
|
||||||
Linux: `$XDG_CONFIG_DIR/min-ed-launcher/settings.json` (`~/.config` if `$XDG_CONFIG_DIR` isn't set)
|
Linux: `$XDG_CONFIG_DIR/min-ed-launcher/settings.json` (`~/.config` if `$XDG_CONFIG_DIR` isn't set)
|
||||||
|
|
||||||
| Settings | Effect |
|
| Settings | Effect |
|
||||||
|-----------------|-------------------------------------------------------------------------------------------|
|
|-----------------|------------------------------------------------------------------------------------------------------------------------|
|
||||||
| apiUri | FDev API base URI. Should only be changed if you are doing local development |
|
| apiUri | FDev API base URI. Should only be changed if you are doing local development |
|
||||||
| watchForCrashes | Determines if the game should be launched by `WatchDog64.exe` or not |
|
| watchForCrashes | Determines if the game should be launched by `WatchDog64.exe` or not |
|
||||||
| gameLocation | Path to game's install folder. Specify this if the launcher can't figure it out by itself |
|
| gameLocation | Path to game's install folder. Specify this if the launcher can't figure it out by itself |
|
||||||
| restart | Restart the game after it has closed |
|
| language | Sets the game's language. Supported values are _en_ and the names of the language folders in Elite's install directory |
|
||||||
| processes | Additional applications to launch before launching the game |
|
| restart | Restart the game after it has closed |
|
||||||
|
| processes | Additional applications to launch before launching the game |
|
||||||
|
|
||||||
When specifying a path for either `gameLocation` or `processes.fileName` on Windows, it's required to escape backslashes. Make sure to use a
|
When specifying a path for either `gameLocation` or `processes.fileName` on Windows, it's required to escape backslashes. Make sure to use a
|
||||||
double backslash (`\\`) instead of a single backslash (`\`).
|
double backslash (`\\`) instead of a single backslash (`\`).
|
||||||
@ -128,6 +129,7 @@ double backslash (`\\`) instead of a single backslash (`\`).
|
|||||||
"apiUri": "https://api.zaonce.net",
|
"apiUri": "https://api.zaonce.net",
|
||||||
"watchForCrashes": false,
|
"watchForCrashes": false,
|
||||||
"gameLocation": null,
|
"gameLocation": null,
|
||||||
|
"language": "en",
|
||||||
"restart": {
|
"restart": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"shutdownTimeout": 3
|
"shutdownTimeout": 3
|
||||||
|
|||||||
@ -167,7 +167,7 @@ let run settings = task {
|
|||||||
|
|
||||||
match selectedProduct, true with
|
match selectedProduct, true with
|
||||||
| Some product, true ->
|
| Some product, true ->
|
||||||
let gameLanguage = Cobra.getGameLang settings.CbLauncherDir
|
let gameLanguage = Cobra.getGameLang settings.CbLauncherDir settings.PreferredLanguage
|
||||||
let processArgs() = Product.createArgString settings.DisplayMode gameLanguage connection.Session machineId (runningTime()) settings.WatchForCrashes settings.Platform SHA1.hashFile product
|
let processArgs() = Product.createArgString settings.DisplayMode gameLanguage connection.Session machineId (runningTime()) settings.WatchForCrashes settings.Platform SHA1.hashFile product
|
||||||
|
|
||||||
match Product.validateForRun settings.CbLauncherDir settings.WatchForCrashes product with
|
match Product.validateForRun settings.CbLauncherDir settings.WatchForCrashes product with
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
module MinEdLauncher.Cobra
|
module MinEdLauncher.Cobra
|
||||||
open System
|
open System
|
||||||
open System.Diagnostics
|
open System.Diagnostics
|
||||||
|
open System.Globalization
|
||||||
open System.IO
|
open System.IO
|
||||||
open System.Reflection
|
open System.Reflection
|
||||||
open System.Resources
|
open System.Resources
|
||||||
@ -27,10 +28,18 @@ let getVersion cbLauncherDir =
|
|||||||
|
|
||||||
Ok (cobraVersion, launcherVersion)
|
Ok (cobraVersion, launcherVersion)
|
||||||
|
|
||||||
let getGameLang cbLauncherDir =
|
let getGameLang cbLauncherDir langCode =
|
||||||
let asm = Assembly.LoadFrom(Path.Combine(cbLauncherDir, "LocalResources.dll"))
|
let asm = Assembly.LoadFrom(Path.Combine(cbLauncherDir, $"LocalResources.dll"))
|
||||||
let resManager = ResourceManager("LocalResources.Properties.Resources", asm)
|
let resManager = ResourceManager("LocalResources.Properties.Resources", asm)
|
||||||
try
|
try
|
||||||
resManager.GetString("GameLanguage") |> Some
|
langCode
|
||||||
with
|
|> Option.bind (fun c ->
|
||||||
| e -> None
|
if Directory.Exists(Path.Combine(cbLauncherDir, c))
|
||||||
|
|| c.Equals("en", StringComparison.OrdinalIgnoreCase)
|
||||||
|
then c.ToLowerInvariant() |> Some
|
||||||
|
else None)
|
||||||
|
|> Option.map (fun c ->
|
||||||
|
let culture = CultureInfo.CreateSpecificCulture(c)
|
||||||
|
resManager.GetString("GameLanguage", culture))
|
||||||
|
|> Option.orElseWith (fun () -> resManager.GetString("GameLanguage") |> Some)
|
||||||
|
with e -> None
|
||||||
@ -17,6 +17,7 @@ let defaults =
|
|||||||
ForceLocal = false
|
ForceLocal = false
|
||||||
Proton = None
|
Proton = None
|
||||||
CbLauncherDir = "."
|
CbLauncherDir = "."
|
||||||
|
PreferredLanguage = None
|
||||||
ApiUri = Uri("http://localhost:8080")
|
ApiUri = Uri("http://localhost:8080")
|
||||||
Restart = false, 0L
|
Restart = false, 0L
|
||||||
Processes = List.empty }
|
Processes = List.empty }
|
||||||
@ -97,6 +98,7 @@ type Config =
|
|||||||
{ ApiUri: string
|
{ ApiUri: string
|
||||||
WatchForCrashes: bool
|
WatchForCrashes: bool
|
||||||
GameLocation: string option
|
GameLocation: string option
|
||||||
|
Language: string option
|
||||||
Restart: RestartConfig
|
Restart: RestartConfig
|
||||||
Processes: ProcessConfig list }
|
Processes: ProcessConfig list }
|
||||||
let parseConfig fileName =
|
let parseConfig fileName =
|
||||||
@ -154,6 +156,7 @@ let getSettings args fileConfig =
|
|||||||
|
|
||||||
parseArgs defaults fallbackDirs args
|
parseArgs defaults fallbackDirs args
|
||||||
|> Result.map (fun settings -> { settings with ApiUri = apiUri
|
|> Result.map (fun settings -> { settings with ApiUri = apiUri
|
||||||
|
PreferredLanguage = fileConfig.Language
|
||||||
Processes = processes
|
Processes = processes
|
||||||
Restart = restart
|
Restart = restart
|
||||||
WatchForCrashes = fileConfig.WatchForCrashes })
|
WatchForCrashes = fileConfig.WatchForCrashes })
|
||||||
@ -34,6 +34,7 @@ type LauncherSettings =
|
|||||||
ForceLocal: ForceLocal
|
ForceLocal: ForceLocal
|
||||||
Proton: Proton option
|
Proton: Proton option
|
||||||
CbLauncherDir: string
|
CbLauncherDir: string
|
||||||
|
PreferredLanguage: string option
|
||||||
ApiUri: Uri
|
ApiUri: Uri
|
||||||
Restart: (bool * int64)
|
Restart: (bool * int64)
|
||||||
Processes: ProcessStartInfo list }
|
Processes: ProcessStartInfo list }
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"apiUri": "https://api.zaonce.net",
|
"apiUri": "https://api.zaonce.net",
|
||||||
"watchForCrashes": false,
|
"watchForCrashes": false,
|
||||||
|
"language": null,
|
||||||
"restart": {
|
"restart": {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
"shutdownTimeout": 3
|
"shutdownTimeout": 3
|
||||||
|
|||||||
Reference in New Issue
Block a user