@rpg-engine/long-bow 0.6.73 → 0.6.74
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/dist/long-bow.cjs.development.js +12 -6
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +12 -6
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/QuestList.tsx +22 -13
package/package.json
CHANGED
|
@@ -115,20 +115,29 @@ const formatObjectives = (
|
|
|
115
115
|
|
|
116
116
|
// Updated helper function to format rewards
|
|
117
117
|
const formatRewards = (rewards: IQuest['rewards']) => {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
118
|
+
try {
|
|
119
|
+
if (!rewards || !Array.isArray(rewards)) return 'No rewards';
|
|
120
|
+
return rewards
|
|
121
|
+
.map(reward => {
|
|
122
|
+
return `${formatText(
|
|
123
|
+
reward?.itemKeys
|
|
124
|
+
?.map(itemKey => itemKey + ' x' + reward?.qty)
|
|
125
|
+
.join(', ')
|
|
126
|
+
)}${
|
|
127
|
+
reward?.spellKeys
|
|
128
|
+
? `, Spells: ${formatText(reward.spellKeys.join(', '))}`
|
|
129
|
+
: ''
|
|
130
|
+
}`;
|
|
131
|
+
})
|
|
132
|
+
.join('; ');
|
|
133
|
+
} catch (error) {
|
|
134
|
+
console.error(
|
|
135
|
+
`Error formatting rewards: ${JSON.stringify(rewards)}:`,
|
|
136
|
+
error
|
|
137
|
+
);
|
|
138
|
+
return 'Error on rewards';
|
|
139
|
+
}
|
|
130
140
|
};
|
|
131
|
-
|
|
132
141
|
const formatText = (text: string) => {
|
|
133
142
|
return text
|
|
134
143
|
.split('-')
|