@rpg-engine/long-bow 0.3.78 → 0.3.80

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.3.78",
3
+ "version": "0.3.80",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -10,6 +10,7 @@ interface IProps {
10
10
  onPositionChange?: (position: IPosition) => void;
11
11
  onOutsideClick?: () => void;
12
12
  initialPosition?: IPosition;
13
+ scale?: number;
13
14
  }
14
15
 
15
16
  export const SlotsContainer: React.FC<IProps> = ({
@@ -19,6 +20,7 @@ export const SlotsContainer: React.FC<IProps> = ({
19
20
  onPositionChange,
20
21
  onOutsideClick,
21
22
  initialPosition,
23
+ scale,
22
24
  }) => {
23
25
  return (
24
26
  <DraggableContainer
@@ -38,6 +40,7 @@ export const SlotsContainer: React.FC<IProps> = ({
38
40
  }}
39
41
  onOutsideClick={onOutsideClick}
40
42
  initialPosition={initialPosition}
43
+ scale={scale}
41
44
  >
42
45
  {children}
43
46
  </DraggableContainer>
@@ -93,6 +93,7 @@ export const CraftBook: React.FC<IItemCraftSelectorProps> = ({
93
93
  onClose();
94
94
  }
95
95
  }}
96
+ scale={scale}
96
97
  >
97
98
  <div style={{ width: '100%' }}>
98
99
  <Title>Craftbook</Title>
@@ -20,6 +20,7 @@ export interface IDraggableContainerProps {
20
20
  onPositionChange?: (position: IPosition) => void;
21
21
  onOutsideClick?: () => void;
22
22
  initialPosition?: IPosition;
23
+ scale?: number;
23
24
  }
24
25
 
25
26
  export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
@@ -36,6 +37,7 @@ export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
36
37
  onPositionChange,
37
38
  onOutsideClick,
38
39
  initialPosition = { x: 0, y: 0 },
40
+ scale,
39
41
  }) => {
40
42
  const draggableRef = useRef(null);
41
43
 
@@ -69,6 +71,7 @@ export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
69
71
  }
70
72
  }}
71
73
  defaultPosition={initialPosition}
74
+ scale={scale}
72
75
  >
73
76
  <Container
74
77
  ref={draggableRef}
@@ -33,7 +33,7 @@ export interface IEquipmentSetProps {
33
33
  itemContainerType: ItemContainerType | null
34
34
  ) => void;
35
35
  onItemOutsideDrop?: (item: IItem, position: IPosition) => void;
36
- dragScale?: number;
36
+ scale?: number;
37
37
  checkIfItemCanBeMoved: () => boolean;
38
38
  checkIfItemShouldDragEnd?: () => boolean;
39
39
  onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
