net.dreditor.ui.savingloading 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.
Files changed (38) hide show
  1. package/.attestation.p7m +0 -0
  2. package/DREditor.UI.SavingLoading.asmdef +22 -22
  3. package/DREditor.UI.SavingLoading.asmdef.meta +7 -7
  4. package/PostSavePoint.cs +57 -57
  5. package/PostSavePoint.cs.meta +11 -11
  6. package/ReturnToMenuOnPauseMenu.cs +113 -113
  7. package/ReturnToMenuOnPauseMenu.cs.meta +11 -11
  8. package/{Samples → Samples~}/DRE_SavePoint.unity +262 -262
  9. package/{Samples → Samples~}/DRE_SavePoint.unity.meta +7 -7
  10. package/{Samples → Samples~}/Save_Point_Canvas_Shell.prefab +169 -169
  11. package/{Samples → Samples~}/Save_Point_Canvas_Shell.prefab.meta +7 -7
  12. package/{Samples → Samples~}/Save_Point_Canvas_Template.prefab +563 -563
  13. package/{Samples → Samples~}/Save_Point_Canvas_Template.prefab.meta +7 -7
  14. package/{Samples → Samples~}/Save_Point_System_Template.prefab +1434 -1434
  15. package/{Samples → Samples~}/Save_Point_System_Template.prefab.meta +7 -7
  16. package/SaveDataDisplayerBase.cs +24 -24
  17. package/SaveDataDisplayerBase.cs.meta +11 -11
  18. package/SaveDateDisplayer.cs +146 -146
  19. package/SaveDateDisplayer.cs.meta +11 -11
  20. package/SaveLoadMenu.cs +298 -298
  21. package/SaveLoadMenu.cs.meta +11 -11
  22. package/SaveLoadMenuBase.cs +122 -122
  23. package/SaveLoadMenuBase.cs.meta +11 -11
  24. package/SavePointUI.cs +239 -239
  25. package/SavePointUI.cs.meta +11 -11
  26. package/SavePointUIBase.cs +134 -134
  27. package/SavePointUIBase.cs.meta +11 -11
  28. package/SavePointUIGameState.cs +120 -120
  29. package/SavePointUIGameState.cs.meta +11 -11
  30. package/SaveSlot.cs +81 -81
  31. package/SaveSlot.cs.meta +11 -11
  32. package/SaveSlotBase.cs +99 -99
  33. package/SaveSlotBase.cs.meta +11 -11
  34. package/SaveTitleDisplayer.cs +204 -204
  35. package/SaveTitleDisplayer.cs.meta +11 -11
  36. package/package.json +46 -41
  37. package/package.json.meta +7 -7
  38. package/Samples.meta +0 -8
