net.dreditor.presents.ui 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/CharacterReactionIndicator.cs +180 -180
- package/CharacterReactionIndicator.cs.meta +11 -11
- package/DREditor.Presents.UI.asmdef +24 -24
- package/DREditor.Presents.UI.asmdef.meta +7 -7
- package/DialoguePresentResolver.cs +118 -118
- package/DialoguePresentResolver.cs.meta +11 -11
- package/GivePresentEventHandler.cs +67 -67
- package/GivePresentEventHandler.cs.meta +11 -11
- package/MenuPresentSelectEvaluator.cs +94 -94
- package/MenuPresentSelectEvaluator.cs.meta +11 -11
- package/PresentDisplayer.cs +153 -153
- package/PresentDisplayer.cs.meta +11 -11
- package/PresentIconSlot.cs +143 -143
- package/PresentIconSlot.cs.meta +11 -11
- package/PresentIconSpawner.cs +42 -42
- package/PresentIconSpawner.cs.meta +11 -11
- package/PresentResolver.cs +19 -19
- package/PresentResolver.cs.meta +11 -11
- package/PresentSelectEvaluator.cs +167 -167
- package/PresentSelectEvaluator.cs.meta +11 -11
- package/PresentUI.cs +280 -280
- package/PresentUI.cs.meta +11 -11
- package/ReactionIndicatorSpawner.cs +57 -57
- package/ReactionIndicatorSpawner.cs.meta +11 -11
- package/{Samples → Samples~}/Animations/Present_UI.controller +220 -220
- package/{Samples → Samples~}/Animations/Present_UI.controller.meta +8 -8
- package/{Samples → Samples~}/Animations/UI_Pr_HideAnim.anim +232 -232
- package/{Samples → Samples~}/Animations/UI_Pr_HideAnim.anim.meta +8 -8
- package/{Samples → Samples~}/Animations.meta +8 -8
- package/{Samples → Samples~}/DRE_Present_UI.unity +381 -381
- package/{Samples → Samples~}/DRE_Present_UI.unity.meta +7 -7
- package/{Samples → Samples~}/Present_Displayer_UI_ETemplate.prefab +900 -900
- package/{Samples → Samples~}/Present_Displayer_UI_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Present_Icon_Slot_ETemplate.prefab +351 -351
- package/{Samples → Samples~}/Present_Icon_Slot_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Present_UI_Canvas_Shell.prefab +1523 -1523
- package/{Samples → Samples~}/Present_UI_Canvas_Shell.prefab.meta +7 -7
- package/{Samples → Samples~}/Present_UI_Canvas_Template.prefab +11800 -11800
- package/{Samples → Samples~}/Present_UI_Canvas_Template.prefab.meta +7 -7
- package/{Samples → Samples~}/Present_UI_Character_Grid_ETemplate.prefab +154 -154
- package/{Samples → Samples~}/Present_UI_Character_Grid_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Present_UI_Reaction_Indicator_ETemplate.prefab +95 -95
- package/{Samples → Samples~}/Present_UI_Reaction_Indicator_ETemplate.prefab.meta +7 -7
- package/{Samples → Samples~}/Present_UI_Slots_ETemplate.prefab +79 -79
- package/{Samples → Samples~}/Present_UI_Slots_ETemplate.prefab.meta +7 -7
- package/package.json +47 -42
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues;
|
|
3
|
-
using DREditor.Dialogues.Events;
|
|
4
|
-
using DREditor.EventObjects;
|
|
5
|
-
using DREditor.Services;
|
|
6
|
-
using System.Collections;
|
|
7
|
-
using UnityEngine;
|
|
8
|
-
|
|
9
|
-
namespace DREditor.Presents.UI
|
|
10
|
-
{
|
|
11
|
-
/// <summary>
|
|
12
|
-
///
|
|
13
|
-
/// </summary>
|
|
14
|
-
[ClassHeader(nameof(PresentResolver) +
|
|
15
|
-
"\n\n")]
|
|
16
|
-
public class DialoguePresentResolver : PresentResolver
|
|
17
|
-
{
|
|
18
|
-
/// <summary>
|
|
19
|
-
///
|
|
20
|
-
/// </summary>
|
|
21
|
-
[Tooltip("")]
|
|
22
|
-
[SerializeField] protected PresentDatabase presentDatabase = null;
|
|
23
|
-
|
|
24
|
-
/// <summary>
|
|
25
|
-
///
|
|
26
|
-
/// </summary>
|
|
27
|
-
[Tooltip("")]
|
|
28
|
-
[SerializeField] protected SceneEvent OnPlayerDidntGivePresentChoice = null;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/// <summary>
|
|
32
|
-
///
|
|
33
|
-
/// </summary>
|
|
34
|
-
[Header("")]
|
|
35
|
-
[Divider]
|
|
36
|
-
[Tooltip("")]
|
|
37
|
-
[SerializeField] protected string callEvaluateReaction = "EvaluateReaction";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/// <summary>
|
|
41
|
-
///
|
|
42
|
-
/// </summary>
|
|
43
|
-
[Header("")]
|
|
44
|
-
[Divider]
|
|
45
|
-
[Tooltip("")]
|
|
46
|
-
[SerializeField] protected SceneEvent hideFakePause = null;
|
|
47
|
-
|
|
48
|
-
/// <summary>
|
|
49
|
-
///
|
|
50
|
-
/// </summary>
|
|
51
|
-
[Tooltip("")]
|
|
52
|
-
[SerializeField] protected float pauseMenuStartUpTime = 1.2f;
|
|
53
|
-
|
|
54
|
-
/// <summary>
|
|
55
|
-
///
|
|
56
|
-
/// </summary>
|
|
57
|
-
[Tooltip("")]
|
|
58
|
-
[SerializeField] protected int noSelectionIndex = 1;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/// <inheritdoc/>
|
|
62
|
-
public override IEnumerator ResolvePresentSelection(bool gavePresent, int selectedPresentIndex)
|
|
63
|
-
{
|
|
64
|
-
if (hideFakePause != null)
|
|
65
|
-
hideFakePause.Raise();
|
|
66
|
-
|
|
67
|
-
yield return new WaitForSecondsRealtime(pauseMenuStartUpTime);
|
|
68
|
-
|
|
69
|
-
if (gavePresent)
|
|
70
|
-
ResolveGivingPresent(selectedPresentIndex);
|
|
71
|
-
else
|
|
72
|
-
ResolveNotGivingPresent();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/// <summary>
|
|
76
|
-
///
|
|
77
|
-
/// </summary>
|
|
78
|
-
/// <param name="selectedPresentIndex"></param>
|
|
79
|
-
protected virtual void ResolveGivingPresent(int selectedPresentIndex)
|
|
80
|
-
{
|
|
81
|
-
Present present = presentDatabase.presents[selectedPresentIndex];
|
|
82
|
-
|
|
83
|
-
UnityEngine.Debug.Log("REPORT: Removing present to give: " + present.DisplayName);
|
|
84
|
-
|
|
85
|
-
ServiceLocator.GetService<IPresentManager>().Get<IAmountablePresent>(present.ID)?.Remove();
|
|
86
|
-
|
|
87
|
-
DialogueEventSystem.TriggerEvent(callEvaluateReaction, presentDatabase.presents[selectedPresentIndex]);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/// <summary>
|
|
91
|
-
///
|
|
92
|
-
/// </summary>
|
|
93
|
-
protected virtual void ResolveNotGivingPresent()
|
|
94
|
-
{
|
|
95
|
-
if (ServiceLocator.HasService<IDialogueManager>())
|
|
96
|
-
if (((Dialogue)ServiceLocator.GetService<IDialogueManager>().GetReader().GetCurrentDialogue())
|
|
97
|
-
.Choices[noSelectionIndex].NextDialogue != null)
|
|
98
|
-
ForceDidntGivePresentChoice();
|
|
99
|
-
else
|
|
100
|
-
ServiceLocator.GetService<IDialogueManager>().GetEnder().StopDialogue();
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/// <summary>
|
|
104
|
-
///
|
|
105
|
-
/// </summary>
|
|
106
|
-
protected virtual void ForceDidntGivePresentChoice()
|
|
107
|
-
{
|
|
108
|
-
DialogueReader dialogueReader = ServiceLocator.GetService<IDialogueManager>().GetReader();
|
|
109
|
-
|
|
110
|
-
Dialogue[] originalDialogue = new Dialogue[1];
|
|
111
|
-
|
|
112
|
-
originalDialogue[0] = ((Dialogue)dialogueReader.GetCurrentDialogue()).Choices[noSelectionIndex].NextDialogue;
|
|
113
|
-
|
|
114
|
-
dialogueReader.PlayDialogues(originalDialogue);
|
|
115
|
-
|
|
116
|
-
OnPlayerDidntGivePresentChoice.Raise();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Events;
|
|
4
|
+
using DREditor.EventObjects;
|
|
5
|
+
using DREditor.Services;
|
|
6
|
+
using System.Collections;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Presents.UI
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[ClassHeader(nameof(PresentResolver) +
|
|
15
|
+
"\n\n")]
|
|
16
|
+
public class DialoguePresentResolver : PresentResolver
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
[Tooltip("")]
|
|
22
|
+
[SerializeField] protected PresentDatabase presentDatabase = null;
|
|
23
|
+
|
|
24
|
+
/// <summary>
|
|
25
|
+
///
|
|
26
|
+
/// </summary>
|
|
27
|
+
[Tooltip("")]
|
|
28
|
+
[SerializeField] protected SceneEvent OnPlayerDidntGivePresentChoice = null;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
[Header("")]
|
|
35
|
+
[Divider]
|
|
36
|
+
[Tooltip("")]
|
|
37
|
+
[SerializeField] protected string callEvaluateReaction = "EvaluateReaction";
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/// <summary>
|
|
41
|
+
///
|
|
42
|
+
/// </summary>
|
|
43
|
+
[Header("")]
|
|
44
|
+
[Divider]
|
|
45
|
+
[Tooltip("")]
|
|
46
|
+
[SerializeField] protected SceneEvent hideFakePause = null;
|
|
47
|
+
|
|
48
|
+
/// <summary>
|
|
49
|
+
///
|
|
50
|
+
/// </summary>
|
|
51
|
+
[Tooltip("")]
|
|
52
|
+
[SerializeField] protected float pauseMenuStartUpTime = 1.2f;
|
|
53
|
+
|
|
54
|
+
/// <summary>
|
|
55
|
+
///
|
|
56
|
+
/// </summary>
|
|
57
|
+
[Tooltip("")]
|
|
58
|
+
[SerializeField] protected int noSelectionIndex = 1;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/// <inheritdoc/>
|
|
62
|
+
public override IEnumerator ResolvePresentSelection(bool gavePresent, int selectedPresentIndex)
|
|
63
|
+
{
|
|
64
|
+
if (hideFakePause != null)
|
|
65
|
+
hideFakePause.Raise();
|
|
66
|
+
|
|
67
|
+
yield return new WaitForSecondsRealtime(pauseMenuStartUpTime);
|
|
68
|
+
|
|
69
|
+
if (gavePresent)
|
|
70
|
+
ResolveGivingPresent(selectedPresentIndex);
|
|
71
|
+
else
|
|
72
|
+
ResolveNotGivingPresent();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// <summary>
|
|
76
|
+
///
|
|
77
|
+
/// </summary>
|
|
78
|
+
/// <param name="selectedPresentIndex"></param>
|
|
79
|
+
protected virtual void ResolveGivingPresent(int selectedPresentIndex)
|
|
80
|
+
{
|
|
81
|
+
Present present = presentDatabase.presents[selectedPresentIndex];
|
|
82
|
+
|
|
83
|
+
UnityEngine.Debug.Log("REPORT: Removing present to give: " + present.DisplayName);
|
|
84
|
+
|
|
85
|
+
ServiceLocator.GetService<IPresentManager>().Get<IAmountablePresent>(present.ID)?.Remove();
|
|
86
|
+
|
|
87
|
+
DialogueEventSystem.TriggerEvent(callEvaluateReaction, presentDatabase.presents[selectedPresentIndex]);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/// <summary>
|
|
91
|
+
///
|
|
92
|
+
/// </summary>
|
|
93
|
+
protected virtual void ResolveNotGivingPresent()
|
|
94
|
+
{
|
|
95
|
+
if (ServiceLocator.HasService<IDialogueManager>())
|
|
96
|
+
if (((Dialogue)ServiceLocator.GetService<IDialogueManager>().GetReader().GetCurrentDialogue())
|
|
97
|
+
.Choices[noSelectionIndex].NextDialogue != null)
|
|
98
|
+
ForceDidntGivePresentChoice();
|
|
99
|
+
else
|
|
100
|
+
ServiceLocator.GetService<IDialogueManager>().GetEnder().StopDialogue();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// <summary>
|
|
104
|
+
///
|
|
105
|
+
/// </summary>
|
|
106
|
+
protected virtual void ForceDidntGivePresentChoice()
|
|
107
|
+
{
|
|
108
|
+
DialogueReader dialogueReader = ServiceLocator.GetService<IDialogueManager>().GetReader();
|
|
109
|
+
|
|
110
|
+
Dialogue[] originalDialogue = new Dialogue[1];
|
|
111
|
+
|
|
112
|
+
originalDialogue[0] = ((Dialogue)dialogueReader.GetCurrentDialogue()).Choices[noSelectionIndex].NextDialogue;
|
|
113
|
+
|
|
114
|
+
dialogueReader.PlayDialogues(originalDialogue);
|
|
115
|
+
|
|
116
|
+
OnPlayerDidntGivePresentChoice.Raise();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
119
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: b6fccfad620234e4d9ac4e3642ebd014
|
|
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: b6fccfad620234e4d9ac4e3642ebd014
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.DialogueEventHandling;
|
|
3
|
-
using DREditor.EventObjects;
|
|
4
|
-
using DREditor.UI;
|
|
5
|
-
using System.Collections;
|
|
6
|
-
using UnityEngine;
|
|
7
|
-
|
|
8
|
-
namespace DREditor.Presents.UI
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
///
|
|
12
|
-
/// </summary>
|
|
13
|
-
[ClassHeader(nameof(DialogueEventHandler) +
|
|
14
|
-
"\n\n")]
|
|
15
|
-
public class GivePresentEventHandler : DialogueEventHandler
|
|
16
|
-
{
|
|
17
|
-
/// <summary>
|
|
18
|
-
///
|
|
19
|
-
/// </summary>
|
|
20
|
-
[Tooltip("")]
|
|
21
|
-
[SerializeField] protected SceneEvent showFakePause = null;
|
|
22
|
-
|
|
23
|
-
/// <summary>
|
|
24
|
-
///
|
|
25
|
-
/// </summary>
|
|
26
|
-
[Tooltip("")]
|
|
27
|
-
[SerializeField] protected float pauseMenuStartUpTime = 1.2f;
|
|
28
|
-
|
|
29
|
-
/// <summary>
|
|
30
|
-
///
|
|
31
|
-
/// </summary>
|
|
32
|
-
[Tooltip("")]
|
|
33
|
-
[SerializeField] protected MenuGroupBase presentUI = null;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/// <inheritdoc/>
|
|
37
|
-
protected override void OnDialogueEventTriggered(object o = null) => StartCoroutine(DelayDisplayPresentUI());
|
|
38
|
-
|
|
39
|
-
/// <summary>
|
|
40
|
-
///
|
|
41
|
-
/// </summary>
|
|
42
|
-
/// <returns></returns>
|
|
43
|
-
protected virtual IEnumerator DelayDisplayPresentUI()
|
|
44
|
-
{
|
|
45
|
-
if (showFakePause != null)
|
|
46
|
-
showFakePause.Raise();
|
|
47
|
-
|
|
48
|
-
yield return new WaitForSecondsRealtime(pauseMenuStartUpTime);
|
|
49
|
-
|
|
50
|
-
presentUI.Show();
|
|
51
|
-
|
|
52
|
-
yield break;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/// <summary>
|
|
57
|
-
///
|
|
58
|
-
/// </summary>
|
|
59
|
-
protected virtual void Reset() => SetDefaultEventString("GivePresent");
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
/// <summary>
|
|
63
|
-
///
|
|
64
|
-
/// </summary>
|
|
65
|
-
[ContextMenu("Test Event")]
|
|
66
|
-
public void TestEvent() => OnDialogueEventTriggered();
|
|
67
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.DialogueEventHandling;
|
|
3
|
+
using DREditor.EventObjects;
|
|
4
|
+
using DREditor.UI;
|
|
5
|
+
using System.Collections;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.Presents.UI
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
[ClassHeader(nameof(DialogueEventHandler) +
|
|
14
|
+
"\n\n")]
|
|
15
|
+
public class GivePresentEventHandler : DialogueEventHandler
|
|
16
|
+
{
|
|
17
|
+
/// <summary>
|
|
18
|
+
///
|
|
19
|
+
/// </summary>
|
|
20
|
+
[Tooltip("")]
|
|
21
|
+
[SerializeField] protected SceneEvent showFakePause = null;
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
[Tooltip("")]
|
|
27
|
+
[SerializeField] protected float pauseMenuStartUpTime = 1.2f;
|
|
28
|
+
|
|
29
|
+
/// <summary>
|
|
30
|
+
///
|
|
31
|
+
/// </summary>
|
|
32
|
+
[Tooltip("")]
|
|
33
|
+
[SerializeField] protected MenuGroupBase presentUI = null;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/// <inheritdoc/>
|
|
37
|
+
protected override void OnDialogueEventTriggered(object o = null) => StartCoroutine(DelayDisplayPresentUI());
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
/// <returns></returns>
|
|
43
|
+
protected virtual IEnumerator DelayDisplayPresentUI()
|
|
44
|
+
{
|
|
45
|
+
if (showFakePause != null)
|
|
46
|
+
showFakePause.Raise();
|
|
47
|
+
|
|
48
|
+
yield return new WaitForSecondsRealtime(pauseMenuStartUpTime);
|
|
49
|
+
|
|
50
|
+
presentUI.Show();
|
|
51
|
+
|
|
52
|
+
yield break;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
///
|
|
58
|
+
/// </summary>
|
|
59
|
+
protected virtual void Reset() => SetDefaultEventString("GivePresent");
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
/// <summary>
|
|
63
|
+
///
|
|
64
|
+
/// </summary>
|
|
65
|
+
[ContextMenu("Test Event")]
|
|
66
|
+
public void TestEvent() => OnDialogueEventTriggered();
|
|
67
|
+
}
|
|
68
68
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: bbd2a105d30fa634c9894dcaa75873fb
|
|
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: bbd2a105d30fa634c9894dcaa75873fb
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Dialogues.Events;
|
|
3
|
-
using DREditor.UI;
|
|
4
|
-
using UnityEngine;
|
|
5
|
-
using UnityEngine.EventSystems;
|
|
6
|
-
using UnityEngine.UI;
|
|
7
|
-
using static UnityEngine.InputSystem.InputAction;
|
|
8
|
-
|
|
9
|
-
namespace DREditor.Presents.UI
|
|
10
|
-
{
|
|
11
|
-
/// <summary>
|
|
12
|
-
///
|
|
13
|
-
/// </summary>
|
|
14
|
-
[ClassHeader(nameof(PresentSelectEvaluator) +
|
|
15
|
-
"\n\n")]
|
|
16
|
-
public class MenuPresentSelectEvaluator : PresentSelectEvaluator
|
|
17
|
-
{
|
|
18
|
-
/// <summary>
|
|
19
|
-
///
|
|
20
|
-
/// </summary>
|
|
21
|
-
[Header("")]
|
|
22
|
-
[Divider]
|
|
23
|
-
[Tooltip("")]
|
|
24
|
-
[SerializeField] protected MenuGroupBase choiceMenuGroup = null;
|
|
25
|
-
|
|
26
|
-
/// <summary>
|
|
27
|
-
///
|
|
28
|
-
/// </summary>
|
|
29
|
-
[Tooltip("")]
|
|
30
|
-
[SerializeField] protected Selectable yesSelectable = null;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
/// <summary>
|
|
34
|
-
///
|
|
35
|
-
/// </summary>
|
|
36
|
-
[Header("")]
|
|
37
|
-
[Divider]
|
|
38
|
-
[Tooltip("")]
|
|
39
|
-
[SerializeField] protected bool callNextDayOnNoPresent = false;
|
|
40
|
-
|
|
41
|
-
/// <summary>
|
|
42
|
-
///
|
|
43
|
-
/// </summary>
|
|
44
|
-
[Tooltip("")]
|
|
45
|
-
[SerializeField] protected string callNextDay = "NextDay";
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/// <inheritdoc/>
|
|
49
|
-
protected override void OnEnable() => choiceMenuGroup.StartEvents.AddListener(OnChoiceMenuStart);
|
|
50
|
-
|
|
51
|
-
/// <inheritdoc/>
|
|
52
|
-
protected override void OnDisable() => choiceMenuGroup.StartEvents.RemoveListener(OnChoiceMenuStart);
|
|
53
|
-
|
|
54
|
-
/// <inheritdoc/>
|
|
55
|
-
protected override void OnSelectedValidPresent() => choiceMenuGroup.Show();
|
|
56
|
-
|
|
57
|
-
/// <summary>
|
|
58
|
-
///
|
|
59
|
-
/// </summary>
|
|
60
|
-
/// <param name="ctx"></param>
|
|
61
|
-
protected virtual void BeforeEvaluateChoice(CallbackContext ctx) { }
|
|
62
|
-
|
|
63
|
-
/// <summary>
|
|
64
|
-
///
|
|
65
|
-
/// </summary>
|
|
66
|
-
/// <param name="ctx"></param>
|
|
67
|
-
protected virtual void AfterEvaluateChoice(CallbackContext ctx) => choiceMenuGroup.Hide();
|
|
68
|
-
|
|
69
|
-
/// <inheritdoc/>
|
|
70
|
-
protected override void EvaluatePresentChoice(CallbackContext ctx)
|
|
71
|
-
{
|
|
72
|
-
BeforeEvaluateChoice(ctx);
|
|
73
|
-
|
|
74
|
-
base.EvaluatePresentChoice(ctx);
|
|
75
|
-
|
|
76
|
-
if (EventSystem.current.currentSelectedGameObject == yesSelectable.gameObject)
|
|
77
|
-
OnGivePresentSelected();
|
|
78
|
-
else
|
|
79
|
-
OnDontGivePresentSelected();
|
|
80
|
-
|
|
81
|
-
EventSystem.current.SetSelectedGameObject(null);
|
|
82
|
-
|
|
83
|
-
AfterEvaluateChoice(ctx);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/// <inheritdoc/>
|
|
87
|
-
protected override void OnGivePresentSelected()
|
|
88
|
-
{
|
|
89
|
-
base.OnGivePresentSelected();
|
|
90
|
-
|
|
91
|
-
if (!gavePresent && callNextDayOnNoPresent)
|
|
92
|
-
DialogueEventSystem.TriggerEvent(callNextDay);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues.Events;
|
|
3
|
+
using DREditor.UI;
|
|
4
|
+
using UnityEngine;
|
|
5
|
+
using UnityEngine.EventSystems;
|
|
6
|
+
using UnityEngine.UI;
|
|
7
|
+
using static UnityEngine.InputSystem.InputAction;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Presents.UI
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
[ClassHeader(nameof(PresentSelectEvaluator) +
|
|
15
|
+
"\n\n")]
|
|
16
|
+
public class MenuPresentSelectEvaluator : PresentSelectEvaluator
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
///
|
|
20
|
+
/// </summary>
|
|
21
|
+
[Header("")]
|
|
22
|
+
[Divider]
|
|
23
|
+
[Tooltip("")]
|
|
24
|
+
[SerializeField] protected MenuGroupBase choiceMenuGroup = null;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
[Tooltip("")]
|
|
30
|
+
[SerializeField] protected Selectable yesSelectable = null;
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
///
|
|
35
|
+
/// </summary>
|
|
36
|
+
[Header("")]
|
|
37
|
+
[Divider]
|
|
38
|
+
[Tooltip("")]
|
|
39
|
+
[SerializeField] protected bool callNextDayOnNoPresent = false;
|
|
40
|
+
|
|
41
|
+
/// <summary>
|
|
42
|
+
///
|
|
43
|
+
/// </summary>
|
|
44
|
+
[Tooltip("")]
|
|
45
|
+
[SerializeField] protected string callNextDay = "NextDay";
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
/// <inheritdoc/>
|
|
49
|
+
protected override void OnEnable() => choiceMenuGroup.StartEvents.AddListener(OnChoiceMenuStart);
|
|
50
|
+
|
|
51
|
+
/// <inheritdoc/>
|
|
52
|
+
protected override void OnDisable() => choiceMenuGroup.StartEvents.RemoveListener(OnChoiceMenuStart);
|
|
53
|
+
|
|
54
|
+
/// <inheritdoc/>
|
|
55
|
+
protected override void OnSelectedValidPresent() => choiceMenuGroup.Show();
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
///
|
|
59
|
+
/// </summary>
|
|
60
|
+
/// <param name="ctx"></param>
|
|
61
|
+
protected virtual void BeforeEvaluateChoice(CallbackContext ctx) { }
|
|
62
|
+
|
|
63
|
+
/// <summary>
|
|
64
|
+
///
|
|
65
|
+
/// </summary>
|
|
66
|
+
/// <param name="ctx"></param>
|
|
67
|
+
protected virtual void AfterEvaluateChoice(CallbackContext ctx) => choiceMenuGroup.Hide();
|
|
68
|
+
|
|
69
|
+
/// <inheritdoc/>
|
|
70
|
+
protected override void EvaluatePresentChoice(CallbackContext ctx)
|
|
71
|
+
{
|
|
72
|
+
BeforeEvaluateChoice(ctx);
|
|
73
|
+
|
|
74
|
+
base.EvaluatePresentChoice(ctx);
|
|
75
|
+
|
|
76
|
+
if (EventSystem.current.currentSelectedGameObject == yesSelectable.gameObject)
|
|
77
|
+
OnGivePresentSelected();
|
|
78
|
+
else
|
|
79
|
+
OnDontGivePresentSelected();
|
|
80
|
+
|
|
81
|
+
EventSystem.current.SetSelectedGameObject(null);
|
|
82
|
+
|
|
83
|
+
AfterEvaluateChoice(ctx);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/// <inheritdoc/>
|
|
87
|
+
protected override void OnGivePresentSelected()
|
|
88
|
+
{
|
|
89
|
+
base.OnGivePresentSelected();
|
|
90
|
+
|
|
91
|
+
if (!gavePresent && callNextDayOnNoPresent)
|
|
92
|
+
DialogueEventSystem.TriggerEvent(callNextDay);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
95
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: cfd460d13582b454f959767b90e7fa16
|
|
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: cfd460d13582b454f959767b90e7fa16
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|