Skip to content

Commit

Permalink
Add a way to use local, non-updatable Dalamud versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
redstrate committed Jun 29, 2024
1 parent d51ba16 commit dfabcd6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion launcher/include/profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Profile : public QObject
enum class WineType { BuiltIn, Custom };
Q_ENUM(WineType)

enum class DalamudChannel { Stable, Staging };
enum class DalamudChannel { Stable, Staging, Local };
Q_ENUM(DalamudChannel)

enum class DalamudInjectMethod { Entrypoint, DLLInject };
Expand Down
14 changes: 9 additions & 5 deletions launcher/src/assetupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ QCoro::Task<bool> AssetUpdater::update()
Utility::createPathIfNeeded(m_dalamudAssetDir);
Utility::createPathIfNeeded(m_dalamudRuntimeDir);

if (!co_await checkRemoteDalamudAssetVersion()) {
co_return false;
}
if (m_profile.dalamudChannel() != Profile::DalamudChannel::Local) {
if (!co_await checkRemoteDalamudAssetVersion()) {
co_return false;
}

if (!co_await checkRemoteDalamudVersion()) {
co_return false;
if (!co_await checkRemoteDalamudVersion()) {
co_return false;
}
} else {
qInfo(ASTRA_LOG) << "Using a local Dalamud installation, skipping version checks!";
}

co_return true;
Expand Down
5 changes: 4 additions & 1 deletion launcher/src/profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ QString Profile::dalamudChannelName() const
return QStringLiteral("stable");
case DalamudChannel::Staging:
return QStringLiteral("staging");
case DalamudChannel::Local:
return QStringLiteral("local");
}

Q_UNREACHABLE();
Expand Down Expand Up @@ -563,7 +565,8 @@ void Profile::setDalamudApplicable(bool applicable)

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
Expand Down
2 changes: 1 addition & 1 deletion launcher/ui/Settings/ProfileSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ FormCard.FormCardPage {
id: dalamudChannelDelegate

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
onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex
enabled: page.profile.dalamudEnabled
Expand Down

0 comments on commit dfabcd6

Please sign in to comment.