@rpg-engine/long-bow 0.4.10 → 0.4.82

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.4.10",
3
+ "version": "0.4.82",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "dependencies": {
85
85
  "@rollup/plugin-image": "^2.1.1",
86
- "@rpg-engine/shared": "^0.8.13",
86
+ "@rpg-engine/shared": "^0.8.15",
87
87
  "dayjs": "^1.11.2",
88
88
  "font-awesome": "^4.7.0",
89
89
  "fs-extra": "^10.1.0",
@@ -10,6 +10,7 @@ export interface IBarProps {
10
10
  displayText?: boolean;
11
11
  percentageWidth?: number;
12
12
  minWidth?: number;
13
+ mobileScale?: number;
13
14
  }
14
15
 
15
16
  export const ProgressBar: React.FC<IBarProps> = ({
@@ -20,6 +21,7 @@ export const ProgressBar: React.FC<IBarProps> = ({
20
21
  percentageWidth = 40,
21
22
  minWidth = 100,
22
23
  style,
24
+ mobileScale,
23
25
  }) => {
24
26
  value = Math.round(value);
25
27
  max = Math.round(max);
@@ -39,6 +41,7 @@ export const ProgressBar: React.FC<IBarProps> = ({
39
41
  percentageWidth={percentageWidth}
40
42
  minWidth={minWidth}
41
43
  style={style}
44
+ mobileScale={mobileScale}
42
45
  >
43
46
  {displayText && (
44
47
  <TextOverlay>
@@ -82,6 +85,7 @@ interface IContainerProps {
82
85
  percentageWidth?: number;
83
86
  minWidth?: number;
84
87
  style?: Record<string, any>;
88
+ mobileScale?: number;
85
89
  }
86
90
 
87
91
  const Container = styled.div<IContainerProps>`
@@ -92,4 +96,7 @@ const Container = styled.div<IContainerProps>`
92
96
  justify-content: start;
93
97
  align-items: flex-start;
94
98
  ${props => props.style}
99
+ @media (max-width: 950px) {
100
+ transform: scale(${props => props.mobileScale});
101
+ }
95
102
  `;
@@ -35,9 +35,17 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
35
35
  skillPointsToNextLevel = getSPForLevel(level + 1);
36
36
  }
37
37
 
38
- const nextLevelSPWillbe = skillPoints + skillPointsToNextLevel;
38
+ const SPLevelActual = getSPForLevel(level + 1);
39
+ const SPLevelBefore = getSPForLevel(level);
40
+ const SPcalc = SPLevelActual - SPLevelBefore;
39
41
 
40
- const ratio = (skillPoints / nextLevelSPWillbe) * 100;
42
+ const ratio = () => {
43
+ if (level === 1) {
44
+ return (skillPoints / SPLevelActual) * 100;
45
+ }
46
+ return ((skillPoints - SPLevelBefore) / SPcalc) * 100;
47
+ };
48
+ //const ratio = ((skillPoints - SPLevelBefore) / SPcalc) * 100;
41
49
 
42
50
  const skillsBuffsCalc = () => {
43
51
  if (buffAndDebuff) {
@@ -109,13 +117,13 @@ export const SkillProgressBar: React.FC<ISkillProgressBarProps> = ({
109
117
  </ProgressIconContainer>
110
118
 
111
119
  <ProgressBarContainer>
112
- <SimpleProgressBar value={ratio} bgColor={bgColor} />
120
+ <SimpleProgressBar value={ratio()} bgColor={bgColor} />
113
121
  </ProgressBarContainer>
114
122
  </ProgressBody>
115
123
  {showSkillPoints && (
116
124
  <SkillDisplayContainer>
117
125
  <SkillPointsDisplay>
118
- {skillPoints}/{nextLevelSPWillbe}
126
+ {skillPoints}/{getSPForLevel(level + 1)}
119
127
  </SkillPointsDisplay>
120
128
  </SkillDisplayContainer>
121
129
  )}
@@ -10,9 +10,9 @@ export const skillMock = {
10
10
  },
11
11
  magic: {
12
12
  type: SkillType.BasicAttributes,
13
- level: 1,
14
- skillPoints: 22,
15
- skillPointsToNextLevel: 80,
13
+ level: 2,
14
+ skillPoints: 48.12,
15
+ skillPointsToNextLevel: 74.25,
16
16
  buffAndDebuff: -10
17
17
  },
18
18
  magicResistance: {
@@ -20,4 +20,5 @@ Default.args = {
20
20
  max: 100,
21
21
  value: 30,
22
22
  color: 'blue',
23
+ mobileScale: 0.8,
23
24
  };