@rpg-engine/long-bow 0.3.52 → 0.3.53
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/CircularController/CircularController.d.ts +1 -2
- package/dist/components/Item/Inventory/ItemContainer.d.ts +1 -2
- package/dist/components/Shortcuts/Shortcuts.d.ts +1 -10
- package/dist/components/Shortcuts/ShortcutsSetter.d.ts +1 -1
- package/dist/components/Spellbook/Spellbook.d.ts +1 -2
- package/dist/components/Spellbook/constants.d.ts +1 -1
- package/dist/long-bow.cjs.development.js +89 -94
- 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 +87 -93
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/CircularController/CircularController.tsx +2 -1
- package/src/components/Item/Inventory/ItemContainer.tsx +1 -1
- package/src/components/Shortcuts/Shortcuts.tsx +2 -11
- package/src/components/Shortcuts/ShortcutsSetter.tsx +7 -2
- package/src/components/Spellbook/Spellbook.tsx +1 -2
- package/src/components/Spellbook/constants.ts +1 -1
- package/src/stories/ItemContainer.stories.tsx +7 -2
- package/src/stories/Spellbook.stories.tsx +1 -1
package/dist/long-bow.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Component, useState, useEffect, useRef, useMemo, Fragment } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { GRID_WIDTH, GRID_HEIGHT, getItemTextureKeyPath, ItemSubType, ItemContainerType, ItemType, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemRarities, ItemSlotType, getSPForLevel, PeriodOfDay, isMobileOrTablet } from '@rpg-engine/shared';
|
|
3
|
+
import { GRID_WIDTH, GRID_HEIGHT, ShortcutType, getItemTextureKeyPath, ItemSubType, ItemContainerType, ItemType, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemRarities, ItemSlotType, getSPForLevel, PeriodOfDay, isMobileOrTablet } from '@rpg-engine/shared';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import { ErrorBoundary as ErrorBoundary$1 } from 'react-error-boundary';
|
|
6
6
|
import { RxPaperPlane } from 'react-icons/rx';
|
|
@@ -33058,95 +33058,6 @@ var SingleShortcut = /*#__PURE__*/styled.button.withConfig({
|
|
|
33058
33058
|
componentId: "sc-vz5ev8-0"
|
|
33059
33059
|
})(["width:3rem;height:3rem;background-color:", ";border:2px solid ", ";border-radius:50%;text-transform:uppercase;font-size:0.7rem;font-weight:bold;display:flex;align-items:center;justify-content:center;position:relative;span{pointer-events:none;}.mana{position:absolute;top:-5px;right:0;font-size:0.65rem;color:", ";}.qty{position:absolute;top:-5px;right:0;font-size:0.65rem;}.magicWords{margin-top:4px;}.keyboard{position:absolute;bottom:-5px;left:0;font-size:0.65rem;color:", ";}&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}&:disabled{opacity:0.5;}"], uiColors.lightGray, uiColors.darkGray, uiColors.blue, uiColors.yellow, uiColors.darkGray, uiColors.gray);
|
|
33060
33060
|
|
|
33061
|
-
var ShortcutType;
|
|
33062
|
-
(function (ShortcutType) {
|
|
33063
|
-
ShortcutType[ShortcutType["Spell"] = 0] = "Spell";
|
|
33064
|
-
ShortcutType[ShortcutType["Item"] = 1] = "Item";
|
|
33065
|
-
ShortcutType[ShortcutType["None"] = 2] = "None";
|
|
33066
|
-
})(ShortcutType || (ShortcutType = {}));
|
|
33067
|
-
var Shortcuts = function Shortcuts(_ref) {
|
|
33068
|
-
var shortcuts = _ref.shortcuts,
|
|
33069
|
-
onShortcutCast = _ref.onShortcutCast,
|
|
33070
|
-
mana = _ref.mana,
|
|
33071
|
-
_ref$isBlockedCasting = _ref.isBlockedCastingByKeyboard,
|
|
33072
|
-
isBlockedCastingByKeyboard = _ref$isBlockedCasting === void 0 ? false : _ref$isBlockedCasting,
|
|
33073
|
-
atlasJSON = _ref.atlasJSON,
|
|
33074
|
-
atlasIMG = _ref.atlasIMG,
|
|
33075
|
-
inventory = _ref.inventory;
|
|
33076
|
-
useEffect(function () {
|
|
33077
|
-
var handleKeyDown = function handleKeyDown(e) {
|
|
33078
|
-
if (isBlockedCastingByKeyboard) return;
|
|
33079
|
-
var shortcutIndex = Number(e.key) - 1;
|
|
33080
|
-
if (shortcutIndex >= 0 && shortcutIndex <= 5) {
|
|
33081
|
-
onShortcutCast(shortcutIndex);
|
|
33082
|
-
}
|
|
33083
|
-
};
|
|
33084
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
33085
|
-
return function () {
|
|
33086
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
33087
|
-
};
|
|
33088
|
-
}, [shortcuts, isBlockedCastingByKeyboard]);
|
|
33089
|
-
return React.createElement(List, null, Array.from({
|
|
33090
|
-
length: 6
|
|
33091
|
-
}).map(function (_, i) {
|
|
33092
|
-
var _shortcuts$i, _shortcuts$i3, _payload$manaCost;
|
|
33093
|
-
if (((_shortcuts$i = shortcuts[i]) == null ? void 0 : _shortcuts$i.type) === ShortcutType.Item) {
|
|
33094
|
-
var _shortcuts$i2;
|
|
33095
|
-
var _payload = (_shortcuts$i2 = shortcuts[i]) == null ? void 0 : _shortcuts$i2.payload;
|
|
33096
|
-
var itemsFromEquipment = [];
|
|
33097
|
-
if (inventory) {
|
|
33098
|
-
Object.keys(inventory.slots).forEach(function (i) {
|
|
33099
|
-
var _inventory$slots$inde;
|
|
33100
|
-
var index = parseInt(i);
|
|
33101
|
-
if (((_inventory$slots$inde = inventory.slots[index]) == null ? void 0 : _inventory$slots$inde.key) === (_payload == null ? void 0 : _payload.key)) {
|
|
33102
|
-
itemsFromEquipment.push(inventory.slots[index]);
|
|
33103
|
-
}
|
|
33104
|
-
});
|
|
33105
|
-
}
|
|
33106
|
-
var totalQty = itemsFromEquipment.reduce(function (acc, item) {
|
|
33107
|
-
return acc + ((item == null ? void 0 : item.stackQty) || 1);
|
|
33108
|
-
}, 0);
|
|
33109
|
-
return React.createElement(SingleShortcut, {
|
|
33110
|
-
key: i,
|
|
33111
|
-
onClick: onShortcutCast.bind(null, i),
|
|
33112
|
-
disabled: false
|
|
33113
|
-
}, _payload && React.createElement(SpriteFromAtlas, {
|
|
33114
|
-
atlasIMG: atlasIMG,
|
|
33115
|
-
atlasJSON: atlasJSON,
|
|
33116
|
-
spriteKey: getItemTextureKeyPath({
|
|
33117
|
-
key: _payload.texturePath,
|
|
33118
|
-
texturePath: _payload.texturePath,
|
|
33119
|
-
stackQty: _payload.stackQty || 1
|
|
33120
|
-
}, atlasJSON),
|
|
33121
|
-
width: 32,
|
|
33122
|
-
height: 32
|
|
33123
|
-
}), React.createElement("span", {
|
|
33124
|
-
className: "qty"
|
|
33125
|
-
}, totalQty), React.createElement("span", {
|
|
33126
|
-
className: "keyboard"
|
|
33127
|
-
}, i + 1));
|
|
33128
|
-
}
|
|
33129
|
-
var payload = (_shortcuts$i3 = shortcuts[i]) == null ? void 0 : _shortcuts$i3.payload;
|
|
33130
|
-
return React.createElement(SingleShortcut, {
|
|
33131
|
-
key: i,
|
|
33132
|
-
onClick: onShortcutCast.bind(null, i),
|
|
33133
|
-
disabled: mana < ((_payload$manaCost = payload == null ? void 0 : payload.manaCost) != null ? _payload$manaCost : 0)
|
|
33134
|
-
}, React.createElement("span", {
|
|
33135
|
-
className: "mana"
|
|
33136
|
-
}, payload && payload.manaCost), React.createElement("span", {
|
|
33137
|
-
className: "magicWords"
|
|
33138
|
-
}, payload == null ? void 0 : payload.magicWords.split(' ').map(function (word) {
|
|
33139
|
-
return word[0];
|
|
33140
|
-
})), React.createElement("span", {
|
|
33141
|
-
className: "keyboard"
|
|
33142
|
-
}, i + 1));
|
|
33143
|
-
}));
|
|
33144
|
-
};
|
|
33145
|
-
var List = /*#__PURE__*/styled.p.withConfig({
|
|
33146
|
-
displayName: "Shortcuts__List",
|
|
33147
|
-
componentId: "sc-kgtsi7-0"
|
|
33148
|
-
})(["width:100%;display:flex;align-items:center;justify-content:center;gap:0.5rem;box-sizing:border-box;margin:0 !important;"]);
|
|
33149
|
-
|
|
33150
33061
|
var CircularController = function CircularController(_ref) {
|
|
33151
33062
|
var onActionClick = _ref.onActionClick,
|
|
33152
33063
|
onCancelClick = _ref.onCancelClick,
|
|
@@ -34471,7 +34382,7 @@ var ShortcutsSetter = function ShortcutsSetter(_ref) {
|
|
|
34471
34382
|
return word[0];
|
|
34472
34383
|
}));
|
|
34473
34384
|
};
|
|
34474
|
-
return React.createElement(Container$b, null, React.createElement("p", null, "Shortcuts:"), React.createElement(List
|
|
34385
|
+
return React.createElement(Container$b, null, React.createElement("p", null, "Shortcuts:"), React.createElement(List, {
|
|
34475
34386
|
id: "shortcuts_list"
|
|
34476
34387
|
}, Array.from({
|
|
34477
34388
|
length: 6
|
|
@@ -34498,7 +34409,7 @@ var Shortcut = /*#__PURE__*/styled.button.withConfig({
|
|
|
34498
34409
|
var isBeingSet = _ref2.isBeingSet;
|
|
34499
34410
|
return isBeingSet ? uiColors.yellow : uiColors.darkGray;
|
|
34500
34411
|
}, uiColors.darkGray, uiColors.gray);
|
|
34501
|
-
var List
|
|
34412
|
+
var List = /*#__PURE__*/styled.div.withConfig({
|
|
34502
34413
|
displayName: "ShortcutsSetter__List",
|
|
34503
34414
|
componentId: "sc-xuouuf-2"
|
|
34504
34415
|
})(["width:100%;display:flex;align-items:center;gap:0.5rem;padding-bottom:0.5rem;padding-left:0.5rem;box-sizing:border-box;margin:0 !important;"]);
|
|
@@ -35340,6 +35251,89 @@ var RPGUIRoot = function RPGUIRoot(_ref) {
|
|
|
35340
35251
|
}, children);
|
|
35341
35252
|
};
|
|
35342
35253
|
|
|
35254
|
+
var Shortcuts = function Shortcuts(_ref) {
|
|
35255
|
+
var shortcuts = _ref.shortcuts,
|
|
35256
|
+
onShortcutCast = _ref.onShortcutCast,
|
|
35257
|
+
mana = _ref.mana,
|
|
35258
|
+
_ref$isBlockedCasting = _ref.isBlockedCastingByKeyboard,
|
|
35259
|
+
isBlockedCastingByKeyboard = _ref$isBlockedCasting === void 0 ? false : _ref$isBlockedCasting,
|
|
35260
|
+
atlasJSON = _ref.atlasJSON,
|
|
35261
|
+
atlasIMG = _ref.atlasIMG,
|
|
35262
|
+
inventory = _ref.inventory;
|
|
35263
|
+
useEffect(function () {
|
|
35264
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
35265
|
+
if (isBlockedCastingByKeyboard) return;
|
|
35266
|
+
var shortcutIndex = Number(e.key) - 1;
|
|
35267
|
+
if (shortcutIndex >= 0 && shortcutIndex <= 5) {
|
|
35268
|
+
onShortcutCast(shortcutIndex);
|
|
35269
|
+
}
|
|
35270
|
+
};
|
|
35271
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
35272
|
+
return function () {
|
|
35273
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
35274
|
+
};
|
|
35275
|
+
}, [shortcuts, isBlockedCastingByKeyboard]);
|
|
35276
|
+
return React.createElement(List$1, null, Array.from({
|
|
35277
|
+
length: 6
|
|
35278
|
+
}).map(function (_, i) {
|
|
35279
|
+
var _shortcuts$i, _shortcuts$i3, _payload$manaCost;
|
|
35280
|
+
if (((_shortcuts$i = shortcuts[i]) == null ? void 0 : _shortcuts$i.type) === ShortcutType.Item) {
|
|
35281
|
+
var _shortcuts$i2;
|
|
35282
|
+
var _payload = (_shortcuts$i2 = shortcuts[i]) == null ? void 0 : _shortcuts$i2.payload;
|
|
35283
|
+
var itemsFromEquipment = [];
|
|
35284
|
+
if (inventory) {
|
|
35285
|
+
Object.keys(inventory.slots).forEach(function (i) {
|
|
35286
|
+
var _inventory$slots$inde;
|
|
35287
|
+
var index = parseInt(i);
|
|
35288
|
+
if (((_inventory$slots$inde = inventory.slots[index]) == null ? void 0 : _inventory$slots$inde.key) === (_payload == null ? void 0 : _payload.key)) {
|
|
35289
|
+
itemsFromEquipment.push(inventory.slots[index]);
|
|
35290
|
+
}
|
|
35291
|
+
});
|
|
35292
|
+
}
|
|
35293
|
+
var totalQty = itemsFromEquipment.reduce(function (acc, item) {
|
|
35294
|
+
return acc + ((item == null ? void 0 : item.stackQty) || 1);
|
|
35295
|
+
}, 0);
|
|
35296
|
+
return React.createElement(SingleShortcut, {
|
|
35297
|
+
key: i,
|
|
35298
|
+
onClick: onShortcutCast.bind(null, i),
|
|
35299
|
+
disabled: false
|
|
35300
|
+
}, _payload && React.createElement(SpriteFromAtlas, {
|
|
35301
|
+
atlasIMG: atlasIMG,
|
|
35302
|
+
atlasJSON: atlasJSON,
|
|
35303
|
+
spriteKey: getItemTextureKeyPath({
|
|
35304
|
+
key: _payload.texturePath,
|
|
35305
|
+
texturePath: _payload.texturePath,
|
|
35306
|
+
stackQty: _payload.stackQty || 1
|
|
35307
|
+
}, atlasJSON),
|
|
35308
|
+
width: 32,
|
|
35309
|
+
height: 32
|
|
35310
|
+
}), React.createElement("span", {
|
|
35311
|
+
className: "qty"
|
|
35312
|
+
}, totalQty), React.createElement("span", {
|
|
35313
|
+
className: "keyboard"
|
|
35314
|
+
}, i + 1));
|
|
35315
|
+
}
|
|
35316
|
+
var payload = (_shortcuts$i3 = shortcuts[i]) == null ? void 0 : _shortcuts$i3.payload;
|
|
35317
|
+
return React.createElement(SingleShortcut, {
|
|
35318
|
+
key: i,
|
|
35319
|
+
onClick: onShortcutCast.bind(null, i),
|
|
35320
|
+
disabled: mana < ((_payload$manaCost = payload == null ? void 0 : payload.manaCost) != null ? _payload$manaCost : 0)
|
|
35321
|
+
}, React.createElement("span", {
|
|
35322
|
+
className: "mana"
|
|
35323
|
+
}, payload && payload.manaCost), React.createElement("span", {
|
|
35324
|
+
className: "magicWords"
|
|
35325
|
+
}, payload == null ? void 0 : payload.magicWords.split(' ').map(function (word) {
|
|
35326
|
+
return word[0];
|
|
35327
|
+
})), React.createElement("span", {
|
|
35328
|
+
className: "keyboard"
|
|
35329
|
+
}, i + 1));
|
|
35330
|
+
}));
|
|
35331
|
+
};
|
|
35332
|
+
var List$1 = /*#__PURE__*/styled.p.withConfig({
|
|
35333
|
+
displayName: "Shortcuts__List",
|
|
35334
|
+
componentId: "sc-kgtsi7-0"
|
|
35335
|
+
})(["width:100%;display:flex;align-items:center;justify-content:center;gap:0.5rem;box-sizing:border-box;margin:0 !important;"]);
|
|
35336
|
+
|
|
35343
35337
|
var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
35344
35338
|
var value = _ref.value,
|
|
35345
35339
|
_ref$bgColor = _ref.bgColor,
|
|
@@ -36238,5 +36232,5 @@ var DialogContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
36238
36232
|
componentId: "sc-u6oe75-1"
|
|
36239
36233
|
})(["display:flex;justify-content:center;padding-top:200px;"]);
|
|
36240
36234
|
|
|
36241
|
-
export { Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, CheckButton, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, ErrorBoundary, HistoryDialog, ImgSide, Input, InputRadio, ItemContainer$1 as ItemContainer, ItemSelector, ItemSlot, ListMenu, NPCDialog, NPCDialogType, NPCMultiDialog, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType,
|
|
36235
|
+
export { Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, CheckButton, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, ErrorBoundary, HistoryDialog, ImgSide, Input, InputRadio, ItemContainer$1 as ItemContainer, ItemSelector, ItemSlot, ListMenu, NPCDialog, NPCDialogType, NPCMultiDialog, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, Shortcuts, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, TextArea, TimeWidget, TradingMenu, Truncate, _RPGUI, useEventListener };
|
|
36242
36236
|
//# sourceMappingURL=long-bow.esm.js.map
|