Compare commits

..

No commits in common. "25b122e8919a023afc8073c31211c0013bc91d53" and "44bcbf8161bb1adaeed197efd2e4baa1c3c03766" have entirely different histories.

View File

@ -806,22 +806,6 @@ lutris_restart() {
#------------------------- begin download functions ----------------------------#
# Display post download message or instructions if needed
# Expects the variables message_heading, post_download_msg1,
# post_download_msg2, and downloaded_item_name
post_download() {
if [ "$trigger_post_download" = "true" ]; then
message_heading="Download Complete"
if [ "$use_zenity" -eq 1 ]; then
message_heading="<b>$message_heading</b>"
post_download_msg2="<i>$post_download_msg2</i>"
fi
message info "$message_heading\n\n$post_download_msg1\n\n$post_download_msg2\n$downloaded_item_name"
fi
trigger_post_download="false"
}
# Uninstall the selected item
download_delete() {
# This function expects an index number for the array
@ -973,7 +957,6 @@ download_install() {
for extracted_item in "$tmp_dir/$download_name"/*; do
if [ -d "$extracted_item" ]; then
num_dirs="$((num_dirs+1))"
extracted_dir="$(basename "$extracted_item")"
elif [ -f "$extracted_item" ]; then
num_files="$((num_files+1))"
fi
@ -983,9 +966,13 @@ download_install() {
if [ "$num_dirs" -eq 0 ] && [ "$num_files" -eq 0 ]; then
# Sanity check
message warning "The downloaded archive is empty. There is nothing to do."
# Cleanup tmp download
debug_print continue "Removing $tmp_dir/$download_file..."
rm "$tmp_dir/$download_file"
return 1
elif [ "$num_dirs" -eq 1 ] && [ "$num_files" -eq 0 ]; then
# If the archive contains only one directory, install that directory
debug_print continue "Installing $download_type into $download_dir/$extracted_dir..."
debug_print continue "Installing $download_type into $download_dir..."
if [ "$use_zenity" -eq 1 ]; then
# Use Zenity progress bar
mkdir -p "$download_dir" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir" | \
@ -993,15 +980,7 @@ download_install() {
else
mkdir -p "$download_dir" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir"
fi
# We need to restart Lutris for the download to be detected
lutris_needs_restart="true"
# Store the final name of the downloaded directory
downloaded_item_name="$extracted_dir"
# Trigger the post_download() function
trigger_post_download="true"
elif [ "$num_dirs" -gt 1 ] || [ "$num_files" -gt 0 ]; then
# If the archive contains more than one directory or
# one or more files, we must create a subdirectory
@ -1013,15 +992,7 @@ download_install() {
else
mkdir -p "$download_dir/$download_name" && cp -r "$tmp_dir"/"$download_name"/* "$download_dir"/"$download_name"
fi
# We need to restart Lutris for the download to be detected
lutris_needs_restart="true"
# Store the final name of the downloaded directory
downloaded_item_name="$download_name"
# Trigger the post_download() function
trigger_post_download="true"
else
# Some unexpected combination of directories and files
debug_print exit "Script error: Unexpected archive contents in download_install function. Aborting"
@ -1029,11 +1000,8 @@ download_install() {
fi
# Cleanup tmp download
debug_print continue "Cleaning up $tmp_dir/$download_file..."
debug_print continue "Removing $tmp_dir/$download_file..."
rm "$tmp_dir/$download_file"
# Display any post-download messages or instructions
post_download
}
# List available items for download
@ -1225,10 +1193,6 @@ download_manage() {
# Configure the download_manage function for runners
runner_manage() {
# Set some defaults
lutris_needs_restart="false"
trigger_post_download="false"
# Use indirect expansion to point download_sources
# to the runner_sources array set at the top of the script
declare -n download_sources=runner_sources
@ -1239,15 +1203,6 @@ runner_manage() {
download_menu_description="The runners listed below are wine builds created for Star Citizen"
download_menu_height="140"
# Set the post download instructions
# Format:
# A header is automatically displayed that reads: Download Complete
# msg1 is displayed below the header
# msg2 is displayed below that in italics when zenity is in use
# Lastly, the downloaded directory name is automatically displayed
post_download_msg1="Select the runner in Lutris from the dropdown menu"
post_download_msg2="Configure->Runner Options->Wine version"
# Call the download_manage function with the above configuration
# The argument passed to the function is used for special handling
# and displayed in the menus and dialogs.
@ -1256,10 +1211,6 @@ runner_manage() {
# Configure the download_manage function for dxvks
dxvk_manage() {
# Set some defaults
lutris_needs_restart="false"
trigger_post_download="false"
# Use indirect expansion to point download_sources
# to the dxvk_sources array set at the top of the script
declare -n download_sources=dxvk_sources
@ -1270,15 +1221,6 @@ dxvk_manage() {
download_menu_description="The DXVK versions below may help improve game performance"
download_menu_height="140"
# Set the post download instructions
# Format:
# A header is automatically displayed that reads: Download Complete
# msg1 is displayed below the header
# msg2 is displayed below that in italics when zenity is in use
# Lastly, the downloaded directory name is automatically displayed
post_download_msg1="Type the DXVK folder name in your Lutris settings"
post_download_msg2="Configure->Runner Options->DXVK version"
# Call the download_manage function with the above configuration
# The argument passed to the function is used for special handling
# and displayed in the menus and dialogs.
@ -1493,8 +1435,9 @@ if [ -x "$(command -v zenity)" ]; then
use_zenity=1
fi
# Set defaults
# Set some defaults
live_or_ptu="$live_dir"
lutris_needs_restart="false"
# Check if a newer verison of the script is available
latest_version="$(get_latest_release "$repo")"