From 69042ab5e18c7eaa723208df5824efe9de513f74 Mon Sep 17 00:00:00 2001 From: Gama11 Date: Tue, 28 Feb 2017 21:22:21 +0100 Subject: [PATCH] Pointer: fix objects in substates not being selectable --- flixel/system/debug/interaction/Interaction.hx | 9 ++++++++- flixel/system/debug/interaction/tools/Pointer.hx | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/flixel/system/debug/interaction/Interaction.hx b/flixel/system/debug/interaction/Interaction.hx index 27f9a4865c..9b4055193a 100644 --- a/flixel/system/debug/interaction/Interaction.hx +++ b/flixel/system/debug/interaction/Interaction.hx @@ -378,7 +378,7 @@ class Interaction extends Window private function restoreSystemCursor():Void { #if FLX_MOUSE - FlxG.mouse.useSystemCursor = _wasUsingSystemCursor; + FlxG.mouse.useSystemCursor = _wasUsingSystemCursor; FlxG.mouse.visible = _wasMouseVisible; _customCursor.visible = false; #end @@ -455,6 +455,13 @@ class Interaction extends Window return (_turn - value) == 1; } + public function findItemsWithinState(items:Array, state:FlxState, area:FlxRect):Void + { + findItemsWithinArea(items, state.members, area); + if (state.subState != null) + findItemsWithinState(items, state.subState, area); + } + /** * Find all items within an area. In order to improve performance and reduce temporary allocations, * the method has no return, you must pass an array where items will be placed. The method decides diff --git a/flixel/system/debug/interaction/tools/Pointer.hx b/flixel/system/debug/interaction/tools/Pointer.hx index 5489d846cd..e569248994 100644 --- a/flixel/system/debug/interaction/tools/Pointer.hx +++ b/flixel/system/debug/interaction/tools/Pointer.hx @@ -134,7 +134,7 @@ class Pointer extends Tool calculateSelectionArea(); if (findItems) - _brain.findItemsWithinArea(_itemsInSelectionArea, FlxG.state.members, _selectionArea); + _brain.findItemsWithinState(_itemsInSelectionArea, FlxG.state, _selectionArea); // Clear everything _selectionHappening = false;