@rpg-engine/long-bow 0.1.74 → 0.1.77
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/ScrollList.d.ts +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +314 -1169
- 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 +314 -1170
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +4 -4
- package/src/components/DraggableContainer.tsx +37 -43
- package/src/components/Item/Inventory/ItemSlot.tsx +1 -1
- package/src/components/Multitab/TabsContainer.tsx +1 -3
- package/src/components/ScrollList.tsx +77 -0
- package/src/index.tsx +1 -0
- package/src/mocks/atlas/items/items.json +151 -1139
- package/src/mocks/atlas/items/items.png +0 -0
- package/src/mocks/equipmentSet.mocks.ts +7 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.77",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"@storybook/addon-links": "^6.5.9",
|
|
62
62
|
"@storybook/addons": "^6.5.9",
|
|
63
63
|
"@storybook/react": "^6.5.9",
|
|
64
|
-
"@types/react": "^
|
|
65
|
-
"@types/react-dom": "^
|
|
64
|
+
"@types/react": "^18.0.14",
|
|
65
|
+
"@types/react-dom": "^18.0.5",
|
|
66
66
|
"@types/styled-components": "^5.1.24",
|
|
67
67
|
"@types/uuid": "^8.3.4",
|
|
68
68
|
"babel-loader": "^8.2.3",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@rollup/plugin-image": "^2.1.1",
|
|
86
|
-
"@rpg-engine/shared": "^0.3.
|
|
86
|
+
"@rpg-engine/shared": "^0.3.40",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"fs-extra": "^10.1.0",
|
|
89
89
|
"mobx": "^6.6.0",
|
|
@@ -55,45 +55,44 @@ export const DraggableContainer: React.FC<IDraggableContainerProps> = ({
|
|
|
55
55
|
}, []);
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
<Draggable
|
|
59
|
+
cancel={`.container-close,${cancelDrag}`}
|
|
60
|
+
onDrag={(_e, data: DraggableData) => {
|
|
61
|
+
if (onPositionChange) {
|
|
62
|
+
onPositionChange({
|
|
63
|
+
x: data.x,
|
|
64
|
+
y: data.y,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<Container
|
|
70
|
+
ref={draggableRef}
|
|
71
|
+
width={width}
|
|
72
|
+
height={height || 'auto'}
|
|
73
|
+
className={`rpgui-container ${type} ${className}`}
|
|
69
74
|
>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
)}
|
|
92
|
-
|
|
93
|
-
{children}
|
|
94
|
-
</Container>
|
|
95
|
-
</Draggable>
|
|
96
|
-
</DraggableRef>
|
|
75
|
+
{title && (
|
|
76
|
+
<TitleContainer className="drag-handler">
|
|
77
|
+
<Title>
|
|
78
|
+
{imgSrc && <Icon src={imgSrc} width={imgWidth} />}
|
|
79
|
+
{title}
|
|
80
|
+
</Title>
|
|
81
|
+
</TitleContainer>
|
|
82
|
+
)}
|
|
83
|
+
{onCloseButton && (
|
|
84
|
+
<CloseButton
|
|
85
|
+
className="container-close"
|
|
86
|
+
onClick={onCloseButton}
|
|
87
|
+
onTouchStart={onCloseButton}
|
|
88
|
+
>
|
|
89
|
+
X
|
|
90
|
+
</CloseButton>
|
|
91
|
+
)}
|
|
92
|
+
|
|
93
|
+
{children}
|
|
94
|
+
</Container>
|
|
95
|
+
</Draggable>
|
|
97
96
|
);
|
|
98
97
|
};
|
|
99
98
|
|
|
@@ -102,11 +101,6 @@ interface IContainerProps {
|
|
|
102
101
|
height: string;
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
const DraggableRef = styled.div<IContainerProps>`
|
|
106
|
-
height: ${props => props.height};
|
|
107
|
-
width: ${({ width }) => width};
|
|
108
|
-
`;
|
|
109
|
-
|
|
110
104
|
const Container = styled.div<IContainerProps>`
|
|
111
105
|
height: ${props => props.height};
|
|
112
106
|
width: ${({ width }) => width};
|
|
@@ -16,7 +16,7 @@ const EquipmentSlotSpriteByType: any = {
|
|
|
16
16
|
Ring: 'rings/iron-ring.png',
|
|
17
17
|
Head: 'helmets/viking-helmet.png',
|
|
18
18
|
Torso: 'armors/iron-armor.png',
|
|
19
|
-
Legs: '
|
|
19
|
+
Legs: 'legs/studded-legs.png',
|
|
20
20
|
Feet: 'boots/iron-boots.png',
|
|
21
21
|
Inventory: 'containers/bag.png',
|
|
22
22
|
RightHand: 'shields/plate-shield.png',
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { DraggableContainer } from './DraggableContainer';
|
|
4
|
+
|
|
5
|
+
interface IListMenuOption {
|
|
6
|
+
id: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IListMenuProps {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
options: IListMenuOption[];
|
|
14
|
+
onSelected: (selectedOptionId: string) => void;
|
|
15
|
+
fontSize?: number;
|
|
16
|
+
title: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const ListMenu: React.FC<IListMenuProps> = ({
|
|
20
|
+
options,
|
|
21
|
+
onSelected,
|
|
22
|
+
title,
|
|
23
|
+
}) => {
|
|
24
|
+
return (
|
|
25
|
+
<ScrollListContainer title={title}>
|
|
26
|
+
<SkillSplitDiv>
|
|
27
|
+
<hr className="golden" />
|
|
28
|
+
</SkillSplitDiv>
|
|
29
|
+
|
|
30
|
+
<ListContainer className="rpgui-list-imp">
|
|
31
|
+
{options.map(params => (
|
|
32
|
+
<ListElement
|
|
33
|
+
key={params?.id}
|
|
34
|
+
onClick={() => {
|
|
35
|
+
onSelected(params?.id);
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
{params?.text || 'No text'}
|
|
39
|
+
</ListElement>
|
|
40
|
+
))}
|
|
41
|
+
</ListContainer>
|
|
42
|
+
</ScrollListContainer>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const ScrollListContainer = styled(DraggableContainer)`
|
|
47
|
+
border: 1px solid black;
|
|
48
|
+
width: 400px;
|
|
49
|
+
height: 400px;
|
|
50
|
+
.DraggableContainer__TitleContainer-sc-184mpyl-2 {
|
|
51
|
+
width: auto;
|
|
52
|
+
height: auto;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
const SkillSplitDiv = styled.div`
|
|
57
|
+
width: 100%;
|
|
58
|
+
font-size: 11px;
|
|
59
|
+
margin-bottom: 10px;
|
|
60
|
+
hr {
|
|
61
|
+
margin: 0px;
|
|
62
|
+
padding: 0px;
|
|
63
|
+
}
|
|
64
|
+
p {
|
|
65
|
+
margin-bottom: 0px;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
const ListContainer = styled.ul`
|
|
70
|
+
border: none;
|
|
71
|
+
width: 400px;
|
|
72
|
+
height: 250px;
|
|
73
|
+
overflow-y: scroll;
|
|
74
|
+
`;
|
|
75
|
+
const ListElement = styled.li`
|
|
76
|
+
margin-right: 0.5rem;
|
|
77
|
+
`;
|
package/src/index.tsx
CHANGED
|
@@ -18,6 +18,7 @@ export * from './components/RPGUIRoot';
|
|
|
18
18
|
export * from './components/shared/SpriteFromAtlas';
|
|
19
19
|
export * from './components/shared/SpriteIcon';
|
|
20
20
|
export * from './components/SkillProgressBar';
|
|
21
|
+
export * from './components/SkillsContainer';
|
|
21
22
|
export * from './components/TextArea';
|
|
22
23
|
export * from './components/Truncate';
|
|
23
24
|
export * from './components/typography/DynamicText';
|