bnstooltips 1.21.2 → 1.22.0
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/build/SkillTooltip/SkillTooltip.d.ts +1 -1
- package/build/SkillTooltip/SkillTooltip.types.d.ts +1 -0
- package/build/SkillTooltipWrapper/SkillTooltipWrapper.types.d.ts +1 -0
- package/build/Utilities/Helpers.d.ts +2 -1
- package/build/Utilities/ISkill.d.ts +13 -1
- package/build/index.es.js +74 -11
- package/build/index.es.js.map +1 -1
- package/build/index.js +74 -11
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -159,7 +159,7 @@ function BuildIconPath(iconPath, iconIndex) {
|
|
|
159
159
|
iconPath = iconPath.substring(1);
|
|
160
160
|
}
|
|
161
161
|
if (iconPath.startsWith("/Game/")) {
|
|
162
|
-
var split = iconPath.split(
|
|
162
|
+
var split = iconPath.split("/");
|
|
163
163
|
var last = split[split.length - 1];
|
|
164
164
|
var penultimate = split[split.length - 2];
|
|
165
165
|
if (last === penultimate) {
|
|
@@ -288,7 +288,7 @@ function getMoneyObj(money) {
|
|
|
288
288
|
var copper = 0;
|
|
289
289
|
if (money === 0)
|
|
290
290
|
return null;
|
|
291
|
-
var digits = money.toString().split(
|
|
291
|
+
var digits = money.toString().split("");
|
|
292
292
|
var realDigits = digits.map(Number);
|
|
293
293
|
var i = 0;
|
|
294
294
|
var subCurrencyIndex = [0, 0, 0];
|
|
@@ -322,13 +322,29 @@ function getMoneyObj(money) {
|
|
|
322
322
|
return {
|
|
323
323
|
Copper: copper,
|
|
324
324
|
Gold: gold,
|
|
325
|
-
Silver: silver
|
|
325
|
+
Silver: silver,
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
328
|
function GetSkillMasteryValue(points, arcaneInfo) {
|
|
329
329
|
if (points <= 0 || arcaneInfo == null)
|
|
330
330
|
return 0;
|
|
331
|
-
return arcaneInfo.IsCooldown
|
|
331
|
+
return arcaneInfo.IsCooldown
|
|
332
|
+
? GetSkillMasteryCdValueForPoints(points, arcaneInfo.CooldownBreakpoints)
|
|
333
|
+
: GetSkillMasteryValueForPoints(points, arcaneInfo.DamageSections);
|
|
334
|
+
}
|
|
335
|
+
function GetSkillMasteryValue2(points, arcaneInfo) {
|
|
336
|
+
if (points <= 0 || arcaneInfo == undefined || arcaneInfo == null)
|
|
337
|
+
return 0;
|
|
338
|
+
if (arcaneInfo.Type === 0)
|
|
339
|
+
return 0; // No modification
|
|
340
|
+
if (arcaneInfo.Type === 1) {
|
|
341
|
+
// Damage modification
|
|
342
|
+
return GetSkillMasteryValueForPoints(points, arcaneInfo.Breakpoints);
|
|
343
|
+
}
|
|
344
|
+
if (arcaneInfo.Type === 2) {
|
|
345
|
+
// Cooldown modification
|
|
346
|
+
return GetSkillMasteryCdValueForPoints(points, arcaneInfo.Breakpoints);
|
|
347
|
+
}
|
|
332
348
|
}
|
|
333
349
|
/**
|
|
334
350
|
* Calculates the cooldown reduction value based on skill mastery points and defined breakpoints.
|
|
@@ -8904,8 +8920,15 @@ function SkillConditions(_a) {
|
|
|
8904
8920
|
React__default["default"].createElement("div", { key: i, dangerouslySetInnerHTML: { __html: sub.Text } }))); })));
|
|
8905
8921
|
}
|
|
8906
8922
|
|
|
8923
|
+
var ArcaneModifyType;
|
|
8924
|
+
(function (ArcaneModifyType) {
|
|
8925
|
+
ArcaneModifyType[ArcaneModifyType["None"] = 0] = "None";
|
|
8926
|
+
ArcaneModifyType[ArcaneModifyType["Damage"] = 1] = "Damage";
|
|
8927
|
+
ArcaneModifyType[ArcaneModifyType["Cooldown"] = 2] = "Cooldown";
|
|
8928
|
+
})(ArcaneModifyType || (ArcaneModifyType = {}));
|
|
8929
|
+
|
|
8907
8930
|
function SkillTooltip(_a) {
|
|
8908
|
-
var data = _a.data, _b = _a.debug, debug = _b === void 0 ? false : _b, _c = _a.masteryPoints, masteryPoints = _c === void 0 ? 0 : _c, _d = _a.multi, multi =
|
|
8931
|
+
var data = _a.data, _b = _a.debug, debug = _b === void 0 ? false : _b, _c = _a.masteryPoints, masteryPoints = _c === void 0 ? 0 : _c, _d = _a.showZeroMastery, showZeroMastery = _d === void 0 ? false : _d, _e = _a.multi, multi = _e === void 0 ? false : _e;
|
|
8909
8932
|
var skill = data;
|
|
8910
8933
|
var tooltipBaseProps = {
|
|
8911
8934
|
title: skill.Name,
|
|
@@ -8926,7 +8949,8 @@ function SkillTooltip(_a) {
|
|
|
8926
8949
|
//bottomPart
|
|
8927
8950
|
AddSubTexts(tooltipBaseProps.subInfoGroups, skill);
|
|
8928
8951
|
AddBreakValue(tooltipBaseProps.subInfoGroups, skill);
|
|
8929
|
-
AddSkillMastery(tooltipBaseProps.subInfoGroups, masteryPoints, skill.ArcaneInfo);
|
|
8952
|
+
AddSkillMastery(tooltipBaseProps.subInfoGroups, masteryPoints, skill.ArcaneInfo, showZeroMastery);
|
|
8953
|
+
AddSkillMastery2(tooltipBaseProps.subInfoGroups, masteryPoints, skill.ArcaneInfo2, showZeroMastery);
|
|
8930
8954
|
AddPvpModifiers(tooltipBaseProps.subInfoGroups, skill);
|
|
8931
8955
|
AddBoundaries(tooltipBaseProps.subInfoGroups, skill);
|
|
8932
8956
|
AddConditions(tooltipBaseProps.subInfoGroups, skill);
|
|
@@ -8979,8 +9003,47 @@ function AddBreakValue(subInfoGroups, skill) {
|
|
|
8979
9003
|
});
|
|
8980
9004
|
}
|
|
8981
9005
|
}
|
|
8982
|
-
function
|
|
8983
|
-
|
|
9006
|
+
function AddSkillMastery2(subInfoGroups, masteryPoints, arcaneInfo2, showZeroMastery) {
|
|
9007
|
+
var _a;
|
|
9008
|
+
if (showZeroMastery === void 0) { showZeroMastery = false; }
|
|
9009
|
+
if (arcaneInfo2 == undefined ||
|
|
9010
|
+
masteryPoints == null ||
|
|
9011
|
+
(masteryPoints == 0 && !showZeroMastery) ||
|
|
9012
|
+
arcaneInfo2 == null)
|
|
9013
|
+
return;
|
|
9014
|
+
var masteryValue = GetSkillMasteryValue2(masteryPoints, arcaneInfo2);
|
|
9015
|
+
if (masteryValue == null)
|
|
9016
|
+
return;
|
|
9017
|
+
var formattedMasteryValue = Number.isInteger(masteryValue)
|
|
9018
|
+
? masteryValue.toString()
|
|
9019
|
+
: masteryValue.toFixed(2).replace(",", ".");
|
|
9020
|
+
var masteryTypeMap = (_a = {},
|
|
9021
|
+
_a[ArcaneModifyType.Damage] = { label: "Damage increase", unit: "%" },
|
|
9022
|
+
_a[ArcaneModifyType.Cooldown] = { label: "Cooldown reduction", unit: " sec." },
|
|
9023
|
+
_a);
|
|
9024
|
+
subInfoGroups.push({
|
|
9025
|
+
title: "",
|
|
9026
|
+
texts: [
|
|
9027
|
+
React__default["default"].createElement("div", null,
|
|
9028
|
+
React__default["default"].createElement("div", { style: { display: "flex", alignItems: "center" } },
|
|
9029
|
+
React__default["default"].createElement("span", { className: "tooltipArg", style: { fontSize: "14px" } }, "Skill Grandmaster"),
|
|
9030
|
+
React__default["default"].createElement("div", { className: "arcanemark" }),
|
|
9031
|
+
React__default["default"].createElement("span", { className: "tooltipArg", style: { fontSize: "14px" } }, masteryPoints)),
|
|
9032
|
+
masteryTypeMap[arcaneInfo2.Type] && (React__default["default"].createElement("div", null,
|
|
9033
|
+
masteryTypeMap[arcaneInfo2.Type].label,
|
|
9034
|
+
":\u00A0",
|
|
9035
|
+
React__default["default"].createElement("span", { className: "tooltipArg" },
|
|
9036
|
+
formattedMasteryValue,
|
|
9037
|
+
masteryTypeMap[arcaneInfo2.Type].unit)))),
|
|
9038
|
+
],
|
|
9039
|
+
});
|
|
9040
|
+
}
|
|
9041
|
+
function AddSkillMastery(subInfoGroups, masteryPoints, arcaneInfo, showZeroMastery) {
|
|
9042
|
+
if (showZeroMastery === void 0) { showZeroMastery = false; }
|
|
9043
|
+
if (arcaneInfo == undefined ||
|
|
9044
|
+
masteryPoints == null ||
|
|
9045
|
+
(masteryPoints == 0 && !showZeroMastery) ||
|
|
9046
|
+
arcaneInfo == null)
|
|
8984
9047
|
return;
|
|
8985
9048
|
var masteryValue = GetSkillMasteryValue(masteryPoints, arcaneInfo);
|
|
8986
9049
|
if (masteryValue == null)
|
|
@@ -9263,9 +9326,9 @@ var css_248z$7 = ".TooltipBase_bns_upgradeRed_color {\n color: #FF2818;\n}\n\n.
|
|
|
9263
9326
|
styleInject(css_248z$7);
|
|
9264
9327
|
|
|
9265
9328
|
var SkillTooltipWrapper = function (_a) {
|
|
9266
|
-
var data = _a.data, children = _a.children, _b = _a.interactive, interactive = _b === void 0 ? false : _b, _c = _a.placement, placement = _c === void 0 ? "right" : _c, _d = _a.followCursor, followCursor$1 = _d === void 0 ? false : _d, _e = _a.trigger, trigger = _e === void 0 ? "mouseenter focus" : _e, _f = _a.showArrow, showArrow = _f === void 0 ? true : _f, _g = _a.debug, debug = _g === void 0 ? false : _g, _h = _a.masteryPoints, masteryPoints = _h === void 0 ? 0 : _h;
|
|
9329
|
+
var data = _a.data, children = _a.children, _b = _a.interactive, interactive = _b === void 0 ? false : _b, _c = _a.placement, placement = _c === void 0 ? "right" : _c, _d = _a.followCursor, followCursor$1 = _d === void 0 ? false : _d, _e = _a.trigger, trigger = _e === void 0 ? "mouseenter focus" : _e, _f = _a.showArrow, showArrow = _f === void 0 ? true : _f, _g = _a.debug, debug = _g === void 0 ? false : _g, _h = _a.masteryPoints, masteryPoints = _h === void 0 ? 0 : _h, _j = _a.showZeroMastery, showZeroMastery = _j === void 0 ? false : _j;
|
|
9267
9330
|
var spanRef = React.useRef(null);
|
|
9268
|
-
var
|
|
9331
|
+
var _k = React.useState(null), childRef = _k[0], setChildRef = _k[1];
|
|
9269
9332
|
/**
|
|
9270
9333
|
* Mount the temporary span element.
|
|
9271
9334
|
* retrieve and store the target element's reference.
|
|
@@ -9278,7 +9341,7 @@ var SkillTooltipWrapper = function (_a) {
|
|
|
9278
9341
|
}, []);
|
|
9279
9342
|
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
9280
9343
|
children,
|
|
9281
|
-
childRef ? (React__default["default"].createElement(Tippy, { arrow: showArrow, trigger: trigger, plugins: [followCursor], followCursor: followCursor$1 &&
|
|
9344
|
+
childRef ? (React__default["default"].createElement(Tippy, { arrow: showArrow, trigger: trigger, plugins: [followCursor], followCursor: followCursor$1 && !interactive && !debug, appendTo: document.body, placement: placement, animation: "fade", interactive: interactive || debug, content: React__default["default"].createElement(SkillTooltip, { data: data, debug: debug, masteryPoints: masteryPoints, showZeroMastery: showZeroMastery }), theme: "grade" + 4, reference: childRef })) : (React__default["default"].createElement("span", { "data-testid": "TooltipWrapper", ref: spanRef, style: { display: "none" } }))));
|
|
9282
9345
|
};
|
|
9283
9346
|
|
|
9284
9347
|
exports.ServerRegion = void 0;
|