net.dreditor.dialogueeventmanaging 0.0.0-stage → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/.attestation.p7m +0 -0
  2. package/CharacterLeaveDialogueEvent.cs +14 -0
  3. package/CharacterLeaveDialogueEvent.cs.meta +11 -0
  4. package/DREditor.DialogueEventManaging.asmdef +17 -0
  5. package/DREditor.DialogueEventManaging.asmdef.meta +7 -0
  6. package/DialogueEventExcluder.cs +40 -0
  7. package/DialogueEventExcluder.cs.meta +11 -0
  8. package/DialogueEventIgnorer.cs +45 -0
  9. package/DialogueEventIgnorer.cs.meta +11 -0
  10. package/DialogueEventManager.cs +38 -0
  11. package/DialogueEventManager.cs.meta +11 -0
  12. package/DialogueEventTypeExcluder.cs +27 -0
  13. package/DialogueEventTypeExcluder.cs.meta +11 -0
  14. package/DialogueLineEventManager.cs +120 -0
  15. package/DialogueLineEventManager.cs.meta +11 -0
  16. package/DialogueLineSceneEventManager.cs +68 -0
  17. package/DialogueLineSceneEventManager.cs.meta +11 -0
  18. package/Editor/DREditor.DialogueEventManaging.Editor.asmdef +18 -0
  19. package/Editor/DREditor.DialogueEventManaging.Editor.asmdef.meta +7 -0
  20. package/Editor/DialogueEventExcluderEditor.cs +206 -0
  21. package/Editor/DialogueEventExcluderEditor.cs.meta +11 -0
  22. package/Editor/LoadDialogueEventExcluderEditor.cs +38 -0
  23. package/Editor/LoadDialogueEventExcluderEditor.cs.meta +11 -0
  24. package/Editor.meta +8 -0
  25. package/FaintDialogueEvent.cs +14 -0
  26. package/FaintDialogueEvent.cs.meta +11 -0
  27. package/FilteredDialogueEventManager.cs +92 -0
  28. package/FilteredDialogueEventManager.cs.meta +11 -0
  29. package/IgnoreCustomDialogueEventManager.cs +84 -0
  30. package/IgnoreCustomDialogueEventManager.cs.meta +11 -0
  31. package/LineProcessDialogueEvent.cs +17 -0
  32. package/LineProcessDialogueEvent.cs.meta +11 -0
  33. package/LoadDialogueEventExcluder.cs +42 -0
  34. package/LoadDialogueEventExcluder.cs.meta +11 -0
  35. package/LoadDialogueEvents.cs +76 -0
  36. package/LoadDialogueEvents.cs.meta +11 -0
  37. package/Samples~/Character_Leave_Dialogue_Event.prefab +46 -0
  38. package/Samples~/Character_Leave_Dialogue_Event.prefab.meta +7 -0
  39. package/Samples~/Dialogue_Event_Excluder.prefab +116 -0
  40. package/Samples~/Dialogue_Event_Excluder.prefab.meta +7 -0
  41. package/Samples~/Dialogue_Line_Event_Manager.prefab +315 -0
  42. package/Samples~/Dialogue_Line_Event_Manager.prefab.meta +7 -0
  43. package/Samples~/Dialogue_Line_Scene_Event_Manager.prefab +48 -0
  44. package/Samples~/Dialogue_Line_Scene_Event_Manager.prefab.meta +7 -0
  45. package/Samples~/Faint_Dialogue_Event.prefab +46 -0
  46. package/Samples~/Faint_Dialogue_Event.prefab.meta +7 -0
  47. package/Samples~/Ignore_Custom_Dialogue_Event_Manager.prefab +51 -0
  48. package/Samples~/Ignore_Custom_Dialogue_Event_Manager.prefab.meta +7 -0
  49. package/Samples~/Load_Dialogue_Events.prefab +317 -0
  50. package/Samples~/Load_Dialogue_Events.prefab.meta +7 -0
  51. package/Samples~/Load_Event_Excluder.prefab +61 -0
  52. package/Samples~/Load_Event_Excluder.prefab.meta +7 -0
  53. package/Samples~/Truth_Bullet_Get_On_Line_End.prefab +46 -0
  54. package/Samples~/Truth_Bullet_Get_On_Line_End.prefab.meta +7 -0
  55. package/TruthBulletGetOnLineEnd.cs +18 -0
  56. package/TruthBulletGetOnLineEnd.cs.meta +11 -0
  57. package/package.json +38 -4
  58. package/package.json.meta +7 -0
  59. package/README.md +0 -3
