mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-04 20:36:58 +03:00
refactor: make Minecraft resource URL override consistent with other overrides
Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
(cherry picked from commit 3f0af19ed3)
This commit is contained in:
parent
2550753e1f
commit
2c782afcc4
5 changed files with 21 additions and 7 deletions
|
|
@ -73,7 +73,7 @@ void AssetUpdateTask::assetIndexFinished()
|
|||
|
||||
auto job = index.getDownloadJob();
|
||||
if (job) {
|
||||
QString resourceURL = APPLICATION->settings()->get("ResourceURL").toString();
|
||||
QString resourceURL = resourceUrl();
|
||||
QString source = tr("Mojang");
|
||||
if (resourceURL != BuildConfig.DEFAULT_RESOURCE_BASE) {
|
||||
source = QUrl(resourceURL).host();
|
||||
|
|
@ -111,3 +111,12 @@ bool AssetUpdateTask::abort()
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
QString AssetUpdateTask::resourceUrl()
|
||||
{
|
||||
if (const QString override = APPLICATION->settings()->get("ResourceURLOverride").toString(); !override.isEmpty()) {
|
||||
return override;
|
||||
}
|
||||
|
||||
return BuildConfig.DEFAULT_RESOURCE_BASE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue