mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Support possibility to deprecate an in-app tutorial step (#4653)
Do not show in changelog
This commit is contained in:
@@ -52,6 +52,7 @@ export type InAppTutorialFlowStep = {|
|
||||
id?: string,
|
||||
isTriggerFlickering?: true,
|
||||
isCheckpoint?: true,
|
||||
deprecated?: true,
|
||||
nextStepTrigger?: InAppTutorialFlowStepTrigger,
|
||||
shortcuts?: Array<{|
|
||||
stepId: string,
|
||||
|
@@ -454,10 +454,16 @@ const InAppTutorialOrchestrator = React.forwardRef<
|
||||
|
||||
let nextStepIndex = stepIndex;
|
||||
|
||||
// Check if we can go directly to next mandatory (not-skippable) step.
|
||||
while (flow[nextStepIndex].skippable && nextStepIndex < stepCount - 1) {
|
||||
// Check if we can go directly to next mandatory (not-skippable) and not deprecated step.
|
||||
while (nextStepIndex < stepCount - 1) {
|
||||
if (
|
||||
isDomBasedTriggerComplete(flow[nextStepIndex].nextStepTrigger, data)
|
||||
flow[nextStepIndex] &&
|
||||
(flow[nextStepIndex].deprecated ||
|
||||
(flow[nextStepIndex].skippable &&
|
||||
isDomBasedTriggerComplete(
|
||||
flow[nextStepIndex].nextStepTrigger,
|
||||
data
|
||||
)))
|
||||
)
|
||||
nextStepIndex += 1;
|
||||
else break;
|
||||
@@ -646,6 +652,7 @@ const InAppTutorialOrchestrator = React.forwardRef<
|
||||
[handleDomMutation]
|
||||
);
|
||||
|
||||
// Methods to run on each step change.
|
||||
React.useEffect(
|
||||
() => {
|
||||
if (!currentStep) return;
|
||||
|
Reference in New Issue
Block a user