Binary file
@@ -0,0 +1,14 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Dialogues.Events;
4
+ using DREditor.Dialogues.LineReading;
5
+
6
+ namespace DREditor.DialogueEventManaging
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ [ClassHeader(nameof(LineProcessDialogueEvent<CharacterLeave>) + " for the Dialogue Event: " + nameof(CharacterLeave) +
12
+ "\n\n")]
13
+ public class CharacterLeaveDialogueEvent : LineProcessDialogueEvent<CharacterLeave> { }
14
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 1a7747ade7429f2439c420dbbdac2ae0
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "DREditor.DialogueEventManaging",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "DREditor",
6
+ "DREditor.Investigations"
7
+ ],
8
+ "includePlatforms": [],
9
+ "excludePlatforms": [],
10
+ "allowUnsafeCode": false,
11
+ "overrideReferences": false,
12
+ "precompiledReferences": [],
13
+ "autoReferenced": true,
14
+ "defineConstraints": [],
15
+ "versionDefines": [],
16
+ "noEngineReferences": false
17
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 2d78ccb046d3233479c6c3d835f1326d
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -0,0 +1,40 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues.Events;
3
+ using System;
4
+ using UnityEngine;
5
+
6
+ namespace DREditor.DialogueEventManaging
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ public class DialogueEventExcluder : DialogueEventTypeExcluder
12
+ {
13
+ /// <inheritdoc/>
14
+ public override bool IsExcludedEvent(IDialogueEvent dialogueEvent)
15
+ {
16
+ foreach (IDialogueEvent type in exclusionTypes)
17
+ if (dialogueEvent.GetType() == type.GetType())
18
+ return true;
19
+
20
+ return false;
21
+ }
22
+
23
+ /// <summary>
24
+ ///
25
+ /// </summary>
26
+ [ContextMenu("Set Default Exclusion Types")]
27
+ public virtual void SetDefaultExclusionTypes() => exclusionTypes = new()
28
+ {
29
+ Create<ShakeObject>(), Create<CGDisplay>(), Create<VideoDisplay>(), Create<FaintAnim>(), Create<CharacterLeave>(),
30
+ Create<Flashback>()
31
+ };
32
+
33
+ /// <summary>
34
+ ///
35
+ /// </summary>
36
+ /// <typeparam name="T"></typeparam>
37
+ /// <returns></returns>
38
+ protected IDialogueEvent Create<T>() where T : IDialogueEvent => (IDialogueEvent)Activator.CreateInstance(typeof(T));
39
+ }
40
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 86a92183080cdbc46a4f152112d822dd
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,45 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Dialogues.Events;
4
+ using System.Collections.Generic;
5
+
6
+ namespace DREditor.DialogueEventManaging
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ public abstract class DialogueEventIgnorer : DialogueComponent
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ protected readonly List<IDialogueEvent> ignoredEvents = new();
17
+
18
+
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ /// <param name="ignoredEvent"></param>
23
+ protected virtual void AddIgnoredEvent(IDialogueEvent ignoredEvent) => ignoredEvents.Add(ignoredEvent);
24
+
25
+
26
+ /// <summary>
27
+ ///
28
+ /// </summary>
29
+ public virtual void ClearIgnoredEvents() => ignoredEvents.Clear();
30
+
31
+ /// <summary>
32
+ ///
33
+ /// </summary>
34
+ /// <param name="dialogueEvent"></param>
35
+ /// <returns></returns>
36
+ public virtual bool IsIgnoredEvent(IDialogueEvent dialogueEvent)
37
+ {
38
+ foreach (IDialogueEvent i in ignoredEvents)
39
+ if (dialogueEvent == i)
40
+ return true;
41
+
42
+ return false;
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: a5ac4c7d7cbb05b49bc54936706eeadc
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,38 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Dialogues.Events;
4
+ using System.Collections.Generic;
5
+ using System.Linq;
6
+
7
+ namespace DREditor.DialogueEventManaging
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ public abstract class DialogueEventManager : DialogueComponent
13
+ {
14
+ /// <summary>
15
+ ///
16
+ /// </summary>
17
+ /// <param name="events"></param>
18
+ protected virtual void TriggerDialogueEvents(IEnumerable<IDialogueEvent> events)
19
+ {
20
+ foreach (IDialogueEvent dialogueEvent in events)
21
+ dialogueEvent.TriggerDialogueEvent();
22
+ }
23
+
24
+ /// <summary>
25
+ ///
26
+ /// </summary>
27
+ /// <typeparam name="T"></typeparam>
28
+ /// <param name="currentLine"></param>
29
+ protected virtual void TriggerAllDialogueEventsOfType<T>(Line currentLine) where T : IDialogueEvent
30
+ {
31
+ var events = currentLine.DiaEvents.Where(dialogueEvent => dialogueEvent.GetType() == typeof(T));
32
+
33
+ if (events.Count() > 0)
34
+ foreach (IDialogueEvent dialogueEvent in events)
35
+ dialogueEvent.TriggerDialogueEvent();
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 0b5e05176a32789438ae07d8d108d89b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,27 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues.Events;
3
+ using System.Collections.Generic;
4
+ using UnityEngine;
5
+
6
+ namespace DREditor.DialogueEventManaging
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ public abstract class DialogueEventTypeExcluder : MonoBehaviour
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ [SerializeReference]
17
+ public List<IDialogueEvent> exclusionTypes = new();
18
+
19
+
20
+ /// <summary>
21
+ ///
22
+ /// </summary>
23
+ /// <param name="dialogueEvent"></param>
24
+ /// <returns></returns>
25
+ public abstract bool IsExcludedEvent(IDialogueEvent dialogueEvent);
26
+ }
27
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 4f38f82313402e348846a59795a228f0
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,120 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Dialogues.Events;
4
+ using DREditor.Dialogues.LineReading;
5
+ using DREditor.Dialogues.Loading;
6
+ using System.Collections;
7
+ using System.Collections.Generic;
8
+ using System.Linq;
9
+ using UnityEngine;
10
+
11
+ namespace DREditor.DialogueEventManaging
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ [ClassHeader(nameof(FilteredDialogueEventManager) + ", " + nameof(ILineProcessorRoutine) + ", " + nameof(ILoadToLineEvents) +
17
+ "\n\n")]
18
+ public class DialogueLineEventManager : FilteredDialogueEventManager, ILineProcessorRoutine, ILoadToLineEvents
19
+ {
20
+ /// <inheritdoc/>
21
+ public virtual bool ShouldProcess(Line currentLine)
22
+ {
23
+ bool hasEvents = currentLine.DiaEvents.Count != 0;
24
+
25
+ bool hasEventWaiters = LineContainsEventWaiters(currentLine, out _);
26
+
27
+ if (hasEvents && !hasEventWaiters)
28
+ TriggerDialogueLineEvents(currentLine);
29
+
30
+ return hasEvents && hasEventWaiters;
31
+ }
32
+
33
+ /// <inheritdoc/>
34
+ public IEnumerator LineProcessRoutine(Line currentLine) => EvaluateDialogueEvents(currentLine);
35
+
36
+
37
+ /// <summary>
38
+ ///
39
+ /// </summary>
40
+ /// <param name="currentLine"></param>
41
+ /// <returns></returns>
42
+ protected virtual IEnumerator EvaluateDialogueEvents(Line currentLine)
43
+ {
44
+ if (currentLine.DiaEvents.Count != 0)
45
+ if (LineContainsEventWaiters(currentLine, out List<IDialogueEvent> list))
46
+ yield return SplitTriggeringWaiterEvents(currentLine, list);
47
+ else
48
+ TriggerDialogueLineEvents(currentLine);
49
+ }
50
+
51
+ /// <summary>
52
+ ///
53
+ /// </summary>
54
+ /// <param name="currentLine"></param>
55
+ /// <param name="dialogueEvents"></param>
56
+ /// <returns></returns>
57
+ protected virtual bool LineContainsEventWaiters(Line currentLine, out List<IDialogueEvent> dialogueEvents)
58
+ {
59
+ dialogueEvents = currentLine.DiaEvents.Where(dialogueEvent => dialogueEvent is EventWaiter).ToList();
60
+
61
+ return dialogueEvents.Count > 0;
62
+ }
63
+
64
+ /// <summary>
65
+ ///
66
+ /// </summary>
67
+ /// <param name="currentLine"></param>
68
+ /// <param name="dialogueEvents"></param>
69
+ /// <returns></returns>
70
+ protected virtual IEnumerator SplitTriggeringWaiterEvents(Line currentLine, List<IDialogueEvent> dialogueEvents)
71
+ {
72
+ yield return TriggerEventWaiters(dialogueEvents);
73
+
74
+ TriggerNonEventWaiters(currentLine);
75
+ }
76
+
77
+ /// <summary>
78
+ ///
79
+ /// </summary>
80
+ /// <param name="dialogueEvents"></param>
81
+ /// <returns></returns>
82
+ protected virtual IEnumerator TriggerEventWaiters(List<IDialogueEvent> dialogueEvents)
83
+ {
84
+ foreach (IDialogueEvent dialogueEvent in dialogueEvents)
85
+ {
86
+ EventWaiter dialogueEventWaiter = dialogueEvent as EventWaiter;
87
+
88
+ dialogueEventWaiter.SetUnfinished();
89
+
90
+ dialogueEvent.TriggerDialogueEvent();
91
+
92
+ UnityEngine.Debug.Log($"REPORT: {ToString()}: Started waiting for event.");
93
+
94
+ yield return new WaitUntil(() => dialogueEventWaiter.done);
95
+
96
+ dialogueEventWaiter.SetUnfinished();
97
+
98
+ UnityEngine.Debug.Log($"REPORT: {ToString()}: Finished waiting for event.");
99
+ }
100
+ }
101
+
102
+ /// <summary>
103
+ ///
104
+ /// </summary>
105
+ /// <param name="currentLine"></param>
106
+ protected virtual void TriggerNonEventWaiters(Line currentLine)
107
+ {
108
+ List<IDialogueEvent> nonEventWaiterDialogueEvents = currentLine.DiaEvents
109
+ .Where(dialogueEvent => dialogueEvent is not EventWaiter).ToList();
110
+
111
+ if (nonEventWaiterDialogueEvents.Count > 0)
112
+ foreach (IDialogueEvent dialogueEvent in nonEventWaiterDialogueEvents)
113
+ dialogueEvent.TriggerDialogueEvent();
114
+ }
115
+
116
+
117
+ /// <inheritdoc/>
118
+ public virtual void OnLoadToLineEvents(Line currentLine) => TriggerDialogueLineEvents(currentLine);
119
+ }
120
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: ba1dff1872cae5b4d8cf2c7be6750ac6
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,68 @@
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Dialogues.LineReading;
4
+ using DREditor.EventObjects;
5
+ using System.Collections;
6
+ using UnityEngine;
7
+
8
+ namespace DREditor.DialogueEventManaging
9
+ {
10
+ /// <summary>
11
+ ///
12
+ /// </summary>
13
+ [ClassHeader(nameof(DialogueComponent) + ", " + nameof(ILineProcessorRoutine) +
14
+ "\n\n")]
15
+ public class DialogueLineSceneEventManager : DialogueComponent, ILineProcessorRoutine
16
+ {
17
+ /// <summary>
18
+ ///
19
+ /// </summary>
20
+ [Tooltip("")]
21
+ [SerializeField] protected BoolWithEvent eventTrigger = null;
22
+
23
+ /// <summary>
24
+ ///
25
+ /// </summary>
26
+ [Tooltip("")]
27
+ [SerializeField] protected BoolWithEvent isLoadingFile = null;
28
+
29
+
30
+ /// <inheritdoc/>
31
+ public virtual bool ShouldProcess(Line currentLine) => currentLine.Events.Count != 0 && !isLoadingFile.Value;
32
+
33
+ /// <inheritdoc/>
34
+ public virtual IEnumerator LineProcessRoutine(Line currentLine) => EvaluateSceneEvents(currentLine);
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ /// <param name="currentLine"></param>
40
+ /// <returns></returns>
41
+ protected virtual IEnumerator EvaluateSceneEvents(Line currentLine)
42
+ {
43
+ if (currentLine.Events.Count != 0 && !isLoadingFile.Value)
44
+ foreach (SceneEvent sceneEvent in currentLine.Events.ToArray())
45
+ yield return TriggerSceneEvent(sceneEvent);
46
+
47
+ yield break;
48
+ }
49
+
50
+ /// <summary>
51
+ ///
52
+ /// </summary>
53
+ /// <param name="sceneEvent"></param>
54
+ /// <returns></returns>
55
+ protected virtual IEnumerator TriggerSceneEvent(SceneEvent sceneEvent)
56
+ {
57
+ sceneEvent.Raise();
58
+
59
+ // Will wait until trigger is true from Event Ending
60
+ while (!eventTrigger.Value)
61
+ yield return null;
62
+
63
+ eventTrigger.SetValue(false);
64
+
65
+ yield break;
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 4ed7cae7330467647a254aff3d0de50e
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "DREditor.DialogueEventManaging.Editor",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "DREditor",
6
+ "DREditor.Editor",
7
+ "DREditor.DialogueEventManaging"
8
+ ],
9
+ "includePlatforms": [],
10
+ "excludePlatforms": [],
11
+ "allowUnsafeCode": false,
12
+ "overrideReferences": false,
13
+ "precompiledReferences": [],
14
+ "autoReferenced": true,
15
+ "defineConstraints": [],
16
+ "versionDefines": [],
17
+ "noEngineReferences": false
18
+ }
@@ -0,0 +1,7 @@
1
+ fileFormatVersion: 2
2
+ guid: 4185b5b1f51ddee4b8936589e292b793
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant: