Admiral-Billy / PokeRogue-App-Android

My PokeRogue app, but for Android, now open source!
MIT License
19 stars 4 forks source link

userAgent Prevents Disabling of Touch Controls #4

Open tomatosoupcan opened 1 month ago

tomatosoupcan commented 1 month ago

While the intent of preventing this is probably sound, I imagine many, like myself, are installing this onto a handheld with a controller attached. The default userAgentString in the webview locks you out of disabling the on screen touch controls and muck up the screen. Easy fix is to add: webView.settings.userAgentString = "PokeRogueClient"

Admiral-Billy commented 1 month ago

Ah, that makes sense. Yeah I'll spoof it next time I update the app to do that, since that's been a request before.

seanrmon commented 2 weeks ago

I was able to get this working where you can toggle the userAgentString between the default and a custom one. However I couldn't get around the scenario where touch screen controls are disabled and there is no gamepad connected. Even when you toggle back to the default userAgentString the touch controls do not return.

I tried setting scene.enableTouchControls = true and document.getElementById("touchControls").classList.toggle("visible", true) but could not get the virtual gamepad to reappear.