@rpg-engine/long-bow 0.3.90 → 0.3.92
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/Character/CharacterSelection.d.ts +2 -0
- package/dist/long-bow.cjs.development.js +37 -20255
- 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 +37 -20255
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Character/CharacterSelection.tsx +9 -7
- package/src/stories/CharacterSelection.stories.tsx +6 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.92",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@rollup/plugin-image": "^2.1.1",
|
|
86
|
-
"@rpg-engine/shared": "^0.7.
|
|
86
|
+
"@rpg-engine/shared": "^0.7.47",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"font-awesome": "^4.7.0",
|
|
89
89
|
"fs-extra": "^10.1.0",
|
|
@@ -3,8 +3,6 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import { SpriteFromAtlas } from '../shared/SpriteFromAtlas';
|
|
5
5
|
|
|
6
|
-
import entitiesJSON from '../../mocks/atlas/entities/entities.json';
|
|
7
|
-
import entitiesIMG from '../../mocks/atlas/entities/entities.png';
|
|
8
6
|
import { ErrorBoundary } from '../Item/Inventory/ErrorBoundary';
|
|
9
7
|
import PropertySelect, {
|
|
10
8
|
IPropertiesProps,
|
|
@@ -17,14 +15,18 @@ export interface ICharacterProps {
|
|
|
17
15
|
|
|
18
16
|
export interface ICharacterSelectionProps {
|
|
19
17
|
availableCharacters: ICharacterProps[];
|
|
18
|
+
atlasJSON: any;
|
|
19
|
+
atlasIMG: any;
|
|
20
20
|
onChange: (textureKey: string) => void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const CharacterSelection: React.FC<ICharacterSelectionProps> = ({
|
|
24
24
|
availableCharacters,
|
|
25
|
+
atlasJSON,
|
|
26
|
+
atlasIMG,
|
|
25
27
|
onChange,
|
|
26
28
|
}) => {
|
|
27
|
-
const propertySelectValues = availableCharacters.map(item => {
|
|
29
|
+
const propertySelectValues = availableCharacters.map((item) => {
|
|
28
30
|
return {
|
|
29
31
|
id: item.textureKey,
|
|
30
32
|
name: item.name,
|
|
@@ -56,12 +58,12 @@ export const CharacterSelection: React.FC<ICharacterSelectionProps> = ({
|
|
|
56
58
|
|
|
57
59
|
return (
|
|
58
60
|
<Container>
|
|
59
|
-
{selectedSpriteKey && (
|
|
61
|
+
{selectedSpriteKey && atlasIMG && atlasJSON && (
|
|
60
62
|
<ErrorBoundary>
|
|
61
63
|
<SpriteFromAtlas
|
|
62
64
|
spriteKey={selectedSpriteKey}
|
|
63
|
-
atlasIMG={
|
|
64
|
-
atlasJSON={
|
|
65
|
+
atlasIMG={atlasIMG}
|
|
66
|
+
atlasJSON={atlasJSON}
|
|
65
67
|
imgScale={4}
|
|
66
68
|
height={80}
|
|
67
69
|
width={64}
|
|
@@ -78,7 +80,7 @@ export const CharacterSelection: React.FC<ICharacterSelectionProps> = ({
|
|
|
78
80
|
)}
|
|
79
81
|
<PropertySelect
|
|
80
82
|
availableProperties={propertySelectValues}
|
|
81
|
-
onChange={value => {
|
|
83
|
+
onChange={(value) => {
|
|
82
84
|
setSelectedValue(value);
|
|
83
85
|
}}
|
|
84
86
|
/>
|
|
@@ -4,6 +4,8 @@ import { RPGUIRoot } from '..';
|
|
|
4
4
|
import CharacterSelection, {
|
|
5
5
|
ICharacterProps,
|
|
6
6
|
} from '../components/Character/CharacterSelection';
|
|
7
|
+
import atlasJSON from '../mocks/atlas/entities/entities.json';
|
|
8
|
+
import atlasIMG from '../mocks/atlas/entities/entities.png';
|
|
7
9
|
|
|
8
10
|
const meta: Meta = {
|
|
9
11
|
title: 'Character Selection',
|
|
@@ -12,14 +14,9 @@ const meta: Meta = {
|
|
|
12
14
|
|
|
13
15
|
export default meta;
|
|
14
16
|
|
|
15
|
-
const Template: Story<any> = args => (
|
|
17
|
+
const Template: Story<any> = (args) => (
|
|
16
18
|
<RPGUIRoot>
|
|
17
|
-
<CharacterSelection
|
|
18
|
-
{...args}
|
|
19
|
-
onChange={value => {
|
|
20
|
-
console.log(value);
|
|
21
|
-
}}
|
|
22
|
-
/>
|
|
19
|
+
<CharacterSelection {...args} />
|
|
23
20
|
</RPGUIRoot>
|
|
24
21
|
);
|
|
25
22
|
|
|
@@ -42,4 +39,6 @@ const availableCharacters: ICharacterProps[] = [
|
|
|
42
39
|
|
|
43
40
|
Default.args = {
|
|
44
41
|
availableCharacters: availableCharacters,
|
|
42
|
+
atlasJSON: atlasJSON,
|
|
43
|
+
atlasIMG: atlasIMG,
|
|
45
44
|
};
|