diff --git a/src/dn/heaps/input/ControllerQueue.hx b/src/dn/heaps/input/ControllerQueue.hx index 60716d6a..a744bf30 100644 --- a/src/dn/heaps/input/ControllerQueue.hx +++ b/src/dn/heaps/input/ControllerQueue.hx @@ -80,6 +80,16 @@ class ControllerQueue { return pressed; } + /** + Same as `consumePressOrDown` but also returns TRUE if the action button is currently down. + **/ + public inline function consumePressOrDown(action:T, ignoreChronologicalOrder=false) { + if( consumePress(action,ignoreChronologicalOrder) ) + return true; + else + return ca.isDown(action); + } + /** Check if the `action` press event is in the queue. This method doesn't "consume" the event from the queue. @@ -96,6 +106,13 @@ class ControllerQueue { return events.get(action).peekPress(curTimeS); } + /** + Same as `peekPress` but also returns TRUE if the action button is currently down. + **/ + public inline function peekPressOrDown(action:T, ignoreChronologicalOrder=false) { + return ca.isDown(action) || peekPress(action, ignoreChronologicalOrder); + } + public function clearAllQueues() { for(ev in events)