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
|
||||
|
||||
@JvmStatic
|
||||
fun updateProgress(infoPtr: Long, progress: Float) =
|
||||
MainActivity.mainViewModel?.gameHost?.setProgress(
|
||||
NativeHelpers.instance.getStringJava(infoPtr),
|
||||
progress
|
||||
)
|
||||
fun updateProgress(infoPtr: Long, progress: Float) {
|
||||
// Get string from native pointer and push into progress overlay
|
||||
val text = NativeHelpers.instance.getStringJava(infoPtr)
|
||||
MainActivity.mainViewModel?.gameHost?.setProgress(text, progress)
|
||||
}
|
||||
|
||||
/**
|
||||
* Variant A (Pointer → Strings via NativeHelpers).
|
||||
|
||||
@@ -59,6 +59,13 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
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 {
|
||||
|
||||
@@ -51,7 +51,6 @@ class UiHandler {
|
||||
var message: String = ""
|
||||
|
||||
init {
|
||||
// 2.0.3 compatible: no parameters
|
||||
KenjinxNative.uiHandlerSetup()
|
||||
}
|
||||
|
||||
@@ -65,8 +64,7 @@ class UiHandler {
|
||||
newMode: KeyboardMode,
|
||||
newSubtitle: String,
|
||||
newInitialText: String
|
||||
)
|
||||
{
|
||||
) {
|
||||
title = newTitle
|
||||
message = newMessage
|
||||
watermark = newWatermark
|
||||
@@ -87,13 +85,11 @@ class UiHandler {
|
||||
val inputListener = remember { inputText }
|
||||
val validation = remember { mutableStateOf("") }
|
||||
|
||||
// Focus & keyboard control so the popup can be typed immediately like in 2.0.3
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
val keyboard = LocalSoftwareKeyboardController.current
|
||||
|
||||
LaunchedEffect(showMessageListener.value, type) {
|
||||
if (showMessageListener.value && type == 2) {
|
||||
// small delay until the dialog is mounted
|
||||
delay(100)
|
||||
focusRequester.requestFocus()
|
||||
keyboard?.show()
|
||||
@@ -120,13 +116,9 @@ class UiHandler {
|
||||
|
||||
fun submit() {
|
||||
if (type == 2) {
|
||||
if (inputListener.value.length < minLength || inputListener.value.length > maxLength)
|
||||
return
|
||||
if (inputListener.value.length < minLength || inputListener.value.length > maxLength) return
|
||||
}
|
||||
KenjinxNative.uiHandlerSetResponse(
|
||||
true,
|
||||
if (type == 2) inputListener.value else ""
|
||||
)
|
||||
KenjinxNative.uiHandlerSetResponse(true, if (type == 2) inputListener.value else "")
|
||||
showMessageListener.value = false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user