Basic Easter Egg framework

This commit is contained in:
icenine451 2023-03-08 15:07:28 -05:00
parent 2af2ebe09f
commit 11746d34d9
2 changed files with 26 additions and 4 deletions

View file

@ -127,7 +127,7 @@ compress_to_chd () {
validate_for_chd () {
# Function for validating chd compression candidates, and compresses if validation passes. Supports .cue, .iso and .gdi formats ONLY
# USAGE: validate_for_chd $input_file
local file=$1
current_run_log_file="chd_compression_"$(date +"%Y_%m_%d_%I_%M_%p").log""
echo "Validating file:" $file > "$logs_folder/$current_run_log_file"
@ -1060,7 +1060,26 @@ create_lock() {
conf_write
}
easter_eggs() {
today=$(date +"%0m%0d") # Read the current date in a format that can be calculated in ranges
# Set Easter Egg date or ranges here, in mmdd format
if [[ today -eq "0401" ]]; then # An example of a one-day easter egg
echo "Today is April Fools Day!"
# cp -fv /var/config/emulationstation/graphics/splash-aprilfools.svg /var/config/emulationstation/graphics/splash.svg
elif [[ today -ge "1001" && today -le "1031" ]]; then # An example of a multi-day easter egg
echo "Today is in the spooky month!"
# cp -fv /var/config/emulationstation/graphics/splash-spookytime.svg /var/config/emulationstation/graphics/splash.svg
else # Revert to standard splash otherwise
echo "Nothing special happening today"
# cp -fv /var/config/emulationstation/graphics/splash-orig.svg /var/config/emulationstation/graphics/splash.svg
fi
}
start_retrodeck() {
echo "Checking to see if today has a surprise..."
easter_eggs
# normal startup
echo "Starting RetroDECK v$version"
emulationstation --home /var/config/emulationstation

View file

@ -1049,9 +1049,12 @@ modules:
# These must be put in home folder, managed by retrodeck.sh
- cp es-configs/es_settings.xml ${FLATPAK_DEST}/retrodeck/es_settings.xml
# Logo, res
- rm -f /app/share/emulationstation/resources/graphics/splash.svg
- cp -f res/splash.svg /app/share/emulationstation/resources/graphics/splash.svg
# Logo, res, move graphics directory to mutable space so splash can be changed after build
- mv -f -t /var/config/emulationstation /app/share/emulationstation/resources/graphics
- ln -s /var/config/emulationstation/graphics /app/share/emulationstation/resources/graphics
- cp -f res/extra-splashes/* /var/config/emulationstation/graphics
- cp -f res/splash.svg /var/config/emulationstation/graphics/splash.svg
- cp -f res/splash.svg /var/config/emulationstation/graphics/splash-orig.svg
- cp -f res/icon.svg /app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg
# Tools