net.dreditor.ui.menus 0.1.6 → 0.1.8
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/ChapterUIImage.cs +78 -78
- package/ChapterUIImage.cs.meta +11 -11
- package/ChapterUIText.cs +91 -91
- package/ChapterUIText.cs.meta +11 -11
- package/DREditor.UI.Menus.asmdef +27 -27
- package/DREditor.UI.Menus.asmdef.meta +7 -7
- package/ImageSelectHandler.cs +108 -108
- package/ImageSelectHandler.cs.meta +11 -11
- package/MainMenu.cs +230 -230
- package/MainMenu.cs.meta +11 -11
- package/PauseMenu.cs +323 -323
- package/PauseMenu.cs.meta +11 -11
- package/PauseOptionData.cs +55 -55
- package/PauseOptionData.cs.meta +11 -11
- package/PauseOptionSaveHandler.cs +81 -81
- package/PauseOptionSaveHandler.cs.meta +11 -11
- package/{Samples → Samples~}/Open_Pause_Menu_Conditions.prefab +106 -106
- package/{Samples → Samples~}/Open_Pause_Menu_Conditions.prefab.meta +7 -7
- package/{Samples → Samples~}/Pause_Option_Save_Handler.prefab +48 -48
- package/{Samples → Samples~}/Pause_Option_Save_Handler.prefab.meta +7 -7
- package/ScrollDescription.cs +259 -259
- package/ScrollDescription.cs.meta +11 -11
- package/TextColorSelect.cs +72 -72
- package/TextColorSelect.cs.meta +11 -11
- package/TextUIPositionPair.cs +24 -24
- package/TextUIPositionPair.cs.meta +11 -11
- package/TruthBulletMenu.cs +238 -238
- package/TruthBulletMenu.cs.meta +11 -11
- package/TruthBulletUnlockableOption.cs +30 -30
- package/TruthBulletUnlockableOption.cs.meta +11 -11
- package/package.json +50 -45
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
package/TruthBulletMenu.cs
CHANGED
|
@@ -1,239 +1,239 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.DialogueMechanics.Investigation;
|
|
3
|
-
using DREditor.EventObjects;
|
|
4
|
-
using DREditor.Investigations;
|
|
5
|
-
using DREditor.Processables;
|
|
6
|
-
using System.Collections.Generic;
|
|
7
|
-
using TMPro;
|
|
8
|
-
using UnityEngine;
|
|
9
|
-
using UnityEngine.UI;
|
|
10
|
-
|
|
11
|
-
namespace DREditor.UI.Menus
|
|
12
|
-
{
|
|
13
|
-
/// <summary>
|
|
14
|
-
///
|
|
15
|
-
/// </summary>
|
|
16
|
-
/// <remarks></remarks>
|
|
17
|
-
[ClassHeader(nameof(MenuModifier) +
|
|
18
|
-
"\n\n")]
|
|
19
|
-
public class TruthBulletMenu : MenuModifier
|
|
20
|
-
{
|
|
21
|
-
/// <summary>
|
|
22
|
-
///
|
|
23
|
-
/// </summary>
|
|
24
|
-
[Header("")]
|
|
25
|
-
[Divider]
|
|
26
|
-
[Tooltip("")]
|
|
27
|
-
[SerializeField] protected Evidence evidence = null;
|
|
28
|
-
|
|
29
|
-
/// <summary>
|
|
30
|
-
///
|
|
31
|
-
/// </summary>
|
|
32
|
-
[Tooltip("")]
|
|
33
|
-
[SerializeField] protected List<TruthBullet> bullets;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/// <summary>
|
|
37
|
-
///
|
|
38
|
-
/// </summary>
|
|
39
|
-
[Header("")]
|
|
40
|
-
[Divider]
|
|
41
|
-
[Tooltip("")]
|
|
42
|
-
[SerializeField] protected EvidenceDatabase evidenceDatabase = null;
|
|
43
|
-
|
|
44
|
-
/// <summary>
|
|
45
|
-
///
|
|
46
|
-
/// </summary>
|
|
47
|
-
[Tooltip("")]
|
|
48
|
-
[SerializeField] protected ScrollOptionModifier scrollGroup = null;
|
|
49
|
-
|
|
50
|
-
/// <summary>
|
|
51
|
-
///
|
|
52
|
-
/// </summary>
|
|
53
|
-
[Tooltip("")]
|
|
54
|
-
[SerializeField] protected IntWithEvent currentChapterIndex = null;
|
|
55
|
-
|
|
56
|
-
/// <summary>
|
|
57
|
-
///
|
|
58
|
-
/// </summary>
|
|
59
|
-
[Tooltip("")]
|
|
60
|
-
[SerializeField] protected TruthBulletDataHandler TruthBulletDataHandler = null;
|
|
61
|
-
|
|
62
|
-
/// <summary>
|
|
63
|
-
///
|
|
64
|
-
/// </summary>
|
|
65
|
-
[Tooltip("")]
|
|
66
|
-
[SerializeField] protected GameObject bulletOptionPrefab = null;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/// <summary>
|
|
70
|
-
///
|
|
71
|
-
/// </summary>
|
|
72
|
-
[Header("")]
|
|
73
|
-
[Divider]
|
|
74
|
-
[Tooltip("")]
|
|
75
|
-
[SerializeField] protected Image bulletImage = null;
|
|
76
|
-
|
|
77
|
-
/// <summary>
|
|
78
|
-
///
|
|
79
|
-
/// </summary>
|
|
80
|
-
[Tooltip("")]
|
|
81
|
-
[SerializeField] protected TextMeshProUGUI bulletText = null;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
/// <summary>
|
|
85
|
-
///
|
|
86
|
-
/// </summary>
|
|
87
|
-
protected virtual void OnEnable() => menu.BeforeStart.AddListener(Load);
|
|
88
|
-
|
|
89
|
-
/// <summary>
|
|
90
|
-
///
|
|
91
|
-
/// </summary>
|
|
92
|
-
protected virtual void OnDisable() => menu.BeforeStart.RemoveListener(Load);
|
|
93
|
-
|
|
94
|
-
/// <summary>
|
|
95
|
-
///
|
|
96
|
-
/// </summary>
|
|
97
|
-
public virtual void Load()
|
|
98
|
-
{
|
|
99
|
-
InitializeEvidence();
|
|
100
|
-
|
|
101
|
-
LoadTruthBullets();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/// <summary>
|
|
105
|
-
///
|
|
106
|
-
/// </summary>
|
|
107
|
-
protected virtual void InitializeEvidence()
|
|
108
|
-
{
|
|
109
|
-
int chapterIndex = currentChapterIndex.Value;
|
|
110
|
-
|
|
111
|
-
if (chapterIndex >= 0 && chapterIndex < evidenceDatabase.Evidences.Count)
|
|
112
|
-
evidence = evidenceDatabase.Evidences[chapterIndex];
|
|
113
|
-
else
|
|
114
|
-
UnityEngine.Debug.LogError("You do not have an evidence asset in the evidence database for the current chapter!");
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/// <summary>
|
|
118
|
-
///
|
|
119
|
-
/// </summary>
|
|
120
|
-
protected virtual void LoadAllBulletsOnEmpty()
|
|
121
|
-
{
|
|
122
|
-
if (TruthBulletDataHandler.foundBullets.Count == 0)
|
|
123
|
-
foreach (TruthBullet bullet in evidence.TruthBullets)
|
|
124
|
-
{
|
|
125
|
-
TruthBulletDataHandler.AddBullet(bullet.DisplayName);
|
|
126
|
-
|
|
127
|
-
if (bullet.OfType<IBuildableDescription>() is IBuildableDescription collection)
|
|
128
|
-
foreach (var fragment in collection.GetFragmentNames())
|
|
129
|
-
TruthBulletDataHandler.AddPiece(fragment);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/// <summary>
|
|
134
|
-
///
|
|
135
|
-
/// </summary>
|
|
136
|
-
protected virtual void LoadTruthBullets()
|
|
137
|
-
{
|
|
138
|
-
LoadAllBulletsOnEmpty();
|
|
139
|
-
|
|
140
|
-
InitializeTruthBullets();
|
|
141
|
-
|
|
142
|
-
SpawnTruthBulletOptions();
|
|
143
|
-
|
|
144
|
-
DisplayTruthBulletOptions();
|
|
145
|
-
|
|
146
|
-
AttemptDisplayBulletInfo();
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/// <summary>
|
|
150
|
-
///
|
|
151
|
-
/// </summary>
|
|
152
|
-
protected virtual void InitializeTruthBullets()
|
|
153
|
-
{
|
|
154
|
-
bullets = new();
|
|
155
|
-
|
|
156
|
-
foreach (var foundBullet in TruthBulletDataHandler.foundBullets)
|
|
157
|
-
bullets.Add(evidence.GetBullet(foundBullet));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/// <summary>
|
|
161
|
-
///
|
|
162
|
-
/// </summary>
|
|
163
|
-
protected virtual void SpawnTruthBulletOptions()
|
|
164
|
-
{
|
|
165
|
-
if (bulletOptionPrefab == null)
|
|
166
|
-
UnityEngine.Debug.LogWarning("ALERT: " +
|
|
167
|
-
"TBM does not have enough scroll options for the amount of truth bullets for this chapter. " +
|
|
168
|
-
"\n It is suggested you either set up more Truth Bullet Options or assign a BulletOptionPrefab to the TBM.");
|
|
169
|
-
else if (scrollGroup.OptionCount() < evidence.TruthBullets.Count &&
|
|
170
|
-
evidence.TruthBullets.Count - scrollGroup.OptionCount() is int missingCount)
|
|
171
|
-
for (int i = 0; i < missingCount; i++)
|
|
172
|
-
InstantiateBulletOptionPrefab();
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/// <summary>
|
|
176
|
-
///
|
|
177
|
-
/// </summary>
|
|
178
|
-
protected virtual void DisplayTruthBulletOptions()
|
|
179
|
-
{
|
|
180
|
-
for (int i = 0; i < TruthBulletDataHandler.foundBullets.Count; i++)
|
|
181
|
-
scrollGroup.EnableOptionAt(i, bullets[i].DisplayName);
|
|
182
|
-
|
|
183
|
-
scrollGroup.DisableUnused(TruthBulletDataHandler.foundBullets.Count);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
/// <summary>
|
|
187
|
-
///
|
|
188
|
-
/// </summary>
|
|
189
|
-
protected virtual void InstantiateBulletOptionPrefab()
|
|
190
|
-
{
|
|
191
|
-
GameObject bulletOption = scrollGroup.InstantiateScrollOption(bulletOptionPrefab);
|
|
192
|
-
|
|
193
|
-
SelectableUIOption selectableOption = bulletOption.GetComponent<SelectableUIOption>();
|
|
194
|
-
|
|
195
|
-
selectableOption.Selection.AddListener(() => DisplayBulletInfo(bulletOption));
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/// <summary>
|
|
199
|
-
///
|
|
200
|
-
/// </summary>
|
|
201
|
-
protected virtual void AttemptDisplayBulletInfo()
|
|
202
|
-
{
|
|
203
|
-
if (menu is SelectableMenuGroupBase selectableMenu)
|
|
204
|
-
DisplayBulletInfo(selectableMenu.EvaluateSelection());
|
|
205
|
-
else
|
|
206
|
-
UnityEngine.Debug.LogWarning($"{ToString()}: ALERT: Loading Bullet Menu did not contain a "
|
|
207
|
-
+ nameof(SelectableMenuGroupBase) + "! Either use one or extend this functionality to not require it.");
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/// <summary>
|
|
211
|
-
///
|
|
212
|
-
/// </summary>
|
|
213
|
-
/// <param name="current"></param>
|
|
214
|
-
protected virtual void DisplayBulletInfo(GameObject current)
|
|
215
|
-
{
|
|
216
|
-
TruthBullet truthBullet = evidence.GetBullet(current.GetComponentInChildren<TextMeshProUGUI>().text);
|
|
217
|
-
|
|
218
|
-
DisplayBulletInfo(truthBullet);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/// <summary>
|
|
222
|
-
///
|
|
223
|
-
/// </summary>
|
|
224
|
-
/// <param name="truthBullet"></param>
|
|
225
|
-
protected virtual void DisplayBulletInfo(TruthBullet truthBullet)
|
|
226
|
-
{
|
|
227
|
-
if (truthBullet.Image != null)
|
|
228
|
-
bulletImage.sprite = truthBullet.Image;
|
|
229
|
-
|
|
230
|
-
string builtDescription = truthBullet
|
|
231
|
-
.OfType<IBuildableDescription>()?[truthBullet.Description, TruthBulletDataHandler.pieceBullets];
|
|
232
|
-
|
|
233
|
-
if (!string.IsNullOrEmpty(builtDescription))
|
|
234
|
-
bulletText.text = builtDescription;
|
|
235
|
-
else
|
|
236
|
-
bulletText.text = truthBullet.Description;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.DialogueMechanics.Investigation;
|
|
3
|
+
using DREditor.EventObjects;
|
|
4
|
+
using DREditor.Investigations;
|
|
5
|
+
using DREditor.Processables;
|
|
6
|
+
using System.Collections.Generic;
|
|
7
|
+
using TMPro;
|
|
8
|
+
using UnityEngine;
|
|
9
|
+
using UnityEngine.UI;
|
|
10
|
+
|
|
11
|
+
namespace DREditor.UI.Menus
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
/// <remarks></remarks>
|
|
17
|
+
[ClassHeader(nameof(MenuModifier) +
|
|
18
|
+
"\n\n")]
|
|
19
|
+
public class TruthBulletMenu : MenuModifier
|
|
20
|
+
{
|
|
21
|
+
/// <summary>
|
|
22
|
+
///
|
|
23
|
+
/// </summary>
|
|
24
|
+
[Header("")]
|
|
25
|
+
[Divider]
|
|
26
|
+
[Tooltip("")]
|
|
27
|
+
[SerializeField] protected Evidence evidence = null;
|
|
28
|
+
|
|
29
|
+
/// <summary>
|
|
30
|
+
///
|
|
31
|
+
/// </summary>
|
|
32
|
+
[Tooltip("")]
|
|
33
|
+
[SerializeField] protected List<TruthBullet> bullets;
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/// <summary>
|
|
37
|
+
///
|
|
38
|
+
/// </summary>
|
|
39
|
+
[Header("")]
|
|
40
|
+
[Divider]
|
|
41
|
+
[Tooltip("")]
|
|
42
|
+
[SerializeField] protected EvidenceDatabase evidenceDatabase = null;
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
[Tooltip("")]
|
|
48
|
+
[SerializeField] protected ScrollOptionModifier scrollGroup = null;
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
[Tooltip("")]
|
|
54
|
+
[SerializeField] protected IntWithEvent currentChapterIndex = null;
|
|
55
|
+
|
|
56
|
+
/// <summary>
|
|
57
|
+
///
|
|
58
|
+
/// </summary>
|
|
59
|
+
[Tooltip("")]
|
|
60
|
+
[SerializeField] protected TruthBulletDataHandler TruthBulletDataHandler = null;
|
|
61
|
+
|
|
62
|
+
/// <summary>
|
|
63
|
+
///
|
|
64
|
+
/// </summary>
|
|
65
|
+
[Tooltip("")]
|
|
66
|
+
[SerializeField] protected GameObject bulletOptionPrefab = null;
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
/// <summary>
|
|
70
|
+
///
|
|
71
|
+
/// </summary>
|
|
72
|
+
[Header("")]
|
|
73
|
+
[Divider]
|
|
74
|
+
[Tooltip("")]
|
|
75
|
+
[SerializeField] protected Image bulletImage = null;
|
|
76
|
+
|
|
77
|
+
/// <summary>
|
|
78
|
+
///
|
|
79
|
+
/// </summary>
|
|
80
|
+
[Tooltip("")]
|
|
81
|
+
[SerializeField] protected TextMeshProUGUI bulletText = null;
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
/// <summary>
|
|
85
|
+
///
|
|
86
|
+
/// </summary>
|
|
87
|
+
protected virtual void OnEnable() => menu.BeforeStart.AddListener(Load);
|
|
88
|
+
|
|
89
|
+
/// <summary>
|
|
90
|
+
///
|
|
91
|
+
/// </summary>
|
|
92
|
+
protected virtual void OnDisable() => menu.BeforeStart.RemoveListener(Load);
|
|
93
|
+
|
|
94
|
+
/// <summary>
|
|
95
|
+
///
|
|
96
|
+
/// </summary>
|
|
97
|
+
public virtual void Load()
|
|
98
|
+
{
|
|
99
|
+
InitializeEvidence();
|
|
100
|
+
|
|
101
|
+
LoadTruthBullets();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/// <summary>
|
|
105
|
+
///
|
|
106
|
+
/// </summary>
|
|
107
|
+
protected virtual void InitializeEvidence()
|
|
108
|
+
{
|
|
109
|
+
int chapterIndex = currentChapterIndex.Value;
|
|
110
|
+
|
|
111
|
+
if (chapterIndex >= 0 && chapterIndex < evidenceDatabase.Evidences.Count)
|
|
112
|
+
evidence = evidenceDatabase.Evidences[chapterIndex];
|
|
113
|
+
else
|
|
114
|
+
UnityEngine.Debug.LogError("You do not have an evidence asset in the evidence database for the current chapter!");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// <summary>
|
|
118
|
+
///
|
|
119
|
+
/// </summary>
|
|
120
|
+
protected virtual void LoadAllBulletsOnEmpty()
|
|
121
|
+
{
|
|
122
|
+
if (TruthBulletDataHandler.foundBullets.Count == 0)
|
|
123
|
+
foreach (TruthBullet bullet in evidence.TruthBullets)
|
|
124
|
+
{
|
|
125
|
+
TruthBulletDataHandler.AddBullet(bullet.DisplayName);
|
|
126
|
+
|
|
127
|
+
if (bullet.OfType<IBuildableDescription>() is IBuildableDescription collection)
|
|
128
|
+
foreach (var fragment in collection.GetFragmentNames())
|
|
129
|
+
TruthBulletDataHandler.AddPiece(fragment);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/// <summary>
|
|
134
|
+
///
|
|
135
|
+
/// </summary>
|
|
136
|
+
protected virtual void LoadTruthBullets()
|
|
137
|
+
{
|
|
138
|
+
LoadAllBulletsOnEmpty();
|
|
139
|
+
|
|
140
|
+
InitializeTruthBullets();
|
|
141
|
+
|
|
142
|
+
SpawnTruthBulletOptions();
|
|
143
|
+
|
|
144
|
+
DisplayTruthBulletOptions();
|
|
145
|
+
|
|
146
|
+
AttemptDisplayBulletInfo();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/// <summary>
|
|
150
|
+
///
|
|
151
|
+
/// </summary>
|
|
152
|
+
protected virtual void InitializeTruthBullets()
|
|
153
|
+
{
|
|
154
|
+
bullets = new();
|
|
155
|
+
|
|
156
|
+
foreach (var foundBullet in TruthBulletDataHandler.foundBullets)
|
|
157
|
+
bullets.Add(evidence.GetBullet(foundBullet));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/// <summary>
|
|
161
|
+
///
|
|
162
|
+
/// </summary>
|
|
163
|
+
protected virtual void SpawnTruthBulletOptions()
|
|
164
|
+
{
|
|
165
|
+
if (bulletOptionPrefab == null)
|
|
166
|
+
UnityEngine.Debug.LogWarning("ALERT: " +
|
|
167
|
+
"TBM does not have enough scroll options for the amount of truth bullets for this chapter. " +
|
|
168
|
+
"\n It is suggested you either set up more Truth Bullet Options or assign a BulletOptionPrefab to the TBM.");
|
|
169
|
+
else if (scrollGroup.OptionCount() < evidence.TruthBullets.Count &&
|
|
170
|
+
evidence.TruthBullets.Count - scrollGroup.OptionCount() is int missingCount)
|
|
171
|
+
for (int i = 0; i < missingCount; i++)
|
|
172
|
+
InstantiateBulletOptionPrefab();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/// <summary>
|
|
176
|
+
///
|
|
177
|
+
/// </summary>
|
|
178
|
+
protected virtual void DisplayTruthBulletOptions()
|
|
179
|
+
{
|
|
180
|
+
for (int i = 0; i < TruthBulletDataHandler.foundBullets.Count; i++)
|
|
181
|
+
scrollGroup.EnableOptionAt(i, bullets[i].DisplayName);
|
|
182
|
+
|
|
183
|
+
scrollGroup.DisableUnused(TruthBulletDataHandler.foundBullets.Count);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/// <summary>
|
|
187
|
+
///
|
|
188
|
+
/// </summary>
|
|
189
|
+
protected virtual void InstantiateBulletOptionPrefab()
|
|
190
|
+
{
|
|
191
|
+
GameObject bulletOption = scrollGroup.InstantiateScrollOption(bulletOptionPrefab);
|
|
192
|
+
|
|
193
|
+
SelectableUIOption selectableOption = bulletOption.GetComponent<SelectableUIOption>();
|
|
194
|
+
|
|
195
|
+
selectableOption.Selection.AddListener(() => DisplayBulletInfo(bulletOption));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/// <summary>
|
|
199
|
+
///
|
|
200
|
+
/// </summary>
|
|
201
|
+
protected virtual void AttemptDisplayBulletInfo()
|
|
202
|
+
{
|
|
203
|
+
if (menu is SelectableMenuGroupBase selectableMenu)
|
|
204
|
+
DisplayBulletInfo(selectableMenu.EvaluateSelection());
|
|
205
|
+
else
|
|
206
|
+
UnityEngine.Debug.LogWarning($"{ToString()}: ALERT: Loading Bullet Menu did not contain a "
|
|
207
|
+
+ nameof(SelectableMenuGroupBase) + "! Either use one or extend this functionality to not require it.");
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/// <summary>
|
|
211
|
+
///
|
|
212
|
+
/// </summary>
|
|
213
|
+
/// <param name="current"></param>
|
|
214
|
+
protected virtual void DisplayBulletInfo(GameObject current)
|
|
215
|
+
{
|
|
216
|
+
TruthBullet truthBullet = evidence.GetBullet(current.GetComponentInChildren<TextMeshProUGUI>().text);
|
|
217
|
+
|
|
218
|
+
DisplayBulletInfo(truthBullet);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/// <summary>
|
|
222
|
+
///
|
|
223
|
+
/// </summary>
|
|
224
|
+
/// <param name="truthBullet"></param>
|
|
225
|
+
protected virtual void DisplayBulletInfo(TruthBullet truthBullet)
|
|
226
|
+
{
|
|
227
|
+
if (truthBullet.Image != null)
|
|
228
|
+
bulletImage.sprite = truthBullet.Image;
|
|
229
|
+
|
|
230
|
+
string builtDescription = truthBullet
|
|
231
|
+
.OfType<IBuildableDescription>()?[truthBullet.Description, TruthBulletDataHandler.pieceBullets];
|
|
232
|
+
|
|
233
|
+
if (!string.IsNullOrEmpty(builtDescription))
|
|
234
|
+
bulletText.text = builtDescription;
|
|
235
|
+
else
|
|
236
|
+
bulletText.text = truthBullet.Description;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
239
|
}
|
package/TruthBulletMenu.cs.meta
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 70930a5b736e8e448ab6077c69bdd029
|
|
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: 70930a5b736e8e448ab6077c69bdd029
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.DialogueMechanics.Investigation;
|
|
3
|
-
using UnityEngine;
|
|
4
|
-
|
|
5
|
-
namespace DREditor.UI.Menus
|
|
6
|
-
{
|
|
7
|
-
/// <summary>
|
|
8
|
-
///
|
|
9
|
-
/// </summary>
|
|
10
|
-
[ClassHeader(nameof(IUnlockableUIOption) +
|
|
11
|
-
"\n\n")]
|
|
12
|
-
public class TruthBulletUnlockableOption : MonoBehaviour, IUnlockableUIOption
|
|
13
|
-
{
|
|
14
|
-
/// <summary>
|
|
15
|
-
///
|
|
16
|
-
/// </summary>
|
|
17
|
-
[Tooltip("")]
|
|
18
|
-
[SerializeField] protected TruthBulletDataHandler TruthBulletDataHandler = null;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
protected virtual void Awake()
|
|
22
|
-
{
|
|
23
|
-
if (TruthBulletDataHandler == null &&
|
|
24
|
-
transform.root.GetComponentInChildren<TruthBulletDataHandler>() is TruthBulletDataHandler handler)
|
|
25
|
-
TruthBulletDataHandler = handler;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/// <inheritdoc/>
|
|
29
|
-
public virtual bool IsUnlocked() => TruthBulletDataHandler.foundBullets.Count != 0;
|
|
30
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.DialogueMechanics.Investigation;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.UI.Menus
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
[ClassHeader(nameof(IUnlockableUIOption) +
|
|
11
|
+
"\n\n")]
|
|
12
|
+
public class TruthBulletUnlockableOption : MonoBehaviour, IUnlockableUIOption
|
|
13
|
+
{
|
|
14
|
+
/// <summary>
|
|
15
|
+
///
|
|
16
|
+
/// </summary>
|
|
17
|
+
[Tooltip("")]
|
|
18
|
+
[SerializeField] protected TruthBulletDataHandler TruthBulletDataHandler = null;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
protected virtual void Awake()
|
|
22
|
+
{
|
|
23
|
+
if (TruthBulletDataHandler == null &&
|
|
24
|
+
transform.root.GetComponentInChildren<TruthBulletDataHandler>() is TruthBulletDataHandler handler)
|
|
25
|
+
TruthBulletDataHandler = handler;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// <inheritdoc/>
|
|
29
|
+
public virtual bool IsUnlocked() => TruthBulletDataHandler.foundBullets.Count != 0;
|
|
30
|
+
}
|
|
31
31
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 1f53b07c6a586ed4ca106a7dfc7d7957
|
|
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: 1f53b07c6a586ed4ca106a7dfc7d7957
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|