minecraft-inventory 0.1.18 → 0.1.19
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
|
@@ -113,9 +113,10 @@ export function HotbarExtras({ showOffhand, container, offhandItem }: HotbarExtr
|
|
|
113
113
|
style={{
|
|
114
114
|
position: 'absolute',
|
|
115
115
|
left: -(24 + GAP) * scale,
|
|
116
|
-
top:
|
|
116
|
+
top: -1 * scale,
|
|
117
117
|
width: 24 * scale,
|
|
118
|
-
height:
|
|
118
|
+
height: 24 * scale,
|
|
119
|
+
pointerEvents: 'auto',
|
|
119
120
|
}}
|
|
120
121
|
>
|
|
121
122
|
<WidgetSprite
|
|
@@ -123,12 +124,12 @@ export function HotbarExtras({ showOffhand, container, offhandItem }: HotbarExtr
|
|
|
123
124
|
srcX={24}
|
|
124
125
|
srcY={22}
|
|
125
126
|
srcW={24}
|
|
126
|
-
srcH={
|
|
127
|
+
srcH={24}
|
|
127
128
|
scale={scale}
|
|
128
129
|
style={{ left: 0, top: 0 }}
|
|
129
130
|
/>
|
|
130
131
|
{/* Item at slot 45 (offhand) */}
|
|
131
|
-
<div style={{ position: 'absolute', top:
|
|
132
|
+
<div style={{ position: 'absolute', top: 4 * scale, left: 3 * scale }}>
|
|
132
133
|
<Slot index={45} item={offhandItem} size={16 * scale} noBackground />
|
|
133
134
|
</div>
|
|
134
135
|
</div>
|
|
@@ -142,19 +143,25 @@ export function HotbarExtras({ showOffhand, container, offhandItem }: HotbarExtr
|
|
|
142
143
|
style={{
|
|
143
144
|
position: 'absolute',
|
|
144
145
|
left: (182 + GAP) * scale,
|
|
145
|
-
top:
|
|
146
|
+
top: -1 * scale,
|
|
146
147
|
width: 24 * scale,
|
|
147
|
-
height:
|
|
148
|
+
height: 24 * scale,
|
|
148
149
|
cursor: 'pointer',
|
|
150
|
+
pointerEvents: 'auto',
|
|
149
151
|
}}
|
|
150
152
|
onClick={() => sendAction({ type: 'open-inventory' })}
|
|
153
|
+
onTouchEnd={(e) => {
|
|
154
|
+
e.stopPropagation()
|
|
155
|
+
e.preventDefault()
|
|
156
|
+
sendAction({ type: 'open-inventory' })
|
|
157
|
+
}}
|
|
151
158
|
>
|
|
152
159
|
<WidgetSprite
|
|
153
160
|
url={hotbarUrl}
|
|
154
161
|
srcX={24}
|
|
155
162
|
srcY={22}
|
|
156
163
|
srcW={24}
|
|
157
|
-
srcH={
|
|
164
|
+
srcH={24}
|
|
158
165
|
scale={scale}
|
|
159
166
|
style={{ left: 0, top: 0 }}
|
|
160
167
|
/>
|
|
@@ -165,7 +172,7 @@ export function HotbarExtras({ showOffhand, container, offhandItem }: HotbarExtr
|
|
|
165
172
|
style={{
|
|
166
173
|
position: 'absolute',
|
|
167
174
|
left: (6 + i * 4) * scale,
|
|
168
|
-
top:
|
|
175
|
+
top: 11 * scale,
|
|
169
176
|
width: 2 * scale,
|
|
170
177
|
height: 2 * scale,
|
|
171
178
|
background: 'white',
|
|
@@ -94,6 +94,7 @@ export function InventoryWindow({
|
|
|
94
94
|
// Offset by borderPx to land inside the texture's slot cell (skip the 1px border)
|
|
95
95
|
left: slotDef.x * scale + borderPx,
|
|
96
96
|
top: slotDef.y * scale + borderPx,
|
|
97
|
+
...(isHotbar ? { pointerEvents: 'none' as const } : {}),
|
|
97
98
|
}}
|
|
98
99
|
>
|
|
99
100
|
<Slot
|