diff --git a/build-win10/PanicPainter/PanicPainter.vcxproj b/build-win10/PanicPainter/PanicPainter.vcxproj index 5b496816..218eb8a7 100644 --- a/build-win10/PanicPainter/PanicPainter.vcxproj +++ b/build-win10/PanicPainter/PanicPainter.vcxproj @@ -195,6 +195,7 @@ + @@ -224,6 +225,7 @@ + diff --git a/build-win10/PanicPainter/PanicPainter.vcxproj.filters b/build-win10/PanicPainter/PanicPainter.vcxproj.filters index dfb821bc..0d4dbf2e 100644 --- a/build-win10/PanicPainter/PanicPainter.vcxproj.filters +++ b/build-win10/PanicPainter/PanicPainter.vcxproj.filters @@ -79,6 +79,9 @@ Scenes\Pause + + Scenes\Gameplay + @@ -145,5 +148,8 @@ Scenes\Pause + + Scenes\Gameplay + \ No newline at end of file diff --git a/source/controllers/PPActionController.cpp b/source/controllers/PPActionController.cpp index e369aabf..3fb89a80 100644 --- a/source/controllers/PPActionController.cpp +++ b/source/controllers/PPActionController.cpp @@ -31,6 +31,7 @@ void ActionController::update(const set> &activeCanvases, if (input.didTripleTap() && input.justReleased() && startingPointIn && currentPointIn) { _state.clearColor(i, i2, selectedColor); + input.clearPreviousTaps(); } if (input.isPressing() && startingPointIn && currentPointIn) { diff --git a/source/controllers/PPInputController.cpp b/source/controllers/PPInputController.cpp index fd2f853f..f2f2c4ce 100644 --- a/source/controllers/PPInputController.cpp +++ b/source/controllers/PPInputController.cpp @@ -165,3 +165,10 @@ bool InputController::didTripleTap() const { _inputs[2]->isJustTap() && _inputs[1]->timeSinceLastInstance <= _consecutiveTapThreshold; } + +void InputController::clearPreviousTaps() { + _inputs.clear(); + if (_currentInput != nullptr) { + _inputs.push_front(_currentInput); + } +} diff --git a/source/controllers/PPInputController.h b/source/controllers/PPInputController.h index 503d27be..4145de6e 100644 --- a/source/controllers/PPInputController.h +++ b/source/controllers/PPInputController.h @@ -136,6 +136,8 @@ class InputController { /** Check if last input resulted in a triple tap. */ bool didTripleTap() const; + void clearPreviousTaps(); + /** Utility function to check if a point is in a scene node. */ static bool inScene(const Vec2 &point, const ptr &scene);