From 9bc5610984fbab776a2cb31bebb3334870d41979 Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Wed, 15 Feb 2023 17:24:44 +0000 Subject: [PATCH] GameScope: use getGameScopeArg for Advanced options --- steamtinkerlaunch | 59 +++++++---------------------------------------- 1 file changed, 8 insertions(+), 51 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index b1ac9368..942d7ade 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -6,7 +6,7 @@ PREFIX="/usr" PROGNAME="SteamTinkerLaunch" NICEPROGNAME="Steam Tinker Launch" -PROGVERS="v12.12.20230215-11 (gamescope-the-adventure-continues)" +PROGVERS="v12.12.20230215-15 (gamescope-the-adventure-continues)" PROGCMD="${0##*/}" SHOSTL="stl" GHURL="https://github.com" @@ -9899,68 +9899,25 @@ function GameScopeGui { fi # Amount of time in milliseconds to wait before hiding the cursor (-C) -- Spinner - if [ -z "$GSHIDECURSORDELAY" ]; then - if ! grep -qw "\-C" <<< "$GAMESCOPE_ARGS"; then - GSHIDECURSORDELAY="0" # 0 means we ignore it - else - GSHIDECURSORDELAY="$(tr ' ' '\n' <<< "$GAMESCOPE_ARGS" | grep -A1 "\-C" | tail -n1)" - fi - fi + GSHIDECURSORDELAY="$( getGameScopeArg "$GAMESCOPE_ARGS" "-C" "$GSHIDECURSORDELAY" "" "0" "num" )" # Disables direct scan-out (--force-composition) -- Checkbox - if [ -z "$GSFORCECOMP" ]; then - if ! grep -qw "\-\-force\-composition" <<< "$GAMESCOPE_ARGS"; then - GSFORCECOMP="0" - else - GSFORCECOMP="1" - fi - fi + GSFORCECOMP="$( getGameScopeArg "$GAMESCOPE_ARGS" "--force-composition" "$GSFORCECOMP" "1" "0" )" # Draw debug hud (--debug-hud) -- Checkbox - if [ -z "$GSDEBUGHUD" ]; then - if ! grep -qw "\-\-debug\-hud" <<< "$GAMESCOPE_ARGS"; then - GSDEBUGHUD="0" - else - GSDEBUGHUD="1" - fi - fi + GSDEBUGHUD="$( getGameScopeArg "$GAMESCOPE_ARGS" "--debug-hud" "$GSDEBUGHUD" "1" "0" )" # Force HDR support flag (--hdr-debug-force-support) -- Checkbox - if [ -z "$GSFORCEHDRSUPPORT" ]; then - if ! grep -qw "\-\-hdr\-debug\-force-support" <<< "$GAMESCOPE_ARGS"; then - GSFORCEHDRSUPPORT="0" - else - GSFORCEHDRSUPPORT="1" - fi - fi + GSFORCEHDRSUPPORT="$( getGameScopeArg "$GAMESCOPE_ARGS" "--hdr-debug-force-support" "$GSFORCEHDRSUPPORT" "1" "0" )" # Force HDR output on display (--hdr-debug-force-output) -- Will look terrible if unsupported -- Checkbox - if [ -z "$GSFORCEHDROUTPUT" ]; then - if ! grep -qw "\-\-hdr\-debug\-force-output" <<< "$GAMESCOPE_ARGS"; then - GSFORCEHDROUTPUT="0" - else - GSFORCEHDROUTPUT="1" - fi - fi + GSFORCEHDROUTPUT="$( getGameScopeArg "$GAMESCOPE_ARGS" "--hdr-debug-force-output" "$GSFORCEHDROUTPUT" "1" "0" )" # Prefer Vulkan device for compositing (--prefer-vk-device) -- Checkbox - if [ -z "$GSPREFERVKDEVICE" ]; then - if ! grep -qw "\-\-prefer\-vk\-device" <<< "$GAMESCOPE_ARGS"; then - GSPREFERVKDEVICE="0" - else - GSPREFERVKDEVICE="1" - fi - fi + GSPREFERVKDEVICE="$( getGameScopeArg "$GAMESCOPE_ARGS" "--prefer-vk-device" "$GSPREFERVKDEVICE" "1" "0" )" # Expose Wayland (--expose-wayland) -- Checkbox - # Only works if client uses xdg-shell - if [ -z "$GSWAYLAND" ]; then - if ! grep -qw "\-\-expose\-wayland" <<< "$GAMESCOPE_ARGS"; then - GSWAYLAND="0" - else - GSWAYLAND="1" - fi - fi + GSWAYLAND="$( getGameScopeArg "$GAMESCOPE_ARGS" "--expose-wayland" "$GSWAYLAND" "1" "0" )" } if [ -n "$1" ]; then