Skip to content

Commit

Permalink
Game Menu: Add option to disable Native Linux Steam Linux Runtime com…
Browse files Browse the repository at this point in the history
…ing from Compatibility Tool

If a native game is launched with a Steam Linux Runtime Compatibility Tool
selected, either by the user or Valve Testing, the Steam Linux Runtime will
come in the game launch command. However a user may want to ignore this
for any reason, so this adds a checkbox to allow users to ignore the
incoming Steam Linux Runtime and let SteamTinkerLaunch find it.
  • Loading branch information
sonic2kk committed Apr 21, 2024
1 parent 04ae6e9 commit c460cda
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lang/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ TRAY_TOOLTIP="RMB=Menu, LBM/MMB=Exit"
TRAY_PAUSE="Pause/unpause active window in 5 seconds"
# SINCE "v2.4.0"
GUI_USESLR="Use Steam Linux Runtime"
DESC_USESLR="Use Steam Linux Runtime requested by compatibility tool, if available - May need to be manually from Steam if unavailable"
DESC_USESLR="Use Steam Linux Runtime requested by compatibility tool, if available - May need to be manually installed from Steam if unavailable"
# SINCE "v2.4.1"
# SINCE "v2.4.2"
GUI_USEWINDECO="Use window decoration (requires restart)"
Expand Down Expand Up @@ -1279,3 +1279,5 @@ NOTY_FSGDBAW="Fetching SteamGridDB Artwork for 'XXX'"
NOTY_FSGDBAWINVALID="Cannot fetch SteamGridDB Artwork, must provide AppID, Game ID, or Game Name!"
GUI_GSMOUSESENSITIVITY="Mouse Sensitivity"
DESC_GSMOUSESENSITIVITY="configurable mouse sensitivity, multiply mouse movement by specified decimal number amount"
GUI_IGNORECOMPATSLR="Ignore Native Linux Steam Linux Runtime from Compatibility Tool"
DESC_IGNORECOMPATSLR="ignore Steam Linux Runtime for native games selected either by you or by Valve Testing as a Compatibility Tool and let SteamTinkerLaunch find it instead. For example, ignore Steam Linux Runtime 3.0 selected by Valve Testing and let SteamTinkerLaunch find and use Steam Linux Runtime 1.0 instead. This can have MAJOR impacts on compatibility, and has NO EFFECT for games using Proton"
15 changes: 13 additions & 2 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.20240420-1"
PROGVERS="v14.0.20240421-1 (ignore-compat-tool-slr)"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -3187,6 +3187,7 @@ function setDefaultCfgValues {
if [ -z "$KEEPSTLOPEN" ] ; then KEEPSTLOPEN="0"; fi
if [ -z "$USESLR" ] ; then USESLR="1"; fi
if [ -z "$FORCESLR" ] ; then FORCESLR="0"; fi
if [ -z "$IGNORECOMPATSLR" ] ; then IGNORECOMPATSLR="0"; fi
if [ -z "$USEREAP" ] ; then USEREAP="1"; fi
if [ -z "$FORCEREAP" ] ; then FORCEREAP="0"; fi
if [ -z "$USEPROTON" ] ; then USEPROTON="$(getDefaultProton)"; fi
Expand Down Expand Up @@ -3765,6 +3766,8 @@ function saveCfg {
echo "USESLR=\"$USESLR\""
echo "## $DESC_FORCESLR"
echo "FORCESLR=\"$FORCESLR\""
echo "## $DESC_IGNORECOMPATSLR"
echo "IGNORECOMPATSLR=\"$IGNORECOMPATSLR\""
echo "## $DESC_USEREAP"
echo "USEREAP=\"$USEREAP\""
echo "## $DESC_FORCEREAP"
Expand Down Expand Up @@ -5707,6 +5710,7 @@ function AllSettingsEntriesDummyFunction {
--field=" $GUI_USEPROTON!$DESC_USEPROTON ('USEPROTON')":CB "$(cleanDropDown "${USEPROTON/#-/ -}" "$PROTYADLIST")" `#CAT_Proton` `#MENU_GAME` \
--field=" $GUI_USESLR!$DESC_USESLR ('USESLR')":CHK "${USESLR/#-/ -}" `#CAT_Proton` `#SUB_Checkbox` `#MENU_GAME` \
--field=" $GUI_FORCESLR!$DESC_FORCESLR ('FORCESLR')":CHK "${FORCESLR/#-/ -}" `#CAT_Proton` `#SUB_Checkbox` `#MENU_GAME` \
--field=" $GUI_IGNORECOMPATSLR!$DESC_IGNORECOMPATSLR ('IGNORECOMPATSLR')":CHK "${IGNORECOMPATSLR/#-/ -}" `#CAT_Proton` `#SUB_Checkbox` `#MENU_GAME` \
--field=" $GUI_USEREAP!$DESC_USEREAP ('USEREAP')":CHK "${USEREAP/#-/ -}" `#CAT_Proton` `#SUB_Checkbox` `#MENU_GAME` \
--field=" $GUI_FORCEREAP!$DESC_FORCEREAP ('FORCEREAP')":CHK "${FORCEREAP/#-/ -}" `#CAT_Proton` `#SUB_Checkbox` `#MENU_GAME` \
--field=" $GUI_AUTOLASTPROTON!$DESC_AUTOLASTPROTON ('AUTOLASTPROTON')":CHK "${AUTOLASTPROTON/#-/ -}" `#CAT_Proton` `#SUB_Checkbox` `#MENU_GLOBAL` \
Expand Down Expand Up @@ -21130,7 +21134,7 @@ function setSLRReap {
#
# In this case, we want to take the SLR given to us by the compatibility tool and use that
# HAVESLRCT=1 will only be true if the SLR is coming from the compatibility tool
if [ "$HAVESLRCT" -eq 1 ] && [ "$USESLR" -eq 1 ]; then
if [ "$HAVESLRCT" -eq 1 ] && [ "$USESLR" -eq 1 ] && [ "$IGNORECOMPATSLR" -eq 0 ]; then
writelog "INFO" "${FUNCNAME[0]} - ## SLR is enabled via USESLR=$USESLR - prepending SLR from Compatibility Tool to the current launch command"
writelog "INFO" "${FUNCNAME[0]} - ## This can happen if a game is running with a Steam Linux Runtime compatibility tool enabled"
SLRCMD=("${RUNSLRCT[@]}")
Expand All @@ -21147,6 +21151,12 @@ function setSLRReap {
writelog "INFO" "${FUNCNAME[0]} - ## SLR is enabled via USESLR=$USESLR - prepending SLR from command line to the current launch command"
writelog "INFO" "${FUNCNAME[0]} - RUNSLR is '${RUNSLR[*]}'"
SLRCMD=("${RUNSLR[@]}")
# If the user enables "IGNORECOMPATSLR", disable HAVESLR so that the below logic for Pressure Vessel Funtime will kick in and fetch the SLR manually
elif [ "$HAVESLRCT" -eq 1 ] && [ "$USESLR" -eq 1 ] && [ "$IGNORECOMPATSLR" -eq 1 ]; then
writelog "INFO" "${FUNCNAME[0]} - ## SLR was found in incoming Start Command, likely from a compatibility tool, but 'IGNORECOMPATSLR' is '${IGNORECOMPATSLR}'"
writelog "INFO" "${FUNCNAME[0]} - ## Ignoring this incoming SLR from the selected Steam Linux Runtime Compatibility Tool and instead letting SteamTinkerLaunch find the Steam Linux Runtime instead"
writelog "WARN" "${FUNCNAME[0]} - ## Note that some games require a specific Steam Linux Runtime version, and if a given Steam Linux Runtime version that SteamTinkerLaunch looks for is not found, or if the version found does not match what a game might require, launching may fail"
HAVESLR=0
fi

# Legacy case to ignore SLR gotten from commandline
Expand All @@ -21157,6 +21167,7 @@ function setSLRReap {

# SLR fetching (from toolmanifest.vdf / native Linux SLR AppID)
# ---------------
# TODO This could probably be refactored to have less indentation and return early...
RUNFORCESLR=0
if [[ ( "$HAVESLR" -eq 0 && "$USESLR" -eq 1 ) || -n "$OVERRIDESLR" ]]; then
if [ -n "$LASTSLR" ] && [ -f "${LASTSLR% --verb*}" ] && [ "$FORCESLR" -eq 1 ]; then
Expand Down

0 comments on commit c460cda

Please sign in to comment.