@rpg-engine/long-bow 0.1.77 → 0.1.792
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/LICENSE +20 -20
- package/README.md +181 -181
- package/dist/components/store/UI.store.d.ts +3 -0
- package/dist/long-bow.cjs.development.js +14 -5
- 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 +14 -5
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/mocks/skills.mocks.d.ts +6 -0
- package/package.json +96 -96
- package/src/components/Abstractions/SlotsContainer.tsx +42 -42
- package/src/components/Button.tsx +29 -29
- package/src/components/Chat/Chat.tsx +193 -193
- package/src/components/CheckButton.tsx +65 -65
- package/src/components/DraggableContainer.tsx +150 -150
- package/src/components/Dropdown.tsx +57 -57
- package/src/components/Equipment/EquipmentSet.tsx +180 -179
- package/src/components/Input.tsx +11 -11
- package/src/components/Item/Cards/ItemCard.tsx +36 -36
- package/src/components/Item/Inventory/ItemContainer.tsx +113 -113
- package/src/components/Item/Inventory/ItemSlot.tsx +158 -158
- package/src/components/Item/Inventory/itemContainerHelper.ts +81 -81
- package/src/components/ListMenu.tsx +65 -65
- package/src/components/Multitab/Tab.tsx +57 -57
- package/src/components/Multitab/TabBody.tsx +13 -13
- package/src/components/Multitab/TabsContainer.tsx +97 -97
- package/src/components/NPCDialog/NPCDialog.tsx +145 -145
- package/src/components/NPCDialog/NPCDialogText.tsx +53 -53
- package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +242 -242
- package/src/components/ProgressBar.tsx +91 -91
- package/src/components/RPGUIContainer.tsx +47 -47
- package/src/components/RPGUIRoot.tsx +14 -14
- package/src/components/RadioButton.tsx +53 -53
- package/src/components/RangeSlider.tsx +68 -68
- package/src/components/ScrollList.tsx +77 -77
- package/src/components/SimpleProgressBar.tsx +62 -62
- package/src/components/SkillProgressBar.tsx +124 -124
- package/src/components/SkillsContainer.tsx +235 -235
- package/src/components/TextArea.tsx +11 -11
- package/src/components/Truncate.tsx +25 -25
- package/src/components/shared/Column.tsx +16 -16
- package/src/components/shared/SpriteFromAtlas.tsx +99 -99
- package/src/components/shared/SpriteIcon.tsx +67 -67
- package/src/components/store/UI.store.ts +205 -192
- package/src/components/typography/DynamicText.tsx +49 -49
- package/src/constants/uiColors.ts +10 -10
- package/src/hooks/useEventListener.ts +21 -21
- package/src/hooks/useOutsideAlerter.ts +25 -25
- package/src/index.tsx +25 -25
- package/src/libs/StringHelpers.ts +3 -3
- package/src/mocks/atlas/icons/icons.json +303 -303
- package/src/mocks/atlas/items/items.json +5195 -5195
- package/src/mocks/equipmentSet.mocks.ts +347 -347
- package/src/mocks/itemContainer.mocks.ts +249 -249
- package/src/mocks/skills.mocks.ts +122 -116
- package/src/types/eventTypes.ts +4 -4
- package/src/types/index.d.ts +2 -2
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
|
|
5
|
-
interface IProps {
|
|
6
|
-
atlasJSON: any;
|
|
7
|
-
atlasIMG: any;
|
|
8
|
-
spriteKey: string;
|
|
9
|
-
width?: number;
|
|
10
|
-
height?: number;
|
|
11
|
-
grayScale?: boolean;
|
|
12
|
-
opacity?: number;
|
|
13
|
-
onClick?: () => void;
|
|
14
|
-
containerStyle?: any;
|
|
15
|
-
imgStyle?: any;
|
|
16
|
-
imgScale?: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const SpriteFromAtlas: React.FC<IProps> = ({
|
|
20
|
-
atlasJSON,
|
|
21
|
-
atlasIMG,
|
|
22
|
-
spriteKey,
|
|
23
|
-
width = GRID_WIDTH,
|
|
24
|
-
height = GRID_HEIGHT,
|
|
25
|
-
imgScale = 2,
|
|
26
|
-
imgStyle,
|
|
27
|
-
onClick,
|
|
28
|
-
containerStyle,
|
|
29
|
-
grayScale = false,
|
|
30
|
-
opacity = 1,
|
|
31
|
-
}) => {
|
|
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
|
-
//!Due to React's limitations, we cannot import it from the public folder directly!
|
|
34
|
-
|
|
35
|
-
const spriteData = atlasJSON.frames[spriteKey];
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Container
|
|
39
|
-
width={width}
|
|
40
|
-
height={height}
|
|
41
|
-
hasHover={grayScale}
|
|
42
|
-
onClick={onClick}
|
|
43
|
-
style={containerStyle}
|
|
44
|
-
>
|
|
45
|
-
<ImgSprite
|
|
46
|
-
className="sprite-from-atlas-img"
|
|
47
|
-
atlasIMG={atlasIMG}
|
|
48
|
-
frame={spriteData.frame}
|
|
49
|
-
scale={imgScale}
|
|
50
|
-
grayScale={grayScale}
|
|
51
|
-
opacity={opacity}
|
|
52
|
-
style={imgStyle}
|
|
53
|
-
/>
|
|
54
|
-
</Container>
|
|
55
|
-
);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
interface IImgSpriteProps {
|
|
59
|
-
atlasIMG: any;
|
|
60
|
-
frame: {
|
|
61
|
-
x: number;
|
|
62
|
-
y: number;
|
|
63
|
-
w: number;
|
|
64
|
-
h: number;
|
|
65
|
-
};
|
|
66
|
-
scale: number;
|
|
67
|
-
grayScale: boolean;
|
|
68
|
-
opacity: number;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
interface IContainerProps {
|
|
72
|
-
width: number;
|
|
73
|
-
height: number;
|
|
74
|
-
hasHover: boolean;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const Container = styled.div`
|
|
78
|
-
width: ${(props: IContainerProps) => props.width}px;
|
|
79
|
-
height: ${(props: IContainerProps) => props.height}px;
|
|
80
|
-
${(props: IContainerProps) =>
|
|
81
|
-
!props.hasHover
|
|
82
|
-
? `&:hover {
|
|
83
|
-
filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);
|
|
84
|
-
}`
|
|
85
|
-
: ``}
|
|
86
|
-
`;
|
|
87
|
-
|
|
88
|
-
const ImgSprite = styled.div<IImgSpriteProps>`
|
|
89
|
-
width: ${props => props.frame.w}px;
|
|
90
|
-
height: ${props => props.frame.h}px;
|
|
91
|
-
background-image: url(${props => props.atlasIMG});
|
|
92
|
-
background-position: -${props => props.frame.x}px -${props => props.frame.y}px;
|
|
93
|
-
transform: scale(${props => props.scale});
|
|
94
|
-
position: relative;
|
|
95
|
-
top: 8px;
|
|
96
|
-
left: 8px;
|
|
97
|
-
filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};
|
|
98
|
-
opacity: ${props => props.opacity};
|
|
99
|
-
`;
|
|
1
|
+
import { GRID_HEIGHT, GRID_WIDTH } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
|
|
5
|
+
interface IProps {
|
|
6
|
+
atlasJSON: any;
|
|
7
|
+
atlasIMG: any;
|
|
8
|
+
spriteKey: string;
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
grayScale?: boolean;
|
|
12
|
+
opacity?: number;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
containerStyle?: any;
|
|
15
|
+
imgStyle?: any;
|
|
16
|
+
imgScale?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const SpriteFromAtlas: React.FC<IProps> = ({
|
|
20
|
+
atlasJSON,
|
|
21
|
+
atlasIMG,
|
|
22
|
+
spriteKey,
|
|
23
|
+
width = GRID_WIDTH,
|
|
24
|
+
height = GRID_HEIGHT,
|
|
25
|
+
imgScale = 2,
|
|
26
|
+
imgStyle,
|
|
27
|
+
onClick,
|
|
28
|
+
containerStyle,
|
|
29
|
+
grayScale = false,
|
|
30
|
+
opacity = 1,
|
|
31
|
+
}) => {
|
|
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
|
+
//!Due to React's limitations, we cannot import it from the public folder directly!
|
|
34
|
+
|
|
35
|
+
const spriteData = atlasJSON.frames[spriteKey];
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Container
|
|
39
|
+
width={width}
|
|
40
|
+
height={height}
|
|
41
|
+
hasHover={grayScale}
|
|
42
|
+
onClick={onClick}
|
|
43
|
+
style={containerStyle}
|
|
44
|
+
>
|
|
45
|
+
<ImgSprite
|
|
46
|
+
className="sprite-from-atlas-img"
|
|
47
|
+
atlasIMG={atlasIMG}
|
|
48
|
+
frame={spriteData.frame}
|
|
49
|
+
scale={imgScale}
|
|
50
|
+
grayScale={grayScale}
|
|
51
|
+
opacity={opacity}
|
|
52
|
+
style={imgStyle}
|
|
53
|
+
/>
|
|
54
|
+
</Container>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
interface IImgSpriteProps {
|
|
59
|
+
atlasIMG: any;
|
|
60
|
+
frame: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
w: number;
|
|
64
|
+
h: number;
|
|
65
|
+
};
|
|
66
|
+
scale: number;
|
|
67
|
+
grayScale: boolean;
|
|
68
|
+
opacity: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface IContainerProps {
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
hasHover: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const Container = styled.div`
|
|
78
|
+
width: ${(props: IContainerProps) => props.width}px;
|
|
79
|
+
height: ${(props: IContainerProps) => props.height}px;
|
|
80
|
+
${(props: IContainerProps) =>
|
|
81
|
+
!props.hasHover
|
|
82
|
+
? `&:hover {
|
|
83
|
+
filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(180deg);
|
|
84
|
+
}`
|
|
85
|
+
: ``}
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
const ImgSprite = styled.div<IImgSpriteProps>`
|
|
89
|
+
width: ${props => props.frame.w}px;
|
|
90
|
+
height: ${props => props.frame.h}px;
|
|
91
|
+
background-image: url(${props => props.atlasIMG});
|
|
92
|
+
background-position: -${props => props.frame.x}px -${props => props.frame.y}px;
|
|
93
|
+
transform: scale(${props => props.scale});
|
|
94
|
+
position: relative;
|
|
95
|
+
top: 8px;
|
|
96
|
+
left: 8px;
|
|
97
|
+
filter: ${props => (props.grayScale ? 'grayscale(100%)' : 'none')};
|
|
98
|
+
opacity: ${props => props.opacity};
|
|
99
|
+
`;
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import iconsAtlasJSON from '../../mocks/atlas/icons/icons.json';
|
|
4
|
-
import iconsAtlasIMG from '../../mocks/atlas/icons/icons.png';
|
|
5
|
-
import { SpriteFromAtlas } from './SpriteFromAtlas';
|
|
6
|
-
|
|
7
|
-
interface IProps {
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
spriteKey: string;
|
|
10
|
-
baseSpriteKey?: string;
|
|
11
|
-
imgStyle?: any;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const SpriteIcon: React.FC<IProps> = ({
|
|
15
|
-
onClick,
|
|
16
|
-
spriteKey,
|
|
17
|
-
baseSpriteKey,
|
|
18
|
-
imgStyle,
|
|
19
|
-
}) => {
|
|
20
|
-
return (
|
|
21
|
-
<Container>
|
|
22
|
-
{baseSpriteKey && (
|
|
23
|
-
<Slot>
|
|
24
|
-
<SpriteFromAtlas
|
|
25
|
-
onClick={onClick}
|
|
26
|
-
atlasJSON={iconsAtlasJSON}
|
|
27
|
-
atlasIMG={iconsAtlasIMG}
|
|
28
|
-
spriteKey={baseSpriteKey}
|
|
29
|
-
width={32}
|
|
30
|
-
height={32}
|
|
31
|
-
containerStyle={{
|
|
32
|
-
zIndex: -1,
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
</Slot>
|
|
36
|
-
)}
|
|
37
|
-
<Slot>
|
|
38
|
-
<SpriteFromAtlas
|
|
39
|
-
onClick={onClick}
|
|
40
|
-
atlasJSON={iconsAtlasJSON}
|
|
41
|
-
atlasIMG={iconsAtlasIMG}
|
|
42
|
-
spriteKey={spriteKey}
|
|
43
|
-
width={28}
|
|
44
|
-
height={28}
|
|
45
|
-
containerStyle={{
|
|
46
|
-
zIndex: 0,
|
|
47
|
-
}}
|
|
48
|
-
imgScale={baseSpriteKey ? 1.5 : 2}
|
|
49
|
-
imgStyle={imgStyle}
|
|
50
|
-
/>
|
|
51
|
-
</Slot>
|
|
52
|
-
</Container>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const Container = styled.div`
|
|
57
|
-
position: relative;
|
|
58
|
-
width: 32px;
|
|
59
|
-
height: 32px;
|
|
60
|
-
display: flex;
|
|
61
|
-
justify-content: center;
|
|
62
|
-
align-items: center;
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
const Slot = styled.div`
|
|
66
|
-
position: absolute;
|
|
67
|
-
`;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import iconsAtlasJSON from '../../mocks/atlas/icons/icons.json';
|
|
4
|
+
import iconsAtlasIMG from '../../mocks/atlas/icons/icons.png';
|
|
5
|
+
import { SpriteFromAtlas } from './SpriteFromAtlas';
|
|
6
|
+
|
|
7
|
+
interface IProps {
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
spriteKey: string;
|
|
10
|
+
baseSpriteKey?: string;
|
|
11
|
+
imgStyle?: any;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const SpriteIcon: React.FC<IProps> = ({
|
|
15
|
+
onClick,
|
|
16
|
+
spriteKey,
|
|
17
|
+
baseSpriteKey,
|
|
18
|
+
imgStyle,
|
|
19
|
+
}) => {
|
|
20
|
+
return (
|
|
21
|
+
<Container>
|
|
22
|
+
{baseSpriteKey && (
|
|
23
|
+
<Slot>
|
|
24
|
+
<SpriteFromAtlas
|
|
25
|
+
onClick={onClick}
|
|
26
|
+
atlasJSON={iconsAtlasJSON}
|
|
27
|
+
atlasIMG={iconsAtlasIMG}
|
|
28
|
+
spriteKey={baseSpriteKey}
|
|
29
|
+
width={32}
|
|
30
|
+
height={32}
|
|
31
|
+
containerStyle={{
|
|
32
|
+
zIndex: -1,
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
</Slot>
|
|
36
|
+
)}
|
|
37
|
+
<Slot>
|
|
38
|
+
<SpriteFromAtlas
|
|
39
|
+
onClick={onClick}
|
|
40
|
+
atlasJSON={iconsAtlasJSON}
|
|
41
|
+
atlasIMG={iconsAtlasIMG}
|
|
42
|
+
spriteKey={spriteKey}
|
|
43
|
+
width={28}
|
|
44
|
+
height={28}
|
|
45
|
+
containerStyle={{
|
|
46
|
+
zIndex: 0,
|
|
47
|
+
}}
|
|
48
|
+
imgScale={baseSpriteKey ? 1.5 : 2}
|
|
49
|
+
imgStyle={imgStyle}
|
|
50
|
+
/>
|
|
51
|
+
</Slot>
|
|
52
|
+
</Container>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const Container = styled.div`
|
|
57
|
+
position: relative;
|
|
58
|
+
width: 32px;
|
|
59
|
+
height: 32px;
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
align-items: center;
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
const Slot = styled.div`
|
|
66
|
+
position: absolute;
|
|
67
|
+
`;
|