You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
Merge pull request #114465 from m4gr3d/fix_editor_hybrid_app_support_detection
[Android editor] Restrict Android editor support for hybrid app projects to XR devices
This commit is contained in:
@@ -104,8 +104,8 @@ abstract class BaseGodotGame: GodotEditor() {
|
||||
@CallSuper
|
||||
override fun supportsFeature(featureTag: String): Boolean {
|
||||
if (HYBRID_APP_FEATURE == featureTag) {
|
||||
// Check if hybrid is enabled
|
||||
return isHybridAppEnabled()
|
||||
// Check if hybrid is enabled.
|
||||
return godot?.isXrRuntime == true && isHybridAppEnabled()
|
||||
}
|
||||
|
||||
return super.supportsFeature(featureTag)
|
||||
|
||||
@@ -135,6 +135,8 @@ class Godot private constructor(val context: Context) {
|
||||
private val gyroscopeEnabled = AtomicBoolean(false)
|
||||
private val mGyroscope: Sensor? by lazy { mSensorManager?.getDefaultSensor(Sensor.TYPE_GYROSCOPE) }
|
||||
|
||||
val isXrRuntime: Boolean by lazy { hasFeature("xr_runtime") }
|
||||
|
||||
val tts = GodotTTS(context)
|
||||
val directoryAccessHandler = DirectoryAccessHandler(context)
|
||||
val fileAccessHandler = FileAccessHandler(context)
|
||||
|
||||
@@ -80,13 +80,11 @@ class GodotGLRenderView extends GLSurfaceView implements GodotRenderView {
|
||||
private final GodotInputHandler inputHandler;
|
||||
private final GodotRenderer godotRenderer;
|
||||
private final SparseArray<PointerIcon> customPointerIcons = new SparseArray<>();
|
||||
private final boolean isXrDevice;
|
||||
|
||||
public GodotGLRenderView(Godot godot, GodotInputHandler inputHandler, XRMode xrMode, boolean useDebugOpengl, boolean shouldBeTranslucent) {
|
||||
super(godot.getContext());
|
||||
|
||||
this.godot = godot;
|
||||
isXrDevice = godot.hasFeature("xr_runtime");
|
||||
this.inputHandler = inputHandler;
|
||||
this.godotRenderer = new GodotRenderer();
|
||||
setPointerIcon(PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT));
|
||||
@@ -177,7 +175,7 @@ class GodotGLRenderView extends GLSurfaceView implements GodotRenderView {
|
||||
@Override
|
||||
public boolean canCapturePointer() {
|
||||
// Pointer capture is not supported on XR devices.
|
||||
return !isXrDevice && inputHandler.canCapturePointer();
|
||||
return !godot.isXrRuntime() && inputHandler.canCapturePointer();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,13 +55,11 @@ class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderView {
|
||||
private final GodotInputHandler mInputHandler;
|
||||
private final VkRenderer mRenderer;
|
||||
private final SparseArray<PointerIcon> customPointerIcons = new SparseArray<>();
|
||||
private final boolean isXrDevice;
|
||||
|
||||
public GodotVulkanRenderView(Godot godot, GodotInputHandler inputHandler, boolean shouldBeTranslucent) {
|
||||
super(godot.getContext());
|
||||
|
||||
this.godot = godot;
|
||||
isXrDevice = godot.hasFeature("xr_runtime");
|
||||
mInputHandler = inputHandler;
|
||||
mRenderer = new VkRenderer();
|
||||
setPointerIcon(PointerIcon.getSystemIcon(getContext(), PointerIcon.TYPE_DEFAULT));
|
||||
@@ -156,7 +154,7 @@ class GodotVulkanRenderView extends VkSurfaceView implements GodotRenderView {
|
||||
@Override
|
||||
public boolean canCapturePointer() {
|
||||
// Pointer capture is not supported on XR devices.
|
||||
return !isXrDevice && mInputHandler.canCapturePointer();
|
||||
return !godot.isXrRuntime() && mInputHandler.canCapturePointer();
|
||||
}
|
||||
@Override
|
||||
public void requestPointerCapture() {
|
||||
|
||||
Reference in New Issue
Block a user