@industry-theme/repository-composition-panels 0.7.8 → 0.7.9
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/{BufferResource-BrcB7GjV.js → BufferResource-tJVgbc59.js} +2 -2
- package/dist/{BufferResource-BrcB7GjV.js.map → BufferResource-tJVgbc59.js.map} +1 -1
- package/dist/{CanvasRenderer-DVCVlQAe.js → CanvasRenderer-BMQBT798.js} +3 -3
- package/dist/{CanvasRenderer-DVCVlQAe.js.map → CanvasRenderer-BMQBT798.js.map} +1 -1
- package/dist/{Filter-g5P8NVFK.js → Filter-VlmwRktd.js} +2 -2
- package/dist/{Filter-g5P8NVFK.js.map → Filter-VlmwRktd.js.map} +1 -1
- package/dist/{RenderTargetSystem-BXTKkVz0.js → RenderTargetSystem-kszI6iwx.js} +3 -3
- package/dist/{RenderTargetSystem-BXTKkVz0.js.map → RenderTargetSystem-kszI6iwx.js.map} +1 -1
- package/dist/{WebGLRenderer-C1p4kl1P.js → WebGLRenderer-CLI9KBvb.js} +4 -4
- package/dist/{WebGLRenderer-C1p4kl1P.js.map → WebGLRenderer-CLI9KBvb.js.map} +1 -1
- package/dist/{WebGPURenderer-XEr9nHdK.js → WebGPURenderer-Bk9GZQ23.js} +4 -4
- package/dist/{WebGPURenderer-XEr9nHdK.js.map → WebGPURenderer-Bk9GZQ23.js.map} +1 -1
- package/dist/{browserAll-33uY9PDc.js → browserAll-TetdT1fR.js} +3 -3
- package/dist/{browserAll-33uY9PDc.js.map → browserAll-TetdT1fR.js.map} +1 -1
- package/dist/{index-DpCjdndq.js → index-B_w7mlVu.js} +272 -220
- package/dist/{index-DpCjdndq.js.map → index-B_w7mlVu.js.map} +1 -1
- package/dist/{init-CACqkXAX.js → init-BoYf1Yr_.js} +3 -3
- package/dist/{init-CACqkXAX.js.map → init-BoYf1Yr_.js.map} +1 -1
- package/dist/panels/overworld-map/OverworldMapPanel.d.ts.map +1 -1
- package/dist/panels/overworld-map/components/IsometricRenderer.d.ts +2 -0
- package/dist/panels/overworld-map/components/IsometricRenderer.d.ts.map +1 -1
- package/dist/panels/overworld-map/components/buildingSpriteGenerator.d.ts +1 -2
- package/dist/panels/overworld-map/components/buildingSpriteGenerator.d.ts.map +1 -1
- package/dist/panels/overworld-map/components/licenseSignSprites.d.ts.map +1 -1
- package/dist/panels.bundle.js +1 -1
- package/dist/webworkerAll-Cwo87khm.js +3 -0
- package/dist/webworkerAll-Cwo87khm.js.map +1 -0
- package/package.json +1 -1
- package/dist/webworkerAll-Cmk7KfNi.js +0 -3
- package/dist/webworkerAll-Cmk7KfNi.js.map +0 -1
|
@@ -106235,7 +106235,7 @@ const browserExt = {
|
|
|
106235
106235
|
},
|
|
106236
106236
|
test: () => true,
|
|
106237
106237
|
load: async () => {
|
|
106238
|
-
await import("./browserAll-
|
|
106238
|
+
await import("./browserAll-TetdT1fR.js");
|
|
106239
106239
|
}
|
|
106240
106240
|
};
|
|
106241
106241
|
const webworkerExt = {
|
|
@@ -106246,7 +106246,7 @@ const webworkerExt = {
|
|
|
106246
106246
|
},
|
|
106247
106247
|
test: () => typeof self !== "undefined" && self.WorkerGlobalScope !== void 0,
|
|
106248
106248
|
load: async () => {
|
|
106249
|
-
await import("./webworkerAll-
|
|
106249
|
+
await import("./webworkerAll-Cwo87khm.js");
|
|
106250
106250
|
}
|
|
106251
106251
|
};
|
|
106252
106252
|
class ObservablePoint {
|
|
@@ -118489,19 +118489,19 @@ async function autoDetectRenderer(options) {
|
|
|
118489
118489
|
for (let i2 = 0; i2 < preferredOrder.length; i2++) {
|
|
118490
118490
|
const rendererType = preferredOrder[i2];
|
|
118491
118491
|
if (rendererType === "webgpu" && await isWebGPUSupported()) {
|
|
118492
|
-
const { WebGPURenderer } = await import("./WebGPURenderer-
|
|
118492
|
+
const { WebGPURenderer } = await import("./WebGPURenderer-Bk9GZQ23.js");
|
|
118493
118493
|
RendererClass = WebGPURenderer;
|
|
118494
118494
|
finalOptions = { ...options, ...options.webgpu };
|
|
118495
118495
|
break;
|
|
118496
118496
|
} else if (rendererType === "webgl" && isWebGLSupported(
|
|
118497
118497
|
options.failIfMajorPerformanceCaveat ?? AbstractRenderer.defaultOptions.failIfMajorPerformanceCaveat
|
|
118498
118498
|
)) {
|
|
118499
|
-
const { WebGLRenderer } = await import("./WebGLRenderer-
|
|
118499
|
+
const { WebGLRenderer } = await import("./WebGLRenderer-CLI9KBvb.js");
|
|
118500
118500
|
RendererClass = WebGLRenderer;
|
|
118501
118501
|
finalOptions = { ...options, ...options.webgl };
|
|
118502
118502
|
break;
|
|
118503
118503
|
} else if (rendererType === "canvas") {
|
|
118504
|
-
const { CanvasRenderer } = await import("./CanvasRenderer-
|
|
118504
|
+
const { CanvasRenderer } = await import("./CanvasRenderer-BMQBT798.js");
|
|
118505
118505
|
RendererClass = CanvasRenderer;
|
|
118506
118506
|
finalOptions = { ...options, ...options.canvasOptions };
|
|
118507
118507
|
break;
|
|
@@ -132406,6 +132406,122 @@ class it extends Container {
|
|
|
132406
132406
|
t2 < this.left ? (this.left = t2, h2 = true) : t2 + n2 > this.right && (this.right = t2 + n2, h2 = true), e2 < this.top ? (this.top = e2, h2 = true) : e2 + i2 > this.bottom && (this.bottom = e2 + i2, h2 = true), h2 && this.emit("moved", { viewport: this, type: "ensureVisible" });
|
|
132407
132407
|
}
|
|
132408
132408
|
}
|
|
132409
|
+
function generateBuildingSprite(config) {
|
|
132410
|
+
const { size, color: color2 = 13789470 } = config;
|
|
132411
|
+
const building = new Graphics();
|
|
132412
|
+
const baseWidth = 40 * size;
|
|
132413
|
+
const baseDepth = 40 * size;
|
|
132414
|
+
const baseHeight = 50 * size;
|
|
132415
|
+
const width = baseWidth;
|
|
132416
|
+
const depth = baseDepth;
|
|
132417
|
+
const height = baseHeight;
|
|
132418
|
+
const isoWidth = width;
|
|
132419
|
+
const isoDepthY = depth * 0.25;
|
|
132420
|
+
const darkColor = adjustBrightness$1(color2, 0.6);
|
|
132421
|
+
const mediumColor = adjustBrightness$1(color2, 0.75);
|
|
132422
|
+
const baseColor = color2;
|
|
132423
|
+
const lightColor = adjustBrightness$1(color2, 1.2);
|
|
132424
|
+
building.fillStyle = { color: darkColor };
|
|
132425
|
+
building.beginPath();
|
|
132426
|
+
building.moveTo(-isoWidth / 2, 0);
|
|
132427
|
+
building.lineTo(0, -isoDepthY);
|
|
132428
|
+
building.lineTo(isoWidth / 2, 0);
|
|
132429
|
+
building.lineTo(0, isoDepthY);
|
|
132430
|
+
building.closePath();
|
|
132431
|
+
building.fill();
|
|
132432
|
+
building.fillStyle = { color: mediumColor };
|
|
132433
|
+
building.beginPath();
|
|
132434
|
+
building.moveTo(-isoWidth / 2, 0);
|
|
132435
|
+
building.lineTo(-isoWidth / 2, -height);
|
|
132436
|
+
building.lineTo(0, -height - isoDepthY);
|
|
132437
|
+
building.lineTo(0, -isoDepthY);
|
|
132438
|
+
building.closePath();
|
|
132439
|
+
building.fill();
|
|
132440
|
+
building.fillStyle = { color: baseColor };
|
|
132441
|
+
building.beginPath();
|
|
132442
|
+
building.moveTo(0, -isoDepthY);
|
|
132443
|
+
building.lineTo(0, -height - isoDepthY);
|
|
132444
|
+
building.lineTo(isoWidth / 2, -height);
|
|
132445
|
+
building.lineTo(isoWidth / 2, 0);
|
|
132446
|
+
building.closePath();
|
|
132447
|
+
building.fill();
|
|
132448
|
+
building.fillStyle = { color: lightColor };
|
|
132449
|
+
building.beginPath();
|
|
132450
|
+
building.moveTo(-isoWidth / 2, -height);
|
|
132451
|
+
building.lineTo(0, -height - isoDepthY);
|
|
132452
|
+
building.lineTo(isoWidth / 2, -height);
|
|
132453
|
+
building.lineTo(0, -height + isoDepthY);
|
|
132454
|
+
building.closePath();
|
|
132455
|
+
building.fill();
|
|
132456
|
+
building.strokeStyle = { width: 2, color: 0, alpha: 0.3 };
|
|
132457
|
+
building.beginPath();
|
|
132458
|
+
building.moveTo(-isoWidth / 2, 0);
|
|
132459
|
+
building.lineTo(-isoWidth / 2, -height);
|
|
132460
|
+
building.lineTo(0, -height - isoDepthY);
|
|
132461
|
+
building.lineTo(isoWidth / 2, -height);
|
|
132462
|
+
building.lineTo(isoWidth / 2, 0);
|
|
132463
|
+
building.stroke();
|
|
132464
|
+
return building;
|
|
132465
|
+
}
|
|
132466
|
+
function adjustBrightness$1(color2, factor) {
|
|
132467
|
+
const r2 = color2 >> 16 & 255;
|
|
132468
|
+
const g2 = color2 >> 8 & 255;
|
|
132469
|
+
const b2 = color2 & 255;
|
|
132470
|
+
const newR = Math.min(255, Math.floor(r2 * factor));
|
|
132471
|
+
const newG = Math.min(255, Math.floor(g2 * factor));
|
|
132472
|
+
const newB = Math.min(255, Math.floor(b2 * factor));
|
|
132473
|
+
return newR << 16 | newG << 8 | newB;
|
|
132474
|
+
}
|
|
132475
|
+
const TILE_SIZE = 32;
|
|
132476
|
+
const MAX_NODES_PER_MAP = 12;
|
|
132477
|
+
const REGION_SIZE_TILES = 25;
|
|
132478
|
+
const ISO_TILE_WIDTH$1 = TILE_SIZE * 2;
|
|
132479
|
+
const ISO_TILE_HEIGHT$1 = TILE_SIZE;
|
|
132480
|
+
function gridToScreen(gridX, gridY) {
|
|
132481
|
+
const screenX = (gridX - gridY) * (ISO_TILE_WIDTH$1 / 2);
|
|
132482
|
+
const screenY = (gridX + gridY) * (ISO_TILE_HEIGHT$1 / 2);
|
|
132483
|
+
return { screenX, screenY };
|
|
132484
|
+
}
|
|
132485
|
+
function screenToGrid(screenX, screenY) {
|
|
132486
|
+
const gridX = (screenX / (ISO_TILE_WIDTH$1 / 2) + screenY / (ISO_TILE_HEIGHT$1 / 2)) / 2;
|
|
132487
|
+
const gridY = (screenY / (ISO_TILE_HEIGHT$1 / 2) - screenX / (ISO_TILE_WIDTH$1 / 2)) / 2;
|
|
132488
|
+
return { gridX, gridY };
|
|
132489
|
+
}
|
|
132490
|
+
function getIsometricZIndex(gridX, gridY) {
|
|
132491
|
+
return gridX + gridY;
|
|
132492
|
+
}
|
|
132493
|
+
function calculateRegionCameraPosition(regionCenterX, regionCenterY, bounds) {
|
|
132494
|
+
const center = gridToScreen(regionCenterX, regionCenterY);
|
|
132495
|
+
const topCorner = gridToScreen(bounds.x, bounds.y);
|
|
132496
|
+
const bottomCorner = gridToScreen(
|
|
132497
|
+
bounds.x + bounds.width,
|
|
132498
|
+
bounds.y + bounds.height
|
|
132499
|
+
);
|
|
132500
|
+
const leftCorner = gridToScreen(bounds.x, bounds.y + bounds.height);
|
|
132501
|
+
const rightCorner = gridToScreen(bounds.x + bounds.width, bounds.y);
|
|
132502
|
+
const screenWidth = rightCorner.screenX - leftCorner.screenX;
|
|
132503
|
+
const screenHeight = bottomCorner.screenY - topCorner.screenY;
|
|
132504
|
+
return {
|
|
132505
|
+
centerX: center.screenX,
|
|
132506
|
+
centerY: center.screenY,
|
|
132507
|
+
screenWidth,
|
|
132508
|
+
screenHeight
|
|
132509
|
+
};
|
|
132510
|
+
}
|
|
132511
|
+
function domEventToGridCoords(clientX, clientY, viewport, canvasElement) {
|
|
132512
|
+
if (!viewport || !canvasElement) {
|
|
132513
|
+
console.warn(
|
|
132514
|
+
"[domEventToGridCoords] Missing viewport or canvas element, returning (0, 0)"
|
|
132515
|
+
);
|
|
132516
|
+
return { gridX: 0, gridY: 0 };
|
|
132517
|
+
}
|
|
132518
|
+
const rect = canvasElement.getBoundingClientRect();
|
|
132519
|
+
const canvasX = clientX - rect.left;
|
|
132520
|
+
const canvasY = clientY - rect.top;
|
|
132521
|
+
const worldPoint = viewport.toWorld({ x: canvasX, y: canvasY });
|
|
132522
|
+
const gridCoords = screenToGrid(worldPoint.x, worldPoint.y);
|
|
132523
|
+
return gridCoords;
|
|
132524
|
+
}
|
|
132409
132525
|
const STAR_TIERS = [
|
|
132410
132526
|
// Flags (basic tiers)
|
|
132411
132527
|
{ min: 0, max: 100, name: "New", decorationType: "flag", color: 9741240 },
|
|
@@ -132696,7 +132812,7 @@ function generatePavilionSprite(color2) {
|
|
|
132696
132812
|
pavilion.lineTo(12, 6);
|
|
132697
132813
|
pavilion.lineTo(6, 7);
|
|
132698
132814
|
pavilion.closePath();
|
|
132699
|
-
pavilion.fill(adjustBrightness
|
|
132815
|
+
pavilion.fill(adjustBrightness(color2, 0.7));
|
|
132700
132816
|
pavilion.beginPath();
|
|
132701
132817
|
pavilion.moveTo(1, 5);
|
|
132702
132818
|
pavilion.lineTo(6, 2);
|
|
@@ -132731,14 +132847,14 @@ function generateGazeboSprite(color2) {
|
|
|
132731
132847
|
gazebo.lineTo(12, 8);
|
|
132732
132848
|
gazebo.lineTo(7, 9);
|
|
132733
132849
|
gazebo.closePath();
|
|
132734
|
-
gazebo.fill(adjustBrightness
|
|
132850
|
+
gazebo.fill(adjustBrightness(color2, 0.6));
|
|
132735
132851
|
gazebo.beginPath();
|
|
132736
132852
|
gazebo.moveTo(3, 6);
|
|
132737
132853
|
gazebo.lineTo(7, 3);
|
|
132738
132854
|
gazebo.lineTo(11, 6);
|
|
132739
132855
|
gazebo.lineTo(7, 7);
|
|
132740
132856
|
gazebo.closePath();
|
|
132741
|
-
gazebo.fill(adjustBrightness
|
|
132857
|
+
gazebo.fill(adjustBrightness(color2, 0.8));
|
|
132742
132858
|
gazebo.beginPath();
|
|
132743
132859
|
gazebo.moveTo(4, 4);
|
|
132744
132860
|
gazebo.lineTo(7, 2);
|
|
@@ -132775,14 +132891,14 @@ function generateBandstandSprite(color2) {
|
|
|
132775
132891
|
bandstand.lineTo(16, 9);
|
|
132776
132892
|
bandstand.lineTo(8, 11);
|
|
132777
132893
|
bandstand.closePath();
|
|
132778
|
-
bandstand.fill(adjustBrightness
|
|
132894
|
+
bandstand.fill(adjustBrightness(color2, 0.6));
|
|
132779
132895
|
bandstand.beginPath();
|
|
132780
132896
|
bandstand.moveTo(2, 7);
|
|
132781
132897
|
bandstand.lineTo(8, 2);
|
|
132782
132898
|
bandstand.lineTo(14, 7);
|
|
132783
132899
|
bandstand.lineTo(8, 9);
|
|
132784
132900
|
bandstand.closePath();
|
|
132785
|
-
bandstand.fill(adjustBrightness
|
|
132901
|
+
bandstand.fill(adjustBrightness(color2, 0.8));
|
|
132786
132902
|
bandstand.beginPath();
|
|
132787
132903
|
bandstand.moveTo(4, 5);
|
|
132788
132904
|
bandstand.lineTo(8, 1);
|
|
@@ -132793,154 +132909,9 @@ function generateBandstandSprite(color2) {
|
|
|
132793
132909
|
bandstand.circle(8, 0, 2);
|
|
132794
132910
|
bandstand.fill(16766720);
|
|
132795
132911
|
bandstand.rect(3, 9, 10, 1);
|
|
132796
|
-
bandstand.fill(adjustBrightness
|
|
132912
|
+
bandstand.fill(adjustBrightness(color2, 1.2));
|
|
132797
132913
|
return bandstand;
|
|
132798
132914
|
}
|
|
132799
|
-
function adjustBrightness$1(color2, factor) {
|
|
132800
|
-
const r2 = color2 >> 16 & 255;
|
|
132801
|
-
const g2 = color2 >> 8 & 255;
|
|
132802
|
-
const b2 = color2 & 255;
|
|
132803
|
-
const newR = Math.min(255, Math.floor(r2 * factor));
|
|
132804
|
-
const newG = Math.min(255, Math.floor(g2 * factor));
|
|
132805
|
-
const newB = Math.min(255, Math.floor(b2 * factor));
|
|
132806
|
-
return newR << 16 | newG << 8 | newB;
|
|
132807
|
-
}
|
|
132808
|
-
function generateBuildingSprite(config) {
|
|
132809
|
-
const { size, color: color2 = 13789470, stars, collaborators } = config;
|
|
132810
|
-
const building = new Graphics();
|
|
132811
|
-
const baseWidth = 40 * size;
|
|
132812
|
-
const baseDepth = 40 * size;
|
|
132813
|
-
const baseHeight = 50 * size;
|
|
132814
|
-
const width = baseWidth;
|
|
132815
|
-
const depth = baseDepth;
|
|
132816
|
-
const height = baseHeight;
|
|
132817
|
-
const isoWidth = width;
|
|
132818
|
-
const isoDepthY = depth * 0.25;
|
|
132819
|
-
const darkColor = adjustBrightness(color2, 0.6);
|
|
132820
|
-
const mediumColor = adjustBrightness(color2, 0.75);
|
|
132821
|
-
const baseColor = color2;
|
|
132822
|
-
const lightColor = adjustBrightness(color2, 1.2);
|
|
132823
|
-
building.fillStyle = { color: darkColor };
|
|
132824
|
-
building.beginPath();
|
|
132825
|
-
building.moveTo(-isoWidth / 2, 0);
|
|
132826
|
-
building.lineTo(0, -isoDepthY);
|
|
132827
|
-
building.lineTo(isoWidth / 2, 0);
|
|
132828
|
-
building.lineTo(0, isoDepthY);
|
|
132829
|
-
building.closePath();
|
|
132830
|
-
building.fill();
|
|
132831
|
-
building.fillStyle = { color: mediumColor };
|
|
132832
|
-
building.beginPath();
|
|
132833
|
-
building.moveTo(-isoWidth / 2, 0);
|
|
132834
|
-
building.lineTo(-isoWidth / 2, -height);
|
|
132835
|
-
building.lineTo(0, -height - isoDepthY);
|
|
132836
|
-
building.lineTo(0, -isoDepthY);
|
|
132837
|
-
building.closePath();
|
|
132838
|
-
building.fill();
|
|
132839
|
-
building.fillStyle = { color: baseColor };
|
|
132840
|
-
building.beginPath();
|
|
132841
|
-
building.moveTo(0, -isoDepthY);
|
|
132842
|
-
building.lineTo(0, -height - isoDepthY);
|
|
132843
|
-
building.lineTo(isoWidth / 2, -height);
|
|
132844
|
-
building.lineTo(isoWidth / 2, 0);
|
|
132845
|
-
building.closePath();
|
|
132846
|
-
building.fill();
|
|
132847
|
-
building.fillStyle = { color: lightColor };
|
|
132848
|
-
building.beginPath();
|
|
132849
|
-
building.moveTo(-isoWidth / 2, -height);
|
|
132850
|
-
building.lineTo(0, -height - isoDepthY);
|
|
132851
|
-
building.lineTo(isoWidth / 2, -height);
|
|
132852
|
-
building.lineTo(0, -height + isoDepthY);
|
|
132853
|
-
building.closePath();
|
|
132854
|
-
building.fill();
|
|
132855
|
-
building.strokeStyle = { width: 2, color: 0, alpha: 0.3 };
|
|
132856
|
-
building.beginPath();
|
|
132857
|
-
building.moveTo(-isoWidth / 2, 0);
|
|
132858
|
-
building.lineTo(-isoWidth / 2, -height);
|
|
132859
|
-
building.lineTo(0, -height - isoDepthY);
|
|
132860
|
-
building.lineTo(isoWidth / 2, -height);
|
|
132861
|
-
building.lineTo(isoWidth / 2, 0);
|
|
132862
|
-
building.stroke();
|
|
132863
|
-
if (stars && stars > 0) {
|
|
132864
|
-
const tier = getStarTier(stars);
|
|
132865
|
-
if (tier) {
|
|
132866
|
-
let decoration;
|
|
132867
|
-
switch (tier.decorationType) {
|
|
132868
|
-
case "flag":
|
|
132869
|
-
decoration = generateFlagSprite(tier.color);
|
|
132870
|
-
break;
|
|
132871
|
-
case "trophy":
|
|
132872
|
-
decoration = generateTrophySprite(tier.color);
|
|
132873
|
-
break;
|
|
132874
|
-
case "statue":
|
|
132875
|
-
decoration = generateStatueSprite(tier.color);
|
|
132876
|
-
break;
|
|
132877
|
-
}
|
|
132878
|
-
const decorationX = -isoWidth / 4;
|
|
132879
|
-
const decorationY = 0;
|
|
132880
|
-
decoration.x = decorationX;
|
|
132881
|
-
decoration.y = decorationY;
|
|
132882
|
-
decoration.scale.set(1.8);
|
|
132883
|
-
building.addChild(decoration);
|
|
132884
|
-
const countText = new Text({
|
|
132885
|
-
text: formatStarCount(stars),
|
|
132886
|
-
style: {
|
|
132887
|
-
fontSize: 10,
|
|
132888
|
-
fill: 16777215,
|
|
132889
|
-
fontFamily: "Arial",
|
|
132890
|
-
fontWeight: "bold",
|
|
132891
|
-
stroke: { color: 0, width: 2 }
|
|
132892
|
-
},
|
|
132893
|
-
resolution: 2
|
|
132894
|
-
});
|
|
132895
|
-
countText.x = decorationX;
|
|
132896
|
-
countText.y = decorationY + 18;
|
|
132897
|
-
countText.anchor.set(0.5, 0);
|
|
132898
|
-
building.addChild(countText);
|
|
132899
|
-
}
|
|
132900
|
-
}
|
|
132901
|
-
if (collaborators && collaborators > 0) {
|
|
132902
|
-
const tier = getCollaboratorTier(collaborators);
|
|
132903
|
-
if (tier) {
|
|
132904
|
-
let decoration;
|
|
132905
|
-
switch (tier.decorationType) {
|
|
132906
|
-
case "bench":
|
|
132907
|
-
decoration = generateBenchSprite(tier.color);
|
|
132908
|
-
break;
|
|
132909
|
-
case "pavilion":
|
|
132910
|
-
decoration = generatePavilionSprite(tier.color);
|
|
132911
|
-
break;
|
|
132912
|
-
case "gazebo":
|
|
132913
|
-
decoration = generateGazeboSprite(tier.color);
|
|
132914
|
-
break;
|
|
132915
|
-
case "bandstand":
|
|
132916
|
-
decoration = generateBandstandSprite(tier.color);
|
|
132917
|
-
break;
|
|
132918
|
-
}
|
|
132919
|
-
const decorationX = isoWidth / 4;
|
|
132920
|
-
const decorationY = 0;
|
|
132921
|
-
decoration.x = decorationX;
|
|
132922
|
-
decoration.y = decorationY;
|
|
132923
|
-
decoration.scale.set(1.8);
|
|
132924
|
-
building.addChild(decoration);
|
|
132925
|
-
const countText = new Text({
|
|
132926
|
-
text: formatCollaboratorCount(collaborators),
|
|
132927
|
-
style: {
|
|
132928
|
-
fontSize: 10,
|
|
132929
|
-
fill: 16777215,
|
|
132930
|
-
fontFamily: "Arial",
|
|
132931
|
-
fontWeight: "bold",
|
|
132932
|
-
stroke: { color: 0, width: 2 }
|
|
132933
|
-
},
|
|
132934
|
-
resolution: 2
|
|
132935
|
-
});
|
|
132936
|
-
countText.x = decorationX;
|
|
132937
|
-
countText.y = decorationY + 18;
|
|
132938
|
-
countText.anchor.set(0.5, 0);
|
|
132939
|
-
building.addChild(countText);
|
|
132940
|
-
}
|
|
132941
|
-
}
|
|
132942
|
-
return building;
|
|
132943
|
-
}
|
|
132944
132915
|
function adjustBrightness(color2, factor) {
|
|
132945
132916
|
const r2 = color2 >> 16 & 255;
|
|
132946
132917
|
const g2 = color2 >> 8 & 255;
|
|
@@ -132950,56 +132921,6 @@ function adjustBrightness(color2, factor) {
|
|
|
132950
132921
|
const newB = Math.min(255, Math.floor(b2 * factor));
|
|
132951
132922
|
return newR << 16 | newG << 8 | newB;
|
|
132952
132923
|
}
|
|
132953
|
-
const TILE_SIZE = 32;
|
|
132954
|
-
const MAX_NODES_PER_MAP = 12;
|
|
132955
|
-
const REGION_SIZE_TILES = 25;
|
|
132956
|
-
const ISO_TILE_WIDTH$1 = TILE_SIZE * 2;
|
|
132957
|
-
const ISO_TILE_HEIGHT$1 = TILE_SIZE;
|
|
132958
|
-
function gridToScreen(gridX, gridY) {
|
|
132959
|
-
const screenX = (gridX - gridY) * (ISO_TILE_WIDTH$1 / 2);
|
|
132960
|
-
const screenY = (gridX + gridY) * (ISO_TILE_HEIGHT$1 / 2);
|
|
132961
|
-
return { screenX, screenY };
|
|
132962
|
-
}
|
|
132963
|
-
function screenToGrid(screenX, screenY) {
|
|
132964
|
-
const gridX = (screenX / (ISO_TILE_WIDTH$1 / 2) + screenY / (ISO_TILE_HEIGHT$1 / 2)) / 2;
|
|
132965
|
-
const gridY = (screenY / (ISO_TILE_HEIGHT$1 / 2) - screenX / (ISO_TILE_WIDTH$1 / 2)) / 2;
|
|
132966
|
-
return { gridX, gridY };
|
|
132967
|
-
}
|
|
132968
|
-
function getIsometricZIndex(gridX, gridY) {
|
|
132969
|
-
return gridX + gridY;
|
|
132970
|
-
}
|
|
132971
|
-
function calculateRegionCameraPosition(regionCenterX, regionCenterY, bounds) {
|
|
132972
|
-
const center = gridToScreen(regionCenterX, regionCenterY);
|
|
132973
|
-
const topCorner = gridToScreen(bounds.x, bounds.y);
|
|
132974
|
-
const bottomCorner = gridToScreen(
|
|
132975
|
-
bounds.x + bounds.width,
|
|
132976
|
-
bounds.y + bounds.height
|
|
132977
|
-
);
|
|
132978
|
-
const leftCorner = gridToScreen(bounds.x, bounds.y + bounds.height);
|
|
132979
|
-
const rightCorner = gridToScreen(bounds.x + bounds.width, bounds.y);
|
|
132980
|
-
const screenWidth = rightCorner.screenX - leftCorner.screenX;
|
|
132981
|
-
const screenHeight = bottomCorner.screenY - topCorner.screenY;
|
|
132982
|
-
return {
|
|
132983
|
-
centerX: center.screenX,
|
|
132984
|
-
centerY: center.screenY,
|
|
132985
|
-
screenWidth,
|
|
132986
|
-
screenHeight
|
|
132987
|
-
};
|
|
132988
|
-
}
|
|
132989
|
-
function domEventToGridCoords(clientX, clientY, viewport, canvasElement) {
|
|
132990
|
-
if (!viewport || !canvasElement) {
|
|
132991
|
-
console.warn(
|
|
132992
|
-
"[domEventToGridCoords] Missing viewport or canvas element, returning (0, 0)"
|
|
132993
|
-
);
|
|
132994
|
-
return { gridX: 0, gridY: 0 };
|
|
132995
|
-
}
|
|
132996
|
-
const rect = canvasElement.getBoundingClientRect();
|
|
132997
|
-
const canvasX = clientX - rect.left;
|
|
132998
|
-
const canvasY = clientY - rect.top;
|
|
132999
|
-
const worldPoint = viewport.toWorld({ x: canvasX, y: canvasY });
|
|
133000
|
-
const gridCoords = screenToGrid(worldPoint.x, worldPoint.y);
|
|
133001
|
-
return gridCoords;
|
|
133002
|
-
}
|
|
133003
132924
|
const TILE_WIDTH = ISO_TILE_WIDTH$1;
|
|
133004
132925
|
const TILE_HEIGHT = ISO_TILE_HEIGHT$1;
|
|
133005
132926
|
function calculateFootprint(sizeMultiplier) {
|
|
@@ -133905,6 +133826,12 @@ class IsometricRenderer {
|
|
|
133905
133826
|
if (instance.ownerAvatar) {
|
|
133906
133827
|
nodes.addChild(instance.ownerAvatar);
|
|
133907
133828
|
}
|
|
133829
|
+
if (instance.starDecoration) {
|
|
133830
|
+
nodes.addChild(instance.starDecoration);
|
|
133831
|
+
}
|
|
133832
|
+
if (instance.collaboratorDecoration) {
|
|
133833
|
+
nodes.addChild(instance.collaboratorDecoration);
|
|
133834
|
+
}
|
|
133908
133835
|
nodes.addChild(instance.label);
|
|
133909
133836
|
if (instance.hoverLabel) {
|
|
133910
133837
|
nodes.addChild(instance.hoverLabel);
|
|
@@ -134189,14 +134116,21 @@ class IsometricRenderer {
|
|
|
134189
134116
|
decoration = generateStatueSprite(tier.color);
|
|
134190
134117
|
break;
|
|
134191
134118
|
}
|
|
134119
|
+
const decorationDimensions = {
|
|
134120
|
+
flag: { w: 8, h: 12 },
|
|
134121
|
+
trophy: { w: 8, h: 10 },
|
|
134122
|
+
statue: { w: 10, h: 15 }
|
|
134123
|
+
};
|
|
134124
|
+
const dim = decorationDimensions[tier.decorationType] || { w: 8, h: 12 };
|
|
134125
|
+
decoration.pivot.set(dim.w, dim.h);
|
|
134192
134126
|
const decorationX = -footprintWidth / 2;
|
|
134193
134127
|
const decorationY = 0;
|
|
134194
134128
|
decoration.x = decorationX;
|
|
134195
134129
|
decoration.y = decorationY;
|
|
134196
|
-
decoration.scale.set(1.
|
|
134130
|
+
decoration.scale.set(1.5 * sizeMultiplier);
|
|
134197
134131
|
container.addChild(decoration);
|
|
134198
134132
|
const countText = new Text({
|
|
134199
|
-
text: formatStarCount(node2.stars)
|
|
134133
|
+
text: `${formatStarCount(node2.stars)} stars`,
|
|
134200
134134
|
style: {
|
|
134201
134135
|
fontSize: 10,
|
|
134202
134136
|
fill: 16777215,
|
|
@@ -134206,8 +134140,8 @@ class IsometricRenderer {
|
|
|
134206
134140
|
},
|
|
134207
134141
|
resolution: 2
|
|
134208
134142
|
});
|
|
134209
|
-
countText.x = decorationX;
|
|
134210
|
-
countText.y = decorationY +
|
|
134143
|
+
countText.x = decorationX - dim.w * 1.5 * sizeMultiplier / 2;
|
|
134144
|
+
countText.y = decorationY + 4;
|
|
134211
134145
|
countText.anchor.set(0.5, 0);
|
|
134212
134146
|
container.addChild(countText);
|
|
134213
134147
|
}
|
|
@@ -134230,14 +134164,22 @@ class IsometricRenderer {
|
|
|
134230
134164
|
decoration = generateBandstandSprite(tier.color);
|
|
134231
134165
|
break;
|
|
134232
134166
|
}
|
|
134167
|
+
const decorationDimensions = {
|
|
134168
|
+
bench: { w: 8, h: 9 },
|
|
134169
|
+
pavilion: { w: 12, h: 12 },
|
|
134170
|
+
gazebo: { w: 14, h: 14 },
|
|
134171
|
+
bandstand: { w: 16, h: 16 }
|
|
134172
|
+
};
|
|
134173
|
+
const dim = decorationDimensions[tier.decorationType] || { w: 12, h: 12 };
|
|
134174
|
+
decoration.pivot.set(0, dim.h);
|
|
134233
134175
|
const decorationX = footprintWidth / 2;
|
|
134234
134176
|
const decorationY = 0;
|
|
134235
134177
|
decoration.x = decorationX;
|
|
134236
134178
|
decoration.y = decorationY;
|
|
134237
|
-
decoration.scale.set(1.
|
|
134179
|
+
decoration.scale.set(1.5 * sizeMultiplier);
|
|
134238
134180
|
container.addChild(decoration);
|
|
134239
134181
|
const countText = new Text({
|
|
134240
|
-
text: formatCollaboratorCount(node2.collaborators)
|
|
134182
|
+
text: `${formatCollaboratorCount(node2.collaborators)} collabs`,
|
|
134241
134183
|
style: {
|
|
134242
134184
|
fontSize: 10,
|
|
134243
134185
|
fill: 16777215,
|
|
@@ -134247,8 +134189,8 @@ class IsometricRenderer {
|
|
|
134247
134189
|
},
|
|
134248
134190
|
resolution: 2
|
|
134249
134191
|
});
|
|
134250
|
-
countText.x = decorationX;
|
|
134251
|
-
countText.y = decorationY +
|
|
134192
|
+
countText.x = decorationX + dim.w * 1.5 * sizeMultiplier / 2;
|
|
134193
|
+
countText.y = decorationY + 4;
|
|
134252
134194
|
countText.anchor.set(0.5, 0);
|
|
134253
134195
|
container.addChild(countText);
|
|
134254
134196
|
}
|
|
@@ -134534,6 +134476,104 @@ class IsometricRenderer {
|
|
|
134534
134476
|
ownerAvatar = void 0;
|
|
134535
134477
|
}
|
|
134536
134478
|
}
|
|
134479
|
+
let starDecoration;
|
|
134480
|
+
if (node2.stars && node2.stars > 0) {
|
|
134481
|
+
const tier = getStarTier(node2.stars);
|
|
134482
|
+
if (tier) {
|
|
134483
|
+
const footprint = calculateFootprint(sizeMultiplier);
|
|
134484
|
+
starDecoration = new Container();
|
|
134485
|
+
let decoration;
|
|
134486
|
+
switch (tier.decorationType) {
|
|
134487
|
+
case "flag":
|
|
134488
|
+
decoration = generateFlagSprite(tier.color);
|
|
134489
|
+
break;
|
|
134490
|
+
case "trophy":
|
|
134491
|
+
decoration = generateTrophySprite(tier.color);
|
|
134492
|
+
break;
|
|
134493
|
+
case "statue":
|
|
134494
|
+
decoration = generateStatueSprite(tier.color);
|
|
134495
|
+
break;
|
|
134496
|
+
}
|
|
134497
|
+
const decorationDimensions = {
|
|
134498
|
+
flag: { w: 8, h: 12 },
|
|
134499
|
+
trophy: { w: 8, h: 10 },
|
|
134500
|
+
statue: { w: 10, h: 15 }
|
|
134501
|
+
};
|
|
134502
|
+
const dim = decorationDimensions[tier.decorationType] || { w: 8, h: 12 };
|
|
134503
|
+
decoration.pivot.set(dim.w, dim.h);
|
|
134504
|
+
decoration.scale.set(1.5 * sizeMultiplier);
|
|
134505
|
+
starDecoration.addChild(decoration);
|
|
134506
|
+
const countText = new Text({
|
|
134507
|
+
text: `${formatStarCount(node2.stars)} stars`,
|
|
134508
|
+
style: {
|
|
134509
|
+
fontSize: 10,
|
|
134510
|
+
fill: 16777215,
|
|
134511
|
+
fontFamily: "Arial",
|
|
134512
|
+
fontWeight: "bold",
|
|
134513
|
+
stroke: { color: 0, width: 2 }
|
|
134514
|
+
},
|
|
134515
|
+
resolution: 2
|
|
134516
|
+
});
|
|
134517
|
+
countText.x = -(dim.w * 1.5 * sizeMultiplier) / 2;
|
|
134518
|
+
countText.y = 4;
|
|
134519
|
+
countText.anchor.set(0.5, 0);
|
|
134520
|
+
starDecoration.addChild(countText);
|
|
134521
|
+
starDecoration.x = screenX - footprint.width / 2;
|
|
134522
|
+
starDecoration.y = screenY;
|
|
134523
|
+
starDecoration.zIndex = sprite.zIndex + 0.11;
|
|
134524
|
+
}
|
|
134525
|
+
}
|
|
134526
|
+
let collaboratorDecoration;
|
|
134527
|
+
if (node2.collaborators && node2.collaborators > 0) {
|
|
134528
|
+
const tier = getCollaboratorTier(node2.collaborators);
|
|
134529
|
+
if (tier) {
|
|
134530
|
+
const footprint = calculateFootprint(sizeMultiplier);
|
|
134531
|
+
collaboratorDecoration = new Container();
|
|
134532
|
+
let decoration;
|
|
134533
|
+
switch (tier.decorationType) {
|
|
134534
|
+
case "bench":
|
|
134535
|
+
decoration = generateBenchSprite(tier.color);
|
|
134536
|
+
break;
|
|
134537
|
+
case "pavilion":
|
|
134538
|
+
decoration = generatePavilionSprite(tier.color);
|
|
134539
|
+
break;
|
|
134540
|
+
case "gazebo":
|
|
134541
|
+
decoration = generateGazeboSprite(tier.color);
|
|
134542
|
+
break;
|
|
134543
|
+
case "bandstand":
|
|
134544
|
+
decoration = generateBandstandSprite(tier.color);
|
|
134545
|
+
break;
|
|
134546
|
+
}
|
|
134547
|
+
const decorationDimensions = {
|
|
134548
|
+
bench: { w: 8, h: 9 },
|
|
134549
|
+
pavilion: { w: 12, h: 12 },
|
|
134550
|
+
gazebo: { w: 14, h: 14 },
|
|
134551
|
+
bandstand: { w: 16, h: 16 }
|
|
134552
|
+
};
|
|
134553
|
+
const dim = decorationDimensions[tier.decorationType] || { w: 12, h: 12 };
|
|
134554
|
+
decoration.pivot.set(0, dim.h);
|
|
134555
|
+
decoration.scale.set(1.5 * sizeMultiplier);
|
|
134556
|
+
collaboratorDecoration.addChild(decoration);
|
|
134557
|
+
const countText = new Text({
|
|
134558
|
+
text: `${formatCollaboratorCount(node2.collaborators)} collabs`,
|
|
134559
|
+
style: {
|
|
134560
|
+
fontSize: 10,
|
|
134561
|
+
fill: 16777215,
|
|
134562
|
+
fontFamily: "Arial",
|
|
134563
|
+
fontWeight: "bold",
|
|
134564
|
+
stroke: { color: 0, width: 2 }
|
|
134565
|
+
},
|
|
134566
|
+
resolution: 2
|
|
134567
|
+
});
|
|
134568
|
+
countText.x = dim.w * 1.5 * sizeMultiplier / 2;
|
|
134569
|
+
countText.y = 4;
|
|
134570
|
+
countText.anchor.set(0.5, 0);
|
|
134571
|
+
collaboratorDecoration.addChild(countText);
|
|
134572
|
+
collaboratorDecoration.x = screenX + footprint.width / 2;
|
|
134573
|
+
collaboratorDecoration.y = screenY;
|
|
134574
|
+
collaboratorDecoration.zIndex = sprite.zIndex + 0.11;
|
|
134575
|
+
}
|
|
134576
|
+
}
|
|
134537
134577
|
const instance = {
|
|
134538
134578
|
sprite,
|
|
134539
134579
|
highlight,
|
|
@@ -134542,6 +134582,8 @@ class IsometricRenderer {
|
|
|
134542
134582
|
licenseGround,
|
|
134543
134583
|
licenseSign,
|
|
134544
134584
|
ownerAvatar,
|
|
134585
|
+
starDecoration,
|
|
134586
|
+
collaboratorDecoration,
|
|
134545
134587
|
gridPosition: { gridX: node2.gridX, gridY: node2.gridY },
|
|
134546
134588
|
size: sizeMultiplier,
|
|
134547
134589
|
spriteKey: node2.sprite,
|
|
@@ -134587,6 +134629,18 @@ class IsometricRenderer {
|
|
|
134587
134629
|
ownerAvatar.y = pos.screenY + footprint.height - 12;
|
|
134588
134630
|
ownerAvatar.zIndex = getIsometricZIndex(gridX, gridY) + 0.12;
|
|
134589
134631
|
}
|
|
134632
|
+
if (starDecoration) {
|
|
134633
|
+
const footprint = calculateFootprint(sizeMultiplier);
|
|
134634
|
+
starDecoration.x = pos.screenX - footprint.width / 2;
|
|
134635
|
+
starDecoration.y = pos.screenY;
|
|
134636
|
+
starDecoration.zIndex = getIsometricZIndex(gridX, gridY) + 0.11;
|
|
134637
|
+
}
|
|
134638
|
+
if (collaboratorDecoration) {
|
|
134639
|
+
const footprint = calculateFootprint(sizeMultiplier);
|
|
134640
|
+
collaboratorDecoration.x = pos.screenX + footprint.width / 2;
|
|
134641
|
+
collaboratorDecoration.y = pos.screenY;
|
|
134642
|
+
collaboratorDecoration.zIndex = getIsometricZIndex(gridX, gridY) + 0.11;
|
|
134643
|
+
}
|
|
134590
134644
|
instance.gridPosition = { gridX, gridY };
|
|
134591
134645
|
},
|
|
134592
134646
|
destroy: () => {
|
|
@@ -134597,6 +134651,8 @@ class IsometricRenderer {
|
|
|
134597
134651
|
licenseGround == null ? void 0 : licenseGround.destroy();
|
|
134598
134652
|
licenseSign == null ? void 0 : licenseSign.destroy();
|
|
134599
134653
|
ownerAvatar == null ? void 0 : ownerAvatar.destroy();
|
|
134654
|
+
starDecoration == null ? void 0 : starDecoration.destroy();
|
|
134655
|
+
collaboratorDecoration == null ? void 0 : collaboratorDecoration.destroy();
|
|
134600
134656
|
}
|
|
134601
134657
|
};
|
|
134602
134658
|
spriteInstances.set(node2.id, instance);
|
|
@@ -136447,13 +136503,9 @@ const OverworldMapPanelContent = ({
|
|
|
136447
136503
|
const [, sizeStr, colorHex, starsStr, collaboratorsStr] = key.split("-");
|
|
136448
136504
|
const size = parseFloat(sizeStr);
|
|
136449
136505
|
const color2 = parseInt(colorHex.replace("#", ""), 16);
|
|
136450
|
-
const stars = parseInt(starsStr) || 0;
|
|
136451
|
-
const collaborators = parseInt(collaboratorsStr) || 0;
|
|
136452
136506
|
const buildingGraphics = generateBuildingSprite({
|
|
136453
136507
|
size,
|
|
136454
|
-
color: color2
|
|
136455
|
-
stars,
|
|
136456
|
-
collaborators
|
|
136508
|
+
color: color2
|
|
136457
136509
|
});
|
|
136458
136510
|
const texture = app.renderer.generateTexture({
|
|
136459
136511
|
target: buildingGraphics,
|
|
@@ -138891,4 +138943,4 @@ export {
|
|
|
138891
138943
|
UPDATE_PRIORITY as y,
|
|
138892
138944
|
removeItems as z
|
|
138893
138945
|
};
|
|
138894
|
-
//# sourceMappingURL=index-
|
|
138946
|
+
//# sourceMappingURL=index-B_w7mlVu.js.map
|