@rpg-engine/long-bow 0.2.26 → 0.2.28

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.2.26",
3
+ "version": "0.2.28",
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.4.58",
86
+ "@rpg-engine/shared": "^0.5.59",
87
87
  "dayjs": "^1.11.2",
88
88
  "fs-extra": "^10.1.0",
89
89
  "lodash": "^4.17.21",
@@ -38,7 +38,7 @@ export const CharacterSelection: React.FC<ICharacterSelectionProps> = ({
38
38
  const textureKey = selectedValue ? selectedValue.id : '';
39
39
  const spriteKey = textureKey ? textureKey + '/down/standing/0.png' : '';
40
40
 
41
- if (spriteKey == selectedSpriteKey) {
41
+ if (spriteKey === selectedSpriteKey) {
42
42
  return;
43
43
  }
44
44
 
@@ -1,4 +1,5 @@
1
1
  import {
2
+ getItemTextureKeyPath,
2
3
  IItem,
3
4
  IItemContainer,
4
5
  ItemContainerType,
@@ -9,7 +10,6 @@ import {
9
10
  import { observer } from 'mobx-react-lite';
10
11
  import React, { useEffect, useState } from 'react';
11
12
  import styled from 'styled-components';
12
- import { getItemTextureKeyPath } from '../../../libs/ItemSlotHelper';
13
13
  import { RelativeListMenu } from '../../RelativeListMenu';
14
14
  import { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';
15
15
  import { ItemTooltip } from '../Cards/ItemTooltip';
@@ -3,7 +3,7 @@ import {
3
3
  // IItem,
4
4
  ItemSlotType,
5
5
  ItemSubType,
6
- ItemType
6
+ ItemType,
7
7
  } from '@rpg-engine/shared';
8
8
 
9
9
  export const items: any = {
@@ -245,8 +245,7 @@ export const items: any = {
245
245
  textureKey: 'stone',
246
246
  name: 'stone',
247
247
  generateContainerSlots: 10,
248
- description:
249
- 'You see a stone. It is used with slingshot.',
248
+ description: 'You see a stone. It is used with slingshot.',
250
249
  attack: 7,
251
250
  defense: 3,
252
251
  weight: 13,
@@ -254,8 +253,7 @@ export const items: any = {
254
253
  x: 320,
255
254
  y: 144,
256
255
  scene: 'MainScene',
257
- fullDescription:
258
- 'You see a stone. It is used with slingshot',
256
+ fullDescription: 'You see a stone. It is used with slingshot',
259
257
  createdAt: '2022-06-04T03:18:09.335Z',
260
258
  updatedAt: '2022-06-04T18:16:49.056Z',
261
259
  },
@@ -3,7 +3,7 @@ import {
3
3
  IItemContainer,
4
4
  ItemSlotType,
5
5
  ItemSubType,
6
- ItemType
6
+ ItemType,
7
7
  } from '@rpg-engine/shared';
8
8
 
9
9
  export const items: IItem[] = [
@@ -240,7 +240,7 @@ export const items: IItem[] = [
240
240
  'You see a bag. It has made using leather and it has 10 total slots.',
241
241
  createdAt: '2022-06-04T03:18:09.335Z',
242
242
  updatedAt: '2022-06-04T18:16:49.056Z',
243
- },
243
+ },
244
244
  {
245
245
  _id: '392acek4j7c8e80d2ff60404',
246
246
  hasUseWith: false,
@@ -259,12 +259,11 @@ export const items: IItem[] = [
259
259
  isItemContainer: true,
260
260
  isSolid: false,
261
261
  key: 'stone',
262
- texturePath: 'ranged-weapons/stone-qty-1.png',
262
+ texturePath: 'ranged-weapons/stone.png',
263
263
  textureKey: 'stone',
264
264
  name: 'stone',
265
265
  generateContainerSlots: 10,
266
- description:
267
- 'You see a stone. It is used with slingshot.',
266
+ description: 'You see a stone. It is used with slingshot.',
268
267
  attack: 7,
269
268
  defense: 3,
270
269
  weight: 13,
@@ -272,11 +271,10 @@ export const items: IItem[] = [
272
271
  x: 320,
273
272
  y: 144,
274
273
  scene: 'MainScene',
275
- fullDescription:
276
- 'You see a stone. It is used with slingshot',
274
+ fullDescription: 'You see a stone. It is used with slingshot',
277
275
  createdAt: '2022-06-04T03:18:09.335Z',
278
276
  updatedAt: '2022-06-04T18:16:49.056Z',
279
- },
277
+ },
280
278
  {
281
279
  _id: '392acek4j7c8e80d2fs60404',
282
280
  hasUseWith: false,
@@ -295,12 +293,11 @@ export const items: IItem[] = [
295
293
  isItemContainer: true,
296
294
  isSolid: false,
297
295
  key: 'stone',
298
- texturePath: 'ranged-weapons/stone-qty-1.png',
296
+ texturePath: 'ranged-weapons/stone.png',
299
297
  textureKey: 'stone',
300
298
  name: 'stone',
301
299
  generateContainerSlots: 10,
302
- description:
303
- 'You see a stone. It is used with slingshot.',
300
+ description: 'You see a stone. It is used with slingshot.',
304
301
  attack: 7,
305
302
  defense: 3,
306
303
  weight: 13,
@@ -308,11 +305,10 @@ export const items: IItem[] = [
308
305
  x: 320,
309
306
  y: 144,
310
307
  scene: 'MainScene',
311
- fullDescription:
312
- 'You see a stone. It is used with slingshot',
308
+ fullDescription: 'You see a stone. It is used with slingshot',
313
309
  createdAt: '2022-06-04T03:18:09.335Z',
314
310
  updatedAt: '2022-06-04T18:16:49.056Z',
315
- },
311
+ },
316
312
  {
317
313
  _id: '392acek4j7c8e80d2fs60404',
318
314
  hasUseWith: false,
@@ -331,12 +327,11 @@ export const items: IItem[] = [
331
327
  isItemContainer: true,
332
328
  isSolid: false,
333
329
  key: 'stone',
334
- texturePath: 'ranged-weapons/stone-qty-1.png',
330
+ texturePath: 'ranged-weapons/stone.png',
335
331
  textureKey: 'stone',
336
332
  name: 'stone',
337
333
  generateContainerSlots: 10,
338
- description:
339
- 'You see a stone. It is used with slingshot.',
334
+ description: 'You see a stone. It is used with slingshot.',
340
335
  attack: 7,
341
336
  defense: 3,
342
337
  weight: 13,
@@ -344,11 +339,10 @@ export const items: IItem[] = [
344
339
  x: 320,
345
340
  y: 144,
346
341
  scene: 'MainScene',
347
- fullDescription:
348
- 'You see a stone. It is used with slingshot',
342
+ fullDescription: 'You see a stone. It is used with slingshot',
349
343
  createdAt: '2022-06-04T03:18:09.335Z',
350
344
  updatedAt: '2022-06-04T18:16:49.056Z',
351
- },
345
+ },
352
346
  {
353
347
  _id: '392acek4j7c8e80d2fs60404',
354
348
  hasUseWith: false,
@@ -367,12 +361,11 @@ export const items: IItem[] = [
367
361
  isItemContainer: true,
368
362
  isSolid: false,
369
363
  key: 'stone',
370
- texturePath: 'ranged-weapons/stone-qty-1.png',
364
+ texturePath: 'ranged-weapons/stone.png',
371
365
  textureKey: 'stone',
372
366
  name: 'stone',
373
367
  generateContainerSlots: 10,
374
- description:
375
- 'You see a stone. It is used with slingshot.',
368
+ description: 'You see a stone. It is used with slingshot.',
376
369
  attack: 7,
377
370
  defense: 3,
378
371
  weight: 13,
@@ -380,11 +373,10 @@ export const items: IItem[] = [
380
373
  x: 320,
381
374
  y: 144,
382
375
  scene: 'MainScene',
383
- fullDescription:
384
- 'You see a stone. It is used with slingshot',
376
+ fullDescription: 'You see a stone. It is used with slingshot',
385
377
  createdAt: '2022-06-04T03:18:09.335Z',
386
378
  updatedAt: '2022-06-04T18:16:49.056Z',
387
- },
379
+ },
388
380
  {
389
381
  _id: '392acek4j7c8e80d2fs60404',
390
382
  hasUseWith: false,
@@ -403,12 +395,11 @@ export const items: IItem[] = [
403
395
  isItemContainer: true,
404
396
  isSolid: false,
405
397
  key: 'stone',
406
- texturePath: 'ranged-weapons/stone-qty-1.png',
398
+ texturePath: 'ranged-weapons/stone.png',
407
399
  textureKey: 'stone',
408
400
  name: 'stone',
409
401
  generateContainerSlots: 10,
410
- description:
411
- 'You see a stone. It is used with slingshot.',
402
+ description: 'You see a stone. It is used with slingshot.',
412
403
  attack: 7,
413
404
  defense: 3,
414
405
  weight: 13,
@@ -416,11 +407,10 @@ export const items: IItem[] = [
416
407
  x: 320,
417
408
  y: 144,
418
409
  scene: 'MainScene',
419
- fullDescription:
420
- 'You see a stone. It is used with slingshot',
410
+ fullDescription: 'You see a stone. It is used with slingshot',
421
411
  createdAt: '2022-06-04T03:18:09.335Z',
422
412
  updatedAt: '2022-06-04T18:16:49.056Z',
423
- },
413
+ },
424
414
  {
425
415
  _id: '392acek4j7c8e80d2fs60404',
426
416
  hasUseWith: false,
@@ -439,12 +429,11 @@ export const items: IItem[] = [
439
429
  isItemContainer: true,
440
430
  isSolid: false,
441
431
  key: 'gold-coin',
442
- texturePath: 'others/gold-coin-qty-1.png',
432
+ texturePath: 'others/gold-coin.png',
443
433
  textureKey: 'gold-coin',
444
434
  name: 'gold-coin',
445
435
  generateContainerSlots: 10,
446
- description:
447
- 'You see a coin.',
436
+ description: 'You see a coin.',
448
437
  attack: 7,
449
438
  defense: 3,
450
439
  weight: 13,
@@ -452,11 +441,10 @@ export const items: IItem[] = [
452
441
  x: 320,
453
442
  y: 144,
454
443
  scene: 'MainScene',
455
- fullDescription:
456
- 'You see a stone. It is used with slingshot',
444
+ fullDescription: 'You see a stone. It is used with slingshot',
457
445
  createdAt: '2022-06-04T03:18:09.335Z',
458
446
  updatedAt: '2022-06-04T18:16:49.056Z',
459
- }
447
+ },
460
448
  ];
461
449
 
462
450
  export const itemContainerMock: IItemContainer = {
@@ -1,2 +0,0 @@
1
- import { IItem } from "@rpg-engine/shared";
2
- export declare const getItemTextureKeyPath: (itemToRender: IItem, atlasJSON: any) => string;
@@ -1,25 +0,0 @@
1
- import { IItem } from "@rpg-engine/shared";
2
-
3
- export const getItemTextureKeyPath = (itemToRender: IItem, atlasJSON: any) => {
4
-
5
- const stackQty = itemToRender?.stackQty ?? 0;
6
- const itemTexturePath = itemToRender.texturePath;
7
-
8
- if (itemToRender && stackQty > 1) {
9
- const idx = stackQty >= 5 ? '5' : stackQty;
10
-
11
- const textureBreakPath = itemTexturePath.split('.');
12
- const txtPrefix: string = textureBreakPath[0];
13
- const txtExtension: string = textureBreakPath[1];
14
-
15
- const newTexturePath = `${txtPrefix}-qty-${idx}.${txtExtension}`;
16
- const spriteData = atlasJSON.frames[newTexturePath];
17
-
18
- if (spriteData !== undefined) {
19
- return newTexturePath;
20
- }
21
- }
22
- return itemTexturePath;
23
-
24
- };
25
-