8 SegmentActionType Type,
10 Identifier ObjectiveTag,
11 Identifier ParentObjectiveId,
14 bool autoPlayVideo =
false,
15 string videoFile =
"",
19 if (Type == SegmentActionType.AddIfNotFound)
21 if (ObjectiveManager.IsSegmentActive(Identifier)) {
return; }
24 ObjectiveManager.Segment? segment =
null;
26 if (Type == SegmentActionType.Trigger)
28 segment = ObjectiveManager.Segment.CreateInfoBoxSegment(Identifier, ObjectiveTag, autoPlayVideo ? Tutorials.AutoPlayVideo.Yes : Tutorials.AutoPlayVideo.No,
29 new ObjectiveManager.Segment.Text(TextTag, width, height, Anchor.Center),
30 new ObjectiveManager.Segment.Video(videoFile, TextTag, width, height));
32 else if (Type == SegmentActionType.Add ||
33 Type == SegmentActionType.AddIfNotFound)
35 segment = ObjectiveManager.Segment.CreateObjectiveSegment(Identifier, !ObjectiveTag.IsEmpty ? ObjectiveTag : Identifier);
37 if (segment is not
null)
39 segment.CanBeCompleted = CanBeCompleted;
40 segment.ParentId = ParentObjectiveId;
45 case SegmentActionType.Trigger:
46 case SegmentActionType.Add:
47 case SegmentActionType.AddIfNotFound:
48 ObjectiveManager.TriggerSegment(segment);
50 case SegmentActionType.Complete:
51 ObjectiveManager.CompleteSegment(Identifier);
53 case SegmentActionType.Remove:
54 ObjectiveManager.RemoveSegment(Identifier);
56 case SegmentActionType.CompleteAndRemove:
57 ObjectiveManager.CompleteSegment(Identifier);
58 ObjectiveManager.RemoveSegment(Identifier);
60 case SegmentActionType.Fail:
61 ObjectiveManager.FailSegment(Identifier);
63 case SegmentActionType.FailAndRemove:
64 ObjectiveManager.FailSegment(Identifier);
65 ObjectiveManager.RemoveSegment(Identifier);
70 partial
void UpdateProjSpecific()
72 Trigger(Type, Identifier, ObjectiveTag, ParentObjectiveId, TextTag, CanBeCompleted, AutoPlayVideo, VideoFile, Width, Height);
static void Trigger(SegmentActionType Type, Identifier Identifier, Identifier ObjectiveTag, Identifier ParentObjectiveId, Identifier TextTag, bool CanBeCompleted, bool autoPlayVideo=false, string videoFile="", int width=450, int height=80)