@rpg-engine/long-bow 0.2.8 → 0.2.9

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.
@@ -27073,13 +27073,19 @@ var img$8 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCA
27073
27073
  var QuestInfo = function QuestInfo(_ref) {
27074
27074
  var quests = _ref.quests,
27075
27075
  onClose = _ref.onClose,
27076
- button = _ref.button;
27076
+ buttons = _ref.buttons,
27077
+ onChangeQuest = _ref.onChangeQuest;
27077
27078
 
27078
27079
  var _useState = useState(0),
27079
27080
  currentIndex = _useState[0],
27080
27081
  setCurrentIndex = _useState[1];
27081
27082
 
27082
27083
  var questsLength = quests.length - 1;
27084
+ useEffect(function () {
27085
+ if (onChangeQuest) {
27086
+ onChangeQuest(currentIndex, quests[currentIndex]._id);
27087
+ }
27088
+ }, [currentIndex]);
27083
27089
 
27084
27090
  var onLeftClick = function onLeftClick() {
27085
27091
  if (currentIndex === 0) setCurrentIndex(questsLength);else setCurrentIndex(function (index) {
@@ -27113,16 +27119,16 @@ var QuestInfo = function QuestInfo(_ref) {
27113
27119
  }))), React.createElement(Content, null, React.createElement("p", null, quests[currentIndex].description)), React.createElement(QuestColumn, {
27114
27120
  className: "dark-background",
27115
27121
  justifyContent: "flex-end"
27116
- }, button && button.map(function (item, index) {
27122
+ }, buttons && buttons.map(function (button, index) {
27117
27123
  return React.createElement(Button, {
27118
27124
  key: index,
27119
27125
  onClick: function onClick() {
27120
- return item.onClick(quests[currentIndex]._id, quests[currentIndex].npcId);
27126
+ return button.onClick(quests[currentIndex]._id, quests[currentIndex].npcId);
27121
27127
  },
27122
- disabled: item.disabled,
27128
+ disabled: button.disabled,
27123
27129
  buttonType: ButtonTypes.RPGUIButton,
27124
27130
  id: "button-" + index
27125
- }, item.title);
27131
+ }, button.title);
27126
27132
  })))) : React.createElement(QuestsContainer, null, React.createElement(QuestContainer, null, React.createElement(TitleContainer$1, {
27127
27133
  className: "drag-handler"
27128
27134
  }, React.createElement(Title$1, null, React.createElement(Thumbnail, {
@@ -27132,16 +27138,16 @@ var QuestInfo = function QuestInfo(_ref) {
27132
27138
  }))), React.createElement(Content, null, React.createElement("p", null, quests[0].description)), React.createElement(QuestColumn, {
27133
27139
  className: "dark-background",
27134
27140
  justifyContent: "flex-end"
27135
- }, button && button.map(function (item, index) {
27141
+ }, buttons && buttons.map(function (button, index) {
27136
27142
  return React.createElement(Button, {
27137
27143
  key: index,
27138
27144
  onClick: function onClick() {
27139
- return item.onClick(quests[0]._id, quests[0].npcId);
27145
+ return button.onClick(quests[0]._id, quests[0].npcId);
27140
27146
  },
27141
- disabled: item.disabled,
27147
+ disabled: button.disabled,
27142
27148
  buttonType: ButtonTypes.RPGUIButton,
27143
27149
  id: "button-" + index
27144
- }, item.title);
27150
+ }, button.title);
27145
27151
  })))));
27146
27152
  };
27147
27153
  var QuestDraggableContainer = /*#__PURE__*/styled(DraggableContainer).withConfig({