DSDH : add canGoToNextMode() methode in onButtonPressed. So that we can prevent going to the next mode on certain conditions.

This commit is contained in:
Paddle
2023-10-30 15:56:26 +01:00
committed by abdullahtahiriyo
parent 3f1f1047b2
commit 3483090279

View File

@@ -589,7 +589,14 @@ protected:
virtual void onButtonPressed(Base::Vector2d onSketchPos)
{
this->updateDataAndDrawToPosition(onSketchPos);
this->moveToNextMode();
if (canGoToNextMode()) {
this->moveToNextMode();
}
}
virtual bool canGoToNextMode()
{
return true;
}
/** @brief Default behaviour that upon arriving to the End state of the state machine, the