FRAMEWORK: added a quit function

This commit is contained in:
XargonWan 2023-12-16 08:55:12 +01:00
parent 5e6d4fcedc
commit 4cefc83d3c
3 changed files with 20 additions and 11 deletions

View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
source functions/functions.sh
debug_dialog() { debug_dialog() {
# This function is for displaying commands run by the Configurator without actually running them # This function is for displaying commands run by the Configurator without actually running them
# USAGE: debug_dialog "command" # USAGE: debug_dialog "command"
@ -21,8 +23,7 @@ configurator_process_complete_dialog() {
if [ ! $? == 0 ]; then # OK button clicked if [ ! $? == 0 ]; then # OK button clicked
configurator_welcome_dialog configurator_welcome_dialog
elif [ ! $? == 1 ]; then # Quit button clicked elif [ ! $? == 1 ]; then # Quit button clicked
pkill -f retrodeck quit_retrodeck
pkill -f emulationstation
fi fi
} }

View file

@ -294,7 +294,7 @@ do
zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" --text="Do you want to quit?" zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="No" --ok-label "Yes" --text="Do you want to quit?"
if [ $? == 0 ] # yes, quit if [ $? == 0 ] # yes, quit
then then
exit 2 quit_retrodeck
fi fi
fi fi
fi fi
@ -304,7 +304,7 @@ do
--title "RetroDECK" \ --title "RetroDECK" \
--ok-label "Quit" \ --ok-label "Quit" \
--text="No location was selected. Please run RetroDECK again to retry." --text="No location was selected. Please run RetroDECK again to retry."
exit 2 quit_retrodeck
fi fi
done done
} }
@ -346,7 +346,7 @@ finit() {
"Back" | "" ) # Back or X button quits "Back" | "" ) # Back or X button quits
rm -f "$rd_conf" # Cleanup unfinished retrodeck.cfg if first install is interrupted rm -f "$rd_conf" # Cleanup unfinished retrodeck.cfg if first install is interrupted
echo "Now quitting" echo "Now quitting"
exit 2 quit_retrodeck
;; ;;
"Internal Storage" ) # Internal "Internal Storage" ) # Internal
@ -382,7 +382,7 @@ finit() {
--text="SD card was found but is not writable\nThis can happen with cards formatted on PC.\nPlease format the SD card through the Steam Deck's Game Mode and run RetroDECK again." --text="SD card was found but is not writable\nThis can happen with cards formatted on PC.\nPlease format the SD card through the Steam Deck's Game Mode and run RetroDECK again."
rm -f "$rd_conf" # Cleanup unfinished retrodeck.cfg if first install is interrupted rm -f "$rd_conf" # Cleanup unfinished retrodeck.cfg if first install is interrupted
echo "Now quitting" echo "Now quitting"
exit 2 quit_retrodeck
else else
rdhome="$sdcard/retrodeck" rdhome="$sdcard/retrodeck"
fi fi
@ -527,6 +527,11 @@ easter_eggs() {
cp -f "$new_splash_file" "$current_splash_file" # Deploy assigned splash screen cp -f "$new_splash_file" "$current_splash_file" # Deploy assigned splash screen
} }
quit_retrodeck() {
pkill -f retrodeck
pkill -f emulationstation
}
start_retrodeck() { start_retrodeck() {
easter_eggs # Check if today has a surprise splashscreen and load it if so easter_eggs # Check if today has a surprise splashscreen and load it if so
# normal startup # normal startup

View file

@ -72,23 +72,26 @@
<ul> <ul>
<li>Added new system: SOLARUS</li> <li>Added new system: SOLARUS</li>
<li>Added new engine: GZDOOM</li> <li>Added new engine: GZDOOM</li>
<li>Added new emulator: Vita3K</li>
<li>Added new emulator: MAME (Standalone)</li>
<li>Quit button after emulators reset should act as an actual full quit button</li> <li>Quit button after emulators reset should act as an actual full quit button</li>
<li>Created a quit_retrodeck function to ease the quit in the scripts.</li>
</ul> </ul>
<p>Fixes:</p> <p>Fixes:</p>
<ul> <ul>
<li>GZDOOM: now the controller should work properly</li> <li>MAME (Standalone) paths should be fixed</li>
<li>GZDOOM: can automatically detect if the loaded file is a WAD or an IWAD</li>
</ul> </ul>
<p>Issues:</p> <p>Issues:</p>
<ul> <ul>
<li>VITA3K is not working, waiting for external fixes</li> <li>GZDOOM: the controller for player 2+ is not correctly configured</li>
<li>MAME (standalone) is not working, more enhancements needed</li> <li>GZDOOM: .doom parser got some issues</li>
</ul> </ul>
<p>Missing:</p> <p>Missing:</p>
<ul> <ul>
<li>GZDOOM: hotkeys</li> <li>GZDOOM: hotkeys</li>
<li>SOLARUS: hotkeys</li> <li>SOLARUS: hotkeys</li>
<li>A proper reset script for the new emulators, now it's just a draft</li> <li>MAME (Standalone): hotkeys</li>
<li>A proper reset script for the new emulators, now it's just a draft (only Vita3K is done)</li>
</ul> </ul>
</description> </description>
</release> </release>