Finally fixed the repeating of iwads when launched through the game launcher.
This commit is contained in:
parent
9877a7b72a
commit
c0bf989641
@ -19,17 +19,18 @@ is_iwad() {
|
|||||||
iwad_menu() {
|
iwad_menu() {
|
||||||
# Extract the Path= lines from the [IWADSearch.Directories] section
|
# Extract the Path= lines from the [IWADSearch.Directories] section
|
||||||
mapfile -t wadPaths < <(sed -n "/^\[IWADSearch.Directories\]/,/^\[/{/Path=/p;}" "$configFile" | cut -d '=' -f 2)
|
mapfile -t wadPaths < <(sed -n "/^\[IWADSearch.Directories\]/,/^\[/{/Path=/p;}" "$configFile" | cut -d '=' -f 2)
|
||||||
declare -a wadList
|
declare -A uniqueWads
|
||||||
# Loop through each path in wadPaths and find WAD files
|
|
||||||
for i in "${wadPaths[@]}"; do
|
for i in "${wadPaths[@]}"; do
|
||||||
# Use find and append results to wadList array
|
|
||||||
if [[ -d "$i" ]]; then
|
if [[ -d "$i" ]]; then
|
||||||
while IFS= read -r -d $'\0' wad; do
|
while IFS= read -r -d $'\0' wad; do
|
||||||
is_iwad "$wad" && wadList+=("$wad")
|
if is_iwad "$wad"; then
|
||||||
|
wad_name=$(basename "$wad")
|
||||||
|
uniqueWads["${wad_name,,}"]="$wad"
|
||||||
|
fi
|
||||||
done < <(find "$i" -follow -maxdepth 1 -type f \( -iname '*.wad' -o -iname '*.ipk3' \) -print0)
|
done < <(find "$i" -follow -maxdepth 1 -type f \( -iname '*.wad' -o -iname '*.ipk3' \) -print0)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
wadList=("${uniqueWads[@]}")
|
||||||
# Set up the menu
|
# Set up the menu
|
||||||
declare -a wadMenu
|
declare -a wadMenu
|
||||||
for path in "${wadList[@]}" ; do
|
for path in "${wadList[@]}" ; do
|
||||||
|
Loading…
Reference in New Issue
Block a user