Skip to content

Commit

Permalink
ModOrganizer 2: Prevent MO2MODE from being 'none', only checkMO2 if M…
Browse files Browse the repository at this point in the history
…O2MODE is 'GUI' (#1017)
  • Loading branch information
sonic2kk authored Jan 19, 2024
1 parent b0639f3 commit 6fc2a35
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20240116-2"
PROGVERS="v14.0.20240119-1"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -6958,6 +6958,14 @@ function migrateCfgOption {
updateConfigEntry "SPEKVERS" "$SPEKVERS" "$STLGAMECFG"
fi

# stop MO2MODE from being 'none' in weird scenarios -- Issue was confirmed to be exclusive to SteamOS and may be a (temporary?) SteamOS regression
if [ "$MO2MODE" == "$NON" ]; then
MO2MODE="disabled"
touch "$FUPDATE"
writelog "INFO" "${FUNCNAME[0]} - ModOrganizer 2 variable MO2MODE is somehow '$NON' -- Defaulting this to 'disabled'"
updateConfigEntry "MO2MODE" "$MO2MODE" "$STLGAMECFG"
fi

# collections update
if [ -n "$CHECKCATEGORIES" ] && [ "$CHECKCATEGORIES" -eq 1 ]; then
CHECKCOLLECTIONS="$CHECKCATEGORIES"
Expand Down Expand Up @@ -17567,7 +17575,19 @@ function setMO2DLMime {
}

function checkMO2 {
if [ "$MO2MODE" != "disabled" ]; then
# migrateCfgOption should mean this never happens, but can never be too careful -- Has begun happening since 12/01/2024 for a small number of Steam Deck users
if [ "$MO2MODE" == "$NON" ]; then
writelog "SKIP" "${FUNCNAME[0]} - MO2MODE is '$NON' -- This should not happen but has been observed in the wild, so explicitly returning here"
return
fi

if [ "$MO2MODE" == "disabled" ]; then
writelog "SKIP" "${FUNCNAME[0]} - MO2MODE is 'disabled' -- Skipping checkMO2!"
return
fi

# if [ "$MO2MODE" != "disabled" ]; then # This check is because MO2 was once planned to have a silent mode, but no idea if/when this will be implemented, so just explicitly check for GUI
if [ "$MO2MODE" == "gui" ]; then
writelog "INFO" "${FUNCNAME[0]} - MO2MODE is '$MO2MODE' - starting MO2"

if [ "$WAITMO2" -gt 0 ]; then
Expand All @@ -17594,8 +17614,8 @@ function checkMO2 {
}
;;
4) {
writelog "INFO" "${FUNCNAME[0]} - Selected to start $MO with mods silently"
MO2MODE="silent"
writelog "INFO" "${FUNCNAME[0]} - Selected to start $MO with mods silently -- defaulting to gui since silent mode is not implemented"
MO2MODE="gui"
}
;;
6) {
Expand All @@ -17617,6 +17637,8 @@ function checkMO2 {
writelog "INFO" "${FUNCNAME[0]} - Disabling custom command, because $MO2 is enabled"
USECUSTOMCMD=0
fi
else
writelog "WARN" "${FUNCNAME[0]} - Unknown MO2MODE value '$MO2MODE' -- This is safe as checkMO2 has been skipped, but it is still unusual"
fi
}

Expand Down

0 comments on commit 6fc2a35

Please sign in to comment.