@rpg-engine/long-bow 0.6.47 → 0.6.48
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 +5 -5
- 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 +5 -5
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SkillProgressBar.tsx +7 -6
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
34
34
|
const [level, setLevel] = useState(initialLevel);
|
|
35
35
|
const [skillPoints, setSkillPoints] = useState(initialSkillPoints);
|
|
36
36
|
const [skillPointsToNextLevel, setSkillPointsToNextLevel] = useState(
|
|
37
|
-
initialSkillPointsToNextLevel
|
|
37
|
+
initialSkillPointsToNextLevel || getSPForLevel(initialLevel + 1)
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
useEffect(() => {
|
|
@@ -47,13 +47,12 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
47
47
|
}
|
|
48
48
|
}, [skillPoints, skillPointsToNextLevel, level]);
|
|
49
49
|
|
|
50
|
-
// Calculate the ratio
|
|
50
|
+
// Calculate the ratio, ensuring it doesn't exceed 100%
|
|
51
51
|
const ratio = Math.min((skillPoints / skillPointsToNextLevel) * 100, 100);
|
|
52
52
|
|
|
53
53
|
const skillsBuffsCalc = (level: number, buffAndDebuff: number): string => {
|
|
54
54
|
const result = level * (buffAndDebuff / 100);
|
|
55
|
-
|
|
56
|
-
return result > 0 ? `+${result.toFixed(2)}` : `${result.toFixed(2)}`;
|
|
55
|
+
return result > 0 ? `+${result}` : `${result}`;
|
|
57
56
|
};
|
|
58
57
|
|
|
59
58
|
return (
|
|
@@ -124,7 +123,9 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
|
|
|
124
123
|
</ProgressBody>
|
|
125
124
|
{showSkillPoints && (
|
|
126
125
|
<SkillDisplayContainer>
|
|
127
|
-
<SkillPointsDisplay>
|
|
126
|
+
<SkillPointsDisplay>
|
|
127
|
+
{skillPoints} / {skillPointsToNextLevel} ({ratio.toFixed(2)}%)
|
|
128
|
+
</SkillPointsDisplay>
|
|
128
129
|
</SkillDisplayContainer>
|
|
129
130
|
)}
|
|
130
131
|
</>
|
|
@@ -153,7 +154,7 @@ const SkillDisplayContainer = styled.div`
|
|
|
153
154
|
`;
|
|
154
155
|
|
|
155
156
|
const SkillPointsDisplay = styled.p`
|
|
156
|
-
font-size: 0.
|
|
157
|
+
font-size: 0.55rem !important;
|
|
157
158
|
font-weight: bold;
|
|
158
159
|
text-align: center;
|
|
159
160
|
`;
|