@almadar/ui 5.55.0 → 5.57.0
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/avl/index.cjs +267 -92
- package/dist/avl/index.js +269 -94
- package/dist/components/game/molecules/GameCanvas3D.d.ts +4 -0
- package/dist/components/game/molecules/IsometricCanvas.d.ts +5 -1
- package/dist/components/game/molecules/three/index.cjs +149 -111
- package/dist/components/game/molecules/three/index.js +149 -111
- package/dist/components/game/organisms/BattleBoard.d.ts +5 -1
- package/dist/components/game/organisms/GameBoard3D.d.ts +5 -1
- package/dist/components/game/organisms/RoguelikeBoard.d.ts +3 -1
- package/dist/components/game/organisms/TowerDefenseBoard.d.ts +4 -1
- package/dist/components/game/organisms/WorldMapBoard.d.ts +5 -1
- package/dist/components/game/templates/GameCanvas3DBattleTemplate.d.ts +5 -1
- package/dist/components/game/templates/GameCanvas3DCastleTemplate.d.ts +5 -1
- package/dist/components/game/templates/GameCanvas3DWorldMapTemplate.d.ts +5 -1
- package/dist/components/index.cjs +263 -91
- package/dist/components/index.js +263 -91
- package/dist/providers/index.cjs +263 -91
- package/dist/providers/index.js +263 -91
- package/dist/runtime/index.cjs +267 -92
- package/dist/runtime/index.js +269 -94
- package/package.json +1 -1
|
@@ -182,6 +182,10 @@ export interface GameCanvas3DProps {
|
|
|
182
182
|
selectedTileIds?: string[];
|
|
183
183
|
/** Selected unit ID */
|
|
184
184
|
selectedUnitId?: string | null;
|
|
185
|
+
/** Unit draw-size multiplier. 1 = default tile-proportional size. */
|
|
186
|
+
unitScale?: number;
|
|
187
|
+
/** Board zoom/group scale. Applied to the scene group. Default 0.45. */
|
|
188
|
+
scale?: number;
|
|
185
189
|
}
|
|
186
190
|
/** Imperative handle for GameCanvas3D */
|
|
187
191
|
export interface GameCanvas3DHandle {
|
|
@@ -91,6 +91,10 @@ export interface IsometricCanvasProps {
|
|
|
91
91
|
enableCamera?: boolean;
|
|
92
92
|
/** Extra scale multiplier for unit draw size. 1 = default. */
|
|
93
93
|
unitScale?: number;
|
|
94
|
+
/** Ratio of unit draw height to scaledFloorHeight. Default 1.5. */
|
|
95
|
+
spriteHeightRatio?: number;
|
|
96
|
+
/** Max unit draw width as a ratio of scaledTileWidth. Default 0.6. */
|
|
97
|
+
spriteMaxWidthRatio?: number;
|
|
94
98
|
/** Board width in tiles (overrides tile-derived size) */
|
|
95
99
|
boardWidth?: number;
|
|
96
100
|
/** Board height in tiles (overrides tile-derived size) */
|
|
@@ -125,7 +129,7 @@ export interface IsometricCanvasProps {
|
|
|
125
129
|
effects?: Record<string, string>;
|
|
126
130
|
};
|
|
127
131
|
}
|
|
128
|
-
export declare function IsometricCanvas({ className, isLoading, error, tiles: _tilesPropRaw, units: _unitsPropRaw, features: _featuresPropRaw, selectedUnitId, validMoves, attackTargets, hoveredTile, onTileClick, onUnitClick, onTileHover, onTileLeave, tileClickEvent, unitClickEvent, tileHoverEvent, tileLeaveEvent, scale, debug, backgroundImage, showMinimap, enableCamera, unitScale, getTerrainSprite, getFeatureSprite, getUnitSprite, resolveUnitFrame, effectSpriteUrls, onDrawEffects, hasActiveEffects, diamondTopY: diamondTopYProp, assetBaseUrl, assetManifest, }: IsometricCanvasProps): React.JSX.Element;
|
|
132
|
+
export declare function IsometricCanvas({ className, isLoading, error, tiles: _tilesPropRaw, units: _unitsPropRaw, features: _featuresPropRaw, selectedUnitId, validMoves, attackTargets, hoveredTile, onTileClick, onUnitClick, onTileHover, onTileLeave, tileClickEvent, unitClickEvent, tileHoverEvent, tileLeaveEvent, scale, debug, backgroundImage, showMinimap, enableCamera, unitScale, spriteHeightRatio, spriteMaxWidthRatio, getTerrainSprite, getFeatureSprite, getUnitSprite, resolveUnitFrame, effectSpriteUrls, onDrawEffects, hasActiveEffects, diamondTopY: diamondTopYProp, assetBaseUrl, assetManifest, }: IsometricCanvasProps): React.JSX.Element;
|
|
129
133
|
export declare namespace IsometricCanvas {
|
|
130
134
|
var displayName: string;
|
|
131
135
|
}
|
|
@@ -2583,6 +2583,7 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2583
2583
|
attackTargets = [],
|
|
2584
2584
|
selectedTileIds = [],
|
|
2585
2585
|
selectedUnitId = null,
|
|
2586
|
+
unitScale = 1,
|
|
2586
2587
|
children
|
|
2587
2588
|
}, ref) => {
|
|
2588
2589
|
const containerRef = React11.useRef(null);
|
|
@@ -2799,12 +2800,18 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2799
2800
|
},
|
|
2800
2801
|
[selectedTileIds, hoveredTile, validMoves, attackTargets, handleTileClick, handleTileHover]
|
|
2801
2802
|
);
|
|
2803
|
+
const UNIT_BASE_MODEL_SCALE = 0.5;
|
|
2804
|
+
const UNIT_BASE_BILLBOARD_HEIGHT = 1.2;
|
|
2805
|
+
const UNIT_BASE_PRIMITIVE_RADIUS = 0.3;
|
|
2802
2806
|
const DefaultUnitRenderer = React11.useCallback(
|
|
2803
2807
|
({ unit, position }) => {
|
|
2804
2808
|
const isSelected = selectedUnitId === unit.id;
|
|
2805
2809
|
const color = unit.faction === "player" ? 4491519 : unit.faction === "enemy" ? 16729156 : 16777028;
|
|
2806
2810
|
const hasAtlas = unitAtlasUrl(unit) !== null;
|
|
2807
2811
|
const initialFrame = hasAtlas ? resolveUnitFrame(unit.id) : null;
|
|
2812
|
+
const modelScale = UNIT_BASE_MODEL_SCALE * unitScale;
|
|
2813
|
+
const billboardHeight = UNIT_BASE_BILLBOARD_HEIGHT * unitScale;
|
|
2814
|
+
const primitiveRadius = UNIT_BASE_PRIMITIVE_RADIUS * unitScale;
|
|
2808
2815
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2809
2816
|
"group",
|
|
2810
2817
|
{
|
|
@@ -2822,7 +2829,8 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2822
2829
|
UnitSpriteBillboard,
|
|
2823
2830
|
{
|
|
2824
2831
|
sheetUrl: initialFrame.sheetUrl,
|
|
2825
|
-
resolveFrame: () => resolveUnitFrame(unit.id)
|
|
2832
|
+
resolveFrame: () => resolveUnitFrame(unit.id),
|
|
2833
|
+
height: billboardHeight
|
|
2826
2834
|
}
|
|
2827
2835
|
) })
|
|
2828
2836
|
) : unit.modelUrl ? (
|
|
@@ -2831,22 +2839,22 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2831
2839
|
ModelLoader,
|
|
2832
2840
|
{
|
|
2833
2841
|
url: unit.modelUrl,
|
|
2834
|
-
scale:
|
|
2842
|
+
scale: modelScale,
|
|
2835
2843
|
fallbackGeometry: "box",
|
|
2836
2844
|
castShadow: true
|
|
2837
2845
|
}
|
|
2838
2846
|
)
|
|
2839
2847
|
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2840
|
-
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0,
|
|
2841
|
-
/* @__PURE__ */ jsxRuntime.jsx("cylinderGeometry", { args: [
|
|
2848
|
+
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0, primitiveRadius, 0], children: [
|
|
2849
|
+
/* @__PURE__ */ jsxRuntime.jsx("cylinderGeometry", { args: [primitiveRadius, primitiveRadius, primitiveRadius * 0.33, 8] }),
|
|
2842
2850
|
/* @__PURE__ */ jsxRuntime.jsx("meshStandardMaterial", { color })
|
|
2843
2851
|
] }),
|
|
2844
|
-
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0,
|
|
2845
|
-
/* @__PURE__ */ jsxRuntime.jsx("capsuleGeometry", { args: [0.
|
|
2852
|
+
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0, primitiveRadius * 2, 0], children: [
|
|
2853
|
+
/* @__PURE__ */ jsxRuntime.jsx("capsuleGeometry", { args: [primitiveRadius * 0.67, primitiveRadius * 1.33, 4, 8] }),
|
|
2846
2854
|
/* @__PURE__ */ jsxRuntime.jsx("meshStandardMaterial", { color })
|
|
2847
2855
|
] }),
|
|
2848
|
-
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0,
|
|
2849
|
-
/* @__PURE__ */ jsxRuntime.jsx("sphereGeometry", { args: [0.
|
|
2856
|
+
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0, primitiveRadius * 3, 0], children: [
|
|
2857
|
+
/* @__PURE__ */ jsxRuntime.jsx("sphereGeometry", { args: [primitiveRadius * 0.4, 8, 8] }),
|
|
2850
2858
|
/* @__PURE__ */ jsxRuntime.jsx("meshStandardMaterial", { color })
|
|
2851
2859
|
] })
|
|
2852
2860
|
] }),
|
|
@@ -2879,7 +2887,7 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2879
2887
|
}
|
|
2880
2888
|
);
|
|
2881
2889
|
},
|
|
2882
|
-
[selectedUnitId, handleUnitClick, resolveUnitFrame]
|
|
2890
|
+
[selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale]
|
|
2883
2891
|
);
|
|
2884
2892
|
const DefaultFeatureRenderer = React11.useCallback(
|
|
2885
2893
|
({
|
|
@@ -3022,33 +3030,35 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
3022
3030
|
fadeStrength: 1
|
|
3023
3031
|
}
|
|
3024
3032
|
),
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3033
|
+
/* @__PURE__ */ jsxRuntime.jsxs("group", { children: [
|
|
3034
|
+
tiles.map((tile, index) => {
|
|
3035
|
+
const position = gridToWorld2(
|
|
3036
|
+
tile.x,
|
|
3037
|
+
tile.z ?? tile.y ?? 0,
|
|
3038
|
+
tile.elevation ?? 0
|
|
3039
|
+
);
|
|
3040
|
+
const Renderer = CustomTileRenderer || DefaultTileRenderer;
|
|
3041
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Renderer, { tile, position }, tile.id ?? `tile-${index}`);
|
|
3042
|
+
}),
|
|
3043
|
+
features.map((feature, index) => {
|
|
3044
|
+
const position = gridToWorld2(
|
|
3045
|
+
feature.x,
|
|
3046
|
+
feature.z ?? feature.y ?? 0,
|
|
3047
|
+
(feature.elevation ?? 0) + 0.5
|
|
3048
|
+
);
|
|
3049
|
+
const Renderer = CustomFeatureRenderer || DefaultFeatureRenderer;
|
|
3050
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Renderer, { feature, position }, feature.id ?? `feature-${index}`);
|
|
3051
|
+
}),
|
|
3052
|
+
units.map((unit) => {
|
|
3053
|
+
const position = gridToWorld2(
|
|
3054
|
+
unit.x ?? 0,
|
|
3055
|
+
unit.z ?? unit.y ?? 0,
|
|
3056
|
+
(unit.elevation ?? 0) + 0.5
|
|
3057
|
+
);
|
|
3058
|
+
const Renderer = CustomUnitRenderer || DefaultUnitRenderer;
|
|
3059
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Renderer, { unit, position }, unit.id);
|
|
3060
|
+
})
|
|
3061
|
+
] }),
|
|
3052
3062
|
children,
|
|
3053
3063
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3054
3064
|
drei.OrbitControls,
|
|
@@ -4236,6 +4246,8 @@ function GameBoard3D({
|
|
|
4236
4246
|
features = [],
|
|
4237
4247
|
cameraMode = "perspective",
|
|
4238
4248
|
backgroundColor = "#2a1a1a",
|
|
4249
|
+
unitScale = 1,
|
|
4250
|
+
scale = 0.45,
|
|
4239
4251
|
tileClickEvent,
|
|
4240
4252
|
unitClickEvent,
|
|
4241
4253
|
attackEvent,
|
|
@@ -4336,6 +4348,8 @@ function GameBoard3D({
|
|
|
4336
4348
|
selectedUnitId,
|
|
4337
4349
|
validMoves,
|
|
4338
4350
|
attackTargets,
|
|
4351
|
+
unitScale,
|
|
4352
|
+
scale,
|
|
4339
4353
|
className: "game-board-3d__canvas w-full min-h-[85vh]"
|
|
4340
4354
|
}
|
|
4341
4355
|
),
|
|
@@ -4576,32 +4590,36 @@ var Box = React11__default.default.forwardRef(
|
|
|
4576
4590
|
}
|
|
4577
4591
|
);
|
|
4578
4592
|
Box.displayName = "Box";
|
|
4593
|
+
var CDN = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
|
|
4594
|
+
var FLOOR_WALL = `${CDN}/template-floor-detail-a.glb`;
|
|
4595
|
+
var FLOOR_DIRT = `${CDN}/template-floor-detail.glb`;
|
|
4596
|
+
var FLOOR_OPEN = `${CDN}/template-floor.glb`;
|
|
4579
4597
|
var DEFAULT_3D_BATTLE_TILES = [
|
|
4580
|
-
{ id: "t00", x: 0, y: 0, z: 0, type: "stone", passable: false },
|
|
4581
|
-
{ id: "t10", x: 1, y: 0, z: 0, type: "stone", passable: false },
|
|
4582
|
-
{ id: "t20", x: 2, y: 0, z: 0, type: "stone", passable: false },
|
|
4583
|
-
{ id: "t30", x: 3, y: 0, z: 0, type: "stone", passable: false },
|
|
4584
|
-
{ id: "t40", x: 4, y: 0, z: 0, type: "stone", passable: false },
|
|
4585
|
-
{ id: "t01", x: 0, y: 1, z: 1, type: "stone", passable: false },
|
|
4586
|
-
{ id: "t11", x: 1, y: 1, z: 1, type: "dirt", passable: true },
|
|
4587
|
-
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true },
|
|
4588
|
-
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true },
|
|
4589
|
-
{ id: "t41", x: 4, y: 1, z: 1, type: "stone", passable: false },
|
|
4590
|
-
{ id: "t02", x: 0, y: 2, z: 2, type: "stone", passable: false },
|
|
4591
|
-
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true },
|
|
4592
|
-
{ id: "t22", x: 2, y: 2, z: 2, type: "dirt", passable: true },
|
|
4593
|
-
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true },
|
|
4594
|
-
{ id: "t42", x: 4, y: 2, z: 2, type: "stone", passable: false },
|
|
4595
|
-
{ id: "t03", x: 0, y: 3, z: 3, type: "stone", passable: false },
|
|
4596
|
-
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true },
|
|
4597
|
-
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true },
|
|
4598
|
-
{ id: "t33", x: 3, y: 3, z: 3, type: "dirt", passable: true },
|
|
4599
|
-
{ id: "t43", x: 4, y: 3, z: 3, type: "stone", passable: false },
|
|
4600
|
-
{ id: "t04", x: 0, y: 4, z: 4, type: "stone", passable: false },
|
|
4601
|
-
{ id: "t14", x: 1, y: 4, z: 4, type: "stone", passable: false },
|
|
4602
|
-
{ id: "t24", x: 2, y: 4, z: 4, type: "stone", passable: false },
|
|
4603
|
-
{ id: "t34", x: 3, y: 4, z: 4, type: "stone", passable: false },
|
|
4604
|
-
{ id: "t44", x: 4, y: 4, z: 4, type: "stone", passable: false }
|
|
4598
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4599
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4600
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4601
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4602
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4603
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4604
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
|
|
4605
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4606
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4607
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4608
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4609
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4610
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
|
|
4611
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4612
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4613
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4614
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4615
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4616
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
|
|
4617
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4618
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4619
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4620
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4621
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4622
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL }
|
|
4605
4623
|
];
|
|
4606
4624
|
var DEFAULT_3D_BATTLE_FEATURES = [
|
|
4607
4625
|
{ id: "f1", x: 2, y: 2, z: 2, type: "gold_mine", color: "#f4c542" },
|
|
@@ -4620,6 +4638,8 @@ function GameCanvas3DBattleTemplate({
|
|
|
4620
4638
|
attackEvent,
|
|
4621
4639
|
playAgainEvent,
|
|
4622
4640
|
gameEndEvent,
|
|
4641
|
+
unitScale,
|
|
4642
|
+
scale,
|
|
4623
4643
|
className
|
|
4624
4644
|
}) {
|
|
4625
4645
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -4640,6 +4660,8 @@ function GameCanvas3DBattleTemplate({
|
|
|
4640
4660
|
features,
|
|
4641
4661
|
cameraMode,
|
|
4642
4662
|
backgroundColor,
|
|
4663
|
+
unitScale,
|
|
4664
|
+
scale,
|
|
4643
4665
|
tileClickEvent,
|
|
4644
4666
|
unitClickEvent,
|
|
4645
4667
|
endTurnEvent,
|
|
@@ -4670,32 +4692,36 @@ function GameCanvas3DBattleTemplate({
|
|
|
4670
4692
|
);
|
|
4671
4693
|
}
|
|
4672
4694
|
GameCanvas3DBattleTemplate.displayName = "GameCanvas3DBattleTemplate";
|
|
4695
|
+
var CDN2 = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
|
|
4696
|
+
var FLOOR_WALL2 = `${CDN2}/template-floor-detail-a.glb`;
|
|
4697
|
+
var FLOOR_DIRT2 = `${CDN2}/template-floor-detail.glb`;
|
|
4698
|
+
var FLOOR_OPEN2 = `${CDN2}/template-floor.glb`;
|
|
4673
4699
|
var DEFAULT_3D_CASTLE_TILES = [
|
|
4674
|
-
{ id: "t00", x: 0, y: 0, z: 0, type: "wall", passable: false },
|
|
4675
|
-
{ id: "t10", x: 1, y: 0, z: 0, type: "wall", passable: false },
|
|
4676
|
-
{ id: "t20", x: 2, y: 0, z: 0, type: "wall", passable: false },
|
|
4677
|
-
{ id: "t30", x: 3, y: 0, z: 0, type: "wall", passable: false },
|
|
4678
|
-
{ id: "t40", x: 4, y: 0, z: 0, type: "wall", passable: false },
|
|
4679
|
-
{ id: "t01", x: 0, y: 1, z: 1, type: "wall", passable: false },
|
|
4680
|
-
{ id: "t11", x: 1, y: 1, z: 1, type: "floor", passable: true },
|
|
4681
|
-
{ id: "t21", x: 2, y: 1, z: 1, type: "floor", passable: true },
|
|
4682
|
-
{ id: "t31", x: 3, y: 1, z: 1, type: "floor", passable: true },
|
|
4683
|
-
{ id: "t41", x: 4, y: 1, z: 1, type: "wall", passable: false },
|
|
4684
|
-
{ id: "t02", x: 0, y: 2, z: 2, type: "wall", passable: false },
|
|
4685
|
-
{ id: "t12", x: 1, y: 2, z: 2, type: "floor", passable: true },
|
|
4686
|
-
{ id: "t22", x: 2, y: 2, z: 2, type: "floor", passable: true },
|
|
4687
|
-
{ id: "t32", x: 3, y: 2, z: 2, type: "floor", passable: true },
|
|
4688
|
-
{ id: "t42", x: 4, y: 2, z: 2, type: "wall", passable: false },
|
|
4689
|
-
{ id: "t03", x: 0, y: 3, z: 3, type: "wall", passable: false },
|
|
4690
|
-
{ id: "t13", x: 1, y: 3, z: 3, type: "floor", passable: true },
|
|
4691
|
-
{ id: "t23", x: 2, y: 3, z: 3, type: "floor", passable: true },
|
|
4692
|
-
{ id: "t33", x: 3, y: 3, z: 3, type: "floor", passable: true },
|
|
4693
|
-
{ id: "t43", x: 4, y: 3, z: 3, type: "wall", passable: false },
|
|
4694
|
-
{ id: "t04", x: 0, y: 4, z: 4, type: "wall", passable: false },
|
|
4695
|
-
{ id: "t14", x: 1, y: 4, z: 4, type: "wall", passable: false },
|
|
4696
|
-
{ id: "t24", x: 2, y: 4, z: 4, type: "wall", passable: false },
|
|
4697
|
-
{ id: "t34", x: 3, y: 4, z: 4, type: "wall", passable: false },
|
|
4698
|
-
{ id: "t44", x: 4, y: 4, z: 4, type: "wall", passable: false }
|
|
4700
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4701
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4702
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4703
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4704
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4705
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4706
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
|
|
4707
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4708
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4709
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4710
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4711
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4712
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
|
|
4713
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4714
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4715
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4716
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4717
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4718
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
|
|
4719
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4720
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4721
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4722
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4723
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4724
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 }
|
|
4699
4725
|
];
|
|
4700
4726
|
var DEFAULT_3D_CASTLE_FEATURES = [
|
|
4701
4727
|
{ id: "f1", x: 2, y: 2, z: 2, type: "chest", color: "#f4c542" },
|
|
@@ -4715,6 +4741,8 @@ function GameCanvas3DCastleTemplate({
|
|
|
4715
4741
|
playAgainEvent,
|
|
4716
4742
|
gameEndEvent,
|
|
4717
4743
|
showHeader = true,
|
|
4744
|
+
unitScale,
|
|
4745
|
+
scale,
|
|
4718
4746
|
className
|
|
4719
4747
|
}) {
|
|
4720
4748
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -4745,6 +4773,8 @@ function GameCanvas3DCastleTemplate({
|
|
|
4745
4773
|
features,
|
|
4746
4774
|
cameraMode,
|
|
4747
4775
|
backgroundColor,
|
|
4776
|
+
unitScale,
|
|
4777
|
+
scale,
|
|
4748
4778
|
tileClickEvent: buildingClickEvent,
|
|
4749
4779
|
unitClickEvent,
|
|
4750
4780
|
endTurnEvent,
|
|
@@ -4767,32 +4797,36 @@ function GameCanvas3DCastleTemplate({
|
|
|
4767
4797
|
);
|
|
4768
4798
|
}
|
|
4769
4799
|
GameCanvas3DCastleTemplate.displayName = "GameCanvas3DCastleTemplate";
|
|
4800
|
+
var CDN3 = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
|
|
4801
|
+
var FLOOR_WALL3 = `${CDN3}/template-floor-detail-a.glb`;
|
|
4802
|
+
var FLOOR_DIRT3 = `${CDN3}/template-floor-detail.glb`;
|
|
4803
|
+
var FLOOR_OPEN3 = `${CDN3}/template-floor.glb`;
|
|
4770
4804
|
var DEFAULT_3D_WORLDMAP_TILES = [
|
|
4771
|
-
{ id: "t00", x: 0, y: 0, z: 0, type: "mountain", passable: false },
|
|
4772
|
-
{ id: "t10", x: 1, y: 0, z: 0, type: "mountain", passable: false },
|
|
4773
|
-
{ id: "t20", x: 2, y: 0, z: 0, type: "water", passable: false },
|
|
4774
|
-
{ id: "t30", x: 3, y: 0, z: 0, type: "mountain", passable: false },
|
|
4775
|
-
{ id: "t40", x: 4, y: 0, z: 0, type: "mountain", passable: false },
|
|
4776
|
-
{ id: "t01", x: 0, y: 1, z: 1, type: "mountain", passable: false },
|
|
4777
|
-
{ id: "t11", x: 1, y: 1, z: 1, type: "grass", passable: true },
|
|
4778
|
-
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true },
|
|
4779
|
-
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true },
|
|
4780
|
-
{ id: "t41", x: 4, y: 1, z: 1, type: "water", passable: false },
|
|
4781
|
-
{ id: "t02", x: 0, y: 2, z: 2, type: "water", passable: false },
|
|
4782
|
-
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true },
|
|
4783
|
-
{ id: "t22", x: 2, y: 2, z: 2, type: "road", passable: true },
|
|
4784
|
-
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true },
|
|
4785
|
-
{ id: "t42", x: 4, y: 2, z: 2, type: "mountain", passable: false },
|
|
4786
|
-
{ id: "t03", x: 0, y: 3, z: 3, type: "mountain", passable: false },
|
|
4787
|
-
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true },
|
|
4788
|
-
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true },
|
|
4789
|
-
{ id: "t33", x: 3, y: 3, z: 3, type: "road", passable: true },
|
|
4790
|
-
{ id: "t43", x: 4, y: 3, z: 3, type: "mountain", passable: false },
|
|
4791
|
-
{ id: "t04", x: 0, y: 4, z: 4, type: "mountain", passable: false },
|
|
4792
|
-
{ id: "t14", x: 1, y: 4, z: 4, type: "water", passable: false },
|
|
4793
|
-
{ id: "t24", x: 2, y: 4, z: 4, type: "grass", passable: true },
|
|
4794
|
-
{ id: "t34", x: 3, y: 4, z: 4, type: "mountain", passable: false },
|
|
4795
|
-
{ id: "t44", x: 4, y: 4, z: 4, type: "mountain", passable: false }
|
|
4805
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4806
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4807
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4808
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4809
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4810
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4811
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4812
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4813
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4814
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4815
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4816
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4817
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "road", passable: true, modelUrl: FLOOR_DIRT3 },
|
|
4818
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4819
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4820
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4821
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4822
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4823
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "road", passable: true, modelUrl: FLOOR_DIRT3 },
|
|
4824
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4825
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4826
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4827
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4828
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4829
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 }
|
|
4796
4830
|
];
|
|
4797
4831
|
var DEFAULT_3D_WORLDMAP_FEATURES = [
|
|
4798
4832
|
{ id: "f1", x: 2, y: 2, z: 2, type: "capital", color: "#f4c542" },
|
|
@@ -4811,6 +4845,8 @@ function GameCanvas3DWorldMapTemplate({
|
|
|
4811
4845
|
attackEvent,
|
|
4812
4846
|
playAgainEvent,
|
|
4813
4847
|
gameEndEvent,
|
|
4848
|
+
unitScale,
|
|
4849
|
+
scale,
|
|
4814
4850
|
className
|
|
4815
4851
|
}) {
|
|
4816
4852
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -4826,6 +4862,8 @@ function GameCanvas3DWorldMapTemplate({
|
|
|
4826
4862
|
features,
|
|
4827
4863
|
cameraMode,
|
|
4828
4864
|
backgroundColor,
|
|
4865
|
+
unitScale,
|
|
4866
|
+
scale,
|
|
4829
4867
|
tileClickEvent,
|
|
4830
4868
|
unitClickEvent,
|
|
4831
4869
|
endTurnEvent,
|