Skip to content

Commit 4325d0a

Browse files
splashscreen.sh: (QOL) updated menu interface
Updated wording to remove ambiguity. Slightly reworked randomizer function. Added mode label (custom, etc.) to randomizer menu title. (Eliminated `$random` var.) Fixed path dialog on randomizer choices. Enable splashscreen and disable randomizer on choosing default.
1 parent 1eedc5a commit 4325d0a

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed

scriptmodules/supplementary/splashscreen.sh

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ function choose_splashscreen() {
185185

186186
function randomize_splashscreen() {
187187
options=(
188+
0 "Disable splashscreen randomizer"
188189
1 "Randomize RetroPie splashscreens"
189190
2 "Randomize own splashscreens (from $datadir/splashscreens)"
190191
3 "Randomize all splashscreens"
@@ -196,13 +197,17 @@ function randomize_splashscreen() {
196197
chown $user:$user "$configdir/all/$md_id.cfg"
197198

198199
case "$choice" in
200+
0)
201+
iniSet "RANDOMIZE" "disabled"
202+
printMsgs "dialog" "Splashscreen randomizer disabled."
203+
;;
199204
1)
200205
iniSet "RANDOMIZE" "retropie"
201-
printMsgs "dialog" "Splashscreen randomizer enabled in directory $path"
206+
printMsgs "dialog" "Splashscreen randomizer enabled in directory $rootdir/supplementary/$md_id"
202207
;;
203208
2)
204209
iniSet "RANDOMIZE" "custom"
205-
printMsgs "dialog" "Splashscreen randomizer enabled in directory $path"
210+
printMsgs "dialog" "Splashscreen randomizer enabled in directory $datadir/splashscreens"
206211
;;
207212
3)
208213
iniSet "RANDOMIZE" "all"
@@ -272,22 +277,15 @@ function gui_splashscreen() {
272277
local cmd=(dialog --backtitle "$__backtitle" --menu "Choose an option." 22 86 16)
273278
while true; do
274279
local enabled=0
275-
local random=0
276280
[[ -n "$(find "/etc/systemd/system/"*".wants" -type l -name "asplashscreen.service")" ]] && enabled=1
277281
local options=(1 "Choose splashscreen")
278282
if [[ "$enabled" -eq 1 ]]; then
279-
options+=(2 "Disable splashscreen on boot (Enabled)")
283+
options+=(2 "Show splashscreen on boot (currently: Enabled)")
280284
iniConfig "=" '"' "$configdir/all/$md_id.cfg"
281285
iniGet "RANDOMIZE"
282-
random=1
283-
[[ "$ini_value" == "disabled" ]] && random=0
284-
if [[ "$random" -eq 1 ]]; then
285-
options+=(3 "Disable splashscreen randomizer (Enabled)")
286-
else
287-
options+=(3 "Enable splashscreen randomizer (Disabled)")
288-
fi
286+
options+=(3 "Randomizer options (currently: ${ini_value^})")
289287
else
290-
options+=(2 "Enable splashscreen on boot (Disabled)")
288+
options+=(2 "Show splashscreen on boot (currently: Disabled)")
291289
fi
292290
options+=(
293291
4 "Use default splashscreen"
@@ -323,15 +321,12 @@ function gui_splashscreen() {
323321
fi
324322
;;
325323
3)
326-
if [[ "$random" -eq 1 ]]; then
327-
iniSet "RANDOMIZE" "disabled"
328-
printMsgs "dialog" "Splashscreen randomizer disabled."
329-
else
330-
randomize_splashscreen
331-
fi
324+
randomize_splashscreen
332325
;;
333326
4)
327+
iniSet "RANDOMIZE" "disabled"
334328
default_splashscreen
329+
enable_splashscreen
335330
printMsgs "dialog" "Splashscreen set to RetroPie default."
336331
;;
337332
5)

0 commit comments

Comments
 (0)