@rpg-engine/long-bow 0.6.48 → 0.6.49
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 +6 -0
- 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 +6 -0
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SkillProgressBar.tsx +9 -0
package/package.json
CHANGED
|
@@ -37,6 +37,15 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
37
37
|
initialSkillPointsToNextLevel || getSPForLevel(initialLevel + 1)
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
+
// Update skill points and level from props when they change
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setLevel(initialLevel);
|
|
43
|
+
setSkillPoints(initialSkillPoints);
|
|
44
|
+
setSkillPointsToNextLevel(
|
|
45
|
+
initialSkillPointsToNextLevel || getSPForLevel(initialLevel + 1)
|
|
46
|
+
);
|
|
47
|
+
}, [initialLevel, initialSkillPoints, initialSkillPointsToNextLevel]);
|
|
48
|
+
|
|
40
49
|
useEffect(() => {
|
|
41
50
|
if (skillPoints >= skillPointsToNextLevel) {
|
|
42
51
|
const excessSkillPoints = skillPoints - skillPointsToNextLevel;
|