mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-20 17:51:13 +02:00
Fixed Loading Screen while Compiling Shaders
This commit is contained in:
@@ -111,11 +111,11 @@ object KenjinxNative : KenjinxNativeJna by jnaInstance {
|
|||||||
MainActivity.mainViewModel?.gameHost?.currentWindowHandle ?: -1
|
MainActivity.mainViewModel?.gameHost?.currentWindowHandle ?: -1
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun updateProgress(infoPtr: Long, progress: Float) =
|
fun updateProgress(infoPtr: Long, progress: Float) {
|
||||||
MainActivity.mainViewModel?.gameHost?.setProgress(
|
// Get string from native pointer and push into progress overlay
|
||||||
NativeHelpers.instance.getStringJava(infoPtr),
|
val text = NativeHelpers.instance.getStringJava(infoPtr)
|
||||||
progress
|
MainActivity.mainViewModel?.gameHost?.setProgress(text, progress)
|
||||||
)
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Variant A (Pointer → Strings via NativeHelpers).
|
* Variant A (Pointer → Strings via NativeHelpers).
|
||||||
|
|||||||
@@ -59,6 +59,13 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
mainViewModel?.gameHost?.hideProgressIndicator()
|
mainViewModel?.gameHost?.hideProgressIndicator()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// <<< NEW: is called from the Native/Lib page to set the loading progress
|
||||||
|
@JvmStatic
|
||||||
|
fun updateProgress(info: String, percent: Float) {
|
||||||
|
// Route directly via the GameHost – it takes care of the progress states
|
||||||
|
mainViewModel?.gameHost?.setProgress(info, percent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ class UiHandler {
|
|||||||
var message: String = ""
|
var message: String = ""
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// 2.0.3 compatible: no parameters
|
|
||||||
KenjinxNative.uiHandlerSetup()
|
KenjinxNative.uiHandlerSetup()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,8 +64,7 @@ class UiHandler {
|
|||||||
newMode: KeyboardMode,
|
newMode: KeyboardMode,
|
||||||
newSubtitle: String,
|
newSubtitle: String,
|
||||||
newInitialText: String
|
newInitialText: String
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
title = newTitle
|
title = newTitle
|
||||||
message = newMessage
|
message = newMessage
|
||||||
watermark = newWatermark
|
watermark = newWatermark
|
||||||
@@ -87,13 +85,11 @@ class UiHandler {
|
|||||||
val inputListener = remember { inputText }
|
val inputListener = remember { inputText }
|
||||||
val validation = remember { mutableStateOf("") }
|
val validation = remember { mutableStateOf("") }
|
||||||
|
|
||||||
// Focus & keyboard control so the popup can be typed immediately like in 2.0.3
|
|
||||||
val focusRequester = remember { FocusRequester() }
|
val focusRequester = remember { FocusRequester() }
|
||||||
val keyboard = LocalSoftwareKeyboardController.current
|
val keyboard = LocalSoftwareKeyboardController.current
|
||||||
|
|
||||||
LaunchedEffect(showMessageListener.value, type) {
|
LaunchedEffect(showMessageListener.value, type) {
|
||||||
if (showMessageListener.value && type == 2) {
|
if (showMessageListener.value && type == 2) {
|
||||||
// small delay until the dialog is mounted
|
|
||||||
delay(100)
|
delay(100)
|
||||||
focusRequester.requestFocus()
|
focusRequester.requestFocus()
|
||||||
keyboard?.show()
|
keyboard?.show()
|
||||||
@@ -120,13 +116,9 @@ class UiHandler {
|
|||||||
|
|
||||||
fun submit() {
|
fun submit() {
|
||||||
if (type == 2) {
|
if (type == 2) {
|
||||||
if (inputListener.value.length < minLength || inputListener.value.length > maxLength)
|
if (inputListener.value.length < minLength || inputListener.value.length > maxLength) return
|
||||||
return
|
|
||||||
}
|
}
|
||||||
KenjinxNative.uiHandlerSetResponse(
|
KenjinxNative.uiHandlerSetResponse(true, if (type == 2) inputListener.value else "")
|
||||||
true,
|
|
||||||
if (type == 2) inputListener.value else ""
|
|
||||||
)
|
|
||||||
showMessageListener.value = false
|
showMessageListener.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user