Skip to content

Commit

Permalink
GameScope: use getGameScopeArg for Advanced options
Browse files Browse the repository at this point in the history
  • Loading branch information
sonic2kk committed Feb 15, 2023
1 parent 383b437 commit 9bc5610
Showing 1 changed file with 8 additions and 51 deletions.
59 changes: 8 additions & 51 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="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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9bc5610

Please sign in to comment.