Seletor DOOM para Doomretro

Publicado por Xerxes (última atualização em 08/07/2024)

[ Hits: 1.554 ]

Homepage: -

Download seletor_doom.sh




Simples script feito para selecionar o jogo DOOM no port Doomretro.

Altere ao seu gosto, incluindo ou removendo os maps e mods que você tem.

Após compilar o Doomretro no Linux, crie um diretório "maps" e outro "mods" dentro do "build" do Doomretro.

Coloque os wads dentro de cada um, respectivamente.

Coloque o script dentro de "build" também.

Dê permissão de execução (chmod +x ./doom_seletor.sh) e execute.

Para compilar o Doomretro use a dica:

https://www.vivaolinux.com.br/dica/Como-compilar-o-DOOM-RETRO-no-Linux

Testado com a seguinte estrutura:

$ ls maps/ -1
doom2.wad
doom.wad
DoomZeroHQMusic.wad
doomzero.wad
freedoom1.wad
freedoom2.wad
master #diretório com os niveis master
plutonia.wad
SIGIL_II_V1_0_COMPAT.WAD
SIGIL_II_V1_0.WAD
SIGIL_v1_2.wad
tnt.wad


$ ls mods/ -1
D1SPFX20.WAD
D2SPFX20.WAD
doom_uwide_v2.wad
freedoom_uwide_v2.wad
pk_doom_sfx_20120224.wad
SD21.wad
vsmooth.wad

  



Esconder código-fonte

#!/bin/bash

# SELETOR DOOM
# v1.0b 7/7/2024
# Xerxes Lins (https://www.vivaolinux.com.br/~xerxeslins)


# Função para exibir o menu inicial
menu_inicial() {
    tput civis  # Oculta o cursor
    tput cup 0 0  # Move o cursor para a posição 0,0
    echo "SELETOR DE JOGOS DOOM"
    echo "" 
    options=("Ultimate DOOM (+SIGIL I)" "Ultimate DOOM (+SIGIL II)" "DOOM 2" "Master Levels" "TNT" "PLUTONIA" "DOOM Zero"
     "Freedoom 1" "Freedoom 2")
    for i in "${!options[@]}"; do
        if [[ $i == $selected_option ]]; then
            echo "> ${options[i]}"
        else
            echo "  ${options[i]}"
        fi
    done
    echo ""
    echo "Use as teclas de seta para navegar e Enter para selecionar"
    echo "(Ctrl+c para encerrar)"
    tput cnorm  # Mostra o cursor novamente
}

# Função para exibir o submenu dos Master Levels
master_levels_submenu() {
    tput civis  # Oculta o cursor
    tput cup 0 0  # Move o cursor para a posição 0,0
    echo "SELETOR DE JOGOS DOOM"
    echo ""
    echo "Escolha um nível dos Master Levels:"
    echo ""
    options=("Level 1: Attack" "Level 2: Canyon" "Level 3: The Catwalk" "Level 4: The Combine" 
             "Level 5: The Fistula" "Level 6: The Garrison" "Level 7: Titan Manor" "Level 8: Paradox" 
             "Level 9: Subspace" "Level 10: Subterra" "Level 11: Trapped on Titan" 
             "Level 12: Virgil's Lead: 3rd Canto of Inferno" "Level 13: Minos' Judgment: 4th Canto of Inferno" 
             "Level 14: Bloodsea Keep" "Level 15: Mephisto's Maosoleum" "Level 16: Nessus: 5th Canto of Inferno" 
             "Level 17: Geryon: 6th Canto of Inferno" "Level 18: Vesperas: 7th Canto of Inferno" 
             "Level 19: Black Tower" "Level 20: The Express Elevator to Hell" "Level 21: Bad Dream" " " "VOLTAR AO MENU INICIAL")
    for i in "${!options[@]}"; do
        if [[ $i == $selected_option ]]; then
            echo "> ${options[i]}"
        else
            echo "  ${options[i]}"
        fi
    done
    echo ""
    echo "Use as teclas de seta para navegar e Enter para selecionar"
    echo "(Ctrl+c para encerrar)"
    tput cnorm  # Mostra o cursor novamente
}

