@rpg-engine/long-bow 0.2.50 → 0.2.52

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.2.50",
3
+ "version": "0.2.52",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  "dependencies": {
85
85
  "@rollup/plugin-image": "^2.1.1",
86
- "@rpg-engine/shared": "^0.5.74",
86
+ "@rpg-engine/shared": "^0.5.82",
87
87
  "dayjs": "^1.11.2",
88
88
  "fs-extra": "^10.1.0",
89
89
  "lodash": "^4.17.21",
@@ -18,6 +18,7 @@ export interface IItemContainerProps {
18
18
  type: ItemContainerType;
19
19
  atlasJSON: any;
20
20
  atlasIMG: any;
21
+ disableContextMenu?: boolean;
21
22
  }
22
23
 
23
24
  export const ItemContainer: React.FC<IItemContainerProps> = ({
@@ -29,6 +30,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
29
30
  type,
30
31
  atlasJSON,
31
32
  atlasIMG,
33
+ disableContextMenu = false,
32
34
  }) => {
33
35
  const onRenderSlots = () => {
34
36
  const slots = [];
@@ -36,6 +38,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
36
38
  for (let i = 0; i < itemContainer.slotQty; i++) {
37
39
  slots.push(
38
40
  <ItemSlot
41
+ isContextMenuDisabled={disableContextMenu}
39
42
  key={i}
40
43
  slotIndex={i}
41
44
  item={itemContainer.slots?.[i] || null}
@@ -54,6 +54,7 @@ interface IProps {
54
54
  ) => void;
55
55
  atlasJSON: any;
56
56
  atlasIMG: any;
57
+ isContextMenuDisabled?: boolean;
57
58
  }
58
59
 
59
60
  export const ItemSlot: React.FC<IProps> = observer(
@@ -68,6 +69,7 @@ export const ItemSlot: React.FC<IProps> = observer(
68
69
  onSelected,
69
70
  atlasJSON,
70
71
  atlasIMG,
72
+ isContextMenuDisabled = false,
71
73
  }) => {
72
74
  const [isTooltipVisible, setTooltipVisible] = useState(false);
73
75
 
@@ -207,7 +209,7 @@ export const ItemSlot: React.FC<IProps> = observer(
207
209
  }
208
210
  }}
209
211
  >
210
- {isContextMenuVisible && contextActions && (
212
+ {!isContextMenuDisabled && isContextMenuVisible && contextActions && (
211
213
  <RelativeListMenu
212
214
  options={contextActions}
213
215
  onSelected={(optionId: string) => {
@@ -142,6 +142,14 @@ export const generateContextMenu = (
142
142
  );
143
143
  break;
144
144
  }
145
+
146
+ const contextActionMenuDontHaveUseWith = !contextActionMenu.find(action =>
147
+ action.text.toLowerCase().includes('use with')
148
+ );
149
+
150
+ if (item.hasUseWith && contextActionMenuDontHaveUseWith) {
151
+ contextActionMenu.push({ id: 'use-with', text: 'Use with...' });
152
+ }
145
153
  }
146
154
 
147
155
  return contextActionMenu;
@@ -26,6 +26,10 @@ export const DayNightPeriod: React.FC<IPeriodOfDayDisplayProps> = ({
26
26
  );
27
27
  };
28
28
 
29
- const GifContainer = styled.span`
29
+ const GifContainer = styled.div`
30
30
  width: 100%;
31
+
32
+ img {
33
+ width: 67%;
34
+ }
31
35
  `;
@@ -33,31 +33,30 @@ export const TimeWidget: React.FC<IClockWidgetProps> = ({
33
33
 
34
34
  const WidgetContainer = styled.div`
35
35
  background-image: url(${ClockWidgetImg});
36
+ background-size: 10rem;
36
37
  background-repeat: no-repeat;
37
- width: 100%;
38
+ width: 10rem;
38
39
  position: absolute;
39
- margin: 20px;
40
40
  `;
41
41
 
42
42
  const Time = styled.div`
43
- width: 100%;
44
- top: -6.95rem;
45
- right: -4.4rem;
46
- position: relative;
47
- font-size: 7.5px;
43
+ top: 0.75rem;
44
+ right: 0.5rem;
45
+ position: absolute;
46
+ font-size: ${uiFonts.size.small};
48
47
  color: white;
49
48
  `;
50
49
 
51
50
  const CloseButton = styled.p`
52
- width: 100%;
53
- position: relative;
54
- top: -1rem;
55
- right: -6.9rem;
56
- font-size: ${uiFonts.size.xxsmall} !important;
51
+ position: absolute;
52
+ top: -0.5rem;
53
+ margin: 0;
54
+ right: -0.2rem;
55
+ font-size: ${uiFonts.size.small} !important;
57
56
  z-index: 1;
58
57
  `;
59
- const DayNightContainer = styled.span`
60
- top: -41px;
61
- left: -3px;
62
- position: relative;
58
+
59
+ const DayNightContainer = styled.div`
60
+ margin-top: -0.3rem;
61
+ margin-left: -0.3rem;
63
62
  `;