package/SavePointUI.cs CHANGED
@@ -1,240 +1,240 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues.Events;
3
- using DREditor.EventObjects;
4
- using DREditor.Fading;
5
- using DREditor.RoomLoading;
6
- using DREditor.Services;
7
- using System.Collections;
8
- using System.Collections.Generic;
9
- using System.Linq;
10
- using UnityEngine;
11
- using UnityEngine.SceneManagement;
12
-
13
- namespace DREditor.UI.SavingLoading
14
- {
15
- /// <summary>
16
- ///
17
- /// </summary>
18
- [ClassHeader(nameof(SavePointUIBase) + ", " + nameof(SceneEventListener) +
19
- "\n\n")]
20
- public class SavePointUI : SavePointUIBase
21
- {
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- [Tooltip("")]
26
- [SerializeField] protected BoolWithEvent inTrialMode = null;
27
-
28
- /// <summary>
29
- ///
30
- /// </summary>
31
- [Tooltip("")]
32
- [SerializeField] protected BoolWithEvent requiredFlagsTriggered = null;
33
-
34
- /// <summary>
35
- ///
36
- /// </summary>
37
- [Tooltip("")]
38
- [SerializeField] protected BoolWithEvent inDialogue = null;
39
-
40
- /// <summary>
41
- ///
42
- /// </summary>
43
- [Tooltip("")]
44
- [SerializeField] protected BoolWithEvent playHideDialogueSFX = null;
45
-
46
- /// <summary>
47
- ///
48
- /// </summary>
49
- [Tooltip("")]
50
- [SerializeField] protected BoolWithEvent threeDUIVisible = null;
51
-
52
- /// <summary>
53
- ///
54
- /// </summary>
55
- [Tooltip("")]
56
- [SerializeField] protected BoolWithEvent hasMenuAccess = null;
57
-
58
- /// <summary>
59
- ///
60
- /// </summary>
61
- [Tooltip("")]
62
- [SerializeField] protected BoolWithEvent inLeaveProcess = null;
63
-
64
-
65
- /// <summary>
66
- ///
67
- /// </summary>
68
- [Header("")]
69
- [Divider]
70
- [Tooltip("")]
71
- [SerializeField] protected SceneEvent moveToNextNaturalObjective = null;
72
-
73
- /// <summary>
74
- ///
75
- /// </summary>
76
- [Tooltip("")]
77
- [SerializeField] protected StringWithEvent currentObjectiveName = null;
78
-
79
- /// <summary>
80
- ///
81
- /// </summary>
82
- [Tooltip("")]
83
- [SerializeField] protected IntWithEvent currentAddState = null;
84
-
85
-
86
- /// <summary>
87
- ///
88
- /// </summary>
89
- [Header("")]
90
- [Divider]
91
- [Tooltip("")]
92
- [SerializeField] protected float delayLoadPointDuration = 0;
93
-
94
- /// <summary>
95
- ///
96
- /// </summary>
97
- [Tooltip("")]
98
- [SerializeField] protected float fadeToPointDuration = 0;
99
-
100
-
101
- /// <summary>
102
- ///
103
- /// </summary>
104
- [Header("")]
105
- [Divider]
106
- [Tooltip("")]
107
- [SerializeField] protected PostSavePoint[] savePoints;
108
-
109
-
110
- /// <summary>
111
- ///
112
- /// </summary>
113
- protected readonly Dictionary<string, string> scenePoints = new();
114
-
115
-
116
- protected virtual void Awake() => InitializeSavePointDictionary();
117
-
118
- /// <inheritdoc/>
119
- protected override void OnEnable()
120
- {
121
- base.OnEnable();
122
-
123
- hasMenuAccess.SetValue(false);
124
- }
125
-
126
- /// <summary>
127
- ///
128
- /// </summary>
129
- protected virtual void InitializeSavePointDictionary()
130
- {
131
- foreach (PostSavePoint savePoint in savePoints)
132
- scenePoints.TryAdd(savePoint.objective, savePoint.scene);
133
- }
134
-
135
-
136
- /// <inheritdoc/>
137
- protected override void ShowSavePointUI()
138
- {
139
- if (inDialogue.Value)
140
- StartCoroutine(WaitForDialogueToFinish());
141
- else
142
- base.ShowSavePointUI();
143
- }
144
-
145
- /// <summary>
146
- ///
147
- /// </summary>
148
- protected virtual IEnumerator WaitForDialogueToFinish()
149
- {
150
- playHideDialogueSFX.SetValue(false);
151
-
152
- yield return new WaitUntil(() => !inDialogue.Value);
153
-
154
- playHideDialogueSFX.SetValue(true);
155
-
156
- threeDUIVisible.SetValue(false);
157
-
158
- savePointGroup.Show();
159
- }
160
-
161
-
162
- /// <inheritdoc/>
163
- protected override void StartSavePointTransition() => StartCoroutine(BufferLoadSavePoint());
164
-
165
- /// <summary>
166
- ///
167
- /// </summary>
168
- protected virtual IEnumerator BufferLoadSavePoint()
169
- {
170
- yield return new WaitForSeconds(delayLoadPointDuration);
171
-
172
- if (ServiceLocator.HasService<GlobalFade>())
173
- ServiceLocator.GetService<GlobalFade>().FadeTo(fadeToPointDuration);
174
-
175
- ExecuteValidSavePoint();
176
- }
177
-
178
- /// <inheritdoc/>
179
- protected override bool SavePointIsValid() => scenePoints.ContainsKey(currentObjectiveName.Value);
180
-
181
- /// <inheritdoc/>
182
- protected override void LoadSavePoint()
183
- {
184
- if (SceneManager.GetActiveScene().name == scenePoints[currentObjectiveName.Value])
185
- return;
186
-
187
- string savePointObjective = currentObjectiveName.Value;
188
-
189
- ExecuteSavePointSettings();
190
-
191
- LoadScene(scenePoints[savePointObjective]);
192
- }
193
-
194
- /// <summary>
195
- ///
196
- /// </summary>
197
- protected virtual void ExecuteSavePointSettings()
198
- {
199
- PostSavePoint savePoint = savePoints.Where(n => n.objective == currentObjectiveName.Value).FirstOrDefault();
200
-
201
- if (savePoint == null)
202
- return;
203
-
204
- if (inTrialMode.Value)
205
- savePoint.mode.SetValue(true);
206
-
207
- if (savePoint.changeObjective && requiredFlagsTriggered.Value)
208
- moveToNextNaturalObjective.Raise();
209
-
210
- if (savePoint.dialogueEvent != "")
211
- DialogueEventSystem.TriggerEvent(savePoint.dialogueEvent);
212
-
213
- if (savePoint.roomLoadingOptions != null)
214
- ServiceLocator.GetService<RoomChangerBase>().SetOptions(savePoint.roomLoadingOptions);
215
-
216
- currentAddState.SetValue(savePoint.addstate);
217
-
218
- inLeaveProcess.SetValue(true);
219
-
220
- hasMenuAccess.SetValue(true);
221
- }
222
-
223
- /// <summary>
224
- ///
225
- /// </summary>
226
- /// <param name="scene"></param>
227
- protected virtual void LoadScene(string scene)
228
- {
229
- if (SceneManager.GetActiveScene().name == scene)
230
- return;
231
-
232
- UnityEngine.Debug.LogWarning("REPORT: CHANGING SCENE.");
233
-
234
- if (!isLoadingFile.Value)
235
- ServiceLocator.GetService<GlobalFade>().FadeTo(fadeToPointDuration);
236
-
237
- SceneManager.LoadSceneAsync(scene);
238
- }
239
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues.Events;
3
+ using DREditor.EventObjects;
4
+ using DREditor.Fading;
5
+ using DREditor.RoomLoading;
6
+ using DREditor.Services;
7
+ using System.Collections;
8
+ using System.Collections.Generic;
9
+ using System.Linq;
10
+ using UnityEngine;
11
+ using UnityEngine.SceneManagement;
12
+
13
+ namespace DREditor.UI.SavingLoading
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [ClassHeader(nameof(SavePointUIBase) + ", " + nameof(SceneEventListener) +
19
+ "\n\n")]
20
+ public class SavePointUI : SavePointUIBase
21
+ {
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Tooltip("")]
26
+ [SerializeField] protected BoolWithEvent inTrialMode = null;
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ [Tooltip("")]
32
+ [SerializeField] protected BoolWithEvent requiredFlagsTriggered = null;
33
+
34
+ /// <summary>
35
+ ///
36
+ /// </summary>
37
+ [Tooltip("")]
38
+ [SerializeField] protected BoolWithEvent inDialogue = null;
39
+
40
+ /// <summary>
41
+ ///
42
+ /// </summary>
43
+ [Tooltip("")]
44
+ [SerializeField] protected BoolWithEvent playHideDialogueSFX = null;
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ [Tooltip("")]
50
+ [SerializeField] protected BoolWithEvent threeDUIVisible = null;
51
+
52
+ /// <summary>
53
+ ///
54
+ /// </summary>
55
+ [Tooltip("")]
56
+ [SerializeField] protected BoolWithEvent hasMenuAccess = null;
57
+
58
+ /// <summary>
59
+ ///
60
+ /// </summary>
61
+ [Tooltip("")]
62
+ [SerializeField] protected BoolWithEvent inLeaveProcess = null;
63
+
64
+
65
+ /// <summary>
66
+ ///
67
+ /// </summary>
68
+ [Header("")]
69
+ [Divider]
70
+ [Tooltip("")]
71
+ [SerializeField] protected SceneEvent moveToNextNaturalObjective = null;
72
+
73
+ /// <summary>
74
+ ///
75
+ /// </summary>
76
+ [Tooltip("")]
77
+ [SerializeField] protected StringWithEvent currentObjectiveName = null;
78
+
79
+ /// <summary>
80
+ ///
81
+ /// </summary>
82
+ [Tooltip("")]
83
+ [SerializeField] protected IntWithEvent currentAddState = null;
84
+
85
+
86
+ /// <summary>
87
+ ///
88
+ /// </summary>
89
+ [Header("")]
90
+ [Divider]
91
+ [Tooltip("")]
92
+ [SerializeField] protected float delayLoadPointDuration = 0;
93
+
94
+ /// <summary>
95
+ ///
96
+ /// </summary>
97
+ [Tooltip("")]
98
+ [SerializeField] protected float fadeToPointDuration = 0;
99
+
100
+
101
+ /// <summary>
102
+ ///
103
+ /// </summary>
104
+ [Header("")]
105
+ [Divider]
106
+ [Tooltip("")]
107
+ [SerializeField] protected PostSavePoint[] savePoints;
108
+
109
+
110
+ /// <summary>
111
+ ///
112
+ /// </summary>
113
+ protected readonly Dictionary<string, string> scenePoints = new();
114
+
115
+
116
+ protected virtual void Awake() => InitializeSavePointDictionary();
117
+
118
+ /// <inheritdoc/>
119
+ protected override void OnEnable()
120
+ {
121
+ base.OnEnable();
122
+
123
+ hasMenuAccess.SetValue(false);
124
+ }
125
+
126
+ /// <summary>
127
+ ///
128
+ /// </summary>
129
+ protected virtual void InitializeSavePointDictionary()
130
+ {
131
+ foreach (PostSavePoint savePoint in savePoints)
132
+ scenePoints.TryAdd(savePoint.objective, savePoint.scene);
133
+ }
134
+
135
+
136
+ /// <inheritdoc/>
137
+ protected override void ShowSavePointUI()
138
+ {
139
+ if (inDialogue.Value)
140
+ StartCoroutine(WaitForDialogueToFinish());
141
+ else
142
+ base.ShowSavePointUI();
143
+ }
144
+
145
+ /// <summary>
146
+ ///
147
+ /// </summary>
148
+ protected virtual IEnumerator WaitForDialogueToFinish()
149
+ {
150
+ playHideDialogueSFX.SetValue(false);
151
+
152
+ yield return new WaitUntil(() => !inDialogue.Value);
153
+
154
+ playHideDialogueSFX.SetValue(true);
155
+
156
+ threeDUIVisible.SetValue(false);
157
+
158
+ savePointGroup.Show();
159
+ }
160
+
161
+
162
+ /// <inheritdoc/>
163
+ protected override void StartSavePointTransition() => StartCoroutine(BufferLoadSavePoint());
164
+
165
+ /// <summary>
166
+ ///
167
+ /// </summary>
168
+ protected virtual IEnumerator BufferLoadSavePoint()
169
+ {
170
+ yield return new WaitForSeconds(delayLoadPointDuration);
171
+
172
+ if (ServiceLocator.HasService<GlobalFade>())
173
+ ServiceLocator.GetService<GlobalFade>().FadeTo(fadeToPointDuration);
174
+
175
+ ExecuteValidSavePoint();
176
+ }
177
+
178
+ /// <inheritdoc/>
179
+ protected override bool SavePointIsValid() => scenePoints.ContainsKey(currentObjectiveName.Value);
180
+
181
+ /// <inheritdoc/>
182
+ protected override void LoadSavePoint()
183
+ {
184
+ if (SceneManager.GetActiveScene().name == scenePoints[currentObjectiveName.Value])
185
+ return;
186
+
187
+ string savePointObjective = currentObjectiveName.Value;
188
+
189
+ ExecuteSavePointSettings();
190
+
191
+ LoadScene(scenePoints[savePointObjective]);
192
+ }
193
+
194
+ /// <summary>
195
+ ///
196
+ /// </summary>
197
+ protected virtual void ExecuteSavePointSettings()
198
+ {
199
+ PostSavePoint savePoint = savePoints.Where(n => n.objective == currentObjectiveName.Value).FirstOrDefault();
200
+
201
+ if (savePoint == null)
202
+ return;
203
+
204
+ if (inTrialMode.Value)
205
+ savePoint.mode.SetValue(true);
206
+
207
+ if (savePoint.changeObjective && requiredFlagsTriggered.Value)
208
+ moveToNextNaturalObjective.Raise();
209
+
210
+ if (savePoint.dialogueEvent != "")
211
+ DialogueEventSystem.TriggerEvent(savePoint.dialogueEvent);
212
+
213
+ if (savePoint.roomLoadingOptions != null)
214
+ ServiceLocator.GetService<RoomChangerBase>().SetOptions(savePoint.roomLoadingOptions);
215
+
216
+ currentAddState.SetValue(savePoint.addstate);
217
+
218
+ inLeaveProcess.SetValue(true);
219
+
220
+ hasMenuAccess.SetValue(true);
221
+ }
222
+
223
+ /// <summary>
224
+ ///
225
+ /// </summary>
226
+ /// <param name="scene"></param>
227
+ protected virtual void LoadScene(string scene)
228
+ {
229
+ if (SceneManager.GetActiveScene().name == scene)
230
+ return;
231
+
232
+ UnityEngine.Debug.LogWarning("REPORT: CHANGING SCENE.");
233
+
234
+ if (!isLoadingFile.Value)
235
+ ServiceLocator.GetService<GlobalFade>().FadeTo(fadeToPointDuration);
236
+
237
+ SceneManager.LoadSceneAsync(scene);
238
+ }
239
+ }
240
240
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 9ede2860c4bd625448391b27d3dc7f5a
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: 9ede2860c4bd625448391b27d3dc7f5a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: