get_steam function potentially ready.
This commit is contained in:
parent
166ad6469a
commit
aedc053e5b
@ -416,35 +416,30 @@ get_installer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_steam() {
|
get_steam() {
|
||||||
# Arguments: $1 name of item for download, $2 url for game
|
# Arguments: $1 id of item for download, $2 url for game
|
||||||
trap "exit 0" SIGINT
|
trap "exit 0" SIGINT
|
||||||
# Check for steamcmd
|
# Check for steamcmd
|
||||||
if ! command -v steamcmd &> /dev/null ; then
|
if ! command -v steamcmd &> /dev/null ; then
|
||||||
dialog --backtitle "Audiogame Manager" \
|
dialog --backtitle "Audiogame Manager" \
|
||||||
--infobox "This installer requires steamcmd. Please install steamcmd and try again." -1 -1
|
--infobox "This installer requires steamcmd. Please install steamcmd and try again." -1 -1
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# Get Steam user name.
|
# Get Steam user name.
|
||||||
steamUser="$(dialog --ok-label "Continue" \
|
steamUser="$(dialog --ok-label "Continue" \
|
||||||
--backtitle "Audiogame Manager" \
|
--backtitle "Audiogame Manager" \
|
||||||
--inputbox "Please enter your Steam user name:" -1 -1)"
|
--inputbox "Please enter your Steam user name:" -1 -1)"
|
||||||
# Create message for dialog.
|
# Create message for dialog.
|
||||||
local message="Make sure ${game} is available in your Steam library and press enter to continue. The URL for ${game} is $2"
|
local message="Make sure ${game} is available in your Steam library and press enter to continue. The URL for ${game} is $2"
|
||||||
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
|
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
|
||||||
message+="\n\nThe URL has been copied to the clipboard."
|
message+="\n\nThe URL has been copied to the clipboard."
|
||||||
fi
|
fi
|
||||||
dialog --ok-label "Continue" \
|
dialog --ok-label "Continue" \
|
||||||
--backtitle "Audiogame Manager" \
|
--backtitle "Audiogame Manager" \
|
||||||
--msgbox "$message" -1 -1
|
--msgbox "$message" -1 -1
|
||||||
# Download the game
|
# Download the game
|
||||||
steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir "$HOME/.local/wine/$bottle/drive_c/Program Files/" +login "$steamUser" +app_update "$1" +quit || { dialog --backtitle "Audiogame Manager" \
|
steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir "$HOME/.local/wine/$bottle/drive_c/Program Files/" +login "$steamUser" +app_update "$1" +quit || { dialog --backtitle "Audiogame Manager" \
|
||||||
--infobox "Something went wrong. Please make sure you have a stable internet connection, and if the problem persists, contact audiogame-manager's developers." -1 -1
|
--infobox "Something went wrong. Please make sure you have a stable internet connection, and if the problem persists, contact audiogame-manager's developers." -1 -1
|
||||||
exit 1; }
|
exit 1; }
|
||||||
# If the file is still not available abort.
|
|
||||||
if [[ ! -f "${cache}/$1" ]]; then
|
|
||||||
echo "couldn't find $1. Please download the file and try again."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
help() {
|
help() {
|
||||||
|
Loading…
Reference in New Issue
Block a user