@rpg-engine/long-bow 0.6.82 → 0.6.85

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.
@@ -31946,7 +31946,7 @@ var QuestList = function QuestList(_ref) {
31946
31946
  style: {
31947
31947
  color: getStatusColor(quest.status)
31948
31948
  }
31949
- }, (_formatStatus = formatStatus(quest.status)) != null ? _formatStatus : 'Unknown')), React__default.createElement(QuestItem, null, React__default.createElement(Label, null, "Description:"), React__default.createElement(Value, null, quest.description)), React__default.createElement(QuestItem, null, React__default.createElement(Label, null, "Objectives:"), React__default.createElement(Value, null, formatObjectives(quest.objectives))), React__default.createElement(QuestItem, null, React__default.createElement(Label, null, "Rewards:"), React__default.createElement(Value, null, formatRewards(quest.rewards))));
31949
+ }, (_formatStatus = formatStatus(quest.status)) != null ? _formatStatus : 'Unknown')), React__default.createElement(QuestItem, null, React__default.createElement(Label, null, "Description:"), React__default.createElement(Value, null, quest.description)));
31950
31950
  }) : React__default.createElement(NoQuestContainer, null, React__default.createElement("p", null, "There are no ongoing quests")));
31951
31951
  };
31952
31952
  var QuestListContainer = /*#__PURE__*/styled__default.div.withConfig({
@@ -31973,49 +31973,73 @@ var NoQuestContainer = /*#__PURE__*/styled__default.div.withConfig({
31973
31973
  displayName: "QuestList__NoQuestContainer",
31974
31974
  componentId: "sc-1c1y8sp-5"
31975
31975
  })(["text-align:center;p{margin-top:5px;color:", ";}"], uiColors.lightGray);
31976
- var formatObjectives = function formatObjectives(objectives) {
31977
- try {
31978
- if (!objectives || !Array.isArray(objectives)) return 'No objectives';
31979
- return objectives.map(function (objective) {
31980
- if ('killCountTarget' in objective) {
31981
- var _killObjective$creatu, _killObjective$creatu2, _killObjective$killCo, _killObjective$killCo2;
31982
- var killObjective = objective;
31983
- return "Kill " + formatText((_killObjective$creatu = (_killObjective$creatu2 = killObjective.creatureKeys) == null ? void 0 : _killObjective$creatu2.join(', ')) != null ? _killObjective$creatu : 'Unknown') + ": " + ((_killObjective$killCo = killObjective.killCount) != null ? _killObjective$killCo : 0) + "/" + ((_killObjective$killCo2 = killObjective.killCountTarget) != null ? _killObjective$killCo2 : 0);
31984
- } else if ('targetNPCkey' in objective) {
31985
- var _interactionObjective;
31986
- var interactionObjective = objective;
31987
- return "Interact with NPC: " + formatText((_interactionObjective = interactionObjective.targetNPCkey) != null ? _interactionObjective : 'Unknown');
31988
- } else {
31989
- return 'Unknown objective';
31990
- }
31991
- }).join('; ');
31992
- } catch (error) {
31993
- console.error('Error formatting objectives:', error);
31994
- return 'Error formatting objectives';
31995
- }
31996
- };
31997
- var formatRewards = function formatRewards(rewards) {
31998
- try {
31999
- if (!rewards || !Array.isArray(rewards)) return 'No rewards';
32000
- return rewards.map(function (reward) {
32001
- var _reward$itemKeys, _reward$spellKeys;
32002
- var itemKeysFormatted = reward == null ? void 0 : (_reward$itemKeys = reward.itemKeys) == null ? void 0 : _reward$itemKeys.map(function (itemKey) {
32003
- return itemKey && (reward == null ? void 0 : reward.qty) !== undefined ? itemKey + " x" + reward.qty : '';
32004
- }).filter(Boolean).join(', ');
32005
- var spellKeysFormatted = reward == null ? void 0 : (_reward$spellKeys = reward.spellKeys) == null ? void 0 : _reward$spellKeys.filter(Boolean).join(', ');
32006
- var formattedReward = itemKeysFormatted ? "" + formatText(itemKeysFormatted) : '';
32007
- if (spellKeysFormatted) {
32008
- return formattedReward ? formattedReward + ", Spells: " + formatText(spellKeysFormatted) : "Spells: " + formatText(spellKeysFormatted);
32009
- }
32010
- return formattedReward || 'No rewards';
32011
- }).filter(Boolean).join('; ');
32012
- } catch (error) {
32013
- console.error("Error formatting rewards: " + JSON.stringify(rewards) + ":", error);
32014
- return 'Error on rewards';
32015
- }
32016
- };
31976
+ // const formatObjectives = (
31977
+ // objectives: (IQuestObjectiveKill | IQuestObjectiveInteraction)[]
31978
+ // ) => {
31979
+ // try {
31980
+ // if (!objectives || !Array.isArray(objectives)) return '';
31981
+ // return objectives
31982
+ // .map(objective => {
31983
+ // if ('killCountTarget' in objective) {
31984
+ // const killObjective = objective as IQuestObjectiveKill;
31985
+ // return `Kill ${formatText(
31986
+ // killObjective.creatureKeys?.join(', ') ?? ''
31987
+ // )}: ${killObjective.killCount ?? 0}/${killObjective.killCountTarget ??
31988
+ // 0}`;
31989
+ // } else if ('targetNPCkey' in objective) {
31990
+ // const interactionObjective = objective as IQuestObjectiveInteraction;
31991
+ // return `Interact with NPC: ${formatText(
31992
+ // interactionObjective.targetNPCkey ?? ''
31993
+ // )}`;
31994
+ // } else {
31995
+ // return '';
31996
+ // }
31997
+ // })
31998
+ // .filter(Boolean)
31999
+ // .join('; ');
32000
+ // } catch (error) {
32001
+ // console.error('Error formatting objectives:', error);
32002
+ // return '';
32003
+ // }
32004
+ // };
32005
+ // const formatRewards = (rewards: IQuest['rewards']) => {
32006
+ // try {
32007
+ // if (!rewards || !Array.isArray(rewards)) return '';
32008
+ // return rewards
32009
+ // .map(reward => {
32010
+ // const itemKeysFormatted = reward?.itemKeys
32011
+ // ?.map(itemKey =>
32012
+ // itemKey && reward?.qty !== undefined
32013
+ // ? `${itemKey} x${reward.qty}`
32014
+ // : ''
32015
+ // )
32016
+ // .filter(Boolean)
32017
+ // .join(', ');
32018
+ // const spellKeysFormatted = reward?.spellKeys
32019
+ // ?.filter(Boolean)
32020
+ // .join(', ');
32021
+ // const formattedReward = itemKeysFormatted
32022
+ // ? `${formatText(itemKeysFormatted)}`
32023
+ // : '';
32024
+ // if (spellKeysFormatted) {
32025
+ // return formattedReward
32026
+ // ? `${formattedReward}, Spells: ${formatText(spellKeysFormatted)}`
32027
+ // : `Spells: ${formatText(spellKeysFormatted)}`;
32028
+ // }
32029
+ // return formattedReward || '';
32030
+ // })
32031
+ // .filter(Boolean)
32032
+ // .join('; ');
32033
+ // } catch (error) {
32034
+ // console.error(
32035
+ // `Error formatting rewards: ${JSON.stringify(rewards)}:`,
32036
+ // error
32037
+ // );
32038
+ // return '';
32039
+ // }
32040
+ // };
32017
32041
  var formatText = function formatText(text) {
32018
- if (!text) return 'Unknown';
32042
+ if (!text) return '';
32019
32043
  return text.split('-').map(function (word) {
32020
32044
  return word.charAt(0).toUpperCase() + word.slice(1);
32021
32045
  }).join(' ');
@@ -32033,7 +32057,7 @@ var getStatusColor = function getStatusColor(status) {
32033
32057
  }
32034
32058
  };
32035
32059
  var formatStatus = function formatStatus(status) {
32036
- if (!status) return 'Unknown';
32060
+ if (!status) return '';
32037
32061
  return status.split(/(?=[A-Z])/).join(' ').replace(/^\w/, function (c) {
32038
32062
  return c.toUpperCase();
32039
32063
  });