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