From 67b6118b2f00dec3f5c6a794fcb72e9c6ceca88b Mon Sep 17 00:00:00 2001 From: Eamonn Rea Date: Sun, 9 Jun 2024 05:27:56 +0100 Subject: [PATCH] misc: Flatten some parts of main --- steamtinkerlaunch | 49 ++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/steamtinkerlaunch b/steamtinkerlaunch index fdab76d6..2b4d15eb 100755 --- a/steamtinkerlaunch +++ b/steamtinkerlaunch @@ -26729,37 +26729,38 @@ function main { if [ -z "$1" ]; then writelog "INFO" "${FUNCNAME[0]} - No arguments provided. See '$PROGCMD --help' for possible command line parameters" "E" - else - writelog "INFO" "${FUNCNAME[0]} - Checking command line: incoming arguments '${*}'" + restoreGtkCss + return + fi - if [ -n "$SteamAppId" ] && [ "$SteamAppId" -eq "0" ]; then - if grep -q "\"$1\"" <<< "$(sed -n "/^#STARTCMDLINE/,/^#ENDCMDLINE/p;/^#ENDCMDLINE/q" "$0" | grep if)"; then - writelog "INFO" "${FUNCNAME[0]} - Seems like a '$PROGCMD'-internal command was started - checking the command line" - commandline "$@" - else - setCustomGameVars "$@" - if [ -n "$ISGAME" ]; then - if [ "$ISGAME" -eq 2 ] || [ "$ISGAME" -eq 3 ]; then - prepareLaunch - fi - else - writelog "ERROR" "${FUNCNAME[0]} - Unknown command '$*'" "E" - fi - fi - elif grep -q "$SAC" <<< "$@" || grep -q "$L2EA" <<< "$@"; then - if grep -q "update" <<< "$@" || grep -q "^play" <<< "$@" ; then - commandline "$@" - else - setGameVars "$@" + writelog "INFO" "${FUNCNAME[0]} - Checking command line: incoming arguments '${*}'" + if [ -n "$SteamAppId" ] && [ "$SteamAppId" -eq "0" ]; then + if grep -q "\"$1\"" <<< "$(sed -n "/^#STARTCMDLINE/,/^#ENDCMDLINE/p;/^#ENDCMDLINE/q" "$0" | grep if)"; then + writelog "INFO" "${FUNCNAME[0]} - Seems like a '$PROGCMD'-internal command was started - checking the command line" + commandline "$@" + else + setCustomGameVars "$@" + if [ -n "$ISGAME" ]; then if [ "$ISGAME" -eq 2 ] || [ "$ISGAME" -eq 3 ]; then prepareLaunch - else - writelog "INFO" "${FUNCNAME[0]} - Unknown parameter '${ORGGCMD[*]}'" "E" fi + else + writelog "ERROR" "${FUNCNAME[0]} - Unknown command '$*'" "E" fi - else + fi + elif grep -q "$SAC" <<< "$@" || grep -q "$L2EA" <<< "$@"; then + if grep -q "update" <<< "$@" || grep -q "^play" <<< "$@" ; then commandline "$@" + else + setGameVars "$@" + if [ "$ISGAME" -eq 2 ] || [ "$ISGAME" -eq 3 ]; then + prepareLaunch + else + writelog "INFO" "${FUNCNAME[0]} - Unknown parameter '${ORGGCMD[*]}'" "E" + fi fi + else + commandline "$@" fi restoreGtkCss