@gamelearn/arcade-components 2.14.9 → 2.15.0
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.
|
@@ -103,6 +103,13 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
var emitGameData = function emitGameData(choice) {
|
|
107
|
+
emitEvent({
|
|
108
|
+
type: 'decisionJournal',
|
|
109
|
+
payload: choice
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
106
113
|
var onNext = function onNext(choice) {
|
|
107
114
|
if (!failed && selectedView === 'results') {
|
|
108
115
|
playSound('click-ui');
|
|
@@ -110,12 +117,15 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
110
117
|
if (inherited) {
|
|
111
118
|
if (simplifiedOptions) {
|
|
112
119
|
if (_onFinish) {
|
|
120
|
+
emitGameData(choice);
|
|
121
|
+
|
|
113
122
|
_onFinish(choice, function () {
|
|
114
123
|
setResultChoice({});
|
|
115
124
|
selectView('options');
|
|
116
125
|
});
|
|
117
126
|
}
|
|
118
127
|
} else {
|
|
128
|
+
emitGameData(choice);
|
|
119
129
|
emitEvent({
|
|
120
130
|
type: 'addPoints',
|
|
121
131
|
payload: choice.rewards,
|
|
@@ -139,6 +149,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
139
149
|
});
|
|
140
150
|
}
|
|
141
151
|
} else {
|
|
152
|
+
emitGameData(choice);
|
|
142
153
|
emitEvent({
|
|
143
154
|
type: 'addPoints',
|
|
144
155
|
payload: choice.rewards,
|
|
@@ -157,6 +168,7 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
157
168
|
|
|
158
169
|
if (!branched) {
|
|
159
170
|
if (inherited || required) {
|
|
171
|
+
emitGameData(choice);
|
|
160
172
|
emitEvent({
|
|
161
173
|
type: 'addPoints',
|
|
162
174
|
payload: choice.rewards,
|
|
@@ -174,6 +186,10 @@ var DecisionComponent = function DecisionComponent(_ref) {
|
|
|
174
186
|
playCurrentAudio(choice);
|
|
175
187
|
selectView('results');
|
|
176
188
|
} else {
|
|
189
|
+
emitGameData(_objectSpread(_objectSpread({}, choice), {}, {
|
|
190
|
+
simplified: true
|
|
191
|
+
}));
|
|
192
|
+
|
|
177
193
|
_onFinish(choice, function () {
|
|
178
194
|
setResultChoice({});
|
|
179
195
|
selectView('options');
|