Compare commits

...

6 Commits

Author SHA1 Message Date
the Sane
7426d0ffb3
Update formatting 2022-10-16 11:20:13 -04:00
the Sane
1cb9eb6488
Update README.md 2022-10-16 11:16:44 -04:00
the-sane
a8c4257430 Bump version 2022-10-16 11:04:15 -04:00
the-sane
b2f542e029 Remove TKG from runner sources
They've switched to CI builds, which we don't currently support
2022-10-16 11:03:44 -04:00
the-sane
17b1bfe140 Rename function 2022-10-16 11:00:16 -04:00
the-sane
f19faa8235 Refactor rm_shaders() 2022-10-16 10:57:01 -04:00
2 changed files with 31 additions and 32 deletions

View File

@ -43,8 +43,8 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
- To re-import your keybinds from within the game, select them from the list:
- *Options->Keybindings->Control Profiles*
- `Delete my shaders folder only`
- Sometimes all you need to do between major version updates is delete your shaders directory.
- `Delete my shaders`
- It is recommended to delete your shaders directory after each game update.
- `Delete my DXVK cache`
- A troubleshooting step that sometimes helps fix various issues and crashes.
@ -55,6 +55,9 @@ Keybinds are backed up to *$XDG_CONFIG_HOME/starcitizen-lug/keybinds/*
- `Reset Helper configs`
- Delete the configs saved by the helper in *$XDG_CONFIG_HOME/starcitizen-lug/*
- `Show the LUG Wiki`
- Display a link to the LUG Wiki for help with installation and troubleshooting
`Get a random Penguin's Star Citizen referral code`
- Display a referral code for a random member of the Star Citizen Linux Users Group.
@ -67,11 +70,11 @@ From Source:
2. Extract it!
3. Run it!
Dependencies: bash, coreurtils, curl, polkit (those should be installed by default on most distributions)
Optional Dependencies: zenity (for GUI), zstd (to extract some runners)
Arch Linux: https://aur.archlinux.org/packages/lug-helper/
_Dependencies: **bash**, **coreutils**, **curl**, **polkit** (these should be installed by default on most distributions)_
_Optional Dependencies: **zenity** (for GUI), **zstd** (to extract some runners)_
## Contributors:
- https://github.com/Termuellinator
- https://github.com/pstn

View File

@ -108,8 +108,12 @@ install_path="drive_c/Program Files/Roberts Space Industries/$sc_base_dir"
live_dir="LIVE"
ptu_dir="PTU"
# AppData directory
# Location in the WINE prefix where shaders are stored
appdata_path="drive_c/users/$USER/AppData/Local/Star Citizen"
# The shaders subdirectory name
shaders_subdir="shaders"
# Remaining directory paths are set at the end of the getdirs() function
######## Runners ###########################################################
@ -125,7 +129,6 @@ runner_sources=(
"RawFox" "https://api.github.com/repos/starcitizen-lug/raw-wine/releases"
"/dev/null" "https://api.github.com/repos/gort818/wine-sc-lug/releases"
"GloriousEggroll" "https://api.github.com/repos/GloriousEggroll/wine-ge-custom/releases"
"TKG" "https://api.github.com/repos/Frogging-Family/wine-tkg-git/releases"
)
######## DXVK ##############################################################
@ -178,7 +181,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.21"
current_version="v1.22"
############################################################################
############################################################################
@ -533,7 +536,7 @@ getdirs() {
# The location within the USER directory to which the game exports keybinds
keybinds_dir="$user_dir/Controls/Mappings"
# Shaders directory
shaders_dir="$wine_prefix/$appdata_path/shaders"
shaders_dir="$wine_prefix/$appdata_path"
# dxvk cache file
dxvk_cache="$game_path/$live_or_ptu/StarCitizen.dxvk-cache"
# Where to store backed up keybinds
@ -584,7 +587,7 @@ display_dirs() {
}
# Save exported keybinds, wipe the USER directory, and restore keybinds
sanitize() {
rm_userdir() {
# Prompt user to back up the current keybinds in the game
message info "Before proceeding, please be sure you have exported\nyour Star Citizen keybinds from within the game.\n\nTo do this, launch the game and go to:\nOptions->Keybindings->Control Profiles->Save Control Settings\n\nGo on; I'll wait."
@ -1533,25 +1536,18 @@ rm_shaders() {
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")
# Loop through all possible shader directories
for appdata_dir in "$shaders_dir"/*; do
if [ -d "$appdata_dir/$shaders_subdir" ]; then
# If a shaders directory is found, delete it
if message question "The following directory will be deleted:\n\n$appdata_dir/$shaders_subdir\n\nDo you want to proceed?"; then
debug_print continue "Deleting $appdata_dir/$shaders_subdir..."
rm -r "$appdata_dir/$shaders_subdir"
fi
fi
done
# 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* ]] && [[ -d "${appdata_items[i]}"/shaders ]]; then # check if the item in the array begins with sc-alpha
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 or sc-alpha directories were found
message info "No more shader directories found"
fi
done
message info "All shaders have been deleted"
}
# Delete DXVK cache
@ -1590,8 +1586,8 @@ maintenance_menu() {
# Configure the menu options
version_msg="Switch the Helper between LIVE and PTU (Currently: $live_or_ptu)"
sanitize_msg="Delete my Star Citizen USER folder and preserve my keybinds"
shaders_msg="Delete my shaders folder only (Do this after each game update)"
userdir_msg="Delete my Star Citizen USER folder and preserve my keybinds"
shaders_msg="Delete my shaders (Do this after each game update)"
vidcache_msg="Delete my DXVK cache"
dirs_msg="Display Helper and Star Citizen directories"
wiki_msg="Show the LUG Wiki"
@ -1599,9 +1595,9 @@ maintenance_menu() {
quit_msg="Return to the main menu"
# Set the options to be displayed in the menu
menu_options=("$version_msg" "$sanitize_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$wiki_msg" "$reset_msg" "$quit_msg")
menu_options=("$version_msg" "$userdir_msg" "$shaders_msg" "$vidcache_msg" "$dirs_msg" "$wiki_msg" "$reset_msg" "$quit_msg")
# Set the corresponding functions to be called for each of the options
menu_actions=("set_version" "sanitize" "rm_shaders" "rm_dxvkcache" "display_dirs" "display_wiki" "reset_helper" "menu_loop_done")
menu_actions=("set_version" "rm_userdir" "rm_shaders" "rm_dxvkcache" "display_dirs" "display_wiki" "reset_helper" "menu_loop_done")
# Calculate the total height the menu should be
menu_height="$(($menu_option_height * ${#menu_options[@]} + $menu_text_height))"
@ -1717,7 +1713,7 @@ Usage: lug-helper <options>
cargs+=("dxvk_manage")
;;
--delete-user-folder | -u )
cargs+=("sanitize")
cargs+=("rm_userdir")
;;
--delete-shaders | -s )
cargs+=("rm_shaders")