1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00

Add a way to use local, non-updatable Dalamud versions

You can now plop your own custom Dalamud installation into a "local"
folder under %APPDATA\dalamud and Astra will use it without question. It
won't update it or perform any game version checks.
This commit is contained in:
Joshua Goins 2024-06-29 19:33:39 -04:00
parent d51ba16e5c
commit dfabcd6cd9
4 changed files with 15 additions and 8 deletions

View file

@ -51,7 +51,7 @@ public:
enum class WineType { BuiltIn, Custom }; enum class WineType { BuiltIn, Custom };
Q_ENUM(WineType) Q_ENUM(WineType)
enum class DalamudChannel { Stable, Staging }; enum class DalamudChannel { Stable, Staging, Local };
Q_ENUM(DalamudChannel) Q_ENUM(DalamudChannel)
enum class DalamudInjectMethod { Entrypoint, DLLInject }; enum class DalamudInjectMethod { Entrypoint, DLLInject };

View file

@ -65,6 +65,7 @@ QCoro::Task<bool> AssetUpdater::update()
Utility::createPathIfNeeded(m_dalamudAssetDir); Utility::createPathIfNeeded(m_dalamudAssetDir);
Utility::createPathIfNeeded(m_dalamudRuntimeDir); Utility::createPathIfNeeded(m_dalamudRuntimeDir);
if (m_profile.dalamudChannel() != Profile::DalamudChannel::Local) {
if (!co_await checkRemoteDalamudAssetVersion()) { if (!co_await checkRemoteDalamudAssetVersion()) {
co_return false; co_return false;
} }
@ -72,6 +73,9 @@ QCoro::Task<bool> AssetUpdater::update()
if (!co_await checkRemoteDalamudVersion()) { if (!co_await checkRemoteDalamudVersion()) {
co_return false; co_return false;
} }
} else {
qInfo(ASTRA_LOG) << "Using a local Dalamud installation, skipping version checks!";
}
co_return true; co_return true;
} }

View file

@ -493,6 +493,8 @@ QString Profile::dalamudChannelName() const
return QStringLiteral("stable"); return QStringLiteral("stable");
case DalamudChannel::Staging: case DalamudChannel::Staging:
return QStringLiteral("staging"); return QStringLiteral("staging");
case DalamudChannel::Local:
return QStringLiteral("local");
} }
Q_UNREACHABLE(); Q_UNREACHABLE();
@ -563,7 +565,8 @@ void Profile::setDalamudApplicable(bool applicable)
bool Profile::dalamudShouldLaunch() const bool Profile::dalamudShouldLaunch() const
{ {
return dalamudEnabled() && m_dalamudApplicable; // Local Dalamud installations can always run
return dalamudEnabled() && (dalamudChannel() != DalamudChannel::Local ? m_dalamudApplicable : true);
} }
QString Profile::compatibilityToolVersion() const QString Profile::compatibilityToolVersion() const

View file

@ -238,7 +238,7 @@ FormCard.FormCardPage {
id: dalamudChannelDelegate id: dalamudChannelDelegate
text: i18n("Update Channel") text: i18n("Update Channel")
model: [i18n("Stable"), i18n("Staging")] model: LauncherCore.settings.showDevTools ? [i18n("Stable"), i18n("Staging"), i18n("Local")] : [i18n("Stable"), i18n("Staging")]
currentIndex: page.profile.dalamudChannel currentIndex: page.profile.dalamudChannel
onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex
enabled: page.profile.dalamudEnabled enabled: page.profile.dalamudEnabled