@rpg-engine/long-bow 0.3.41 → 0.3.43
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/CaracterStatus/CaracterStatus.d.ts +9 -0
- package/dist/long-bow.cjs.development.js +3 -3
- 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 +3 -3
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/CaracterStatus.stories.d.ts +5 -0
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/CaracterStatus/CaracterStatus.tsx +86 -0
- package/src/components/CaracterStatus/Character.png +0 -0
- package/src/components/Chat/Chat.tsx +1 -0
- package/src/components/TradingMenu/TradingItemRow.tsx +1 -2
- package/src/components/TradingMenu/items.mock.ts +1 -0
- package/src/stories/CaracterStatus.stories.tsx +29 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { ICharacterStatusProps } from '../components/CaracterStatus/CaracterStatus';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, ICharacterStatusProps>;
|
package/package.json
CHANGED
package/src/.DS_Store
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { uiColors } from '../../constants/uiColors';
|
|
4
|
+
import { ProgressBar } from '../ProgressBar';
|
|
5
|
+
import Character from './Character.png';
|
|
6
|
+
|
|
7
|
+
export interface ICharacterStatusProps {
|
|
8
|
+
healthValue: number;
|
|
9
|
+
healthMaxValue: number;
|
|
10
|
+
manaValue: number;
|
|
11
|
+
manaMaxValue: number;
|
|
12
|
+
charName: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const CharacterStatus: React.FC<ICharacterStatusProps> = ({
|
|
16
|
+
healthValue,
|
|
17
|
+
healthMaxValue,
|
|
18
|
+
manaValue,
|
|
19
|
+
manaMaxValue,
|
|
20
|
+
charName,
|
|
21
|
+
}) => {
|
|
22
|
+
return (
|
|
23
|
+
<StatusContainer>
|
|
24
|
+
<ImgContainer
|
|
25
|
+
style={{
|
|
26
|
+
background: `url(${Character})`,
|
|
27
|
+
backgroundPositionX: 'center',
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
<div>
|
|
31
|
+
<CharNameContainer>{charName}</CharNameContainer>
|
|
32
|
+
<ProgressContainer>
|
|
33
|
+
<StyledProgressBar
|
|
34
|
+
max={healthMaxValue}
|
|
35
|
+
value={healthValue}
|
|
36
|
+
color={'red'}
|
|
37
|
+
minWidth={200}
|
|
38
|
+
/>
|
|
39
|
+
<StyledProgressBar
|
|
40
|
+
max={manaMaxValue}
|
|
41
|
+
value={manaValue}
|
|
42
|
+
color={'blue'}
|
|
43
|
+
minWidth={200}
|
|
44
|
+
/>
|
|
45
|
+
</ProgressContainer>
|
|
46
|
+
</div>
|
|
47
|
+
</StatusContainer>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const CharNameContainer = styled.div`
|
|
52
|
+
color: black;
|
|
53
|
+
margin: auto;
|
|
54
|
+
display: flex;
|
|
55
|
+
justify-content: space-around;
|
|
56
|
+
background-color: rgba(117, 113, 97, 0.3);
|
|
57
|
+
align-items: center;
|
|
58
|
+
height: 30px;
|
|
59
|
+
border-radius: 10px;
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
const StatusContainer = styled.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
scale: 0.7;
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const ProgressContainer = styled.div`
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: row;
|
|
70
|
+
`;
|
|
71
|
+
|
|
72
|
+
const StyledProgressBar = styled(ProgressBar)`
|
|
73
|
+
.rpgui-progress-left-edge,
|
|
74
|
+
.rpgui-progress-right-edge {
|
|
75
|
+
width: 20px;
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
const ImgContainer = styled.div`
|
|
80
|
+
width: 4.3rem;
|
|
81
|
+
height: 4.3rem;
|
|
82
|
+
border: 2px solid ${uiColors.darkGray};
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
border-radius: 50%;
|
|
85
|
+
margin-right: 8px;
|
|
86
|
+
`;
|
|
Binary file
|
|
@@ -44,8 +44,7 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
|
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
const onRightOutClick = () => {
|
|
47
|
-
if (selectedQty + 10
|
|
48
|
-
console.log(traderItem);
|
|
47
|
+
if (selectedQty + 10 <= (traderItem.qty ?? 999)) {
|
|
49
48
|
const newQuantity = selectedQty + 10;
|
|
50
49
|
onQuantityChange(traderItem, newQuantity);
|
|
51
50
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Meta, Story } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
CharacterStatus,
|
|
5
|
+
ICharacterStatusProps,
|
|
6
|
+
} from '../components/CaracterStatus/CaracterStatus';
|
|
7
|
+
import { RPGUIRoot } from '../components/RPGUIRoot';
|
|
8
|
+
|
|
9
|
+
const meta: Meta = {
|
|
10
|
+
title: 'Caracter Status',
|
|
11
|
+
component: CharacterStatus,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
const Template: Story<ICharacterStatusProps> = args => (
|
|
17
|
+
<RPGUIRoot>
|
|
18
|
+
<CharacterStatus {...args} />
|
|
19
|
+
</RPGUIRoot>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export const Default = Template.bind({});
|
|
23
|
+
Default.args = {
|
|
24
|
+
healthValue: 30,
|
|
25
|
+
healthMaxValue: 100,
|
|
26
|
+
manaValue: 30,
|
|
27
|
+
manaMaxValue: 100,
|
|
28
|
+
charName: 'Char Name',
|
|
29
|
+
};
|