@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.6.47",
3
+ "version": "0.6.48",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -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 ?? getSPForLevel(initialLevel + 1)
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 for progress bar, ensuring it doesn't exceed 100%
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>{ratio.toFixed(2)}%</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.6rem !important;
157
+ font-size: 0.55rem !important;
157
158
  font-weight: bold;
158
159
  text-align: center;
159
160
  `;