resolve problems
Signed-off-by: clague <93119153+clague@users.noreply.github.com>
This commit is contained in:
parent
4bf6e59f3b
commit
09ec3eb621
4 changed files with 12 additions and 18 deletions
|
@ -866,13 +866,13 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||||
m_settings->reset("MetaURLOverride");
|
m_settings->reset("MetaURLOverride");
|
||||||
|
|
||||||
// Resource URL
|
// Resource URL
|
||||||
m_settings->registerSetting("ResourceURLOverride", "");
|
m_settings->registerSetting("ResourceURL", BuildConfig.DEFAULT_RESOURCE_BASE);
|
||||||
|
|
||||||
QUrl resourceUrl(m_settings->get("ResourceURLOverride").toString());
|
QUrl resourceUrl(m_settings->get("ResourceURL").toString());
|
||||||
|
|
||||||
// get rid of invalid resource urls
|
// get rid of invalid resource urls
|
||||||
if (!resourceUrl.isValid() || (resourceUrl.scheme() != "http" && resourceUrl.scheme() != "https"))
|
if (!resourceUrl.isValid() || (resourceUrl.scheme() != "http" && resourceUrl.scheme() != "https"))
|
||||||
m_settings->reset("ResourceURLOverride");
|
m_settings->reset("ResourceURL");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_settings->registerSetting("CloseAfterLaunch", false);
|
m_settings->registerSetting("CloseAfterLaunch", false);
|
||||||
|
|
|
@ -298,11 +298,7 @@ QString AssetObject::getLocalPath()
|
||||||
|
|
||||||
QUrl AssetObject::getUrl()
|
QUrl AssetObject::getUrl()
|
||||||
{
|
{
|
||||||
auto s = APPLICATION->settings();
|
auto resourceURL = APPLICATION->settings()->get("ResourceURL").toString();
|
||||||
auto resourceURL = s->get("ResourceURLOverride").toString();
|
|
||||||
if (resourceURL.isEmpty()) {
|
|
||||||
return BuildConfig.DEFAULT_RESOURCE_BASE + getRelPath();
|
|
||||||
}
|
|
||||||
return resourceURL + getRelPath();
|
return resourceURL + getRelPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "AssetUpdateTask.h"
|
#include "AssetUpdateTask.h"
|
||||||
|
|
||||||
|
#include "BuildConfig.h"
|
||||||
#include "launch/LaunchStep.h"
|
#include "launch/LaunchStep.h"
|
||||||
#include "minecraft/AssetsUtils.h"
|
#include "minecraft/AssetsUtils.h"
|
||||||
#include "minecraft/MinecraftInstance.h"
|
#include "minecraft/MinecraftInstance.h"
|
||||||
|
@ -71,15 +72,12 @@ void AssetUpdateTask::assetIndexFinished()
|
||||||
|
|
||||||
auto job = index.getDownloadJob();
|
auto job = index.getDownloadJob();
|
||||||
if (job) {
|
if (job) {
|
||||||
QString resourceURLRaw;
|
QString resourceURL = APPLICATION->settings()->get("ResourceURL").toString();
|
||||||
auto statusText = tr("Getting the assets files from Mojang...");
|
QString source = tr("Mojang");
|
||||||
resourceURLRaw = APPLICATION->settings()->get("ResourceURLOverride").toString();
|
if (resourceURL != BuildConfig.DEFAULT_RESOURCE_BASE) {
|
||||||
// FIXME: Need translation
|
source = QUrl(resourceURL).host();
|
||||||
if (!resourceURLRaw.isEmpty()) {
|
|
||||||
QUrl resourceURL = QUrl(resourceURLRaw);
|
|
||||||
statusText.replace("Mojang", resourceURL.host());
|
|
||||||
}
|
}
|
||||||
setStatus(statusText);
|
setStatus(tr("Getting the assets files from %1...").arg(source));
|
||||||
downloadJob = job;
|
downloadJob = job;
|
||||||
connect(downloadJob.get(), &NetJob::succeeded, this, &AssetUpdateTask::emitSucceeded);
|
connect(downloadJob.get(), &NetJob::succeeded, this, &AssetUpdateTask::emitSucceeded);
|
||||||
connect(downloadJob.get(), &NetJob::failed, this, &AssetUpdateTask::assetsFailed);
|
connect(downloadJob.get(), &NetJob::failed, this, &AssetUpdateTask::assetsFailed);
|
||||||
|
|
|
@ -138,7 +138,7 @@ void APIPage::loadSettings()
|
||||||
ui->msaClientID->setText(msaClientID);
|
ui->msaClientID->setText(msaClientID);
|
||||||
QString metaURL = s->get("MetaURLOverride").toString();
|
QString metaURL = s->get("MetaURLOverride").toString();
|
||||||
ui->metaURL->setText(metaURL);
|
ui->metaURL->setText(metaURL);
|
||||||
QString resourceURL = s->get("ResourceURLOverride").toString();
|
QString resourceURL = s->get("ResourceURL").toString();
|
||||||
ui->resourceURL->setText(resourceURL);
|
ui->resourceURL->setText(resourceURL);
|
||||||
QString flameKey = s->get("FlameKeyOverride").toString();
|
QString flameKey = s->get("FlameKeyOverride").toString();
|
||||||
ui->flameKey->setText(flameKey);
|
ui->flameKey->setText(flameKey);
|
||||||
|
@ -183,7 +183,7 @@ void APIPage::applySettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
s->set("MetaURLOverride", metaURL.toString());
|
s->set("MetaURLOverride", metaURL.toString());
|
||||||
s->set("ResourceURLOverride", resourceURL.toString());
|
s->set("ResourceURL", resourceURL.toString());
|
||||||
QString flameKey = ui->flameKey->text();
|
QString flameKey = ui->flameKey->text();
|
||||||
s->set("FlameKeyOverride", flameKey);
|
s->set("FlameKeyOverride", flameKey);
|
||||||
QString modrinthToken = ui->modrinthToken->text();
|
QString modrinthToken = ui->modrinthToken->text();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue