mirror of
https://github.com/aclist/dztui.git
synced 2025-01-01 15:12:05 +01:00
Restructure menus
This commit is contained in:
parent
01bd10d264
commit
d876695c9a
1 changed files with 30 additions and 24 deletions
46
dzgui.sh
46
dzgui.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
version=2.8.0-rc.1
|
version=2.8.0-rc.3
|
||||||
|
|
||||||
aid=221100
|
aid=221100
|
||||||
game="dayz"
|
game="dayz"
|
||||||
|
@ -27,9 +27,11 @@ helpers_path="$sd_install_path/helpers"
|
||||||
geo_file="$helpers_path/ips.csv"
|
geo_file="$helpers_path/ips.csv"
|
||||||
km_helper="$helpers_path/latlon"
|
km_helper="$helpers_path/latlon"
|
||||||
sums_path="$helpers_path/sums.md5"
|
sums_path="$helpers_path/sums.md5"
|
||||||
|
scmd_file="$helpers_path/scmd.sh"
|
||||||
km_helper_url="$releases_url/latlon"
|
km_helper_url="$releases_url/latlon"
|
||||||
db_file="$releases_url/ips.csv.gz"
|
db_file="$releases_url/ips.csv.gz"
|
||||||
sums_url="$testing_url/helpers/sums.md5"
|
sums_url="$testing_url/helpers/sums.md5"
|
||||||
|
scmd_url="$testing_url/helpers/scmd.sh"
|
||||||
|
|
||||||
update_last_seen(){
|
update_last_seen(){
|
||||||
mv $config_file ${config_path}dztuirc.old
|
mv $config_file ${config_path}dztuirc.old
|
||||||
|
@ -90,10 +92,10 @@ items=(
|
||||||
" Delete server"
|
" Delete server"
|
||||||
"[Options]"
|
"[Options]"
|
||||||
" List installed mods"
|
" List installed mods"
|
||||||
" Toggle debug mode"
|
|
||||||
" Report bug (opens in browser)"
|
" Report bug (opens in browser)"
|
||||||
" Help file (opens in browser)"
|
" Help file (opens in browser)"
|
||||||
" View changelog"
|
" View changelog"
|
||||||
|
" Advanced options"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
warn_and_exit(){
|
warn_and_exit(){
|
||||||
|
@ -481,9 +483,13 @@ connect(){
|
||||||
[[ $rc -eq 1 ]] && return
|
[[ $rc -eq 1 ]] && return
|
||||||
compare
|
compare
|
||||||
if [[ -n $diff ]]; then
|
if [[ -n $diff ]]; then
|
||||||
|
if [[ $auto_install -eq 1 ]]; then
|
||||||
auto_mod_install "$diff"
|
auto_mod_install "$diff"
|
||||||
rc=$?
|
rc=$?
|
||||||
[[ $rc -eq 1 ]] && manual_mod_install
|
[[ $rc -eq 1 ]] && manual_mod_install
|
||||||
|
else
|
||||||
|
manual_mod_install
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
passed_mod_check > >(zenity --pulsate --progress --auto-close --width=500 2>/dev/null)
|
passed_mod_check > >(zenity --pulsate --progress --auto-close --width=500 2>/dev/null)
|
||||||
launch
|
launch
|
||||||
|
@ -805,14 +811,16 @@ connect_to_fav(){
|
||||||
|
|
||||||
}
|
}
|
||||||
set_header(){
|
set_header(){
|
||||||
|
[[ $auto_install -eq 1 ]] && install_mode=auto
|
||||||
|
[[ $auto_install -eq 0 ]] && install_mode=manual
|
||||||
if [[ $1 == "delete" ]]; then
|
if [[ $1 == "delete" ]]; then
|
||||||
sel=$(cat $tmp | zenity $sd_res --list $cols --title="DZGUI" --text="DZGUI $version | Mode: $mode | Branch: $branch | Fav: $fav_label" \
|
sel=$(cat $tmp | zenity $sd_res --list $cols --title="DZGUI" --text="DZGUI $version | Mode: $mode | Branch: $branch | Mods: $install_mode | Fav: $fav_label" \
|
||||||
--separator="$separator" --print-column=1,2 --ok-label="Delete" 2>/dev/null)
|
--separator="$separator" --print-column=1,2 --ok-label="Delete" 2>/dev/null)
|
||||||
elif [[ $1 == "populate" ]]; then
|
elif [[ $1 == "populate" ]]; then
|
||||||
sel=$(cat $tmp | zenity $sd_res --list $cols --title="DZGUI" --text="DZGUI $version | Mode: $mode | Branch: $branch | Fav: $fav_label" \
|
sel=$(cat $tmp | zenity $sd_res --list $cols --title="DZGUI" --text="DZGUI $version | Mode: $mode | Branch: $branch | Mods: $install_mode | Fav: $fav_label" \
|
||||||
--separator="$separator" --print-column=2,6 2>/dev/null)
|
--separator="$separator" --print-column=2,6 2>/dev/null)
|
||||||
elif [[ $1 == "main_menu" ]]; then
|
elif [[ $1 == "main_menu" ]]; then
|
||||||
sel=$(zenity $sd_res --list --title="DZGUI" --text="${news}DZGUI $version | Mode: $mode | Branch: $branch | Fav: $fav_label" \
|
sel=$(zenity $sd_res --list --title="DZGUI" --text="${news}DZGUI $version | Mode: $mode | Branch: $branch | Mods: $install_mode | Fav: $fav_label" \
|
||||||
--cancel-label="Exit" --ok-label="Select" --column="Select launch option" --hide-header "${items[@]}" 2>/dev/null)
|
--cancel-label="Exit" --ok-label="Select" --column="Select launch option" --hide-header "${items[@]}" 2>/dev/null)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -842,14 +850,13 @@ generate_log(){
|
||||||
DOC
|
DOC
|
||||||
}
|
}
|
||||||
toggle_automods(){
|
toggle_automods(){
|
||||||
[[ $auto_install -eq 1 ]] && #print warning message about credentials etc.
|
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
debug_menu(){
|
options_menu(){
|
||||||
debug_list=(
|
debug_list=(
|
||||||
"Toggle branch"
|
"Toggle branch"
|
||||||
"Generate debug log"
|
"Generate debug log"
|
||||||
"Toggle auto-mod install"
|
"Toggle auto-mod install (experimental)"
|
||||||
)
|
)
|
||||||
debug_sel=$(zenity --list --width=1280 --height=800 --column="Options" --title="DZGUI" --hide-header "${debug_list[@]}" 2>/dev/null)
|
debug_sel=$(zenity --list --width=1280 --height=800 --column="Options" --title="DZGUI" --hide-header "${debug_list[@]}" 2>/dev/null)
|
||||||
if [[ $debug_sel == "${debug_list[0]}" ]]; then
|
if [[ $debug_sel == "${debug_list[0]}" ]]; then
|
||||||
|
@ -1148,15 +1155,14 @@ server_browser(){
|
||||||
}
|
}
|
||||||
|
|
||||||
mods_disk_size(){
|
mods_disk_size(){
|
||||||
printf "Total size on disk: %s" $(du -sh "$game_dir" | awk '{print $1}')
|
printf "Total size on disk: %s |" $(du -sh "$game_dir" | awk '{print $1}')
|
||||||
|
printf "Mods location: $steam_path/steamapps/workshop/content/221100"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main_menu(){
|
main_menu(){
|
||||||
print_news
|
print_news
|
||||||
set_mode
|
set_mode
|
||||||
if [[ $debug -eq 1 ]]; then
|
|
||||||
items+=(" Debug options")
|
|
||||||
fi
|
|
||||||
if [[ -n $fav ]]; then
|
if [[ -n $fav ]]; then
|
||||||
items[7]=" Change favorite server"
|
items[7]=" Change favorite server"
|
||||||
fi
|
fi
|
||||||
|
@ -1192,17 +1198,13 @@ main_menu(){
|
||||||
--title="DZGUI" $sd_res --text="$(mods_disk_size)" \
|
--title="DZGUI" $sd_res --text="$(mods_disk_size)" \
|
||||||
--print-column="" 2>/dev/null
|
--print-column="" 2>/dev/null
|
||||||
elif [[ $sel == "${items[11]}" ]]; then
|
elif [[ $sel == "${items[11]}" ]]; then
|
||||||
toggle_debug
|
|
||||||
main_menu
|
|
||||||
return
|
|
||||||
elif [[ $sel == "${items[12]}" ]]; then
|
|
||||||
report_bug
|
report_bug
|
||||||
elif [[ $sel == "${items[13]}" ]]; then
|
elif [[ $sel == "${items[12]}" ]]; then
|
||||||
help_file
|
help_file
|
||||||
elif [[ $sel == "${items[14]}" ]]; then
|
elif [[ $sel == "${items[13]}" ]]; then
|
||||||
changelog | zenity --text-info $sd_res --title="DZGUI" 2>/dev/null
|
changelog | zenity --text-info $sd_res --title="DZGUI" 2>/dev/null
|
||||||
elif [[ $sel == "${items[15]}" ]]; then
|
elif [[ $sel == "${items[14]}" ]]; then
|
||||||
debug_menu
|
options_menu
|
||||||
else
|
else
|
||||||
warn "This feature is not yet implemented."
|
warn "This feature is not yet implemented."
|
||||||
fi
|
fi
|
||||||
|
@ -1485,6 +1487,9 @@ lock(){
|
||||||
echo $$ > $config_path/.lockfile
|
echo $$ > $config_path/.lockfile
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
fetch_scmd_helper(){
|
||||||
|
curl -Ls "$scmd_url" > "$helpers_path"
|
||||||
|
}
|
||||||
initial_setup(){
|
initial_setup(){
|
||||||
echo "# Initial setup"
|
echo "# Initial setup"
|
||||||
run_depcheck
|
run_depcheck
|
||||||
|
@ -1492,6 +1497,7 @@ initial_setup(){
|
||||||
check_version
|
check_version
|
||||||
check_map_count
|
check_map_count
|
||||||
config
|
config
|
||||||
|
# fetch_scmd_helper
|
||||||
run_varcheck
|
run_varcheck
|
||||||
init_items
|
init_items
|
||||||
setup
|
setup
|
||||||
|
|
Loading…
Reference in a new issue