linux-game-manager/.launch/TobyCustom/.mapmenu
2024-12-26 19:31:39 -05:00

31 lines
1.0 KiB
Plaintext
Executable File

# Choice of maps
mapList=(
"${gamePath}/OpMDK.wad"
"${gamePath}/Addons/MAPS/TobyDoomLevels.wad"
"${gamePath}/Addons/MAPS/Toby-Demo-Level.wad"
)
declare -a mapMenu=('none' 'None')
for i in "${mapList[@]}" ; do
if [[ -e "$i" ]]; then
title="${i##*/}"
title="${title%.*}"
title="${title/OpMDK/Operation MDK}"
title="${title/-/ }"
mapMenu+=("$i" "$title")
fi
done
map="$(dialog --backtitle "Select Map" \
--clear \
--no-tags \
--cancel-label "Exit" \
--ok-label "Next" \
--menu "Please select one" 0 0 0 "${mapMenu[@]}" --stdout)"
[[ $? -ne 0 ]] && exit 0
if [[ "${map}" != "none" ]]; then
gameOption=("$map" "${gameOption[@]}")
fi
if [[ "${map}" == ""${gamePath}/TobyDoomLevels.wad"" ]]; then
gameOption=("$map" "${gameOption[@]}" "${gamePath}/Toby-Doom-Level-Music-Renamer.pk3")
fi