From 3cebd10fe011ccd235583d42d069e6d8883d8ec5 Mon Sep 17 00:00:00 2001 From: Eskild Hustvedt Date: Sun, 28 Apr 2024 13:58:57 +0200 Subject: [PATCH] Implemented MO2 silent mode --- steamtinkerlaunch | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index c0b44e9c..9806319a 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -19782,29 +19782,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