@rpg-engine/long-bow 0.8.20 → 0.8.21

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.
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IInformationCenterItem, IInformationCenterNPC } from './InformationCenterTypes';
2
+ import { IInformationCenterProps } from './InformationCenterTypes';
3
3
  export interface IFaqItem {
4
4
  id: string;
5
5
  question: string;
@@ -13,17 +13,4 @@ export interface IVideoGuide {
13
13
  videoUrl: string;
14
14
  category: 'Combat' | 'Crafting' | 'Exploration' | 'General';
15
15
  }
16
- export interface IInformationCenterProps {
17
- itemsAtlasJSON: Record<string, any>;
18
- itemsAtlasIMG: string;
19
- entitiesAtlasJSON: Record<string, any>;
20
- entitiesAtlasIMG: string;
21
- faqItems?: IFaqItem[];
22
- bestiaryItems?: IInformationCenterNPC[];
23
- videoGuides?: IVideoGuide[];
24
- items?: IInformationCenterItem[];
25
- loading?: boolean;
26
- error?: string;
27
- initialSearchQuery?: string;
28
- }
29
16
  export declare const InformationCenter: React.FC<IInformationCenterProps>;
@@ -1,4 +1,5 @@
1
1
  import { EntityAttackType, ICharacterPermanentBuff, IEquippableItemBlueprint, INPCLoot, ItemRarities, NPCAlignment, NPCSubtype, RangeTypes } from '@rpg-engine/shared';
2
+ import { IFaqItem, IVideoGuide } from './InformationCenter';
2
3
  export declare enum MovementSpeed {
3
4
  ExtraSlow = 1.5,
4
5
  Slow = 2.25,
@@ -35,6 +36,7 @@ interface INPCBlueprintSpellArea {
35
36
  spellKey: string;
36
37
  probability: number;
37
38
  power: string;
39
+ texturePath: string;
38
40
  }
39
41
  export interface IInformationCenterNPC {
40
42
  id: string;
@@ -76,4 +78,19 @@ export interface IInformationCenterItem extends IEquippableItemBlueprint {
76
78
  equippedBuff?: ICharacterPermanentBuff[];
77
79
  equippedBuffDescription?: string;
78
80
  }
81
+ export interface IInformationCenterProps {
82
+ itemsAtlasJSON: Record<string, any>;
83
+ itemsAtlasIMG: string;
84
+ entitiesAtlasJSON: Record<string, any>;
85
+ entitiesAtlasIMG: string;
86
+ iconsAtlasJSON: any;
87
+ iconsAtlasIMG: any;
88
+ faqItems?: IFaqItem[];
89
+ bestiaryItems?: IInformationCenterNPC[];
90
+ videoGuides?: IVideoGuide[];
91
+ items?: IInformationCenterItem[];
92
+ loading?: boolean;
93
+ error?: string;
94
+ initialSearchQuery?: string;
95
+ }
79
96
  export {};
@@ -6,6 +6,8 @@ interface IBestiarySectionProps {
6
6
  itemsAtlasIMG: string;
7
7
  entitiesAtlasJSON: Record<string, any>;
8
8
  entitiesAtlasIMG: string;
9
+ iconsAtlasIMG: any;
10
+ iconsAtlasJSON: any;
9
11
  initialSearchQuery: string;
10
12
  tabId: string;
11
13
  }
@@ -6,6 +6,8 @@ interface INPCDetailsProps {
6
6
  itemsAtlasIMG: string;
7
7
  entitiesAtlasJSON: Record<string, any>;
8
8
  entitiesAtlasIMG: string;
9
+ iconAtlasIMG?: any;
10
+ iconAtlasJSON?: any;
9
11
  onBack: () => void;
10
12
  }
11
13
  export declare const InformationCenterNPCDetails: React.FC<INPCDetailsProps>;
@@ -30968,7 +30968,7 @@ var StyledDropdown = /*#__PURE__*/styled__default(Dropdown).withConfig({
30968
30968
  var PaginatedContent = function PaginatedContent(_ref) {
30969
30969
  var items = _ref.items,
30970
30970
  _ref$itemsPerPage = _ref.itemsPerPage,
30971
- itemsPerPage = _ref$itemsPerPage === void 0 ? 5 : _ref$itemsPerPage,
30971
+ itemsPerPage = _ref$itemsPerPage === void 0 ? 8 : _ref$itemsPerPage,
30972
30972
  renderItem = _ref.renderItem,
30973
30973
  _ref$emptyMessage = _ref.emptyMessage,
30974
30974
  emptyMessage = _ref$emptyMessage === void 0 ? 'No items found' : _ref$emptyMessage,
@@ -31186,6 +31186,13 @@ var SpriteContainer$2 = /*#__PURE__*/styled__default.div.withConfig({
31186
31186
  })(["width:64px;height:64px;background:rgba(0,0,0,0.3);border-radius:4px;display:flex;justify-content:center;align-items:center;position:relative;.sprite-from-atlas-img{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(2);transform-origin:center;}"]);
31187
31187
 
31188
31188
  var ITEMS_PER_PAGE$1 = 5;
31189
+ var formatItemName = function formatItemName(itemPath) {
31190
+ var _itemPath$split$pop;
31191
+ var cleanText = ((_itemPath$split$pop = itemPath.split('/').pop()) == null ? void 0 : _itemPath$split$pop.split('.').shift()) || '';
31192
+ return cleanText.split('-').map(function (word) {
31193
+ return word.charAt(0).toUpperCase() + word.slice(1);
31194
+ }).join(' ');
31195
+ };
31189
31196
  var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
31190
31197
  var _npc$loots, _npc$skills$strength, _npc$skills$dexterity, _npc$skills$resistanc;
31191
31198
  var npc = _ref.npc,
@@ -31193,6 +31200,8 @@ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
31193
31200
  itemsAtlasIMG = _ref.itemsAtlasIMG,
31194
31201
  entitiesAtlasJSON = _ref.entitiesAtlasJSON,
31195
31202
  entitiesAtlasIMG = _ref.entitiesAtlasIMG,
31203
+ iconAtlasIMG = _ref.iconAtlasIMG,
31204
+ iconAtlasJSON = _ref.iconAtlasJSON,
31196
31205
  onBack = _ref.onBack;
31197
31206
  var isMobile = shared.isMobileOrTablet();
31198
31207
  var _useState = React.useState(''),
@@ -31226,7 +31235,7 @@ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
31226
31235
  }
31227
31236
  };
31228
31237
  var filteredLoots = ((_npc$loots = npc.loots) == null ? void 0 : _npc$loots.filter(function (loot) {
31229
- return formatText(loot.itemBlueprintKey).toLowerCase().includes(lootSearchQuery.toLowerCase());
31238
+ return formatItemName(loot.itemBlueprintKey).toLowerCase().includes(lootSearchQuery.toLowerCase());
31230
31239
  })) || [];
31231
31240
  var totalLootPages = Math.ceil(filteredLoots.length / ITEMS_PER_PAGE$1);
31232
31241
  var paginatedLoots = filteredLoots.slice((currentLootPage - 1) * ITEMS_PER_PAGE$1, currentLootPage * ITEMS_PER_PAGE$1);
@@ -31256,7 +31265,7 @@ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
31256
31265
  width: 24,
31257
31266
  height: 24,
31258
31267
  imgScale: 1
31259
- }), React__default.createElement(LootDetails, null, React__default.createElement(LootName, null, formatText(loot.itemBlueprintKey)), React__default.createElement(LootInfo, null, React__default.createElement(LootChance, null, formatRarity(loot.chance)), loot.quantityRange && React__default.createElement(LootQuantity, null, "x", loot.quantityRange[0], "-", loot.quantityRange[1]))));
31268
+ }), React__default.createElement(LootDetails, null, React__default.createElement(LootName, null, formatItemName(loot.itemBlueprintKey)), React__default.createElement(LootInfo, null, React__default.createElement(LootChance, null, formatRarity(loot.chance)), loot.quantityRange && React__default.createElement(LootQuantity, null, "x", loot.quantityRange[0], "-", loot.quantityRange[1]))));
31260
31269
  })), filteredLoots.length > ITEMS_PER_PAGE$1 && React__default.createElement(PaginationContainer$2, null, React__default.createElement(StyledPagination, {
31261
31270
  currentPage: currentLootPage,
31262
31271
  totalPages: totalLootPages,
@@ -31274,7 +31283,14 @@ var InformationCenterNPCDetails = function InformationCenterNPCDetails(_ref) {
31274
31283
  }, React__default.createElement(SpellsList, null, npc.areaSpells.map(function (spell, index) {
31275
31284
  return React__default.createElement(SpellItem, {
31276
31285
  key: index
31277
- }, React__default.createElement(SpellName, null, formatText(spell.spellKey)), React__default.createElement(SpellDetails, null, "Power: ", React__default.createElement(SpellValue, null, formatText(spell.power)), React__default.createElement(Separator, null, "\u2022"), "Chance: ", React__default.createElement(SpellValue, null, spell.probability, "%")));
31286
+ }, React__default.createElement(SpellIconContainer, null, React__default.createElement(SpriteFromAtlas, {
31287
+ atlasJSON: iconAtlasJSON,
31288
+ atlasIMG: iconAtlasIMG,
31289
+ spriteKey: spell.texturePath || spell.spellKey,
31290
+ width: 24,
31291
+ height: 24,
31292
+ imgScale: 1
31293
+ })), React__default.createElement(SpellContent, null, React__default.createElement(SpellName, null, formatText(spell.spellKey)), React__default.createElement(SpellDetails, null, "Power:", ' ', React__default.createElement(SpellValue, null, formatText(spell.power)), React__default.createElement(Separator, null, "\u2022"), "Chance: ", React__default.createElement(SpellValue, null, spell.probability, "%"))));
31278
31294
  }))));
