@rpg-engine/long-bow 0.3.44 → 0.3.45
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/Abstractions/SlotsContainer.d.ts +1 -0
- package/dist/components/Button.d.ts +3 -2
- package/dist/components/Chat/Chat.d.ts +12 -2
- package/dist/components/Chatdeprecated/ChatDeprecated.d.ts +13 -0
- package/dist/components/CheckButton.d.ts +1 -2
- package/dist/components/CircularController/CircularController.d.ts +10 -0
- package/dist/components/CraftBook/CraftBook.d.ts +15 -0
- package/dist/components/CraftBook/MockItems.d.ts +2 -0
- package/dist/components/DraggableContainer.d.ts +1 -0
- package/dist/components/DropdownSelectorContainer.d.ts +13 -0
- package/dist/components/Equipment/EquipmentSet.d.ts +8 -0
- package/dist/components/Input.d.ts +1 -0
- package/dist/components/Item/Inventory/ItemContainer.d.ts +12 -0
- package/dist/components/Item/Inventory/ItemQuantitySelector.d.ts +7 -0
- package/dist/components/Item/Inventory/ItemSlot.d.ts +9 -0
- package/dist/components/NPCDialog/NPCDialogText.d.ts +4 -2
- package/dist/components/RadioInput/RadioButton.d.ts +8 -0
- package/dist/components/RadioInput/RadioInput.d.ts +13 -0
- package/dist/components/RadioInput/instruments.d.ts +4 -0
- package/dist/components/RangeSlider.d.ts +1 -0
- package/dist/components/Spellbook/QuickSpells.d.ts +10 -0
- package/dist/components/Spellbook/Spell.d.ts +11 -0
- package/dist/components/Spellbook/Spellbook.d.ts +15 -0
- package/dist/components/Spellbook/SpellbookShortcuts.d.ts +10 -0
- package/dist/components/Spellbook/constants.d.ts +3 -0
- package/dist/components/Spellbook/mockSpells.d.ts +2 -0
- package/dist/components/itemSelector/ItemSelector.d.ts +14 -0
- package/dist/constants/uiDevices.d.ts +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/long-bow.cjs.development.js +7464 -515
- 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 +7458 -518
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/mocks/equipmentSet.mocks.d.ts +15 -2
- package/dist/mocks/skills.mocks.d.ts +2 -121
- package/dist/stories/ChatDeprecated.stories.d.ts +5 -0
- package/dist/stories/CircullarController.stories.d.ts +5 -0
- package/dist/stories/CraftBook.stories.d.ts +4 -0
- package/dist/stories/DropdownSelectorContainer.stories.d.ts +5 -0
- package/dist/stories/ItemQuantitySelector.stories.d.ts +5 -0
- package/dist/stories/ItemSelector.stories.d.ts +4 -0
- package/dist/stories/QuickSpells.stories.d.ts +5 -0
- package/dist/stories/RadioInput.stories.d.ts +5 -0
- package/dist/stories/Spellbook.stories.d.ts +5 -0
- package/package.json +4 -1
- package/src/components/Abstractions/SlotsContainer.tsx +3 -0
- package/src/components/Button.tsx +18 -8
- package/src/components/Chat/Chat.tsx +105 -105
- package/src/components/Chatdeprecated/ChatDeprecated.tsx +200 -0
- package/src/components/CheckButton.tsx +1 -1
- package/src/components/CircularController/CircularController.tsx +162 -0
- package/src/components/CraftBook/CraftBook.tsx +230 -0
- package/src/components/CraftBook/MockItems.ts +46 -0
- package/src/components/DraggableContainer.tsx +4 -1
- package/src/components/Dropdown.tsx +7 -1
- package/src/components/DropdownSelectorContainer.tsx +42 -0
- package/src/components/Equipment/EquipmentSet.tsx +46 -0
- package/src/components/Input.tsx +6 -2
- package/src/components/Item/Inventory/ItemContainer.tsx +104 -6
- package/src/components/Item/Inventory/ItemQuantitySelector.tsx +142 -0
- package/src/components/Item/Inventory/ItemSlot.tsx +234 -34
- package/src/components/NPCDialog/NPCDialog.tsx +4 -28
- package/src/components/NPCDialog/NPCDialogText.tsx +75 -15
- package/src/components/NPCDialog/img/press-button.gif +0 -0
- package/src/components/RadioInput/RadioButton.tsx +98 -0
- package/src/components/RadioInput/RadioInput.tsx +99 -0
- package/src/components/RadioInput/instruments.ts +16 -0
- package/src/components/RangeSlider.tsx +37 -14
- package/src/components/SkillsContainer.tsx +1 -1
- package/src/components/Spellbook/QuickSpells.tsx +120 -0
- package/src/components/Spellbook/Spell.tsx +201 -0
- package/src/components/Spellbook/Spellbook.tsx +144 -0
- package/src/components/Spellbook/SpellbookShortcuts.tsx +77 -0
- package/src/components/Spellbook/constants.ts +12 -0
- package/src/components/Spellbook/mockSpells.ts +60 -0
- package/src/components/TimeWidget/TimeWidget.tsx +1 -0
- package/src/components/TradingMenu/TradingItemRow.tsx +43 -6
- package/src/components/TradingMenu/TradingMenu.tsx +1 -1
- package/src/components/itemSelector/ItemSelector.tsx +136 -0
- package/src/components/shared/SpriteFromAtlas.tsx +4 -1
- package/src/constants/uiDevices.ts +5 -0
- package/src/hooks/useOutsideAlerter.ts +2 -2
- package/src/index.tsx +8 -0
- package/src/mocks/atlas/items/items.json +6086 -314
- package/src/mocks/atlas/items/items.png +0 -0
- package/src/mocks/equipmentSet.mocks.ts +49 -4
- package/src/mocks/itemContainer.mocks.ts +54 -6
- package/src/mocks/skills.mocks.ts +8 -2
- package/src/stories/Chat.stories.tsx +20 -3
- package/src/stories/ChatDeprecated.stories.tsx +170 -0
- package/src/stories/CircullarController.stories.tsx +33 -0
- package/src/stories/CraftBook.stories.tsx +40 -0
- package/src/stories/DropdownSelectorContainer.stories.tsx +41 -0
- package/src/stories/EquipmentSet.stories.tsx +10 -0
- package/src/stories/ItemContainer.stories.tsx +84 -15
- package/src/stories/ItemQuantitySelector.stories.tsx +26 -0
- package/src/stories/ItemSelector.stories.tsx +77 -0
- package/src/stories/QuickSpells.stories.tsx +38 -0
- package/src/stories/RadioInput.stories.tsx +35 -0
- package/src/stories/RangeSlider.stories.tsx +10 -9
- package/src/stories/Spellbook.stories.tsx +107 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { IRawSpell } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { uiColors } from '../../constants/uiColors';
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
setSettingShortcutIndex: (index: number) => void;
|
|
8
|
+
settingShortcutIndex: number;
|
|
9
|
+
shortcuts: IRawSpell[];
|
|
10
|
+
removeShortcut: (index: number) => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const SpellbookShortcuts: React.FC<Props> = ({
|
|
14
|
+
setSettingShortcutIndex,
|
|
15
|
+
settingShortcutIndex,
|
|
16
|
+
shortcuts,
|
|
17
|
+
removeShortcut,
|
|
18
|
+
}) => (
|
|
19
|
+
<List id="shortcuts_list">
|
|
20
|
+
Spells shortcuts:
|
|
21
|
+
{Array.from({ length: 4 }).map((_, i) => (
|
|
22
|
+
<SpellShortcut
|
|
23
|
+
key={i}
|
|
24
|
+
onClick={() => {
|
|
25
|
+
removeShortcut(i);
|
|
26
|
+
if (!shortcuts[i]?.key) setSettingShortcutIndex(i);
|
|
27
|
+
}}
|
|
28
|
+
disabled={settingShortcutIndex !== -1 && settingShortcutIndex !== i}
|
|
29
|
+
isBeingSet={settingShortcutIndex === i}
|
|
30
|
+
>
|
|
31
|
+
<span>{shortcuts[i]?.magicWords.split(' ').map(word => word[0])}</span>
|
|
32
|
+
</SpellShortcut>
|
|
33
|
+
))}
|
|
34
|
+
</List>
|
|
35
|
+
);
|
|
36
|
+
const SpellShortcut = styled.button<{ isBeingSet?: boolean }>`
|
|
37
|
+
width: 2.6rem;
|
|
38
|
+
height: 2.6rem;
|
|
39
|
+
background-color: ${uiColors.lightGray};
|
|
40
|
+
border: 2px solid
|
|
41
|
+
${({ isBeingSet }) => (isBeingSet ? uiColors.yellow : uiColors.darkGray)};
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
text-transform: uppercase;
|
|
44
|
+
font-size: 0.7rem;
|
|
45
|
+
font-weight: bold;
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
|
|
50
|
+
span {
|
|
51
|
+
margin-top: 4px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:hover,
|
|
55
|
+
&:focus {
|
|
56
|
+
background-color: ${uiColors.darkGray};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:active {
|
|
60
|
+
background-color: ${uiColors.gray};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&:disabled {
|
|
64
|
+
opacity: 0.5;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
const List = styled.p`
|
|
69
|
+
width: 100%;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: flex-end;
|
|
73
|
+
gap: 0.5rem;
|
|
74
|
+
padding: 0.5rem;
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
margin: 0 !important;
|
|
77
|
+
`;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IRawSpell } from '@rpg-engine/shared';
|
|
2
|
+
|
|
3
|
+
export const SPELL_SHORTCUTS_STORAGE_KEY = 'spellShortcuts';
|
|
4
|
+
|
|
5
|
+
export const defaultSpellShortcut: IRawSpell = {
|
|
6
|
+
key: '',
|
|
7
|
+
manaCost: 0,
|
|
8
|
+
magicWords: '',
|
|
9
|
+
name: '',
|
|
10
|
+
description: '',
|
|
11
|
+
minMagicLevelRequired: 0,
|
|
12
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { IRawSpell } from '@rpg-engine/shared';
|
|
2
|
+
|
|
3
|
+
enum SpellsBlueprint {
|
|
4
|
+
SelfHealingSpell = 'self-healing-spell',
|
|
5
|
+
FoodCreationSpell = 'food-creation-spell',
|
|
6
|
+
ArrowCreationSpell = 'arrow-creation-spell',
|
|
7
|
+
BoltCreationSpell = 'bolt-creation-spell',
|
|
8
|
+
BlankRuneCreationSpell = 'blank-rune-creation-spell',
|
|
9
|
+
SelfHasteSpell = 'self-haste-spell',
|
|
10
|
+
FireRuneCreationSpell = 'fire-rune-creation-spell',
|
|
11
|
+
HealRuneCreationSpell = 'healing-rune-creation-spell',
|
|
12
|
+
PoisonRuneCreationSpell = 'poison-rune-creation-spell',
|
|
13
|
+
DarkRuneCreationSpell = 'dark-rune-creation-spell',
|
|
14
|
+
GreaterHealingSpell = 'greater-healing-spell',
|
|
15
|
+
EnergyBoltCreationSpell = 'energy-bolt-creation-spell',
|
|
16
|
+
FireBoltCreationSpell = 'fire-bolt-creation-spell',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const mockSpells: IRawSpell[] = [
|
|
20
|
+
{
|
|
21
|
+
key: SpellsBlueprint.ArrowCreationSpell,
|
|
22
|
+
name: 'Arrow Creation Spell',
|
|
23
|
+
description: 'A spell that creates arrow in your inventory.',
|
|
24
|
+
magicWords: 'iquar elandi',
|
|
25
|
+
manaCost: 10,
|
|
26
|
+
minMagicLevelRequired: 3,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: SpellsBlueprint.BlankRuneCreationSpell,
|
|
30
|
+
name: 'Blank Rune Creation Spell',
|
|
31
|
+
description: 'A spell that creates a blank rune in your inventory.',
|
|
32
|
+
magicWords: 'iquar ansr ki',
|
|
33
|
+
manaCost: 5,
|
|
34
|
+
minMagicLevelRequired: 3,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: SpellsBlueprint.BoltCreationSpell,
|
|
38
|
+
name: 'Bolt Creation Spell',
|
|
39
|
+
description: 'A spell that creates bolt in your inventory.',
|
|
40
|
+
magicWords: 'iquar lyn',
|
|
41
|
+
manaCost: 15,
|
|
42
|
+
minMagicLevelRequired: 3,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: SpellsBlueprint.SelfHasteSpell,
|
|
46
|
+
name: 'Self Haste Spell',
|
|
47
|
+
description: 'A self haste spell.',
|
|
48
|
+
magicWords: 'talas hiz',
|
|
49
|
+
manaCost: 40,
|
|
50
|
+
minMagicLevelRequired: 5,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: SpellsBlueprint.SelfHealingSpell,
|
|
54
|
+
name: 'Self Healing Spell',
|
|
55
|
+
description: 'A self healing spell.',
|
|
56
|
+
magicWords: 'talas faenya',
|
|
57
|
+
manaCost: 10,
|
|
58
|
+
minMagicLevelRequired: 1,
|
|
59
|
+
},
|
|
60
|
+
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ITradeResponseItem } from '@rpg-engine/shared';
|
|
1
|
+
import { getItemTextureKeyPath, ITradeResponseItem } from '@rpg-engine/shared';
|
|
2
2
|
import capitalize from 'lodash/capitalize';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -37,6 +37,18 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
37
37
|
onQuantityChange(traderItem, newQuantity);
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
+
const onLeftOutClick = () => {
|
|
41
|
+
if (selectedQty >= 10) {
|
|
42
|
+
const newQuantity = selectedQty - 10;
|
|
43
|
+
onQuantityChange(traderItem, newQuantity);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const onRightOutClick = () => {
|
|
47
|
+
if (selectedQty + 10 <= (traderItem.qty ?? 999)) {
|
|
48
|
+
const newQuantity = selectedQty + 10;
|
|
49
|
+
onQuantityChange(traderItem, newQuantity);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
40
52
|
|
|
41
53
|
return (
|
|
42
54
|
<ItemWrapper>
|
|
@@ -45,7 +57,14 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
45
57
|
<SpriteFromAtlas
|
|
46
58
|
atlasIMG={atlasIMG}
|
|
47
59
|
atlasJSON={atlasJSON}
|
|
48
|
-
spriteKey={
|
|
60
|
+
spriteKey={getItemTextureKeyPath(
|
|
61
|
+
{
|
|
62
|
+
key: traderItem.key,
|
|
63
|
+
stackQty: traderItem.qty || 1,
|
|
64
|
+
texturePath: traderItem.texturePath,
|
|
65
|
+
},
|
|
66
|
+
atlasJSON
|
|
67
|
+
)}
|
|
49
68
|
imgScale={2.5}
|
|
50
69
|
/>
|
|
51
70
|
</SpriteContainer>
|
|
@@ -63,29 +82,47 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
63
82
|
|
|
64
83
|
<QuantityContainer>
|
|
65
84
|
<SelectArrow
|
|
85
|
+
size={32}
|
|
86
|
+
className="arrow-selector"
|
|
87
|
+
direction="left"
|
|
88
|
+
onClick={onLeftOutClick}
|
|
89
|
+
onTouchStart={onLeftOutClick}
|
|
90
|
+
/>
|
|
91
|
+
<StyledArrow
|
|
66
92
|
size={32}
|
|
67
93
|
className="arrow-selector"
|
|
68
94
|
direction="left"
|
|
69
95
|
onClick={onLeftClick}
|
|
70
96
|
onTouchStart={onLeftClick}
|
|
71
|
-
|
|
97
|
+
/>
|
|
72
98
|
<QuantityDisplay>
|
|
73
99
|
<TextOverlay>
|
|
74
100
|
<Item>{selectedQty}</Item>
|
|
75
101
|
</TextOverlay>
|
|
76
102
|
</QuantityDisplay>
|
|
77
|
-
<
|
|
103
|
+
<StyledArrow
|
|
78
104
|
size={32}
|
|
79
105
|
className="arrow-selector"
|
|
80
106
|
direction="right"
|
|
81
107
|
onClick={onRightClick}
|
|
82
108
|
onTouchStart={onRightClick}
|
|
83
|
-
|
|
109
|
+
/>
|
|
110
|
+
<SelectArrow
|
|
111
|
+
size={32}
|
|
112
|
+
className="arrow-selector"
|
|
113
|
+
direction="right"
|
|
114
|
+
onClick={onRightOutClick}
|
|
115
|
+
onTouchStart={onRightOutClick}
|
|
116
|
+
/>
|
|
84
117
|
</QuantityContainer>
|
|
85
118
|
</ItemWrapper>
|
|
86
119
|
);
|
|
87
120
|
};
|
|
88
121
|
|
|
122
|
+
const StyledArrow = styled(SelectArrow)`
|
|
123
|
+
margin: 40px;
|
|
124
|
+
`;
|
|
125
|
+
|
|
89
126
|
const ItemWrapper = styled.div`
|
|
90
127
|
width: 100%;
|
|
91
128
|
margin: auto;
|
|
@@ -152,7 +189,7 @@ const QuantityContainer = styled.div<IContainerProps>`
|
|
|
152
189
|
justify-content: center;
|
|
153
190
|
align-items: center;
|
|
154
191
|
|
|
155
|
-
flex:
|
|
192
|
+
flex: 40%;
|
|
156
193
|
`;
|
|
157
194
|
|
|
158
195
|
const QuantityDisplay = styled.div`
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Button, ButtonTypes } from '../Button';
|
|
4
|
+
import { DraggableContainer } from '../DraggableContainer';
|
|
5
|
+
import { RPGUIContainerTypes } from '../RPGUIContainer';
|
|
6
|
+
import { SpriteFromAtlas } from '../shared/SpriteFromAtlas';
|
|
7
|
+
|
|
8
|
+
export interface IOptionsItemSelectorProps {
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
imageKey: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IItemSelectorProps {
|
|
15
|
+
atlasJSON: any;
|
|
16
|
+
atlasIMG: any;
|
|
17
|
+
options: IOptionsItemSelectorProps[];
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
onSelect: (value: string) => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const ItemSelector: React.FC<IItemSelectorProps> = ({
|
|
23
|
+
atlasIMG,
|
|
24
|
+
atlasJSON,
|
|
25
|
+
options,
|
|
26
|
+
onClose,
|
|
27
|
+
onSelect,
|
|
28
|
+
}) => {
|
|
29
|
+
const [selectedValue, setSelectedValue] = useState<string>();
|
|
30
|
+
|
|
31
|
+
const handleClick = () => {
|
|
32
|
+
let element = document.querySelector(
|
|
33
|
+
`input[name='test']:checked`
|
|
34
|
+
) as HTMLInputElement;
|
|
35
|
+
const elementValue = element.value;
|
|
36
|
+
setSelectedValue(elementValue);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (selectedValue) {
|
|
41
|
+
onSelect(selectedValue);
|
|
42
|
+
}
|
|
43
|
+
}, [selectedValue]);
|
|
44
|
+
return (
|
|
45
|
+
<DraggableContainer
|
|
46
|
+
type={RPGUIContainerTypes.Framed}
|
|
47
|
+
width="500px"
|
|
48
|
+
cancelDrag=".equipment-container-body .arrow-selector"
|
|
49
|
+
onCloseButton={() => {
|
|
50
|
+
if (onClose) {
|
|
51
|
+
onClose();
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<div style={{ width: '100%' }}>
|
|
56
|
+
<Title>{'Harvesting instruments'}</Title>
|
|
57
|
+
<Subtitle>{'Use the tool, you need it'}</Subtitle>
|
|
58
|
+
<hr className="golden" />
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<RadioInputScroller>
|
|
62
|
+
{options?.map((option, index) => (
|
|
63
|
+
<RadioOptionsWrapper key={index}>
|
|
64
|
+
<SpriteAtlasWrapper>
|
|
65
|
+
<SpriteFromAtlas
|
|
66
|
+
atlasIMG={atlasIMG}
|
|
67
|
+
atlasJSON={atlasJSON}
|
|
68
|
+
spriteKey={option.imageKey}
|
|
69
|
+
imgScale={3}
|
|
70
|
+
/>
|
|
71
|
+
</SpriteAtlasWrapper>
|
|
72
|
+
<div>
|
|
73
|
+
<input
|
|
74
|
+
className="rpgui-radio"
|
|
75
|
+
type="radio"
|
|
76
|
+
value={option.name}
|
|
77
|
+
name="test"
|
|
78
|
+
/>
|
|
79
|
+
<label
|
|
80
|
+
onClick={handleClick}
|
|
81
|
+
style={{ display: 'flex', alignItems: 'center' }}
|
|
82
|
+
>
|
|
83
|
+
{option.name} <br />
|
|
84
|
+
{option.description}
|
|
85
|
+
</label>
|
|
86
|
+
</div>
|
|
87
|
+
</RadioOptionsWrapper>
|
|
88
|
+
))}
|
|
89
|
+
</RadioInputScroller>
|
|
90
|
+
<ButtonWrapper>
|
|
91
|
+
<Button buttonType={ButtonTypes.RPGUIButton} onClick={onClose}>
|
|
92
|
+
Cancel
|
|
93
|
+
</Button>
|
|
94
|
+
<Button buttonType={ButtonTypes.RPGUIButton}>Select</Button>
|
|
95
|
+
</ButtonWrapper>
|
|
96
|
+
</DraggableContainer>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const Title = styled.h1`
|
|
101
|
+
font-size: 0.6rem;
|
|
102
|
+
color: yellow !important;
|
|
103
|
+
`;
|
|
104
|
+
const Subtitle = styled.h1`
|
|
105
|
+
font-size: 0.4rem;
|
|
106
|
+
color: yellow !important;
|
|
107
|
+
`;
|
|
108
|
+
|
|
109
|
+
const RadioInputScroller = styled.div`
|
|
110
|
+
padding-left: 15px;
|
|
111
|
+
padding-top: 10px;
|
|
112
|
+
width: 100%;
|
|
113
|
+
margin-top: 1rem;
|
|
114
|
+
align-items: center;
|
|
115
|
+
margin-left: 20px;
|
|
116
|
+
align-items: flex-start;
|
|
117
|
+
overflow-y: scroll;
|
|
118
|
+
height: 360px;
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
const SpriteAtlasWrapper = styled.div`
|
|
122
|
+
margin-right: 40px;
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
const RadioOptionsWrapper = styled.div`
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: stretch;
|
|
128
|
+
margin-bottom: 40px;
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
const ButtonWrapper = styled.div`
|
|
132
|
+
display: flex;
|
|
133
|
+
justify-content: space-around;
|
|
134
|
+
padding-top: 20px;
|
|
135
|
+
width: 100%;
|
|
136
|
+
`;
|
|
@@ -32,7 +32,10 @@ export const SpriteFromAtlas: React.FC<IProps> = ({
|
|
|
32
32
|
//! If an item is not showing, remember that you MUST run yarn atlas:copy everytime you add a new item to the atlas (it will sync our public folder atlas with src/atlas).
|
|
33
33
|
//!Due to React's limitations, we cannot import it from the public folder directly!
|
|
34
34
|
|
|
35
|
-
const spriteData =
|
|
35
|
+
const spriteData =
|
|
36
|
+
atlasJSON.frames[spriteKey] || atlasJSON.frames['others/no-image.png'];
|
|
37
|
+
|
|
38
|
+
if (!spriteData) throw new Error(`Sprite ${spriteKey} not found in atlas!`);
|
|
36
39
|
|
|
37
40
|
return (
|
|
38
41
|
<Container
|
|
@@ -16,10 +16,10 @@ export function useOutsideClick(ref: any, id: string) {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
// Bind the event listener
|
|
19
|
-
document.addEventListener('
|
|
19
|
+
document.addEventListener('pointerdown', handleClickOutside);
|
|
20
20
|
return () => {
|
|
21
21
|
// Unbind the event listener on clean up
|
|
22
|
-
document.removeEventListener('
|
|
22
|
+
document.removeEventListener('pointerdown', handleClickOutside);
|
|
23
23
|
};
|
|
24
24
|
}, [ref]);
|
|
25
25
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
export * from './components/Button';
|
|
2
2
|
export * from './components/Character/CharacterSelection';
|
|
3
3
|
export * from './components/Chat/Chat';
|
|
4
|
+
export * from './components/Chatdeprecated/ChatDeprecated';
|
|
4
5
|
export * from './components/CheckButton';
|
|
6
|
+
export * from './components/CircularController/CircularController';
|
|
7
|
+
export * from './components/CraftBook/CraftBook';
|
|
5
8
|
export * from './components/DraggableContainer';
|
|
6
9
|
export * from './components/Dropdown';
|
|
10
|
+
export * from './components/DropdownSelectorContainer';
|
|
7
11
|
export * from './components/Equipment/EquipmentSet';
|
|
8
12
|
export * from './components/HistoryDialog';
|
|
9
13
|
export * from './components/Input';
|
|
14
|
+
export { ErrorBoundary } from './components/Item/Inventory/ErrorBoundary';
|
|
10
15
|
export * from './components/Item/Inventory/ItemContainer';
|
|
11
16
|
export * from './components/Item/Inventory/ItemSlot';
|
|
17
|
+
export * from './components/itemSelector/ItemSelector';
|
|
12
18
|
export * from './components/ListMenu';
|
|
13
19
|
export * from './components/NPCDialog/NPCDialog';
|
|
14
20
|
export * from './components/NPCDialog/NPCMultiDialog';
|
|
@@ -24,6 +30,8 @@ export * from './components/RPGUIRoot';
|
|
|
24
30
|
export * from './components/shared/SpriteFromAtlas';
|
|
25
31
|
export * from './components/SkillProgressBar';
|
|
26
32
|
export * from './components/SkillsContainer';
|
|
33
|
+
export * from './components/Spellbook/QuickSpells';
|
|
34
|
+
export * from './components/Spellbook/Spellbook';
|
|
27
35
|
export * from './components/TextArea';
|
|
28
36
|
export * from './components/TimeWidget/TimeWidget';
|
|
29
37
|
export * from './components/TradingMenu/TradingMenu';
|