mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 19:57:45 +00:00
Cleaning up my argument mess
This commit is contained in:
parent
a88f7305d0
commit
0242a77e5e
1 changed files with 12 additions and 25 deletions
|
@ -173,34 +173,21 @@ void LauncherCore::launchGame(const ProfileSettings& profile, const LoginAuth au
|
|||
});
|
||||
}
|
||||
|
||||
if(profile.encryptArguments) {
|
||||
const QString argFormat = profile.encryptArguments ? " /%1 =%2" : "%1=%2";
|
||||
|
||||
QString argJoined;
|
||||
for(auto arg : gameArgs) {
|
||||
argJoined += QString(" /%1 =%2").arg(arg.key, arg.value);
|
||||
for(const auto& arg : gameArgs) {
|
||||
argJoined += argFormat.arg(arg.key, arg.value);
|
||||
}
|
||||
|
||||
auto earg = encryptGameArg(argJoined);
|
||||
arguments.append(earg);
|
||||
launchExecutable(profile, gameProcess, arguments);
|
||||
if(profile.encryptArguments) {
|
||||
arguments.append(encryptGameArg(argJoined));
|
||||
} else {
|
||||
if(profile.enableDalamud) {
|
||||
// nativelauncher requires arg[3] to be the arguments, put inside of a quoted string. if this is encrypted, that's easy but this is not
|
||||
// TODO: combine with code above (they do the same thing lol)
|
||||
QString finalArg;
|
||||
for(auto arg : gameArgs) {
|
||||
finalArg.append(QString(" %1=%2").arg(arg.key, arg.value));
|
||||
}
|
||||
|
||||
arguments.append(finalArg);
|
||||
} else {
|
||||
for(auto arg : gameArgs) {
|
||||
arguments.append(QString("%1=%2").arg(arg.key, arg.value));
|
||||
}
|
||||
arguments.append(argJoined);
|
||||
}
|
||||
|
||||
launchExecutable(profile, gameProcess, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
void LauncherCore::launchExecutable(const ProfileSettings& profile, const QStringList args) {
|
||||
auto process = new QProcess(this);
|
||||
|
|
Loading…
Add table
Reference in a new issue