Skip to content

Commit

Permalink
Implemented MO2 silent mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zerodogg committed Apr 28, 2024
1 parent 7199cf5 commit 3cebd10
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3cebd10

Please sign in to comment.