@rpg-engine/long-bow 0.3.51 → 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 +6 -3
- package/dist/components/Item/Inventory/ItemContainer.d.ts +4 -1
- package/dist/components/Item/Inventory/ItemSlot.d.ts +1 -0
- package/dist/components/Shortcuts/Shortcuts.d.ts +12 -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 -3
- package/dist/components/Spellbook/constants.d.ts +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/long-bow.cjs.development.js +292 -146
- 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 +293 -146
- 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 +2 -2
- package/src/components/Abstractions/SlotsContainer.tsx +2 -2
- package/src/components/CircularController/CircularController.tsx +119 -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 +129 -0
- package/src/components/Shortcuts/ShortcutsSetter.tsx +132 -0
- package/src/components/Shortcuts/SingleShortcut.ts +61 -0
- package/src/components/Spellbook/Spellbook.tsx +15 -9
- 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 +76 -2
- 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, 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';
|
|
@@ -33053,62 +33053,20 @@ var CheckButton = function CheckButton(_ref) {
|
|
|
33053
33053
|
}));
|
|
33054
33054
|
};
|
|
33055
33055
|
|
|
33056
|
-
var
|
|
33057
|
-
|
|
33058
|
-
|
|
33059
|
-
|
|
33060
|
-
_ref$isBlockedCasting = _ref.isBlockedCastingByKeyboard,
|
|
33061
|
-
isBlockedCastingByKeyboard = _ref$isBlockedCasting === void 0 ? false : _ref$isBlockedCasting;
|
|
33062
|
-
useEffect(function () {
|
|
33063
|
-
var handleKeyDown = function handleKeyDown(e) {
|
|
33064
|
-
if (isBlockedCastingByKeyboard) return;
|
|
33065
|
-
var shortcutIndex = Number(e.key) - 1;
|
|
33066
|
-
if (shortcutIndex >= 0 && shortcutIndex <= 3) {
|
|
33067
|
-
var shortcut = quickSpells[shortcutIndex];
|
|
33068
|
-
if (shortcut != null && shortcut.key && mana >= (shortcut == null ? void 0 : shortcut.manaCost)) {
|
|
33069
|
-
onSpellCast(shortcut.key);
|
|
33070
|
-
}
|
|
33071
|
-
}
|
|
33072
|
-
};
|
|
33073
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
33074
|
-
return function () {
|
|
33075
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
33076
|
-
};
|
|
33077
|
-
}, [quickSpells, isBlockedCastingByKeyboard]);
|
|
33078
|
-
return React.createElement(List, null, Array.from({
|
|
33079
|
-
length: 4
|
|
33080
|
-
}).map(function (_, i) {
|
|
33081
|
-
var _quickSpells$i, _quickSpells$i2, _quickSpells$i3, _quickSpells$i4, _quickSpells$i5;
|
|
33082
|
-
return React.createElement(SpellShortcut, {
|
|
33083
|
-
key: i,
|
|
33084
|
-
onClick: onSpellCast.bind(null, (_quickSpells$i = quickSpells[i]) == null ? void 0 : _quickSpells$i.key),
|
|
33085
|
-
disabled: mana < ((_quickSpells$i2 = quickSpells[i]) == null ? void 0 : _quickSpells$i2.manaCost)
|
|
33086
|
-
}, React.createElement("span", {
|
|
33087
|
-
className: "mana"
|
|
33088
|
-
}, ((_quickSpells$i3 = quickSpells[i]) == null ? void 0 : _quickSpells$i3.key) && ((_quickSpells$i4 = quickSpells[i]) == null ? void 0 : _quickSpells$i4.manaCost)), React.createElement("span", {
|
|
33089
|
-
className: "magicWords"
|
|
33090
|
-
}, (_quickSpells$i5 = quickSpells[i]) == null ? void 0 : _quickSpells$i5.magicWords.split(' ').map(function (word) {
|
|
33091
|
-
return word[0];
|
|
33092
|
-
})), React.createElement("span", {
|
|
33093
|
-
className: "keyboard"
|
|
33094
|
-
}, i + 1));
|
|
33095
|
-
}));
|
|
33096
|
-
};
|
|
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
|
-
var List = /*#__PURE__*/styled.p.withConfig({
|
|
33102
|
-
displayName: "QuickSpells__List",
|
|
33103
|
-
componentId: "sc-41yq7s-1"
|
|
33104
|
-
})(["width:100%;display:flex;align-items:center;justify-content:center;gap:0.5rem;box-sizing:border-box;margin:0 !important;"]);
|
|
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);
|
|
33105
33060
|
|
|
33106
33061
|
var CircularController = function CircularController(_ref) {
|
|
33107
33062
|
var onActionClick = _ref.onActionClick,
|
|
33108
33063
|
onCancelClick = _ref.onCancelClick,
|
|
33109
|
-
|
|
33064
|
+
onShortcutClick = _ref.onShortcutClick,
|
|
33110
33065
|
mana = _ref.mana,
|
|
33111
|
-
|
|
33066
|
+
shortcuts = _ref.shortcuts,
|
|
33067
|
+
inventory = _ref.inventory,
|
|
33068
|
+
atlasIMG = _ref.atlasIMG,
|
|
33069
|
+
atlasJSON = _ref.atlasJSON;
|
|
33112
33070
|
var onTouchStart = function onTouchStart(e) {
|
|
33113
33071
|
var target = e.target;
|
|
33114
33072
|
target == null ? void 0 : target.classList.add('active');
|
|
@@ -33120,25 +33078,70 @@ var CircularController = function CircularController(_ref) {
|
|
|
33120
33078
|
}, 100);
|
|
33121
33079
|
action();
|
|
33122
33080
|
};
|
|
33123
|
-
|
|
33124
|
-
|
|
33125
|
-
|
|
33126
|
-
|
|
33127
|
-
var
|
|
33128
|
-
|
|
33081
|
+
var renderShortcut = function renderShortcut(i) {
|
|
33082
|
+
var _shortcuts$i, _shortcuts$i2, _shortcuts$i4, _payload$manaCost;
|
|
33083
|
+
var variant = '';
|
|
33084
|
+
if (i === 0) variant = 'top';else if (i >= 3) variant = "bottom-" + (i - 3);
|
|
33085
|
+
var onShortcutClickBinded = ((_shortcuts$i = shortcuts[i]) == null ? void 0 : _shortcuts$i.type) !== ShortcutType.None ? onShortcutClick.bind(null, i) : function () {};
|
|
33086
|
+
if (((_shortcuts$i2 = shortcuts[i]) == null ? void 0 : _shortcuts$i2.type) === ShortcutType.Item) {
|
|
33087
|
+
var _shortcuts$i3;
|
|
33088
|
+
var _payload = (_shortcuts$i3 = shortcuts[i]) == null ? void 0 : _shortcuts$i3.payload;
|
|
33089
|
+
var itemsFromEquipment = [];
|
|
33090
|
+
if (inventory) {
|
|
33091
|
+
Object.keys(inventory.slots).forEach(function (i) {
|
|
33092
|
+
var _inventory$slots$inde;
|
|
33093
|
+
var index = parseInt(i);
|
|
33094
|
+
if (((_inventory$slots$inde = inventory.slots[index]) == null ? void 0 : _inventory$slots$inde.key) === (_payload == null ? void 0 : _payload.key)) {
|
|
33095
|
+
itemsFromEquipment.push(inventory.slots[index]);
|
|
33096
|
+
}
|
|
33097
|
+
});
|
|
33098
|
+
}
|
|
33099
|
+
var totalQty = itemsFromEquipment.reduce(function (acc, item) {
|
|
33100
|
+
return acc + ((item == null ? void 0 : item.stackQty) || 1);
|
|
33101
|
+
}, 0);
|
|
33102
|
+
return React.createElement(StyledShortcut, {
|
|
33103
|
+
key: i,
|
|
33104
|
+
onTouchStart: onTouchStart,
|
|
33105
|
+
onTouchEnd: onTouchEnd.bind(null, onShortcutClickBinded),
|
|
33106
|
+
disabled: false,
|
|
33107
|
+
className: variant
|
|
33108
|
+
}, _payload && React.createElement(SpriteFromAtlas, {
|
|
33109
|
+
atlasIMG: atlasIMG,
|
|
33110
|
+
atlasJSON: atlasJSON,
|
|
33111
|
+
spriteKey: getItemTextureKeyPath({
|
|
33112
|
+
key: _payload.texturePath,
|
|
33113
|
+
texturePath: _payload.texturePath,
|
|
33114
|
+
stackQty: _payload.stackQty || 1
|
|
33115
|
+
}, atlasJSON),
|
|
33116
|
+
width: 32,
|
|
33117
|
+
height: 32,
|
|
33118
|
+
imgScale: 1.4,
|
|
33119
|
+
imgStyle: {
|
|
33120
|
+
left: '4px'
|
|
33121
|
+
}
|
|
33122
|
+
}), React.createElement("span", {
|
|
33123
|
+
className: "qty"
|
|
33124
|
+
}, totalQty));
|
|
33125
|
+
}
|
|
33126
|
+
var payload = (_shortcuts$i4 = shortcuts[i]) == null ? void 0 : _shortcuts$i4.payload;
|
|
33129
33127
|
return React.createElement(StyledShortcut, {
|
|
33130
33128
|
key: i,
|
|
33131
|
-
disabled: mana < (spell == null ? void 0 : spell.manaCost),
|
|
33132
33129
|
onTouchStart: onTouchStart,
|
|
33133
|
-
onTouchEnd: onTouchEnd.bind(null,
|
|
33130
|
+
onTouchEnd: onTouchEnd.bind(null, onShortcutClickBinded),
|
|
33131
|
+
disabled: mana < ((_payload$manaCost = payload == null ? void 0 : payload.manaCost) != null ? _payload$manaCost : 0),
|
|
33134
33132
|
className: variant
|
|
33135
33133
|
}, React.createElement("span", {
|
|
33136
33134
|
className: "mana"
|
|
33137
|
-
},
|
|
33135
|
+
}, payload && payload.manaCost), React.createElement("span", {
|
|
33138
33136
|
className: "magicWords"
|
|
33139
|
-
},
|
|
33137
|
+
}, payload == null ? void 0 : payload.magicWords.split(' ').map(function (word) {
|
|
33140
33138
|
return word[0];
|
|
33141
33139
|
})));
|
|
33140
|
+
};
|
|
33141
|
+
return React.createElement(ButtonsContainer, null, React.createElement(ShortcutsContainer, null, Array.from({
|
|
33142
|
+
length: 6
|
|
33143
|
+
}).map(function (_, i) {
|
|
33144
|
+
return renderShortcut(i);
|
|
33142
33145
|
})), React.createElement(Button$2, {
|
|
33143
33146
|
onTouchStart: onTouchStart,
|
|
33144
33147
|
onTouchEnd: onTouchEnd.bind(null, onActionClick)
|
|
@@ -33152,7 +33155,7 @@ var CircularController = function CircularController(_ref) {
|
|
|
33152
33155
|
var Button$2 = /*#__PURE__*/styled.button.withConfig({
|
|
33153
33156
|
displayName: "CircularController__Button",
|
|
33154
33157
|
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);
|
|
33158
|
+
})(["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
33159
|
var CancelButton = /*#__PURE__*/styled(Button$2).withConfig({
|
|
33157
33160
|
displayName: "CircularController__CancelButton",
|
|
33158
33161
|
componentId: "sc-1fewf3h-1"
|
|
@@ -33161,14 +33164,14 @@ var ButtonsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
33161
33164
|
displayName: "CircularController__ButtonsContainer",
|
|
33162
33165
|
componentId: "sc-1fewf3h-2"
|
|
33163
33166
|
})(["display:flex;align-items:center;justify-content:center;gap:0.5rem;"]);
|
|
33164
|
-
var
|
|
33165
|
-
displayName: "
|
|
33167
|
+
var ShortcutsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33168
|
+
displayName: "CircularController__ShortcutsContainer",
|
|
33166
33169
|
componentId: "sc-1fewf3h-3"
|
|
33167
|
-
})(["display:flex;align-items:center;justify-content:center;gap:0.
|
|
33168
|
-
var StyledShortcut = /*#__PURE__*/styled(
|
|
33170
|
+
})(["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%));}"]);
|
|
33171
|
+
var StyledShortcut = /*#__PURE__*/styled(SingleShortcut).withConfig({
|
|
33169
33172
|
displayName: "CircularController__StyledShortcut",
|
|
33170
33173
|
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);
|
|
33174
|
+
})(["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
33175
|
|
|
33173
33176
|
function useOutsideClick(ref, id) {
|
|
33174
33177
|
useEffect(function () {
|
|
@@ -33757,7 +33760,8 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33757
33760
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
33758
33761
|
openQuantitySelector = _ref.openQuantitySelector,
|
|
33759
33762
|
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
33760
|
-
dragScale = _ref.dragScale
|
|
33763
|
+
dragScale = _ref.dragScale,
|
|
33764
|
+
isSelectingShortcut = _ref.isSelectingShortcut;
|
|
33761
33765
|
var _useState = useState(false),
|
|
33762
33766
|
isTooltipVisible = _useState[0],
|
|
33763
33767
|
setTooltipVisible = _useState[1];
|
|
@@ -33790,6 +33794,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33790
33794
|
});
|
|
33791
33795
|
setIsFocused(false);
|
|
33792
33796
|
if (item) {
|
|
33797
|
+
console.log(item);
|
|
33793
33798
|
setContextActions(generateContextMenu(item, containerType));
|
|
33794
33799
|
}
|
|
33795
33800
|
}, [item]);
|
|
@@ -33921,12 +33926,14 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33921
33926
|
bubbles: true
|
|
33922
33927
|
});
|
|
33923
33928
|
(_document$elementFrom = document.elementFromPoint(clientX, clientY)) == null ? void 0 : _document$elementFrom.dispatchEvent(simulatedEvent);
|
|
33924
|
-
}
|
|
33929
|
+
},
|
|
33930
|
+
isSelectingShortcut: isSelectingShortcut && ((item == null ? void 0 : item.type) === ItemType.Consumable || (item == null ? void 0 : item.type) === ItemType.Tool)
|
|
33925
33931
|
}, React.createElement(Draggable, {
|
|
33932
|
+
axis: isSelectingShortcut ? 'none' : 'both',
|
|
33926
33933
|
defaultClassName: item ? 'draggable' : 'empty-slot',
|
|
33927
33934
|
scale: dragScale,
|
|
33928
33935
|
onStop: function onStop(e, data) {
|
|
33929
|
-
if (wasDragged && item) {
|
|
33936
|
+
if (wasDragged && item && !isSelectingShortcut) {
|
|
33930
33937
|
var _e$target;
|
|
33931
33938
|
//@ts-ignore
|
|
33932
33939
|
var classes = Array.from((_e$target = e.target) == null ? void 0 : _e$target.classList);
|
|
@@ -33964,12 +33971,12 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33964
33971
|
}
|
|
33965
33972
|
}, 100);
|
|
33966
33973
|
} else if (item) {
|
|
33967
|
-
if (!isContextMenuDisabled) setIsContextMenuVisible(!isContextMenuVisible);
|
|
33974
|
+
if (!isContextMenuDisabled && !isSelectingShortcut) setIsContextMenuVisible(!isContextMenuVisible);
|
|
33968
33975
|
onClick(item.type, containerType, item);
|
|
33969
33976
|
}
|
|
33970
33977
|
},
|
|
33971
33978
|
onStart: function onStart() {
|
|
33972
|
-
if (!item) {
|
|
33979
|
+
if (!item || isSelectingShortcut) {
|
|
33973
33980
|
return;
|
|
33974
33981
|
}
|
|
33975
33982
|
if (onDragStart) {
|
|
@@ -34031,7 +34038,7 @@ var rarityColor = function rarityColor(item) {
|
|
|
34031
34038
|
var Container$a = /*#__PURE__*/styled.div.withConfig({
|
|
34032
34039
|
displayName: "ItemSlot__Container",
|
|
34033
34040
|
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) {
|
|
34041
|
+
})(["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
34042
|
var item = _ref2.item;
|
|
34036
34043
|
return rarityColor(item);
|
|
34037
34044
|
}, function (_ref3) {
|
|
@@ -34040,6 +34047,9 @@ var Container$a = /*#__PURE__*/styled.div.withConfig({
|
|
|
34040
34047
|
}, function (_ref4) {
|
|
34041
34048
|
var item = _ref4.item;
|
|
34042
34049
|
return "0 0 4px 3px " + rarityColor(item);
|
|
34050
|
+
}, function (_ref5) {
|
|
34051
|
+
var isSelectingShortcut = _ref5.isSelectingShortcut;
|
|
34052
|
+
return isSelectingShortcut ? 'bg-color-change 1s infinite' : 'none';
|
|
34043
34053
|
});
|
|
34044
34054
|
var ItemContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34045
34055
|
displayName: "ItemSlot__ItemContainer",
|
|
@@ -34165,8 +34175,8 @@ var SlotsContainer = function SlotsContainer(_ref) {
|
|
|
34165
34175
|
onClose();
|
|
34166
34176
|
}
|
|
34167
34177
|
},
|
|
34168
|
-
width: "
|
|
34169
|
-
cancelDrag: ".item-container-body",
|
|
34178
|
+
width: "400px",
|
|
34179
|
+
cancelDrag: ".item-container-body, #shortcuts_list",
|
|
34170
34180
|
onPositionChange: function onPositionChange(_ref2) {
|
|
34171
34181
|
var x = _ref2.x,
|
|
34172
34182
|
y = _ref2.y;
|
|
@@ -34338,6 +34348,72 @@ var CloseButton$2 = /*#__PURE__*/styled.div.withConfig({
|
|
|
34338
34348
|
componentId: "sc-yfdtpn-3"
|
|
34339
34349
|
})(["position:absolute;top:3px;right:0px;color:white;z-index:22;font-size:0.8rem;"]);
|
|
34340
34350
|
|
|
34351
|
+
var ShortcutsSetter = function ShortcutsSetter(_ref) {
|
|
34352
|
+
var setSettingShortcutIndex = _ref.setSettingShortcutIndex,
|
|
34353
|
+
settingShortcutIndex = _ref.settingShortcutIndex,
|
|
34354
|
+
shortcuts = _ref.shortcuts,
|
|
34355
|
+
removeShortcut = _ref.removeShortcut,
|
|
34356
|
+
atlasJSON = _ref.atlasJSON,
|
|
34357
|
+
atlasIMG = _ref.atlasIMG;
|
|
34358
|
+
var getContent = function getContent(index) {
|
|
34359
|
+
var _shortcuts$index, _shortcuts$index3;
|
|
34360
|
+
if (((_shortcuts$index = shortcuts[index]) == null ? void 0 : _shortcuts$index.type) === ShortcutType.Item) {
|
|
34361
|
+
var _shortcuts$index2;
|
|
34362
|
+
var _payload = (_shortcuts$index2 = shortcuts[index]) == null ? void 0 : _shortcuts$index2.payload;
|
|
34363
|
+
if (!_payload) return null;
|
|
34364
|
+
return React.createElement(SpriteFromAtlas, {
|
|
34365
|
+
atlasIMG: atlasIMG,
|
|
34366
|
+
atlasJSON: atlasJSON,
|
|
34367
|
+
spriteKey: getItemTextureKeyPath({
|
|
34368
|
+
key: _payload.texturePath,
|
|
34369
|
+
texturePath: _payload.texturePath,
|
|
34370
|
+
stackQty: _payload.stackQty || 1
|
|
34371
|
+
}, atlasJSON),
|
|
34372
|
+
width: 32,
|
|
34373
|
+
height: 32,
|
|
34374
|
+
imgScale: 1.6,
|
|
34375
|
+
imgStyle: {
|
|
34376
|
+
left: '5px'
|
|
34377
|
+
}
|
|
34378
|
+
});
|
|
34379
|
+
}
|
|
34380
|
+
var payload = (_shortcuts$index3 = shortcuts[index]) == null ? void 0 : _shortcuts$index3.payload;
|
|
34381
|
+
return React.createElement("span", null, payload == null ? void 0 : payload.magicWords.split(' ').map(function (word) {
|
|
34382
|
+
return word[0];
|
|
34383
|
+
}));
|
|
34384
|
+
};
|
|
34385
|
+
return React.createElement(Container$b, null, React.createElement("p", null, "Shortcuts:"), React.createElement(List, {
|
|
34386
|
+
id: "shortcuts_list"
|
|
34387
|
+
}, Array.from({
|
|
34388
|
+
length: 6
|
|
34389
|
+
}).map(function (_, i) {
|
|
34390
|
+
return React.createElement(Shortcut, {
|
|
34391
|
+
key: i,
|
|
34392
|
+
onClick: function onClick() {
|
|
34393
|
+
removeShortcut(i);
|
|
34394
|
+
if (!shortcuts[i] || shortcuts[i].type === ShortcutType.None) setSettingShortcutIndex(i);
|
|
34395
|
+
},
|
|
34396
|
+
disabled: settingShortcutIndex !== -1 && settingShortcutIndex !== i,
|
|
34397
|
+
isBeingSet: settingShortcutIndex === i
|
|
34398
|
+
}, getContent(i));
|
|
34399
|
+
})));
|
|
34400
|
+
};
|
|
34401
|
+
var Container$b = /*#__PURE__*/styled.div.withConfig({
|
|
34402
|
+
displayName: "ShortcutsSetter__Container",
|
|
34403
|
+
componentId: "sc-xuouuf-0"
|
|
34404
|
+
})(["p{margin:0;margin-left:0.5rem;}"]);
|
|
34405
|
+
var Shortcut = /*#__PURE__*/styled.button.withConfig({
|
|
34406
|
+
displayName: "ShortcutsSetter__Shortcut",
|
|
34407
|
+
componentId: "sc-xuouuf-1"
|
|
34408
|
+
})(["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) {
|
|
34409
|
+
var isBeingSet = _ref2.isBeingSet;
|
|
34410
|
+
return isBeingSet ? uiColors.yellow : uiColors.darkGray;
|
|
34411
|
+
}, uiColors.darkGray, uiColors.gray);
|
|
34412
|
+
var List = /*#__PURE__*/styled.div.withConfig({
|
|
34413
|
+
displayName: "ShortcutsSetter__List",
|
|
34414
|
+
componentId: "sc-xuouuf-2"
|
|
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;"]);
|
|
34416
|
+
|
|
34341
34417
|
var ItemContainer$1 = function ItemContainer(_ref) {
|
|
34342
34418
|
var itemContainer = _ref.itemContainer,
|
|
34343
34419
|
onClose = _ref.onClose,
|
|
@@ -34356,7 +34432,10 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34356
34432
|
checkIfItemCanBeMoved = _ref.checkIfItemCanBeMoved,
|
|
34357
34433
|
initialPosition = _ref.initialPosition,
|
|
34358
34434
|
checkIfItemShouldDragEnd = _ref.checkIfItemShouldDragEnd,
|
|
34359
|
-
dragScale = _ref.dragScale
|
|
34435
|
+
dragScale = _ref.dragScale,
|
|
34436
|
+
shortcuts = _ref.shortcuts,
|
|
34437
|
+
setItemShortcut = _ref.setItemShortcut,
|
|
34438
|
+
removeShortcut = _ref.removeShortcut;
|
|
34360
34439
|
var _useState = useState({
|
|
34361
34440
|
isOpen: false,
|
|
34362
34441
|
maxQuantity: 1,
|
|
@@ -34364,6 +34443,9 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34364
34443
|
}),
|
|
34365
34444
|
quantitySelect = _useState[0],
|
|
34366
34445
|
setQuantitySelect = _useState[1];
|
|
34446
|
+
var _useState2 = useState(-1),
|
|
34447
|
+
settingShortcutIndex = _useState2[0],
|
|
34448
|
+
setSettingShortcutIndex = _useState2[1];
|
|
34367
34449
|
var onRenderSlots = function onRenderSlots() {
|
|
34368
34450
|
var slots = [];
|
|
34369
34451
|
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
@@ -34377,8 +34459,13 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34377
34459
|
onMouseOver: function onMouseOver(event, slotIndex, item) {
|
|
34378
34460
|
if (_onMouseOver) _onMouseOver(event, slotIndex, item);
|
|
34379
34461
|
},
|
|
34380
|
-
onClick: function onClick(
|
|
34381
|
-
if (
|
|
34462
|
+
onClick: function onClick(itemType, containerType, item) {
|
|
34463
|
+
if (settingShortcutIndex !== -1) {
|
|
34464
|
+
setSettingShortcutIndex(-1);
|
|
34465
|
+
if (itemType === ItemType.Consumable || itemType === ItemType.Tool) {
|
|
34466
|
+
setItemShortcut == null ? void 0 : setItemShortcut(item.key, settingShortcutIndex);
|
|
34467
|
+
}
|
|
34468
|
+
} else if (onItemClick) onItemClick(item, itemType, containerType);
|
|
34382
34469
|
},
|
|
34383
34470
|
onSelected: function onSelected(optionId, item) {
|
|
34384
34471
|
if (_onSelected) _onSelected(optionId, item);
|
|
@@ -34406,7 +34493,8 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34406
34493
|
if (_onOutsideDrop) _onOutsideDrop(item, position);
|
|
34407
34494
|
},
|
|
34408
34495
|
atlasIMG: atlasIMG,
|
|
34409
|
-
atlasJSON: atlasJSON
|
|
34496
|
+
atlasJSON: atlasJSON,
|
|
34497
|
+
isSelectingShortcut: settingShortcutIndex !== -1
|
|
34410
34498
|
}));
|
|
34411
34499
|
}
|
|
34412
34500
|
return slots;
|
|
@@ -34415,7 +34503,14 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34415
34503
|
title: itemContainer.name || 'Container',
|
|
34416
34504
|
onClose: onClose,
|
|
34417
34505
|
initialPosition: initialPosition
|
|
34418
|
-
}, React.createElement(
|
|
34506
|
+
}, type === ItemContainerType.Inventory && shortcuts && removeShortcut && React.createElement(ShortcutsSetter, {
|
|
34507
|
+
setSettingShortcutIndex: setSettingShortcutIndex,
|
|
34508
|
+
settingShortcutIndex: settingShortcutIndex,
|
|
34509
|
+
shortcuts: shortcuts,
|
|
34510
|
+
removeShortcut: removeShortcut,
|
|
34511
|
+
atlasIMG: atlasIMG,
|
|
34512
|
+
atlasJSON: atlasJSON
|
|
34513
|
+
}), React.createElement(ItemsContainer, {
|
|
34419
34514
|
className: "item-container-body"
|
|
34420
34515
|
}, onRenderSlots())), quantitySelect.isOpen && React.createElement(QuantitySelectorContainer, null, React.createElement(ItemQuantitySelector, {
|
|
34421
34516
|
quantity: quantitySelect.maxQuantity,
|
|
@@ -34440,7 +34535,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
34440
34535
|
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34441
34536
|
displayName: "ItemContainer__ItemsContainer",
|
|
34442
34537
|
componentId: "sc-15y5p9l-0"
|
|
34443
|
-
})(["
|
|
34538
|
+
})(["display:flex;justify-content:center;flex-wrap:wrap;"]);
|
|
34444
34539
|
var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
|
|
34445
34540
|
displayName: "ItemContainer__QuantitySelectorContainer",
|
|
34446
34541
|
componentId: "sc-15y5p9l-1"
|
|
@@ -34537,7 +34632,7 @@ var ListMenu = function ListMenu(_ref) {
|
|
|
34537
34632
|
onSelected = _ref.onSelected,
|
|
34538
34633
|
x = _ref.x,
|
|
34539
34634
|
y = _ref.y;
|
|
34540
|
-
return React.createElement(Container$
|
|
34635
|
+
return React.createElement(Container$c, {
|
|
34541
34636
|
x: x,
|
|
34542
34637
|
y: y
|
|
34543
34638
|
}, React.createElement("ul", {
|
|
@@ -34554,7 +34649,7 @@ var ListMenu = function ListMenu(_ref) {
|
|
|
34554
34649
|
}, (params == null ? void 0 : params.text) || 'No text');
|
|
34555
34650
|
})));
|
|
34556
34651
|
};
|
|
34557
|
-
var Container$
|
|
34652
|
+
var Container$c = /*#__PURE__*/styled.div.withConfig({
|
|
34558
34653
|
displayName: "ListMenu__Container",
|
|
34559
34654
|
componentId: "sc-i9097t-0"
|
|
34560
34655
|
})(["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 +34703,7 @@ var NPCMultiDialog = function NPCMultiDialog(_ref) {
|
|
|
34608
34703
|
type: RPGUIContainerTypes.FramedGold,
|
|
34609
34704
|
width: '50%',
|
|
34610
34705
|
height: '180px'
|
|
34611
|
-
}, React.createElement(React.Fragment, null, React.createElement(Container$
|
|
34706
|
+
}, 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
34707
|
flex: '70%'
|
|
34613
34708
|
}, React.createElement(NPCDialogText, {
|
|
34614
34709
|
onStartStep: function onStartStep() {
|
|
@@ -34650,7 +34745,7 @@ var NPCMultiDialog = function NPCMultiDialog(_ref) {
|
|
|
34650
34745
|
src: img$7
|
|
34651
34746
|
}))), ")"));
|
|
34652
34747
|
};
|
|
34653
|
-
var Container$
|
|
34748
|
+
var Container$d = /*#__PURE__*/styled.div.withConfig({
|
|
34654
34749
|
displayName: "NPCMultiDialog__Container",
|
|
34655
34750
|
componentId: "sc-rvu5wg-0"
|
|
34656
34751
|
})(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
|
|
@@ -34854,7 +34949,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
34854
34949
|
return null;
|
|
34855
34950
|
});
|
|
34856
34951
|
};
|
|
34857
|
-
return React.createElement(Container$
|
|
34952
|
+
return React.createElement(Container$e, null, React.createElement(QuestionContainer, null, React.createElement(DynamicText, {
|
|
34858
34953
|
text: currentQuestion.text,
|
|
34859
34954
|
onStart: function onStart() {
|
|
34860
34955
|
return setCanShowAnswers(false);
|
|
@@ -34864,7 +34959,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
34864
34959
|
}
|
|
34865
34960
|
})), canShowAnswers && React.createElement(AnswersContainer, null, onRenderCurrentAnswers()));
|
|
34866
34961
|
};
|
|
34867
|
-
var Container$
|
|
34962
|
+
var Container$e = /*#__PURE__*/styled.div.withConfig({
|
|
34868
34963
|
displayName: "QuestionDialog__Container",
|
|
34869
34964
|
componentId: "sc-bxc5u0-0"
|
|
34870
34965
|
})(["display:flex;word-break:break-all;box-sizing:border-box;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;"]);
|
|
@@ -34910,7 +35005,7 @@ var ProgressBar = function ProgressBar(_ref) {
|
|
|
34910
35005
|
}
|
|
34911
35006
|
return value * 100 / max;
|
|
34912
35007
|
};
|
|
34913
|
-
return React.createElement(Container$
|
|
35008
|
+
return React.createElement(Container$f, {
|
|
34914
35009
|
className: "rpgui-progress",
|
|
34915
35010
|
"data-value": calculatePercentageValue(max, value) / 100,
|
|
34916
35011
|
"data-rpguitype": "progress",
|
|
@@ -34939,7 +35034,7 @@ var TextOverlay$1 = /*#__PURE__*/styled.div.withConfig({
|
|
|
34939
35034
|
displayName: "ProgressBar__TextOverlay",
|
|
34940
35035
|
componentId: "sc-qa6fzh-1"
|
|
34941
35036
|
})(["width:100%;position:relative;"]);
|
|
34942
|
-
var Container$
|
|
35037
|
+
var Container$f = /*#__PURE__*/styled.div.withConfig({
|
|
34943
35038
|
displayName: "ProgressBar__Container",
|
|
34944
35039
|
componentId: "sc-qa6fzh-2"
|
|
34945
35040
|
})(["display:flex;flex-direction:column;min-width:", "px;width:", "%;justify-content:start;align-items:flex-start;", ""], function (props) {
|
|
@@ -35156,13 +35251,96 @@ var RPGUIRoot = function RPGUIRoot(_ref) {
|
|
|
35156
35251
|
}, children);
|
|
35157
35252
|
};
|
|
35158
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
|
+
|
|
35159
35337
|
var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
35160
35338
|
var value = _ref.value,
|
|
35161
35339
|
_ref$bgColor = _ref.bgColor,
|
|
35162
35340
|
bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
|
|
35163
35341
|
_ref$margin = _ref.margin,
|
|
35164
35342
|
margin = _ref$margin === void 0 ? 20 : _ref$margin;
|
|
35165
|
-
return React.createElement(Container$
|
|
35343
|
+
return React.createElement(Container$g, {
|
|
35166
35344
|
className: "simple-progress-bar"
|
|
35167
35345
|
}, React.createElement(ProgressBarContainer, {
|
|
35168
35346
|
margin: margin
|
|
@@ -35171,7 +35349,7 @@ var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
|
35171
35349
|
bgColor: bgColor
|
|
35172
35350
|
}))));
|
|
35173
35351
|
};
|
|
35174
|
-
var Container$
|
|
35352
|
+
var Container$g = /*#__PURE__*/styled.div.withConfig({
|
|
35175
35353
|
displayName: "SimpleProgressBar__Container",
|
|
35176
35354
|
componentId: "sc-mbeil3-0"
|
|
35177
35355
|
})(["display:flex;justify-content:center;align-items:center;width:100%;"]);
|
|
@@ -35399,7 +35577,7 @@ var Spell = function Spell(_ref) {
|
|
|
35399
35577
|
isSettingShortcut = _ref.isSettingShortcut,
|
|
35400
35578
|
minMagicLevelRequired = _ref.minMagicLevelRequired;
|
|
35401
35579
|
var disabled = isSettingShortcut ? charMagicLevel < minMagicLevelRequired : manaCost > charMana || charMagicLevel < minMagicLevelRequired;
|
|
35402
|
-
return React.createElement(Container$
|
|
35580
|
+
return React.createElement(Container$h, {
|
|
35403
35581
|
disabled: disabled,
|
|
35404
35582
|
onClick: onClick == null ? void 0 : onClick.bind(null, spellKey),
|
|
35405
35583
|
isSettingShortcut: isSettingShortcut && !disabled,
|
|
@@ -35412,7 +35590,7 @@ var Spell = function Spell(_ref) {
|
|
|
35412
35590
|
className: "mana"
|
|
35413
35591
|
}, manaCost)));
|
|
35414
35592
|
};
|
|
35415
|
-
var Container$
|
|
35593
|
+
var Container$h = /*#__PURE__*/styled.button.withConfig({
|
|
35416
35594
|
displayName: "Spell__Container",
|
|
35417
35595
|
componentId: "sc-j96fa2-0"
|
|
35418
35596
|
})(["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 +35626,6 @@ var Overlay = /*#__PURE__*/styled.p.withConfig({
|
|
|
35448
35626
|
componentId: "sc-j96fa2-7"
|
|
35449
35627
|
})(["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
35628
|
|
|
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
35629
|
var Spellbook = function Spellbook(_ref) {
|
|
35489
35630
|
var onClose = _ref.onClose,
|
|
35490
35631
|
onInputFocus = _ref.onInputFocus,
|
|
@@ -35494,8 +35635,10 @@ var Spellbook = function Spellbook(_ref) {
|
|
|
35494
35635
|
mana = _ref.mana,
|
|
35495
35636
|
onSpellClick = _ref.onSpellClick,
|
|
35496
35637
|
setSpellShortcut = _ref.setSpellShortcut,
|
|
35497
|
-
|
|
35498
|
-
|
|
35638
|
+
shortcuts = _ref.shortcuts,
|
|
35639
|
+
removeShortcut = _ref.removeShortcut,
|
|
35640
|
+
atlasIMG = _ref.atlasIMG,
|
|
35641
|
+
atlasJSON = _ref.atlasJSON;
|
|
35499
35642
|
var _useState = useState(''),
|
|
35500
35643
|
search = _useState[0],
|
|
35501
35644
|
setSearch = _useState[1];
|
|
@@ -35532,11 +35675,13 @@ var Spellbook = function Spellbook(_ref) {
|
|
|
35532
35675
|
width: "inherit",
|
|
35533
35676
|
height: "inherit",
|
|
35534
35677
|
cancelDrag: "#spellbook-search, #shortcuts_list, .spell"
|
|
35535
|
-
}, React.createElement(Container$
|
|
35678
|
+
}, React.createElement(Container$i, null, React.createElement(Title$6, null, "Learned Spells"), React.createElement(ShortcutsSetter, {
|
|
35536
35679
|
setSettingShortcutIndex: setSettingShortcutIndex,
|
|
35537
35680
|
settingShortcutIndex: settingShortcutIndex,
|
|
35538
|
-
shortcuts:
|
|
35539
|
-
removeShortcut:
|
|
35681
|
+
shortcuts: shortcuts,
|
|
35682
|
+
removeShortcut: removeShortcut,
|
|
35683
|
+
atlasIMG: atlasIMG,
|
|
35684
|
+
atlasJSON: atlasJSON
|
|
35540
35685
|
}), React.createElement(Input, {
|
|
35541
35686
|
placeholder: "Search for spell",
|
|
35542
35687
|
value: search,
|
|
@@ -35562,7 +35707,7 @@ var Title$6 = /*#__PURE__*/styled.h1.withConfig({
|
|
|
35562
35707
|
displayName: "Spellbook__Title",
|
|
35563
35708
|
componentId: "sc-r02nfq-0"
|
|
35564
35709
|
})(["font-size:", " !important;margin-bottom:0 !important;"], uiFonts.size.large);
|
|
35565
|
-
var Container$
|
|
35710
|
+
var Container$i = /*#__PURE__*/styled.div.withConfig({
|
|
35566
35711
|
displayName: "Spellbook__Container",
|
|
35567
35712
|
componentId: "sc-r02nfq-1"
|
|
35568
35713
|
})(["width:100%;height:100%;color:white;display:flex;flex-direction:column;"]);
|
|
@@ -35795,14 +35940,16 @@ var TradingMenu = function TradingMenu(_ref) {
|
|
|
35795
35940
|
if (onClose) onClose();
|
|
35796
35941
|
},
|
|
35797
35942
|
width: "600px",
|
|
35798
|
-
cancelDrag: "
|
|
35943
|
+
cancelDrag: "#TraderContainer"
|
|
35799
35944
|
}, React.createElement(React.Fragment, null, React.createElement("div", {
|
|
35800
35945
|
style: {
|
|
35801
35946
|
width: '100%'
|
|
35802
35947
|
}
|
|
35803
35948
|
}, React.createElement(Title$7, null, Capitalize(type), " Menu"), React.createElement("hr", {
|
|
35804
35949
|
className: "golden"
|
|
35805
|
-
})), React.createElement(TradingComponentScrollWrapper,
|
|
35950
|
+
})), React.createElement(TradingComponentScrollWrapper, {
|
|
35951
|
+
id: "TraderContainer"
|
|
35952
|
+
}, traderItems.map(function (tradeItem, index) {
|
|
35806
35953
|
var _qtyMap$get;
|
|
35807
35954
|
return React.createElement(ItemWrapper$1, {
|
|
35808
35955
|
key: tradeItem.key + "_" + index
|
|
@@ -35860,11 +36007,11 @@ var Truncate = function Truncate(_ref) {
|
|
|
35860
36007
|
var _ref$maxLines = _ref.maxLines,
|
|
35861
36008
|
maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
|
|
35862
36009
|
children = _ref.children;
|
|
35863
|
-
return React.createElement(Container$
|
|
36010
|
+
return React.createElement(Container$j, {
|
|
35864
36011
|
maxLines: maxLines
|
|
35865
36012
|
}, children);
|
|
35866
36013
|
};
|
|
35867
|
-
var Container$
|
|
36014
|
+
var Container$j = /*#__PURE__*/styled.div.withConfig({
|
|
35868
36015
|
displayName: "Truncate__Container",
|
|
35869
36016
|
componentId: "sc-6x00qb-0"
|
|
35870
36017
|
})(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
|
|
@@ -35927,7 +36074,7 @@ var NPCDialogText = function NPCDialogText(_ref) {
|
|
|
35927
36074
|
var _useState2 = useState(false),
|
|
35928
36075
|
showGoNextIndicator = _useState2[0],
|
|
35929
36076
|
setShowGoNextIndicator = _useState2[1];
|
|
35930
|
-
return React.createElement(Container$
|
|
36077
|
+
return React.createElement(Container$k, null, React.createElement(DynamicText, {
|
|
35931
36078
|
text: (textChunks == null ? void 0 : textChunks[chunkIndex]) || '',
|
|
35932
36079
|
onFinish: function onFinish() {
|
|
35933
36080
|
setShowGoNextIndicator(true);
|
|
@@ -35945,7 +36092,7 @@ var NPCDialogText = function NPCDialogText(_ref) {
|
|
|
35945
36092
|
}
|
|
35946
36093
|
}));
|
|
35947
36094
|
};
|
|
35948
|
-
var Container$
|
|
36095
|
+
var Container$k = /*#__PURE__*/styled.div.withConfig({
|
|
35949
36096
|
displayName: "NPCDialogText__Container",
|
|
35950
36097
|
componentId: "sc-1cxkdh9-0"
|
|
35951
36098
|
})([""]);
|
|
@@ -35987,7 +36134,7 @@ var NPCDialog = function NPCDialog(_ref) {
|
|
|
35987
36134
|
}
|
|
35988
36135
|
})), type === NPCDialogType.TextAndThumbnail && React.createElement(ThumbnailContainer$1, null, React.createElement(NPCThumbnail$1, {
|
|
35989
36136
|
src: imagePath || img$6
|
|
35990
|
-
}))) : React.createElement(React.Fragment, null, React.createElement(Container$
|
|
36137
|
+
}))) : React.createElement(React.Fragment, null, React.createElement(Container$l, null, React.createElement(TextContainer$2, {
|
|
35991
36138
|
flex: type === NPCDialogType.TextAndThumbnail ? '70%' : '100%'
|
|
35992
36139
|
}, React.createElement(NPCDialogText, {
|
|
35993
36140
|
type: type,
|
|
@@ -36001,7 +36148,7 @@ var NPCDialog = function NPCDialog(_ref) {
|
|
|
36001
36148
|
src: imagePath || img$6
|
|
36002
36149
|
})))));
|
|
36003
36150
|
};
|
|
36004
|
-
var Container$
|
|
36151
|
+
var Container$l = /*#__PURE__*/styled.div.withConfig({
|
|
36005
36152
|
displayName: "NPCDialog__Container",
|
|
36006
36153
|
componentId: "sc-1b4aw74-0"
|
|
36007
36154
|
})(["display:flex;width:100%;height:100%;box-sizing:border-box;justify-content:center;align-items:flex-start;position:relative;"]);
|
|
@@ -36085,5 +36232,5 @@ var DialogContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
36085
36232
|
componentId: "sc-u6oe75-1"
|
|
36086
36233
|
})(["display:flex;justify-content:center;padding-top:200px;"]);
|
|
36087
36234
|
|
|
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,
|
|
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 };
|
|
36089
36236
|
//# sourceMappingURL=long-bow.esm.js.map
|