Skip to content

Commit

Permalink
Merge pull request #942 from tabreturn/main
Browse files Browse the repository at this point in the history
Fix PlanetWaves.sh
  • Loading branch information
Cebion authored Nov 18, 2024
2 parents 1e014f6 + c8cdeaf commit 325b202
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 19 deletions.
18 changes: 6 additions & 12 deletions ports/littlefroggame/Little Frog Game.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,21 @@ else
fi

source $controlfolder/control.txt
source $controlfolder/device_info.txt
# device_info.txt will be included by default

[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"

get_controls

#GAMEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/littlefroggame"
GAMEDIR="/$directory/ports/littlefroggame"
GAMEDIR=/$directory/ports/littlefroggame
CONFDIR="$GAMEDIR/conf/"

# Ensure the conf directory exists
mkdir -p "$GAMEDIR/conf"

# Set the XDG environment variables for config & savefiles
export XDG_CONFIG_HOME="$CONFDIR"
export XDG_DATA_HOME="$CONFDIR"
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"

cd $GAMEDIR

Expand All @@ -40,7 +39,6 @@ if [ ! -f "$controlfolder/libs/${runtime}.squashfs" ]; then
sleep 5
exit 1
fi

$ESUDO $controlfolder/harbourmaster --quiet --no-check runtime_check "${runtime}.squashfs"
fi

Expand All @@ -54,13 +52,9 @@ PATH="$godot_dir:$PATH"

export FRT_NO_EXIT_SHORTCUTS=FRT_NO_EXIT_SHORTCUTS

$ESUDO chmod 666 /dev/uinput
$GPTOKEYB "$runtime" -c "./littlefroggame.gptk" &
SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" "$runtime" $GODOT_OPTS --main-pack "gamedata/Little Frog Game.pck"
pm_platform_helper "$runtime"
"$runtime" $GODOT_OPTS --main-pack "gamedata/Little Frog Game.pck"

$ESUDO umount "$godot_dir"
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" > /dev/tty0


pm_finish
44 changes: 37 additions & 7 deletions ports/planetwaves/PlanetWaves.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,48 @@ else
fi

source $controlfolder/control.txt
# device_info.txt will be included by default

[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"

get_controls

GAMEDIR=/$directory/ports/PlanetWaves/
GAMEDIR=/$directory/ports/PlanetWaves
CONFDIR="$GAMEDIR/conf/"

# Ensure the conf directory exists
mkdir -p "$GAMEDIR/conf"

# Set the XDG environment variables for config & savefiles
export XDG_DATA_HOME="$CONFDIR"
export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"

cd $GAMEDIR

runtime="frt_3.5.2"
if [ ! -f "$controlfolder/libs/${runtime}.squashfs" ]; then
# Check for runtime if not downloaded via PM
if [ ! -f "$controlfolder/harbourmaster" ]; then
echo "This port requires the latest PortMaster to run, please go to https://portmaster.games/ for more info." > /dev/tty0
sleep 5
exit 1
fi
$ESUDO $controlfolder/harbourmaster --quiet --no-check runtime_check "${runtime}.squashfs"
fi

# Setup Godot
godot_dir="$HOME/godot"
godot_file="$controlfolder/libs/${runtime}.squashfs"
$ESUDO mkdir -p "$godot_dir"
$ESUDO umount "$godot_file" || true
$ESUDO mount "$godot_file" "$godot_dir"
PATH="$godot_dir:$PATH"

export FRT_NO_EXIT_SHORTCUTS=FRT_NO_EXIT_SHORTCUTS

$ESUDO chmod 666 /dev/uinput
$GPTOKEYB "frt_3.5.2" -c "./waves.gptk" textinput &
SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./frt_3.5.2 --main-pack PlanetWaves.zip
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" > /dev/tty0
$GPTOKEYB "$runtime" -c "./waves.gptk" &
pm_platform_helper "$runtime"
"$runtime" $GODOT_OPTS --main-pack "PlanetWaves.zip"

$ESUDO umount "$godot_dir"
pm_finish

0 comments on commit 325b202

Please sign in to comment.