@almadar/ui 5.54.0 → 5.56.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 +144 -95
- package/dist/avl/index.js +146 -97
- 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 +150 -111
- package/dist/components/game/molecules/three/index.js +150 -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 +81 -42
- package/dist/components/index.js +81 -42
- package/dist/providers/index.cjs +132 -86
- package/dist/providers/index.js +132 -86
- package/dist/runtime/index.cjs +131 -82
- package/dist/runtime/index.js +133 -84
- 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,8 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2583
2583
|
attackTargets = [],
|
|
2584
2584
|
selectedTileIds = [],
|
|
2585
2585
|
selectedUnitId = null,
|
|
2586
|
+
unitScale = 1,
|
|
2587
|
+
scale = 0.45,
|
|
2586
2588
|
children
|
|
2587
2589
|
}, ref) => {
|
|
2588
2590
|
const containerRef = React11.useRef(null);
|
|
@@ -2799,12 +2801,18 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2799
2801
|
},
|
|
2800
2802
|
[selectedTileIds, hoveredTile, validMoves, attackTargets, handleTileClick, handleTileHover]
|
|
2801
2803
|
);
|
|
2804
|
+
const UNIT_BASE_MODEL_SCALE = 0.5;
|
|
2805
|
+
const UNIT_BASE_BILLBOARD_HEIGHT = 1.2;
|
|
2806
|
+
const UNIT_BASE_PRIMITIVE_RADIUS = 0.3;
|
|
2802
2807
|
const DefaultUnitRenderer = React11.useCallback(
|
|
2803
2808
|
({ unit, position }) => {
|
|
2804
2809
|
const isSelected = selectedUnitId === unit.id;
|
|
2805
2810
|
const color = unit.faction === "player" ? 4491519 : unit.faction === "enemy" ? 16729156 : 16777028;
|
|
2806
2811
|
const hasAtlas = unitAtlasUrl(unit) !== null;
|
|
2807
2812
|
const initialFrame = hasAtlas ? resolveUnitFrame(unit.id) : null;
|
|
2813
|
+
const modelScale = UNIT_BASE_MODEL_SCALE * unitScale;
|
|
2814
|
+
const billboardHeight = UNIT_BASE_BILLBOARD_HEIGHT * unitScale;
|
|
2815
|
+
const primitiveRadius = UNIT_BASE_PRIMITIVE_RADIUS * unitScale;
|
|
2808
2816
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2809
2817
|
"group",
|
|
2810
2818
|
{
|
|
@@ -2822,7 +2830,8 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2822
2830
|
UnitSpriteBillboard,
|
|
2823
2831
|
{
|
|
2824
2832
|
sheetUrl: initialFrame.sheetUrl,
|
|
2825
|
-
resolveFrame: () => resolveUnitFrame(unit.id)
|
|
2833
|
+
resolveFrame: () => resolveUnitFrame(unit.id),
|
|
2834
|
+
height: billboardHeight
|
|
2826
2835
|
}
|
|
2827
2836
|
) })
|
|
2828
2837
|
) : unit.modelUrl ? (
|
|
@@ -2831,22 +2840,22 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2831
2840
|
ModelLoader,
|
|
2832
2841
|
{
|
|
2833
2842
|
url: unit.modelUrl,
|
|
2834
|
-
scale:
|
|
2843
|
+
scale: modelScale,
|
|
2835
2844
|
fallbackGeometry: "box",
|
|
2836
2845
|
castShadow: true
|
|
2837
2846
|
}
|
|
2838
2847
|
)
|
|
2839
2848
|
) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2840
|
-
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0,
|
|
2841
|
-
/* @__PURE__ */ jsxRuntime.jsx("cylinderGeometry", { args: [
|
|
2849
|
+
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0, primitiveRadius, 0], children: [
|
|
2850
|
+
/* @__PURE__ */ jsxRuntime.jsx("cylinderGeometry", { args: [primitiveRadius, primitiveRadius, primitiveRadius * 0.33, 8] }),
|
|
2842
2851
|
/* @__PURE__ */ jsxRuntime.jsx("meshStandardMaterial", { color })
|
|
2843
2852
|
] }),
|
|
2844
|
-
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0,
|
|
2845
|
-
/* @__PURE__ */ jsxRuntime.jsx("capsuleGeometry", { args: [0.
|
|
2853
|
+
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0, primitiveRadius * 2, 0], children: [
|
|
2854
|
+
/* @__PURE__ */ jsxRuntime.jsx("capsuleGeometry", { args: [primitiveRadius * 0.67, primitiveRadius * 1.33, 4, 8] }),
|
|
2846
2855
|
/* @__PURE__ */ jsxRuntime.jsx("meshStandardMaterial", { color })
|
|
2847
2856
|
] }),
|
|
2848
|
-
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0,
|
|
2849
|
-
/* @__PURE__ */ jsxRuntime.jsx("sphereGeometry", { args: [0.
|
|
2857
|
+
/* @__PURE__ */ jsxRuntime.jsxs("mesh", { position: [0, primitiveRadius * 3, 0], children: [
|
|
2858
|
+
/* @__PURE__ */ jsxRuntime.jsx("sphereGeometry", { args: [primitiveRadius * 0.4, 8, 8] }),
|
|
2850
2859
|
/* @__PURE__ */ jsxRuntime.jsx("meshStandardMaterial", { color })
|
|
2851
2860
|
] })
|
|
2852
2861
|
] }),
|
|
@@ -2879,7 +2888,7 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
2879
2888
|
}
|
|
2880
2889
|
);
|
|
2881
2890
|
},
|
|
2882
|
-
[selectedUnitId, handleUnitClick, resolveUnitFrame]
|
|
2891
|
+
[selectedUnitId, handleUnitClick, resolveUnitFrame, unitScale]
|
|
2883
2892
|
);
|
|
2884
2893
|
const DefaultFeatureRenderer = React11.useCallback(
|
|
2885
2894
|
({
|
|
@@ -3022,33 +3031,35 @@ var GameCanvas3D = React11.forwardRef(
|
|
|
3022
3031
|
fadeStrength: 1
|
|
3023
3032
|
}
|
|
3024
3033
|
),
|
|
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
|
-
|
|
3034
|
+
/* @__PURE__ */ jsxRuntime.jsxs("group", { scale, children: [
|
|
3035
|
+
tiles.map((tile, index) => {
|
|
3036
|
+
const position = gridToWorld2(
|
|
3037
|
+
tile.x,
|
|
3038
|
+
tile.z ?? tile.y ?? 0,
|
|
3039
|
+
tile.elevation ?? 0
|
|
3040
|
+
);
|
|
3041
|
+
const Renderer = CustomTileRenderer || DefaultTileRenderer;
|
|
3042
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Renderer, { tile, position }, tile.id ?? `tile-${index}`);
|
|
3043
|
+
}),
|
|
3044
|
+
features.map((feature, index) => {
|
|
3045
|
+
const position = gridToWorld2(
|
|
3046
|
+
feature.x,
|
|
3047
|
+
feature.z ?? feature.y ?? 0,
|
|
3048
|
+
(feature.elevation ?? 0) + 0.5
|
|
3049
|
+
);
|
|
3050
|
+
const Renderer = CustomFeatureRenderer || DefaultFeatureRenderer;
|
|
3051
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Renderer, { feature, position }, feature.id ?? `feature-${index}`);
|
|
3052
|
+
}),
|
|
3053
|
+
units.map((unit) => {
|
|
3054
|
+
const position = gridToWorld2(
|
|
3055
|
+
unit.x ?? 0,
|
|
3056
|
+
unit.z ?? unit.y ?? 0,
|
|
3057
|
+
(unit.elevation ?? 0) + 0.5
|
|
3058
|
+
);
|
|
3059
|
+
const Renderer = CustomUnitRenderer || DefaultUnitRenderer;
|
|
3060
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Renderer, { unit, position }, unit.id);
|
|
3061
|
+
})
|
|
3062
|
+
] }),
|
|
3052
3063
|
children,
|
|
3053
3064
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3054
3065
|
drei.OrbitControls,
|
|
@@ -4236,6 +4247,8 @@ function GameBoard3D({
|
|
|
4236
4247
|
features = [],
|
|
4237
4248
|
cameraMode = "perspective",
|
|
4238
4249
|
backgroundColor = "#2a1a1a",
|
|
4250
|
+
unitScale = 1,
|
|
4251
|
+
scale = 0.45,
|
|
4239
4252
|
tileClickEvent,
|
|
4240
4253
|
unitClickEvent,
|
|
4241
4254
|
attackEvent,
|
|
@@ -4336,6 +4349,8 @@ function GameBoard3D({
|
|
|
4336
4349
|
selectedUnitId,
|
|
4337
4350
|
validMoves,
|
|
4338
4351
|
attackTargets,
|
|
4352
|
+
unitScale,
|
|
4353
|
+
scale,
|
|
4339
4354
|
className: "game-board-3d__canvas w-full min-h-[85vh]"
|
|
4340
4355
|
}
|
|
4341
4356
|
),
|
|
@@ -4576,32 +4591,36 @@ var Box = React11__default.default.forwardRef(
|
|
|
4576
4591
|
}
|
|
4577
4592
|
);
|
|
4578
4593
|
Box.displayName = "Box";
|
|
4594
|
+
var CDN = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
|
|
4595
|
+
var FLOOR_WALL = `${CDN}/template-floor-detail-a.glb`;
|
|
4596
|
+
var FLOOR_DIRT = `${CDN}/template-floor-detail.glb`;
|
|
4597
|
+
var FLOOR_OPEN = `${CDN}/template-floor.glb`;
|
|
4579
4598
|
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 }
|
|
4599
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4600
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4601
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4602
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4603
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4604
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4605
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
|
|
4606
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4607
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4608
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4609
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4610
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4611
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
|
|
4612
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4613
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4614
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4615
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4616
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN },
|
|
4617
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "dirt", passable: true, modelUrl: FLOOR_DIRT },
|
|
4618
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4619
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4620
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4621
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4622
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL },
|
|
4623
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "stone", passable: false, modelUrl: FLOOR_WALL }
|
|
4605
4624
|
];
|
|
4606
4625
|
var DEFAULT_3D_BATTLE_FEATURES = [
|
|
4607
4626
|
{ id: "f1", x: 2, y: 2, z: 2, type: "gold_mine", color: "#f4c542" },
|
|
@@ -4620,6 +4639,8 @@ function GameCanvas3DBattleTemplate({
|
|
|
4620
4639
|
attackEvent,
|
|
4621
4640
|
playAgainEvent,
|
|
4622
4641
|
gameEndEvent,
|
|
4642
|
+
unitScale,
|
|
4643
|
+
scale,
|
|
4623
4644
|
className
|
|
4624
4645
|
}) {
|
|
4625
4646
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -4640,6 +4661,8 @@ function GameCanvas3DBattleTemplate({
|
|
|
4640
4661
|
features,
|
|
4641
4662
|
cameraMode,
|
|
4642
4663
|
backgroundColor,
|
|
4664
|
+
unitScale,
|
|
4665
|
+
scale,
|
|
4643
4666
|
tileClickEvent,
|
|
4644
4667
|
unitClickEvent,
|
|
4645
4668
|
endTurnEvent,
|
|
@@ -4670,32 +4693,36 @@ function GameCanvas3DBattleTemplate({
|
|
|
4670
4693
|
);
|
|
4671
4694
|
}
|
|
4672
4695
|
GameCanvas3DBattleTemplate.displayName = "GameCanvas3DBattleTemplate";
|
|
4696
|
+
var CDN2 = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
|
|
4697
|
+
var FLOOR_WALL2 = `${CDN2}/template-floor-detail-a.glb`;
|
|
4698
|
+
var FLOOR_DIRT2 = `${CDN2}/template-floor-detail.glb`;
|
|
4699
|
+
var FLOOR_OPEN2 = `${CDN2}/template-floor.glb`;
|
|
4673
4700
|
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 }
|
|
4701
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4702
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4703
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4704
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4705
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4706
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4707
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
|
|
4708
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4709
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4710
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4711
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4712
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4713
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
|
|
4714
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4715
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4716
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4717
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4718
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_OPEN2 },
|
|
4719
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "floor", passable: true, modelUrl: FLOOR_DIRT2 },
|
|
4720
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4721
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4722
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4723
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4724
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 },
|
|
4725
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "wall", passable: false, modelUrl: FLOOR_WALL2 }
|
|
4699
4726
|
];
|
|
4700
4727
|
var DEFAULT_3D_CASTLE_FEATURES = [
|
|
4701
4728
|
{ id: "f1", x: 2, y: 2, z: 2, type: "chest", color: "#f4c542" },
|
|
@@ -4715,6 +4742,8 @@ function GameCanvas3DCastleTemplate({
|
|
|
4715
4742
|
playAgainEvent,
|
|
4716
4743
|
gameEndEvent,
|
|
4717
4744
|
showHeader = true,
|
|
4745
|
+
unitScale,
|
|
4746
|
+
scale,
|
|
4718
4747
|
className
|
|
4719
4748
|
}) {
|
|
4720
4749
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -4745,6 +4774,8 @@ function GameCanvas3DCastleTemplate({
|
|
|
4745
4774
|
features,
|
|
4746
4775
|
cameraMode,
|
|
4747
4776
|
backgroundColor,
|
|
4777
|
+
unitScale,
|
|
4778
|
+
scale,
|
|
4748
4779
|
tileClickEvent: buildingClickEvent,
|
|
4749
4780
|
unitClickEvent,
|
|
4750
4781
|
endTurnEvent,
|
|
@@ -4767,32 +4798,36 @@ function GameCanvas3DCastleTemplate({
|
|
|
4767
4798
|
);
|
|
4768
4799
|
}
|
|
4769
4800
|
GameCanvas3DCastleTemplate.displayName = "GameCanvas3DCastleTemplate";
|
|
4801
|
+
var CDN3 = "https://almadar-kflow-assets.web.app/shared/3d/dungeon/floor";
|
|
4802
|
+
var FLOOR_WALL3 = `${CDN3}/template-floor-detail-a.glb`;
|
|
4803
|
+
var FLOOR_DIRT3 = `${CDN3}/template-floor-detail.glb`;
|
|
4804
|
+
var FLOOR_OPEN3 = `${CDN3}/template-floor.glb`;
|
|
4770
4805
|
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 }
|
|
4806
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4807
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4808
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4809
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4810
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4811
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4812
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4813
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4814
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4815
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4816
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4817
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4818
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "road", passable: true, modelUrl: FLOOR_DIRT3 },
|
|
4819
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4820
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4821
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4822
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4823
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4824
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "road", passable: true, modelUrl: FLOOR_DIRT3 },
|
|
4825
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4826
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4827
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "water", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4828
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "grass", passable: true, modelUrl: FLOOR_OPEN3 },
|
|
4829
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 },
|
|
4830
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "mountain", passable: false, modelUrl: FLOOR_WALL3 }
|
|
4796
4831
|
];
|
|
4797
4832
|
var DEFAULT_3D_WORLDMAP_FEATURES = [
|
|
4798
4833
|
{ id: "f1", x: 2, y: 2, z: 2, type: "capital", color: "#f4c542" },
|
|
@@ -4811,6 +4846,8 @@ function GameCanvas3DWorldMapTemplate({
|
|
|
4811
4846
|
attackEvent,
|
|
4812
4847
|
playAgainEvent,
|
|
4813
4848
|
gameEndEvent,
|
|
4849
|
+
unitScale,
|
|
4850
|
+
scale,
|
|
4814
4851
|
className
|
|
4815
4852
|
}) {
|
|
4816
4853
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
@@ -4826,6 +4863,8 @@ function GameCanvas3DWorldMapTemplate({
|
|
|
4826
4863
|
features,
|
|
4827
4864
|
cameraMode,
|
|
4828
4865
|
backgroundColor,
|
|
4866
|
+
unitScale,
|
|
4867
|
+
scale,
|
|
4829
4868
|
tileClickEvent,
|
|
4830
4869
|
unitClickEvent,
|
|
4831
4870
|
endTurnEvent,
|