net.dreditor.roomloading 0.0.0-stage → 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/CheckThreeDModeDuringLoad.cs +64 -0
- package/CheckThreeDModeDuringLoad.cs.meta +11 -0
- package/DRERoomTransition.cs +116 -0
- package/DRERoomTransition.cs.meta +11 -0
- package/DREStartAloneScene.cs +179 -0
- package/DREStartAloneScene.cs.meta +11 -0
- package/DREditor.RoomLoading.asmdef +24 -0
- package/DREditor.RoomLoading.asmdef.meta +7 -0
- package/DialogueRoomLoader.cs +188 -0
- package/DialogueRoomLoader.cs.meta +11 -0
- package/FadeOnEndTransitionFromSave.cs +205 -0
- package/FadeOnEndTransitionFromSave.cs.meta +11 -0
- package/FadeOutGeneratePastOnDebugTest.cs +97 -0
- package/FadeOutGeneratePastOnDebugTest.cs.meta +11 -0
- package/FadeOutOnRoomLoad.cs +75 -0
- package/FadeOutOnRoomLoad.cs.meta +11 -0
- package/FreezeColorRoomTransition.cs +186 -0
- package/FreezeColorRoomTransition.cs.meta +11 -0
- package/IPostTransitionRoutine.cs +17 -0
- package/IPostTransitionRoutine.cs.meta +11 -0
- package/IRoomLoadResolver.cs +15 -0
- package/IRoomLoadResolver.cs.meta +11 -0
- package/IRoomLoadRoutine.cs +17 -0
- package/IRoomLoadRoutine.cs.meta +11 -0
- package/IRoomTransition.cs +39 -0
- package/IRoomTransition.cs.meta +11 -0
- package/ITeleporter.cs +24 -0
- package/ITeleporter.cs.meta +11 -0
- package/InstanceManagerBase.cs +131 -0
- package/InstanceManagerBase.cs.meta +11 -0
- package/KeepStateAfterObjective.cs +74 -0
- package/KeepStateAfterObjective.cs.meta +11 -0
- package/MoveEndOnDialogueFinish.cs +131 -0
- package/MoveEndOnDialogueFinish.cs.meta +11 -0
- package/PastPointData.cs +44 -0
- package/PastPointData.cs.meta +11 -0
- package/PrepareTPFDOnLoadingRoom.cs +68 -0
- package/PrepareTPFDOnLoadingRoom.cs.meta +11 -0
- package/ResolveRoomLoadStates.cs +95 -0
- package/ResolveRoomLoadStates.cs.meta +11 -0
- package/RoomChanger.cs +265 -0
- package/RoomChanger.cs.meta +11 -0
- package/RoomChangerBase.cs +85 -0
- package/RoomChangerBase.cs.meta +11 -0
- package/RoomChangerLoader.cs +90 -0
- package/RoomChangerLoader.cs.meta +11 -0
- package/RoomLoadComponent.cs +13 -0
- package/RoomLoadComponent.cs.meta +11 -0
- package/RoomLoadFinisher.cs +81 -0
- package/RoomLoadFinisher.cs.meta +11 -0
- package/RoomLoadOptionsAsset.cs +45 -0
- package/RoomLoadOptionsAsset.cs.meta +11 -0
- package/RoomLoader.cs +265 -0
- package/RoomLoader.cs.meta +11 -0
- package/RoomLoaderBase.cs +87 -0
- package/RoomLoaderBase.cs.meta +11 -0
- package/RoomLoaderDebugger.cs +151 -0
- package/RoomLoaderDebugger.cs.meta +11 -0
- package/RoomLoaderHolder.cs +10 -0
- package/RoomLoaderHolder.cs.meta +11 -0
- package/Samples~/BlackTransitionOnlyOption.asset +18 -0
- package/Samples~/BlackTransitionOnlyOption.asset.meta +8 -0
- package/Samples~/BlackTransitionToInvestigationOption.asset +18 -0
- package/Samples~/BlackTransitionToInvestigationOption.asset.meta +8 -0
- package/Samples~/Check_ThreeD_Mode_During_Load.prefab +49 -0
- package/Samples~/Check_ThreeD_Mode_During_Load.prefab.meta +7 -0
- package/Samples~/DRE_Start_Alone_Scene.prefab +148 -0
- package/Samples~/DRE_Start_Alone_Scene.prefab.meta +7 -0
- package/Samples~/Dialogue_Room_Loader.prefab +55 -0
- package/Samples~/Dialogue_Room_Loader.prefab.meta +7 -0
- package/Samples~/FadeOutBlackTransitionOption.asset +18 -0
- package/Samples~/FadeOutBlackTransitionOption.asset.meta +8 -0
- package/Samples~/Fade_On_End_Transition_From_Save.prefab +145 -0
- package/Samples~/Fade_On_End_Transition_From_Save.prefab.meta +7 -0
- package/Samples~/Fade_Out_Generate_Past_On_Debug_Test.prefab +139 -0
- package/Samples~/Fade_Out_Generate_Past_On_Debug_Test.prefab.meta +7 -0
- package/Samples~/Fade_Out_On_Room_Load.prefab +137 -0
- package/Samples~/Fade_Out_On_Room_Load.prefab.meta +7 -0
- package/Samples~/Freeze_Transition_Canvas.prefab +300 -0
- package/Samples~/Freeze_Transition_Canvas.prefab.meta +7 -0
- package/Samples~/IsLoadingToRoom.asset +19 -0
- package/Samples~/IsLoadingToRoom.asset.meta +8 -0
- package/Samples~/Move_End_On_Dialogue_Finish.prefab +52 -0
- package/Samples~/Move_End_On_Dialogue_Finish.prefab.meta +7 -0
- package/Samples~/OnFadingOutOfLoading.asset +15 -0
- package/Samples~/OnFadingOutOfLoading.asset.meta +8 -0
- package/Samples~/OnFinishedLoadingRoom.asset +14 -0
- package/Samples~/OnFinishedLoadingRoom.asset.meta +8 -0
- package/Samples~/OnLoadingThreeDRoom.asset +14 -0
- package/Samples~/OnLoadingThreeDRoom.asset.meta +8 -0
- package/Samples~/OnLoadingThreeDRoomListener.prefab +51 -0
- package/Samples~/OnLoadingThreeDRoomListener.prefab.meta +7 -0
- package/Samples~/On_Finished_Loading_Room_Listener.prefab +51 -0
- package/Samples~/On_Finished_Loading_Room_Listener.prefab.meta +7 -0
- package/Samples~/On_Finished_Loading_Room_No_Dialogue_Listener.prefab +51 -0
- package/Samples~/On_Finished_Loading_Room_No_Dialogue_Listener.prefab.meta +7 -0
- package/Samples~/On_Finished_Room_Transitions_Listener.prefab +51 -0
- package/Samples~/On_Finished_Room_Transitions_Listener.prefab.meta +7 -0
- package/Samples~/On_Loading_Room_Listener.prefab +51 -0
- package/Samples~/On_Loading_Room_Listener.prefab.meta +7 -0
- package/Samples~/On_Started_Changing_Room_Listener.prefab +51 -0
- package/Samples~/On_Started_Changing_Room_Listener.prefab.meta +7 -0
- package/Samples~/Prepare_TPFD_On_Room_Loading.prefab +142 -0
- package/Samples~/Prepare_TPFD_On_Room_Loading.prefab.meta +7 -0
- package/Samples~/Resolve_Room_Load_States.prefab +54 -0
- package/Samples~/Resolve_Room_Load_States.prefab.meta +7 -0
- package/Samples~/Room_Changer.prefab +143 -0
- package/Samples~/Room_Changer.prefab.meta +7 -0
- package/Samples~/Room_Changer_Loader.prefab +53 -0
- package/Samples~/Room_Changer_Loader.prefab.meta +7 -0
- package/Samples~/Room_Instance_Manager.prefab +78 -0
- package/Samples~/Room_Instance_Manager.prefab.meta +7 -0
- package/Samples~/Room_Load_Finisher.prefab +139 -0
- package/Samples~/Room_Load_Finisher.prefab.meta +7 -0
- package/Samples~/Room_Loader.prefab +584 -0
- package/Samples~/Room_Loader.prefab.meta +7 -0
- package/Samples~/Room_Loader_Event_Listeners.prefab +337 -0
- package/Samples~/Room_Loader_Event_Listeners.prefab.meta +7 -0
- package/Samples~/Room_Loading_System_ETemplate.prefab +398 -0
- package/Samples~/Room_Loading_System_ETemplate.prefab.meta +7 -0
- package/Samples~/SkipActivateControls.asset +19 -0
- package/Samples~/SkipActivateControls.asset.meta +8 -0
- package/Samples~/Skip_Controls_When_Loaded.prefab +156 -0
- package/Samples~/Skip_Controls_When_Loaded.prefab.meta +7 -0
- package/Samples~/TPFD_Room_Loader.prefab +215 -0
- package/Samples~/TPFD_Room_Loader.prefab.meta +7 -0
- package/Samples~/TeleportTransitionOptions.asset +18 -0
- package/Samples~/TeleportTransitionOptions.asset.meta +8 -0
- package/Samples~/Teleport_Room_Manager.prefab +84 -0
- package/Samples~/Teleport_Room_Manager.prefab.meta +7 -0
- package/Samples~/UI_Visibility_On_Scene_Events.prefab +316 -0
- package/Samples~/UI_Visibility_On_Scene_Events.prefab.meta +7 -0
- package/SkipControlsWhenLoaded.cs +66 -0
- package/SkipControlsWhenLoaded.cs.meta +11 -0
- package/TPFDRoomAnimation.cs +84 -0
- package/TPFDRoomAnimation.cs.meta +11 -0
- package/TPFDRoomLoader.cs +93 -0
- package/TPFDRoomLoader.cs.meta +11 -0
- package/TeleportRoomManager.cs +114 -0
- package/TeleportRoomManager.cs.meta +11 -0
- package/package.json +43 -4
- package/package.json.meta +7 -0
- package/README.md +0 -3
package/.attestation.p7m
ADDED
|
Binary file
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using DREditor.Gates;
|
|
4
|
+
using DREditor.Services;
|
|
5
|
+
using System.Collections;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
using UnityEngine.SceneManagement;
|
|
8
|
+
using UnityEngine.Serialization;
|
|
9
|
+
|
|
10
|
+
namespace DREditor.RoomLoading
|
|
11
|
+
{
|
|
12
|
+
/// <summary>
|
|
13
|
+
///
|
|
14
|
+
/// </summary>
|
|
15
|
+
[ClassHeader(nameof(RoomLoadComponent) + ", " + nameof(IRoomLoadRoutine) +
|
|
16
|
+
"\n\n")]
|
|
17
|
+
public class CheckThreeDModeDuringLoad : RoomLoadComponent, IRoomLoadRoutine
|
|
18
|
+
{
|
|
19
|
+
/// <summary>
|
|
20
|
+
///
|
|
21
|
+
/// </summary>
|
|
22
|
+
[Tooltip("")]
|
|
23
|
+
[FormerlySerializedAs("GDB")]
|
|
24
|
+
[SerializeField] protected GateDatabase gateDatabase = null;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeField] protected BoolWithEvent inThreeDMode = null;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
///
|
|
34
|
+
/// </summary>
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/// <inheritdoc/>
|
|
40
|
+
public virtual IEnumerator OnRoomLoadRoutine()
|
|
41
|
+
{
|
|
42
|
+
CheckThreeDMode();
|
|
43
|
+
|
|
44
|
+
yield break;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// <summary>
|
|
48
|
+
///
|
|
49
|
+
/// </summary>
|
|
50
|
+
protected virtual void CheckThreeDMode()
|
|
51
|
+
{
|
|
52
|
+
// Added 8-27-2024 because going dorm hallway ch 1 free time, laundromat tp, then leaving,
|
|
53
|
+
// always had sprite billboard looking where the player last was.
|
|
54
|
+
|
|
55
|
+
Gate changerDestination = ServiceLocator.GetService<RoomChangerBase>().GetDestination();
|
|
56
|
+
|
|
57
|
+
Gate destination = changerDestination != null ?
|
|
58
|
+
changerDestination : gateDatabase.GetArea(SceneManager.GetActiveScene().name);
|
|
59
|
+
|
|
60
|
+
if (destination != null && !destination.isTPFD && !isLoadingFile.Value)
|
|
61
|
+
inThreeDMode.SetValue(true);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.EventObjects;
|
|
3
|
+
using DREditor.Services;
|
|
4
|
+
using System.Collections;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.RoomLoading
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
/// <remarks></remarks>
|
|
13
|
+
public abstract class DRERoomTransition : ServiceHolder<IRoomTransition>, IRoomTransition
|
|
14
|
+
{
|
|
15
|
+
public bool IsTransitioning => isTransitioning;
|
|
16
|
+
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeField] protected bool replaceActiveTransition = false;
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
[Tooltip("")]
|
|
27
|
+
[SerializeField] protected BoolWithEvent inLoading = null;
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
protected IRoomTransition previousTransition;
|
|
34
|
+
|
|
35
|
+
/// <summary>
|
|
36
|
+
///
|
|
37
|
+
/// </summary>
|
|
38
|
+
protected bool isTransitioning;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
///
|
|
43
|
+
/// </summary>
|
|
44
|
+
protected override void Awake()
|
|
45
|
+
{
|
|
46
|
+
if (replaceActiveTransition &&
|
|
47
|
+
ServiceLocator.HasService<IRoomTransition>() &&
|
|
48
|
+
ServiceLocator.GetService<IRoomTransition>() != this as IRoomTransition)
|
|
49
|
+
StartCoroutine(AttemptReplacingActiveTransition());
|
|
50
|
+
else
|
|
51
|
+
base.Awake();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/// <summary>
|
|
55
|
+
///
|
|
56
|
+
/// </summary>
|
|
57
|
+
/// <returns></returns>
|
|
58
|
+
protected virtual IEnumerator AttemptReplacingActiveTransition()
|
|
59
|
+
{
|
|
60
|
+
yield return new WaitUntil(() => !ServiceLocator.GetService<IRoomTransition>().IsTransitioning && !inLoading.Value);
|
|
61
|
+
|
|
62
|
+
ReplaceActiveTransition();
|
|
63
|
+
|
|
64
|
+
base.Awake();
|
|
65
|
+
|
|
66
|
+
yield break;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/// <summary>
|
|
70
|
+
///
|
|
71
|
+
/// </summary>
|
|
72
|
+
protected virtual void ReplaceActiveTransition()
|
|
73
|
+
{
|
|
74
|
+
previousTransition = ServiceLocator.GetService<IRoomTransition>();
|
|
75
|
+
|
|
76
|
+
ServiceLocator.Unregister(previousTransition);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// <summary>
|
|
80
|
+
///
|
|
81
|
+
/// </summary>
|
|
82
|
+
protected override void OnDestroy()
|
|
83
|
+
{
|
|
84
|
+
base.OnDestroy();
|
|
85
|
+
|
|
86
|
+
UnregisterTransition();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// <summary>
|
|
90
|
+
///
|
|
91
|
+
/// </summary>
|
|
92
|
+
protected virtual void UnregisterTransition()
|
|
93
|
+
{
|
|
94
|
+
if (ServiceLocator.HasService<IRoomTransition>() && ServiceLocator.GetService<IRoomTransition>() == this as IRoomTransition)
|
|
95
|
+
{
|
|
96
|
+
ServiceLocator.Unregister<IRoomTransition>(this);
|
|
97
|
+
|
|
98
|
+
if (previousTransition != null)
|
|
99
|
+
ServiceLocator.Register(previousTransition);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
/// <inheritdoc/>
|
|
105
|
+
public virtual void StartTransition() => StartCoroutine(StartTransitionRoutine());
|
|
106
|
+
|
|
107
|
+
/// <inheritdoc/>
|
|
108
|
+
public abstract IEnumerator StartTransitionRoutine();
|
|
109
|
+
|
|
110
|
+
/// <inheritdoc/>
|
|
111
|
+
public virtual void EndTransition() => StartCoroutine(EndTransitionRoutine());
|
|
112
|
+
|
|
113
|
+
/// <inheritdoc/>
|
|
114
|
+
public abstract IEnumerator EndTransitionRoutine();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Loading;
|
|
4
|
+
using DREditor.EventObjects;
|
|
5
|
+
using DREditor.Services;
|
|
6
|
+
using System.Collections;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.RoomLoading
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[ClassHeader(nameof(IDialogueHolder) +
|
|
15
|
+
"\n\n")]
|
|
16
|
+
public class DREStartAloneScene : MonoBehaviour, IDialogueHolder
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
[Header("")]
|
|
22
|
+
[Divider]
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
[SerializeField] protected Dialogue startingDialogue = null;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeField] protected BoolWithEvent startingMode = null;
|
|
31
|
+
|
|
32
|
+
/// <summary>
|
|
33
|
+
///
|
|
34
|
+
/// </summary>
|
|
35
|
+
[Tooltip("")]
|
|
36
|
+
[SerializeField] protected BoolWithEvent inDialogue = null;
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
[Tooltip("")]
|
|
42
|
+
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
[Tooltip("")]
|
|
48
|
+
[SerializeField] protected BoolWithEvent observeModeLocked = null;
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
[Tooltip("")]
|
|
54
|
+
[SerializeField] protected BoolWithEvent reticleSelectOverride = null;
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
///
|
|
58
|
+
/// </summary>
|
|
59
|
+
[Tooltip("")]
|
|
60
|
+
[SerializeField] protected SceneEventListener onFinishedLoadingRoomNoDialogue = null;
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/// <summary>
|
|
64
|
+
///
|
|
65
|
+
/// </summary>
|
|
66
|
+
[Header("")]
|
|
67
|
+
[Divider]
|
|
68
|
+
[Tooltip("")]
|
|
69
|
+
[SerializeField] protected float startSceneDialogueBufferTime = 1;
|
|
70
|
+
|
|
71
|
+
/// <summary>
|
|
72
|
+
///
|
|
73
|
+
/// </summary>
|
|
74
|
+
[Tooltip("")]
|
|
75
|
+
[SerializeField] protected SelectableObject actor = null;
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
/// <summary>
|
|
79
|
+
///
|
|
80
|
+
/// </summary>
|
|
81
|
+
protected virtual void Awake() => InitializeGameStates();
|
|
82
|
+
|
|
83
|
+
/// <summary>
|
|
84
|
+
///
|
|
85
|
+
/// </summary>
|
|
86
|
+
protected virtual void InitializeGameStates()
|
|
87
|
+
{
|
|
88
|
+
reticleSelectOverride.SetValue(false);
|
|
89
|
+
|
|
90
|
+
observeModeLocked.SetValue(true);
|
|
91
|
+
|
|
92
|
+
SetGameToDesignatedMode();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/// <summary>
|
|
96
|
+
///
|
|
97
|
+
/// </summary>
|
|
98
|
+
protected virtual void SetGameToDesignatedMode() => startingMode.SetValue(true);
|
|
99
|
+
|
|
100
|
+
/// <summary>
|
|
101
|
+
///
|
|
102
|
+
/// </summary>
|
|
103
|
+
protected virtual void Start() => StartSceneProcessFromLoadSituation();
|
|
104
|
+
|
|
105
|
+
/// <summary>
|
|
106
|
+
///
|
|
107
|
+
/// </summary>
|
|
108
|
+
protected virtual void StartSceneProcessFromLoadSituation()
|
|
109
|
+
{
|
|
110
|
+
if (isLoadingFile.Value)
|
|
111
|
+
StartCoroutine(AssertObserveModeUnlockAfterDialogue());
|
|
112
|
+
else
|
|
113
|
+
SubscribeToSceneEvent();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/// <summary>
|
|
117
|
+
///
|
|
118
|
+
/// </summary>
|
|
119
|
+
protected virtual void SubscribeToSceneEvent()
|
|
120
|
+
=> onFinishedLoadingRoomNoDialogue.Response.AddListener(StartGameSceneDialogue);
|
|
121
|
+
|
|
122
|
+
/// <summary>
|
|
123
|
+
///
|
|
124
|
+
/// </summary>
|
|
125
|
+
/// <returns></returns>
|
|
126
|
+
protected virtual IEnumerator AssertObserveModeUnlockAfterDialogue()
|
|
127
|
+
{
|
|
128
|
+
SetGameToDesignatedMode();
|
|
129
|
+
|
|
130
|
+
yield return new WaitUntil(() => inDialogue.Value);
|
|
131
|
+
|
|
132
|
+
observeModeLocked.SetValue(false);
|
|
133
|
+
|
|
134
|
+
yield break;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/// <summary>
|
|
138
|
+
///
|
|
139
|
+
/// </summary>
|
|
140
|
+
protected virtual void StartGameSceneDialogue() => StartCoroutine(StartGameSceneDialogueRoutine());
|
|
141
|
+
|
|
142
|
+
/// <summary>
|
|
143
|
+
///
|
|
144
|
+
/// </summary>
|
|
145
|
+
/// <returns></returns>
|
|
146
|
+
protected virtual IEnumerator StartGameSceneDialogueRoutine()
|
|
147
|
+
{
|
|
148
|
+
yield return new WaitForSeconds(startSceneDialogueBufferTime);
|
|
149
|
+
|
|
150
|
+
inDialogue.SetValue(true);
|
|
151
|
+
|
|
152
|
+
observeModeLocked.SetValue(false);
|
|
153
|
+
|
|
154
|
+
ServiceLocator.GetService<IDialogueManager>().StartDialogue(actor, new Dialogue[1] { startingDialogue });
|
|
155
|
+
|
|
156
|
+
yield break;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/// <summary>
|
|
160
|
+
///
|
|
161
|
+
/// </summary>
|
|
162
|
+
protected virtual void OnDestroy() => UnsubscribeToSceneEvent();
|
|
163
|
+
|
|
164
|
+
/// <summary>
|
|
165
|
+
///
|
|
166
|
+
/// </summary>
|
|
167
|
+
protected virtual void UnsubscribeToSceneEvent()
|
|
168
|
+
=> onFinishedLoadingRoomNoDialogue.Response.RemoveListener(StartGameSceneDialogue);
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
/// <inheritdoc/>
|
|
172
|
+
public virtual bool CheckIfSaveDialogue()
|
|
173
|
+
{
|
|
174
|
+
return ServiceLocator.GetService<IDialogueManager>()
|
|
175
|
+
.GetManagerComponent<DialogueLoadIdentifier>()
|
|
176
|
+
.CheckDialogue<Line>(startingDialogue);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "DREditor.RoomLoading",
|
|
3
|
+
"rootNamespace": "",
|
|
4
|
+
"references": [
|
|
5
|
+
"DREditor",
|
|
6
|
+
"DREditor.Input",
|
|
7
|
+
"DREditor.Fading",
|
|
8
|
+
"Unity.InputSystem",
|
|
9
|
+
"DREditor.Progressing.Handling",
|
|
10
|
+
"DG.Tweening",
|
|
11
|
+
"DREditor.Controls",
|
|
12
|
+
"DREditor.UIHandling",
|
|
13
|
+
"DREditor.UI"
|
|
14
|
+
],
|
|
15
|
+
"includePlatforms": [],
|
|
16
|
+
"excludePlatforms": [],
|
|
17
|
+
"allowUnsafeCode": false,
|
|
18
|
+
"overrideReferences": false,
|
|
19
|
+
"precompiledReferences": [],
|
|
20
|
+
"autoReferenced": true,
|
|
21
|
+
"defineConstraints": [],
|
|
22
|
+
"versionDefines": [],
|
|
23
|
+
"noEngineReferences": false
|
|
24
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Loading;
|
|
4
|
+
using DREditor.EventObjects;
|
|
5
|
+
using DREditor.FPC;
|
|
6
|
+
using DREditor.Saving;
|
|
7
|
+
using System.Collections;
|
|
8
|
+
using System.Collections.Generic;
|
|
9
|
+
using System.Linq;
|
|
10
|
+
using UnityEngine;
|
|
11
|
+
|
|
12
|
+
namespace DREditor.RoomLoading
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[ClassHeader(nameof(RoomLoadComponent) + ", " +
|
|
18
|
+
nameof(IDRELoadable) + ", " + nameof(IRoomLoadRoutine) + ", " + nameof(IRoomLoadResolver) +
|
|
19
|
+
"\n\n")]
|
|
20
|
+
public class DialogueRoomLoader : RoomLoadComponent, IDRELoadable, IRoomLoadRoutine, IRoomLoadResolver
|
|
21
|
+
{
|
|
22
|
+
/// <summary>
|
|
23
|
+
///
|
|
24
|
+
/// </summary>
|
|
25
|
+
[Tooltip("")]
|
|
26
|
+
[SerializeField] protected BoolWithEvent inDialogue = null;
|
|
27
|
+
|
|
28
|
+
/// <summary>
|
|
29
|
+
///
|
|
30
|
+
/// </summary>
|
|
31
|
+
[Tooltip("")]
|
|
32
|
+
[SerializeField] protected BoolWithEvent inThreeDMode = null;
|
|
33
|
+
|
|
34
|
+
/// <summary>
|
|
35
|
+
///
|
|
36
|
+
/// </summary>
|
|
37
|
+
[Tooltip("")]
|
|
38
|
+
[SerializeField] protected BoolWithEvent hasMenuAccess = null;
|
|
39
|
+
|
|
40
|
+
/// <summary>
|
|
41
|
+
///
|
|
42
|
+
/// </summary>
|
|
43
|
+
[Tooltip("")]
|
|
44
|
+
[SerializeField] protected BoolWithEvent inTrialMode = null;
|
|
45
|
+
|
|
46
|
+
/// <summary>
|
|
47
|
+
///
|
|
48
|
+
/// </summary>
|
|
49
|
+
[Tooltip("")]
|
|
50
|
+
[SerializeField] protected BoolWithEvent isLoadingFile = null;
|
|
51
|
+
|
|
52
|
+
/// <summary>
|
|
53
|
+
///
|
|
54
|
+
/// </summary>
|
|
55
|
+
[Tooltip("")]
|
|
56
|
+
[SerializeField] protected BoolWithEvent loadDialogueFound = null;
|
|
57
|
+
|
|
58
|
+
/// <summary>
|
|
59
|
+
///
|
|
60
|
+
/// </summary>
|
|
61
|
+
[Tooltip("")]
|
|
62
|
+
[SerializeField] protected BoolWithEvent dialogueLoaded = null;
|
|
63
|
+
|
|
64
|
+
/// <summary>
|
|
65
|
+
///
|
|
66
|
+
/// </summary>
|
|
67
|
+
[Tooltip("")]
|
|
68
|
+
[SerializeField] protected SceneEvent LoadTrialIndex = null;
|
|
69
|
+
|
|
70
|
+
/// <summary>
|
|
71
|
+
///
|
|
72
|
+
/// </summary>
|
|
73
|
+
[Tooltip("")]
|
|
74
|
+
[SerializeField] protected string dialogueNameSaveKey = "DialogueName";
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
/// <summary>
|
|
78
|
+
///
|
|
79
|
+
/// </summary>
|
|
80
|
+
protected Dictionary<string, object> saveDatas = new();
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/// <inheritdoc/>
|
|
84
|
+
public virtual void Load(Dictionary<string, object> saveDatas) => this.saveDatas = saveDatas;
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
/// <inheritdoc/>
|
|
88
|
+
public virtual IEnumerator OnRoomLoadRoutine() => CheckLoadDialoguesRoutine();
|
|
89
|
+
|
|
90
|
+
/// <summary>
|
|
91
|
+
///
|
|
92
|
+
/// </summary>
|
|
93
|
+
public virtual IEnumerator CheckLoadDialoguesRoutine()
|
|
94
|
+
{
|
|
95
|
+
if (!SaveFileIsInDialogue())
|
|
96
|
+
yield break;
|
|
97
|
+
|
|
98
|
+
LookForSaveDialogue();
|
|
99
|
+
|
|
100
|
+
yield return WaitForSaveDialogueFound();
|
|
101
|
+
|
|
102
|
+
SpawnSavedTrialMinigame();
|
|
103
|
+
|
|
104
|
+
yield return WaitForDialogueLoadersCompleted();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/// <summary>
|
|
108
|
+
///
|
|
109
|
+
/// </summary>
|
|
110
|
+
protected virtual void LookForSaveDialogue()
|
|
111
|
+
{
|
|
112
|
+
UnityEngine.Debug.Log($"REPORT: {ToString()}: Started Looking for Dialogue: " + saveDatas.Get<string>(dialogueNameSaveKey));
|
|
113
|
+
|
|
114
|
+
var dialogueHolders = FindObjectsByType<MonoBehaviour>().OfType<IDialogueHolder>();
|
|
115
|
+
|
|
116
|
+
foreach (IDialogueHolder holder in dialogueHolders)
|
|
117
|
+
holder.CheckIfSaveDialogue();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/// <summary>
|
|
121
|
+
///
|
|
122
|
+
/// </summary>
|
|
123
|
+
protected virtual void SpawnSavedTrialMinigame()
|
|
124
|
+
{
|
|
125
|
+
if (inTrialMode.Value)
|
|
126
|
+
LoadTrialIndex.Raise();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/// <summary>
|
|
130
|
+
///
|
|
131
|
+
/// </summary>
|
|
132
|
+
protected virtual IEnumerator WaitForSaveDialogueFound()
|
|
133
|
+
{
|
|
134
|
+
yield return new WaitUntil(() => loadDialogueFound.Value);
|
|
135
|
+
|
|
136
|
+
loadDialogueFound.SetValue(false);
|
|
137
|
+
|
|
138
|
+
UnityEngine.Debug.Log($"REPORT: {ToString()}: Found Dialogue");
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/// <summary>
|
|
142
|
+
///
|
|
143
|
+
/// </summary>
|
|
144
|
+
/// <remarks></remarks>
|
|
145
|
+
protected virtual IEnumerator WaitForDialogueLoadersCompleted()
|
|
146
|
+
{
|
|
147
|
+
var loaders = FindObjectsByType<MonoBehaviour>().OfType<IDialogueLoader>();
|
|
148
|
+
|
|
149
|
+
foreach (var loader in loaders)
|
|
150
|
+
yield return loader.LoadDialogueProcess(saveDatas);
|
|
151
|
+
|
|
152
|
+
yield return new WaitUntil(() => dialogueLoaded.Value);
|
|
153
|
+
|
|
154
|
+
dialogueLoaded.SetValue(false);
|
|
155
|
+
|
|
156
|
+
UnityEngine.Debug.Log($"REPORT: {ToString()}: Dialogue has finished loading.");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/// <summary>
|
|
160
|
+
///
|
|
161
|
+
/// </summary>
|
|
162
|
+
/// <returns></returns>
|
|
163
|
+
public virtual bool SaveFileIsInDialogue() => isLoadingFile.Value && saveDatas.Get<string>(dialogueNameSaveKey) != "";
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
/// <inheritdoc/>
|
|
167
|
+
public virtual void OnRoomLoadResolve()
|
|
168
|
+
{
|
|
169
|
+
if (isLoadingFile.Value && !SaveFileIsInDialogue())
|
|
170
|
+
WhenLoadingSaveFileWithoutDialogue();
|
|
171
|
+
|
|
172
|
+
if (!inDialogue.Value && SaveFileIsInDialogue())
|
|
173
|
+
inDialogue.SetValue(true);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/// <summary>
|
|
177
|
+
///
|
|
178
|
+
/// </summary>
|
|
179
|
+
protected virtual void WhenLoadingSaveFileWithoutDialogue()
|
|
180
|
+
{
|
|
181
|
+
if (!inTrialMode.Value)
|
|
182
|
+
hasMenuAccess.SetValue(true);
|
|
183
|
+
|
|
184
|
+
if (inThreeDMode.Value)
|
|
185
|
+
FindAnyObjectByType<MovePlayer>().enabled = true;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|