net.dreditor.presents 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.
Files changed (71) hide show
  1. package/.attestation.p7m +0 -0
  2. package/DREditor.Presents.asmdef +15 -15
  3. package/DREditor.Presents.asmdef.meta +7 -7
  4. package/Editor/CreatePresentsWizard.cs +159 -159
  5. package/Editor/CreatePresentsWizard.cs.meta +11 -11
  6. package/Editor/DREditor.Presents.Editor.asmdef +17 -17
  7. package/Editor/DREditor.Presents.Editor.asmdef.meta +7 -7
  8. package/Editor/DescriptionsByIDOption.cs +105 -105
  9. package/Editor/DescriptionsByIDOption.cs.meta +1 -1
  10. package/Editor/PresentDatabaseEditor.cs +183 -183
  11. package/Editor/PresentDatabaseEditor.cs.meta +11 -11
  12. package/Editor/PresentEditor.cs +152 -152
  13. package/Editor/PresentEditor.cs.meta +11 -11
  14. package/Editor/PresentGoogleSheetsImportOption.cs +54 -54
  15. package/Editor/PresentGoogleSheetsImportOption.cs.meta +1 -1
  16. package/Editor/PresentImportOptionBase.cs +131 -131
  17. package/Editor/PresentImportOptionBase.cs.meta +1 -1
  18. package/Editor/PresentReactionLevelOption.cs +80 -80
  19. package/Editor/PresentReactionLevelOption.cs.meta +1 -1
  20. package/Editor/PresentUtility.cs +41 -41
  21. package/Editor/PresentUtility.cs.meta +11 -11
  22. package/Editor/ReactionByIDCharactersOption.cs +135 -135
  23. package/Editor/ReactionByIDCharactersOption.cs.meta +1 -1
  24. package/Editor/ReactionByIDOption.cs +53 -53
  25. package/Editor/ReactionByIDOption.cs.meta +1 -1
  26. package/Editor/ReactionImportOption.cs +73 -73
  27. package/Editor/ReactionImportOption.cs.meta +1 -1
  28. package/Editor/ReactionImporter.cs +58 -58
  29. package/Editor/ReactionImporter.cs.meta +11 -11
  30. package/Editor/RenamePresentsByIDOption.cs +95 -95
  31. package/Editor/RenamePresentsByIDOption.cs.meta +1 -1
  32. package/Editor/StudentReactionCollectionEditor.cs +103 -103
  33. package/Editor/StudentReactionCollectionEditor.cs.meta +1 -1
  34. package/Editor/StudentReactionEditor.cs +82 -82
  35. package/Editor/StudentReactionEditor.cs.meta +1 -1
  36. package/Editor.meta +8 -8
  37. package/IAmountablePresent.cs +28 -28
  38. package/IAmountablePresent.cs.meta +1 -1
  39. package/INewPresentObtained.cs +21 -21
  40. package/INewPresentObtained.cs.meta +1 -1
  41. package/IPresentData.cs +9 -9
  42. package/IPresentData.cs.meta +1 -1
  43. package/IPresentManager.cs +37 -37
  44. package/IPresentManager.cs.meta +1 -1
  45. package/IReactionEntry.cs +20 -20
  46. package/IReactionEntry.cs.meta +1 -1
  47. package/Present.cs +23 -23
  48. package/Present.cs.meta +11 -11
  49. package/PresentData.cs +49 -49
  50. package/PresentData.cs.meta +11 -11
  51. package/PresentDatabase.cs +27 -27
  52. package/PresentDatabase.cs.meta +11 -11
  53. package/PresentManager.cs +70 -70
  54. package/PresentManager.cs.meta +11 -11
  55. package/PresentManagerBase.cs +34 -34
  56. package/PresentManagerBase.cs.meta +1 -1
  57. package/PresentReactionLevel.cs +12 -12
  58. package/PresentReactionLevel.cs.meta +11 -11
  59. package/PresentSaveBase.cs +25 -25
  60. package/PresentSaveBase.cs.meta +1 -1
  61. package/ReactionLevelDatabase.cs +34 -34
  62. package/ReactionLevelDatabase.cs.meta +11 -11
  63. package/{Samples → Samples~}/Present_Manager.prefab +54 -54
  64. package/{Samples → Samples~}/Present_Manager.prefab.meta +7 -7
  65. package/StudentReaction.cs +27 -27
  66. package/StudentReaction.cs.meta +1 -1
  67. package/StudentReactionCollection.cs +44 -44
  68. package/StudentReactionCollection.cs.meta +1 -1
  69. package/package.json +39 -34
  70. package/package.json.meta +7 -7
  71. package/Samples.meta +0 -8
