@rpg-engine/long-bow 0.2.45 → 0.2.46
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/StaticBook/StaticBook.d.ts +5 -8
- package/dist/components/TimeWidget/DayNightPeriod/DayNightPeriod.d.ts +6 -0
- package/dist/components/TimeWidget/TimeWidget.d.ts +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +49 -0
- 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 +50 -2
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/stories/DayNightPeriod.stories.d.ts +2 -2
- package/dist/stories/StaticBook.stories.d.ts +2 -2
- package/dist/stories/TimeWidget.stories.d.ts +5 -0
- package/package.json +2 -2
- package/src/components/StaticBook/StaticBook.tsx +85 -76
- package/src/components/TimeWidget/DayNightPeriod/DayNightPeriod.tsx +31 -0
- package/src/components/{DayNightPeriod/Gif/Afternoon.gif → TimeWidget/DayNightPeriod/gif/afternoon.gif} +0 -0
- package/src/components/{DayNightPeriod/Gif/Morning.gif → TimeWidget/DayNightPeriod/gif/morning.gif} +0 -0
- package/src/components/{DayNightPeriod/Gif/Night.gif → TimeWidget/DayNightPeriod/gif/night.gif} +0 -0
- package/src/components/TimeWidget/TimeWidget.tsx +63 -0
- package/src/components/TimeWidget/img/clockwidget.png +0 -0
- package/src/index.tsx +1 -0
- package/src/stories/DayNightPeriod.stories.tsx +15 -8
- package/src/stories/StaticBook.stories.tsx +16 -23
- package/src/stories/TimeWidget.stories.tsx +27 -0
- package/dist/components/DayNightPeriod/DayNightPeriod.d.ts +0 -11
- package/src/components/DayNightPeriod/DayNightPeriod.tsx +0 -36
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { IPeriodOfDayDisplayProps } from '../components/TimeWidget/DayNightPeriod/DayNightPeriod';
|
|
3
3
|
declare const meta: Meta;
|
|
4
4
|
export default meta;
|
|
5
|
-
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework,
|
|
5
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IPeriodOfDayDisplayProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react';
|
|
2
|
-
import {
|
|
2
|
+
import { IStaticBookProps } from '../components/StaticBook/StaticBook';
|
|
3
3
|
declare const meta: Meta;
|
|
4
4
|
export default meta;
|
|
5
|
-
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework,
|
|
5
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IStaticBookProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { IClockWidgetProps } from '../components/TimeWidget/TimeWidget';
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, IClockWidgetProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.46",
|
|
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.5.
|
|
86
|
+
"@rpg-engine/shared": "^0.5.72",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"fs-extra": "^10.1.0",
|
|
89
89
|
"lodash": "^4.17.21",
|
|
@@ -1,96 +1,105 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import Draggable from 'react-draggable';
|
|
2
3
|
import styled from 'styled-components';
|
|
4
|
+
import { uiFonts } from '../../constants/uiFonts';
|
|
3
5
|
import SelectArrow from '../Arrow/SelectArrow';
|
|
4
6
|
import Book from './img/0.png';
|
|
5
7
|
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
export interface IStaticBookProps {
|
|
9
|
+
content: string;
|
|
10
|
+
onChange?: (slice: string) => void;
|
|
11
|
+
onClose?: () => void;
|
|
9
12
|
}
|
|
10
13
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export const StaticBook: React.FC<StaticBookProps> = ({
|
|
16
|
-
availableBook,
|
|
17
|
-
onChange,
|
|
14
|
+
export const StaticBook: React.FC<IStaticBookProps> = ({
|
|
15
|
+
content,
|
|
16
|
+
onChange,
|
|
17
|
+
onClose,
|
|
18
18
|
}) => {
|
|
19
|
-
|
|
20
|
-
const bookLength = availableBook.length - 1;
|
|
19
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
else setCurrentIndex(index => index - 1);
|
|
25
|
-
};
|
|
26
|
-
const onRightClick = () => {
|
|
27
|
-
if (currentIndex === bookLength) setCurrentIndex(0);
|
|
28
|
-
else setCurrentIndex(index => index + 1);
|
|
29
|
-
};
|
|
21
|
+
// create slicedContent with string sliced every 550 characters
|
|
22
|
+
const slicedContent = content.match(/.{1,550}/g) || [];
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (onChange) onChange(slicedContent[currentIndex]);
|
|
26
|
+
}, [currentIndex]);
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
setCurrentIndex(0);
|
|
37
|
-
}, [JSON.stringify(availableBook)]);
|
|
28
|
+
const bookLength = slicedContent.length - 1;
|
|
38
29
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
30
|
+
const onLeftClick = () => {
|
|
31
|
+
if (currentIndex === 0) setCurrentIndex(bookLength);
|
|
32
|
+
else setCurrentIndex(index => index - 1);
|
|
33
|
+
};
|
|
34
|
+
const onRightClick = () => {
|
|
35
|
+
if (currentIndex === bookLength) setCurrentIndex(0);
|
|
36
|
+
else setCurrentIndex(index => index + 1);
|
|
37
|
+
};
|
|
46
38
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<ArrowContainer>
|
|
51
|
-
<SelectArrow
|
|
52
|
-
direction="left"
|
|
53
|
-
onClick={onLeftClick}
|
|
54
|
-
onTouchStart={onLeftClick}
|
|
55
|
-
></SelectArrow>
|
|
56
|
-
<SelectArrow
|
|
57
|
-
direction="right"
|
|
58
|
-
onClick={onRightClick}
|
|
59
|
-
onTouchStart={onRightClick}
|
|
60
|
-
></SelectArrow>
|
|
61
|
-
</ArrowContainer>
|
|
62
|
-
</Container>
|
|
63
|
-
);
|
|
64
|
-
};
|
|
39
|
+
const getCurrentContentSlice = () => {
|
|
40
|
+
return slicedContent[currentIndex];
|
|
41
|
+
};
|
|
65
42
|
|
|
43
|
+
return (
|
|
44
|
+
<Draggable>
|
|
45
|
+
<Container>
|
|
46
|
+
<CloseButton onClick={onClose}>X</CloseButton>
|
|
47
|
+
<ColumnBook isLastPage={currentIndex === bookLength}>
|
|
48
|
+
{getCurrentContentSlice()}
|
|
49
|
+
</ColumnBook>
|
|
50
|
+
|
|
51
|
+
<ArrowContainer>
|
|
52
|
+
{currentIndex >= 1 && (
|
|
53
|
+
<SelectArrow
|
|
54
|
+
direction="left"
|
|
55
|
+
onClick={onLeftClick}
|
|
56
|
+
onTouchStart={onLeftClick}
|
|
57
|
+
></SelectArrow>
|
|
58
|
+
)}
|
|
59
|
+
{currentIndex !== bookLength && (
|
|
60
|
+
<SelectArrow
|
|
61
|
+
direction="right"
|
|
62
|
+
onClick={onRightClick}
|
|
63
|
+
onTouchStart={onRightClick}
|
|
64
|
+
></SelectArrow>
|
|
65
|
+
)}
|
|
66
|
+
</ArrowContainer>
|
|
67
|
+
</Container>
|
|
68
|
+
</Draggable>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
66
71
|
|
|
67
72
|
const Container = styled.div`
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const Textbook = styled.span`
|
|
76
|
-
position: absolute;
|
|
77
|
-
padding-left: 6em;
|
|
78
|
-
display: flex;
|
|
79
|
-
|
|
80
|
-
`;
|
|
81
|
-
const Colunbook = styled.span`
|
|
82
|
-
padding-left: 3px;
|
|
83
|
-
padding-top: 70px;
|
|
84
|
-
width: 86%;
|
|
85
|
-
column-count:2;
|
|
86
|
-
grid-gap: 50px;
|
|
73
|
+
background-image: url(${Book});
|
|
74
|
+
background-repeat: no-repeat;
|
|
75
|
+
position: relative;
|
|
76
|
+
width: 778px;
|
|
77
|
+
height: 463px;
|
|
78
|
+
background-position-y: -1rem;
|
|
79
|
+
`;
|
|
87
80
|
|
|
88
|
-
|
|
81
|
+
const CloseButton = styled.p`
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: 1.9rem;
|
|
84
|
+
right: 5rem;
|
|
85
|
+
font-size: ${uiFonts.size.large} !important;
|
|
86
|
+
`;
|
|
87
|
+
|
|
88
|
+
interface IColumnBook {
|
|
89
|
+
isLastPage: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const ColumnBook = styled.span<IColumnBook>`
|
|
93
|
+
position: absolute;
|
|
94
|
+
left: 5.2rem;
|
|
95
|
+
top: 3.8rem;
|
|
96
|
+
width: ${({ isLastPage }) => (!isLastPage ? '77%' : '37%')};
|
|
97
|
+
column-count: ${({ isLastPage }) => (isLastPage ? 1 : 2)};
|
|
98
|
+
grid-gap: 56px;
|
|
99
|
+
min-height: 340px;
|
|
100
|
+
`;
|
|
89
101
|
const ArrowContainer = styled.span`
|
|
90
102
|
display: flex;
|
|
91
|
-
height:100
|
|
103
|
+
height: 100%;
|
|
92
104
|
align-items: center;
|
|
93
|
-
|
|
94
|
-
`;
|
|
95
|
-
|
|
96
|
-
export default StaticBook;
|
|
105
|
+
`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { PeriodOfDay } from '@rpg-engine/shared';
|
|
5
|
+
import AfternoonGif from './gif/afternoon.gif';
|
|
6
|
+
import MorningGif from './gif/morning.gif';
|
|
7
|
+
import NightGif from './gif/night.gif';
|
|
8
|
+
|
|
9
|
+
export interface IPeriodOfDayDisplayProps {
|
|
10
|
+
periodOfDay: PeriodOfDay;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const DayNightPeriod: React.FC<IPeriodOfDayDisplayProps> = ({
|
|
14
|
+
periodOfDay,
|
|
15
|
+
}) => {
|
|
16
|
+
const periodOfDaySrcFiles = {
|
|
17
|
+
[PeriodOfDay.Morning]: MorningGif,
|
|
18
|
+
[PeriodOfDay.Afternoon]: AfternoonGif,
|
|
19
|
+
[PeriodOfDay.Night]: NightGif,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<GifContainer>
|
|
24
|
+
<img src={periodOfDaySrcFiles[periodOfDay]} />
|
|
25
|
+
</GifContainer>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const GifContainer = styled.span`
|
|
30
|
+
width: 100%;
|
|
31
|
+
`;
|
|
File without changes
|
package/src/components/{DayNightPeriod/Gif/Morning.gif → TimeWidget/DayNightPeriod/gif/morning.gif}
RENAMED
|
File without changes
|
package/src/components/{DayNightPeriod/Gif/Night.gif → TimeWidget/DayNightPeriod/gif/night.gif}
RENAMED
|
File without changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { PeriodOfDay } from '@rpg-engine/shared';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Draggable from 'react-draggable';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { uiFonts } from '../../constants/uiFonts';
|
|
6
|
+
import { DayNightPeriod } from './DayNightPeriod/DayNightPeriod';
|
|
7
|
+
|
|
8
|
+
import ClockWidgetImg from './img/clockwidget.png';
|
|
9
|
+
|
|
10
|
+
export interface IClockWidgetProps {
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
TimeClock: string;
|
|
13
|
+
periodOfDay: PeriodOfDay;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const TimeWidget: React.FC<IClockWidgetProps> = ({
|
|
17
|
+
onClose,
|
|
18
|
+
TimeClock,
|
|
19
|
+
periodOfDay,
|
|
20
|
+
}) => {
|
|
21
|
+
return (
|
|
22
|
+
<Draggable>
|
|
23
|
+
<WidgetContainer>
|
|
24
|
+
<CloseButton onClick={onClose}>X</CloseButton>
|
|
25
|
+
<DayNightContainer>
|
|
26
|
+
<DayNightPeriod periodOfDay={periodOfDay} />
|
|
27
|
+
</DayNightContainer>
|
|
28
|
+
<Time>{TimeClock}</Time>
|
|
29
|
+
</WidgetContainer>
|
|
30
|
+
</Draggable>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const WidgetContainer = styled.div`
|
|
35
|
+
background-image: url(${ClockWidgetImg});
|
|
36
|
+
background-repeat: no-repeat;
|
|
37
|
+
width: 100%;
|
|
38
|
+
position: absolute;
|
|
39
|
+
margin: 20px;
|
|
40
|
+
`;
|
|
41
|
+
|
|
42
|
+
const Time = styled.div`
|
|
43
|
+
width: 100%;
|
|
44
|
+
top: -6.95rem;
|
|
45
|
+
right: -4.4rem;
|
|
46
|
+
position: relative;
|
|
47
|
+
font-size: 7.5px;
|
|
48
|
+
color: white;
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const CloseButton = styled.p`
|
|
52
|
+
width: 100%;
|
|
53
|
+
position: relative;
|
|
54
|
+
top: -1rem;
|
|
55
|
+
right: -6.9rem;
|
|
56
|
+
font-size: ${uiFonts.size.xxsmall} !important;
|
|
57
|
+
z-index: 1;
|
|
58
|
+
`;
|
|
59
|
+
const DayNightContainer = styled.span`
|
|
60
|
+
top: -41px;
|
|
61
|
+
left: -3px;
|
|
62
|
+
position: relative;
|
|
63
|
+
`;
|
|
Binary file
|
package/src/index.tsx
CHANGED
|
@@ -25,6 +25,7 @@ export * from './components/shared/SpriteFromAtlas';
|
|
|
25
25
|
export * from './components/SkillProgressBar';
|
|
26
26
|
export * from './components/SkillsContainer';
|
|
27
27
|
export * from './components/TextArea';
|
|
28
|
+
export * from './components/TimeWidget/TimeWidget';
|
|
28
29
|
export * from './components/TradingMenu/TradingMenu';
|
|
29
30
|
export * from './components/Truncate';
|
|
30
31
|
export * from './components/typography/DynamicText';
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
+
import { PeriodOfDay } from '@rpg-engine/shared';
|
|
1
2
|
import { Meta, Story } from '@storybook/react';
|
|
2
3
|
import React from 'react';
|
|
3
|
-
import DayNightPeriod, { IPeriodOfDay, PeriodOfDay, PeriodOfDayProps } from '../components/DayNightPeriod/DayNightPeriod';
|
|
4
4
|
import { RPGUIRoot } from '../components/RPGUIRoot';
|
|
5
|
-
|
|
5
|
+
import {
|
|
6
|
+
DayNightPeriod,
|
|
7
|
+
IPeriodOfDayDisplayProps,
|
|
8
|
+
} from '../components/TimeWidget/DayNightPeriod/DayNightPeriod';
|
|
6
9
|
|
|
7
10
|
const meta: Meta = {
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
title: 'Day and Night Period',
|
|
12
|
+
component: DayNightPeriod,
|
|
10
13
|
};
|
|
11
14
|
|
|
12
15
|
export default meta;
|
|
13
16
|
|
|
14
|
-
const Template: Story<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
const Template: Story<IPeriodOfDayDisplayProps> = args => (
|
|
18
|
+
<RPGUIRoot>
|
|
19
|
+
<DayNightPeriod {...args} />
|
|
20
|
+
</RPGUIRoot>
|
|
18
21
|
);
|
|
19
22
|
|
|
20
23
|
export const Default = Template.bind({});
|
|
24
|
+
|
|
25
|
+
Default.args = {
|
|
26
|
+
periodOfDay: PeriodOfDay.Morning,
|
|
27
|
+
};
|
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { RPGUIRoot } from '..';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
IStaticBookProps,
|
|
6
|
+
StaticBook,
|
|
7
|
+
} from '../components/StaticBook/StaticBook';
|
|
6
8
|
|
|
7
9
|
const meta: Meta = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
title: 'Static Book',
|
|
11
|
+
component: StaticBook,
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export default meta;
|
|
13
15
|
|
|
14
|
-
const Template: Story<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const Template: Story<IStaticBookProps> = args => (
|
|
17
|
+
<RPGUIRoot>
|
|
18
|
+
<StaticBook
|
|
19
|
+
{...args}
|
|
20
|
+
onClose={() => console.log('Trying to close the book!')}
|
|
21
|
+
/>
|
|
22
|
+
</RPGUIRoot>
|
|
18
23
|
);
|
|
19
24
|
|
|
20
25
|
export const Default = Template.bind({});
|
|
21
26
|
|
|
22
|
-
const bookMock =
|
|
23
|
-
|
|
24
|
-
text: '1 ... Computers and RPGs have always gone hand-in-hand. Even when the bes and Oubliette. A few, such as Oubliette, had simple graphics, though most started out as just text or used ASCII’s standard set of text-mode graphics The most successful dungeon crawler of all time is, of course, Blizzard’s Diablo. But Rogue’s longest-lived descendent is arguably a much more interesting game—1987’s Nethack. Technically, it was based on a Rogue clone called, yes, Hack, but let’s not quibble. Nethack takes the basic dungeon crawling concept and adds several decades worth of development.',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
text: '2 ... The original PC RPGs—such as MUDs, or multi-user dungeons—appeared in the mid-70s. These weren’t for home computers, but mainframes, typically found in universities. They tended to be based on either Dungeons & Dragons, which itself launched in 1974, or be variously disguised takes on Tolkien. These included Dungeon, DND, Orthanc, and Oubliette. A few, such as Oubliette, had simple graphics, though most started out as just text or used ASCII’s standard set of text-mode graphics The most successful dungeon crawler of all time is, of course, Blizzard’s Diablo. But Rogue’s longest-lived descendent is arguably a much more interesting game—1987’s Nethack. Technically, it was based on a Rogue clone called, yes, Hack, but let’s not quibble. Nethack takes the basic dungeon crawling concept and adds several decades worth of development. ',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
text: '3 ... Despite the primitive technology, these games often offered surprising depth. Don Daglow’s Dungeon for instance, a 1975 D&D pastiche, offered control of an entire multiplayer party, mapping, NPCs with AI, line-of-sight-based combat, and both melee and ranged attacks. Moria, from the same year, served up wireframe graphics for its characters, and even featured rudimentary 3D views of its corridors. Small ones, with no detail, but let’s not forget that even Space Invaders wasn’t out yet! Ever wondered if throwing a custard pie in a basilisk’s face will stop its petrifying stare? Nethack not only answers that question (it will), but also implements blindness if you get hit by a pie yourself, causes you to break your code if a vegan character eats one (seriously), and ensures the attack doesn’t count if you’re on a pacifist run (it does no damage, no matter your combat bonus). This level of detail lead to the saying “The Dev Team Thinks Of Everything”. Many versions are now available, from the original ASCII-based game to graphical overhauls like Vulture’s Eye. All are free, as a condition of the distribution licence. ',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
text: '4 ... Despite the primitive technology, these games often offered surprising depth. Don Daglow’s Dungeon for instance, a 1975 D&D pastiche, offered control of an entire multiplayer party, mapping, NPCs with AI, line-of-sight-based combat, and both melee and ranged attacks. Moria, from the same year, served up wireframe graphics for its characters, and even featured rudimentary 3D views of its corridors. Small ones, with no detail, but let’s not forget that even Space Invaders wasn’t out yet! Ever wondered if throwing a custard pie in a basilisk’s face will stop its petrifying stare? Nethack not only answers that question (it will), but also implements blindness if you get hit by a pie yourself, causes you to break your code if a vegan character eats one (seriously), and ensures the attack doesn’t count if you’re on a pacifist run (it does no damage, no matter your combat bonus). This level of detail lead to the saying “The Dev Team Thinks Of Everything”. Many versions are now available, from the original ASCII-based game to graphical overhauls like Vulture’s Eye. All are free, as a condition of the distribution licence. ',
|
|
34
|
-
},
|
|
35
|
-
];
|
|
27
|
+
const bookMock =
|
|
28
|
+
'Computers and RPGs have always gone hand-in-hand. Even when the bes and Oubliette. A few, such as Oubliette, had simple graphics, though most started out as just text or used ASCII’s standard set of text-mode graphics The most successful dungeon crawler of all time is, of course, Blizzard’s Diablo. But Rogue’s longest-lived descendent is arguably a much more interesting game—1987’s Nethack. Technically, it was based on a Rogue clone called, yes, Hack, but let’s not quibble. Nethack takes the basic dungeon crawling concept and adds several decades worth of development. The original PC RPGs—such as MUDs, or multi-user dungeons—appeared in the mid-70s. These weren’t for home computers, but mainframes, typically found in universities. They tended to be based on either Dungeons & Dragons, which itself launched in 1974, or be variously disguised takes on Tolkien. These included Dungeon, DND, Orthanc, and Oubliette. A few, such as Oubliette, had simple graphics, though most started out as just text or used ASCII’s standard set of text-mode graphics The most successful dungeon crawler of all time is, of course, Blizzard’s Diablo. But Rogue’s longest-lived descendent is arguably a much more interesting game—1987’s Nethack. Technically, it was based on a Rogue clone called, yes, Hack, but let’s not quibble. Nethack takes the basic dungeon crawling concept and adds several decades worth of development. Despite the primitive technology, these games often offered surprising depth. Don Daglow’s Dungeon for instance, a 1975 D&D pastiche, offered control of an entire multiplayer party, mapping, NPCs with AI, line-of-sight-based combat, and both melee and ranged attacks. Moria, from the same year, served up wireframe graphics for its characters, and even featured rudimentary 3D views of its corridors. Small ones, with no detail, but let’s not forget that even Space Invaders wasn’t out yet! Ever wondered if throwing a custard pie in a basilisk’s face will stop its petrifying stare? Nethack not only answers that question (it will), but also implements blindness if you get hit by a pie yourself, causes you to break your code if a vegan character eats one (seriously), and ensures the attack doesn’t count if you’re on a pacifist run (it does no damage, no matter your combat bonus). This level of detail lead to the saying “The Dev Team Thinks Of Everything”. Many versions are now available, from the original ASCII-based game to graphical overhauls like Vulture’s Eye. All are free, as a condition of the distribution licence. While the original Rogue was a single-player game, the first multiplayer game was probably 1980’s MUD, or Multi-User Dungeon. This was a text-based game, but with the ability to play with other people. It was also the first game to use the term “multiplayer” in its name. MUDs were hugely popular, and spawned a whole genre of games, including the aforementioned Nethack. The most successful of these was probably 1988’s MUD1, which was so popular that it was ported to the Commodore 64. The most successful of these was probably 1988’s MUD1, which was so popular that it was ported to the Commodore 64. The most successful of these was probably 1988’s MUD1, which was so popular that it was ported to the Commodore 64. The most successful of these was probably 1988’s MUD1, which was so popular that it was ported to the Commodore 64. ';
|
|
36
29
|
|
|
37
30
|
Default.args = {
|
|
38
|
-
|
|
31
|
+
content: bookMock,
|
|
39
32
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PeriodOfDay } from '@rpg-engine/shared';
|
|
2
|
+
import { Meta, Story } from '@storybook/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { RPGUIRoot } from '../components/RPGUIRoot';
|
|
5
|
+
import {
|
|
6
|
+
IClockWidgetProps,
|
|
7
|
+
TimeWidget,
|
|
8
|
+
} from '../components/TimeWidget/TimeWidget';
|
|
9
|
+
|
|
10
|
+
const meta: Meta = {
|
|
11
|
+
title: 'Time Widget',
|
|
12
|
+
component: TimeWidget,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
const Template: Story<IClockWidgetProps> = args => (
|
|
18
|
+
<RPGUIRoot>
|
|
19
|
+
<TimeWidget {...args} />
|
|
20
|
+
</RPGUIRoot>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const Default = Template.bind({});
|
|
24
|
+
Default.args = {
|
|
25
|
+
TimeClock: '10:00',
|
|
26
|
+
periodOfDay: PeriodOfDay.Morning,
|
|
27
|
+
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare enum IPeriodOfDay {
|
|
3
|
-
Morning = "static/media/src/components/DayNightPeriod/Gif/Morning.gif",
|
|
4
|
-
Afternoon = "static/media/src/components/DayNightPeriod/Gif/Afternoon.gif",
|
|
5
|
-
Night = "static/media/src/components/DayNightPeriod/Gif/Night.gif"
|
|
6
|
-
}
|
|
7
|
-
export interface PeriodOfDayProps {
|
|
8
|
-
periodOfDay: IPeriodOfDay;
|
|
9
|
-
}
|
|
10
|
-
export declare const PeriodOfDay: React.FC<PeriodOfDayProps>;
|
|
11
|
-
export default PeriodOfDay;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export enum IPeriodOfDay {
|
|
6
|
-
Morning = "static/media/src/components/DayNightPeriod/Gif/Morning.gif",
|
|
7
|
-
Afternoon = "static/media/src/components/DayNightPeriod/Gif/Afternoon.gif",
|
|
8
|
-
Night = "static/media/src/components/DayNightPeriod/Gif/Night.gif",
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface PeriodOfDayProps {
|
|
12
|
-
periodOfDay: IPeriodOfDay;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const PeriodOfDay: React.FC<PeriodOfDayProps> = ({ periodOfDay }) => {
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<GifContainer >
|
|
21
|
-
|
|
22
|
-
<img src={periodOfDay} />
|
|
23
|
-
|
|
24
|
-
</GifContainer>
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
interface IPeriodOfDayProps {
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const GifContainer = styled.span<IPeriodOfDayProps>`
|
|
33
|
-
width: 100%;
|
|
34
|
-
`;
|
|
35
|
-
|
|
36
|
-
export default PeriodOfDay;
|