BlueGit

timfa questward

Polish CE sell/buy UI and strip-union table corner sprites.

Sell uses the bag grid with a clickable market-price hint; buy search no longer opens chat; table L/T bends keep concave corners for line tables.

timfa Tim Falken · pushed by timfa

Authored 2026-08-25 · 2 months ago

Hash
259c26297a1a393cc19ead77eb1c37e33209ddd2
Parent
2b34e2dd
23 files changed +265 −108
client/assets/blocks/table/0.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/1.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/10.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/11.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/12.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/13.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/14.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/15.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/2.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/3.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/4.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/5.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/6.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/7.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/8.png Binary file +0 −0

The contents of this binary file are not shown.

client/assets/blocks/table/9.png Binary file +0 −0

The contents of this binary file are not shown.

client/index.html +5 −2
@@ -237,7 +237,7 @@
237 237 <div id="market-orders"></div>
238 238 </section>
239 239 <section id="market-pane-sell" class="market-pane" data-pane="sell" hidden>
240 <div id="market-sell-list" class="market-sell-list"></div>
240 <div id="market-sell-list" class="item-grid"></div>
241 241 <p id="market-sell-selected" class="hint">Select an item from your bag</p>
242 242 <label class="send-row">Quantity
243 243 <input id="market-sell-qty" type="number" min="1" step="1" value="1">
@@ -246,7 +246,10 @@
246 246 <input id="market-sell-min" type="number" min="1" step="1" value="1">
247 247 </label>
248 248 <p id="market-sell-fee" class="hint"></p>
249 <button id="market-sell-confirm" type="button">Place sell order</button>
249 <div class="market-sell-actions">
250 <button id="market-sell-confirm" type="button">Place sell order</button>
251 <button id="market-sell-suggest" type="button" class="market-price-suggest" hidden></button>
252 </div>
250 253 </section>
251 254 <section id="market-pane-buy" class="market-pane" data-pane="buy" hidden>
252 255 <label class="send-row">Search items
@@ -237,7 +237,7 @@
237 <div id="market-orders"></div>
237 <div id="market-orders"></div>
238 </section>
238 </section>
239 <section id="market-pane-sell" class="market-pane" data-pane="sell" hidden>
239 <section id="market-pane-sell" class="market-pane" data-pane="sell" hidden>
240 <div id="market-sell-list" class="market-sell-list"></div>
240 <div id="market-sell-list" class="item-grid"></div>
241 <p id="market-sell-selected" class="hint">Select an item from your bag</p>
241 <p id="market-sell-selected" class="hint">Select an item from your bag</p>
242 <label class="send-row">Quantity
242 <label class="send-row">Quantity
243 <input id="market-sell-qty" type="number" min="1" step="1" value="1">
243 <input id="market-sell-qty" type="number" min="1" step="1" value="1">
@@ -246,7 +246,10 @@
246 <input id="market-sell-min" type="number" min="1" step="1" value="1">
246 <input id="market-sell-min" type="number" min="1" step="1" value="1">
247 </label>
247 </label>
248 <p id="market-sell-fee" class="hint"></p>
248 <p id="market-sell-fee" class="hint"></p>
249 <button id="market-sell-confirm" type="button">Place sell order</button>
249 <div class="market-sell-actions">
250 <button id="market-sell-confirm" type="button">Place sell order</button>
251 <button id="market-sell-suggest" type="button" class="market-price-suggest" hidden></button>
252 </div>
250 </section>
253 </section>
251 <section id="market-pane-buy" class="market-pane" data-pane="buy" hidden>
254 <section id="market-pane-buy" class="market-pane" data-pane="buy" hidden>
252 <label class="send-row">Search items
255 <label class="send-row">Search items
client/scripts/generate-table-sprites.mjs +102 −50
@@ -1,8 +1,12 @@
1 1 /**
2 2 * Generate 16×16 magenta table PNGs for neighbor-connect masks 0–15.
3 * Reads the artist `wood.png`, remaps browns → magenta (tintable), then
4 * extends the tabletop along connected cardinals (no diagonals).
5 * Legs stay on free south edges; extra legs appear on long spans.
3 *
4 * Geometry is a **strip union** (horizontal bar ∪ vertical bar), so L/T/+ bends
5 * keep a concave inner corner instead of filling the AABB. Straight runs stay
6 * one tile wide. Future filled rectangles (2×3, etc.) can add alternate corner
7 * sprites keyed by diagonal neighbors without changing these line pieces.
8 *
9 * Legs stay on free south edges of the footprint.
6 10 */
7 11 import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
8 12 import { deflateSync, inflateSync } from "node:zlib";
@@ -147,6 +151,18 @@ function setPx (rgba, x, y, color)
147 151 rgba[i + 3] = color[3];
148 152 }
149 153
154 function isAlreadyMagenta (rgba)
155 {
156 for (let i = 0; i < rgba.length; i += 4)
157 {
158 if (rgba[i + 3] < 8)
159 { continue; }
160 if (Math.abs(rgba[i] - rgba[i + 2]) > 2 || rgba[i + 1] >= rgba[i])
161 { return false; }
162 }
163 return true;
164 }
165
150 166 /** Remap any opaque pixel into the magenta tint family (R≈B, G<R). */
151 167 function toMagenta (r, g, b, a)
152 168 {
@@ -155,7 +171,6 @@ function toMagenta (r, g, b, a)
155 171 const L = Math.max(1, Math.max(r, g, b));
156 172 const minC = Math.min(r, g, b);
157 173 const chroma = (L - minC) / 255;
158 // Slight G softens grain; keep rims more saturated (low G).
159 174 const gMag = Math.min(L - 1, Math.round(L * (0.08 + (1 - chroma) * 0.22)));
160 175 return [L, Math.max(0, gMag), L, 255];
161 176 }
@@ -181,9 +196,29 @@ function sampleTop (base, x, y)
181 196 return getPx(base, sx, sy);
182 197 }
183 198
199 /**
200 * Line-table footprint: union of an E–W bar (core height) and an N–S bar (core width),
201 * each extended only along connected cardinals. Leaves concave cutouts for L/T bends.
202 */
203 function isTabletopPixel (x, y, connectN, connectE, connectS, connectW)
204 {
205 const inCoreX = x >= BASE.x0 && x <= BASE.x1;
206 const inCoreY = y >= BASE.y0 && y <= BASE.y1;
207 const inHBar = inCoreY && (
208 inCoreX
209 || (connectW && x < BASE.x0)
210 || (connectE && x > BASE.x1)
211 );
212 const inVBar = inCoreX && (
213 inCoreY
214 || (connectN && y < BASE.y0)
215 || (connectS && y > BASE.y1)
216 );
217 return inHBar || inVBar;
218 }
219
184 220 function drawLeg (rgba, base, anchorX, topY)
185 221 {
186 // Artist legs: 3×2 under the top at (4,12) and (9,12).
187 222 const pattern = [
188 223 [getPx(base, 4, 12), getPx(base, 5, 12), getPx(base, 6, 12)],
189 224 [getPx(base, 4, 13), getPx(base, 5, 13), getPx(base, 6, 13)]
@@ -198,6 +233,20 @@ function drawLeg (rgba, base, anchorX, topY)
198 233 }
199 234 }
200 235
236 function rimFlags (x, y, connectN, connectE, connectS, connectW)
237 {
238 const n = isTabletopPixel(x, y - 1, connectN, connectE, connectS, connectW);
239 const e = isTabletopPixel(x + 1, y, connectN, connectE, connectS, connectW);
240 const s = isTabletopPixel(x, y + 1, connectN, connectE, connectS, connectW);
241 const w = isTabletopPixel(x - 1, y, connectN, connectE, connectS, connectW);
242 return {
243 onN: !n,
244 onE: !e,
245 onS: !s,
246 onW: !w
247 };
248 }
249
201 250 function paintTable (mask, base)
202 251 {
203 252 const rgba = new Uint8Array(SIZE * SIZE * 4);
@@ -212,64 +261,67 @@ function paintTable (mask, base)
212 261 return rgba;
213 262 }
214 263
215 const topX0 = connectW ? 0 : BASE.x0;
216 const topX1 = connectE ? SIZE - 1 : BASE.x1;
217 const topY0 = connectN ? 0 : BASE.y0;
218 const topY1 = connectS ? SIZE - 1 : BASE.y1;
219
220 for (let y = topY0; y <= topY1; y++)
264 for (let y = 0; y < SIZE; y++)
221 265 {
222 for (let x = topX0; x <= topX1; x++)
266 for (let x = 0; x < SIZE; x++)
223 267 {
224 const onN = y === topY0 && !connectN;
225 const onS = y === topY1 && !connectS;
226 const onW = x === topX0 && !connectW;
227 const onE = x === topX1 && !connectE;
268 if (!isTabletopPixel(x, y, connectN, connectE, connectS, connectW))
269 { continue; }
270 const rim = rimFlags(x, y, connectN, connectE, connectS, connectW);
228 271 let color;
229 if (onN)
272 if (rim.onN)
230 273 { color = sampleTop(base, Math.min(BASE.x1, Math.max(BASE.x0, x)), BASE.y0); }
231 else if (onS)
274 else if (rim.onS)
232 275 { color = sampleTop(base, Math.min(BASE.x1, Math.max(BASE.x0, x)), BASE.y1); }
233 else if (onW)
276 else if (rim.onW)
234 277 { color = sampleTop(base, BASE.x0, Math.min(BASE.y1, Math.max(BASE.y0, y))); }
235 else if (onE)
278 else if (rim.onE)
236 279 { color = sampleTop(base, BASE.x1, Math.min(BASE.y1, Math.max(BASE.y0, y))); }
237 280 else
238 281 {
239 // Interior: wrap the artist's fill so long spans keep grain.
240 const ix = BASE.x0 + 1 + ((x - topX0) % (BASE.x1 - BASE.x0 - 1));
241 const iy = BASE.y0 + 1 + ((y - topY0) % (BASE.y1 - BASE.y0 - 1));
282 const ix = BASE.x0 + 1 + ((x - BASE.x0 + SIZE) % (BASE.x1 - BASE.x0 - 1));
283 const iy = BASE.y0 + 1 + ((y - BASE.y0 + SIZE) % (BASE.y1 - BASE.y0 - 1));
242 284 color = sampleTop(base, ix, iy);
243 285 }
244 286 setPx(rgba, x, y, color);
245 287 }
246 288 }
247 289
248 // Front legs only when this tile is a south terminus (perspective).
249 if (!connectS && topY1 + 2 < SIZE)
290 // Front legs on free south edge of the footprint (line tables only show these).
291 if (!connectS)
250 292 {
251 const span = topX1 - topX0 + 1;
252 const anchors = [];
253 if (span <= 10)
293 const footY = BASE.y1;
294 if (footY + 2 < SIZE)
254 295 {
255 anchors.push(topX0 + 1);
256 anchors.push(Math.max(topX0 + 1, topX1 - 3));
257 }
258 else
259 {
260 for (let x = topX0 + 1; x <= topX1 - 3; x += 5)
261 { anchors.push(x); }
262 const last = topX1 - 3;
263 if (anchors[anchors.length - 1] !== last)
264 { anchors.push(last); }
265 }
266 const seen = new Set();
267 for (const ax of anchors)
268 {
269 if (seen.has(ax))
270 { continue; }
271 seen.add(ax);
272 drawLeg(rgba, base, ax, topY1);
296 const anchors = [];
297 for (let x = 0; x < SIZE; )
298 {
299 if (!isTabletopPixel(x, footY, connectN, connectE, connectS, connectW))
300 {
301 x++;
302 continue;
303 }
304 let x1 = x;
305 while (x1 + 1 < SIZE && isTabletopPixel(x1 + 1, footY, connectN, connectE, connectS, connectW))
306 { x1++; }
307 const span = x1 - x + 1;
308 if (span >= 3)
309 {
310 anchors.push(x + 1);
311 if (span >= 8)
312 { anchors.push(x1 - 2); }
313 }
314 x = x1 + 1;
315 }
316 const seen = new Set();
317 for (const ax of anchors)
318 {
319 const clamped = Math.max(0, Math.min(SIZE - 3, ax));
320 if (seen.has(clamped))
321 { continue; }
322 seen.add(clamped);
323 drawLeg(rgba, base, clamped, footY);
324 }
273 325 }
274 326 }
275 327
@@ -277,13 +329,13 @@ function paintTable (mask, base)
277 329 }
278 330
279 331 const source = decodePngRgba(readFileSync(SOURCE));
280 const base = magentaize(source);
332 const base = isAlreadyMagenta(source) ? source : magentaize(source);
281 333
282 334 mkdirSync(OUT, { recursive: true });
283 // Replace artist wood.png with magenta base (same silhouette).
284 writeFileSync(SOURCE, encodePng(base));
335 if (!isAlreadyMagenta(source))
336 { writeFileSync(SOURCE, encodePng(base)); }
285 337 for (let mask = 0; mask < 16; mask++)
286 338 {
287 339 writeFileSync(join(OUT, `${mask}.png`), encodePng(paintTable(mask, base)));
288 340 }
289 console.log(`Wrote magenta table sprites wood.png + 0–15 to ${OUT}`);
341 console.log(`Wrote strip-union table sprites 0–15 to ${OUT}`);
@@ -1,8 +1,12 @@
1/**
1/**
2 * Generate 16×16 magenta table PNGs for neighbor-connect masks 0–15.
2 * Generate 16×16 magenta table PNGs for neighbor-connect masks 0–15.
3 * Reads the artist `wood.png`, remaps browns → magenta (tintable), then
3 *
4 * extends the tabletop along connected cardinals (no diagonals).
4 * Geometry is a **strip union** (horizontal bar ∪ vertical bar), so L/T/+ bends
5 * Legs stay on free south edges; extra legs appear on long spans.
5 * keep a concave inner corner instead of filling the AABB. Straight runs stay
6 * one tile wide. Future filled rectangles (2×3, etc.) can add alternate corner
7 * sprites keyed by diagonal neighbors without changing these line pieces.
8 *
9 * Legs stay on free south edges of the footprint.
6 */
10 */
7import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
11import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
8import { deflateSync, inflateSync } from "node:zlib";
12import { deflateSync, inflateSync } from "node:zlib";
@@ -147,6 +151,18 @@ function setPx (rgba, x, y, color)
147 rgba[i + 3] = color[3];
151 rgba[i + 3] = color[3];
148}
152}
149
153
154function isAlreadyMagenta (rgba)
155{
156 for (let i = 0; i < rgba.length; i += 4)
157 {
158 if (rgba[i + 3] < 8)
159 { continue; }
160 if (Math.abs(rgba[i] - rgba[i + 2]) > 2 || rgba[i + 1] >= rgba[i])
161 { return false; }
162 }
163 return true;
164}
165
150/** Remap any opaque pixel into the magenta tint family (R≈B, G<R). */
166/** Remap any opaque pixel into the magenta tint family (R≈B, G<R). */
151function toMagenta (r, g, b, a)
167function toMagenta (r, g, b, a)
152{
168{
@@ -155,7 +171,6 @@ function toMagenta (r, g, b, a)
155 const L = Math.max(1, Math.max(r, g, b));
171 const L = Math.max(1, Math.max(r, g, b));
156 const minC = Math.min(r, g, b);
172 const minC = Math.min(r, g, b);
157 const chroma = (L - minC) / 255;
173 const chroma = (L - minC) / 255;
158 // Slight G softens grain; keep rims more saturated (low G).
159 const gMag = Math.min(L - 1, Math.round(L * (0.08 + (1 - chroma) * 0.22)));
174 const gMag = Math.min(L - 1, Math.round(L * (0.08 + (1 - chroma) * 0.22)));
160 return [L, Math.max(0, gMag), L, 255];
175 return [L, Math.max(0, gMag), L, 255];
161}
176}
@@ -181,9 +196,29 @@ function sampleTop (base, x, y)
181 return getPx(base, sx, sy);
196 return getPx(base, sx, sy);
182}
197}
183
198
199/**
200 * Line-table footprint: union of an E–W bar (core height) and an N–S bar (core width),
201 * each extended only along connected cardinals. Leaves concave cutouts for L/T bends.
202 */
203function isTabletopPixel (x, y, connectN, connectE, connectS, connectW)
204{
205 const inCoreX = x >= BASE.x0 && x <= BASE.x1;
206 const inCoreY = y >= BASE.y0 && y <= BASE.y1;
207 const inHBar = inCoreY && (
208 inCoreX
209 || (connectW && x < BASE.x0)
210 || (connectE && x > BASE.x1)
211 );
212 const inVBar = inCoreX && (
213 inCoreY
214 || (connectN && y < BASE.y0)
215 || (connectS && y > BASE.y1)
216 );
217 return inHBar || inVBar;
218}
219
184function drawLeg (rgba, base, anchorX, topY)
220function drawLeg (rgba, base, anchorX, topY)
185{
221{
186 // Artist legs: 3×2 under the top at (4,12) and (9,12).
187 const pattern = [
222 const pattern = [
188 [getPx(base, 4, 12), getPx(base, 5, 12), getPx(base, 6, 12)],
223 [getPx(base, 4, 12), getPx(base, 5, 12), getPx(base, 6, 12)],
189 [getPx(base, 4, 13), getPx(base, 5, 13), getPx(base, 6, 13)]
224 [getPx(base, 4, 13), getPx(base, 5, 13), getPx(base, 6, 13)]
@@ -198,6 +233,20 @@ function drawLeg (rgba, base, anchorX, topY)
198 }
233 }
199}
234}
200
235
236function rimFlags (x, y, connectN, connectE, connectS, connectW)
237{
238 const n = isTabletopPixel(x, y - 1, connectN, connectE, connectS, connectW);
239 const e = isTabletopPixel(x + 1, y, connectN, connectE, connectS, connectW);
240 const s = isTabletopPixel(x, y + 1, connectN, connectE, connectS, connectW);
241 const w = isTabletopPixel(x - 1, y, connectN, connectE, connectS, connectW);
242 return {
243 onN: !n,
244 onE: !e,
245 onS: !s,
246 onW: !w
247 };
248}
249
201function paintTable (mask, base)
250function paintTable (mask, base)
202{
251{
203 const rgba = new Uint8Array(SIZE * SIZE * 4);
252 const rgba = new Uint8Array(SIZE * SIZE * 4);
@@ -212,64 +261,67 @@ function paintTable (mask, base)
212 return rgba;
261 return rgba;
213 }
262 }
214
263
215 const topX0 = connectW ? 0 : BASE.x0;
264 for (let y = 0; y < SIZE; y++)
216 const topX1 = connectE ? SIZE - 1 : BASE.x1;
217 const topY0 = connectN ? 0 : BASE.y0;
218 const topY1 = connectS ? SIZE - 1 : BASE.y1;
219
220 for (let y = topY0; y <= topY1; y++)
221 {
265 {
222 for (let x = topX0; x <= topX1; x++)
266 for (let x = 0; x < SIZE; x++)
223 {
267 {
224 const onN = y === topY0 && !connectN;
268 if (!isTabletopPixel(x, y, connectN, connectE, connectS, connectW))
225 const onS = y === topY1 && !connectS;
269 { continue; }
226 const onW = x === topX0 && !connectW;
270 const rim = rimFlags(x, y, connectN, connectE, connectS, connectW);
227 const onE = x === topX1 && !connectE;
228 let color;
271 let color;
229 if (onN)
272 if (rim.onN)
230 { color = sampleTop(base, Math.min(BASE.x1, Math.max(BASE.x0, x)), BASE.y0); }
273 { color = sampleTop(base, Math.min(BASE.x1, Math.max(BASE.x0, x)), BASE.y0); }
231 else if (onS)
274 else if (rim.onS)
232 { color = sampleTop(base, Math.min(BASE.x1, Math.max(BASE.x0, x)), BASE.y1); }
275 { color = sampleTop(base, Math.min(BASE.x1, Math.max(BASE.x0, x)), BASE.y1); }
233 else if (onW)
276 else if (rim.onW)
234 { color = sampleTop(base, BASE.x0, Math.min(BASE.y1, Math.max(BASE.y0, y))); }
277 { color = sampleTop(base, BASE.x0, Math.min(BASE.y1, Math.max(BASE.y0, y))); }
235 else if (onE)
278 else if (rim.onE)
236 { color = sampleTop(base, BASE.x1, Math.min(BASE.y1, Math.max(BASE.y0, y))); }
279 { color = sampleTop(base, BASE.x1, Math.min(BASE.y1, Math.max(BASE.y0, y))); }
237 else
280 else
238 {
281 {
239 // Interior: wrap the artist's fill so long spans keep grain.
282 const ix = BASE.x0 + 1 + ((x - BASE.x0 + SIZE) % (BASE.x1 - BASE.x0 - 1));
240 const ix = BASE.x0 + 1 + ((x - topX0) % (BASE.x1 - BASE.x0 - 1));
283 const iy = BASE.y0 + 1 + ((y - BASE.y0 + SIZE) % (BASE.y1 - BASE.y0 - 1));
241 const iy = BASE.y0 + 1 + ((y - topY0) % (BASE.y1 - BASE.y0 - 1));
242 color = sampleTop(base, ix, iy);
284 color = sampleTop(base, ix, iy);
243 }
285 }
244 setPx(rgba, x, y, color);
286 setPx(rgba, x, y, color);
245 }
287 }
246 }
288 }
247
289
248 // Front legs only when this tile is a south terminus (perspective).
290 // Front legs on free south edge of the footprint (line tables only show these).
249 if (!connectS && topY1 + 2 < SIZE)
291 if (!connectS)
250 {
292 {
251 const span = topX1 - topX0 + 1;
293 const footY = BASE.y1;
252 const anchors = [];
294 if (footY + 2 < SIZE)
253 if (span <= 10)
254 {
295 {
255 anchors.push(topX0 + 1);
296 const anchors = [];
256 anchors.push(Math.max(topX0 + 1, topX1 - 3));
297 for (let x = 0; x < SIZE; )
257 }
298 {
258 else
299 if (!isTabletopPixel(x, footY, connectN, connectE, connectS, connectW))
259 {
300 {
260 for (let x = topX0 + 1; x <= topX1 - 3; x += 5)
301 x++;
261 { anchors.push(x); }
302 continue;
262 const last = topX1 - 3;
303 }
263 if (anchors[anchors.length - 1] !== last)
304 let x1 = x;
264 { anchors.push(last); }
305 while (x1 + 1 < SIZE && isTabletopPixel(x1 + 1, footY, connectN, connectE, connectS, connectW))
265 }
306 { x1++; }
266 const seen = new Set();
307 const span = x1 - x + 1;
267 for (const ax of anchors)
308 if (span >= 3)
268 {
309 {
269 if (seen.has(ax))
310 anchors.push(x + 1);
270 { continue; }
311 if (span >= 8)
271 seen.add(ax);
312 { anchors.push(x1 - 2); }
272 drawLeg(rgba, base, ax, topY1);
313 }
314 x = x1 + 1;
315 }
316 const seen = new Set();
317 for (const ax of anchors)
318 {
319 const clamped = Math.max(0, Math.min(SIZE - 3, ax));
320 if (seen.has(clamped))
321 { continue; }
322 seen.add(clamped);
323 drawLeg(rgba, base, clamped, footY);
324 }
273 }
325 }
274 }
326 }
275
327
@@ -277,13 +329,13 @@ function paintTable (mask, base)
277}
329}
278
330
279const source = decodePngRgba(readFileSync(SOURCE));
331const source = decodePngRgba(readFileSync(SOURCE));
280const base = magentaize(source);
332const base = isAlreadyMagenta(source) ? source : magentaize(source);
281
333
282mkdirSync(OUT, { recursive: true });
334mkdirSync(OUT, { recursive: true });
283// Replace artist wood.png with magenta base (same silhouette).
335if (!isAlreadyMagenta(source))
284writeFileSync(SOURCE, encodePng(base));
336{ writeFileSync(SOURCE, encodePng(base)); }
285for (let mask = 0; mask < 16; mask++)
337for (let mask = 0; mask < 16; mask++)
286{
338{
287 writeFileSync(join(OUT, `${mask}.png`), encodePng(paintTable(mask, base)));
339 writeFileSync(join(OUT, `${mask}.png`), encodePng(paintTable(mask, base)));
288}
340}
289console.log(`Wrote magenta table sprites wood.png + 0–15 to ${OUT}`);
341console.log(`Wrote strip-union table sprites 0–15 to ${OUT}`);
client/src/play/chat.js +4 −0
@@ -74,6 +74,10 @@ export function initChat ({ socket, MessageType, getSettings })
74 74 { return; }
75 75 if (document.activeElement === input)
76 76 { return; }
77 const focus = document.activeElement;
78 const tag = focus?.tagName;
79 if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || focus?.isContentEditable)
80 { return; }
77 81 if (!playingHudReady())
78 82 { return; }
79 83 event.preventDefault();
@@ -74,6 +74,10 @@ export function initChat ({ socket, MessageType, getSettings })
74 { return; }
74 { return; }
75 if (document.activeElement === input)
75 if (document.activeElement === input)
76 { return; }
76 { return; }
77 const focus = document.activeElement;
78 const tag = focus?.tagName;
79 if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || focus?.isContentEditable)
80 { return; }
77 if (!playingHudReady())
81 if (!playingHudReady())
78 { return; }
82 { return; }
79 event.preventDefault();
83 event.preventDefault();
client/src/play/main.js +1 −1
@@ -99,7 +99,7 @@ function uiBlocked ()
99 99 {
100 100 return !!(social?.isBlocking() || chat?.isBlocking() || inventory?.isBlocking()
101 101 || crafting?.isBlocking() || alchemy?.isBlocking() || shop?.isBlocking()
102 || contextMenu?.isOpen() || death?.isBlocking());
102 || market?.isBlocking() || contextMenu?.isOpen() || death?.isBlocking());
103 103 }
104 104
105 105 function clearPendingPickup ()
@@ -99,7 +99,7 @@ function uiBlocked ()
99{
99{
100 return !!(social?.isBlocking() || chat?.isBlocking() || inventory?.isBlocking()
100 return !!(social?.isBlocking() || chat?.isBlocking() || inventory?.isBlocking()
101 || crafting?.isBlocking() || alchemy?.isBlocking() || shop?.isBlocking()
101 || crafting?.isBlocking() || alchemy?.isBlocking() || shop?.isBlocking()
102 || contextMenu?.isOpen() || death?.isBlocking());
102 || market?.isBlocking() || contextMenu?.isOpen() || death?.isBlocking());
103}
103}
104
104
105function clearPendingPickup ()
105function clearPendingPickup ()
client/src/play/market.js +117 −45
@@ -4,6 +4,7 @@ import {
4 4 itemAssetPathForStack,
5 5 formatQuantity
6 6 } from "/shared/definitions/items.js";
7 import { INVENTORY_SLOTS } from "/shared/items/inventory.js";
7 8 import { marketOrderListingFee } from "/shared/market/exchange.js";
8 9 import { countMarketFunds, resolveMarketSellListing } from "/shared/market/funds.js";
9 10 import { applyItemIcon } from "../render/potionIcon.js";
@@ -31,6 +32,7 @@ export function initMarket ({
31 32 const sellQty = document.getElementById("market-sell-qty");
32 33 const sellMin = document.getElementById("market-sell-min");
33 34 const sellFee = document.getElementById("market-sell-fee");
35 const sellSuggest = document.getElementById("market-sell-suggest");
34 36 const coinsEl = document.getElementById("market-coins");
35 37 const hintEl = document.getElementById("market-hint");
36 38 const tabs = [...document.querySelectorAll(".market-tab")];
@@ -58,7 +60,13 @@ export function initMarket ({
58 60 for (const pane of panes)
59 61 { pane.hidden = pane.dataset.pane !== tab; }
60 62 if (tab === "sell")
61 { renderSellables(); }
63 {
64 renderSellables();
65 const slots = getInventorySlots?.() ?? [];
66 const slot = selectedSellSlot == null ? null : slots[selectedSellSlot];
67 const listing = slot ? resolveMarketSellListing(slot) : null;
68 updateSellSuggest(listing?.itemId ?? null);
69 }
62 70 if (tab === "buy")
63 71 { updateBuyFee(); }
64 72 if (tab === "orders")
@@ -85,11 +93,13 @@ export function initMarket ({
85 93
86 94 buySearch?.addEventListener("keydown", (event) =>
87 95 {
96 event.stopPropagation();
88 97 if (event.key !== "Enter")
89 98 { return; }
90 99 event.preventDefault();
91 100 runBuySearch(buySearch.value ?? "");
92 101 });
102 buySearch?.addEventListener("keyup", (event) => event.stopPropagation());
93 103
94 104 buyQty?.addEventListener("input", () => updateBuyFee());
95 105 buyMax?.addEventListener("input", () => updateBuyFee());
@@ -120,6 +130,15 @@ export function initMarket ({
120 130 });
121 131 });
122 132
133 sellSuggest?.addEventListener("click", () =>
134 {
135 const price = Number(sellSuggest.dataset.price);
136 if (!(price > 0) || !sellMin)
137 { return; }
138 sellMin.value = String(price);
139 updateSellFee();
140 });
141
123 142 function close ()
124 143 {
125 144 if (!open)
@@ -179,6 +198,33 @@ export function initMarket ({
179 198 }
180 199 }
181 200
201 function hintPriceForItem (itemId)
202 {
203 const entry = catalog.find((row) => (row.itemId | 0) === (itemId | 0));
204 const price = entry?.hintPrice;
205 if (price == null || !(Number(price) > 0))
206 { return null; }
207 return Math.max(1, Math.round(Number(price)));
208 }
209
210 function updateSellSuggest (itemId = null)
211 {
212 if (!sellSuggest)
213 { return; }
214 const price = itemId == null ? null : hintPriceForItem(itemId);
215 if (price == null)
216 {
217 sellSuggest.hidden = true;
218 sellSuggest.dataset.price = "";
219 sellSuggest.textContent = "";
220 return;
221 }
222 sellSuggest.hidden = false;
223 sellSuggest.dataset.price = String(price);
224 sellSuggest.textContent = `Market ~${formatQuantity(price)}`;
225 sellSuggest.title = "Use shopkeeper market price (seed + last-sale lerp) as min price";
226 }
227
182 228 function renderOrders ()
183 229 {
184 230 ordersEl.replaceChildren();
@@ -249,59 +295,77 @@ export function initMarket ({
249 295 }
250 296 }
251 297
298 function selectSellSlot (slotIndex, slot, listing)
299 {
300 selectedSellSlot = slotIndex;
301 sellQtyLocked = !!listing.quantityLocked;
302 if (sellQty)
303 {
304 sellQty.value = String(listing.quantityLocked
305 ? listing.quantity
306 : Math.min(listing.quantity, Math.max(1, slot.quantity | 0)));
307 sellQty.readOnly = sellQtyLocked;
308 sellQty.disabled = sellQtyLocked;
309 if (!sellQtyLocked)
310 { sellQty.max = String(Math.max(1, slot.quantity | 0)); }
311 else
312 { sellQty.removeAttribute("max"); }
313 }
314 if (sellSelected)
315 {
316 sellSelected.textContent = listing.isCheque
317 ? `Selling cheque for ${listing.quantity}× ${listing.displayName} (quantity locked)`
318 : `Selling ${itemDisplayName(slot)}`;
319 }
320 updateSellSuggest(listing.itemId);
321 renderSellables();
322 updateSellFee();
323 }
324
252 325 function renderSellables ()
253 326 {
254 327 sellList.replaceChildren();
255 328 const slots = getInventorySlots?.() ?? [];
256 slots.forEach((slot, slotIndex) =>
329 const count = Math.max(INVENTORY_SLOTS, slots.length);
330 for (let slotIndex = 0; slotIndex < count; slotIndex++)
257 331 {
258 if (!slot || slot.itemId == null)
259 { return; }
260 const listing = resolveMarketSellListing(slot);
261 if (!listing)
262 { return; }
263 const def = itemDefinition(slot.itemId);
264 if (!def || def.marketplaceSellable === false)
265 { return; }
266 const row = document.createElement("button");
267 row.type = "button";
268 row.className = "market-sell-row";
269 if (selectedSellSlot === slotIndex)
270 { row.classList.add("selected"); }
271 const icon = document.createElement("img");
272 icon.alt = "";
273 applyItemIcon(icon, itemAssetPathForStack(slot));
274 const label = document.createElement("span");
275 if (listing.isCheque)
276 {
277 label.textContent = `Cheque: ${listing.displayName} ×${formatQuantity(listing.quantity)}`;
278 }
279 else
332 const slot = slots[slotIndex] ?? null;
333 const button = document.createElement("button");
334 button.type = "button";
335 const listing = slot ? resolveMarketSellListing(slot) : null;
336 const sellable = !!listing && itemDefinition(slot.itemId)?.marketplaceSellable !== false;
337 button.className = `item-slot${selectedSellSlot === slotIndex ? " selected" : ""}`;
338 if (slot && !sellable)
339 { button.classList.add("disabled"); }
340 button.title = slot
341 ? (sellable
342 ? (listing.isCheque
343 ? `Cheque: ${listing.displayName} ×${formatQuantity(listing.quantity)}`
344 : `${itemDisplayName(slot)} ×${formatQuantity(slot.quantity)}`)
345 : `${itemDisplayName(slot)} (cannot list)`)
346 : "";
347 if (slot)
280 348 {
281 label.textContent = `${itemDisplayName(slot)} ×${formatQuantity(slot.quantity)}`;
282 }
283 row.append(icon, label);
284 row.addEventListener("click", () =>
285 {
286 selectedSellSlot = slotIndex;
287 sellQtyLocked = !!listing.quantityLocked;
288 if (sellQty)
289 {
290 sellQty.value = String(listing.quantity);
291 sellQty.readOnly = sellQtyLocked;
292 sellQty.disabled = sellQtyLocked;
293 }
294 if (sellSelected)
349 const img = document.createElement("img");
350 img.alt = itemDisplayName(slot);
351 applyItemIcon(img, slot, itemAssetPathForStack(slot));
352 button.append(img);
353 if ((slot.quantity | 0) > 1)
295 354 {
296 sellSelected.textContent = listing.isCheque
297 ? `Selling cheque for ${listing.quantity}× ${listing.displayName} (quantity locked)`
298 : `Selling ${itemDisplayName(slot)}`;
355 const qty = document.createElement("span");
356 qty.className = "qty";
357 qty.textContent = formatQuantity(slot.quantity);
358 button.append(qty);
299 359 }
300 renderSellables();
301 updateSellFee();
360 }
361 button.addEventListener("click", () =>
362 {
363 if (!sellable)
364 { return; }
365 selectSellSlot(slotIndex, slot, listing);
302 366 });
303 sellList.append(row);
304 });
367 sellList.append(button);
368 }
305 369 }
306 370
307 371 function refreshChrome ()
@@ -331,14 +395,18 @@ export function initMarket ({
331 395 selectedSellSlot = null;
332 396 selectedBuyItemId = null;
333 397 sellQtyLocked = false;
398 updateSellSuggest(null);
334 399 if (sellQty)
335 400 {
336 401 sellQty.readOnly = false;
337 402 sellQty.disabled = false;
338 403 sellQty.value = "1";
404 sellQty.removeAttribute("max");
339 405 }
340 406 if (buySearch)
341 407 { buySearch.value = ""; }
408 if (sellSelected)
409 { sellSelected.textContent = "Select an item from your bag"; }
342 410 if (title)
343 411 { title.textContent = payload.displayName || "Central Exchange"; }
344 412 if (hintEl)
@@ -376,6 +444,10 @@ export function initMarket ({
376 444 {
377 445 return open;
378 446 },
447 isBlocking ()
448 {
449 return open;
450 },
379 451 close
380 452 };
381 453 }
@@ -4,6 +4,7 @@ import {
4 itemAssetPathForStack,
4 itemAssetPathForStack,
5 formatQuantity
5 formatQuantity
6} from "/shared/definitions/items.js";
6} from "/shared/definitions/items.js";
7import { INVENTORY_SLOTS } from "/shared/items/inventory.js";
7import { marketOrderListingFee } from "/shared/market/exchange.js";
8import { marketOrderListingFee } from "/shared/market/exchange.js";
8import { countMarketFunds, resolveMarketSellListing } from "/shared/market/funds.js";
9import { countMarketFunds, resolveMarketSellListing } from "/shared/market/funds.js";
9import { applyItemIcon } from "../render/potionIcon.js";
10import { applyItemIcon } from "../render/potionIcon.js";
@@ -31,6 +32,7 @@ export function initMarket ({
31 const sellQty = document.getElementById("market-sell-qty");
32 const sellQty = document.getElementById("market-sell-qty");
32 const sellMin = document.getElementById("market-sell-min");
33 const sellMin = document.getElementById("market-sell-min");
33 const sellFee = document.getElementById("market-sell-fee");
34 const sellFee = document.getElementById("market-sell-fee");
35 const sellSuggest = document.getElementById("market-sell-suggest");
34 const coinsEl = document.getElementById("market-coins");
36 const coinsEl = document.getElementById("market-coins");
35 const hintEl = document.getElementById("market-hint");
37 const hintEl = document.getElementById("market-hint");
36 const tabs = [...document.querySelectorAll(".market-tab")];
38 const tabs = [...document.querySelectorAll(".market-tab")];
@@ -58,7 +60,13 @@ export function initMarket ({
58 for (const pane of panes)
60 for (const pane of panes)
59 { pane.hidden = pane.dataset.pane !== tab; }
61 { pane.hidden = pane.dataset.pane !== tab; }
60 if (tab === "sell")
62 if (tab === "sell")
61 { renderSellables(); }
63 {
64 renderSellables();
65 const slots = getInventorySlots?.() ?? [];
66 const slot = selectedSellSlot == null ? null : slots[selectedSellSlot];
67 const listing = slot ? resolveMarketSellListing(slot) : null;
68 updateSellSuggest(listing?.itemId ?? null);
69 }
62 if (tab === "buy")
70 if (tab === "buy")
63 { updateBuyFee(); }
71 { updateBuyFee(); }
64 if (tab === "orders")
72 if (tab === "orders")
@@ -85,11 +93,13 @@ export function initMarket ({
85
93
86 buySearch?.addEventListener("keydown", (event) =>
94 buySearch?.addEventListener("keydown", (event) =>
87 {
95 {
96 event.stopPropagation();
88 if (event.key !== "Enter")
97 if (event.key !== "Enter")
89 { return; }
98 { return; }
90 event.preventDefault();
99 event.preventDefault();
91 runBuySearch(buySearch.value ?? "");
100 runBuySearch(buySearch.value ?? "");
92 });
101 });
102 buySearch?.addEventListener("keyup", (event) => event.stopPropagation());
93
103
94 buyQty?.addEventListener("input", () => updateBuyFee());
104 buyQty?.addEventListener("input", () => updateBuyFee());
95 buyMax?.addEventListener("input", () => updateBuyFee());
105 buyMax?.addEventListener("input", () => updateBuyFee());
@@ -120,6 +130,15 @@ export function initMarket ({
120 });
130 });
121 });
131 });
122
132
133 sellSuggest?.addEventListener("click", () =>
134 {
135 const price = Number(sellSuggest.dataset.price);
136 if (!(price > 0) || !sellMin)
137 { return; }
138 sellMin.value = String(price);
139 updateSellFee();
140 });
141
123 function close ()
142 function close ()
124 {
143 {
125 if (!open)
144 if (!open)
@@ -179,6 +198,33 @@ export function initMarket ({
179 }
198 }
180 }
199 }
181
200
201 function hintPriceForItem (itemId)
202 {
203 const entry = catalog.find((row) => (row.itemId | 0) === (itemId | 0));
204 const price = entry?.hintPrice;
205 if (price == null || !(Number(price) > 0))
206 { return null; }
207 return Math.max(1, Math.round(Number(price)));
208 }
209
210 function updateSellSuggest (itemId = null)
211 {
212 if (!sellSuggest)
213 { return; }
214 const price = itemId == null ? null : hintPriceForItem(itemId);
215 if (price == null)
216 {
217 sellSuggest.hidden = true;
218 sellSuggest.dataset.price = "";
219 sellSuggest.textContent = "";
220 return;
221 }
222 sellSuggest.hidden = false;
223 sellSuggest.dataset.price = String(price);
224 sellSuggest.textContent = `Market ~${formatQuantity(price)}`;
225 sellSuggest.title = "Use shopkeeper market price (seed + last-sale lerp) as min price";
226 }
227
182 function renderOrders ()
228 function renderOrders ()
183 {
229 {
184 ordersEl.replaceChildren();
230 ordersEl.replaceChildren();
@@ -249,59 +295,77 @@ export function initMarket ({
249 }
295 }
250 }
296 }
251
297
298 function selectSellSlot (slotIndex, slot, listing)
299 {
300 selectedSellSlot = slotIndex;
301 sellQtyLocked = !!listing.quantityLocked;
302 if (sellQty)
303 {
304 sellQty.value = String(listing.quantityLocked
305 ? listing.quantity
306 : Math.min(listing.quantity, Math.max(1, slot.quantity | 0)));
307 sellQty.readOnly = sellQtyLocked;
308 sellQty.disabled = sellQtyLocked;
309 if (!sellQtyLocked)
310 { sellQty.max = String(Math.max(1, slot.quantity | 0)); }
311 else
312 { sellQty.removeAttribute("max"); }
313 }
314 if (sellSelected)
315 {
316 sellSelected.textContent = listing.isCheque
317 ? `Selling cheque for ${listing.quantity}× ${listing.displayName} (quantity locked)`
318 : `Selling ${itemDisplayName(slot)}`;
319 }
320 updateSellSuggest(listing.itemId);
321 renderSellables();
322 updateSellFee();
323 }
324
252 function renderSellables ()
325 function renderSellables ()
253 {
326 {
254 sellList.replaceChildren();
327 sellList.replaceChildren();
255 const slots = getInventorySlots?.() ?? [];
328 const slots = getInventorySlots?.() ?? [];
256 slots.forEach((slot, slotIndex) =>
329 const count = Math.max(INVENTORY_SLOTS, slots.length);
330 for (let slotIndex = 0; slotIndex < count; slotIndex++)
257 {
331 {
258 if (!slot || slot.itemId == null)
332 const slot = slots[slotIndex] ?? null;
259 { return; }
333 const button = document.createElement("button");
260 const listing = resolveMarketSellListing(slot);
334 button.type = "button";
261 if (!listing)
335 const listing = slot ? resolveMarketSellListing(slot) : null;
262 { return; }
336 const sellable = !!listing && itemDefinition(slot.itemId)?.marketplaceSellable !== false;
263 const def = itemDefinition(slot.itemId);
337 button.className = `item-slot${selectedSellSlot === slotIndex ? " selected" : ""}`;
264 if (!def || def.marketplaceSellable === false)
338 if (slot && !sellable)
265 { return; }
339 { button.classList.add("disabled"); }
266 const row = document.createElement("button");
340 button.title = slot
267 row.type = "button";
341 ? (sellable
268 row.className = "market-sell-row";
342 ? (listing.isCheque
269 if (selectedSellSlot === slotIndex)
343 ? `Cheque: ${listing.displayName} ×${formatQuantity(listing.quantity)}`
270 { row.classList.add("selected"); }
344 : `${itemDisplayName(slot)} ×${formatQuantity(slot.quantity)}`)
271 const icon = document.createElement("img");
345 : `${itemDisplayName(slot)} (cannot list)`)
272 icon.alt = "";
346 : "";
273 applyItemIcon(icon, itemAssetPathForStack(slot));
347 if (slot)
274 const label = document.createElement("span");
275 if (listing.isCheque)
276 {
277 label.textContent = `Cheque: ${listing.displayName} ×${formatQuantity(listing.quantity)}`;
278 }
279 else
280 {
348 {
281 label.textContent = `${itemDisplayName(slot)} ×${formatQuantity(slot.quantity)}`;
349 const img = document.createElement("img");
282 }
350 img.alt = itemDisplayName(slot);
283 row.append(icon, label);
351 applyItemIcon(img, slot, itemAssetPathForStack(slot));
284 row.addEventListener("click", () =>
352 button.append(img);
285 {
353 if ((slot.quantity | 0) > 1)
286 selectedSellSlot = slotIndex;
287 sellQtyLocked = !!listing.quantityLocked;
288 if (sellQty)
289 {
290 sellQty.value = String(listing.quantity);
291 sellQty.readOnly = sellQtyLocked;
292 sellQty.disabled = sellQtyLocked;
293 }
294 if (sellSelected)
295 {
354 {
296 sellSelected.textContent = listing.isCheque
355 const qty = document.createElement("span");
297 ? `Selling cheque for ${listing.quantity}× ${listing.displayName} (quantity locked)`
356 qty.className = "qty";
298 : `Selling ${itemDisplayName(slot)}`;
357 qty.textContent = formatQuantity(slot.quantity);
358 button.append(qty);
299 }
359 }
300 renderSellables();
360 }
301 updateSellFee();
361 button.addEventListener("click", () =>
362 {
363 if (!sellable)
364 { return; }
365 selectSellSlot(slotIndex, slot, listing);
302 });
366 });
303 sellList.append(row);
367 sellList.append(button);
304 });
368 }
305 }
369 }
306
370
307 function refreshChrome ()
371 function refreshChrome ()
@@ -331,14 +395,18 @@ export function initMarket ({
331 selectedSellSlot = null;
395 selectedSellSlot = null;
332 selectedBuyItemId = null;
396 selectedBuyItemId = null;
333 sellQtyLocked = false;
397 sellQtyLocked = false;
398 updateSellSuggest(null);
334 if (sellQty)
399 if (sellQty)
335 {
400 {
336 sellQty.readOnly = false;
401 sellQty.readOnly = false;
337 sellQty.disabled = false;
402 sellQty.disabled = false;
338 sellQty.value = "1";
403 sellQty.value = "1";
404 sellQty.removeAttribute("max");
339 }
405 }
340 if (buySearch)
406 if (buySearch)
341 { buySearch.value = ""; }
407 { buySearch.value = ""; }
408 if (sellSelected)
409 { sellSelected.textContent = "Select an item from your bag"; }
342 if (title)
410 if (title)
343 { title.textContent = payload.displayName || "Central Exchange"; }
411 { title.textContent = payload.displayName || "Central Exchange"; }
344 if (hintEl)
412 if (hintEl)
@@ -376,6 +444,10 @@ export function initMarket ({
376 {
444 {
377 return open;
445 return open;
378 },
446 },
447 isBlocking ()
448 {
449 return open;
450 },
379 close
451 close
380 };
452 };
381}
453}
client/ui/play.css +34 −9
@@ -1150,8 +1150,7 @@ a { color: #d4c48a; }
1150 1150 margin-top: 0.25rem;
1151 1151 }
1152 1152
1153 .market-catalog,
1154 .market-sell-list {
1153 .market-catalog {
1155 1154 display: flex;
1156 1155 flex-direction: column;
1157 1156 gap: 0.25rem;
@@ -1160,8 +1159,12 @@ a { color: #d4c48a; }
1160 1159 margin-bottom: 0.5rem;
1161 1160 }
1162 1161
1162 #market-sell-list.item-grid {
1163 max-height: none;
1164 margin-bottom: 0.5rem;
1165 }
1166
1163 1167 .market-catalog-row,
1164 .market-sell-row,
1165 1168 .market-order-row {
1166 1169 display: flex;
1167 1170 align-items: center;
@@ -1174,15 +1177,12 @@ a { color: #d4c48a; }
1174 1177 text-align: left;
1175 1178 }
1176 1179
1177 .market-catalog-row.selected,
1178 .market-sell-row.selected {
1180 .market-catalog-row.selected {
1179 1181 border-color: #6a8caf;
1180 1182 }
1181 1183
1182 .market-sell-row img {
1183 width: 24px;
1184 height: 24px;
1185 image-rendering: pixelated;
1184 #market-sell-list .item-slot.disabled {
1185 opacity: 0.4;
1186 1186 }
1187 1187
1188 1188 #market-sell-qty:disabled,
@@ -1190,6 +1190,31 @@ a { color: #d4c48a; }
1190 1190 opacity: 0.7;
1191 1191 }
1192 1192
1193 .market-sell-actions {
1194 display: flex;
1195 align-items: flex-end;
1196 justify-content: space-between;
1197 gap: 0.75rem;
1198 margin-top: 0.5rem;
1199 }
1200
1201 .market-price-suggest {
1202 margin: 0;
1203 padding: 0;
1204 border: none;
1205 background: transparent;
1206 color: #9aa3b2;
1207 font: inherit;
1208 font-size: 0.85rem;
1209 text-align: right;
1210 cursor: pointer;
1211 }
1212
1213 .market-price-suggest:hover {
1214 color: #d4c48a;
1215 text-decoration: underline;
1216 }
1217
1193 1218
1194 1219 #shop-qty-backdrop {
1195 1220 z-index: 7;
@@ -1150,8 +1150,7 @@ a { color: #d4c48a; }
1150 margin-top: 0.25rem;
1150 margin-top: 0.25rem;
1151}
1151}
1152
1152
1153.market-catalog,
1153.market-catalog {
1154.market-sell-list {
1155 display: flex;
1154 display: flex;
1156 flex-direction: column;
1155 flex-direction: column;
1157 gap: 0.25rem;
1156 gap: 0.25rem;
@@ -1160,8 +1159,12 @@ a { color: #d4c48a; }
1160 margin-bottom: 0.5rem;
1159 margin-bottom: 0.5rem;
1161}
1160}
1162
1161
1162#market-sell-list.item-grid {
1163 max-height: none;
1164 margin-bottom: 0.5rem;
1165}
1166
1163.market-catalog-row,
1167.market-catalog-row,
1164.market-sell-row,
1165.market-order-row {
1168.market-order-row {
1166 display: flex;
1169 display: flex;
1167 align-items: center;
1170 align-items: center;
@@ -1174,15 +1177,12 @@ a { color: #d4c48a; }
1174 text-align: left;
1177 text-align: left;
1175}
1178}
1176
1179
1177.market-catalog-row.selected,
1180.market-catalog-row.selected {
1178.market-sell-row.selected {
1179 border-color: #6a8caf;
1181 border-color: #6a8caf;
1180}
1182}
1181
1183
1182.market-sell-row img {
1184#market-sell-list .item-slot.disabled {
1183 width: 24px;
1185 opacity: 0.4;
1184 height: 24px;
1185 image-rendering: pixelated;
1186}
1186}
1187
1187
1188#market-sell-qty:disabled,
1188#market-sell-qty:disabled,
@@ -1190,6 +1190,31 @@ a { color: #d4c48a; }
1190 opacity: 0.7;
1190 opacity: 0.7;
1191}
1191}
1192
1192
1193.market-sell-actions {
1194 display: flex;
1195 align-items: flex-end;
1196 justify-content: space-between;
1197 gap: 0.75rem;
1198 margin-top: 0.5rem;
1199}
1200
1201.market-price-suggest {
1202 margin: 0;
1203 padding: 0;
1204 border: none;
1205 background: transparent;
1206 color: #9aa3b2;
1207 font: inherit;
1208 font-size: 0.85rem;
1209 text-align: right;
1210 cursor: pointer;
1211}
1212
1213.market-price-suggest:hover {
1214 color: #d4c48a;
1215 text-decoration: underline;
1216}
1217
1193
1218
1194#shop-qty-backdrop {
1219#shop-qty-backdrop {
1195 z-index: 7;
1220 z-index: 7;
shared/definitions/tiles.js +2 −1
@@ -261,7 +261,8 @@ export const BLOCK_DEFINITIONS = Object.freeze({
261 261 framesPerRow: 1,
262 262 animationSpeed: 0,
263 263 outdoor: false,
264 /** Magenta base `0`–`15`; catalog expands `${wood}-${mask}` with wood tints. */
264 /** Magenta base `0`–`15` (strip-union line tables); catalog expands `${wood}-${mask}`.
265 * Filled-rectangle corners can later add diagonal-aware sprites without replacing these. */
265 266 neighborConnect: true,
266 267 neighborConnectByMaterial: true,
267 268 defaultNeighborMaterial: WoodTier.pine
@@ -261,7 +261,8 @@ export const BLOCK_DEFINITIONS = Object.freeze({
261 framesPerRow: 1,
261 framesPerRow: 1,
262 animationSpeed: 0,
262 animationSpeed: 0,
263 outdoor: false,
263 outdoor: false,
264 /** Magenta base `0`–`15`; catalog expands `${wood}-${mask}` with wood tints. */
264 /** Magenta base `0`–`15` (strip-union line tables); catalog expands `${wood}-${mask}`.
265 * Filled-rectangle corners can later add diagonal-aware sprites without replacing these. */
265 neighborConnect: true,
266 neighborConnect: true,
266 neighborConnectByMaterial: true,
267 neighborConnectByMaterial: true,
267 defaultNeighborMaterial: WoodTier.pine
268 defaultNeighborMaterial: WoodTier.pine