@rpg-engine/long-bow 0.3.98 → 0.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.3.98",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -21,6 +21,9 @@ export const ProgressBar: React.FC<IBarProps> = ({
21
21
  minWidth = 100,
22
22
  style,
23
23
  }) => {
24
+ value = Math.round(value);
25
+ max = Math.round(max);
26
+
24
27
  const calculatePercentageValue = function(max: number, value: number) {
25
28
  if (value > max) {
26
29
  value = max;
@@ -71,7 +71,7 @@ export const Shortcuts: React.FC<ShortcutsProps> = ({
71
71
 
72
72
  const isOnShortcutCooldown = shortcutCooldown > 0;
73
73
 
74
- if (shortcuts[i]?.type === ShortcutType.Item) {
74
+ if (shortcuts && shortcuts[i]?.type === ShortcutType.Item) {
75
75
  const payload = shortcuts[i]?.payload as IItem | undefined;
76
76
 
77
77
  let itemsFromEquipment: (IItem | undefined | null)[] = [];
@@ -132,7 +132,8 @@ export const Shortcuts: React.FC<ShortcutsProps> = ({
132
132
  );
133
133
  }
134
134
 
135
- const payload = shortcuts[i]?.payload as IRawSpell | undefined;
135
+ const payload =
136
+ shortcuts && (shortcuts[i]?.payload as IRawSpell | undefined); //check if shortcuts exists before using the ? operator.
136
137
 
137
138
  const spellCooldown = !payload
138
139
  ? 0
@@ -93,6 +93,9 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
93
93
  const output = [];
94
94
 
95
95
  for (const [key, value] of Object.entries(skillCategory.values)) {
96
+ if (key === 'stamina') {
97
+ continue;
98
+ }
96
99
  //@ts-ignore
97
100
  const skillDetails = (skill[key] as unknown) as ISkillDetails;
98
101
 
@@ -167,7 +170,7 @@ export const SkillsContainer: React.FC<ISkillContainerProps> = ({
167
170
 
168
171
  const SkillsDraggableContainer = styled(DraggableContainer)`
169
172
  border: 1px solid black;
170
- width: 400px;
173
+
171
174
  height: 90%;
172
175
  .DraggableContainer__TitleContainer-sc-184mpyl-2 {
173
176
  width: auto;
@@ -83,7 +83,7 @@ const Container = styled.button<{ isSettingShortcut?: boolean }>`
83
83
  border-radius: 1rem;
84
84
  width: 100%;
85
85
  display: flex;
86
- height: 5rem;
86
+
87
87
  gap: 1rem;
88
88
  align-items: center;
89
89
  padding: 0 1rem;
@@ -137,6 +137,7 @@ export const Spellbook: React.FC<ISpellbookProps> = ({
137
137
  const Title = styled.h1`
138
138
  font-size: ${uiFonts.size.large} !important;
139
139
  margin-bottom: 0 !important;
140
+
140
141
  `;
141
142
 
142
143
  const Container = styled.div`
@@ -145,6 +146,7 @@ const Container = styled.div`
145
146
  color: white;
146
147
  display: flex;
147
148
  flex-direction: column;
149
+
148
150
  `;
149
151
 
150
152
  const SpellList = styled.div`
@@ -44,10 +44,12 @@ export const SpellInfo: React.FC<ISpellInfoProps> = ({ spell }) => {
44
44
  <div className="label">Cooldown:</div>
45
45
  <div className="value">{cooldown}</div>
46
46
  </Statistic>
47
- <Statistic>
48
- <div className="label">Max Distance Grid:</div>
49
- <div className="value">{maxDistanceGrid}</div>
50
- </Statistic>
47
+ {maxDistanceGrid && (
48
+ <Statistic>
49
+ <div className="label">Max Distance Grid:</div>
50
+ <div className="value">{maxDistanceGrid}</div>
51
+ </Statistic>
52
+ )}
51
53
  <Statistic>
52
54
  {requiredItem && (
53
55
  <>
package/src/.DS_Store DELETED
Binary file
Binary file
Binary file
Binary file
Binary file