From a96fde868a981e00f470003d35e85c6408a8303c Mon Sep 17 00:00:00 2001 From: Syahriel Ibnu Irfansyah Date: Mon, 5 Dec 2022 01:23:11 +0700 Subject: [PATCH] Re-add function to load custom cold boot and game boot image --- .../src/main/java/id/psw/vshlauncher/views/XmbView.Coldboot.kt | 3 +++ .../src/main/java/id/psw/vshlauncher/views/XmbView.Gameboot.kt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/launcher_app/src/main/java/id/psw/vshlauncher/views/XmbView.Coldboot.kt b/launcher_app/src/main/java/id/psw/vshlauncher/views/XmbView.Coldboot.kt index 96a90fa..9daff31 100644 --- a/launcher_app/src/main/java/id/psw/vshlauncher/views/XmbView.Coldboot.kt +++ b/launcher_app/src/main/java/id/psw/vshlauncher/views/XmbView.Coldboot.kt @@ -62,6 +62,9 @@ fun XmbView.cbStart(){ fun XmbView.cbEnsureImageLoaded(){ if(state.coldBoot.image == null){ + val i = context.vsh.getAllPathsFor(VshBaseDirs.VSH_RESOURCES_DIR, "COLDBOOT.PNG", createParentDir = false).find { it.exists() } + if(i != null) { state.coldBoot.image = BitmapFactory.decodeFile(i.absolutePath) } + state.coldBoot.image = getDrawable(R.drawable.coldboot_internal)?.toBitmap(1280, 720) } } diff --git a/launcher_app/src/main/java/id/psw/vshlauncher/views/XmbView.Gameboot.kt b/launcher_app/src/main/java/id/psw/vshlauncher/views/XmbView.Gameboot.kt index 0285400..aa2a951 100644 --- a/launcher_app/src/main/java/id/psw/vshlauncher/views/XmbView.Gameboot.kt +++ b/launcher_app/src/main/java/id/psw/vshlauncher/views/XmbView.Gameboot.kt @@ -75,6 +75,8 @@ fun XmbView.gbStart(){ private fun XmbView.gbEnsureImageLoaded(){ if(state.gameBoot.image == null){ + val i = context.vsh.getAllPathsFor(VshBaseDirs.VSH_RESOURCES_DIR, "GAMEBOOT.PNG", createParentDir = false).find { it.exists() } + if(i != null) { state.gameBoot.image = BitmapFactory.decodeFile(i.absolutePath) } state.gameBoot.image = getDrawable(R.drawable.gameboot_internal)?.toBitmap(1280, 720) }