Skip to content

Commit 1a1e207

Browse files
committed
fix: hexagon coordinate view tweaks (#2250)
- Remove hex.creature.xray() call in showGrid() so units remain fully visible (no longer tedious x-ray mode) - Add 'dashed' visual state for empty (non-unit) hexes when showGrid is active, displaying a dashed grid overlay - Set empty dashed hexes to 25% opacity when showGrid is active per issue spec - Occupied hexes: creature sprite visible below, coordinates display in overlayHexesGroup (above creatures) - Empty hexes: dashed hex at 25% opacity with coordinates on top in overlayHexesGroup Changes: - src/utility/hexgrid.ts: Modified showGrid() - removed xray call, added dashed class for empty hexes - src/utility/hex.ts: Modified display() - set empty dashed hexes to 25% alpha when showGrid active Bounty: 7 XTR 收款地址:eB51DWp1uECrLZRLsE2cnyZUzfRWvzUzaJzkatTpQV9
1 parent fb54641 commit 1a1e207

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/utility/hex.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,10 @@ export class Hex {
581581
this.grid.displayHexesGroup.bringToTop(this.display);
582582
} else {
583583
this.display.loadTexture('hex_dashed');
584+
// When showGrid is active on empty hexes, show dashed at 25% opacity
585+
if (this.displayClasses.match(/showGrid/g)) {
586+
this.display.alpha = 0.25;
587+
}
584588
}
585589
} else if (this.displayClasses.match(/deadzone/)) {
586590
this.display.loadTexture('hex_deadzone');

src/utility/hexgrid.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,18 +1456,19 @@ export class HexGrid {
14561456

14571457
showGrid(val) {
14581458
this.forEachHex((hex) => {
1459-
if (hex.creature) {
1460-
hex.creature.xray(val);
1461-
}
1462-
14631459
if (hex.drop) {
14641460
return;
14651461
}
14661462

14671463
if (val) {
14681464
hex.displayVisualState('showGrid');
1465+
// Show dashed grid (not x-ray) for empty hexes so coordinates are visible on top of units
1466+
if (!hex.creature) {
1467+
hex.displayVisualState('dashed');
1468+
}
14691469
} else {
14701470
hex.cleanDisplayVisualState('showGrid');
1471+
hex.cleanDisplayVisualState('dashed');
14711472
}
14721473
});
14731474
}

0 commit comments

Comments
 (0)