net.dreditor.textdisplaying 0.1.6 → 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.
- package/.attestation.p7m +0 -0
- package/CGLineTextDisplayer.cs +12 -12
- package/CGLineTextDisplayer.cs.meta +11 -11
- package/ClearTextOnLineEnd.cs +17 -17
- package/ClearTextOnLineEnd.cs.meta +11 -11
- package/ColorByCharacterTextModifier.cs +45 -45
- package/ColorByCharacterTextModifier.cs.meta +11 -11
- package/DREditor.TextDisplaying.asmdef +19 -19
- package/DREditor.TextDisplaying.asmdef.meta +7 -7
- package/DialogueLineTextDisplayer.cs +187 -187
- package/DialogueLineTextDisplayer.cs.meta +11 -11
- package/DisplayFormattedString.cs +68 -68
- package/DisplayFormattedString.cs.meta +1 -1
- package/DisplayOwnedIntCurrency.cs +56 -56
- package/DisplayOwnedIntCurrency.cs.meta +1 -1
- package/HighlightTextModifier.cs +70 -70
- package/HighlightTextModifier.cs.meta +11 -11
- package/ITextDisplayerHandler.cs +22 -22
- package/ITextDisplayerHandler.cs.meta +11 -11
- package/OptionsTextMessage.cs +53 -53
- package/OptionsTextMessage.cs.meta +11 -11
- package/OptionsTextSpeedMessage.cs +82 -82
- package/OptionsTextSpeedMessage.cs.meta +11 -11
- package/RegexEscapeModifier.cs +43 -43
- package/RegexEscapeModifier.cs.meta +11 -11
- package/ReplaceGroup.cs +33 -33
- package/ReplaceGroup.cs.meta +11 -11
- package/ReplaceTextModifier.cs +53 -53
- package/ReplaceTextModifier.cs.meta +11 -11
- package/ReplaceTextModifierBase.cs +18 -18
- package/ReplaceTextModifierBase.cs.meta +11 -11
- package/{Samples → Samples~}/CGDialogueUIVisible.asset +21 -21
- package/{Samples → Samples~}/CGDialogueUIVisible.asset.meta +8 -8
- package/{Samples → Samples~}/CGTextBox.asset +21 -21
- package/{Samples → Samples~}/CGTextBox.asset.meta +8 -8
- package/{Samples → Samples~}/CG_Line_Text_Displayer.prefab +147 -147
- package/{Samples → Samples~}/CG_Line_Text_Displayer.prefab.meta +7 -7
- package/{Samples → Samples~}/Clear_Text_On_Line_End.prefab +46 -46
- package/{Samples → Samples~}/Clear_Text_On_Line_End.prefab.meta +7 -7
- package/{Samples → Samples~}/Color_By_Character_Text_Modifier.prefab +51 -51
- package/{Samples → Samples~}/Color_By_Character_Text_Modifier.prefab.meta +7 -7
- package/{Samples → Samples~}/DRE_TextDebugging.unity +492 -492
- package/{Samples → Samples~}/DRE_TextDebugging.unity.meta +7 -7
- package/{Samples → Samples~}/DialogueTextBox.asset +21 -21
- package/{Samples → Samples~}/DialogueTextBox.asset.meta +8 -8
- package/{Samples → Samples~}/Dialogue_Line_Text_Displayer.prefab +142 -142
- package/{Samples → Samples~}/Dialogue_Line_Text_Displayer.prefab.meta +7 -7
- package/{Samples → Samples~}/Highlight_Text_Modifier.prefab +49 -49
- package/{Samples → Samples~}/Highlight_Text_Modifier.prefab.meta +7 -7
- package/{Samples → Samples~}/Option_Message_UI_ETemplate.prefab +335 -335
- package/{Samples → Samples~}/Option_Message_UI_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/OptionsUITextSpeedMessage.asset +21 -21
- package/{Samples → Samples~}/OptionsUITextSpeedMessage.asset.meta +8 -8
- package/{Samples → Samples~}/Regex_Escape_Modifier.prefab +47 -47
- package/{Samples → Samples~}/Regex_Escape_Modifier.prefab.meta +7 -7
- package/{Samples → Samples~}/Replace_Text_Modifier.prefab +49 -49
- package/{Samples → Samples~}/Replace_Text_Modifier.prefab.meta +7 -7
- package/{Samples → Samples~}/Symbol_Color_Text_Modifier.prefab +50 -50
- package/{Samples → Samples~}/Symbol_Color_Text_Modifier.prefab.meta +7 -7
- package/{Samples → Samples~}/Symbol_Protag_UI_Modifier.prefab +48 -48
- package/{Samples → Samples~}/Symbol_Protag_UI_Modifier.prefab.meta +7 -7
- package/{Samples → Samples~}/Text_Display_Debugger.prefab +467 -467
- package/{Samples → Samples~}/Text_Display_Debugger.prefab.meta +7 -7
- package/{Samples → Samples~}/Text_Displayer.prefab +624 -624
- package/{Samples → Samples~}/Text_Displayer.prefab.meta +7 -7
- package/{Samples → Samples~}/TrialDialogueTextBox.asset +21 -21
- package/{Samples → Samples~}/TrialDialogueTextBox.asset.meta +8 -8
- package/{Samples → Samples~}/Trial_Dialogue_Line_Text_Displayer.prefab +82 -82
- package/{Samples → Samples~}/Trial_Dialogue_Line_Text_Displayer.prefab.meta +7 -7
- package/SetTextDisplaySpeed.cs +59 -59
- package/SetTextDisplaySpeed.cs.meta +11 -11
- package/SymbolColorTextModifier.cs +24 -24
- package/SymbolColorTextModifier.cs.meta +11 -11
- package/SymbolProtagUIModifier.cs +41 -41
- package/SymbolProtagUIModifier.cs.meta +11 -11
- package/SymbolTextModifier.cs +47 -47
- package/SymbolTextModifier.cs.meta +11 -11
- package/TMPMarquee.cs +177 -177
- package/TMPMarquee.cs.meta +11 -11
- package/TMPMarqueeBase.cs +103 -103
- package/TMPMarqueeBase.cs.meta +1 -1
- package/TextDisplayDebugger.cs +86 -86
- package/TextDisplayDebugger.cs.meta +11 -11
- package/TextDisplayModifier.cs +28 -28
- package/TextDisplayModifier.cs.meta +11 -11
- package/TextDisplayer.cs +254 -254
- package/TextDisplayer.cs.meta +11 -11
- package/TextDisplayerBase.cs +106 -106
- package/TextDisplayerBase.cs.meta +11 -11
- package/package.json +42 -37
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.EventObjects;
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
|
|
5
|
-
namespace DREditor.TextDisplaying
|
|
6
|
-
{
|
|
7
|
-
/// <summary>
|
|
8
|
-
///
|
|
9
|
-
/// </summary>
|
|
10
|
-
[ClassHeader(nameof(OptionsTextMessage) +
|
|
11
|
-
"\n\n")]
|
|
12
|
-
public class OptionsTextSpeedMessage : OptionsTextMessage
|
|
13
|
-
{
|
|
14
|
-
/// <summary>
|
|
15
|
-
///
|
|
16
|
-
/// </summary>
|
|
17
|
-
[Tooltip("")]
|
|
18
|
-
[SerializeField] protected TextDisplayerBase displayer = null;
|
|
19
|
-
|
|
20
|
-
/// <summary>
|
|
21
|
-
///
|
|
22
|
-
/// </summary>
|
|
23
|
-
[Tooltip("")]
|
|
24
|
-
[SerializeField] protected StringWithEvent[] clearOnMessagesChanged;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/// <inheritdoc/>
|
|
28
|
-
protected override void OnEnable()
|
|
29
|
-
{
|
|
30
|
-
base.OnEnable();
|
|
31
|
-
|
|
32
|
-
foreach (var message in clearOnMessagesChanged)
|
|
33
|
-
message.AddListener(OnOtherMessagesChanged);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/// <inheritdoc/>
|
|
38
|
-
protected override void OnDisable()
|
|
39
|
-
{
|
|
40
|
-
base.OnDisable();
|
|
41
|
-
|
|
42
|
-
foreach (var message in clearOnMessagesChanged)
|
|
43
|
-
message.RemoveListener(OnOtherMessagesChanged);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/// <summary>
|
|
48
|
-
///
|
|
49
|
-
/// </summary>
|
|
50
|
-
/// <param name="message"></param>
|
|
51
|
-
public override void PlayMessage(string message)
|
|
52
|
-
{
|
|
53
|
-
ClearBox();
|
|
54
|
-
|
|
55
|
-
displayer.SetWaitingForClick(true);
|
|
56
|
-
|
|
57
|
-
displayer.DisplayText(box, new Dialogues.Line(message));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/// <summary>
|
|
61
|
-
///
|
|
62
|
-
/// </summary>
|
|
63
|
-
/// <param name="updatedMessage"></param>
|
|
64
|
-
protected virtual void OnOtherMessagesChanged(string updatedMessage)
|
|
65
|
-
{
|
|
66
|
-
displayer.StopAllCoroutines();
|
|
67
|
-
|
|
68
|
-
displayer.ResolveDisplayingText(displayer.GetText());
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/// <summary>
|
|
72
|
-
///
|
|
73
|
-
/// </summary>
|
|
74
|
-
protected override void ClearBox()
|
|
75
|
-
{
|
|
76
|
-
displayer.StopAllCoroutines();
|
|
77
|
-
|
|
78
|
-
displayer.ResolveDisplayingText("");
|
|
79
|
-
|
|
80
|
-
base.ClearBox();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.TextDisplaying
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
[ClassHeader(nameof(OptionsTextMessage) +
|
|
11
|
+
"\n\n")]
|
|
12
|
+
public class OptionsTextSpeedMessage : OptionsTextMessage
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Tooltip("")]
|
|
18
|
+
[SerializeField] protected TextDisplayerBase displayer = null;
|
|
19
|
+
|
|
20
|
+
/// <summary>
|
|
21
|
+
///
|
|
22
|
+
/// </summary>
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
[SerializeField] protected StringWithEvent[] clearOnMessagesChanged;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/// <inheritdoc/>
|
|
28
|
+
protected override void OnEnable()
|
|
29
|
+
{
|
|
30
|
+
base.OnEnable();
|
|
31
|
+
|
|
32
|
+
foreach (var message in clearOnMessagesChanged)
|
|
33
|
+
message.AddListener(OnOtherMessagesChanged);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/// <inheritdoc/>
|
|
38
|
+
protected override void OnDisable()
|
|
39
|
+
{
|
|
40
|
+
base.OnDisable();
|
|
41
|
+
|
|
42
|
+
foreach (var message in clearOnMessagesChanged)
|
|
43
|
+
message.RemoveListener(OnOtherMessagesChanged);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
/// <summary>
|
|
48
|
+
///
|
|
49
|
+
/// </summary>
|
|
50
|
+
/// <param name="message"></param>
|
|
51
|
+
public override void PlayMessage(string message)
|
|
52
|
+
{
|
|
53
|
+
ClearBox();
|
|
54
|
+
|
|
55
|
+
displayer.SetWaitingForClick(true);
|
|
56
|
+
|
|
57
|
+
displayer.DisplayText(box, new Dialogues.Line(message));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/// <summary>
|
|
61
|
+
///
|
|
62
|
+
/// </summary>
|
|
63
|
+
/// <param name="updatedMessage"></param>
|
|
64
|
+
protected virtual void OnOtherMessagesChanged(string updatedMessage)
|
|
65
|
+
{
|
|
66
|
+
displayer.StopAllCoroutines();
|
|
67
|
+
|
|
68
|
+
displayer.ResolveDisplayingText(displayer.GetText());
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/// <summary>
|
|
72
|
+
///
|
|
73
|
+
/// </summary>
|
|
74
|
+
protected override void ClearBox()
|
|
75
|
+
{
|
|
76
|
+
displayer.StopAllCoroutines();
|
|
77
|
+
|
|
78
|
+
displayer.ResolveDisplayingText("");
|
|
79
|
+
|
|
80
|
+
base.ClearBox();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
83
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: db64361ebcbfdf244842568e20ada177
|
|
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: db64361ebcbfdf244842568e20ada177
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/RegexEscapeModifier.cs
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using System.Text.RegularExpressions;
|
|
4
|
-
using TMPro;
|
|
5
|
-
using UnityEngine;
|
|
6
|
-
|
|
7
|
-
namespace DREditor.TextDisplaying
|
|
8
|
-
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
///
|
|
11
|
-
/// </summary>
|
|
12
|
-
[ClassHeader(nameof(TextDisplayModifier) +
|
|
13
|
-
"\n\n")]
|
|
14
|
-
public class RegexEscapeModifier : TextDisplayModifier
|
|
15
|
-
{
|
|
16
|
-
/// <summary>
|
|
17
|
-
///
|
|
18
|
-
/// </summary>
|
|
19
|
-
[Tooltip("")]
|
|
20
|
-
[SerializeField] protected string regexString = @"(?: *)\\(?: *)u(?: *)(.)(?: *)(?: *)(.)(.)(.)";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/// <inheritdoc/>
|
|
24
|
-
public override string ApplyModification(string text, Line currentLine = null, TMP_Text box = null)
|
|
25
|
-
=> ApplyRegex(text);
|
|
26
|
-
|
|
27
|
-
/// <summary>
|
|
28
|
-
///
|
|
29
|
-
/// </summary>
|
|
30
|
-
/// <param name="text"></param>
|
|
31
|
-
/// <returns></returns>
|
|
32
|
-
protected virtual string ApplyRegex(string text)
|
|
33
|
-
{
|
|
34
|
-
Regex reg = new(regexString);
|
|
35
|
-
|
|
36
|
-
MatchCollection m = reg.Matches(text);
|
|
37
|
-
|
|
38
|
-
foreach (Match match in m)
|
|
39
|
-
text = reg.Replace(text, Regex.Unescape(match.Value));
|
|
40
|
-
|
|
41
|
-
return text;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using System.Text.RegularExpressions;
|
|
4
|
+
using TMPro;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.TextDisplaying
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
[ClassHeader(nameof(TextDisplayModifier) +
|
|
13
|
+
"\n\n")]
|
|
14
|
+
public class RegexEscapeModifier : TextDisplayModifier
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[Tooltip("")]
|
|
20
|
+
[SerializeField] protected string regexString = @"(?: *)\\(?: *)u(?: *)(.)(?: *)(?: *)(.)(.)(.)";
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
/// <inheritdoc/>
|
|
24
|
+
public override string ApplyModification(string text, Line currentLine = null, TMP_Text box = null)
|
|
25
|
+
=> ApplyRegex(text);
|
|
26
|
+
|
|
27
|
+
/// <summary>
|
|
28
|
+
///
|
|
29
|
+
/// </summary>
|
|
30
|
+
/// <param name="text"></param>
|
|
31
|
+
/// <returns></returns>
|
|
32
|
+
protected virtual string ApplyRegex(string text)
|
|
33
|
+
{
|
|
34
|
+
Regex reg = new(regexString);
|
|
35
|
+
|
|
36
|
+
MatchCollection m = reg.Matches(text);
|
|
37
|
+
|
|
38
|
+
foreach (Match match in m)
|
|
39
|
+
text = reg.Replace(text, Regex.Unescape(match.Value));
|
|
40
|
+
|
|
41
|
+
return text;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
44
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 315a93035dd0757429d96e433a8ca9c6
|
|
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: 315a93035dd0757429d96e433a8ca9c6
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/ReplaceGroup.cs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using System;
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
|
|
5
|
-
namespace DREditor.TextDisplaying
|
|
6
|
-
{
|
|
7
|
-
/// <summary>
|
|
8
|
-
///
|
|
9
|
-
/// </summary>
|
|
10
|
-
[Serializable]
|
|
11
|
-
public class ReplaceGroup
|
|
12
|
-
{
|
|
13
|
-
public ReplaceGroup() { }
|
|
14
|
-
|
|
15
|
-
public ReplaceGroup(string findValue, string replacedWithValue)
|
|
16
|
-
{
|
|
17
|
-
this.findValue = findValue;
|
|
18
|
-
|
|
19
|
-
this.replacedWithValue = replacedWithValue;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/// <summary>
|
|
23
|
-
///
|
|
24
|
-
/// </summary>
|
|
25
|
-
[Tooltip("")]
|
|
26
|
-
public string findValue;
|
|
27
|
-
|
|
28
|
-
/// <summary>
|
|
29
|
-
///
|
|
30
|
-
/// </summary>
|
|
31
|
-
[Tooltip("")]
|
|
32
|
-
public string replacedWithValue;
|
|
33
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using System;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.TextDisplaying
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
[Serializable]
|
|
11
|
+
public class ReplaceGroup
|
|
12
|
+
{
|
|
13
|
+
public ReplaceGroup() { }
|
|
14
|
+
|
|
15
|
+
public ReplaceGroup(string findValue, string replacedWithValue)
|
|
16
|
+
{
|
|
17
|
+
this.findValue = findValue;
|
|
18
|
+
|
|
19
|
+
this.replacedWithValue = replacedWithValue;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/// <summary>
|
|
23
|
+
///
|
|
24
|
+
/// </summary>
|
|
25
|
+
[Tooltip("")]
|
|
26
|
+
public string findValue;
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
///
|
|
30
|
+
/// </summary>
|
|
31
|
+
[Tooltip("")]
|
|
32
|
+
public string replacedWithValue;
|
|
33
|
+
}
|
|
34
34
|
}
|
package/ReplaceGroup.cs.meta
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: eff06b5a1be5fe545b81fd17d18001c0
|
|
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: eff06b5a1be5fe545b81fd17d18001c0
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/ReplaceTextModifier.cs
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using System.Text.RegularExpressions;
|
|
4
|
-
using TMPro;
|
|
5
|
-
using UnityEngine;
|
|
6
|
-
|
|
7
|
-
namespace DREditor.TextDisplaying
|
|
8
|
-
{
|
|
9
|
-
/// <summary>
|
|
10
|
-
///
|
|
11
|
-
/// </summary>
|
|
12
|
-
[ClassHeader(nameof(ReplaceTextModifierBase<ReplaceGroup>) +
|
|
13
|
-
"\n\n")]
|
|
14
|
-
public class ReplaceTextModifier : ReplaceTextModifierBase<ReplaceGroup>
|
|
15
|
-
{
|
|
16
|
-
/// <inheritdoc/>
|
|
17
|
-
public override string ApplyModification(string text, Line currentLine = null, TMP_Text box = null)
|
|
18
|
-
{
|
|
19
|
-
foreach (var group in replaceGroups)
|
|
20
|
-
text = ReplaceText(text, group);
|
|
21
|
-
|
|
22
|
-
return text;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/// <summary>
|
|
26
|
-
///
|
|
27
|
-
/// </summary>
|
|
28
|
-
/// <param name="text"></param>
|
|
29
|
-
/// <param name="group"></param>
|
|
30
|
-
/// <returns></returns>
|
|
31
|
-
protected virtual string ReplaceText(string text, ReplaceGroup group)
|
|
32
|
-
{
|
|
33
|
-
string findValue = CastUnicode(group.findValue);
|
|
34
|
-
|
|
35
|
-
string replacedWithValue = CastUnicode(group.replacedWithValue);
|
|
36
|
-
|
|
37
|
-
return text.Replace(findValue, replacedWithValue);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/// <summary>
|
|
41
|
-
///
|
|
42
|
-
/// </summary>
|
|
43
|
-
/// <param name="text"></param>
|
|
44
|
-
/// <returns></returns>
|
|
45
|
-
protected virtual string CastUnicode(string text) => text.Contains("\\") ? Regex.Unescape(text) : text;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/// <summary>
|
|
49
|
-
///
|
|
50
|
-
/// </summary>
|
|
51
|
-
[ContextMenu("Add Replace Carriage")]
|
|
52
|
-
public virtual void AddReplaceCarriage() => replaceGroups.Add(new ReplaceGroup("\\r", ""));
|
|
53
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using System.Text.RegularExpressions;
|
|
4
|
+
using TMPro;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.TextDisplaying
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
[ClassHeader(nameof(ReplaceTextModifierBase<ReplaceGroup>) +
|
|
13
|
+
"\n\n")]
|
|
14
|
+
public class ReplaceTextModifier : ReplaceTextModifierBase<ReplaceGroup>
|
|
15
|
+
{
|
|
16
|
+
/// <inheritdoc/>
|
|
17
|
+
public override string ApplyModification(string text, Line currentLine = null, TMP_Text box = null)
|
|
18
|
+
{
|
|
19
|
+
foreach (var group in replaceGroups)
|
|
20
|
+
text = ReplaceText(text, group);
|
|
21
|
+
|
|
22
|
+
return text;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
///
|
|
27
|
+
/// </summary>
|
|
28
|
+
/// <param name="text"></param>
|
|
29
|
+
/// <param name="group"></param>
|
|
30
|
+
/// <returns></returns>
|
|
31
|
+
protected virtual string ReplaceText(string text, ReplaceGroup group)
|
|
32
|
+
{
|
|
33
|
+
string findValue = CastUnicode(group.findValue);
|
|
34
|
+
|
|
35
|
+
string replacedWithValue = CastUnicode(group.replacedWithValue);
|
|
36
|
+
|
|
37
|
+
return text.Replace(findValue, replacedWithValue);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// <summary>
|
|
41
|
+
///
|
|
42
|
+
/// </summary>
|
|
43
|
+
/// <param name="text"></param>
|
|
44
|
+
/// <returns></returns>
|
|
45
|
+
protected virtual string CastUnicode(string text) => text.Contains("\\") ? Regex.Unescape(text) : text;
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/// <summary>
|
|
49
|
+
///
|
|
50
|
+
/// </summary>
|
|
51
|
+
[ContextMenu("Add Replace Carriage")]
|
|
52
|
+
public virtual void AddReplaceCarriage() => replaceGroups.Add(new ReplaceGroup("\\r", ""));
|
|
53
|
+
}
|
|
54
54
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: e7d32bf6de5264941bf3ae37fbdbdfba
|
|
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: e7d32bf6de5264941bf3ae37fbdbdfba
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using System.Collections.Generic;
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
|
|
5
|
-
namespace DREditor.TextDisplaying
|
|
6
|
-
{
|
|
7
|
-
/// <summary>
|
|
8
|
-
///
|
|
9
|
-
/// </summary>
|
|
10
|
-
/// <typeparam name="T"></typeparam>
|
|
11
|
-
public abstract class ReplaceTextModifierBase<T> : TextDisplayModifier where T : ReplaceGroup
|
|
12
|
-
{
|
|
13
|
-
/// <summary>
|
|
14
|
-
///
|
|
15
|
-
/// </summary>
|
|
16
|
-
[Tooltip("")]
|
|
17
|
-
[SerializeField] protected List<T> replaceGroups = new();
|
|
18
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using System.Collections.Generic;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.TextDisplaying
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
/// <typeparam name="T"></typeparam>
|
|
11
|
+
public abstract class ReplaceTextModifierBase<T> : TextDisplayModifier where T : ReplaceGroup
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
[Tooltip("")]
|
|
17
|
+
[SerializeField] protected List<T> replaceGroups = new();
|
|
18
|
+
}
|
|
19
19
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: a7c4f1dc7ebf6bb41808d93e3352dbe3
|
|
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: a7c4f1dc7ebf6bb41808d93e3352dbe3
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
%YAML 1.1
|
|
2
|
-
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
-
--- !u!114 &11400000
|
|
4
|
-
MonoBehaviour:
|
|
5
|
-
m_ObjectHideFlags: 0
|
|
6
|
-
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
-
m_PrefabInstance: {fileID: 0}
|
|
8
|
-
m_PrefabAsset: {fileID: 0}
|
|
9
|
-
m_GameObject: {fileID: 0}
|
|
10
|
-
m_Enabled: 1
|
|
11
|
-
m_EditorHideFlags: 0
|
|
12
|
-
m_Script: {fileID: 11500000, guid: ba8f98926693a40d88c7ad327c8a8f3b, type: 3}
|
|
13
|
-
m_Name: CGDialogueUIVisible
|
|
14
|
-
m_EditorClassIdentifier:
|
|
15
|
-
debug: 0
|
|
16
|
-
alwaysInvokeOnSetValue: 1
|
|
17
|
-
OnChange:
|
|
18
|
-
m_PersistentCalls:
|
|
19
|
-
m_Calls: []
|
|
20
|
-
InitialValue: 0
|
|
21
|
-
_value: 0
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!114 &11400000
|
|
4
|
+
MonoBehaviour:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
m_GameObject: {fileID: 0}
|
|
10
|
+
m_Enabled: 1
|
|
11
|
+
m_EditorHideFlags: 0
|
|
12
|
+
m_Script: {fileID: 11500000, guid: ba8f98926693a40d88c7ad327c8a8f3b, type: 3}
|
|
13
|
+
m_Name: CGDialogueUIVisible
|
|
14
|
+
m_EditorClassIdentifier:
|
|
15
|
+
debug: 0
|
|
16
|
+
alwaysInvokeOnSetValue: 1
|
|
17
|
+
OnChange:
|
|
18
|
+
m_PersistentCalls:
|
|
19
|
+
m_Calls: []
|
|
20
|
+
InitialValue: 0
|
|
21
|
+
_value: 0
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 719cad2fddc902a4aa9cbbec187bc8ba
|
|
3
|
-
NativeFormatImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
mainObjectFileID: 11400000
|
|
6
|
-
userData:
|
|
7
|
-
assetBundleName:
|
|
8
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 719cad2fddc902a4aa9cbbec187bc8ba
|
|
3
|
+
NativeFormatImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
mainObjectFileID: 11400000
|
|
6
|
+
userData:
|
|
7
|
+
assetBundleName:
|
|
8
|
+
assetBundleVariant:
|