@@ -1,153 +1,153 @@
1
- // Original Author: KHeartz
2
- // Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
3
- #if UNITY_EDITOR
4
- using DREditor.Editor.Toolbox;
5
- using DREditor.Editor.Utility;
6
- using System.Collections.Generic;
7
- using System.Linq;
8
- using UnityEditor;
9
-
10
- namespace DREditor.Presents.Editor
11
- {
12
- /// <summary>
13
- ///
14
- /// </summary>
15
- [CustomEditor(typeof(Present))]
16
- public class PresentEditor : InventoryItemEditor, INestedEditorCacheable
17
- {
18
- /// <summary>
19
- ///
20
- /// </summary>
21
- protected Present present;
22
-
23
- /// <summary>
24
- ///
25
- /// </summary>
26
- protected SerializedProperty propID;
27
-
28
- /// <summary>
29
- ///
30
- /// </summary>
31
- protected Dictionary<object, bool> visibilityCaches = new();
32
-
33
- /// <summary>
34
- ///
35
- /// </summary>
36
- protected Dictionary<object, int> indexCaches = new();
37
-
38
- /// <summary>
39
- ///
40
- /// </summary>
41
- protected List<object> dataCaches = new();
42
-
43
- /// <summary>
44
- ///
45
- /// </summary>
46
- protected bool showUI = false;
47
-
48
- /// <summary>
49
- ///
50
- /// </summary>
51
- protected InterfaceEditor<IPresentData> presentDataEditor;
52
-
53
-
54
- /// <summary>
55
- ///
56
- /// </summary>
57
- private readonly string AttributesFieldName = "attributes";
58
-
59
- /// <summary>
60
- ///
61
- /// </summary>
62
- protected readonly string IDPropertyString = "id";
63
-
64
- /// <summary>
65
- ///
66
- /// </summary>
67
- protected readonly string IDLabel = "ID No. ";
68
-
69
-
70
- public Dictionary<object, bool> VisibilityCaches => visibilityCaches;
71
-
72
- public Dictionary<object, int> IndexCaches => indexCaches;
73
-
74
-
75
- /// <inheritdoc/>
76
- protected override void OnEnable()
77
- {
78
- present = target as Present;
79
-
80
- base.OnEnable();
81
-
82
- presentDataEditor = new(this, present.attributes, true);
83
- }
84
-
85
- /// <inheritdoc/>
86
- protected override void InitializeSerializedProperties()
87
- {
88
- base.InitializeSerializedProperties();
89
-
90
- propID = serializedObject.FindProperty(IDPropertyString);
91
- }
92
-
93
- /// <inheritdoc/>
94
- public override void OnInspectorGUI()
95
- {
96
- serializedObject.Update();
97
-
98
- HandyFields.Label(nameof(Present));
99
-
100
- DisplayItemData();
101
-
102
- EditorUtility.SetDirty(present);
103
-
104
- serializedObject.ApplyModifiedProperties();
105
- }
106
-
107
- /// <inheritdoc/>
108
- protected override void DisplayItemData()
109
- {
110
- base.DisplayItemData();
111
-
112
- DisplayAttributes();
113
- }
114
-
115
- /// <summary>
116
- ///
117
- /// </summary>
118
- protected virtual void DisplayAttributes()
119
- {
120
- var presentDataProperty = serializedObject.FindProperty(AttributesFieldName);
121
-
122
- presentDataEditor.DisplayInterfaceInstances(presentDataProperty, this, presentDataProperty, presentDataEditor);
123
-
124
- showUI = presentDataEditor.showDiaEvents;
125
- }
126
-
127
- /// <inheritdoc/>
128
- protected override void DisplayName()
129
- {
130
- base.DisplayName();
131
-
132
- DisplayID();
133
- }
134
-
135
- /// <summary>
136
- ///
137
- /// </summary>
138
- protected virtual void DisplayID() => HandyFields.HardPropertyField(IDLabel, propID);
139
-
140
- /// <inheritdoc/>
141
- public virtual void AddData(object obj) => dataCaches.Add(obj);
142
-
143
- /// <inheritdoc/>
144
- public virtual bool TryGetData<T>(out T data)
145
- {
146
- data = dataCaches.OfType<T>().FirstOrDefault();
147
-
148
- return data != null;
149
- }
150
- }
151
- }
152
-
1
+ // Original Author: KHeartz
2
+ // Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
3
+ #if UNITY_EDITOR
4
+ using DREditor.Editor.Toolbox;
5
+ using DREditor.Editor.Utility;
6
+ using System.Collections.Generic;
7
+ using System.Linq;
8
+ using UnityEditor;
9
+
10
+ namespace DREditor.Presents.Editor
11
+ {
12
+ /// <summary>
13
+ ///
14
+ /// </summary>
15
+ [CustomEditor(typeof(Present))]
16
+ public class PresentEditor : InventoryItemEditor, INestedEditorCacheable
17
+ {
18
+ /// <summary>
19
+ ///
20
+ /// </summary>
21
+ protected Present present;
22
+
23
+ /// <summary>
24
+ ///
25
+ /// </summary>
26
+ protected SerializedProperty propID;
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ protected Dictionary<object, bool> visibilityCaches = new();
32
+
33
+ /// <summary>
34
+ ///
35
+ /// </summary>
36
+ protected Dictionary<object, int> indexCaches = new();
37
+
38
+ /// <summary>
39
+ ///
40
+ /// </summary>
41
+ protected List<object> dataCaches = new();
42
+
43
+ /// <summary>
44
+ ///
45
+ /// </summary>
46
+ protected bool showUI = false;
47
+
48
+ /// <summary>
49
+ ///
50
+ /// </summary>
51
+ protected InterfaceEditor<IPresentData> presentDataEditor;
52
+
53
+
54
+ /// <summary>
55
+ ///
56
+ /// </summary>
57
+ private readonly string AttributesFieldName = "attributes";
58
+
59
+ /// <summary>
60
+ ///
61
+ /// </summary>
62
+ protected readonly string IDPropertyString = "id";
63
+
64
+ /// <summary>
65
+ ///
66
+ /// </summary>
67
+ protected readonly string IDLabel = "ID No. ";
68
+
69
+
70
+ public Dictionary<object, bool> VisibilityCaches => visibilityCaches;
71
+
72
+ public Dictionary<object, int> IndexCaches => indexCaches;
73
+
74
+
75
+ /// <inheritdoc/>
76
+ protected override void OnEnable()
77
+ {
78
+ present = target as Present;
79
+
80
+ base.OnEnable();
81
+
82
+ presentDataEditor = new(this, present.attributes, true);
83
+ }
84
+
85
+ /// <inheritdoc/>
86
+ protected override void InitializeSerializedProperties()
87
+ {
88
+ base.InitializeSerializedProperties();
89
+
90
+ propID = serializedObject.FindProperty(IDPropertyString);
91
+ }
92
+
93
+ /// <inheritdoc/>
94
+ public override void OnInspectorGUI()
95
+ {
96
+ serializedObject.Update();
97
+
98
+ HandyFields.Label(nameof(Present));
99
+
100
+ DisplayItemData();
101
+
102
+ EditorUtility.SetDirty(present);
103
+
104
+ serializedObject.ApplyModifiedProperties();
105
+ }
106
+
107
+ /// <inheritdoc/>
108
+ protected override void DisplayItemData()
109
+ {
110
+ base.DisplayItemData();
111
+
112
+ DisplayAttributes();
113
+ }
114
+
115
+ /// <summary>
116
+ ///
117
+ /// </summary>
118
+ protected virtual void DisplayAttributes()
119
+ {
120
+ var presentDataProperty = serializedObject.FindProperty(AttributesFieldName);
121
+
122
+ presentDataEditor.DisplayInterfaceInstances(presentDataProperty, this, presentDataProperty, presentDataEditor);
123
+
124
+ showUI = presentDataEditor.showDiaEvents;
125
+ }
126
+
127
+ /// <inheritdoc/>
128
+ protected override void DisplayName()
129
+ {
130
+ base.DisplayName();
131
+
132
+ DisplayID();
133
+ }
134
+
135
+ /// <summary>
136
+ ///
137
+ /// </summary>
138
+ protected virtual void DisplayID() => HandyFields.HardPropertyField(IDLabel, propID);
139
+
140
+ /// <inheritdoc/>
141
+ public virtual void AddData(object obj) => dataCaches.Add(obj);
142
+
143
+ /// <inheritdoc/>
144
+ public virtual bool TryGetData<T>(out T data)
145
+ {
146
+ data = dataCaches.OfType<T>().FirstOrDefault();
147
+
148
+ return data != null;
149
+ }
150
+ }
151
+ }
152
+
153
153
  #endif
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 8e35500fce46e3c498cfb2a204fdc447
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: 8e35500fce46e3c498cfb2a204fdc447
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,55 +1,55 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- #if UNITY_EDITOR
3
- using System;
4
- using System.Collections.Generic;
5
- using System.Linq;
6
- using System.Text.RegularExpressions;
7
-
8
- namespace DREditor.Presents.Editor
9
- {
10
- /// <summary>
11
- ///
12
- /// </summary>
13
- [Serializable]
14
- public abstract class PresentGoogleSheetsImportOption : PresentImportOptionBase
15
- {
16
- /// <summary>
17
- ///
18
- /// </summary>
19
- /// <param name="pattern"></param>
20
- /// <returns></returns>
21
- protected virtual List<string> GetListOfNamesGoogleSheetFormat(string pattern)
22
- {
23
- var matches = Regex.Matches(textArea, pattern);
24
-
25
- List<string> words = new();
26
-
27
- foreach (Match match in matches)
28
- if (match.Value == string.Empty || string.IsNullOrWhiteSpace(match.Value))
29
- continue;
30
- else
31
- words.Add(match.Value.Replace(tab, ""));
32
-
33
- return words;
34
- }
35
-
36
- /// <summary>
37
- ///
38
- /// </summary>
39
- /// <param name="ids"></param>
40
- /// <param name="words"></param>
41
- /// <param name="dictionary"></param>
42
- protected virtual void CreatePairing(List<int> ids, List<string> words, out Dictionary<int, string> dictionary)
43
- {
44
- var count = Math.Min(ids.Count, words.Count);
45
-
46
- dictionary = ids.Take(count)
47
- .Zip(words.Take(count), (id, word) => new { id, word })
48
- .ToDictionary(pair => pair.id, pair => pair.word);
49
-
50
- foreach (var pair in dictionary)
51
- UnityEngine.Debug.Log($"Key: {pair.Key}, Value: {pair.Value}");
52
- }
53
- }
54
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if UNITY_EDITOR
3
+ using System;
4
+ using System.Collections.Generic;
5
+ using System.Linq;
6
+ using System.Text.RegularExpressions;
7
+
8
+ namespace DREditor.Presents.Editor
9
+ {
10
+ /// <summary>
11
+ ///
12
+ /// </summary>
13
+ [Serializable]
14
+ public abstract class PresentGoogleSheetsImportOption : PresentImportOptionBase
15
+ {
16
+ /// <summary>
17
+ ///
18
+ /// </summary>
19
+ /// <param name="pattern"></param>
20
+ /// <returns></returns>
21
+ protected virtual List<string> GetListOfNamesGoogleSheetFormat(string pattern)
22
+ {
23
+ var matches = Regex.Matches(textArea, pattern);
24
+
25
+ List<string> words = new();
26
+
27
+ foreach (Match match in matches)
28
+ if (match.Value == string.Empty || string.IsNullOrWhiteSpace(match.Value))
29
+ continue;
30
+ else
31
+ words.Add(match.Value.Replace(tab, ""));
32
+
33
+ return words;
34
+ }
35
+
36
+ /// <summary>
37
+ ///
38
+ /// </summary>
39
+ /// <param name="ids"></param>
40
+ /// <param name="words"></param>
41
+ /// <param name="dictionary"></param>
42
+ protected virtual void CreatePairing(List<int> ids, List<string> words, out Dictionary<int, string> dictionary)
43
+ {
44
+ var count = Math.Min(ids.Count, words.Count);
45
+
46
+ dictionary = ids.Take(count)
47
+ .Zip(words.Take(count), (id, word) => new { id, word })
48
+ .ToDictionary(pair => pair.id, pair => pair.word);
49
+
50
+ foreach (var pair in dictionary)
51
+ UnityEngine.Debug.Log($"Key: {pair.Key}, Value: {pair.Value}");
52
+ }
53
+ }
54
+ }
55
55
  #endif
@@ -1,2 +1,2 @@
1
- fileFormatVersion: 2
1
+ fileFormatVersion: 2
2
2
  guid: 5bcca821dd5129b40a5910844eeb25b6