@@ -58,7 +58,7 @@ export const EquipmentSet: React.FC<IEquipmentSetProps> = ({
58
58
  onItemOutsideDrop,
59
59
  checkIfItemCanBeMoved,
60
60
  checkIfItemShouldDragEnd,
61
- dragScale,
61
+ scale,
62
62
  }) => {
63
63
  const {
64
64
  neck,
@@ -136,7 +136,7 @@ export const EquipmentSet: React.FC<IEquipmentSetProps> = ({
136
136
  onDragEnd={quantity => {
137
137
  if (onItemDragEnd) onItemDragEnd(quantity);
138
138
  }}
139
- dragScale={dragScale}
139
+ dragScale={scale}
140
140
  checkIfItemCanBeMoved={checkIfItemCanBeMoved}
141
141
  checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}
142
142
  onPlaceDrop={(item, slotIndex, itemContainerType) => {
@@ -162,6 +162,7 @@ export const EquipmentSet: React.FC<IEquipmentSetProps> = ({
162
162
  }}
163
163
  width="330px"
164
164
  cancelDrag=".equipment-container-body"
165
+ scale={scale}
165
166
  >
166
167
  <EquipmentSetContainer className="equipment-container-body">
167
168
  <EquipmentColumn>{onRenderEquipmentSlotRange(0, 3)}</EquipmentColumn>
@@ -35,7 +35,7 @@ export interface IItemContainerProps {
35
35
  slotIndex: number,
36
36
  itemContainerType: ItemContainerType | null
37
37
  ) => void;
38
- dragScale?: number;
38
+ scale?: number;
39
39
  checkIfItemCanBeMoved: () => boolean;
40
40
  checkIfItemShouldDragEnd?: () => boolean;
41
41
  onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
@@ -68,7 +68,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
68
68
  checkIfItemCanBeMoved,
69
69
  initialPosition,
70
70
  checkIfItemShouldDragEnd,
71
- dragScale,
71
+ scale,
72
72
  shortcuts,
73
73
  setItemShortcut,
74
74
  removeShortcut,
@@ -117,7 +117,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
117
117
  onDragEnd={quantity => {
118
118
  if (onItemDragEnd) onItemDragEnd(quantity);
119
119
  }}
120
- dragScale={dragScale}
120
+ dragScale={scale}
121
121
  checkIfItemCanBeMoved={checkIfItemCanBeMoved}
122
122
  checkIfItemShouldDragEnd={checkIfItemShouldDragEnd}
123
123
  openQuantitySelector={(maxQuantity, callback) => {
@@ -150,6 +150,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
150
150
  title={itemContainer.name || 'Container'}
151
151
  onClose={onClose}
152
152
  initialPosition={initialPosition}
153
+ scale={scale}
153
154
  >
154
155
  {type === ItemContainerType.Inventory &&
155
156
  shortcuts &&
@@ -346,7 +346,11 @@ export const ItemSlot: React.FC<IProps> = observer(
346
346
  }, 100);
347
347
  } else if (item) {
348
348
  let isTouch = false;
349
- if (e.type === 'touchend' && !isSelectingShortcut) {
349
+ if (
350
+ !isContextMenuDisabled &&
351
+ e.type === 'touchend' &&
352
+ !isSelectingShortcut
353
+ ) {
350
354
  isTouch = true;
351
355
  setIsTooltipMobileVisible(true);
352
356
  }
@@ -22,6 +22,7 @@ export interface IQuestInfoProps {
22
22
  buttons?: IQuestsButtonProps[];
23
23
  quests: IQuest[];
24
24
  onChangeQuest: (currentQuestIndex: number, currentQuestId: string) => void;
25
+ scale?: number;
25
26
  }
26
27
 
27
28
  export const QuestInfo: React.FC<IQuestInfoProps> = ({
@@ -29,6 +30,7 @@ export const QuestInfo: React.FC<IQuestInfoProps> = ({
29
30
  onClose,
30
31
  buttons,
31
32
  onChangeQuest,
33
+ scale,
32
34
  }) => {
33
35
  const [currentIndex, setCurrentIndex] = useState(0);
34
36
  const questsLength = quests.length - 1;
@@ -56,6 +58,7 @@ export const QuestInfo: React.FC<IQuestInfoProps> = ({
56
58
  }}
57
59
  width="730px"
58
60
  cancelDrag=".equipment-container-body .arrow-selector"
61
+ scale={scale}
59
62
  >
60
63
  {quests.length >= 2 ? (
61
64
  <QuestsContainer>
@@ -8,9 +8,14 @@ import { RPGUIContainerTypes } from './RPGUIContainer';
8
8
  export interface IQuestListProps {
9
9
  quests?: IQuest[];
10
10
  onClose: () => void;
11
+ scale?: number;
11
12
  }
12
13
 
13
- export const QuestList: React.FC<IQuestListProps> = ({ quests, onClose }) => {
14
+ export const QuestList: React.FC<IQuestListProps> = ({
15
+ quests,
16
+ onClose,
17
+ scale,
18
+ }) => {
14
19
  return (
15
20
  <QuestDraggableContainer
16
21
  type={RPGUIContainerTypes.Framed}
@@ -18,6 +23,7 @@ export const QuestList: React.FC<IQuestListProps> = ({ quests, onClose }) => {
18
23
  if (onClose) onClose();
19
24
  }}
20
25
  width="520px"
26
+ scale={scale}
21
27
  >
22
28
  <div style={{ width: '100%' }}>
23
29
  <Title>Quests</Title>
@@ -10,6 +10,7 @@ export interface ISkillContainerProps {
10
10
  onCloseButton: () => void;
11
11
  atlasJSON: any;
12
12
  atlasIMG: any;
13
+ scale?: number;
13
14
  }
14
15
 
15
16
  const skillProps = {
@@ -80,6 +81,7 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
80
81
  skill,
81
82
  atlasIMG,
82
83
  atlasJSON,
84
+ scale,
83
85
  }) => {
84
86
  const onRenderSkillCategory = (
85
87
  category: 'attributes' | 'combat' | 'crafting'
@@ -115,7 +117,11 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
115
117
  };
116
118
 
117
119
  return (
118
- <SkillsDraggableContainer title="Skills" cancelDrag="#skillsDiv">
120
+ <SkillsDraggableContainer
121
+ title="Skills"
122
+ cancelDrag="#skillsDiv"
123
+ scale={scale}
124
+ >
119
125
  {onCloseButton && (
120
126
  <CloseButton onPointerDown={onCloseButton}>X</CloseButton>
121
127
  )}
@@ -21,6 +21,7 @@ export interface ISpellbookProps {
21
21
  removeShortcut: (index: number) => void;
22
22
  atlasIMG: any;
23
23
  atlasJSON: any;
24
+ scale?: number;
24
25
  }
25
26
 
26
27
  export const Spellbook: React.FC<ISpellbookProps> = ({
@@ -36,6 +37,7 @@ export const Spellbook: React.FC<ISpellbookProps> = ({
36
37
  removeShortcut,
37
38
  atlasIMG,
38
39
  atlasJSON,
40
+ scale,
39
41
  }) => {
40
42
  const [search, setSearch] = useState('');
41
43
  const [settingShortcutIndex, setSettingShortcutIndex] = useState(-1);
@@ -82,6 +84,7 @@ export const Spellbook: React.FC<ISpellbookProps> = ({
82
84
  width="inherit"
83
85
  height="inherit"
84
86
  cancelDrag="#spellbook-search, #shortcuts_list, .spell"
87
+ scale={scale}
85
88
  >
86
89
  <Container>
87
90
  <Title>Learned Spells</Title>
@@ -11,15 +11,17 @@ export interface IClockWidgetProps {
11
11
  onClose?: () => void;
12
12
  TimeClock: string;
13
13
  periodOfDay: PeriodOfDay;
14
+ scale?: number;
14
15
  }
15
16
 
16
17
  export const TimeWidget: React.FC<IClockWidgetProps> = ({
17
18
  onClose,
18
19
  TimeClock,
19
20
  periodOfDay,
21
+ scale,
20
22
  }) => {
21
23
  return (
22
- <Draggable>
24
+ <Draggable scale={scale}>
23
25
  <WidgetContainer>
24
26
  <CloseButton onPointerDown={onClose}>X</CloseButton>
25
27
  <DayNightContainer>
@@ -92,6 +92,7 @@ export const TradingMenu: React.FC<ITradingMenu> = ({
92
92
  }}
93
93
  width="600px"
94
94
  cancelDrag="#TraderContainer"
95
+ scale={scale}
95
96
  >
96
97
  <>
97
98
  <div style={{ width: '100%' }}>