# Lê entrada do menu inicial
entrada_menu_inicial() {
    while true; do
        read -rsn1 input
        case $input in
            $'\x1B') # Seta 
                read -rsn2 -t 0.1 input
                if [[ $input == '[A' ]]; then # Para cima
                    ((selected_option--))
                    if ((selected_option < 0)); then selected_option=8; fi
                elif [[ $input == '[B' ]]; then # Para baixo
                    ((selected_option++))
                    if ((selected_option > 8)); then selected_option=0; fi
                fi
                ;;
            "") # Enter
                case $selected_option in
                    0) ./doomretro -iwad maps/doom.wad -file  maps/SIGIL_v1_2.wad mods/pk_doom_sfx_20120224.wad mods/D1SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 3;;
                    1) ./doomretro -iwad maps/doom.wad -file  maps/SIGIL_II_V1_0_COMPAT.WAD mods/pk_doom_sfx_20120224.wad mods/D1SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 3;;
                    2) ./doomretro -iwad maps/doom2.wad -file mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -warp 01 -compat 4;;
                    3) clear; selected_option=0; master_levels_submenu; entrada_submenu_master;;
                    4) ./doomretro -iwad maps/doom2.wad -file mods/freedoom_uwide_v2.wad maps/tnt.wad mods/doom_uwide_v2.wad mods/pk_doom_sfx_20120224.wad mods/SD21.wad -compat 4;;
                    5) ./doomretro -iwad maps/doom2.wad -file mods/freedoom_uwide_v2.wad maps/plutonia.wad mods/doom_uwide_v2.wad mods/pk_doom_sfx_20120224.wad mods/SD21.wad -compat 4;;
                    6) ./doomretro -iwad maps/doom2.wad -file maps/doomzero.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad maps/DoomZeroHQMusic.wad mods/SD21.wad -compat 4;;
                    7) ./doomretro -iwad maps/freedoom1.wad -file mods/freedoom_uwide_v2.wad mods/D1SPFX20.WAD mods/SD21.wad;;
                    8) ./doomretro -iwad maps/freedoom2.wad -file mods/freedoom_uwide_v2.wad mods/D1SPFX20.WAD mods/SD21.wad;;
                    
                esac
                exit
                ;;
        esac
        menu_inicial
    done
}

# Lê entrada do submenu dos Master Levels
entrada_submenu_master() {
    while true; do
        read -rsn1 input
        case $input in
            $'\x1B') # Seta 
                read -rsn2 -t 0.1 input
                if [[ $input == '[A' ]]; then # Para cima
                    ((selected_option--))
                    if ((selected_option < 0)); then selected_option=22; fi
                    if ((selected_option == 21)); then selected_option=20; fi
                elif [[ $input == '[B' ]]; then # Para baixo
                    ((selected_option++))
                    if ((selected_option > 22)); then selected_option=0; fi
                    if ((selected_option == 21)); then selected_option=22; fi

                fi
                ;;              
            "") # Enter
                case $selected_option in
                    0) ./doomretro -iwad maps/doom2.wad -file maps/master/attack.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    1) ./doomretro -iwad maps/doom2.wad -file maps/master/canyon.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    2) ./doomretro -iwad maps/doom2.wad -file maps/master/catwalk.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    3) ./doomretro -iwad maps/doom2.wad -file maps/master/combine.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    4) ./doomretro -iwad maps/doom2.wad -file maps/master/fistula.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    5) ./doomretro -iwad maps/doom2.wad -file maps/master/garrison.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    6) ./doomretro -iwad maps/doom2.wad -file maps/master/manor.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    7) ./doomretro -iwad maps/doom2.wad -file maps/master/paradox.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    8) ./doomretro -iwad maps/doom2.wad -file maps/master/subspace.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    9) ./doomretro -iwad maps/doom2.wad -file maps/master/subterra.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    10) ./doomretro -iwad maps/doom2.wad -file maps/master/ttrap.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    11) ./doomretro -iwad maps/doom2.wad -file maps/master/virgil.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -warp 03 -compat 4;;
                    12) ./doomretro -iwad maps/doom2.wad -file maps/master/minos.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -warp 05 -compat 4;;
                    13) ./doomretro -iwad maps/doom2.wad -file maps/master/bloodsea.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    14) ./doomretro -iwad maps/doom2.wad -file maps/master/mephisto.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -warp 07 -compat 4;;
                    15) ./doomretro -iwad maps/doom2.wad -file maps/master/nessus.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    16) ./doomretro -iwad maps/doom2.wad -file maps/master/geryon.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -warp 08 -compat 4;;
                    17) ./doomretro -iwad maps/doom2.wad -file maps/master/vesperas.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -compat 4;;
                    18) ./doomretro -iwad maps/doom2.wad -file maps/master/blacktwr.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -warp 25 -compat 4;;
                    19) ./doomretro -iwad maps/doom2.wad -file maps/master/teeth.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -warp 31 -compat 4;;
                    20) ./doomretro -iwad maps/doom2.wad -file maps/master/teeth.wad mods/pk_doom_sfx_20120224.wad mods/D2SPFX20.WAD mods/doom_uwide_v2.wad mods/SD21.wad -warp 32 -compat 4;;
                    22) clear; selected_option=0; menu_inicial; entrada_menu_inicial;;
                esac
                exit
                ;;
        esac
        master_levels_submenu
    done
}

# Posição inicial
selected_option=0

# Mostra menu inicial
clear
menu_inicial
entrada_menu_inicial

Scripts recomendados

Configuração da placa Pixel View Hybrid semi-automatizada

Estranho

Desligando seu PC com controle total e aviso sonoro

atari-usplash para edgy

Fake Login


  

Comentários
[1] Comentário enviado por maurixnovatrento em 20/07/2024 - 18:09h

Gostei do esquema do menu.
______________________________________________________________________
Inscreva-se no meu Canal: https://www.youtube.com/@LinuxDicasPro
Repositório GitHub do Canal: https://github.com/LinuxDicasPro
Grupo do Telegram: https://t.me/LinuxDicasPro
Meu GitHub Pessoal: https://github.com/mxnt10


Contribuir com comentário




Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts