@rpg-engine/long-bow 0.3.59 → 0.3.60

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.
@@ -33057,7 +33057,7 @@ var CheckButton = function CheckButton(_ref) {
33057
33057
  var SingleShortcut = /*#__PURE__*/styled.button.withConfig({
33058
33058
  displayName: "SingleShortcut",
33059
33059
  componentId: "sc-vz5ev8-0"
33060
- })(["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
+ })(["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:", ";border-color:", ";}&:disabled{opacity:0.5;}"], uiColors.lightGray, uiColors.darkGray, uiColors.blue, uiColors.yellow, uiColors.darkGray, uiColors.gray, uiColors.yellow);
33061
33061
 
33062
33062
  var CircularController = function CircularController(_ref) {
33063
33063
  var onActionClick = _ref.onActionClick,
@@ -33119,6 +33119,9 @@ var CircularController = function CircularController(_ref) {
33119
33119
  imgScale: 1.4,
33120
33120
  imgStyle: {
33121
33121
  left: '4px'
33122
+ },
33123
+ containerStyle: {
33124
+ pointerEvents: 'none'
33122
33125
  }
33123
33126
  }), React__default.createElement("span", {
33124
33127
  className: "qty"
@@ -33156,7 +33159,7 @@ var CircularController = function CircularController(_ref) {
33156
33159
  var Button$2 = /*#__PURE__*/styled.button.withConfig({
33157
33160
  displayName: "CircularController__Button",
33158
33161
  componentId: "sc-1fewf3h-0"
33159
- })(["width:4.3rem;height:4.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;transition:background-color 0.1s;margin-top:-3rem;&.active{background-color:", ";}.sword{transform:rotate(-45deg);height:2.5rem;width:1.9rem;pointer-events:none;}"], uiColors.lightGray, uiColors.darkGray, uiColors.gray);
33162
+ })(["width:4.3rem;height:4.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;transition:all 0.1s;margin-top:-3rem;&.active{background-color:", ";border-color:", ";}.sword{transform:rotate(-45deg);height:2.5rem;width:1.9rem;pointer-events:none;}"], uiColors.lightGray, uiColors.darkGray, uiColors.gray, uiColors.yellow);
33160
33163
  var CancelButton = /*#__PURE__*/styled(Button$2).withConfig({
33161
33164
  displayName: "CircularController__CancelButton",
33162
33165
  componentId: "sc-1fewf3h-1"
@@ -33172,7 +33175,7 @@ var ShortcutsContainer = /*#__PURE__*/styled.div.withConfig({
33172
33175
  var StyledShortcut = /*#__PURE__*/styled(SingleShortcut).withConfig({
33173
33176
  displayName: "CircularController__StyledShortcut",
33174
33177
  componentId: "sc-1fewf3h-4"
33175
- })(["width:2.5rem;height:2.5rem;transition:background-color 0.1s;.mana,.qty{font-size:0.5rem;}&:hover,&:focus,&:active{background-color:", ";}&.active{background-color:", ";}"], uiColors.lightGray, uiColors.gray);
33178
+ })(["width:2.5rem;height:2.5rem;transition:all 0.1s;.mana,.qty{font-size:0.5rem;}&:hover,&:focus,&:active{background-color:", ";}&.active{background-color:", ";border-color:", ";}"], uiColors.lightGray, uiColors.gray, uiColors.yellow);
33176
33179
 
33177
33180
  function useOutsideClick(ref, id) {
33178
33181
  React.useEffect(function () {
@@ -35231,12 +35234,19 @@ var Shortcuts = function Shortcuts(_ref) {
35231
35234
  atlasJSON = _ref.atlasJSON,
35232
35235
  atlasIMG = _ref.atlasIMG,
35233
35236
  inventory = _ref.inventory;
35237
+ var shortcutsRefs = React.useRef([]);
35234
35238
  React.useEffect(function () {
35235
35239
  var handleKeyDown = function handleKeyDown(e) {
35236
35240
  if (isBlockedCastingByKeyboard) return;
35237
35241
  var shortcutIndex = Number(e.key) - 1;
35238
35242
  if (shortcutIndex >= 0 && shortcutIndex <= 5) {
35243
+ var _shortcutsRefs$curren;
35239
35244
  onShortcutCast(shortcutIndex);
35245
+ (_shortcutsRefs$curren = shortcutsRefs.current[shortcutIndex]) == null ? void 0 : _shortcutsRefs$curren.classList.add('active');
35246
+ setTimeout(function () {
35247
+ var _shortcutsRefs$curren2;
35248
+ (_shortcutsRefs$curren2 = shortcutsRefs.current[shortcutIndex]) == null ? void 0 : _shortcutsRefs$curren2.classList.remove('active');
35249
+ }, 150);
35240
35250
  }
35241
35251
  };
35242
35252
  window.addEventListener('keydown', handleKeyDown);
@@ -35264,10 +35274,13 @@ var Shortcuts = function Shortcuts(_ref) {
35264
35274
  var totalQty = itemsFromEquipment.reduce(function (acc, item) {
35265
35275
  return acc + ((item == null ? void 0 : item.stackQty) || 1);
35266
35276
  }, 0);
35267
- return React__default.createElement(SingleShortcut, {
35277
+ return React__default.createElement(StyledShortcut$1, {
35268
35278
  key: i,
35269
35279
  onPointerDown: onShortcutCast.bind(null, i),
35270
- disabled: false
35280
+ disabled: false,
35281
+ ref: function ref(el) {
35282
+ if (el) shortcutsRefs.current[i] = el;
35283
+ }
35271
35284
  }, _payload && React__default.createElement(SpriteFromAtlas, {
35272
35285
  atlasIMG: atlasIMG,
35273
35286
  atlasJSON: atlasJSON,
@@ -35285,10 +35298,13 @@ var Shortcuts = function Shortcuts(_ref) {
35285
35298
  }, i + 1));
35286
35299
  }
35287
35300
  var payload = (_shortcuts$i3 = shortcuts[i]) == null ? void 0 : _shortcuts$i3.payload;
35288
- return React__default.createElement(SingleShortcut, {
35301
+ return React__default.createElement(StyledShortcut$1, {
35289
35302
  key: i,
35290
35303
  onPointerDown: onShortcutCast.bind(null, i),
35291
- disabled: mana < ((_payload$manaCost = payload == null ? void 0 : payload.manaCost) != null ? _payload$manaCost : 0)
35304
+ disabled: mana < ((_payload$manaCost = payload == null ? void 0 : payload.manaCost) != null ? _payload$manaCost : 0),
35305
+ ref: function ref(el) {
35306
+ if (el) shortcutsRefs.current[i] = el;
35307
+ }
35292
35308
  }, React__default.createElement("span", {
35293
35309
  className: "mana"
35294
35310
  }, payload && payload.manaCost), React__default.createElement("span", {
@@ -35300,9 +35316,13 @@ var Shortcuts = function Shortcuts(_ref) {
35300
35316
  }, i + 1));
35301
35317
  }));
35302
35318
  };
35319
+ var StyledShortcut$1 = /*#__PURE__*/styled(SingleShortcut).withConfig({
35320
+ displayName: "Shortcuts__StyledShortcut",
35321
+ componentId: "sc-kgtsi7-0"
35322
+ })(["transition:all 0.15s;&.active{background-color:", ";border-color:", ";}"], uiColors.gray, uiColors.yellow);
35303
35323
  var List$1 = /*#__PURE__*/styled.p.withConfig({
35304
35324
  displayName: "Shortcuts__List",
35305
- componentId: "sc-kgtsi7-0"
35325
+ componentId: "sc-kgtsi7-1"
35306
35326
  })(["width:100%;display:flex;align-items:center;justify-content:center;gap:0.5rem;box-sizing:border-box;margin:0 !important;"]);
35307
35327
 
35308
35328
  var SimpleProgressBar = function SimpleProgressBar(_ref) {