@rpg-engine/long-bow 0.7.13 → 0.7.14
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/dist/components/Quests/QuestList.d.ts +11 -1
- package/dist/long-bow.cjs.development.js +25 -73
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +23 -74
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Quests/QuestList.tsx +24 -87
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import { IQuest } from '@rpg-engine/shared';
|
|
1
|
+
import { IQuest, QuestStatus } from '@rpg-engine/shared';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { CSSProperties } from 'styled-components';
|
|
3
4
|
export interface IQuestListProps {
|
|
4
5
|
quests?: IQuest[];
|
|
6
|
+
styles?: {
|
|
7
|
+
container?: CSSProperties;
|
|
8
|
+
card?: CSSProperties;
|
|
9
|
+
label?: CSSProperties;
|
|
10
|
+
value?: CSSProperties;
|
|
11
|
+
};
|
|
5
12
|
}
|
|
6
13
|
export declare const QuestList: React.FC<IQuestListProps>;
|
|
14
|
+
export declare const formatText: (text: string) => string;
|
|
15
|
+
export declare const getStatusColor: (status?: QuestStatus | undefined) => string;
|
|
16
|
+
export declare const formatStatus: (status?: QuestStatus | undefined) => string;
|
|
@@ -31955,22 +31955,36 @@ var Thumbnail = /*#__PURE__*/styled__default.img.withConfig({
|
|
|
31955
31955
|
})(["color:white;z-index:22;width:32px * 1.5;margin-right:0.5rem;position:relative;top:-4px;"]);
|
|
31956
31956
|
|
|
31957
31957
|
var QuestList = function QuestList(_ref) {
|
|
31958
|
-
var quests = _ref.quests
|
|
31959
|
-
|
|
31958
|
+
var quests = _ref.quests,
|
|
31959
|
+
styles = _ref.styles;
|
|
31960
|
+
return React__default.createElement(QuestListContainer, {
|
|
31961
|
+
style: styles == null ? void 0 : styles.container
|
|
31962
|
+
}, quests && quests.length > 0 ? quests.map(function (quest, i) {
|
|
31960
31963
|
var _formatStatus;
|
|
31961
31964
|
return React__default.createElement(QuestCard, {
|
|
31962
|
-
key: i
|
|
31963
|
-
|
|
31964
|
-
|
|
31965
|
+
key: i,
|
|
31966
|
+
style: styles == null ? void 0 : styles.card
|
|
31967
|
+
}, React__default.createElement(QuestItem, null, React__default.createElement(Label, {
|
|
31968
|
+
style: styles == null ? void 0 : styles.label
|
|
31969
|
+
}, "Title:"), React__default.createElement(Value, {
|
|
31970
|
+
style: styles == null ? void 0 : styles.value
|
|
31971
|
+
}, formatText(quest.title))), React__default.createElement(QuestItem, null, React__default.createElement(Label, {
|
|
31972
|
+
style: styles == null ? void 0 : styles.label
|
|
31973
|
+
}, "Status:"), React__default.createElement(Value, {
|
|
31974
|
+
style: _extends({}, styles == null ? void 0 : styles.value, {
|
|
31965
31975
|
color: getStatusColor(quest.status)
|
|
31966
|
-
}
|
|
31967
|
-
}, (_formatStatus = formatStatus(quest.status)) != null ? _formatStatus : 'Unknown')), React__default.createElement(QuestItem, null, React__default.createElement(Label,
|
|
31976
|
+
})
|
|
31977
|
+
}, (_formatStatus = formatStatus(quest.status)) != null ? _formatStatus : 'Unknown')), React__default.createElement(QuestItem, null, React__default.createElement(Label, {
|
|
31978
|
+
style: styles == null ? void 0 : styles.label
|
|
31979
|
+
}, "Description:"), React__default.createElement(Value, {
|
|
31980
|
+
style: styles == null ? void 0 : styles.value
|
|
31981
|
+
}, quest.description)));
|
|
31968
31982
|
}) : React__default.createElement(NoQuestContainer, null, React__default.createElement("p", null, "There are no ongoing quests")));
|
|
31969
31983
|
};
|
|
31970
31984
|
var QuestListContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
31971
31985
|
displayName: "QuestList__QuestListContainer",
|
|
31972
31986
|
componentId: "sc-1c1y8sp-0"
|
|
31973
|
-
})(["
|
|
31987
|
+
})(["max-height:400px;padding:10px;border-radius:10px;font-size:0.7rem;"]);
|
|
31974
31988
|
var QuestCard = /*#__PURE__*/styled__default.div.withConfig({
|
|
31975
31989
|
displayName: "QuestList__QuestCard",
|
|
31976
31990
|
componentId: "sc-1c1y8sp-1"
|
|
@@ -31991,71 +32005,6 @@ var NoQuestContainer = /*#__PURE__*/styled__default.div.withConfig({
|
|
|
31991
32005
|
displayName: "QuestList__NoQuestContainer",
|
|
31992
32006
|
componentId: "sc-1c1y8sp-5"
|
|
31993
32007
|
})(["text-align:center;p{margin-top:5px;color:", ";}"], uiColors.lightGray);
|
|
31994
|
-
// const formatObjectives = (
|
|
31995
|
-
// objectives: (IQuestObjectiveKill | IQuestObjectiveInteraction)[]
|
|
31996
|
-
// ) => {
|
|
31997
|
-
// try {
|
|
31998
|
-
// if (!objectives || !Array.isArray(objectives)) return '';
|
|
31999
|
-
// return objectives
|
|
32000
|
-
// .map(objective => {
|
|
32001
|
-
// if ('killCountTarget' in objective) {
|
|
32002
|
-
// const killObjective = objective as IQuestObjectiveKill;
|
|
32003
|
-
// return `Kill ${formatText(
|
|
32004
|
-
// killObjective.creatureKeys?.join(', ') ?? ''
|
|
32005
|
-
// )}: ${killObjective.killCount ?? 0}/${killObjective.killCountTarget ??
|
|
32006
|
-
// 0}`;
|
|
32007
|
-
// } else if ('targetNPCkey' in objective) {
|
|
32008
|
-
// const interactionObjective = objective as IQuestObjectiveInteraction;
|
|
32009
|
-
// return `Interact with NPC: ${formatText(
|
|
32010
|
-
// interactionObjective.targetNPCkey ?? ''
|
|
32011
|
-
// )}`;
|
|
32012
|
-
// } else {
|
|
32013
|
-
// return '';
|
|
32014
|
-
// }
|
|
32015
|
-
// })
|
|
32016
|
-
// .filter(Boolean)
|
|
32017
|
-
// .join('; ');
|
|
32018
|
-
// } catch (error) {
|
|
32019
|
-
// console.error('Error formatting objectives:', error);
|
|
32020
|
-
// return '';
|
|
32021
|
-
// }
|
|
32022
|
-
// };
|
|
32023
|
-
// const formatRewards = (rewards: IQuest['rewards']) => {
|
|
32024
|
-
// try {
|
|
32025
|
-
// if (!rewards || !Array.isArray(rewards)) return '';
|
|
32026
|
-
// return rewards
|
|
32027
|
-
// .map(reward => {
|
|
32028
|
-
// const itemKeysFormatted = reward?.itemKeys
|
|
32029
|
-
// ?.map(itemKey =>
|
|
32030
|
-
// itemKey && reward?.qty !== undefined
|
|
32031
|
-
// ? `${itemKey} x${reward.qty}`
|
|
32032
|
-
// : ''
|
|
32033
|
-
// )
|
|
32034
|
-
// .filter(Boolean)
|
|
32035
|
-
// .join(', ');
|
|
32036
|
-
// const spellKeysFormatted = reward?.spellKeys
|
|
32037
|
-
// ?.filter(Boolean)
|
|
32038
|
-
// .join(', ');
|
|
32039
|
-
// const formattedReward = itemKeysFormatted
|
|
32040
|
-
// ? `${formatText(itemKeysFormatted)}`
|
|
32041
|
-
// : '';
|
|
32042
|
-
// if (spellKeysFormatted) {
|
|
32043
|
-
// return formattedReward
|
|
32044
|
-
// ? `${formattedReward}, Spells: ${formatText(spellKeysFormatted)}`
|
|
32045
|
-
// : `Spells: ${formatText(spellKeysFormatted)}`;
|
|
32046
|
-
// }
|
|
32047
|
-
// return formattedReward || '';
|
|
32048
|
-
// })
|
|
32049
|
-
// .filter(Boolean)
|
|
32050
|
-
// .join('; ');
|
|
32051
|
-
// } catch (error) {
|
|
32052
|
-
// console.error(
|
|
32053
|
-
// `Error formatting rewards: ${JSON.stringify(rewards)}:`,
|
|
32054
|
-
// error
|
|
32055
|
-
// );
|
|
32056
|
-
// return '';
|
|
32057
|
-
// }
|
|
32058
|
-
// };
|
|
32059
32008
|
var formatText = function formatText(text) {
|
|
32060
32009
|
if (!text) return '';
|
|
32061
32010
|
return text.split('-').map(function (word) {
|
|
@@ -33693,8 +33642,11 @@ exports.Truncate = Truncate;
|
|
|
33693
33642
|
exports.TutorialStepper = TutorialStepper;
|
|
33694
33643
|
exports.UserActionLink = UserActionLink;
|
|
33695
33644
|
exports._RPGUI = _RPGUI;
|
|
33645
|
+
exports.formatStatus = formatStatus;
|
|
33646
|
+
exports.formatText = formatText;
|
|
33696
33647
|
exports.getMockedPlayersRowsLeader = getMockedPlayersRowsLeader;
|
|
33697
33648
|
exports.getMockedPlayersRowsNotLeader = getMockedPlayersRowsNotLeader;
|
|
33649
|
+
exports.getStatusColor = getStatusColor;
|
|
33698
33650
|
exports.mockedPartyManager = mockedPartyManager;
|
|
33699
33651
|
exports.mockedPartyRows = mockedPartyRows;
|
|
33700
33652
|
exports.mockedPlayersRows = mockedPlayersRows;
|