Merge pull request #814 from icenine451/cooker-0.8.2b-icenine451

Cooker 0.8.2b icenine451
This commit is contained in:
icenine451 2024-06-21 21:32:51 -04:00 committed by GitHub
commit ac992bb8a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 17 deletions

View file

@ -42,6 +42,14 @@ find_empty_rom_folders() {
empty_rom_folders_list=() empty_rom_folders_list=()
all_empty_folders=() all_empty_folders=()
all_helper_files=()
while IFS='^' read -r file dest
do
if [[ ! "$file" == "#"* ]] && [[ ! -z "$file" ]]; then
all_helper_files=("${all_helper_files[@]}" "$file")
fi
done < "$helper_files_list"
for system in $(find "$roms_folder" -mindepth 1 -maxdepth 1 -type d -printf '%f\n') for system in $(find "$roms_folder" -mindepth 1 -maxdepth 1 -type d -printf '%f\n')
do do
@ -59,6 +67,21 @@ find_empty_rom_folders() {
empty_rom_folders_list=("${empty_rom_folders_list[@]}" "false" "$(realpath $dir)") empty_rom_folders_list=("${empty_rom_folders_list[@]}" "false" "$(realpath $dir)")
all_empty_folders=("${all_empty_folders[@]}" "$(realpath $dir)") all_empty_folders=("${all_empty_folders[@]}" "$(realpath $dir)")
echo "$(realpath $dir)" >> "$godot_empty_roms_folders" # Godot data transfer temp file echo "$(realpath $dir)" >> "$godot_empty_roms_folders" # Godot data transfer temp file
elif [[ $count -eq 2 ]] && [[ "$files" =~ "systeminfo.txt" ]]; then
# Directory contains 2 files, one of which is "systeminfo.txt"
for helper_file in ${all_helper_files[@]} # Compare helper file list to dir file list
do
if [[ "$files" =~ "$helper_file" ]]; then
contains_helper_file="true" # Helper file was found
break
fi
done
if [[ "$contains_helper_file" == "true" ]]; then
# Directory contains only systeminfo.txt and a helper file
empty_rom_folders_list=("${empty_rom_folders_list[@]}" "false" "$(realpath $dir)")
all_empty_folders=("${all_empty_folders[@]}" "$(realpath $dir)")
echo "$(realpath $dir)" >> "$godot_empty_roms_folders" # Godot data transfer temp file
fi
fi fi
done done
} }

View file

@ -560,7 +560,6 @@ deploy_helper_files() {
eval current_dest="$dest" eval current_dest="$dest"
cp -f "$helper_files_folder/$file" "$current_dest/$file" cp -f "$helper_files_folder/$file" "$current_dest/$file"
fi fi
done < "$helper_files_list" done < "$helper_files_list"
} }

View file

