net.dreditor.dialogues.implementation 0.1.6 → 0.1.8

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 (100) hide show
  1. package/.attestation.p7m +0 -0
  2. package/DREditor.Dialogues.Implementation.asmdef +15 -15
  3. package/DREditor.Dialogues.Implementation.asmdef.meta +7 -7
  4. package/DialogueAssetDataClearer.cs +49 -49
  5. package/DialogueAssetDataClearer.cs.meta +11 -11
  6. package/DialogueAssetEndEventHandler.cs +57 -57
  7. package/DialogueAssetEndEventHandler.cs.meta +11 -11
  8. package/DialogueAssetEnder.cs +239 -239
  9. package/DialogueAssetEnder.cs.meta +11 -11
  10. package/DialogueAssetFinisher.cs +89 -89
  11. package/DialogueAssetFinisher.cs.meta +11 -11
  12. package/DialogueAssetFinisherBase.cs +82 -82
  13. package/DialogueAssetFinisherBase.cs.meta +11 -11
  14. package/DialogueAssetManager.cs +65 -65
  15. package/DialogueAssetManager.cs.meta +11 -11
  16. package/DialogueAssetReader.cs +377 -377
  17. package/DialogueAssetReader.cs.meta +11 -11
  18. package/DialogueAssetStarter.cs +254 -254
  19. package/DialogueAssetStarter.cs.meta +11 -11
  20. package/DialogueAssetStarterDebugger.cs +40 -40
  21. package/DialogueAssetStarterDebugger.cs.meta +11 -11
  22. package/DialogueAssetWaiter.cs +93 -93
  23. package/DialogueAssetWaiter.cs.meta +11 -11
  24. package/DialogueLineReader.cs +391 -391
  25. package/DialogueLineReader.cs.meta +11 -11
  26. package/DialogueManager.cs +83 -83
  27. package/DialogueManager.cs.meta +11 -11
  28. package/DialogueNameSaver.cs +45 -45
  29. package/DialogueNameSaver.cs.meta +11 -11
  30. package/FastForwardToLine.cs +102 -102
  31. package/FastForwardToLine.cs.meta +11 -11
  32. package/InstantDialogueEnder.cs +91 -91
  33. package/InstantDialogueEnder.cs.meta +11 -11
  34. package/InstantDialogueFinisher.cs +132 -132
  35. package/InstantDialogueFinisher.cs.meta +11 -11
  36. package/InstantDialogueStarter.cs +82 -82
  37. package/InstantDialogueStarter.cs.meta +11 -11
  38. package/NotLeavingOnDialogueFinish.cs +44 -44
  39. package/NotLeavingOnDialogueFinish.cs.meta +11 -11
  40. package/PreparableDialogueStarter.cs +88 -88
  41. package/PreparableDialogueStarter.cs.meta +11 -11
  42. package/{Samples → Samples~}/Dialogue_Asset_End_Event_Handler.prefab +685 -685
  43. package/{Samples → Samples~}/Dialogue_Asset_End_Event_Handler.prefab.meta +7 -7
  44. package/{Samples → Samples~}/Dialogue_Asset_Ender.prefab +858 -858
  45. package/{Samples → Samples~}/Dialogue_Asset_Ender.prefab.meta +7 -7
  46. package/{Samples → Samples~}/Dialogue_Asset_Finisher.prefab +301 -301
  47. package/{Samples → Samples~}/Dialogue_Asset_Finisher.prefab.meta +7 -7
  48. package/{Samples → Samples~}/Dialogue_Asset_Load_Identifier.prefab +48 -48
  49. package/{Samples → Samples~}/Dialogue_Asset_Load_Identifier.prefab.meta +7 -7
  50. package/{Samples → Samples~}/Dialogue_Asset_Loader.prefab +231 -231
  51. package/{Samples → Samples~}/Dialogue_Asset_Loader.prefab.meta +7 -7
  52. package/{Samples → Samples~}/Dialogue_Asset_Reader_DRE.prefab +511 -511
  53. package/{Samples → Samples~}/Dialogue_Asset_Reader_DRE.prefab.meta +7 -7
  54. package/{Samples → Samples~}/Dialogue_Asset_Reader_Shell.prefab +252 -252
  55. package/{Samples → Samples~}/Dialogue_Asset_Reader_Shell.prefab.meta +7 -7
  56. package/{Samples → Samples~}/Dialogue_Asset_Reader_Template.prefab +193 -193
  57. package/{Samples → Samples~}/Dialogue_Asset_Reader_Template.prefab.meta +7 -7
  58. package/{Samples → Samples~}/Dialogue_Asset_Starter.prefab +613 -613
  59. package/{Samples → Samples~}/Dialogue_Asset_Starter.prefab.meta +7 -7
  60. package/{Samples → Samples~}/Dialogue_Asset_Waiter.prefab +50 -50
  61. package/{Samples → Samples~}/Dialogue_Asset_Waiter.prefab.meta +7 -7
  62. package/{Samples → Samples~}/Dialogue_Events_Shell.prefab +458 -458
  63. package/{Samples → Samples~}/Dialogue_Events_Shell.prefab.meta +7 -7
  64. package/{Samples → Samples~}/Dialogue_Events_Template.prefab +302 -302
  65. package/{Samples → Samples~}/Dialogue_Events_Template.prefab.meta +7 -7
  66. package/{Samples → Samples~}/Dialogue_Line_Loader.prefab +1282 -1282
  67. package/{Samples → Samples~}/Dialogue_Line_Loader.prefab.meta +7 -7
  68. package/{Samples → Samples~}/Dialogue_Line_Reader.prefab +3688 -3688
  69. package/{Samples → Samples~}/Dialogue_Line_Reader.prefab.meta +7 -7
  70. package/{Samples → Samples~}/Dialogue_Name_Saver.prefab +48 -48
  71. package/{Samples → Samples~}/Dialogue_Name_Saver.prefab.meta +7 -7
  72. package/{Samples → Samples~}/Dialogue_System_Shell.prefab +325 -325
  73. package/{Samples → Samples~}/Dialogue_System_Shell.prefab.meta +7 -7
  74. package/{Samples → Samples~}/Dialogue_System_Template.prefab +1138 -1138
  75. package/{Samples → Samples~}/Dialogue_System_Template.prefab.meta +7 -7
  76. package/{Samples → Samples~}/Fast_Forward_To_Line_Tool.prefab +53 -53
  77. package/{Samples → Samples~}/Fast_Forward_To_Line_Tool.prefab.meta +7 -7
  78. package/{Samples → Samples~}/Instant_Dialogue_Ender.prefab +141 -141
  79. package/{Samples → Samples~}/Instant_Dialogue_Ender.prefab.meta +7 -7
  80. package/{Samples → Samples~}/Instant_Dialogue_Finisher.prefab +172 -172
  81. package/{Samples → Samples~}/Instant_Dialogue_Finisher.prefab.meta +7 -7
  82. package/{Samples → Samples~}/Instant_Dialogue_Starter.prefab +55 -55
  83. package/{Samples → Samples~}/Instant_Dialogue_Starter.prefab.meta +7 -7
  84. package/{Samples → Samples~}/On_Loading_Through_Scene_Transition.prefab +48 -48
  85. package/{Samples → Samples~}/On_Loading_Through_Scene_Transition.prefab.meta +7 -7
  86. package/{Samples → Samples~}/Scene_Event_On_Text_Display.prefab +47 -47
  87. package/{Samples → Samples~}/Scene_Event_On_Text_Display.prefab.meta +7 -7
  88. package/{Samples → Samples~}/Trial_Dialogue_Asset_Reader.prefab +561 -561
  89. package/{Samples → Samples~}/Trial_Dialogue_Asset_Reader.prefab.meta +7 -7
  90. package/{Samples → Samples~}/Trial_Dialogue_Asset_Starter.prefab +239 -239
  91. package/{Samples → Samples~}/Trial_Dialogue_Asset_Starter.prefab.meta +7 -7
  92. package/{Samples → Samples~}/Trial_Dialogue_Line_Loader.prefab +941 -941
  93. package/{Samples → Samples~}/Trial_Dialogue_Line_Loader.prefab.meta +7 -7
  94. package/{Samples → Samples~}/Trial_Dialogue_Loader.prefab +232 -232
  95. package/{Samples → Samples~}/Trial_Dialogue_Loader.prefab.meta +7 -7
  96. package/{Samples → Samples~}/Tween_Waiter_Handler.prefab +46 -46
  97. package/{Samples → Samples~}/Tween_Waiter_Handler.prefab.meta +7 -7
  98. package/package.json +39 -34
  99. package/package.json.meta +7 -7
  100. package/Samples.meta +0 -8
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 5c3c35cde306d124eb430447d2f44553
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 5c3c35cde306d124eb430447d2f44553
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,255 +1,255 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues.Ending;
3
- using DREditor.Dialogues.Loading;
4
- using DREditor.Dialogues.Starting;
5
- using DREditor.EventObjects;
6
- using DREditor.Services;
7
- using System;
8
- using System.Collections;
9
- using UnityEngine;
10
-
11
- namespace DREditor.Dialogues.Implementation
12
- {
13
- /// <summary>
14
- ///
15
- /// </summary>
16
- [ClassHeader(nameof(PreparableDialogueStarter) + ", " + nameof(IDialogueStartEvent) + ", " +
17
- nameof(PreparableDialogueStarter) + ", " + nameof(DialogueStarter) + ", " + nameof(IDialoguePrepareEvent) +
18
- "\n\n")]
19
- public class DialogueAssetStarter : PreparableDialogueStarter, IDialogueStartEvent
20
- {
21
- /// <summary>
22
- ///
23
- /// </summary>
24
- [Header("")]
25
- [Divider]
26
- [Tooltip("")]
27
- [SerializeField] protected BoolWithEvent inDialogue = null;
28
-
29
- /// <summary>
30
- ///
31
- /// </summary>
32
- [Tooltip("")]
33
- [SerializeField] protected BoolWithEvent isLeaving = null;
34
-
35
- /// <summary>
36
- ///
37
- /// </summary>
38
- [Tooltip("")]
39
- [SerializeField] protected StringWithEvent currentControlsKey = null;
40
-
41
- /// <summary>
42
- ///
43
- /// </summary>
44
- [Tooltip("")]
45
- [SerializeField] protected BoolWithEvent hasMenuAccess = null;
46
-
47
- /// <summary>
48
- ///
49
- /// </summary>
50
- [Tooltip("")]
51
- [SerializeField] protected BoolWithEvent isLoadingFile = null;
52
-
53
- /// <summary>
54
- ///
55
- /// </summary>
56
- [Tooltip("")]
57
- [SerializeField] protected StringWithEvent saveDialogueName = null;
58
-
59
-
60
- /// <summary>
61
- ///
62
- /// </summary>
63
- [Header("")]
64
- [Divider]
65
- [Tooltip("")]
66
- [SerializeField] protected DialogueWaiter DialogueWaiter = null;
67
-
68
- /// <summary>
69
- ///
70
- /// </summary>
71
- [Tooltip("")]
72
- [SerializeField] protected DialogueStarter InstantDialogueStarter = null;
73
-
74
-
75
- /// <summary>
76
- ///
77
- /// </summary>
78
- [Header("")]
79
- [Divider]
80
- [Tooltip("")]
81
- [SerializeField] protected string setDialogueControlKey = "dialogue";
82
-
83
-
84
- /// <summary>
85
- ///
86
- /// </summary>
87
- public event Action<DialogueCore> OnDialogueStarted;
88
-
89
-
90
- #region Start Dialogue
91
-
92
- /// <inheritdoc/>
93
- public override void StartDialogue<T>(SelectableObject actor, DialogueBase<T>[] dialogues, bool inleaving = false)
94
- => StartDialogueProcess(actor, dialogues, inleaving);
95
-
96
- public override void StartDialogue<T>(SelectableObject actor, DialogueBase<T> dialogue, bool inleaving = false)
97
- => StartDialogue(actor, new DialogueBase<T>[1] { dialogue }, inleaving);
98
-
99
- /// <summary>
100
- ///
101
- /// </summary>
102
- /// <param name="coreActor"></param>
103
- /// <param name="coreDialogues"></param>
104
- /// <param name="inleaving"></param>
105
- protected virtual void StartDialogueProcess<T>(SelectableObject coreActor, DialogueBase<T>[] coreDialogues,
106
- bool inleaving = false)
107
- where T : Line
108
- {
109
- if (SentDialoguesEmpty(coreDialogues))
110
- return;
111
-
112
- UnityEngine.Debug.Log($"{ToString()}: Starting Dialogue is named: " + coreDialogues[0].name);
113
-
114
- saveDialogueName.SetValue(coreDialogues[0].name);
115
-
116
- SetValueWithEvents(inleaving);
117
-
118
- if (coreDialogues[0] is IInstantAbleDialogue instantable && instantable.GetInstant())
119
- EvaluateInstantDialogue(coreActor, coreDialogues, inleaving);
120
- else
121
- StartCoroutine(BeginDialoguePreparations(coreActor, coreDialogues, inleaving));
122
- }
123
-
124
- /// <summary>
125
- ///
126
- /// </summary>
127
- /// <param name="intendingToLeave"></param>
128
- protected virtual void SetValueWithEvents(bool intendingToLeave = false)
129
- {
130
- currentControlsKey.SetValue(setDialogueControlKey);
131
-
132
- hasMenuAccess.SetValue(false);
133
-
134
- isLeaving.SetValue(intendingToLeave);
135
-
136
- // Added 4-30-2026 Moving to a place that starts dialogue on load showed the reticle when it shouldn't, this fixes that.
137
- // The reason the other call in this script hasn't been removed is because it's unclear as to whether there would
138
- // be any adverse affects from doing so, I mean without the call here, the issue mentioned wouldn't be happening.
139
- // If there are any adverse effects of inDialogue being active too early, then the issue mentioned must also be
140
- // fixed if this line is to be removed.
141
- inDialogue.SetValue(true);
142
- }
143
-
144
- /// <summary>
145
- ///
146
- /// </summary>
147
- /// <param name="dialogues"></param>
148
- /// <returns></returns>
149
- protected virtual bool SentDialoguesEmpty(DialogueCore[] dialogues)
150
- {
151
- bool dialoguesAreEmpty = dialogues == null || dialogues.Length == 0 || dialogues[0] == null;
152
-
153
- if (dialoguesAreEmpty)
154
- {
155
- ServiceLocator.GetService<IDialogueManager>().GetEnder().StopDialogue();
156
-
157
- UnityEngine.Debug.LogWarning($"{ToString()}:Sent dialogues were empty.");
158
- }
159
-
160
- return dialoguesAreEmpty;
161
- }
162
-
163
- #endregion
164
-
165
- #region Dialogue Preparations
166
-
167
- /// <summary>
168
- ///
169
- /// </summary>
170
- /// <param name="actor"></param>
171
- /// <param name="dialogues"></param>
172
- /// <param name="inleaving"></param>
173
- protected virtual IEnumerator BeginDialoguePreparations<T>(SelectableObject actor, DialogueBase<T>[] dialogues,
174
- bool inleaving = false)
175
- where T : Line
176
- {
177
- InvokeDialoguePreparationEvent();
178
-
179
- yield return DialogueWaiter.CheckIfInDialogueToPlay(dialogues[0]);
180
-
181
- VerifyStartActor(actor);
182
-
183
- inDialogue.SetValue(true);
184
-
185
- OnDialogueStarted?.Invoke(dialogues[0]);
186
-
187
- UnityEngine.Debug.Log($"REPORT: {nameof(DialogueAssetStarter)}: " +
188
- $"Starting to Prepare Dialogue.");
189
-
190
- yield return PrepareDialogueComponents();
191
-
192
- UnityEngine.Debug.Log($"REPORT: {nameof(DialogueAssetStarter)}: " +
193
- $"Prepared Dialogue while Loading File is: " + isLoadingFile.Value);
194
-
195
- if (isLoadingFile.Value)
196
- dialogues = ServiceLocator.GetService<IDialogueManager>()
197
- .GetManagerComponent<DialogueLoader>()
198
- .StartLoadThrough(dialogues);
199
-
200
- ServiceLocator.GetService<IDialogueManager>()
201
- .GetReader()
202
- .PlayDialogues(dialogues, inleaving);
203
- }
204
-
205
- /// <summary>
206
- ///
207
- /// </summary>
208
- /// <param name="actor"></param>
209
- protected virtual void VerifyStartActor(SelectableObject actor)
210
- {
211
- if (ServiceLocator.HasService<DialogueObjectManager>())
212
- ServiceLocator.GetService<DialogueObjectManager>().AttemptSetStartingDialogueObject(actor);
213
- else
214
- UnityEngine.Debug.LogWarning($"ALERT: There are no {nameof(DialogueObjectManager)}s in the scene," +
215
- $" the starting actor will skip validity checking.");
216
- }
217
-
218
- #endregion
219
-
220
- #region Instant Dialogue
221
-
222
- /// <summary>
223
- ///
224
- /// </summary>
225
- /// <param name="actor"></param>
226
- /// <param name="dialogues"></param>
227
- /// <param name="inleaving"></param>
228
- protected virtual void EvaluateInstantDialogue<T>(SelectableObject actor, DialogueBase<T>[] dialogues,
229
- bool inleaving = false)
230
- where T : Line
231
- {
232
- if (InstantDialogueStarter == this)
233
- {
234
- UnityEngine.Debug.LogError("ALERT: ERROR: YOU CANNOT USE THE SAME DIALOGUE STARTER FOR INSTANT DIALOGUE, " +
235
- "THIS WILL LOOP CODE. " +
236
- "USE INSTANTDIALOGUESTARTER SCRIPT INSTEAD. REMOVING REFERENCE.");
237
-
238
- InstantDialogueStarter = null;
239
- }
240
-
241
- if (InstantDialogueStarter == null)
242
- {
243
- UnityEngine.Debug.LogWarning("REPORT: An Instant Dialogue Starter hasn't been assigned. Using Default Starter Instead.");
244
-
245
- StartCoroutine(BeginDialoguePreparations(actor, dialogues, inleaving));
246
-
247
- return;
248
- }
249
-
250
- InstantDialogueStarter.StartDialogue(actor, dialogues, inleaving);
251
- }
252
-
253
- #endregion
254
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues.Ending;
3
+ using DREditor.Dialogues.Loading;
4
+ using DREditor.Dialogues.Starting;
5
+ using DREditor.EventObjects;
6
+ using DREditor.Services;
7
+ using System;
8
+ using System.Collections;
9
+ using UnityEngine;
10
+
11
+ namespace DREditor.Dialogues.Implementation
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ [ClassHeader(nameof(PreparableDialogueStarter) + ", " + nameof(IDialogueStartEvent) + ", " +
17
+ nameof(PreparableDialogueStarter) + ", " + nameof(DialogueStarter) + ", " + nameof(IDialoguePrepareEvent) +
18
+ "\n\n")]
19
+ public class DialogueAssetStarter : PreparableDialogueStarter, IDialogueStartEvent
20
+ {
21
+ /// <summary>
22
+ ///
23
+ /// </summary>
24
+ [Header("")]
25
+ [Divider]
26
+ [Tooltip("")]
27
+ [SerializeField] protected BoolWithEvent inDialogue = null;
28
+
29
+ /// <summary>
30
+ ///
31
+ /// </summary>
32
+ [Tooltip("")]
33
+ [SerializeField] protected BoolWithEvent isLeaving = null;
34
+
35
+ /// <summary>
36
+ ///
37
+ /// </summary>
38
+ [Tooltip("")]
39
+ [SerializeField] protected StringWithEvent currentControlsKey = null;
40
+
41
+ /// <summary>
42
+ ///
43
+ /// </summary>
44
+ [Tooltip("")]
45
+ [SerializeField] protected BoolWithEvent hasMenuAccess = null;
46
+
47
+ /// <summary>
48
+ ///
49
+ /// </summary>
50
+ [Tooltip("")]
51
+ [SerializeField] protected BoolWithEvent isLoadingFile = null;
52
+
53
+ /// <summary>
54
+ ///
55
+ /// </summary>
56
+ [Tooltip("")]
57
+ [SerializeField] protected StringWithEvent saveDialogueName = null;
58
+
59
+
60
+ /// <summary>
61
+ ///
62
+ /// </summary>
63
+ [Header("")]
64
+ [Divider]
65
+ [Tooltip("")]
66
+ [SerializeField] protected DialogueWaiter DialogueWaiter = null;
67
+
68
+ /// <summary>
69
+ ///
70
+ /// </summary>
71
+ [Tooltip("")]
72
+ [SerializeField] protected DialogueStarter InstantDialogueStarter = null;
73
+
74
+
75
+ /// <summary>
76
+ ///
77
+ /// </summary>
78
+ [Header("")]
79
+ [Divider]
80
+ [Tooltip("")]
81
+ [SerializeField] protected string setDialogueControlKey = "dialogue";
82
+
83
+
84
+ /// <summary>
85
+ ///
86
+ /// </summary>
87
+ public event Action<DialogueCore> OnDialogueStarted;
88
+
89
+
90
+ #region Start Dialogue
91
+
92
+ /// <inheritdoc/>
93
+ public override void StartDialogue<T>(SelectableObject actor, DialogueBase<T>[] dialogues, bool inleaving = false)
94
+ => StartDialogueProcess(actor, dialogues, inleaving);
95
+
96
+ public override void StartDialogue<T>(SelectableObject actor, DialogueBase<T> dialogue, bool inleaving = false)
97
+ => StartDialogue(actor, new DialogueBase<T>[1] { dialogue }, inleaving);
98
+
99
+ /// <summary>
100
+ ///
101
+ /// </summary>
102
+ /// <param name="coreActor"></param>
103
+ /// <param name="coreDialogues"></param>
104
+ /// <param name="inleaving"></param>
105
+ protected virtual void StartDialogueProcess<T>(SelectableObject coreActor, DialogueBase<T>[] coreDialogues,
106
+ bool inleaving = false)
107
+ where T : Line
108
+ {
109
+ if (SentDialoguesEmpty(coreDialogues))
110
+ return;
111
+
112
+ UnityEngine.Debug.Log($"{ToString()}: Starting Dialogue is named: " + coreDialogues[0].name);
113
+
114
+ saveDialogueName.SetValue(coreDialogues[0].name);
115
+
116
+ SetValueWithEvents(inleaving);
117
+
118
+ if (coreDialogues[0] is IInstantAbleDialogue instantable && instantable.GetInstant())
119
+ EvaluateInstantDialogue(coreActor, coreDialogues, inleaving);
120
+ else
121
+ StartCoroutine(BeginDialoguePreparations(coreActor, coreDialogues, inleaving));
122
+ }
123
+
124
+ /// <summary>
125
+ ///
126
+ /// </summary>
127
+ /// <param name="intendingToLeave"></param>
128
+ protected virtual void SetValueWithEvents(bool intendingToLeave = false)
129
+ {
130
+ currentControlsKey.SetValue(setDialogueControlKey);
131
+
132
+ hasMenuAccess.SetValue(false);
133
+
134
+ isLeaving.SetValue(intendingToLeave);
135
+
136
+ // Added 4-30-2026 Moving to a place that starts dialogue on load showed the reticle when it shouldn't, this fixes that.
137
+ // The reason the other call in this script hasn't been removed is because it's unclear as to whether there would
138
+ // be any adverse affects from doing so, I mean without the call here, the issue mentioned wouldn't be happening.
139
+ // If there are any adverse effects of inDialogue being active too early, then the issue mentioned must also be
140
+ // fixed if this line is to be removed.
141
+ inDialogue.SetValue(true);
142
+ }
143
+
144
+ /// <summary>
145
+ ///
146
+ /// </summary>
147
+ /// <param name="dialogues"></param>
148
+ /// <returns></returns>
149
+ protected virtual bool SentDialoguesEmpty(DialogueCore[] dialogues)
150
+ {
151
+ bool dialoguesAreEmpty = dialogues == null || dialogues.Length == 0 || dialogues[0] == null;
152
+
153
+ if (dialoguesAreEmpty)
154
+ {
155
+ ServiceLocator.GetService<IDialogueManager>().GetEnder().StopDialogue();
156
+
157
+ UnityEngine.Debug.LogWarning($"{ToString()}:Sent dialogues were empty.");
158
+ }
159
+
160
+ return dialoguesAreEmpty;
161
+ }
162
+
163
+ #endregion
164
+
165
+ #region Dialogue Preparations
166
+
167
+ /// <summary>
168
+ ///
169
+ /// </summary>
170
+ /// <param name="actor"></param>
171
+ /// <param name="dialogues"></param>
172
+ /// <param name="inleaving"></param>
173
+ protected virtual IEnumerator BeginDialoguePreparations<T>(SelectableObject actor, DialogueBase<T>[] dialogues,
174
+ bool inleaving = false)
175
+ where T : Line
176
+ {
177
+ InvokeDialoguePreparationEvent();
178
+
179
+ yield return DialogueWaiter.CheckIfInDialogueToPlay(dialogues[0]);
180
+
181
+ VerifyStartActor(actor);
182
+
183
+ inDialogue.SetValue(true);
184
+
185
+ OnDialogueStarted?.Invoke(dialogues[0]);
186
+
187
+ UnityEngine.Debug.Log($"REPORT: {nameof(DialogueAssetStarter)}: " +
188
+ $"Starting to Prepare Dialogue.");
189
+
190
+ yield return PrepareDialogueComponents();
191
+
192
+ UnityEngine.Debug.Log($"REPORT: {nameof(DialogueAssetStarter)}: " +
193
+ $"Prepared Dialogue while Loading File is: " + isLoadingFile.Value);
194
+
195
+ if (isLoadingFile.Value)
196
+ dialogues = ServiceLocator.GetService<IDialogueManager>()
197
+ .GetManagerComponent<DialogueLoader>()
198
+ .StartLoadThrough(dialogues);
199
+
200
+ ServiceLocator.GetService<IDialogueManager>()
201
+ .GetReader()
202
+ .PlayDialogues(dialogues, inleaving);
203
+ }
204
+
205
+ /// <summary>
206
+ ///
207
+ /// </summary>
208
+ /// <param name="actor"></param>
209
+ protected virtual void VerifyStartActor(SelectableObject actor)
210
+ {
211
+ if (ServiceLocator.HasService<DialogueObjectManager>())
212
+ ServiceLocator.GetService<DialogueObjectManager>().AttemptSetStartingDialogueObject(actor);
213
+ else
214
+ UnityEngine.Debug.LogWarning($"ALERT: There are no {nameof(DialogueObjectManager)}s in the scene," +
215
+ $" the starting actor will skip validity checking.");
216
+ }
217
+
218
+ #endregion
219
+
220
+ #region Instant Dialogue
221
+
222
+ /// <summary>
223
+ ///
224
+ /// </summary>
225
+ /// <param name="actor"></param>
226
+ /// <param name="dialogues"></param>
227
+ /// <param name="inleaving"></param>
228
+ protected virtual void EvaluateInstantDialogue<T>(SelectableObject actor, DialogueBase<T>[] dialogues,
229
+ bool inleaving = false)
230
+ where T : Line
231
+ {
232
+ if (InstantDialogueStarter == this)
233
+ {
234
+ UnityEngine.Debug.LogError("ALERT: ERROR: YOU CANNOT USE THE SAME DIALOGUE STARTER FOR INSTANT DIALOGUE, " +
235
+ "THIS WILL LOOP CODE. " +
236
+ "USE INSTANTDIALOGUESTARTER SCRIPT INSTEAD. REMOVING REFERENCE.");
237
+
238
+ InstantDialogueStarter = null;
239
+ }
240
+
241
+ if (InstantDialogueStarter == null)
242
+ {
243
+ UnityEngine.Debug.LogWarning("REPORT: An Instant Dialogue Starter hasn't been assigned. Using Default Starter Instead.");
244
+
245
+ StartCoroutine(BeginDialoguePreparations(actor, dialogues, inleaving));
246
+
247
+ return;
248
+ }
249
+
250
+ InstantDialogueStarter.StartDialogue(actor, dialogues, inleaving);
251
+ }
252
+
253
+ #endregion
254
+ }
255
255
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: be8c7a41d1f924c4a9385074386de1d2
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: be8c7a41d1f924c4a9385074386de1d2
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,41 +1,41 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues.Starting;
3
- using DREditor.EventObjects;
4
- using UnityEngine;
5
-
6
- namespace DREditor.Dialogues.Implementation
7
- {
8
- /// <summary>
9
- ///
10
- /// </summary>
11
- [ClassHeader(nameof(DialogueStarterDebugger) +
12
- "\n\n")]
13
- [RequireComponent(typeof(DialogueStarter))]
14
- public class DialogueAssetStarterDebugger : DialogueStarterDebugger
15
- {
16
- /// <summary>
17
- ///
18
- /// </summary>
19
- /// <param name="actor"></param>
20
- /// <param name="DebugNoDialogue"></param>
21
- public override void DebugNoCharacterDialogueCall(SelectableObject actor, DialogueCore DebugNoDialogue = null)
22
- {
23
- Dialogue dialogueDebug = (Dialogue)DebugNoDialogue;
24
-
25
- Dialogue[] Conversation = new Dialogue[1];
26
-
27
- Dialogue dialogue = ScriptableObject.CreateInstance<Dialogue>();
28
-
29
- dialogue.Lines.Add(new Line());
30
-
31
- dialogue.Lines[0].SetText("THIS CHARACTER HAS NO DIALOGUE PLUGGED IN DO NOT SAVE ON THIS LINE!");
32
-
33
- Conversation[0] = dialogue;
34
-
35
- if (DebugNoDialogue != null)
36
- Conversation[0] = dialogueDebug;
37
-
38
- GetComponent<DialogueStarter>().StartDialogue(actor, Conversation);
39
- }
40
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues.Starting;
3
+ using DREditor.EventObjects;
4
+ using UnityEngine;
5
+
6
+ namespace DREditor.Dialogues.Implementation
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ [ClassHeader(nameof(DialogueStarterDebugger) +
12
+ "\n\n")]
13
+ [RequireComponent(typeof(DialogueStarter))]
14
+ public class DialogueAssetStarterDebugger : DialogueStarterDebugger
15
+ {
16
+ /// <summary>
17
+ ///
18
+ /// </summary>
19
+ /// <param name="actor"></param>
20
+ /// <param name="DebugNoDialogue"></param>
21
+ public override void DebugNoCharacterDialogueCall(SelectableObject actor, DialogueCore DebugNoDialogue = null)
22
+ {
23
+ Dialogue dialogueDebug = (Dialogue)DebugNoDialogue;
24
+
25
+ Dialogue[] Conversation = new Dialogue[1];
26
+
27
+ Dialogue dialogue = ScriptableObject.CreateInstance<Dialogue>();
28
+
29
+ dialogue.Lines.Add(new Line());
30
+
31
+ dialogue.Lines[0].SetText("THIS CHARACTER HAS NO DIALOGUE PLUGGED IN DO NOT SAVE ON THIS LINE!");
32
+
33
+ Conversation[0] = dialogue;
34
+
35
+ if (DebugNoDialogue != null)
36
+ Conversation[0] = dialogueDebug;
37
+
38
+ GetComponent<DialogueStarter>().StartDialogue(actor, Conversation);
39
+ }
40
+ }
41
41
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 8b010968def40f641b657948e929312a
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 8b010968def40f641b657948e929312a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: