Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented MO2 silent mode #1097

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20240429-1"
PROGVERS="v14.0.20240330-1"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -19820,29 +19820,26 @@ function prepMO2 {
GMO2EXE="$GPFX/$MOERPATH"
fi

# silent mode doesn't work, feel free to create a PR
if [ "$MO2MODE" == "silent" ]; then
setMO2Vars
MO2GAMIN1="$(grep -m1 "\"$AID\"" "$MO2GAMES" | cut -d ';' -f3)"
MO2GAMINI="${MO2GAMIN1//\"}"

MO2MODE="gui"

function disabledWIPSilentMode {
if [ -n "$MO2GAM" ] && [ -f "$MO2EXE" ]; then
if [ -n "$MO2GAMINI" ] && [ -f "$MO2EXE" ]; then
if [ "$(grep -c "^+" "$MODLIST")" -eq 0 ]; then
writelog "SKIP" "${FUNCNAME[0]} - Not starting $MO silent as requested, because no mod is enabled in '$MODLIST'"
notiShow "$(strFix "$NOTY_NOMO" "$GN" "$AID")"
MO2MODE="gui"
else
# both seem to work:
RUNCMD=("${RUNCMD[@]}" "$GMO2EXE" "moshortcut://$MO2GAM:$MO2GAMINI" "-p" "Default")
RUNCMD=("${RUNCMD[@]}" "$MO2EXE" "moshortcut://:$MO2GAMINI")

writelog "INFO" "${FUNCNAME[0]} - Starting '$SGNAID' with $MO enabled mods with command '${RUNCMD[*]}'"
notiShow "$(strFix "$NOTY_STARTSIMO" "$GN" "$AID")"
fi
else
writelog "SKIP" "${FUNCNAME[0]} - Not starting $MO silent as requested, because MO2GAM ('$MO2GAM') or MO2EXE ('$MO2EXE') is empty"
writelog "SKIP" "${FUNCNAME[0]} - Not starting $MO silent as requested, because MO2GAMINI ('$MO2GAMINI') or MO2EXE ('$MO2EXE') is empty"
MO2MODE="gui"
fi
}
fi

if [ "$MO2MODE" == "gui" ]; then
Expand Down