@rpg-engine/long-bow 0.3.51 → 0.3.52
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 +7 -3
- package/dist/components/Item/Inventory/ItemContainer.d.ts +4 -0
- package/dist/components/Item/Inventory/ItemSlot.d.ts +1 -0
- package/dist/components/Shortcuts/Shortcuts.d.ts +21 -0
- package/dist/components/Shortcuts/ShortcutsSetter.d.ts +12 -0
- package/dist/components/Shortcuts/SingleShortcut.d.ts +1 -0
- package/dist/components/Spellbook/Spellbook.d.ts +5 -2
- package/dist/components/Spellbook/constants.d.ts +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/long-bow.cjs.development.js +271 -120
- 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 +273 -120
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/{QuickSpells.stories.d.ts → Shortcuts.stories.d.ts} +2 -2
- package/package.json +1 -1
- package/src/components/Abstractions/SlotsContainer.tsx +2 -2
- package/src/components/CircularController/CircularController.tsx +118 -36
- package/src/components/Item/Inventory/ItemContainer.tsx +39 -4
- package/src/components/Item/Inventory/ItemSlot.tsx +38 -3
- package/src/components/Shortcuts/Shortcuts.tsx +138 -0
- package/src/components/Shortcuts/ShortcutsSetter.tsx +127 -0
- package/src/components/Shortcuts/SingleShortcut.ts +61 -0
- package/src/components/Spellbook/Spellbook.tsx +15 -8
- package/src/components/Spellbook/constants.ts +5 -9
- package/src/components/TradingMenu/TradingMenu.tsx +2 -2
- package/src/components/TradingMenu/items.mock.ts +59 -0
- package/src/index.tsx +1 -1
- package/src/mocks/itemContainer.mocks.ts +22 -20
- package/src/stories/CircullarController.stories.tsx +9 -5
- package/src/stories/ItemContainer.stories.tsx +70 -1
- package/src/stories/Shortcuts.stories.tsx +39 -0
- package/src/stories/Spellbook.stories.tsx +35 -38
- package/dist/components/Spellbook/QuickSpells.d.ts +0 -10
- package/dist/components/Spellbook/SpellbookShortcuts.d.ts +0 -10
- package/src/components/Spellbook/QuickSpells.tsx +0 -120
- package/src/components/Spellbook/SpellbookShortcuts.tsx +0 -77
- package/src/stories/QuickSpells.stories.tsx +0 -38
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, ItemSubType, ItemContainerType, ItemType, ItemSocketEventsDisplayLabels, ActionsForInventory, ActionsForEquipmentSet, ActionsForLoot, ActionsForMapContainer, ItemRarities,
|
|
3
|
+
import { GRID_WIDTH, GRID_HEIGHT, 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';
|
|
@@ -33053,62 +33053,109 @@ var CheckButton = function CheckButton(_ref) {
|
|
|
33053
33053
|
}));
|
|
33054
33054
|
};
|
|
33055
33055
|
|
|
33056
|
-
var
|
|
33057
|
-
|
|
33058
|
-
|
|
33056
|
+
var SingleShortcut = /*#__PURE__*/styled.button.withConfig({
|
|
33057
|
+
displayName: "SingleShortcut",
|
|
33058
|
+
componentId: "sc-vz5ev8-0"
|
|
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
|
+
|
|
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,
|
|
33059
33070
|
mana = _ref.mana,
|
|
33060
33071
|
_ref$isBlockedCasting = _ref.isBlockedCastingByKeyboard,
|
|
33061
|
-
isBlockedCastingByKeyboard = _ref$isBlockedCasting === void 0 ? false : _ref$isBlockedCasting
|
|
33072
|
+
isBlockedCastingByKeyboard = _ref$isBlockedCasting === void 0 ? false : _ref$isBlockedCasting,
|
|
33073
|
+
atlasJSON = _ref.atlasJSON,
|
|
33074
|
+
atlasIMG = _ref.atlasIMG,
|
|
33075
|
+
inventory = _ref.inventory;
|
|
33062
33076
|
useEffect(function () {
|
|
33063
33077
|
var handleKeyDown = function handleKeyDown(e) {
|
|
33064
33078
|
if (isBlockedCastingByKeyboard) return;
|
|
33065
33079
|
var shortcutIndex = Number(e.key) - 1;
|
|
33066
|
-
if (shortcutIndex >= 0 && shortcutIndex <=
|
|
33067
|
-
|
|
33068
|
-
if (shortcut != null && shortcut.key && mana >= (shortcut == null ? void 0 : shortcut.manaCost)) {
|
|
33069
|
-
onSpellCast(shortcut.key);
|
|
33070
|
-
}
|
|
33080
|
+
if (shortcutIndex >= 0 && shortcutIndex <= 5) {
|
|
33081
|
+
onShortcutCast(shortcutIndex);
|
|
33071
33082
|
}
|
|
33072
33083
|
};
|
|
33073
33084
|
window.addEventListener('keydown', handleKeyDown);
|
|
33074
33085
|
return function () {
|
|
33075
33086
|
window.removeEventListener('keydown', handleKeyDown);
|
|
33076
33087
|
};
|
|
33077
|
-
}, [
|
|
33088
|
+
}, [shortcuts, isBlockedCastingByKeyboard]);
|
|
33078
33089
|
return React.createElement(List, null, Array.from({
|
|
33079
|
-
length:
|
|
33090
|
+
length: 6
|
|
33080
33091
|
}).map(function (_, i) {
|
|
33081
|
-
var
|
|
33082
|
-
|
|
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, {
|
|
33083
33131
|
key: i,
|
|
33084
|
-
onClick:
|
|
33085
|
-
disabled: mana < ((
|
|
33132
|
+
onClick: onShortcutCast.bind(null, i),
|
|
33133
|
+
disabled: mana < ((_payload$manaCost = payload == null ? void 0 : payload.manaCost) != null ? _payload$manaCost : 0)
|
|
33086
33134
|
}, React.createElement("span", {
|
|
33087
33135
|
className: "mana"
|
|
33088
|
-
},
|
|
33136
|
+
}, payload && payload.manaCost), React.createElement("span", {
|
|
33089
33137
|
className: "magicWords"
|
|
33090
|
-
},
|
|
33138
|
+
}, payload == null ? void 0 : payload.magicWords.split(' ').map(function (word) {
|
|
33091
33139
|
return word[0];
|
|
33092
33140
|
})), React.createElement("span", {
|
|
33093
33141
|
className: "keyboard"
|
|
33094
33142
|
}, i + 1));
|
|
33095
33143
|
}));
|
|
33096
33144
|
};
|
|
33097
|
-
var SpellShortcut = /*#__PURE__*/styled.button.withConfig({
|
|
33098
|
-
displayName: "QuickSpells__SpellShortcut",
|
|
33099
|
-
componentId: "sc-41yq7s-0"
|
|
33100
|
-
})(["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:", ";}.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);
|
|
33101
33145
|
var List = /*#__PURE__*/styled.p.withConfig({
|
|
33102
|
-
displayName: "
|
|
33103
|
-
componentId: "sc-
|
|
33146
|
+
displayName: "Shortcuts__List",
|
|
33147
|
+
componentId: "sc-kgtsi7-0"
|
|
33104
33148
|
})(["width:100%;display:flex;align-items:center;justify-content:center;gap:0.5rem;box-sizing:border-box;margin:0 !important;"]);
|
|
33105
33149
|
|
|
33106
33150
|
var CircularController = function CircularController(_ref) {
|
|
33107
33151
|
var onActionClick = _ref.onActionClick,
|
|
33108
33152
|
onCancelClick = _ref.onCancelClick,
|
|
33109
|
-
|
|
33153
|
+
onShortcutClick = _ref.onShortcutClick,
|
|
33110
33154
|
mana = _ref.mana,
|
|
33111
|
-
|
|
33155
|
+
shortcuts = _ref.shortcuts,
|
|
33156
|
+
inventory = _ref.inventory,
|
|
33157
|
+
atlasIMG = _ref.atlasIMG,
|
|
33158
|
+
atlasJSON = _ref.atlasJSON;
|
|
33112
33159
|
var onTouchStart = function onTouchStart(e) {
|
|
33113
33160
|
var target = e.target;
|
|
33114
33161
|
target == null ? void 0 : target.classList.add('active');
|
|
@@ -33120,25 +33167,70 @@ var CircularController = function CircularController(_ref) {
|
|
|
33120
33167
|
}, 100);
|
|
33121
33168
|
action();
|
|
33122
33169
|
};
|
|
33123
|
-
|
|
33124
|
-
|
|
33125
|
-
|
|
33126
|
-
|
|
33127
|
-
var
|
|
33128
|
-
|
|
33170
|
+
var renderShortcut = function renderShortcut(i) {
|
|
33171
|
+
var _shortcuts$i, _shortcuts$i2, _shortcuts$i4, _payload$manaCost;
|
|
33172
|
+
var variant = '';
|
|
33173
|
+
if (i === 0) variant = 'top';else if (i >= 3) variant = "bottom-" + (i - 3);
|
|
33174
|
+
var onShortcutClickBinded = ((_shortcuts$i = shortcuts[i]) == null ? void 0 : _shortcuts$i.type) !== ShortcutType.None ? onShortcutClick.bind(null, i) : function () {};
|
|
33175
|
+
if (((_shortcuts$i2 = shortcuts[i]) == null ? void 0 : _shortcuts$i2.type) === ShortcutType.Item) {
|
|
33176
|
+
var _shortcuts$i3;
|
|
33177
|
+
var _payload = (_shortcuts$i3 = shortcuts[i]) == null ? void 0 : _shortcuts$i3.payload;
|
|
33178
|
+
var itemsFromEquipment = [];
|
|
33179
|
+
if (inventory) {
|
|
33180
|
+
Object.keys(inventory.slots).forEach(function (i) {
|
|
33181
|
+
var _inventory$slots$inde;
|
|
33182
|
+
var index = parseInt(i);
|
|
33183
|
+
if (((_inventory$slots$inde = inventory.slots[index]) == null ? void 0 : _inventory$slots$inde.key) === (_payload == null ? void 0 : _payload.key)) {
|
|
33184
|
+
itemsFromEquipment.push(inventory.slots[index]);
|
|
33185
|
+
}
|
|
33186
|
+
});
|
|
33187
|
+
}
|
|
33188
|
+
var totalQty = itemsFromEquipment.reduce(function (acc, item) {
|
|
33189
|
+
return acc + ((item == null ? void 0 : item.stackQty) || 1);
|
|
33190
|
+
}, 0);
|
|
33191
|
+
return React.createElement(StyledShortcut, {
|
|
33192
|
+
key: i,
|
|
33193
|
+
onTouchStart: onTouchStart,
|
|
33194
|
+
onTouchEnd: onTouchEnd.bind(null, onShortcutClickBinded),
|
|
33195
|
+
disabled: false,
|
|
33196
|
+
className: variant
|
|
33197
|
+
}, _payload && React.createElement(SpriteFromAtlas, {
|
|
33198
|
+
atlasIMG: atlasIMG,
|
|
33199
|
+
atlasJSON: atlasJSON,
|
|
33200
|
+
spriteKey: getItemTextureKeyPath({
|
|
33201
|
+
key: _payload.texturePath,
|
|
33202
|
+
texturePath: _payload.texturePath,
|
|
33203
|
+
stackQty: _payload.stackQty || 1
|
|
33204
|
+
}, atlasJSON),
|
|
33205
|
+
width: 32,
|
|
33206
|
+
height: 32,
|
|
33207
|
+
imgScale: 1.4,
|
|
33208
|
+
imgStyle: {
|
|
33209
|
+
left: '4px'
|
|
33210
|
+
}
|
|
33211
|
+
}), React.createElement("span", {
|
|
33212
|
+
className: "qty"
|
|
33213
|
+
}, totalQty));
|
|
33214
|
+
}
|
|
33215
|
+
var payload = (_shortcuts$i4 = shortcuts[i]) == null ? void 0 : _shortcuts$i4.payload;
|
|
33129
33216
|
return React.createElement(StyledShortcut, {
|
|
33130
33217
|
key: i,
|
|
33131
|
-
disabled: mana < (spell == null ? void 0 : spell.manaCost),
|
|
33132
33218
|
onTouchStart: onTouchStart,
|
|
33133
|
-
onTouchEnd: onTouchEnd.bind(null,
|
|
33219
|
+
onTouchEnd: onTouchEnd.bind(null, onShortcutClickBinded),
|
|
33220
|
+
disabled: mana < ((_payload$manaCost = payload == null ? void 0 : payload.manaCost) != null ? _payload$manaCost : 0),
|
|
33134
33221
|
className: variant
|
|
33135
33222
|
}, React.createElement("span", {
|
|
33136
33223
|
className: "mana"
|
|
33137
|
-
},
|
|
33224
|
+
}, payload && payload.manaCost), React.createElement("span", {
|
|
33138
33225
|
className: "magicWords"
|
|
33139
|
-
},
|
|
33226
|
+
}, payload == null ? void 0 : payload.magicWords.split(' ').map(function (word) {
|
|
33140
33227
|
return word[0];
|
|
33141
33228
|
})));
|
|
33229
|
+
};
|
|
33230
|
+
return React.createElement(ButtonsContainer, null, React.createElement(ShortcutsContainer, null, Array.from({
|
|
33231
|
+
length: 6
|
|
33232
|
+
}).map(function (_, i) {
|
|
33233
|
+
return renderShortcut(i);
|
|
33142
33234
|
})), React.createElement(Button$2, {
|
|
33143
33235
|
onTouchStart: onTouchStart,
|
|
33144
33236
|
onTouchEnd: onTouchEnd.bind(null, onActionClick)
|
|
@@ -33152,7 +33244,7 @@ var CircularController = function CircularController(_ref) {
|
|
|
33152
33244
|
var Button$2 = /*#__PURE__*/styled.button.withConfig({
|
|
33153
33245
|
displayName: "CircularController__Button",
|
|
33154
33246
|
componentId: "sc-1fewf3h-0"
|
|
33155
|
-
})(["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;&.active{background-color:", ";}.sword{transform:rotate(-45deg);height:2.5rem;width:1.9rem;pointer-events:none;}"], uiColors.lightGray, uiColors.darkGray, uiColors.gray);
|
|
33247
|
+
})(["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);
|
|
33156
33248
|
var CancelButton = /*#__PURE__*/styled(Button$2).withConfig({
|
|
33157
33249
|
displayName: "CircularController__CancelButton",
|
|
33158
33250
|
componentId: "sc-1fewf3h-1"
|
|
@@ -33161,14 +33253,14 @@ var ButtonsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
33161
33253
|
displayName: "CircularController__ButtonsContainer",
|
|
33162
33254
|
componentId: "sc-1fewf3h-2"
|
|
33163
33255
|
})(["display:flex;align-items:center;justify-content:center;gap:0.5rem;"]);
|
|
33164
|
-
var
|
|
33165
|
-
displayName: "
|
|
33256
|
+
var ShortcutsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33257
|
+
displayName: "CircularController__ShortcutsContainer",
|
|
33166
33258
|
componentId: "sc-1fewf3h-3"
|
|
33167
|
-
})(["display:flex;align-items:center;justify-content:center;gap:0.
|
|
33168
|
-
var StyledShortcut = /*#__PURE__*/styled(
|
|
33259
|
+
})(["display:flex;align-items:center;justify-content:center;gap:0.5rem;flex-direction:column;margin-top:3rem;.top{transform:translate(93%,25%);}.bottom-0{transform:translate(93%,-25%);}.bottom-1{transform:translate(-120%,calc(-5.5rem));}.bottom-2{transform:translate(-30%,calc(-5.5rem - 25%));}"]);
|
|
33260
|
+
var StyledShortcut = /*#__PURE__*/styled(SingleShortcut).withConfig({
|
|
33169
33261
|
displayName: "CircularController__StyledShortcut",
|
|
33170
33262
|
componentId: "sc-1fewf3h-4"
|
|
33171
|
-
})(["width:2.5rem;height:2.5rem;transition:background-color 0.1s;.mana{font-size:0.5rem;}&:hover,&:focus,&:active{background-color:", ";}&.active{background-color:", ";}"], uiColors.lightGray, uiColors.gray);
|
|
33263
|
+
})(["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);
|
|
33172
33264
|
|
|
33173
33265
|
function useOutsideClick(ref, id) {
|
|
33174
33266
|
useEffect(function () {
|
|
@@ -33757,7 +33849,8 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33757
33849
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33758
33850
|
openQuantitySelector = _ref.openQuantitySelector,
|
|
33759
33851
|
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
33760
|
-
dragScale = _ref.dragScale
|
|
33852
|
+
dragScale = _ref.dragScale,
|
|
33853
|
+
isSelectingShortcut = _ref.isSelectingShortcut;
|
|
33761
33854
|
var _useState = useState(false),
|
|
33762
33855
|
isTooltipVisible = _useState[0],
|
|
33763
33856
|
setTooltipVisible = _useState[1];
|
|
@@ -33790,6 +33883,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33790
33883
|
});
|
|
33791
33884
|
setIsFocused(false);
|
|
33792
33885
|
if (item) {
|
|
33886
|
+
console.log(item);
|
|
33793
33887
|
setContextActions(generateContextMenu(item, containerType));
|
|
33794
33888
|
}
|
|
33795
33889
|
}, [item]);
|
|
@@ -33921,12 +34015,14 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33921
34015
|
bubbles: true
|
|
33922
34016
|
});
|
|
33923
34017
|
(_document$elementFrom = document.elementFromPoint(clientX, clientY)) == null ? void 0 : _document$elementFrom.dispatchEvent(simulatedEvent);
|
|
33924
|
-
}
|
|
34018
|
+
},
|
|
34019
|
+
isSelectingShortcut: isSelectingShortcut && ((item == null ? void 0 : item.type) === ItemType.Consumable || (item == null ? void 0 : item.type) === ItemType.Tool)
|
|
33925
34020
|
}, React.createElement(Draggable, {
|
|
34021
|
+
axis: isSelectingShortcut ? 'none' : 'both',
|
|
33926
34022
|
defaultClassName: item ? 'draggable' : 'empty-slot',
|
|
33927
34023
|
scale: dragScale,
|
|
33928
34024
|
onStop: function onStop(e, data) {
|
|
33929
|
-
if (wasDragged && item) {
|
|
34025
|
+
if (wasDragged && item && !isSelectingShortcut) {
|
|
33930
34026
|
var _e$target;
|
|
33931
34027
|
//@ts-ignore
|
|
33932
34028
|
var classes = Array.from((_e$target = e.target) == null ? void 0 : _e$target.classList);
|
|
@@ -33964,12 +34060,12 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33964
34060
|
}
|
|
33965
34061
|
}, 100);
|
|
33966
34062
|
} else if (item) {
|
|
33967
|
-
if (!isContextMenuDisabled) setIsContextMenuVisible(!isContextMenuVisible);
|
|
34063
|
+
if (!isContextMenuDisabled && !isSelectingShortcut) setIsContextMenuVisible(!isContextMenuVisible);
|
|
33968
34064
|
onClick(item.type, containerType, item);
|
|
33969
34065
|
}
|
|
33970
34066
|
},
|
|
33971
34067
|
onStart: function onStart() {
|
|
33972
|
-
if (!item) {
|
|
34068
|
+
if (!item || isSelectingShortcut) {
|
|
33973
34069
|
return;
|
|
33974
34070
|
}
|
|
33975
34071
|
if (onDragStart) {
|
|
@@ -34031,7 +34127,7 @@ var rarityColor = function rarityColor(item) {
|
|
|
34031
34127
|
var Container$a = /*#__PURE__*/styled.div.withConfig({
|
|
34032
34128
|
displayName: "ItemSlot__Container",
|
|
34033
34129
|
componentId: "sc-l2j5ef-0"
|
|
34034
|
-
})(["margin:0.1rem;.sprite-from-atlas-img{position:relative;top:1.5rem;left:1.5rem;border-color:", ";box-shadow:", " inset,", ";}position:relative;"], function (_ref2) {
|
|
34130
|
+
})(["margin:0.1rem;.sprite-from-atlas-img{position:relative;top:1.5rem;left:1.5rem;border-color:", ";box-shadow:", " inset,", ";}position:relative;&::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;border-radius:12px;pointer-events:none;animation:", ";@keyframes bg-color-change{0%{background-color:rgba(255 255 255 / 0.5);}50%{background-color:transparent;}100%{background-color:rgba(255 255 255 / 0.5);}}}"], function (_ref2) {
|
|
34035
34131
|
var item = _ref2.item;
|
|
34036
34132
|
return rarityColor(item);
|
|
34037
34133
|
}, function (_ref3) {
|
|
@@ -34040,6 +34136,9 @@ var Container$a = /*#__PURE__*/styled.div.withConfig({
|
|
|
34040
34136
|
}, function (_ref4) {
|
|
34041
34137
|
var item = _ref4.item;
|
|
34042
34138
|
return "0 0 4px 3px " + rarityColor(item);
|
|
34139
|
+
}, function (_ref5) {
|
|
34140
|
+
var isSelectingShortcut = _ref5.isSelectingShortcut;
|
|
34141
|
+
return isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none';
|
|
34043
34142
|
});
|
|
34044
34143
|
var ItemContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34045
34144
|
displayName: "ItemSlot__ItemContainer",
|
|
@@ -34165,8 +34264,8 @@ var SlotsContainer = function SlotsContainer(_ref) {
|
|
|
34165
34264
|
onClose();
|
|
34166
34265
|
}
|
|
34167
34266
|
},
|
|
34168
|
-
width: "
|
|
34169
|
-
cancelDrag: ".item-container-body",
|
|
34267
|
+
width: "400px",
|
|
34268
|
+
cancelDrag: ".item-container-body, #shortcuts_list",
|
|
34170
34269
|
onPositionChange: function onPositionChange(_ref2) {
|
|
34171
34270
|
var x = _ref2.x,
|
|
34172
34271
|
y = _ref2.y;
|
|
@@ -34338,6 +34437,72 @@ var CloseButton$2 = /*#__PURE__*/styled.div.withConfig({
|
|
|
34338
34437
|
componentId: "sc-yfdtpn-3"
|
|
34339
34438
|
})(["position:absolute;top:3px;right:0px;color:white;z-index:22;font-size:0.8rem;"]);
|
|
34340
34439
|
|
|
34440
|
+
var ShortcutsSetter = function ShortcutsSetter(_ref) {
|
|
34441
|
+
var setSettingShortcutIndex = _ref.setSettingShortcutIndex,
|
|
34442
|
+
settingShortcutIndex = _ref.settingShortcutIndex,
|
|
34443
|
+
shortcuts = _ref.shortcuts,
|
|
34444
|
+
removeShortcut = _ref.removeShortcut,
|
|
34445
|
+
atlasJSON = _ref.atlasJSON,
|
|
34446
|
+
atlasIMG = _ref.atlasIMG;
|
|
34447
|
+
var getContent = function getContent(index) {
|
|
34448
|
+
var _shortcuts$index, _shortcuts$index3;
|
|
34449
|
+
if (((_shortcuts$index = shortcuts[index]) == null ? void 0 : _shortcuts$index.type) === ShortcutType.Item) {
|
|
34450
|
+
var _shortcuts$index2;
|
|
34451
|
+
var _payload = (_shortcuts$index2 = shortcuts[index]) == null ? void 0 : _shortcuts$index2.payload;
|
|
34452
|
+
if (!_payload) return null;
|
|
34453
|
+
return React.createElement(SpriteFromAtlas, {
|
|
34454
|
+
atlasIMG: atlasIMG,
|
|
34455
|
+
atlasJSON: atlasJSON,
|
|
34456
|
+
spriteKey: getItemTextureKeyPath({
|
|
34457
|
+
key: _payload.texturePath,
|
|
34458
|
+
texturePath: _payload.texturePath,
|
|
34459
|
+
stackQty: _payload.stackQty || 1
|
|
34460
|
+
}, atlasJSON),
|
|
34461
|
+
width: 32,
|
|
34462
|
+
height: 32,
|
|
34463
|
+
imgScale: 1.6,
|
|
34464
|
+
imgStyle: {
|
|
34465
|
+
left: '5px'
|
|
34466
|
+
}
|
|
34467
|
+
});
|
|
34468
|
+
}
|
|
34469
|
+
var payload = (_shortcuts$index3 = shortcuts[index]) == null ? void 0 : _shortcuts$index3.payload;
|
|
34470
|
+
return React.createElement("span", null, payload == null ? void 0 : payload.magicWords.split(' ').map(function (word) {
|
|
34471
|
+
return word[0];
|
|
34472
|
+
}));
|
|
34473
|
+
};
|
|
34474
|
+
return React.createElement(Container$b, null, React.createElement("p", null, "Shortcuts:"), React.createElement(List$1, {
|
|
34475
|
+
id: "shortcuts_list"
|
|
34476
|
+
}, Array.from({
|
|
34477
|
+
length: 6
|
|
34478
|
+
}).map(function (_, i) {
|
|
34479
|
+
return React.createElement(Shortcut, {
|
|
34480
|
+
key: i,
|
|
34481
|
+
onClick: function onClick() {
|
|
34482
|
+
removeShortcut(i);
|
|
34483
|
+
if (!shortcuts[i] || shortcuts[i].type === ShortcutType.None) setSettingShortcutIndex(i);
|
|
34484
|
+
},
|
|
34485
|
+
disabled: settingShortcutIndex !== -1 && settingShortcutIndex !== i,
|
|
34486
|
+
isBeingSet: settingShortcutIndex === i
|
|
34487
|
+
}, getContent(i));
|
|
34488
|
+
})));
|
|
34489
|
+
};
|
|
34490
|
+
var Container$b = /*#__PURE__*/styled.div.withConfig({
|
|
34491
|
+
displayName: "ShortcutsSetter__Container",
|
|
34492
|
+
componentId: "sc-xuouuf-0"
|
|
34493
|
+
})(["p{margin:0;margin-left:0.5rem;}"]);
|
|
34494
|
+
var Shortcut = /*#__PURE__*/styled.button.withConfig({
|
|
34495
|
+
displayName: "ShortcutsSetter__Shortcut",
|
|
34496
|
+
componentId: "sc-xuouuf-1"
|
|
34497
|
+
})(["width:2.6rem;height:2.6rem;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;span{margin-top:4px;}&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}&:disabled{opacity:0.5;}"], uiColors.lightGray, function (_ref2) {
|
|
34498
|
+
var isBeingSet = _ref2.isBeingSet;
|
|
34499
|
+
return isBeingSet ? uiColors.yellow : uiColors.darkGray;
|
|
34500
|
+
}, uiColors.darkGray, uiColors.gray);
|
|
34501
|
+
var List$1 = /*#__PURE__*/styled.div.withConfig({
|
|
34502
|
+
displayName: "ShortcutsSetter__List",
|
|
34503
|
+
componentId: "sc-xuouuf-2"
|
|
34504
|
+
})(["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;"]);
|
|
34505
|
+
|
|
34341
34506
|
var ItemContainer$1 = function ItemContainer(_ref) {
|
|
34342
34507
|
var itemContainer = _ref.itemContainer,
|
|
34343
34508
|
onClose = _ref.onClose,
|
|
@@ -34356,7 +34521,10 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34356
34521
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
34357
34522
|
initialPosition = _ref.initialPosition,
|
|
34358
34523
|
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
34359
|
-
dragScale = _ref.dragScale
|
|
34524
|
+
dragScale = _ref.dragScale,
|
|
34525
|
+
shortcuts = _ref.shortcuts,
|
|
34526
|
+
setItemShortcut = _ref.setItemShortcut,
|
|
34527
|
+
removeShortcut = _ref.removeShortcut;
|
|
34360
34528
|
var _useState = useState({
|
|
34361
34529
|
isOpen: false,
|
|
34362
34530
|
maxQuantity: 1,
|
|
@@ -34364,6 +34532,9 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34364
34532
|
}),
|
|
34365
34533
|
quantitySelect = _useState[0],
|
|
34366
34534
|
setQuantitySelect = _useState[1];
|
|
34535
|
+
var _useState2 = useState(-1),
|
|
34536
|
+
settingShortcutIndex = _useState2[0],
|
|
34537
|
+
setSettingShortcutIndex = _useState2[1];
|
|
34367
34538
|
var onRenderSlots = function onRenderSlots() {
|
|
34368
34539
|
var slots = [];
|
|
34369
34540
|
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
@@ -34377,8 +34548,13 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34377
34548
|
onMouseOver: function onMouseOver(event, slotIndex, item) {
|
|
34378
34549
|
if (_onMouseOver) _onMouseOver(event, slotIndex, item);
|
|
34379
34550
|
},
|
|
34380
|
-
onClick: function onClick(
|
|
34381
|
-
if (
|
|
34551
|
+
onClick: function onClick(itemType, containerType, item) {
|
|
34552
|
+
if (settingShortcutIndex !== -1) {
|
|
34553
|
+
setSettingShortcutIndex(-1);
|
|
34554
|
+
if (itemType === ItemType.Consumable || itemType === ItemType.Tool) {
|
|
34555
|
+
setItemShortcut == null ? void 0 : setItemShortcut(item.key, settingShortcutIndex);
|
|
34556
|
+
}
|
|
34557
|
+
} else if (onItemClick) onItemClick(item, itemType, containerType);
|
|
34382
34558
|
},
|
|
34383
34559
|
onSelected: function onSelected(optionId, item) {
|
|
34384
34560
|
if (_onSelected) _onSelected(optionId, item);
|
|
@@ -34406,7 +34582,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34406
34582
|
if (_onOutsideDrop) _onOutsideDrop(item, position);
|
|
34407
34583
|
},
|
|
34408
34584
|
atlasIMG: atlasIMG,
|
|
34409
|
-
atlasJSON: atlasJSON
|
|
34585
|
+
atlasJSON: atlasJSON,
|
|
34586
|
+
isSelectingShortcut: settingShortcutIndex !== -1
|
|
34410
34587
|
}));
|
|
34411
34588
|
}
|
|
34412
34589
|
return slots;
|
|
@@ -34415,7 +34592,14 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34415
34592
|
title: itemContainer.name || 'Container',
|
|
34416
34593
|
onClose: onClose,
|
|
34417
34594
|
initialPosition: initialPosition
|
|
34418
|
-
}, React.createElement(
|
|
34595
|
+
}, type === ItemContainerType.Inventory && shortcuts && removeShortcut && React.createElement(ShortcutsSetter, {
|
|
34596
|
+
setSettingShortcutIndex: setSettingShortcutIndex,
|
|
34597
|
+
settingShortcutIndex: settingShortcutIndex,
|
|
34598
|
+
shortcuts: shortcuts,
|
|
34599
|
+
removeShortcut: removeShortcut,
|
|
34600
|
+
atlasIMG: atlasIMG,
|
|
34601
|
+
atlasJSON: atlasJSON
|
|
34602
|
+
}), React.createElement(ItemsContainer, {
|
|
34419
34603
|
className: "item-container-body"
|
|
34420
34604
|
}, onRenderSlots())), quantitySelect.isOpen && React.createElement(QuantitySelectorContainer, null, React.createElement(ItemQuantitySelector, {
|
|
34421
34605
|
quantity: quantitySelect.maxQuantity,
|
|
@@ -34440,7 +34624,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34440
34624
|
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34441
34625
|
displayName: "ItemContainer__ItemsContainer",
|
|
34442
34626
|
componentId: "sc-15y5p9l-0"
|
|
34443
|
-
})(["
|
|
34627
|
+
})(["display:flex;justify-content:center;flex-wrap:wrap;"]);
|
|
34444
34628
|
var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34445
34629
|
displayName: "ItemContainer__QuantitySelectorContainer",
|
|
34446
34630
|
componentId: "sc-15y5p9l-1"
|
|
@@ -34537,7 +34721,7 @@ var ListMenu = function ListMenu(_ref) {
|
|
|
34537
34721
|
onSelected = _ref.onSelected,
|
|
34538
34722
|
x = _ref.x,
|
|
34539
34723
|
y = _ref.y;
|
|
34540
|
-
return React.createElement(Container$
|
|
34724
|
+
return React.createElement(Container$c, {
|
|
34541
34725
|
x: x,
|
|
34542
34726
|
y: y
|
|
34543
34727
|
}, React.createElement("ul", {
|
|
@@ -34554,7 +34738,7 @@ var ListMenu = function ListMenu(_ref) {
|
|
|
34554
34738
|
}, (params == null ? void 0 : params.text) || 'No text');
|
|
34555
34739
|
})));
|
|
34556
34740
|
};
|
|
34557
|
-
var Container$
|
|
34741
|
+
var Container$c = /*#__PURE__*/styled.div.withConfig({
|
|
34558
34742
|
displayName: "ListMenu__Container",
|
|
34559
34743
|
componentId: "sc-i9097t-0"
|
|
34560
34744
|
})(["display:flex;flex-direction:column;width:100%;justify-content:start;align-items:flex-start;position:absolute;top:", "px;left:", "px;li{font-size:", ";}"], function (props) {
|
|
@@ -34608,7 +34792,7 @@ var NPCMultiDialog = function NPCMultiDialog(_ref) {
|
|
|
34608
34792
|
type: RPGUIContainerTypes.FramedGold,
|
|
34609
34793
|
width: '50%',
|
|
34610
34794
|
height: '180px'
|
|
34611
|
-
}, React.createElement(React.Fragment, null, React.createElement(Container$
|
|
34795
|
+
}, React.createElement(React.Fragment, null, React.createElement(Container$d, null, ((_textAndTypeArray$sli = textAndTypeArray[slide]) == null ? void 0 : _textAndTypeArray$sli.imageSide) === 'right' && React.createElement(React.Fragment, null, React.createElement(TextContainer, {
|
|
34612
34796
|
flex: '70%'
|
|
34613
34797
|
}, React.createElement(NPCDialogText, {
|
|
34614
34798
|
onStartStep: function onStartStep() {
|
|
@@ -34650,7 +34834,7 @@ var NPCMultiDialog = function NPCMultiDialog(_ref) {
|
|
|
34650
34834
|
src: img$7
|
|
34651
34835
|
}))), ")"));
|
|
34652
34836
|
};
|
|
34653
|
-
var Container$
|
|
34837
|
+
var Container$d = /*#__PURE__*/styled.div.withConfig({
|
|
34654
34838
|
displayName: "NPCMultiDialog__Container",
|
|
34655
34839
|
componentId: "sc-rvu5wg-0"
|
|
34656
34840
|
})(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
|
|
@@ -34854,7 +35038,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
34854
35038
|
return null;
|
|
34855
35039
|
});
|
|
34856
35040
|
};
|
|
34857
|
-
return React.createElement(Container$
|
|
35041
|
+
return React.createElement(Container$e, null, React.createElement(QuestionContainer, null, React.createElement(DynamicText, {
|
|
34858
35042
|
text: currentQuestion.text,
|
|
34859
35043
|
onStart: function onStart() {
|
|
34860
35044
|
return setCanShowAnswers(false);
|
|
@@ -34864,7 +35048,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
34864
35048
|
}
|
|
34865
35049
|
})), canShowAnswers && React.createElement(AnswersContainer, null, onRenderCurrentAnswers()));
|
|
34866
35050
|
};
|
|
34867
|
-
var Container$
|
|
35051
|
+
var Container$e = /*#__PURE__*/styled.div.withConfig({
|
|
34868
35052
|
displayName: "QuestionDialog__Container",
|
|
34869
35053
|
componentId: "sc-bxc5u0-0"
|
|
34870
35054
|
})(["display:flex;word-break:break-all;box-sizing:border-box;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;"]);
|
|
@@ -34910,7 +35094,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
34910
35094
|
}
|
|
34911
35095
|
return value * 100 / max;
|
|
34912
35096
|
};
|
|
34913
|
-
return React.createElement(Container$
|
|
35097
|
+
return React.createElement(Container$f, {
|
|
34914
35098
|
className: "rpgui-progress",
|
|
34915
35099
|
"data-value": calculatePercentageValue(max, value) / 100,
|
|
34916
35100
|
"data-rpguitype": "progress",
|
|
@@ -34939,7 +35123,7 @@ var TextOverlay$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
34939
35123
|
displayName: "ProgressBar__TextOverlay",
|
|
34940
35124
|
componentId: "sc-qa6fzh-1"
|
|
34941
35125
|
})(["width:100%;position:relative;"]);
|
|
34942
|
-
var Container$
|
|
35126
|
+
var Container$f = /*#__PURE__*/styled.div.withConfig({
|
|
34943
35127
|
displayName: "ProgressBar__Container",
|
|
34944
35128
|
componentId: "sc-qa6fzh-2"
|
|
34945
35129
|
})(["display:flex;flex-direction:column;min-width:", "px;width:", "%;justify-content:start;align-items:flex-start;", ""], function (props) {
|
|
@@ -35162,7 +35346,7 @@ var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
|
35162
35346
|
bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
|
|
35163
35347
|
_ref$margin = _ref.margin,
|
|
35164
35348
|
margin = _ref$margin === void 0 ? 20 : _ref$margin;
|
|
35165
|
-
return React.createElement(Container$
|
|
35349
|
+
return React.createElement(Container$g, {
|
|
35166
35350
|
className: "simple-progress-bar"
|
|
35167
35351
|
}, React.createElement(ProgressBarContainer, {
|
|
35168
35352
|
margin: margin
|
|
@@ -35171,7 +35355,7 @@ var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
|
35171
35355
|
bgColor: bgColor
|
|
35172
35356
|
}))));
|
|
35173
35357
|
};
|
|
35174
|
-
var Container$
|
|
35358
|
+
var Container$g = /*#__PURE__*/styled.div.withConfig({
|
|
35175
35359
|
displayName: "SimpleProgressBar__Container",
|
|
35176
35360
|
componentId: "sc-mbeil3-0"
|
|
35177
35361
|
})(["display:flex;justify-content:center;align-items:center;width:100%;"]);
|
|
@@ -35399,7 +35583,7 @@ var Spell = function Spell(_ref) {
|
|
|
35399
35583
|
isSettingShortcut = _ref.isSettingShortcut,
|
|
35400
35584
|
minMagicLevelRequired = _ref.minMagicLevelRequired;
|
|
35401
35585
|
var disabled = isSettingShortcut ? charMagicLevel < minMagicLevelRequired : manaCost > charMana || charMagicLevel < minMagicLevelRequired;
|
|
35402
|
-
return React.createElement(Container$
|
|
35586
|
+
return React.createElement(Container$h, {
|
|
35403
35587
|
disabled: disabled,
|
|
35404
35588
|
onClick: onClick == null ? void 0 : onClick.bind(null, spellKey),
|
|
35405
35589
|
isSettingShortcut: isSettingShortcut && !disabled,
|
|
@@ -35412,7 +35596,7 @@ var Spell = function Spell(_ref) {
|
|
|
35412
35596
|
className: "mana"
|
|
35413
35597
|
}, manaCost)));
|
|
35414
35598
|
};
|
|
35415
|
-
var Container$
|
|
35599
|
+
var Container$h = /*#__PURE__*/styled.button.withConfig({
|
|
35416
35600
|
displayName: "Spell__Container",
|
|
35417
35601
|
componentId: "sc-j96fa2-0"
|
|
35418
35602
|
})(["display:block;background:none;border:2px solid transparent;border-radius:1rem;width:100%;display:flex;height:5rem;gap:1rem;align-items:center;padding:0 1rem;text-align:left;position:relative;animation:", ";@keyframes border-color-change{0%{border-color:", ";}50%{border-color:transparent;}100%{border-color:", ";}}&:hover,&:focus{background-color:", ";}&:active{background:none;}"], function (_ref2) {
|
|
@@ -35448,43 +35632,6 @@ var Overlay = /*#__PURE__*/styled.p.withConfig({
|
|
|
35448
35632
|
componentId: "sc-j96fa2-7"
|
|
35449
35633
|
})(["margin:0 !important;position:absolute;top:0;left:0;width:100%;height:100%;border-radius:1rem;display:flex;justify-content:center;align-items:center;color:", ";font-size:", " !important;font-weight:bold;z-index:10;background-color:rgba(0 0 0 / 0.2);"], uiColors.yellow, uiFonts.size.large);
|
|
35450
35634
|
|
|
35451
|
-
var SpellbookShortcuts = function SpellbookShortcuts(_ref) {
|
|
35452
|
-
var setSettingShortcutIndex = _ref.setSettingShortcutIndex,
|
|
35453
|
-
settingShortcutIndex = _ref.settingShortcutIndex,
|
|
35454
|
-
shortcuts = _ref.shortcuts,
|
|
35455
|
-
removeShortcut = _ref.removeShortcut;
|
|
35456
|
-
return React.createElement(List$1, {
|
|
35457
|
-
id: "shortcuts_list"
|
|
35458
|
-
}, "Spells shortcuts:", Array.from({
|
|
35459
|
-
length: 4
|
|
35460
|
-
}).map(function (_, i) {
|
|
35461
|
-
var _shortcuts$i2;
|
|
35462
|
-
return React.createElement(SpellShortcut$1, {
|
|
35463
|
-
key: i,
|
|
35464
|
-
onClick: function onClick() {
|
|
35465
|
-
var _shortcuts$i;
|
|
35466
|
-
removeShortcut(i);
|
|
35467
|
-
if (!((_shortcuts$i = shortcuts[i]) != null && _shortcuts$i.key)) setSettingShortcutIndex(i);
|
|
35468
|
-
},
|
|
35469
|
-
disabled: settingShortcutIndex !== -1 && settingShortcutIndex !== i,
|
|
35470
|
-
isBeingSet: settingShortcutIndex === i
|
|
35471
|
-
}, React.createElement("span", null, (_shortcuts$i2 = shortcuts[i]) == null ? void 0 : _shortcuts$i2.magicWords.split(' ').map(function (word) {
|
|
35472
|
-
return word[0];
|
|
35473
|
-
})));
|
|
35474
|
-
}));
|
|
35475
|
-
};
|
|
35476
|
-
var SpellShortcut$1 = /*#__PURE__*/styled.button.withConfig({
|
|
35477
|
-
displayName: "SpellbookShortcuts__SpellShortcut",
|
|
35478
|
-
componentId: "sc-fr4a0d-0"
|
|
35479
|
-
})(["width:2.6rem;height:2.6rem;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;span{margin-top:4px;}&:hover,&:focus{background-color:", ";}&:active{background-color:", ";}&:disabled{opacity:0.5;}"], uiColors.lightGray, function (_ref2) {
|
|
35480
|
-
var isBeingSet = _ref2.isBeingSet;
|
|
35481
|
-
return isBeingSet ? uiColors.yellow : uiColors.darkGray;
|
|
35482
|
-
}, uiColors.darkGray, uiColors.gray);
|
|
35483
|
-
var List$1 = /*#__PURE__*/styled.p.withConfig({
|
|
35484
|
-
displayName: "SpellbookShortcuts__List",
|
|
35485
|
-
componentId: "sc-fr4a0d-1"
|
|
35486
|
-
})(["width:100%;display:flex;align-items:center;justify-content:flex-end;gap:0.5rem;padding:0.5rem;box-sizing:border-box;margin:0 !important;"]);
|
|
35487
|
-
|
|
35488
35635
|
var Spellbook = function Spellbook(_ref) {
|
|
35489
35636
|
var onClose = _ref.onClose,
|
|
35490
35637
|
onInputFocus = _ref.onInputFocus,
|
|
@@ -35494,8 +35641,10 @@ var Spellbook = function Spellbook(_ref) {
|
|
|
35494
35641
|
mana = _ref.mana,
|
|
35495
35642
|
onSpellClick = _ref.onSpellClick,
|
|
35496
35643
|
setSpellShortcut = _ref.setSpellShortcut,
|
|
35497
|
-
|
|
35498
|
-
|
|
35644
|
+
shortcuts = _ref.shortcuts,
|
|
35645
|
+
removeShortcut = _ref.removeShortcut,
|
|
35646
|
+
atlasIMG = _ref.atlasIMG,
|
|
35647
|
+
atlasJSON = _ref.atlasJSON;
|
|
35499
35648
|
var _useState = useState(''),
|
|
35500
35649
|
search = _useState[0],
|
|
35501
35650
|
setSearch = _useState[1];
|
|
@@ -35532,11 +35681,13 @@ var Spellbook = function Spellbook(_ref) {
|
|
|
35532
35681
|
width: "inherit",
|
|
35533
35682
|
height: "inherit",
|
|
35534
35683
|
cancelDrag: "#spellbook-search, #shortcuts_list, .spell"
|
|
35535
|
-
}, React.createElement(Container$
|
|
35684
|
+
}, React.createElement(Container$i, null, React.createElement(Title$6, null, "Learned Spells"), React.createElement(ShortcutsSetter, {
|
|
35536
35685
|
setSettingShortcutIndex: setSettingShortcutIndex,
|
|
35537
35686
|
settingShortcutIndex: settingShortcutIndex,
|
|
35538
|
-
shortcuts:
|
|
35539
|
-
removeShortcut:
|
|
35687
|
+
shortcuts: shortcuts,
|
|
35688
|
+
removeShortcut: removeShortcut,
|
|
35689
|
+
atlasIMG: atlasIMG,
|
|
35690
|
+
atlasJSON: atlasJSON
|
|
35540
35691
|
}), React.createElement(Input, {
|
|
35541
35692
|
placeholder: "Search for spell",
|
|
35542
35693
|
value: search,
|
|
@@ -35562,7 +35713,7 @@ var Title$6 = /*#__PURE__*/styled.h1.withConfig({
|
|
|
35562
35713
|
displayName: "Spellbook__Title",
|
|
35563
35714
|
componentId: "sc-r02nfq-0"
|
|
35564
35715
|
})(["font-size:", " !important;margin-bottom:0 !important;"], uiFonts.size.large);
|
|
35565
|
-
var Container$
|
|
35716
|
+
var Container$i = /*#__PURE__*/styled.div.withConfig({
|
|
35566
35717
|
displayName: "Spellbook__Container",
|
|
35567
35718
|
componentId: "sc-r02nfq-1"
|
|
35568
35719
|
})(["width:100%;height:100%;color:white;display:flex;flex-direction:column;"]);
|
|
@@ -35795,14 +35946,16 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
35795
35946
|
if (onClose) onClose();
|
|
35796
35947
|
},
|
|
35797
35948
|
width: "600px",
|
|
35798
|
-
cancelDrag: "
|
|
35949
|
+
cancelDrag: "#TraderContainer"
|
|
35799
35950
|
}, React.createElement(React.Fragment, null, React.createElement("div", {
|
|
35800
35951
|
style: {
|
|
35801
35952
|
width: '100%'
|
|
35802
35953
|
}
|
|
35803
35954
|
}, React.createElement(Title$7, null, Capitalize(type), " Menu"), React.createElement("hr", {
|
|
35804
35955
|
className: "golden"
|
|
35805
|
-
})), React.createElement(TradingComponentScrollWrapper,
|
|
35956
|
+
})), React.createElement(TradingComponentScrollWrapper, {
|
|
35957
|
+
id: "TraderContainer"
|
|
35958
|
+
}, traderItems.map(function (tradeItem, index) {
|
|
35806
35959
|
var _qtyMap$get;
|
|
35807
35960
|
return React.createElement(ItemWrapper$1, {
|
|
35808
35961
|
key: tradeItem.key + "_" + index
|
|
@@ -35860,11 +36013,11 @@ var Truncate = function Truncate(_ref) {
|
|
|
35860
36013
|
var _ref$maxLines = _ref.maxLines,
|
|
35861
36014
|
maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
|
|
35862
36015
|
children = _ref.children;
|
|
35863
|
-
return React.createElement(Container$
|
|
36016
|
+
return React.createElement(Container$j, {
|
|
35864
36017
|
maxLines: maxLines
|
|
35865
36018
|
}, children);
|
|
35866
36019
|
};
|
|
35867
|
-
var Container$
|
|
36020
|
+
var Container$j = /*#__PURE__*/styled.div.withConfig({
|
|
35868
36021
|
displayName: "Truncate__Container",
|
|
35869
36022
|
componentId: "sc-6x00qb-0"
|
|
35870
36023
|
})(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
|
|
@@ -35927,7 +36080,7 @@ var NPCDialogText = function NPCDialogText(_ref) {
|
|
|
35927
36080
|
var _useState2 = useState(false),
|
|
35928
36081
|
showGoNextIndicator = _useState2[0],
|
|
35929
36082
|
setShowGoNextIndicator = _useState2[1];
|
|
35930
|
-
return React.createElement(Container$
|
|
36083
|
+
return React.createElement(Container$k, null, React.createElement(DynamicText, {
|
|
35931
36084
|
text: (textChunks == null ? void 0 : textChunks[chunkIndex]) || '',
|
|
35932
36085
|
onFinish: function onFinish() {
|
|
35933
36086
|
setShowGoNextIndicator(true);
|
|
@@ -35945,7 +36098,7 @@ var NPCDialogText = function NPCDialogText(_ref) {
|
|
|
35945
36098
|
}
|
|
35946
36099
|
}));
|
|
35947
36100
|
};
|
|
35948
|
-
var Container$
|
|
36101
|
+
var Container$k = /*#__PURE__*/styled.div.withConfig({
|
|
35949
36102
|
displayName: "NPCDialogText__Container",
|
|
35950
36103
|
componentId: "sc-1cxkdh9-0"
|
|
35951
36104
|
})([""]);
|
|
@@ -35987,7 +36140,7 @@ var NPCDialog = function NPCDialog(_ref) {
|
|
|
35987
36140
|
}
|
|
35988
36141
|
})), type === NPCDialogType.TextAndThumbnail && React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
|
|
35989
36142
|
src: imagePath || img$6
|
|
35990
|
-
}))) : React.createElement(React.Fragment, null, React.createElement(Container$
|
|
36143
|
+
}))) : React.createElement(React.Fragment, null, React.createElement(Container$l, null, React.createElement(TextContainer$2, {
|
|
35991
36144
|
flex: type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'
|
|
35992
36145
|
}, React.createElement(NPCDialogText, {
|
|
35993
36146
|
type: type,
|
|
@@ -36001,7 +36154,7 @@ var NPCDialog = function NPCDialog(_ref) {
|
|
|
36001
36154
|
src: imagePath || img$6
|
|
36002
36155
|
})))));
|
|
36003
36156
|
};
|
|
36004
|
-
var Container$
|
|
36157
|
+
var Container$l = /*#__PURE__*/styled.div.withConfig({
|
|
36005
36158
|
displayName: "NPCDialog__Container",
|
|
36006
36159
|
componentId: "sc-1b4aw74-0"
|
|
36007
36160
|
})(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
|
|
@@ -36085,5 +36238,5 @@ var DialogContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
36085
36238
|
componentId: "sc-u6oe75-1"
|
|
36086
36239
|
})(["display:flex;justify-content:center;padding-top:200px;"]);
|
|
36087
36240
|
|
|
36088
|
-
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,
|
|
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, ShortcutType, Shortcuts, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, TextArea, TimeWidget, TradingMenu, Truncate, _RPGUI, useEventListener };
|
|
36089
36242
|
//# sourceMappingURL=long-bow.esm.js.map
|