@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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.3.41",
3
+ "version": "0.3.43",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
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
+ `;
@@ -115,6 +115,7 @@ export const Chat: React.FC<IChatProps> = ({
115
115
  onFocus={onFocus}
116
116
  onBlur={onBlur}
117
117
  onTouchStart={onFocus}
118
+ autoFocus
118
119
  />
119
120
  </Column>
120
121
  <Column justifyContent="flex-end">
@@ -44,8 +44,7 @@ export const TradingItemRow: React.FC<ITradeComponentProps> = ({
44
44
  }
45
45
  };
46
46
  const onRightOutClick = () => {
47
- if (selectedQty + 10 < (traderItem.qty ?? 999)) {
48
- console.log(traderItem);
47
+ if (selectedQty + 10 <= (traderItem.qty ?? 999)) {
49
48
  const newQuantity = selectedQty + 10;
50
49
  onQuantityChange(traderItem, newQuantity);
51
50
  }
@@ -19,6 +19,7 @@ export const itemMock: ITradeResponseItem[] = [
19
19
  name: 'Silver Short Sword Premium',
20
20
  price: 100,
21
21
  key: SwordsBlueprint.IceSword,
22
+ qty: 12
22
23
  },
23
24
  {
24
25
  texturePath: "swords/corruption-sword.png",
@@ -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
+ };