@rpg-engine/long-bow 0.1.99 → 0.2.0
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/Item/Inventory/itemContainerHelper.d.ts +1 -4
- package/dist/long-bow.cjs.development.js +23 -41
- 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 -41
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Item/Inventory/ItemSlot.tsx +2 -2
- package/src/components/Item/Inventory/itemContainerHelper.ts +45 -99
- package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +0 -2
package/dist/long-bow.esm.js
CHANGED
|
@@ -5799,16 +5799,7 @@ var Container$5 = /*#__PURE__*/styled.div.withConfig({
|
|
|
5799
5799
|
componentId: "sc-11d9r7x-0"
|
|
5800
5800
|
})(["z-index:2;position:absolute;top:1rem;left:4rem;font-size:0.5rem;color:white;background-color:black;border-radius:5px;padding:0.5rem;min-width:20px;width:100%;text-align:center;opacity:0.75;"]);
|
|
5801
5801
|
|
|
5802
|
-
var
|
|
5803
|
-
|
|
5804
|
-
(function (SlotContainerType) {
|
|
5805
|
-
SlotContainerType["INVENTORY"] = "Inventory";
|
|
5806
|
-
SlotContainerType["EQUIPMENT_SET"] = "EquipmentSet";
|
|
5807
|
-
SlotContainerType["LOOT"] = "Loot";
|
|
5808
|
-
SlotContainerType["MAP_CONTAINER"] = "Map-Container";
|
|
5809
|
-
})(SlotContainerType || (SlotContainerType = {}));
|
|
5810
|
-
|
|
5811
|
-
var generateContextList = function generateContextList(actionsByTypeList) {
|
|
5802
|
+
var generateContextMenuListOptions = function generateContextMenuListOptions(actionsByTypeList) {
|
|
5812
5803
|
var contextMenu = actionsByTypeList.map(function (action) {
|
|
5813
5804
|
return {
|
|
5814
5805
|
id: action,
|
|
@@ -5818,7 +5809,7 @@ var generateContextList = function generateContextList(actionsByTypeList) {
|
|
|
5818
5809
|
return contextMenu;
|
|
5819
5810
|
};
|
|
5820
5811
|
|
|
5821
|
-
var
|
|
5812
|
+
var generateContextMenu = function generateContextMenu(itemType, itemContainerType) {
|
|
5822
5813
|
var contextActionMenu = [];
|
|
5823
5814
|
|
|
5824
5815
|
if (itemContainerType === ItemContainerType.Inventory) {
|
|
@@ -5828,37 +5819,29 @@ var handleNewContextMenu = function handleNewContextMenu(itemType, itemContainer
|
|
|
5828
5819
|
case ItemType.Accessory:
|
|
5829
5820
|
case ItemType.Jewelry:
|
|
5830
5821
|
case ItemType.Container:
|
|
5831
|
-
contextActionMenu =
|
|
5822
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Equipment);
|
|
5832
5823
|
break;
|
|
5833
5824
|
|
|
5834
5825
|
case ItemType.Consumable:
|
|
5835
|
-
contextActionMenu =
|
|
5826
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Consumable);
|
|
5836
5827
|
break;
|
|
5837
5828
|
|
|
5838
5829
|
case ItemType.CraftMaterial:
|
|
5839
|
-
contextActionMenu =
|
|
5830
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForInventory.CraftMaterial);
|
|
5840
5831
|
break;
|
|
5841
5832
|
|
|
5842
5833
|
case ItemType.Tool:
|
|
5843
|
-
contextActionMenu =
|
|
5834
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Tool);
|
|
5844
5835
|
break;
|
|
5845
5836
|
|
|
5846
|
-
|
|
5847
|
-
contextActionMenu =
|
|
5837
|
+
default:
|
|
5838
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForInventory.Other);
|
|
5848
5839
|
break;
|
|
5849
5840
|
}
|
|
5850
5841
|
}
|
|
5851
5842
|
|
|
5852
5843
|
if (itemContainerType === ItemContainerType.Equipment) {
|
|
5853
|
-
|
|
5854
|
-
case ItemType.Weapon:
|
|
5855
|
-
case ItemType.Armor:
|
|
5856
|
-
case ItemType.Accessory:
|
|
5857
|
-
case ItemType.Jewelry:
|
|
5858
|
-
case ItemType.Container:
|
|
5859
|
-
contextActionMenu = generateContextList(ActionsForEquipmentSet.Equipment);
|
|
5860
|
-
break;
|
|
5861
|
-
}
|
|
5844
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForEquipmentSet.Equipment);
|
|
5862
5845
|
}
|
|
5863
5846
|
|
|
5864
5847
|
if (itemContainerType === ItemContainerType.Loot) {
|
|
@@ -5867,23 +5850,23 @@ var handleNewContextMenu = function handleNewContextMenu(itemType, itemContainer
|
|
|
5867
5850
|
case ItemType.Armor:
|
|
5868
5851
|
case ItemType.Accessory:
|
|
5869
5852
|
case ItemType.Jewelry:
|
|
5870
|
-
contextActionMenu =
|
|
5853
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Equipment);
|
|
5871
5854
|
break;
|
|
5872
5855
|
|
|
5873
5856
|
case ItemType.Consumable:
|
|
5874
|
-
contextActionMenu =
|
|
5857
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Consumable);
|
|
5875
5858
|
break;
|
|
5876
5859
|
|
|
5877
5860
|
case ItemType.CraftMaterial:
|
|
5878
|
-
contextActionMenu =
|
|
5861
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForLoot.CraftMaterial);
|
|
5879
5862
|
break;
|
|
5880
5863
|
|
|
5881
5864
|
case ItemType.Tool:
|
|
5882
|
-
contextActionMenu =
|
|
5865
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Tool);
|
|
5883
5866
|
break;
|
|
5884
5867
|
|
|
5885
|
-
|
|
5886
|
-
contextActionMenu =
|
|
5868
|
+
default:
|
|
5869
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Other);
|
|
5887
5870
|
break;
|
|
5888
5871
|
}
|
|
5889
5872
|
}
|
|
@@ -5894,23 +5877,23 @@ var handleNewContextMenu = function handleNewContextMenu(itemType, itemContainer
|
|
|
5894
5877
|
case ItemType.Armor:
|
|
5895
5878
|
case ItemType.Accessory:
|
|
5896
5879
|
case ItemType.Jewelry:
|
|
5897
|
-
contextActionMenu =
|
|
5880
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Equipment);
|
|
5898
5881
|
break;
|
|
5899
5882
|
|
|
5900
5883
|
case ItemType.Consumable:
|
|
5901
|
-
contextActionMenu =
|
|
5884
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Consumable);
|
|
5902
5885
|
break;
|
|
5903
5886
|
|
|
5904
5887
|
case ItemType.CraftMaterial:
|
|
5905
|
-
contextActionMenu =
|
|
5888
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.CraftMaterial);
|
|
5906
5889
|
break;
|
|
5907
5890
|
|
|
5908
5891
|
case ItemType.Tool:
|
|
5909
|
-
contextActionMenu =
|
|
5892
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Tool);
|
|
5910
5893
|
break;
|
|
5911
5894
|
|
|
5912
|
-
|
|
5913
|
-
contextActionMenu =
|
|
5895
|
+
default:
|
|
5896
|
+
contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Other);
|
|
5914
5897
|
break;
|
|
5915
5898
|
}
|
|
5916
5899
|
}
|
|
@@ -5954,7 +5937,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
5954
5937
|
|
|
5955
5938
|
useEffect(function () {
|
|
5956
5939
|
if (item) {
|
|
5957
|
-
setContextActions(
|
|
5940
|
+
setContextActions(generateContextMenu(item.type, containerType));
|
|
5958
5941
|
}
|
|
5959
5942
|
}, [item]);
|
|
5960
5943
|
|
|
@@ -6422,8 +6405,7 @@ var QuestionDialog = function QuestionDialog(_ref) {
|
|
|
6422
6405
|
var nextAnswerIndex = onGetAnswers(currentQuestion.answerIds).findIndex(function (answer) {
|
|
6423
6406
|
return (answer == null ? void 0 : answer.id) === currentAnswer.id + 1;
|
|
6424
6407
|
});
|
|
6425
|
-
var nextAnswerID = currentQuestion.answerIds[nextAnswerIndex];
|
|
6426
|
-
|
|
6408
|
+
var nextAnswerID = currentQuestion.answerIds[nextAnswerIndex];
|
|
6427
6409
|
var nextAnswer = onGetAnswers(currentQuestion.answerIds).find(function (answer) {
|
|
6428
6410
|
return (answer == null ? void 0 : answer.id) === nextAnswerID;
|
|
6429
6411
|
});
|