@ -124,7 +124,7 @@ prepare_component() {
create_dir "$bios_folder/fbneo/cheats" create_dir "$bios_folder/fbneo/cheats"
create_dir "$bios_folder/fbneo/blend" create_dir "$bios_folder/fbneo/blend"
dir_prep "$mods_folder/FBNeo" "$bios_folder/fbneo/patched" dir_prep "$mods_folder/FBNeo" "$bios_folder/fbneo/patched"
# PPSSPP # PPSSPP
log i "--------------------------------" log i "--------------------------------"
log i "Prepearing PPSSPP_LIBRETRO" log i "Prepearing PPSSPP_LIBRETRO"
@ -172,11 +172,11 @@ prepare_component() {
set_setting_value "$ra_scummvm_conf" "themepath" "$mods_folder/RetroArch/ScummVM/theme" "libretro_scummvm" "scummvm" set_setting_value "$ra_scummvm_conf" "themepath" "$mods_folder/RetroArch/ScummVM/theme" "libretro_scummvm" "scummvm"
set_setting_value "$ra_scummvm_conf" "savepath" "$saves_folder/scummvm" "libretro_scummvm" "scummvm" set_setting_value "$ra_scummvm_conf" "savepath" "$saves_folder/scummvm" "libretro_scummvm" "scummvm"
set_setting_value "$ra_scummvm_conf" "browser_lastpath" "$roms_folder/scummvm" "libretro_scummvm" "scummvm" set_setting_value "$ra_scummvm_conf" "browser_lastpath" "$roms_folder/scummvm" "libretro_scummvm" "scummvm"
dir_prep "$texture_packs_folder/RetroArch-Mesen" "/var/config/retroarch/system/HdPacks" dir_prep "$texture_packs_folder/RetroArch-Mesen" "/var/config/retroarch/system/HdPacks"
dir_prep "$texture_packs_folder/RetroArch-Mupen64Plus/cache" "/var/config/retroarch/system/Mupen64plus/cache" dir_prep "$texture_packs_folder/RetroArch-Mupen64Plus/cache" "/var/config/retroarch/system/Mupen64plus/cache"
dir_prep "$texture_packs_folder/RetroArch-Mupen64Plus/hires_texture" "/var/config/retroarch/system/Mupen64plus/hires_texture" dir_prep "$texture_packs_folder/RetroArch-Mupen64Plus/hires_texture" "/var/config/retroarch/system/Mupen64plus/hires_texture"
# Reset default preset settings # Reset default preset settings
set_setting_value "$rd_conf" "retroarch" "$(get_setting_value "$rd_defaults" "retroarch" "retrodeck" "cheevos")" "retrodeck" "cheevos" set_setting_value "$rd_conf" "retroarch" "$(get_setting_value "$rd_defaults" "retroarch" "retrodeck" "cheevos")" "retrodeck" "cheevos"
set_setting_value "$rd_conf" "retroarch" "$(get_setting_value "$rd_defaults" "retroarch" "retrodeck" "cheevos_hardcore")" "retrodeck" "cheevos_hardcore" set_setting_value "$rd_conf" "retroarch" "$(get_setting_value "$rd_defaults" "retroarch" "retrodeck" "cheevos_hardcore")" "retrodeck" "cheevos_hardcore"
@ -853,7 +853,7 @@ prepare_component() {
sed -i 's#RETRODECKSAVESDIR#'$saves_folder'#g' "/var/config/gzdoom/gzdoom.ini" # This is an unfortunate one-off because set_setting_value does not currently support JSON sed -i 's#RETRODECKSAVESDIR#'$saves_folder'#g' "/var/config/gzdoom/gzdoom.ini" # This is an unfortunate one-off because set_setting_value does not currently support JSON
fi fi
if [[ $component_found="false" ]]; then if [[ $component_found == "false" ]]; then
log e "Supplied component $component not found, not resetting" log e "Supplied component $component not found, not resetting"
fi fi

View file

@ -586,16 +586,10 @@ configurator_retrodeck_tools_dialog() {
"Tool: Remove Empty ROM Folders" ) "Tool: Remove Empty ROM Folders" )
log i "Configurator: opening \"$choice\" menu" log i "Configurator: opening \"$choice\" menu"
(
find_empty_rom_folders configurator_generic_dialog "RetroDECK Configurator - Remove Empty ROM Folders" "Searching for empty rom folders, please be patient..."
) | find_empty_rom_folders
zenity --progress --no-cancel --pulsate --auto-close \
--icon-name=net.retrodeck.retrodeck \
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title="Finding Empty ROM Folders" \
--width=400 --height=200 \
--text="Finding empty ROM folders, please be patient.\n\n"
choice=$(zenity \ choice=$(zenity \
--list --width=1200 --height=720 --title "RetroDECK Configurator - RetroDECK: Remove Empty ROM Folders" \ --list --width=1200 --height=720 --title "RetroDECK Configurator - RetroDECK: Remove Empty ROM Folders" \
--checklist --hide-column=3 --ok-label="Remove Selected" --extra-button="Remove All" \ --checklist --hide-column=3 --ok-label="Remove Selected" --extra-button="Remove All" \
@ -604,7 +598,7 @@ configurator_retrodeck_tools_dialog() {
--column "Remove?" \ --column "Remove?" \
--column "System" \ --column "System" \
"${empty_rom_folders_list[@]}") "${empty_rom_folders_list[@]}")
local rc=$? local rc=$?
if [[ $rc == "0" && ! -z $choice ]]; then # User clicked "Remove Selected" with at least one system selected if [[ $rc == "0" && ! -z $choice ]]; then # User clicked "Remove Selected" with at least one system selected
IFS="," read -ra folders_to_remove <<< "$choice" IFS="," read -ra folders_to_remove <<< "$choice"
@ -620,7 +614,7 @@ configurator_retrodeck_tools_dialog() {
done done
configurator_generic_dialog "RetroDECK Configurator - Remove Empty ROM Folders" "The removal process is complete." configurator_generic_dialog "RetroDECK Configurator - Remove Empty ROM Folders" "The removal process is complete."
fi fi
configurator_retrodeck_tools_dialog configurator_retrodeck_tools_dialog
;; ;;