@rpg-engine/long-bow 0.2.21 → 0.2.23

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.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { NPCMultiDialogType } from './NPCDialog/NPCMultiDialog';
3
3
  import { IQuestionDialog, IQuestionDialogAnswer } from './NPCDialog/QuestionDialog/QuestionDialog';
4
4
  export interface IHistoryDialogProps {
5
- backgroundImgPath: string;
5
+ backgroundImgPath: string[];
6
6
  fullCoverBackground: boolean;
7
7
  questions?: IQuestionDialog[];
8
8
  answers?: IQuestionDialogAnswer[];
@@ -1,7 +1,7 @@
1
1
  import { IQuest } from '@rpg-engine/shared';
2
2
  import React from 'react';
3
3
  export interface IQuestListProps {
4
- quests: IQuest[];
4
+ quests?: IQuest[];
5
5
  onClose: () => void;
6
6
  }
7
7
  export declare const QuestList: React.FC<IQuestListProps>;
@@ -28396,7 +28396,7 @@ var QuestList = function QuestList(_ref) {
28396
28396
  }
28397
28397
  }, React__default.createElement(Title$2, null, "Quests"), React__default.createElement("hr", {
28398
28398
  className: "golden"
28399
- }), React__default.createElement(QuestListContainer, null, quests.map(function (quest, i) {
28399
+ }), React__default.createElement(QuestListContainer, null, quests ? quests.map(function (quest, i) {
28400
28400
  return React__default.createElement("div", {
28401
28401
  className: "quest-item",
28402
28402
  key: i
@@ -28409,7 +28409,7 @@ var QuestList = function QuestList(_ref) {
28409
28409
  }, quest.title), React__default.createElement("p", {
28410
28410
  className: "quest-detail__description"
28411
28411
  }, quest.description)));
28412
- }))));
28412
+ }) : React__default.createElement(NoQuestContainer, null, React__default.createElement("p", null, "There are no ongoing quests")))));
28413
28413
  };
28414
28414
  var QuestDraggableContainer$1 = /*#__PURE__*/styled(DraggableContainer).withConfig({
28415
28415
  displayName: "QuestList__QuestDraggableContainer",
@@ -28422,7 +28422,11 @@ var Title$2 = /*#__PURE__*/styled.h1.withConfig({
28422
28422
  var QuestListContainer = /*#__PURE__*/styled.div.withConfig({
28423
28423
  displayName: "QuestList__QuestListContainer",
28424
28424
  componentId: "sc-1a2vx6q-2"
28425
- })(["margin-top:20px;margin-bottom:40px;overflow-y:auto;max-height:400px;.quest-item{display:flex;align-items:flex-start;margin-bottom:12px;}.quest-number{border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;margin-right:16px;background-color:brown;flex-shrink:0;}.quest-number.completed{background-color:yellow;}p{margin:0;}.quest-detail__title{color:yellow;}.quest-detail__description{margin-top:5px;}"]);
28425
+ })(["margin-top:20px;margin-bottom:40px;overflow-y:auto;max-height:400px;.quest-item{display:flex;align-items:flex-start;margin-bottom:12px;}.quest-number{border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;margin-right:16px;background-color:brown;flex-shrink:0;}.quest-number.completed{background-color:yellow;}p{margin:0;}.quest-detail__title{color:yellow;}.quest-detail__description{margin-top:5px;}.Noquest-detail__description{margin-top:5px;margin:auto;}"]);
28426
+ var NoQuestContainer = /*#__PURE__*/styled.div.withConfig({
28427
+ displayName: "QuestList__NoQuestContainer",
28428
+ componentId: "sc-1a2vx6q-3"
28429
+ })(["text-align:center;p{margin-top:5px;}"]);
28426
28430
 
28427
28431
  var InputRadio = function InputRadio(_ref) {
28428
28432
  var name = _ref.name,
@@ -28836,8 +28840,32 @@ var HistoryDialog = function HistoryDialog(_ref) {
28836
28840
  imagePath = _ref.imagePath,
28837
28841
  textAndTypeArray = _ref.textAndTypeArray,
28838
28842
  onClose = _ref.onClose;
28843
+
28844
+ var _useState = React.useState(0),
28845
+ img = _useState[0],
28846
+ setImage = _useState[1];
28847
+
28848
+ var onHandleSpacePress = function onHandleSpacePress(event) {
28849
+ if (event.code === 'Space') {
28850
+ if (img < (backgroundImgPath == null ? void 0 : backgroundImgPath.length) - 1) {
28851
+ setImage(function (prev) {
28852
+ return prev + 1;
28853
+ });
28854
+ } else {
28855
+ // if there's no more text chunks, close the dialog
28856
+ onClose();
28857
+ }
28858
+ }
28859
+ };
28860
+
28861
+ React.useEffect(function () {
28862
+ document.addEventListener('keydown', onHandleSpacePress);
28863
+ return function () {
28864
+ return document.removeEventListener('keydown', onHandleSpacePress);
28865
+ };
28866
+ }, [backgroundImgPath]);
28839
28867
  return React__default.createElement(BackgroundContainer, {
28840
- imgPath: backgroundImgPath,
28868
+ imgPath: backgroundImgPath[img],
28841
28869
  fullImg: fullCoverBackground
28842
28870
  }, React__default.createElement(DialogContainer, null, textAndTypeArray ? React__default.createElement(NPCMultiDialog, {
28843
28871
  textAndTypeArray: textAndTypeArray,