fix assets on windows

Windows uses drive letters and backspaces, hence it breaks a lot.
This commit is contained in:
Moritz Zwerger 2024-01-12 21:16:30 +01:00
parent 94954657ca
commit 44813001a1
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
3 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ class DirectoryAssetsManager(
continue continue
} }
if (root) continue // root path just allows folders if (root) continue // root path just allows folders
val path = file.toPath().relativeTo(basePath).toString().removePrefix(File.separator).toAssetName(false, prefix) ?: continue val path = file.toPath().relativeTo(basePath).toString().replace("\\", "/").removePrefix("/").toAssetName(false, prefix) ?: continue
assets += path assets += path
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
* Minosoft * Minosoft
* Copyright (C) 2020-2023 Moritz Zwerger * Copyright (C) 2020-2024 Moritz Zwerger
* *
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
* *
@ -33,7 +33,7 @@ object ResourcesAssetsUtil {
} }
return when (rootResources.protocol) { return when (rootResources.protocol) {
"file" -> DirectoryAssetsManager(Path.of(rootResources.path).parent, canUnload, prefix) // Read them directly from the folder "file" -> DirectoryAssetsManager(Path.of(rootResources.toURI()).parent, canUnload, prefix) // Read them directly from the folder
"jar" -> { "jar" -> {
val path: String = rootResources.path val path: String = rootResources.path
val jarPath = path.substring(5, path.indexOf("!")) val jarPath = path.substring(5, path.indexOf("!"))

View File

@ -32,7 +32,7 @@ class UpdaterC(profile: OtherProfile) {
/** /**
* Update channel * Update channel
* If automatic, it chooses either stable or beta matching the current executed version * If set to `auto`, it will download the update from the same branch as the running version
*/ */
var channel by StringDelegate(profile, "auto") var channel by StringDelegate(profile, "auto")