net.dreditor.backlog 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.
Binary file
package/BacklogHandler.cs CHANGED
@@ -1,53 +1,53 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues;
3
- using DREditor.Saving;
4
- using System.Collections.Generic;
5
- using UnityEngine;
6
-
7
- namespace DREditor.Backlogging
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [ClassHeader("")]
13
- public class BacklogHandler : BacklogHandlerBase, IDRESaveable, IDRELoadable
14
- {
15
- /// <summary>
16
- ///
17
- /// </summary>
18
- [Tooltip("")]
19
- [SerializeField] protected Backlog backlog = null;
20
-
21
- /// <summary>
22
- ///
23
- /// </summary>
24
- [Tooltip("")]
25
- [SerializeField] protected string dataSaveKey = "BackData";
26
-
27
-
28
- /// <inheritdoc/>
29
- public override object[] GetBacklogLines() => backlog.GetLinesArray();
30
-
31
- /// <inheritdoc/>
32
- public override void ClearLines() => backlog.Lines.Clear();
33
-
34
- /// <inheritdoc/>
35
- public override void AddLine(object o = null)
36
- {
37
- if (o != null && o is BacklogLines line)
38
- backlog.AddLine(line.Charfile, line.Text, line.AliasNum, line.Color, line.Voice);
39
- }
40
-
41
- /// <inheritdoc/>
42
- public override object SaveBacklog() => backlog.Save();
43
-
44
- /// <inheritdoc/>
45
- public override void LoadBacklog(object o = null) => backlog.Load((BacklogData)o);
46
-
47
- /// <inheritdoc/>
48
- public virtual void Save(Dictionary<string, object> saveData) => saveData.Set(dataSaveKey, (BacklogData)SaveBacklog());
49
-
50
- /// <inheritdoc/>
51
- public virtual void Load(Dictionary<string, object> saveDatas) => LoadBacklog(saveDatas.Get<BacklogData>(dataSaveKey));
52
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using DREditor.Saving;
4
+ using System.Collections.Generic;
5
+ using UnityEngine;
6
+
7
+ namespace DREditor.Backlogging
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [ClassHeader("")]
13
+ public class BacklogHandler : BacklogHandlerBase, IDRESaveable, IDRELoadable
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [Tooltip("")]
19
+ [SerializeField] protected Backlog backlog = null;
20
+
21
+ /// <summary>
22
+ ///
23
+ /// </summary>
24
+ [Tooltip("")]
25
+ [SerializeField] protected string dataSaveKey = "BackData";
26
+
27
+
28
+ /// <inheritdoc/>
29
+ public override object[] GetBacklogLines() => backlog.GetLinesArray();
30
+
31
+ /// <inheritdoc/>
32
+ public override void ClearLines() => backlog.Lines.Clear();
33
+
34
+ /// <inheritdoc/>
35
+ public override void AddLine(object o = null)
36
+ {
37
+ if (o != null && o is BacklogLines line)
38
+ backlog.AddLine(line.Charfile, line.Text, line.AliasNum, line.Color, line.Voice);
39
+ }
40
+
41
+ /// <inheritdoc/>
42
+ public override object SaveBacklog() => backlog.Save();
43
+
44
+ /// <inheritdoc/>
45
+ public override void LoadBacklog(object o = null) => backlog.Load((BacklogData)o);
46
+
47
+ /// <inheritdoc/>
48
+ public virtual void Save(Dictionary<string, object> saveData) => saveData.Set(dataSaveKey, (BacklogData)SaveBacklog());
49
+
50
+ /// <inheritdoc/>
51
+ public virtual void Load(Dictionary<string, object> saveDatas) => LoadBacklog(saveDatas.Get<BacklogData>(dataSaveKey));
52
+ }
53
53
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 4a27659b646b46a4eae71455b1dbc54c
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: 4a27659b646b46a4eae71455b1dbc54c
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,93 +1,93 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.EventObjects;
3
- using DREditor.Services;
4
- using UnityEngine;
5
-
6
- namespace DREditor.Backlogging
7
- {
8
- /// <summary>
9
- ///
10
- /// </summary>
11
- public abstract class BacklogHandlerBase : MonoBehaviour, ISceneEventListener
12
- {
13
- /// <summary>
14
- ///
15
- /// </summary>
16
- [Header("")]
17
- [Divider]
18
- [Tooltip("")]
19
- [SerializeField] protected SceneEvent startedNewGame = null;
20
-
21
-
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- protected virtual void OnEnable()
26
- {
27
- RegisterThisService();
28
-
29
- startedNewGame.RegisterListener(this);
30
- }
31
-
32
- /// <summary>
33
- ///
34
- /// </summary>
35
- protected virtual void OnDisable()
36
- {
37
- UnregisterThisService();
38
-
39
- startedNewGame.UnregisterListener(this);
40
- }
41
-
42
- /// <summary>
43
- ///
44
- /// </summary>
45
- protected virtual void RegisterThisService()
46
- {
47
- if (!ServiceLocator.HasService<BacklogHandlerBase>())
48
- ServiceLocator.Register(this);
49
- }
50
-
51
- /// <summary>
52
- ///
53
- /// </summary>
54
- protected virtual void UnregisterThisService()
55
- {
56
- if (ServiceLocator.GetService<BacklogHandlerBase>() == this)
57
- ServiceLocator.Unregister(this);
58
- }
59
-
60
- /// <summary>
61
- ///
62
- /// </summary>
63
- /// <returns></returns>
64
- public abstract object[] GetBacklogLines();
65
-
66
- /// <summary>
67
- ///
68
- /// </summary>
69
- public abstract void ClearLines();
70
-
71
- /// <summary>
72
- ///
73
- /// </summary>
74
- /// <param name="o"></param>
75
- public abstract void AddLine(object o = null);
76
-
77
- /// <summary>
78
- ///
79
- /// </summary>
80
- /// <returns></returns>
81
- public abstract object SaveBacklog();
82
-
83
- /// <summary>
84
- ///
85
- /// </summary>
86
- /// <param name="o"></param>
87
- public abstract void LoadBacklog(object o = null);
88
-
89
-
90
- /// <inheritdoc/>
91
- public virtual void OnEventRaised() => ClearLines();
92
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.EventObjects;
3
+ using DREditor.Services;
4
+ using UnityEngine;
5
+
6
+ namespace DREditor.Backlogging
7
+ {
8
+ /// <summary>
9
+ ///
10
+ /// </summary>
11
+ public abstract class BacklogHandlerBase : MonoBehaviour, ISceneEventListener
12
+ {
13
+ /// <summary>
14
+ ///
15
+ /// </summary>
16
+ [Header("")]
17
+ [Divider]
18
+ [Tooltip("")]
19
+ [SerializeField] protected SceneEvent startedNewGame = null;
20
+
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ protected virtual void OnEnable()
26
+ {
27
+ RegisterThisService();
28
+
29
+ startedNewGame.RegisterListener(this);
30
+ }
31
+
32
+ /// <summary>
33
+ ///
34
+ /// </summary>
35
+ protected virtual void OnDisable()
36
+ {
37
+ UnregisterThisService();
38
+
39
+ startedNewGame.UnregisterListener(this);
40
+ }
41
+
42
+ /// <summary>
43
+ ///
44
+ /// </summary>
45
+ protected virtual void RegisterThisService()
46
+ {
47
+ if (!ServiceLocator.HasService<BacklogHandlerBase>())
48
+ ServiceLocator.Register(this);
49
+ }
50
+
51
+ /// <summary>
52
+ ///
53
+ /// </summary>
54
+ protected virtual void UnregisterThisService()
55
+ {
56
+ if (ServiceLocator.GetService<BacklogHandlerBase>() == this)
57
+ ServiceLocator.Unregister(this);
58
+ }
59
+
60
+ /// <summary>
61
+ ///
62
+ /// </summary>
63
+ /// <returns></returns>
64
+ public abstract object[] GetBacklogLines();
65
+
66
+ /// <summary>
67
+ ///
68
+ /// </summary>
69
+ public abstract void ClearLines();
70
+
71
+ /// <summary>
72
+ ///
73
+ /// </summary>
74
+ /// <param name="o"></param>
75
+ public abstract void AddLine(object o = null);
76
+
77
+ /// <summary>
78
+ ///
79
+ /// </summary>
80
+ /// <returns></returns>
81
+ public abstract object SaveBacklog();
82
+
83
+ /// <summary>
84
+ ///
85
+ /// </summary>
86
+ /// <param name="o"></param>
87
+ public abstract void LoadBacklog(object o = null);
88
+
89
+
90
+ /// <inheritdoc/>
91
+ public virtual void OnEventRaised() => ClearLines();
92
+ }
93
93
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 71438e3b7ae94a642ade28b22d295334
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: 71438e3b7ae94a642ade28b22d295334
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,47 +1,47 @@
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 DREditor.TextDisplaying;
6
-
7
- namespace DREditor.Backlogging
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [ClassHeader(nameof(ILineEndProcess) +
13
- "\n\n")]
14
- public class BacklogLineHandler : DialogueComponent, ILineEndProcess
15
- {
16
- /// <inheritdoc/>
17
- public virtual void LineEndProcess(Line currentLine) => AddLineToBacklog(currentLine);
18
-
19
- /// <summary>
20
- ///
21
- /// </summary>
22
- /// <param name="currentLine"></param>
23
- protected virtual void AddLineToBacklog(Line currentLine)
24
- {
25
- if (currentLine.Speaker != null)
26
- ServiceLocator.GetService<BacklogHandlerBase>().AddLine(CreateBacklogLine(currentLine));
27
- }
28
-
29
- /// <summary>
30
- ///
31
- /// </summary>
32
- /// <param name="currentLine"></param>
33
- /// <returns></returns>
34
- protected virtual BacklogLines CreateBacklogLine(Line currentLine) =>
35
- new(
36
- currentLine.Speaker,
37
- ServiceLocator.GetService<ITextDisplayerHandler>().GetTextBox().text,
38
- currentLine.AliasNumber - 1,
39
- #if FMOD_UNITY
40
- currentLine.VoiceSFX,
41
- #else
42
- currentLine.VoiceSFX.name,
43
- #endif
44
- ServiceLocator.GetService<ITextDisplayerHandler>().GetTextBox().color
45
- );
46
- }
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 DREditor.TextDisplaying;
6
+
7
+ namespace DREditor.Backlogging
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [ClassHeader(nameof(ILineEndProcess) +
13
+ "\n\n")]
14
+ public class BacklogLineHandler : DialogueComponent, ILineEndProcess
15
+ {
16
+ /// <inheritdoc/>
17
+ public virtual void LineEndProcess(Line currentLine) => AddLineToBacklog(currentLine);
18
+
19
+ /// <summary>
20
+ ///
21
+ /// </summary>
22
+ /// <param name="currentLine"></param>
23
+ protected virtual void AddLineToBacklog(Line currentLine)
24
+ {
25
+ if (currentLine.Speaker != null)
26
+ ServiceLocator.GetService<BacklogHandlerBase>().AddLine(CreateBacklogLine(currentLine));
27
+ }
28
+
29
+ /// <summary>
30
+ ///
31
+ /// </summary>
32
+ /// <param name="currentLine"></param>
33
+ /// <returns></returns>
34
+ protected virtual BacklogLines CreateBacklogLine(Line currentLine) =>
35
+ new(
36
+ currentLine.Speaker,
37
+ ServiceLocator.GetService<ITextDisplayerHandler>().GetTextBox().text,
38
+ currentLine.AliasNumber - 1,
39
+ #if FMOD_UNITY
40
+ currentLine.VoiceSFX,
41
+ #else
42
+ currentLine.VoiceSFX.name,
43
+ #endif
44
+ ServiceLocator.GetService<ITextDisplayerHandler>().GetTextBox().color
45
+ );
46
+ }
47
47
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: c9d18d42d87b29145bd97a1f8b3b1735
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: c9d18d42d87b29145bd97a1f8b3b1735
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: