Advertisement
ExampleWhoexample

Fallout 1.sh

Dec 20th, 2024
43
0
363 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.24 KB | Gaming | 0 0
  1. #!/bin/bash
  2. # PORTMASTER: fallout1.zip, Fallout 1.sh
  3. # Built from https://github.com/alexbatalov/fallout2-ce
  4.  
  5. PORTNAME="Fallout 1"
  6. export HOME=/root
  7.  
  8. XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
  9.  
  10. if [ -d "/opt/system/Tools/PortMaster/" ]; then
  11.   controlfolder="/opt/system/Tools/PortMaster"
  12. elif [ -d "/opt/tools/PortMaster/" ]; then
  13.   controlfolder="/opt/tools/PortMaster"
  14. elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
  15.   controlfolder="$XDG_DATA_HOME/PortMaster"
  16. else
  17.   controlfolder="/roms/ports/PortMaster"
  18. fi
  19.  
  20.  
  21. to_lower_case() {
  22.     for SRC in $(find "$1" -depth); do
  23.     DST=$(dirname "${SRC}")/$(basename "${SRC}" | tr '[A-Z]' '[a-z]')
  24.     if [ "${SRC}" != "${DST}" ]; then
  25.         [ ! -e "${DST}" ] && $ESUDO mv -vT "${SRC}" "${DST}" || echo "- ${SRC} was not renamed"
  26.     fi
  27.     done
  28. }
  29.  
  30. SHDIR=$(dirname "$0")
  31.  
  32. source $controlfolder/control.txt
  33. get_controls
  34.  
  35. PORTDIR="/$directory/ports/fallout1"
  36.  
  37. CUR_TTY=/dev/tty0
  38. $ESUDO chmod 666 $CUR_TTY
  39.  
  40. GAMEDIR="$SHDIR/fallout1"
  41. cd "$GAMEDIR"
  42.  
  43. for file in data critter.dat master.dat; do
  44.     if [[ ! -e "$file" ]]; then
  45.         file_uc=$(echo "$file" | tr '[a-z]' '[A-Z]')
  46.  
  47.         if [[ -e "$file_uc" ]]; then
  48.             # File exists but it is in uppercase, make it lowercase.
  49.             to_lower_case "${PORTDIR}"
  50.  
  51.             if [[ ! -e "$file" ]]; then
  52.                 echo "Missing file: $file" > /dev/tty1
  53.                 sleep 5
  54.                 printf "\033c" >> /dev/tty1
  55.                 exit 1
  56.             fi
  57.         else
  58.             echo "Missing file: $file" > /dev/tty1
  59.             sleep 5
  60.             printf "\033c" >> /dev/tty1
  61.             exit 1
  62.         fi
  63.     fi
  64. done
  65.  
  66. $ESUDO chmod 666 /dev/uinput
  67. export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"
  68.  
  69. export TEXTINPUTPRESET="Name"
  70. export TEXTINPUTINTERACTIVE="Y"
  71. export TEXTINPUTNOAUTOCAPITALS="Y"
  72.  
  73. $GPTOKEYB "fallout-ce" -c "./fallout1.gptk.$ANALOGSTICKS" textinput &
  74. if [[ $whichos == *"ArkOS"* ]]; then
  75.     LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0.10.0 ./fallout-ce 2>&1 | tee -a ./log.txt
  76. else
  77.     ./fallout-ce 2>&1 | tee -a ./log.txt
  78. fi
  79.  
  80. $ESUDO kill -9 $(pidof gptokeyb)
  81. unset SDL_GAMECONTROLLERCONFIG
  82. $ESUDO systemctl restart oga_events &
  83. printf "\033c" >> /dev/tty0
  84.  
  85.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement