@rpg-engine/long-bow 0.6.55 → 0.6.57
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/components/Tooltip/Tooltip.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +13 -13
- 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 +14 -14
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SkillProgressBar.tsx +18 -16
- package/src/components/SkillsContainer.tsx +4 -7
- package/src/components/Tooltip/Tooltip.tsx +19 -0
- package/src/mocks/skills.mocks.ts +14 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Tooltip: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -32126,6 +32126,11 @@ var ProgressBarContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
32126
32126
|
return props.margin;
|
|
32127
32127
|
});
|
|
32128
32128
|
|
|
32129
|
+
var Tooltip = /*#__PURE__*/styled__default.div.withConfig({
|
|
32130
|
+
displayName: "Tooltip",
|
|
32131
|
+
componentId: "sc-m78j13-0"
|
|
32132
|
+
})(["visibility:hidden;position:absolute;background-color:black;color:white;text-align:center;border-radius:4px;padding:5px;z-index:1;font-size:0.5rem;white-space:nowrap;top:-20px;left:50%;transform:translateX(-50%);"]);
|
|
32133
|
+
|
|
32129
32134
|
var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
32130
32135
|
var bgColor = _ref.bgColor,
|
|
32131
32136
|
skillName = _ref.skillName,
|
|
@@ -32139,13 +32144,9 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
32139
32144
|
atlasJSON = _ref.atlasJSON,
|
|
32140
32145
|
buffAndDebuff = _ref.buffAndDebuff;
|
|
32141
32146
|
// Base skill points for the previous level (0 for level 1)
|
|
32142
|
-
var baseSkillPointsPrevLevel =
|
|
32143
|
-
// Total skill points needed for the next level
|
|
32144
|
-
var nextLevelSkillPoints = skillPointsToNextLevel;
|
|
32145
|
-
// Calculate excess skill points above the previous level
|
|
32146
|
-
var excessSkillPoints = Math.max(currentSkillPoints - baseSkillPointsPrevLevel, 0);
|
|
32147
|
+
var baseSkillPointsPrevLevel = shared.getSPForLevel(level - 1) || 0;
|
|
32147
32148
|
// Calculate progress percentage towards the next level
|
|
32148
|
-
var progress = Math.min(100, Math.max(0,
|
|
32149
|
+
var progress = Math.min(100, Math.max(0, (currentSkillPoints - baseSkillPointsPrevLevel) / (skillPointsToNextLevel - baseSkillPointsPrevLevel) * 100));
|
|
32149
32150
|
var skillsBuffsCalc = function skillsBuffsCalc(level, buffAndDebuff) {
|
|
32150
32151
|
var result = level * (buffAndDebuff / 100);
|
|
32151
32152
|
return result > 0 ? "+" + result.toFixed(2) : "" + result.toFixed(2);
|
|
@@ -32157,15 +32158,15 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
32157
32158
|
imgScale: 1,
|
|
32158
32159
|
grayScale: true,
|
|
32159
32160
|
opacity: 0.5
|
|
32160
|
-
}))) : React__default.createElement(React__default.Fragment, null)), React__default.createElement(
|
|
32161
|
+
}))) : React__default.createElement(React__default.Fragment, null)), React__default.createElement(ProgressBarWrapper, null, React__default.createElement(SimpleProgressBar, {
|
|
32161
32162
|
value: progress,
|
|
32162
32163
|
bgColor: bgColor
|
|
32163
|
-
}))), showSkillPoints && React__default.createElement(SkillDisplayContainer, null, React__default.createElement(SkillPointsDisplay, null, progress.toFixed(2), "%")));
|
|
32164
|
+
}), React__default.createElement(Tooltip, null, "SP: ", currentSkillPoints))), showSkillPoints && React__default.createElement(SkillDisplayContainer, null, React__default.createElement(SkillPointsDisplay, null, progress.toFixed(2), "%")));
|
|
32164
32165
|
};
|
|
32165
|
-
var
|
|
32166
|
-
displayName: "
|
|
32166
|
+
var ProgressBarWrapper = /*#__PURE__*/styled__default.div.withConfig({
|
|
32167
|
+
displayName: "SkillProgressBar__ProgressBarWrapper",
|
|
32167
32168
|
componentId: "sc-5vuroc-0"
|
|
32168
|
-
})(["position:relative
|
|
32169
|
+
})(["position:relative;&:hover ", ",&:active ", "{visibility:visible;}width:100%;height:auto;top:8px;"], Tooltip, Tooltip);
|
|
32169
32170
|
var SpriteContainer$2 = /*#__PURE__*/styled__default.div.withConfig({
|
|
32170
32171
|
displayName: "SkillProgressBar__SpriteContainer",
|
|
32171
32172
|
componentId: "sc-5vuroc-1"
|
|
@@ -32300,14 +32301,13 @@ var SkillsContainer = function SkillsContainer(_ref) {
|
|
|
32300
32301
|
if (!skillDetails) {
|
|
32301
32302
|
continue;
|
|
32302
32303
|
}
|
|
32303
|
-
var skillPointsToNextLevel = shared.calculateSPToNextLevel(skillDetails.skillPoints, skillDetails.level);
|
|
32304
32304
|
output.push(React__default.createElement(SkillProgressBar, {
|
|
32305
32305
|
key: key,
|
|
32306
32306
|
skillName: skillNameMap[key],
|
|
32307
32307
|
bgColor: skillCategoryColor,
|
|
32308
32308
|
level: skillDetails.level || 0,
|
|
32309
32309
|
skillPoints: Math.round(skillDetails.skillPoints) || 0,
|
|
32310
|
-
skillPointsToNextLevel:
|
|
32310
|
+
skillPointsToNextLevel: Math.round(shared.getSPForLevel(skillDetails.level + 1)) || 0,
|
|
32311
32311
|
texturePath: value,
|
|
32312
32312
|
atlasIMG: atlasIMG,
|
|
32313
32313
|
atlasJSON: atlasJSON,
|