Skip to content

Commit

Permalink
Enable Vanguard patcher by default
Browse files Browse the repository at this point in the history
  • Loading branch information
moonshadow565 committed May 1, 2024
1 parent 81c9c2e commit ca75917
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
13 changes: 8 additions & 5 deletions cslol-tools/lib/lol/patcher/patcher_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,8 @@ auto patcher::run(std::function<void(Message, char const*)> update,
fs::path const& game_path,
fs::names const& opts) -> void {
lol_throw_if(skinhack_detected());
for (auto const& o : opts) {
if (o == "dllpatcher") {
if (new_patcher(std::move(update), profile_path, config_path, game_path, opts)) return;
}
}
if (new_patcher(std::move(update), profile_path, config_path, game_path, opts)) return;

auto ctx = Context{};
ctx.set_prefix(profile_path);
ctx.kernel32 = Kernel32::load();
Expand Down Expand Up @@ -417,6 +414,12 @@ static auto new_patcher(std::function<void(Message, char const*)> update,
fs::path const& config_path,
fs::path const& game_path,
fs::names const& opts) -> bool {
for (auto const& o : opts) {
if (o == "oldpatcher") {
return false;
}
}

// Initialize first proces.
lol_throw_if(cslol_init());
lol_throw_if(cslol_set_flags(CSLOL_HOOK_DISALBE_NONE));
Expand Down
2 changes: 1 addition & 1 deletion src/CSLOLTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CSLOLTools : public QObject {
void deleteMod(QString name);
void exportMod(QString name, QString dest);
void installFantomeZip(QString path);
void saveProfile(QString name, QJsonObject mods, bool run, bool skipConflict, bool experimentalDll);
void saveProfile(QString name, QJsonObject mods, bool run, bool skipConflict, bool oldPatcher);
void loadProfile(QString name);
void deleteProfile(QString name);
void stopProfile();
Expand Down
4 changes: 2 additions & 2 deletions src/CSLOLToolsImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ void CSLOLToolsImpl::doUpdate(QString urls) {
}
}

void CSLOLToolsImpl::saveProfile(QString name, QJsonObject mods, bool run, bool skipConflict, bool experimentalDll) {
void CSLOLToolsImpl::saveProfile(QString name, QJsonObject mods, bool run, bool skipConflict, bool oldPatcher) {
if (state_ == CSLOLState::StateIdle) {
setState(CSLOLState::StateBusy);

Expand Down Expand Up @@ -541,7 +541,7 @@ void CSLOLToolsImpl::saveProfile(QString name, QJsonObject mods, bool run, bool
prog_ + "/profiles/" + name,
prog_ + "/profiles/" + name + ".config",
"--game:" + game_,
"--opts:" + QString(experimentalDll ? "dllpatcher" : "none"),
"--opts:" + QString(oldPatcher ? "oldpatcher" : "none"),
});
} else {
setState(CSLOLState::StateIdle);
Expand Down
2 changes: 1 addition & 1 deletion src/CSLOLToolsImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public slots:
void deleteMod(QString name);
void exportMod(QString name, QString dest);
void installFantomeZip(QString path);
void saveProfile(QString name, QJsonObject mods, bool run, bool skipConflict, bool experimentalDll);
void saveProfile(QString name, QJsonObject mods, bool run, bool skipConflict, bool oldPatcher);
void loadProfile(QString name);
void deleteProfile(QString name);
void stopProfile();
Expand Down
6 changes: 3 additions & 3 deletions src/qml/CSLOLDialogSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Dialog {
property alias enableSystray: enableSystrayCheck.checked
property alias enableAutoRun: enableAutoRunCheck.checked
property alias updateUrls: updateUrlsTextArea.text
property alias experimentalDll: experimentalDllCheck.checked
property alias oldPatcher: oldPatcherCheck.checked

property var colors_LIST: [
"Red",
Expand Down Expand Up @@ -117,8 +117,8 @@ Dialog {
Layout.fillWidth: true
}
Switch {
id: experimentalDllCheck
text: qsTr("Experimental dll patcher(might result in bans)")
id: oldPatcherCheck
text: qsTr("Old patcher(does NOT work with Vanguard)")
checked: false
Layout.fillWidth: true
}
Expand Down
4 changes: 2 additions & 2 deletions src/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ApplicationWindow {
property alias themeDarkMode: cslolDialogSettings.themeDarkMode
property alias themePrimaryColor: cslolDialogSettings.themePrimaryColor
property alias themeAccentColor: cslolDialogSettings.themeAccentColor
property alias experimentalDll: cslolDialogSettings.experimentalDll
property alias oldPatcher: cslolDialogSettings.oldPatcher

property alias removeUnknownNames: cslolDialogEditMod.removeUnknownNames
property alias lastZipDirectory: cslolDialogOpenZipFantome.folder
Expand Down Expand Up @@ -98,7 +98,7 @@ ApplicationWindow {
let name = cslolToolBar.profilesCurrentName
let mods = cslolModsView.saveProfile()
if (checkGamePath()) {
cslolTools.saveProfile(name, mods, run, settings.suppressInstallConflicts, settings.experimentalDll)
cslolTools.saveProfile(name, mods, run, settings.suppressInstallConflicts, settings.oldPatcher)
}
}

Expand Down

0 comments on commit ca75917

Please sign in to comment.