31279
31295
  };
31280
31296
  var InfoSection = /*#__PURE__*/styled__default.div.withConfig({
@@ -31317,69 +31333,77 @@ var SpellsList = /*#__PURE__*/styled__default.div.withConfig({
31317
31333
  displayName: "InformationCenterNPCDetails__SpellsList",
31318
31334
  componentId: "sc-fdu3xl-9"
31319
31335
  })(["display:flex;flex-direction:column;gap:8px;padding:12px;"]);
31336
+ var SpellIconContainer = /*#__PURE__*/styled__default.div.withConfig({
31337
+ displayName: "InformationCenterNPCDetails__SpellIconContainer",
31338
+ componentId: "sc-fdu3xl-10"
31339
+ })(["display:flex;padding-right:30px;padding-bottom:30px;"]);
31340
+ var SpellContent = /*#__PURE__*/styled__default.div.withConfig({
31341
+ displayName: "InformationCenterNPCDetails__SpellContent",
31342
+ componentId: "sc-fdu3xl-11"
31343
+ })(["display:flex;flex-direction:column;gap:4px;flex:1;"]);
31320
31344
  var SpellItem = /*#__PURE__*/styled__default.div.withConfig({
31321
31345
  displayName: "InformationCenterNPCDetails__SpellItem",
31322
- componentId: "sc-fdu3xl-10"
31323
- })(["display:flex;flex-direction:column;gap:4px;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
31346
+ componentId: "sc-fdu3xl-12"
31347
+ })(["display:flex;gap:8px;background:rgba(255,255,255,0.05);padding:8px;padding-left:10px;border-radius:4px;align-items:center;"]);
31324
31348
  var SpellName = /*#__PURE__*/styled__default.div.withConfig({
31325
31349
  displayName: "InformationCenterNPCDetails__SpellName",
31326
- componentId: "sc-fdu3xl-11"
31350
+ componentId: "sc-fdu3xl-13"
31327
31351
  })(["color:", ";font-size:0.5rem;"], uiColors.yellow);
31328
31352
  var SpellDetails = /*#__PURE__*/styled__default.div.withConfig({
31329
31353
  displayName: "InformationCenterNPCDetails__SpellDetails",
31330
- componentId: "sc-fdu3xl-12"
31354
+ componentId: "sc-fdu3xl-14"
31331
31355
  })(["display:flex;align-items:center;gap:8px;color:", ";font-size:0.45rem;opacity:0.8;"], uiColors.white);
31332
31356
  var SpellValue = /*#__PURE__*/styled__default.span.withConfig({
31333
31357
  displayName: "InformationCenterNPCDetails__SpellValue",
31334
- componentId: "sc-fdu3xl-13"
31358
+ componentId: "sc-fdu3xl-15"
31335
31359
  })(["color:", ";"], uiColors.yellow);
31336
31360
  var Separator = /*#__PURE__*/styled__default.span.withConfig({
31337
31361
  displayName: "InformationCenterNPCDetails__Separator",
31338
- componentId: "sc-fdu3xl-14"
31362
+ componentId: "sc-fdu3xl-16"
31339
31363
  })(["color:", ";opacity:0.5;"], uiColors.yellow);
31340
31364
  var LootSearchContainer = /*#__PURE__*/styled__default.div.withConfig({
31341
31365
  displayName: "InformationCenterNPCDetails__LootSearchContainer",
31342
- componentId: "sc-fdu3xl-15"
31366
+ componentId: "sc-fdu3xl-17"
31343
31367
  })(["padding:12px 12px 0;"]);
31344
31368
  var StyledSearchBar$1 = /*#__PURE__*/styled__default(SearchBar).withConfig({
31345
31369
  displayName: "InformationCenterNPCDetails__StyledSearchBar",
31346
- componentId: "sc-fdu3xl-16"
31370
+ componentId: "sc-fdu3xl-18"
31347
31371
  })(["width:100%;"]);
31348
31372
  var LootGrid = /*#__PURE__*/styled__default.div.withConfig({
31349
31373
  displayName: "InformationCenterNPCDetails__LootGrid",
31350
- componentId: "sc-fdu3xl-17"
31374
+ componentId: "sc-fdu3xl-19"
31351
31375
  })(["display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;padding:12px;"]);
31352
31376
  var LootItem = /*#__PURE__*/styled__default.div.withConfig({
31353
31377
  displayName: "InformationCenterNPCDetails__LootItem",
31354
- componentId: "sc-fdu3xl-18"
31378
+ componentId: "sc-fdu3xl-20"
31355
31379
  })(["display:flex;align-items:center;gap:8px;background:rgba(255,255,255,0.05);padding:8px;border-radius:4px;"]);
31356
31380
  var LootDetails = /*#__PURE__*/styled__default.div.withConfig({
31357
31381
  displayName: "InformationCenterNPCDetails__LootDetails",
31358
- componentId: "sc-fdu3xl-19"
31382
+ componentId: "sc-fdu3xl-21"
31359
31383
  })(["flex:1;display:flex;flex-direction:column;gap:4px;"]);
31360
31384
  var LootName = /*#__PURE__*/styled__default.div.withConfig({
31361
31385
  displayName: "InformationCenterNPCDetails__LootName",
31362
- componentId: "sc-fdu3xl-20"
31386
+ componentId: "sc-fdu3xl-22"
31363
31387
  })(["color:", ";font-size:0.5rem;"], uiColors.white);
31364
31388
  var LootInfo = /*#__PURE__*/styled__default.div.withConfig({
31365
31389
  displayName: "InformationCenterNPCDetails__LootInfo",
31366
- componentId: "sc-fdu3xl-21"
31390
+ componentId: "sc-fdu3xl-23"
31367
31391
  })(["display:flex;align-items:center;gap:8px;"]);
31368
31392
  var LootChance = /*#__PURE__*/styled__default.span.withConfig({
31369
31393
  displayName: "InformationCenterNPCDetails__LootChance",
31370
- componentId: "sc-fdu3xl-22"
31394
+ componentId: "sc-fdu3xl-24"
31371
31395
  })(["color:", ";font-size:0.45rem;"], uiColors.yellow);
31372
31396
  var LootQuantity = /*#__PURE__*/styled__default.span.withConfig({
31373
31397
  displayName: "InformationCenterNPCDetails__LootQuantity",
31374
- componentId: "sc-fdu3xl-23"
31398
+ componentId: "sc-fdu3xl-25"
31375
31399
  })(["color:", ";font-size:0.45rem;"], uiColors.lightGray);
31376
31400
  var PaginationContainer$2 = /*#__PURE__*/styled__default.div.withConfig({
31377
31401
  displayName: "InformationCenterNPCDetails__PaginationContainer",
31378
- componentId: "sc-fdu3xl-24"
31402
+ componentId: "sc-fdu3xl-26"
31379
31403
  })(["display:flex;justify-content:center;padding:12px;"]);
31380
31404
  var StyledPagination = /*#__PURE__*/styled__default(Pagination).withConfig({
31381
31405
  displayName: "InformationCenterNPCDetails__StyledPagination",
31382
- componentId: "sc-fdu3xl-25"
31406
+ componentId: "sc-fdu3xl-27"
31383
31407
  })(["font-size:0.6rem;"]);
31384
31408
 
31385
31409
  var TooltipContainer$1 = /*#__PURE__*/styled__default.div.withConfig({
@@ -31509,6 +31533,8 @@ var InformationCenterBestiarySection = function InformationCenterBestiarySection
31509
31533
  var bestiaryItems = _ref.bestiaryItems,
31510
31534
  itemsAtlasJSON = _ref.itemsAtlasJSON,
31511
31535
  itemsAtlasIMG = _ref.itemsAtlasIMG,
31536
+ iconsAtlasIMG = _ref.iconsAtlasIMG,
31537
+ iconsAtlasJSON = _ref.iconsAtlasJSON,
31512
31538
  entitiesAtlasJSON = _ref.entitiesAtlasJSON,
31513
31539
  entitiesAtlasIMG = _ref.entitiesAtlasIMG,
31514
31540
  initialSearchQuery = _ref.initialSearchQuery,
@@ -31620,6 +31646,8 @@ var InformationCenterBestiarySection = function InformationCenterBestiarySection
31620
31646
  npc: selectedMonster,
31621
31647
  itemsAtlasJSON: itemsAtlasJSON,
31622
31648
  itemsAtlasIMG: itemsAtlasIMG,
31649
+ iconAtlasIMG: iconsAtlasIMG,
31650
+ iconAtlasJSON: iconsAtlasJSON,
31623
31651
  entitiesAtlasJSON: entitiesAtlasJSON,
31624
31652
  entitiesAtlasIMG: entitiesAtlasIMG,
31625
31653
  onBack: function onBack() {
@@ -32099,6 +32127,8 @@ var InformationCenter = function InformationCenter(_ref) {
32099
32127
  itemsAtlasIMG = _ref.itemsAtlasIMG,
32100
32128
  entitiesAtlasJSON = _ref.entitiesAtlasJSON,
32101
32129
  entitiesAtlasIMG = _ref.entitiesAtlasIMG,
32130
+ iconsAtlasIMG = _ref.iconsAtlasIMG,
32131
+ iconsAtlasJSON = _ref.iconsAtlasJSON,
32102
32132
  _ref$faqItems = _ref.faqItems,
32103
32133
  faqItems = _ref$faqItems === void 0 ? [] : _ref$faqItems,
32104
32134
  _ref$bestiaryItems = _ref.bestiaryItems,
@@ -32131,6 +32161,8 @@ var InformationCenter = function InformationCenter(_ref) {
32131
32161
  bestiaryItems: bestiaryItems,
32132
32162
  itemsAtlasJSON: itemsAtlasJSON,
32133
32163
  itemsAtlasIMG: itemsAtlasIMG,
32164
+ iconsAtlasIMG: iconsAtlasIMG,
32165
+ iconsAtlasJSON: iconsAtlasJSON,
32134
32166
  entitiesAtlasJSON: entitiesAtlasJSON,
32135
32167
  entitiesAtlasIMG: entitiesAtlasIMG,
32136
32168
  initialSearchQuery: initialSearchQuery,