mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-07-01 14:20:36 +00:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
dd81f24be3 | |||
f99fe9b996 | |||
dffa971dc1 | |||
fe1733542d | |||
d6d28f1481 | |||
eb48d00396 | |||
f072378617 | |||
d6376ff9fa | |||
28051a135a | |||
44b1332782 |
@ -102,6 +102,8 @@ install_path="drive_c/Program Files/Roberts Space Industries/$sc_base_dir"
|
||||
live_dir="LIVE"
|
||||
ptu_dir="PTU"
|
||||
|
||||
# AppData directory
|
||||
appdata_path="drive_c/users/$USER/AppData/Local/Star Citizen"
|
||||
# Remaining directory paths are set at the end of the getdirs() function
|
||||
|
||||
######## Runners ###########################################################
|
||||
@ -132,6 +134,7 @@ dxvk_dir="$data_dir/lutris/runtime/dxvk"
|
||||
dxvk_sources=(
|
||||
"Sporif Async" "https://api.github.com/repos/Sporif/dxvk-async/releases"
|
||||
"/dev/null" "https://api.github.com/repos/gort818/dxvk/releases"
|
||||
"gnusenpai" "https://api.github.com/repos/gnusenpai/dxvk/releases"
|
||||
)
|
||||
|
||||
# Set a maximum number of versions to display from each download url
|
||||
@ -169,7 +172,7 @@ lug_wiki="https://github.com/starcitizen-lug/information-howtos/wiki"
|
||||
# Github repo and script version info
|
||||
repo="starcitizen-lug/lug-helper"
|
||||
releases_url="https://github.com/$repo/releases"
|
||||
current_version="v1.18"
|
||||
current_version="v1.20"
|
||||
|
||||
############################################################################
|
||||
############################################################################
|
||||
@ -346,7 +349,7 @@ menu() {
|
||||
done
|
||||
|
||||
# Display the zenity radio button menu
|
||||
choice="$(zenity --list --radiolist --width="480" --height="$menu_height" --text="$menu_text_zenity" --title="Star Citizen LUG Helper" --hide-header --cancel-label "$cancel_label" --window-icon=$lug_logo --column="" --column="Option" "${zen_options[@]}" 2>/dev/null)"
|
||||
choice="$(zenity --list --radiolist --width="480" --height="$menu_height" --text="$menu_text_zenity" --title="Star Citizen LUG Helper" --hide-header --cancel-label "$cancel_label" --window-icon="$lug_logo" --column="" --column="Option" "${zen_options[@]}" 2>/dev/null)"
|
||||
|
||||
# Loop through the options array to match the chosen option
|
||||
matched="false"
|
||||
@ -524,7 +527,7 @@ getdirs() {
|
||||
# The location within the USER directory to which the game exports keybinds
|
||||
keybinds_dir="$user_dir/Controls/Mappings"
|
||||
# Shaders directory
|
||||
shaders_dir="$user_dir/shaders"
|
||||
shaders_dir="$wine_prefix/$appdata_path/shaders"
|
||||
# dxvk cache file
|
||||
dxvk_cache="$game_path/$live_or_ptu/StarCitizen.dxvk-cache"
|
||||
# Where to store backed up keybinds
|
||||
@ -1030,6 +1033,9 @@ download_install() {
|
||||
*.tar.xz)
|
||||
download_name="$(basename "$download_file" .tar.xz)"
|
||||
;;
|
||||
*.tar.zst)
|
||||
download_name="$(basename "$download_file" .tar.zst)"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Unknown archive filetype in download_install function. Aborting."
|
||||
;;
|
||||
@ -1232,6 +1238,9 @@ download_select_install() {
|
||||
*.tar.xz)
|
||||
download_name="$(basename "${download_versions[i]}" .tar.xz)"
|
||||
;;
|
||||
*.tar.zst)
|
||||
download_name="$(basename "${download_versions[i]}" .tar.zst)"
|
||||
;;
|
||||
*)
|
||||
debug_print exit "Unknown archive filetype in download_select_install function. Aborting."
|
||||
;;
|
||||
@ -1498,18 +1507,29 @@ rm_shaders() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Sanity check
|
||||
if [ ! -d "$shaders_dir" ]; then
|
||||
message warning "Shaders directory not found. There is nothing to delete!\n\n$shaders_dir"
|
||||
return 0
|
||||
fi
|
||||
# Create an array containing all directories in the appdata_path
|
||||
for appdata_list in "$wine_prefix/$appdata_path"/*; do
|
||||
if [ -d "$appdata_list" ]; then
|
||||
appdata_items+=("$appdata_list")
|
||||
fi
|
||||
done
|
||||
|
||||
# Delete the shader directory
|
||||
if message question "The following directory will be deleted:\n\n$shaders_dir\n\nDo you want to proceed?"; then
|
||||
debug_print continue "Deleting $shaders_dir..."
|
||||
rm -r "$shaders_dir"
|
||||
message info "Your shaders have been deleted!"
|
||||
fi
|
||||
# Delete shaders directory in every directory beginning with "sc-alpha"
|
||||
for (( i=0; i<"${#appdata_items[@]}"; i++ )); do
|
||||
if [ "${appdata_items[i]}" = "$wine_prefix/$appdata_path"/sc-alpha* ]; then # check if the item in the array begins with sc-alpha
|
||||
if [ -d "${appdata_items[i]}/shaders" ]; then # check if there is a shaders subfolder
|
||||
if message question "The following directory will be deleted:\n\n${appdata_items[i]}/shaders\n\nDo you want to proceed?"; then
|
||||
debug_print continue "Deleting ${appdata_items[i]}/shaders..."
|
||||
rm -r "${appdata_items[i]}/shaders"
|
||||
message info "Your shaders have been deleted!"
|
||||
fi
|
||||
elif [ $i = $(( "${#appdata_items[@]}" - 1 )) ]; then # display message when end of array is reached and no shaders directories were found
|
||||
message info "No more shader directories found"
|
||||
fi
|
||||
elif [ $i = $(( "${#appdata_items[@]}" - 1 )) ]; then # display message when end of array is reached and no shaders or sc-alpha directories were found
|
||||
message info "No more shader directories found"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Delete DXVK cache
|
||||
|
Reference in New Issue
Block a user