1
0
Fork 0
mirror of https://github.com/aclist/dztui.git synced 2024-12-27 21:02:36 +01:00

fix: abort path discovery

This commit is contained in:
aclist 2024-12-16 15:21:57 +09:00
parent 34b3d3bc8c
commit 6e3746e9b4
3 changed files with 18 additions and 5 deletions

View file

@ -3,6 +3,11 @@
## [5.6.0-beta.18] 2024-12-14
### Added
- Open Steam workshop subscriptions
### Fixed
- Empty dialog popups if user manually deletes local mods while application is running
- Abort DayZ path discovery if VDF if Steam files are not synched
### Changed
- Admonish user to restart Steam in error dialog if DayZ path could not be found
## [5.6.0-beta.17] 2024-12-14
### Added

View file

@ -581,7 +581,7 @@ fetch_helpers_by_sum(){
["ui.py"]="0e3845ef150ee9863f9160c62dbb24f9"
["query_v2.py"]="55d339ba02512ac69de288eb3be41067"
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
["funcs"]="4c1480fcfae15c4bc1c02a337d1de488"
["funcs"]="a9745fa5cc2f007bddf0d30032845fbd"
["lan"]="c62e84ddd1457b71a85ad21da662b9af"
)
local author="aclist"
@ -747,7 +747,7 @@ find_library_folder(){
local search_path="$1"
steam_path="$(python3 "$helpers_path/vdf2json.py" -i "$1/steamapps/libraryfolders.vdf" \
| jq -r '.libraryfolders[]|select(.apps|has("221100")).path')"
if [[ ! $? -eq 0 ]]; then
if [[ ! $? -eq 0 ]] || [[ -z $steam_path ]]; then
logger WARN "Failed to parse Steam path using '$search_path'"
return 1
fi
@ -800,7 +800,7 @@ create_config(){
find_library_folder "$default_steam_path"
if [[ -z $steam_path ]]; then
logger raise_error "Steam path was empty"
zenity --question --text="DayZ not found or not installed at the Steam library given." --ok-label="Choose path manually" --cancel-label="Exit"
zenity --question --text="DayZ not found or not installed at the Steam library given. NOTE: if you recently installed DayZ or moved its location, you MUST restart Steam first for these changes to synch." --ok-label="Choose path manually" --cancel-label="Exit"
if [[ $? -eq 0 ]]; then
logger INFO "User selected file picker"
file_picker

View file

@ -353,12 +353,13 @@ list_mods(){
local name
local base_dir
local size
local mods
if [[ -z $(installed_mods) ]] || [[ -z $(find $workshop_dir -maxdepth 2 -name "*.cpp" | grep .cpp) ]]; then
printf "No mods currently installed or incorrect path set."
logger WARN "Found no locally installed mods"
return 1
else
for dir in $(find $game_dir/* -maxdepth 1 -type l); do
mods=$(for dir in $(find $game_dir/* -maxdepth 1 -type l); do
symlink=$(basename $dir)
sep="␞"
name=$(awk -F\" '/name/ {print $2}' "${dir}/meta.cpp")
@ -366,7 +367,14 @@ list_mods(){
size=$(du -s "$(readlink -f "$game_dir/$symlink")" | awk '{print $1}')
size=$(python3 -c "n=($size/1024) +.005; print(round(n,4))")
LC_NUMERIC=C printf "%s$sep%s$sep%s$sep%3.3f\n" "$name" "$symlink" "$base_dir" "$size"
done | sort -k1
done | sort -k1)
# user may have manually pruned mods out-of-band
# handle directory detritus but no actual mods
if [[ -z $mods ]]; then
printf "No mods currently installed or incorrect path set."
return 1
fi
echo "$mods"
fi
}
installed_mods(){