net.dreditor.textdisplaying 0.0.0-stage → 0.1.6
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.
- package/CGLineTextDisplayer.cs +13 -0
- package/CGLineTextDisplayer.cs.meta +11 -0
- package/ClearTextOnLineEnd.cs +18 -0
- package/ClearTextOnLineEnd.cs.meta +11 -0
- package/ColorByCharacterTextModifier.cs +46 -0
- package/ColorByCharacterTextModifier.cs.meta +11 -0
- package/DREditor.TextDisplaying.asmdef +20 -0
- package/DREditor.TextDisplaying.asmdef.meta +7 -0
- package/DialogueLineTextDisplayer.cs +188 -0
- package/DialogueLineTextDisplayer.cs.meta +11 -0
- package/DisplayFormattedString.cs +69 -0
- package/DisplayFormattedString.cs.meta +2 -0
- package/DisplayOwnedIntCurrency.cs +57 -0
- package/DisplayOwnedIntCurrency.cs.meta +2 -0
- package/HighlightTextModifier.cs +71 -0
- package/HighlightTextModifier.cs.meta +11 -0
- package/ITextDisplayerHandler.cs +23 -0
- package/ITextDisplayerHandler.cs.meta +11 -0
- package/OptionsTextMessage.cs +54 -0
- package/OptionsTextMessage.cs.meta +11 -0
- package/OptionsTextSpeedMessage.cs +83 -0
- package/OptionsTextSpeedMessage.cs.meta +11 -0
- package/RegexEscapeModifier.cs +44 -0
- package/RegexEscapeModifier.cs.meta +11 -0
- package/ReplaceGroup.cs +34 -0
- package/ReplaceGroup.cs.meta +11 -0
- package/ReplaceTextModifier.cs +54 -0
- package/ReplaceTextModifier.cs.meta +11 -0
- package/ReplaceTextModifierBase.cs +19 -0
- package/ReplaceTextModifierBase.cs.meta +11 -0
- package/Samples/CGDialogueUIVisible.asset +21 -0
- package/Samples/CGDialogueUIVisible.asset.meta +8 -0
- package/Samples/CGTextBox.asset +21 -0
- package/Samples/CGTextBox.asset.meta +8 -0
- package/Samples/CG_Line_Text_Displayer.prefab +147 -0
- package/Samples/CG_Line_Text_Displayer.prefab.meta +7 -0
- package/Samples/Clear_Text_On_Line_End.prefab +46 -0
- package/Samples/Clear_Text_On_Line_End.prefab.meta +7 -0
- package/Samples/Color_By_Character_Text_Modifier.prefab +51 -0
- package/Samples/Color_By_Character_Text_Modifier.prefab.meta +7 -0
- package/Samples/DRE_TextDebugging.unity +492 -0
- package/Samples/DRE_TextDebugging.unity.meta +7 -0
- package/Samples/DialogueTextBox.asset +21 -0
- package/Samples/DialogueTextBox.asset.meta +8 -0
- package/Samples/Dialogue_Line_Text_Displayer.prefab +142 -0
- package/Samples/Dialogue_Line_Text_Displayer.prefab.meta +7 -0
- package/Samples/Highlight_Text_Modifier.prefab +49 -0
- package/Samples/Highlight_Text_Modifier.prefab.meta +7 -0
- package/Samples/Option_Message_UI_ETemplate.prefab +335 -0
- package/Samples/Option_Message_UI_ETemplate.prefab.meta +7 -0
- package/Samples/OptionsUITextSpeedMessage.asset +21 -0
- package/Samples/OptionsUITextSpeedMessage.asset.meta +8 -0
- package/Samples/Regex_Escape_Modifier.prefab +47 -0
- package/Samples/Regex_Escape_Modifier.prefab.meta +7 -0
- package/Samples/Replace_Text_Modifier.prefab +49 -0
- package/Samples/Replace_Text_Modifier.prefab.meta +7 -0
- package/Samples/Symbol_Color_Text_Modifier.prefab +50 -0
- package/Samples/Symbol_Color_Text_Modifier.prefab.meta +7 -0
- package/Samples/Symbol_Protag_UI_Modifier.prefab +48 -0
- package/Samples/Symbol_Protag_UI_Modifier.prefab.meta +7 -0
- package/Samples/Text_Display_Debugger.prefab +467 -0
- package/Samples/Text_Display_Debugger.prefab.meta +7 -0
- package/Samples/Text_Displayer.prefab +624 -0
- package/Samples/Text_Displayer.prefab.meta +7 -0
- package/Samples/TrialDialogueTextBox.asset +21 -0
- package/Samples/TrialDialogueTextBox.asset.meta +8 -0
- package/Samples/Trial_Dialogue_Line_Text_Displayer.prefab +82 -0
- package/Samples/Trial_Dialogue_Line_Text_Displayer.prefab.meta +7 -0
- package/Samples.meta +8 -0
- package/SetTextDisplaySpeed.cs +60 -0
- package/SetTextDisplaySpeed.cs.meta +11 -0
- package/SymbolColorTextModifier.cs +25 -0
- package/SymbolColorTextModifier.cs.meta +11 -0
- package/SymbolProtagUIModifier.cs +42 -0
- package/SymbolProtagUIModifier.cs.meta +11 -0
- package/SymbolTextModifier.cs +48 -0
- package/SymbolTextModifier.cs.meta +11 -0
- package/TMPMarquee.cs +178 -0
- package/TMPMarquee.cs.meta +11 -0
- package/TMPMarqueeBase.cs +104 -0
- package/TMPMarqueeBase.cs.meta +2 -0
- package/TextDisplayDebugger.cs +87 -0
- package/TextDisplayDebugger.cs.meta +11 -0
- package/TextDisplayModifier.cs +29 -0
- package/TextDisplayModifier.cs.meta +11 -0
- package/TextDisplayer.cs +255 -0
- package/TextDisplayer.cs.meta +11 -0
- package/TextDisplayerBase.cs +107 -0
- package/TextDisplayerBase.cs.meta +11 -0
- package/package.json +37 -6
- package/package.json.meta +7 -0
- package/README.md +0 -3
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.LineReading;
|
|
4
|
+
using System.Collections;
|
|
5
|
+
using System.Collections.Generic;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
using UnityEngine.InputSystem;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.TextDisplaying
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
public class TextDisplayDebugger : MonoBehaviour
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[Tooltip("")]
|
|
20
|
+
[SerializeField] protected InputActionReference submit = null;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
[Header("")]
|
|
27
|
+
[Space]
|
|
28
|
+
[Tooltip("")]
|
|
29
|
+
[SerializeField] protected bool debugging = true;
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
[Tooltip("")]
|
|
35
|
+
[SerializeField] protected List<Line> debugLines = new();
|
|
36
|
+
|
|
37
|
+
/// <summary>
|
|
38
|
+
///
|
|
39
|
+
/// </summary>
|
|
40
|
+
[Tooltip("")]
|
|
41
|
+
[SerializeField] protected DialogueComponent lineDisplayerComponent;
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
protected ILineTextDisplayRoutine lineTextDisplayer;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
protected virtual void Awake() => lineTextDisplayer = (ILineTextDisplayRoutine)lineDisplayerComponent;
|
|
54
|
+
|
|
55
|
+
/// <summary>
|
|
56
|
+
///
|
|
57
|
+
/// </summary>
|
|
58
|
+
protected virtual void Start() => StartCoroutine(LoopDebugDisplayLines());
|
|
59
|
+
|
|
60
|
+
/// <summary>
|
|
61
|
+
///
|
|
62
|
+
/// </summary>
|
|
63
|
+
/// <returns></returns>
|
|
64
|
+
protected virtual IEnumerator LoopDebugDisplayLines()
|
|
65
|
+
{
|
|
66
|
+
while (debugging)
|
|
67
|
+
yield return DisplayLines();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// <summary>
|
|
71
|
+
///
|
|
72
|
+
/// </summary>
|
|
73
|
+
/// <returns></returns>
|
|
74
|
+
protected virtual IEnumerator DisplayLines()
|
|
75
|
+
{
|
|
76
|
+
foreach(var line in debugLines)
|
|
77
|
+
{
|
|
78
|
+
yield return lineTextDisplayer.LineTextDisplay(line);
|
|
79
|
+
|
|
80
|
+
yield return null;
|
|
81
|
+
|
|
82
|
+
while (!submit.action.triggered && line.Text != "")
|
|
83
|
+
yield return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using TMPro;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
|
|
6
|
+
namespace DREditor.TextDisplaying
|
|
7
|
+
{
|
|
8
|
+
/// <summary>
|
|
9
|
+
///
|
|
10
|
+
/// </summary>
|
|
11
|
+
public abstract class TextDisplayModifier : MonoBehaviour
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
/// <param name="text"></param>
|
|
17
|
+
/// <param name="currentLine"></param>
|
|
18
|
+
/// <param name="box"></param>
|
|
19
|
+
/// <returns></returns>
|
|
20
|
+
public abstract string ApplyModification(string text, Line currentLine = null, TMP_Text box = null);
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
///
|
|
24
|
+
/// </summary>
|
|
25
|
+
/// <param name="currentLine"></param>
|
|
26
|
+
/// <returns></returns>
|
|
27
|
+
public virtual bool SkipLine(Line currentLine) => false;
|
|
28
|
+
}
|
|
29
|
+
}
|
package/TextDisplayer.cs
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
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 DREditor.Input;
|
|
6
|
+
using DREditor.Services;
|
|
7
|
+
using System.Collections;
|
|
8
|
+
using System.Collections.Generic;
|
|
9
|
+
using System.Linq;
|
|
10
|
+
using System.Text.RegularExpressions;
|
|
11
|
+
using TMPro;
|
|
12
|
+
using UnityEngine;
|
|
13
|
+
using UnityEngine.InputSystem;
|
|
14
|
+
|
|
15
|
+
namespace DREditor.TextDisplaying
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[ClassHeader(nameof(TextDisplayerBase) + ", " + nameof(IToTitleScreen) + ", " + nameof(ILineRoutine) +
|
|
21
|
+
"\n\n")]
|
|
22
|
+
public class TextDisplayer : TextDisplayerBase
|
|
23
|
+
{
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Tooltip("")]
|
|
28
|
+
[SerializeField] protected InputActionReference submit = null;
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
[Tooltip("")]
|
|
34
|
+
[SerializeField] protected BoolWithEvent inTrialMode = null;
|
|
35
|
+
|
|
36
|
+
/// <summary>
|
|
37
|
+
///
|
|
38
|
+
/// </summary>
|
|
39
|
+
[Tooltip("")]
|
|
40
|
+
[SerializeField] protected BoolWithEvent inFastForwardMode = null;
|
|
41
|
+
|
|
42
|
+
/// <summary>
|
|
43
|
+
///
|
|
44
|
+
/// </summary>
|
|
45
|
+
[Tooltip("")]
|
|
46
|
+
[SerializeField] protected float bufferTextMultiplier = 0.01f;
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
/// <summary>
|
|
50
|
+
///
|
|
51
|
+
/// </summary>
|
|
52
|
+
[Header("")]
|
|
53
|
+
[Divider]
|
|
54
|
+
[Tooltip("")]
|
|
55
|
+
[SerializeField] protected List<TextDisplayModifier> textModifiers = new();
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
///
|
|
60
|
+
/// </summary>
|
|
61
|
+
protected bool skipText = false;
|
|
62
|
+
|
|
63
|
+
/// <summary>
|
|
64
|
+
///
|
|
65
|
+
/// </summary>
|
|
66
|
+
protected bool skipTextStarted = false;
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/// <inheritdoc/>
|
|
70
|
+
public override void DisplayText(TMP_Text textBox, Line line)
|
|
71
|
+
{
|
|
72
|
+
if (inFastForwardMode.Value)
|
|
73
|
+
{
|
|
74
|
+
InitializeTextBox(textBox);
|
|
75
|
+
|
|
76
|
+
string preparedText = ApplyTextModifications(line);
|
|
77
|
+
|
|
78
|
+
PrepareTextBox(preparedText);
|
|
79
|
+
|
|
80
|
+
if (TextBoxIsEmpty(line))
|
|
81
|
+
return;
|
|
82
|
+
|
|
83
|
+
ResolveDisplayingText(preparedText);
|
|
84
|
+
}
|
|
85
|
+
else
|
|
86
|
+
StartCoroutine(DisplayTextRoutine(textBox, line));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// <summary>
|
|
90
|
+
///
|
|
91
|
+
/// </summary>
|
|
92
|
+
/// <param name="textBox"></param>
|
|
93
|
+
/// <param name="currentLine"></param>
|
|
94
|
+
/// <returns></returns>
|
|
95
|
+
protected virtual IEnumerator DisplayTextRoutine(TMP_Text textBox, Line currentLine)
|
|
96
|
+
{
|
|
97
|
+
InitializeTextBox(textBox);
|
|
98
|
+
|
|
99
|
+
string preparedText = ApplyTextModifications(currentLine);
|
|
100
|
+
|
|
101
|
+
PrepareTextBox(preparedText);
|
|
102
|
+
|
|
103
|
+
if (TextBoxIsEmpty(currentLine))
|
|
104
|
+
yield break;
|
|
105
|
+
|
|
106
|
+
yield return DisplayTextAnimation(preparedText);
|
|
107
|
+
|
|
108
|
+
ResolveDisplayingText(preparedText);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/// <summary>
|
|
112
|
+
///
|
|
113
|
+
/// </summary>
|
|
114
|
+
/// <param name="textBox"></param>
|
|
115
|
+
protected virtual void InitializeTextBox(TMP_Text textBox)
|
|
116
|
+
{
|
|
117
|
+
box = textBox;
|
|
118
|
+
|
|
119
|
+
skipText = false;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/// <summary>
|
|
123
|
+
///
|
|
124
|
+
/// </summary>
|
|
125
|
+
/// <param name="preparedText"></param>
|
|
126
|
+
protected virtual void PrepareTextBox(string preparedText)
|
|
127
|
+
{
|
|
128
|
+
box.maxVisibleCharacters = 0;
|
|
129
|
+
|
|
130
|
+
box.text = preparedText;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// <summary>
|
|
134
|
+
///
|
|
135
|
+
/// </summary>
|
|
136
|
+
/// <param name="currentLine"></param>
|
|
137
|
+
/// <returns></returns>
|
|
138
|
+
protected virtual bool TextBoxIsEmpty(Line currentLine)
|
|
139
|
+
{
|
|
140
|
+
bool result = string.IsNullOrEmpty(box.text) || SkipDisplayingLine(currentLine);
|
|
141
|
+
|
|
142
|
+
if (result)
|
|
143
|
+
{
|
|
144
|
+
SetWaitingForClick(false);
|
|
145
|
+
|
|
146
|
+
ServiceLocator.GetService<IInputManager>().Disable();
|
|
147
|
+
|
|
148
|
+
inFastForwardMode.SetValue(true);
|
|
149
|
+
|
|
150
|
+
ServiceLocator.GetService<IDialogueManager>()
|
|
151
|
+
.GetComponentsInChildren<MonoBehaviour>()
|
|
152
|
+
.OfType<ILineReader>()
|
|
153
|
+
.FirstOrDefault().OnLineEndEvent += OnLineSkipped;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/// <summary>
|
|
160
|
+
///
|
|
161
|
+
/// </summary>
|
|
162
|
+
protected virtual void OnLineSkipped()
|
|
163
|
+
{
|
|
164
|
+
ServiceLocator.GetService<IDialogueManager>()
|
|
165
|
+
.GetComponentsInChildren<MonoBehaviour>()
|
|
166
|
+
.OfType<ILineReader>()
|
|
167
|
+
.FirstOrDefault().OnLineEndEvent -= OnLineSkipped;
|
|
168
|
+
|
|
169
|
+
inFastForwardMode.SetValue(false);
|
|
170
|
+
|
|
171
|
+
ServiceLocator.GetService<IInputManager>().Enable();
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/// <summary>
|
|
175
|
+
///
|
|
176
|
+
/// </summary>
|
|
177
|
+
/// <param name="currentLine"></param>
|
|
178
|
+
/// <returns></returns>
|
|
179
|
+
protected virtual string ApplyTextModifications(Line currentLine)
|
|
180
|
+
{
|
|
181
|
+
string preparedText = currentLine.Text;
|
|
182
|
+
|
|
183
|
+
foreach (var modifier in textModifiers)
|
|
184
|
+
preparedText = modifier.ApplyModification(preparedText, currentLine, box);
|
|
185
|
+
|
|
186
|
+
return preparedText;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/// <summary>
|
|
190
|
+
///
|
|
191
|
+
/// </summary>
|
|
192
|
+
/// <param name="preparedText"></param>
|
|
193
|
+
/// <returns></returns>
|
|
194
|
+
protected virtual IEnumerator DisplayTextAnimation(string preparedText)
|
|
195
|
+
{
|
|
196
|
+
string textWithoutHTMLTags = Regex.Replace(preparedText, "<.*?>", string.Empty);
|
|
197
|
+
|
|
198
|
+
for (int i = 0; i < textWithoutHTMLTags.Length && !skipText; i++)
|
|
199
|
+
{
|
|
200
|
+
if (i == 1 && !skipTextStarted)
|
|
201
|
+
StartCoroutine(SkipText());
|
|
202
|
+
|
|
203
|
+
box.maxVisibleCharacters = i;
|
|
204
|
+
|
|
205
|
+
if (!inFastForwardMode.Value)
|
|
206
|
+
yield return new WaitForSecondsRealtime(textDisplaySpeed * bufferTextMultiplier);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
box.maxVisibleCharacters += 1;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/// <summary>
|
|
213
|
+
///
|
|
214
|
+
/// </summary>
|
|
215
|
+
/// <returns></returns>
|
|
216
|
+
protected virtual IEnumerator SkipText()
|
|
217
|
+
{
|
|
218
|
+
skipTextStarted = true;
|
|
219
|
+
|
|
220
|
+
while (IsWaitingForClick())
|
|
221
|
+
if (submit.action.triggered || inFastForwardMode.Value)
|
|
222
|
+
break;
|
|
223
|
+
else
|
|
224
|
+
yield return null;
|
|
225
|
+
|
|
226
|
+
skipTextStarted = false;
|
|
227
|
+
|
|
228
|
+
skipText = true;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/// <inheritdoc/>
|
|
232
|
+
public override bool ShouldProcess(Line currentLine)
|
|
233
|
+
{
|
|
234
|
+
foreach (var modifier in textModifiers)
|
|
235
|
+
if (modifier is ILineRoutine routineCheck && routineCheck.ShouldProcess(currentLine))
|
|
236
|
+
return true;
|
|
237
|
+
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/// <summary>
|
|
242
|
+
///
|
|
243
|
+
/// </summary>
|
|
244
|
+
/// <param name="currentLine"></param>
|
|
245
|
+
/// <returns></returns>
|
|
246
|
+
protected virtual bool SkipDisplayingLine(Line currentLine)
|
|
247
|
+
{
|
|
248
|
+
foreach (var modifier in textModifiers)
|
|
249
|
+
if (modifier.SkipLine(currentLine))
|
|
250
|
+
return true;
|
|
251
|
+
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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.Services;
|
|
5
|
+
using TMPro;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.TextDisplaying
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
public abstract class TextDisplayerBase : MonoBehaviour, IToTitleScreen, ILineRoutine
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
protected TMP_Text box = null;
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
///
|
|
22
|
+
/// </summary>
|
|
23
|
+
protected bool isWaitingForClick = false;
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
///
|
|
27
|
+
/// </summary>
|
|
28
|
+
protected float textDisplaySpeed = 3.5f;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
/// <param name="textBox"></param>
|
|
35
|
+
/// <param name="line"></param>
|
|
36
|
+
public abstract void DisplayText(TMP_Text textBox, Line line);
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
/// <param name="speed"></param>
|
|
42
|
+
public virtual void SetTextDisplaySpeed(float speed) => textDisplaySpeed = speed;
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
/// <param name="waitingForClick"></param>
|
|
48
|
+
public virtual void SetWaitingForClick(bool waitingForClick) => isWaitingForClick = waitingForClick;
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
/// <returns></returns>
|
|
54
|
+
public virtual bool IsWaitingForClick() => isWaitingForClick;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
///
|
|
59
|
+
/// </summary>
|
|
60
|
+
/// <param name="preparedText"></param>
|
|
61
|
+
public virtual void ResolveDisplayingText(string preparedText)
|
|
62
|
+
{
|
|
63
|
+
if (box != null)
|
|
64
|
+
PasteFinalDisplayText(preparedText);
|
|
65
|
+
|
|
66
|
+
SetWaitingForClick(false);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// <summary>
|
|
70
|
+
///
|
|
71
|
+
/// </summary>
|
|
72
|
+
/// <param name="text"></param>
|
|
73
|
+
protected virtual void PasteFinalDisplayText(string text)
|
|
74
|
+
{
|
|
75
|
+
box.text = text;
|
|
76
|
+
|
|
77
|
+
box.maxVisibleCharacters = int.MaxValue;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/// <summary>
|
|
81
|
+
///
|
|
82
|
+
/// </summary>
|
|
83
|
+
/// <returns></returns>
|
|
84
|
+
public virtual string GetText() => box != null ? box.text : "";
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
/// <inheritdoc/>
|
|
88
|
+
public abstract bool ShouldProcess(Line currentLine);
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
/// <inheritdoc/>
|
|
92
|
+
public virtual void ToTitleScreen() => ClearText();
|
|
93
|
+
|
|
94
|
+
/// <summary>
|
|
95
|
+
///
|
|
96
|
+
/// </summary>
|
|
97
|
+
public virtual void ClearText()
|
|
98
|
+
{
|
|
99
|
+
if (box != null)
|
|
100
|
+
{
|
|
101
|
+
box.maxVisibleCharacters = 0;
|
|
102
|
+
|
|
103
|
+
box.text = "";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "net.dreditor.textdisplaying",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "net.dreditor.textdisplaying",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"displayName": "DREditor Text Displaying",
|
|
5
|
+
"description": "The beta for DREditor. A tool to create death game style projects without having to code.",
|
|
6
|
+
"unity": "6000.4",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"com.unity.inputsystem": "1.19.0",
|
|
9
|
+
"com.unity.ugui": "2.0.0",
|
|
10
|
+
"net.dreditor.core": "0.1.6",
|
|
11
|
+
"net.dreditor.input": "0.1.6"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Benjamin \"Sweden\" Jillson",
|
|
18
|
+
"email": "dreditortool@gmail.com",
|
|
19
|
+
"url": "https://dreditor.net"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"editor",
|
|
23
|
+
"tool",
|
|
24
|
+
"dreditor"
|
|
25
|
+
],
|
|
26
|
+
"samples": [
|
|
27
|
+
{
|
|
28
|
+
"displayName": "Samples",
|
|
29
|
+
"description": "",
|
|
30
|
+
"path": "Samples~"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"documentationUrl": "https://dreditor.net",
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"licensesUrl": "https://dreditor.net/docs/LICENSE.html",
|
|
36
|
+
"changelogUrl": "https://dreditor.net/docs/CHANGELOG.html"
|
|
37
|
+
}
|
package/README.md
DELETED