@rpg-engine/long-bow 0.3.43 → 0.3.44
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/Abstractions/SlotsContainer.d.ts +0 -1
- package/dist/components/Button.d.ts +2 -3
- package/dist/components/Chat/Chat.d.ts +2 -12
- package/dist/components/CheckButton.d.ts +2 -1
- package/dist/components/DraggableContainer.d.ts +0 -1
- package/dist/components/Equipment/EquipmentSet.d.ts +0 -8
- package/dist/components/Input.d.ts +0 -1
- package/dist/components/Item/Inventory/ItemContainer.d.ts +0 -12
- package/dist/components/Item/Inventory/ItemSlot.d.ts +0 -9
- package/dist/components/NPCDialog/NPCDialogText.d.ts +2 -4
- package/dist/components/RangeSlider.d.ts +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/long-bow.cjs.development.js +515 -7465
- 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 +520 -7461
- package/dist/long-bow.esm.js.map +1 -1
- package/dist/mocks/equipmentSet.mocks.d.ts +2 -15
- package/dist/mocks/skills.mocks.d.ts +121 -2
- package/package.json +2 -5
- package/src/components/Abstractions/SlotsContainer.tsx +0 -3
- package/src/components/Button.tsx +8 -18
- package/src/components/Chat/Chat.tsx +105 -106
- package/src/components/CheckButton.tsx +1 -1
- package/src/components/DraggableContainer.tsx +1 -4
- package/src/components/Dropdown.tsx +1 -7
- package/src/components/Equipment/EquipmentSet.tsx +0 -46
- package/src/components/Input.tsx +2 -6
- package/src/components/Item/Inventory/ItemContainer.tsx +6 -104
- package/src/components/Item/Inventory/ItemSlot.tsx +34 -234
- package/src/components/NPCDialog/NPCDialog.tsx +28 -4
- package/src/components/NPCDialog/NPCDialogText.tsx +15 -75
- package/src/components/RangeSlider.tsx +14 -37
- package/src/components/SkillsContainer.tsx +1 -1
- package/src/components/TimeWidget/TimeWidget.tsx +0 -1
- package/src/components/TradingMenu/TradingItemRow.tsx +6 -43
- package/src/components/TradingMenu/TradingMenu.tsx +1 -1
- package/src/components/TradingMenu/items.mock.ts +0 -1
- package/src/components/shared/SpriteFromAtlas.tsx +1 -4
- package/src/hooks/useOutsideAlerter.ts +2 -2
- package/src/index.tsx +0 -8
- package/src/mocks/atlas/items/items.json +314 -6086
- package/src/mocks/atlas/items/items.png +0 -0
- package/src/mocks/equipmentSet.mocks.ts +4 -49
- package/src/mocks/itemContainer.mocks.ts +6 -54
- package/src/mocks/skills.mocks.ts +2 -8
- package/src/stories/Chat.stories.tsx +3 -20
- package/src/stories/EquipmentSet.stories.tsx +0 -10
- package/src/stories/ItemContainer.stories.tsx +15 -84
- package/src/stories/RangeSlider.stories.tsx +9 -10
- package/dist/components/CaracterStatus/CaracterStatus.d.ts +0 -9
- package/dist/components/Chatdeprecated/ChatDeprecated.d.ts +0 -13
- package/dist/components/CircularController/CircularController.d.ts +0 -10
- package/dist/components/CraftBook/CraftBook.d.ts +0 -15
- package/dist/components/CraftBook/MockItems.d.ts +0 -2
- package/dist/components/DropdownSelectorContainer.d.ts +0 -13
- package/dist/components/Item/Inventory/ItemQuantitySelector.d.ts +0 -7
- package/dist/components/RadioInput/RadioButton.d.ts +0 -8
- package/dist/components/RadioInput/RadioInput.d.ts +0 -13
- package/dist/components/RadioInput/instruments.d.ts +0 -4
- package/dist/components/Spellbook/QuickSpells.d.ts +0 -10
- package/dist/components/Spellbook/Spell.d.ts +0 -11
- package/dist/components/Spellbook/Spellbook.d.ts +0 -15
- package/dist/components/Spellbook/SpellbookShortcuts.d.ts +0 -10
- package/dist/components/Spellbook/constants.d.ts +0 -3
- package/dist/components/Spellbook/mockSpells.d.ts +0 -2
- package/dist/components/itemSelector/ItemSelector.d.ts +0 -14
- package/dist/constants/uiDevices.d.ts +0 -1
- package/dist/stories/CaracterStatus.stories.d.ts +0 -5
- package/dist/stories/ChatDeprecated.stories.d.ts +0 -5
- package/dist/stories/CircullarController.stories.d.ts +0 -5
- package/dist/stories/CraftBook.stories.d.ts +0 -4
- package/dist/stories/DropdownSelectorContainer.stories.d.ts +0 -5
- package/dist/stories/ItemQuantitySelector.stories.d.ts +0 -5
- package/dist/stories/ItemSelector.stories.d.ts +0 -4
- package/dist/stories/QuickSpells.stories.d.ts +0 -5
- package/dist/stories/RadioInput.stories.d.ts +0 -5
- package/dist/stories/Spellbook.stories.d.ts +0 -5
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/CaracterStatus/CaracterStatus.tsx +0 -86
- package/src/components/CaracterStatus/Character.png +0 -0
- package/src/components/Chatdeprecated/ChatDeprecated.tsx +0 -200
- package/src/components/CircularController/CircularController.tsx +0 -162
- package/src/components/CraftBook/CraftBook.tsx +0 -230
- package/src/components/CraftBook/MockItems.ts +0 -46
- package/src/components/DropdownSelectorContainer.tsx +0 -42
- package/src/components/Item/Inventory/ItemQuantitySelector.tsx +0 -142
- package/src/components/NPCDialog/.DS_Store +0 -0
- package/src/components/NPCDialog/img/.DS_Store +0 -0
- package/src/components/NPCDialog/img/press-button.gif +0 -0
- package/src/components/RadioInput/RadioButton.tsx +0 -98
- package/src/components/RadioInput/RadioInput.tsx +0 -99
- package/src/components/RadioInput/instruments.ts +0 -16
- package/src/components/Spellbook/QuickSpells.tsx +0 -120
- package/src/components/Spellbook/Spell.tsx +0 -201
- package/src/components/Spellbook/Spellbook.tsx +0 -144
- package/src/components/Spellbook/SpellbookShortcuts.tsx +0 -77
- package/src/components/Spellbook/constants.ts +0 -12
- package/src/components/Spellbook/mockSpells.ts +0 -60
- package/src/components/itemSelector/ItemSelector.tsx +0 -136
- package/src/constants/uiDevices.ts +0 -5
- package/src/mocks/.DS_Store +0 -0
- package/src/mocks/atlas/.DS_Store +0 -0
- package/src/stories/CaracterStatus.stories.tsx +0 -29
- package/src/stories/ChatDeprecated.stories.tsx +0 -170
- package/src/stories/CircullarController.stories.tsx +0 -33
- package/src/stories/CraftBook.stories.tsx +0 -40
- package/src/stories/DropdownSelectorContainer.stories.tsx +0 -41
- package/src/stories/ItemQuantitySelector.stories.tsx +0 -26
- package/src/stories/ItemSelector.stories.tsx +0 -77
- package/src/stories/QuickSpells.stories.tsx +0 -38
- package/src/stories/RadioInput.stories.tsx +0 -35
- package/src/stories/Spellbook.stories.tsx +0 -107
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { Meta, Story } from '@storybook/react';
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { RPGUIRoot } from '../components/RPGUIRoot';
|
|
4
|
-
import {
|
|
5
|
-
defaultSpellShortcut,
|
|
6
|
-
SPELL_SHORTCUTS_STORAGE_KEY,
|
|
7
|
-
} from '../components/Spellbook/constants';
|
|
8
|
-
import { mockSpells } from '../components/Spellbook/mockSpells';
|
|
9
|
-
import { ISpellbookProps, Spellbook } from '../components/Spellbook/Spellbook';
|
|
10
|
-
|
|
11
|
-
const meta: Meta = {
|
|
12
|
-
title: 'Spellbook',
|
|
13
|
-
component: Spellbook,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default meta;
|
|
17
|
-
|
|
18
|
-
const Template: Story<ISpellbookProps> = args => {
|
|
19
|
-
const [spellShortcuts, setSpellShortcuts] = useState([]);
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
const shortcuts = localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY);
|
|
23
|
-
if (shortcuts) {
|
|
24
|
-
setSpellShortcuts(JSON.parse(shortcuts));
|
|
25
|
-
}
|
|
26
|
-
}, []);
|
|
27
|
-
|
|
28
|
-
const setSpellShortcut = (key: string, index: number) => {
|
|
29
|
-
const spellShortcuts = JSON.parse(
|
|
30
|
-
localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY) as string
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const spell = mockSpells.find(s => s.key === key);
|
|
34
|
-
if (!spell) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (!spellShortcuts) {
|
|
39
|
-
const newSpellShortcuts = [
|
|
40
|
-
defaultSpellShortcut,
|
|
41
|
-
defaultSpellShortcut,
|
|
42
|
-
defaultSpellShortcut,
|
|
43
|
-
defaultSpellShortcut,
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
newSpellShortcuts[index] = spell;
|
|
47
|
-
|
|
48
|
-
localStorage.setItem(
|
|
49
|
-
SPELL_SHORTCUTS_STORAGE_KEY,
|
|
50
|
-
JSON.stringify(newSpellShortcuts)
|
|
51
|
-
);
|
|
52
|
-
} else {
|
|
53
|
-
spellShortcuts[index] = spell;
|
|
54
|
-
|
|
55
|
-
localStorage.setItem(
|
|
56
|
-
SPELL_SHORTCUTS_STORAGE_KEY,
|
|
57
|
-
JSON.stringify(spellShortcuts)
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
setSpellShortcuts(spellShortcuts);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const removeSpellShortcut = (index: number) => {
|
|
65
|
-
const spellShortcuts = JSON.parse(
|
|
66
|
-
localStorage.getItem(SPELL_SHORTCUTS_STORAGE_KEY) as string
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
if (!spellShortcuts) return;
|
|
70
|
-
|
|
71
|
-
spellShortcuts[index] = defaultSpellShortcut;
|
|
72
|
-
|
|
73
|
-
localStorage.setItem(
|
|
74
|
-
SPELL_SHORTCUTS_STORAGE_KEY,
|
|
75
|
-
JSON.stringify(spellShortcuts)
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
setSpellShortcuts(spellShortcuts);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<RPGUIRoot>
|
|
83
|
-
<div
|
|
84
|
-
style={{
|
|
85
|
-
width: '50%',
|
|
86
|
-
height: '75%',
|
|
87
|
-
}}
|
|
88
|
-
>
|
|
89
|
-
<Spellbook
|
|
90
|
-
{...args}
|
|
91
|
-
setSpellShortcut={setSpellShortcut}
|
|
92
|
-
removeSpellShortcut={removeSpellShortcut}
|
|
93
|
-
spellShortcuts={spellShortcuts}
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
</RPGUIRoot>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const Default = Template.bind({});
|
|
101
|
-
Default.args = {
|
|
102
|
-
onClose: () => console.log('close'),
|
|
103
|
-
onSpellClick: spellKey => console.log(spellKey),
|
|
104
|
-
spells: mockSpells,
|
|
105
|
-
magicLevel: 3,
|
|
106
|
-
mana: 5,
|
|
107
|
-
};
|