Skip to content

Commit

Permalink
Implemented MO2 silent mode (#1097)
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodogg authored Apr 29, 2024
1 parent 921bc93 commit 18fd5f3
Showing 1 changed file with 7 additions and 10 deletions.
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

0 comments on commit 18fd5f3

Please sign in to comment.