mirror of
https://github.com/JonasunderscoreJones/dayz-linux-gui-launcher.git
synced 2025-10-23 03:29:21 +02:00
feat: support optional game launch parameters
This commit is contained in:
parent
9550d9bff6
commit
fe462b9337
2 changed files with 14 additions and 3 deletions
|
@ -14,7 +14,7 @@ Please see the "Install DayZ" section down below on how to get the game running
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
Usage: dayz-launcher.sh [OPTION]... [MODID]...
|
Usage: dayz-launcher.sh [OPTION]... [MODID]... [-- [GAME-PARAM]...]
|
||||||
|
|
||||||
Automatically set up mods for DayZ, launch the game and connect to a server,
|
Automatically set up mods for DayZ, launch the game and connect to a server,
|
||||||
or print the game's -mod command line argument for custom configuration.
|
or print the game's -mod command line argument for custom configuration.
|
||||||
|
@ -38,6 +38,8 @@ Command line options:
|
||||||
--launch
|
--launch
|
||||||
Launch DayZ after resolving and setting up mods instead of
|
Launch DayZ after resolving and setting up mods instead of
|
||||||
printing the game's -mod command line argument.
|
printing the game's -mod command line argument.
|
||||||
|
Any custom game parameters that come after the first double-dash (--) will
|
||||||
|
be appended to the overall launch command line. This implies --launch.
|
||||||
|
|
||||||
-n <name>
|
-n <name>
|
||||||
--name <name>
|
--name <name>
|
||||||
|
|
|
@ -31,6 +31,7 @@ PORT="27016"
|
||||||
NAME=""
|
NAME=""
|
||||||
INPUT=()
|
INPUT=()
|
||||||
MODS=()
|
MODS=()
|
||||||
|
PARAMS=()
|
||||||
|
|
||||||
declare -A DEPS=(
|
declare -A DEPS=(
|
||||||
[gawk]="required for parsing the mod metadata"
|
[gawk]="required for parsing the mod metadata"
|
||||||
|
@ -41,7 +42,7 @@ declare -A DEPS=(
|
||||||
|
|
||||||
print_help() {
|
print_help() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: ${SELF} [OPTION]... [MODID]...
|
Usage: ${SELF} [OPTION]... [MODID]... [-- [GAME-PARAM]...]
|
||||||
|
|
||||||
Automatically set up mods for DayZ, launch the game and connect to a server,
|
Automatically set up mods for DayZ, launch the game and connect to a server,
|
||||||
or print the game's -mod command line argument for custom configuration.
|
or print the game's -mod command line argument for custom configuration.
|
||||||
|
@ -65,6 +66,8 @@ Command line options:
|
||||||
--launch
|
--launch
|
||||||
Launch DayZ after resolving and setting up mods instead of
|
Launch DayZ after resolving and setting up mods instead of
|
||||||
printing the game's -mod command line argument.
|
printing the game's -mod command line argument.
|
||||||
|
Any custom game parameters that come after the first double-dash (--) will
|
||||||
|
be appended to the overall launch command line. This implies --launch.
|
||||||
|
|
||||||
-n <name>
|
-n <name>
|
||||||
--name <name>
|
--name <name>
|
||||||
|
@ -131,6 +134,12 @@ while (( "$#" )); do
|
||||||
NAME="${2}"
|
NAME="${2}"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
--)
|
||||||
|
shift
|
||||||
|
PARAMS+=("${@}")
|
||||||
|
LAUNCH=1
|
||||||
|
break
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
INPUT+=("${1}")
|
INPUT+=("${1}")
|
||||||
;;
|
;;
|
||||||
|
@ -291,7 +300,7 @@ main() {
|
||||||
[[ -n "${SERVER}" ]] && cmdline+=("-connect=${SERVER}" -nolauncher -world=empty)
|
[[ -n "${SERVER}" ]] && cmdline+=("-connect=${SERVER}" -nolauncher -world=empty)
|
||||||
[[ -n "${NAME}" ]] && cmdline+=("-name=${NAME}")
|
[[ -n "${NAME}" ]] && cmdline+=("-name=${NAME}")
|
||||||
msg "Launching DayZ"
|
msg "Launching DayZ"
|
||||||
run_steam -applaunch "${DAYZ_ID}" "${cmdline[@]}"
|
run_steam -applaunch "${DAYZ_ID}" "${cmdline[@]}" "${PARAMS[@]}"
|
||||||
elif [[ -n "${mods}" ]]; then
|
elif [[ -n "${mods}" ]]; then
|
||||||
msg "Add this to your game's launch options, including the quotes:"
|
msg "Add this to your game's launch options, including the quotes:"
|
||||||
echo "\"-mod=${mods}\""
|
echo "\"-mod=${mods}\""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue