@almadar/ui 5.73.0 → 5.75.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 +42285 -42752
- package/dist/avl/index.css +0 -504
- package/dist/avl/index.js +42495 -42961
- package/dist/components/core/atoms/index.d.ts +1 -1
- package/dist/components/core/molecules/RepeatableFormSection.d.ts +6 -5
- package/dist/components/core/molecules/index.d.ts +1 -1
- package/dist/components/core/organisms/index.d.ts +1 -1
- package/dist/components/core/templates/index.d.ts +12 -12
- package/dist/components/game/{organisms/puzzles/sequencer → 2d}/ActionPalette.d.ts +1 -1
- package/dist/components/game/{organisms/puzzles/sequencer → 2d}/ActionTile.d.ts +2 -2
- package/dist/components/game/{organisms → 2d}/BattleBoard.d.ts +2 -2
- package/dist/components/game/{templates → 2d}/BattleTemplate.d.ts +3 -3
- package/dist/components/game/{organisms → 2d}/BoardgameBoard.d.ts +4 -4
- package/dist/components/game/{organisms/puzzles/builder → 2d}/BuilderBoard.d.ts +1 -1
- package/dist/components/game/2d/Canvas2D.d.ts +161 -0
- package/dist/components/game/{organisms → 2d}/CanvasEffect.d.ts +3 -3
- package/dist/components/game/{templates → 2d}/CardBattlerTemplate.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/CastleBoard.d.ts +1 -1
- package/dist/components/game/{templates → 2d}/CastleTemplate.d.ts +3 -3
- package/dist/components/game/{templates → 2d}/CityBuilderTemplate.d.ts +1 -1
- package/dist/components/game/{organisms/puzzles/classifier → 2d}/ClassifierBoard.d.ts +1 -1
- package/dist/components/game/2d/ControlGrid.d.ts +41 -0
- package/dist/components/game/{organisms/puzzles/debugger → 2d}/DebuggerBoard.d.ts +1 -1
- package/dist/components/game/{organisms/puzzles/event-handler → 2d}/EventHandlerBoard.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/FishingBoard.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/GameAudioProvider.d.ts +1 -1
- package/dist/components/game/2d/GameCard.d.ts +26 -0
- package/dist/components/game/2d/HealthBar.d.ts +26 -0
- package/dist/components/game/{organisms → 2d}/HexStrategyBoard.d.ts +4 -4
- package/dist/components/game/{organisms → 2d}/HolidayRunnerBoard.d.ts +4 -4
- package/dist/components/game/{molecules → 2d}/IsometricCanvas.d.ts +3 -3
- package/dist/components/game/{organisms → 2d}/MatchPuzzleBoard.d.ts +4 -4
- package/dist/components/game/{organisms → 2d}/MinigolfBoard.d.ts +4 -4
- package/dist/components/game/{organisms/puzzles/negotiator → 2d}/NegotiatorBoard.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/PinballBoard.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/PirateBoard.d.ts +4 -4
- package/dist/components/game/{organisms → 2d}/PlatformerBoard.d.ts +9 -14
- package/dist/components/game/{molecules → 2d}/PlatformerCanvas.d.ts +1 -1
- package/dist/components/game/{templates → 2d}/PlatformerTemplate.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/RacingBoard.d.ts +4 -4
- package/dist/components/game/{organisms → 2d}/RoguelikeBoard.d.ts +1 -1
- package/dist/components/game/{templates → 2d}/RoguelikeTemplate.d.ts +2 -2
- package/dist/components/game/{organisms/puzzles/sequencer → 2d}/SequenceBar.d.ts +1 -1
- package/dist/components/game/{organisms/puzzles/sequencer → 2d}/SequencerBoard.d.ts +1 -1
- package/dist/components/game/{organisms/physics-sim → 2d}/SimulationCanvas.d.ts +1 -1
- package/dist/components/game/{organisms/puzzles/simulator → 2d}/SimulatorBoard.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/SokobanBoard.d.ts +4 -4
- package/dist/components/game/{organisms → 2d}/SpaceShmupBoard.d.ts +4 -4
- package/dist/components/game/{organisms → 2d}/SpaceStationBoard.d.ts +4 -4
- package/dist/components/game/{organisms → 2d}/SportsBoard.d.ts +4 -4
- package/dist/components/game/{atoms → 2d}/Sprite.d.ts +1 -1
- package/dist/components/game/{organisms/puzzles/state-architect → 2d}/StateArchitectBoard.d.ts +1 -1
- package/dist/components/game/{organisms/puzzles/state-architect → 2d}/StateNode.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/TanksBoard.d.ts +4 -4
- package/dist/components/game/{templates → 2d}/TopDownShooterTemplate.d.ts +1 -1
- package/dist/components/game/{templates → 2d}/TowerDefenseTemplate.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/TraitStateViewer.d.ts +1 -1
- package/dist/components/game/{organisms/puzzles/state-architect → 2d}/TransitionArrow.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/UncontrolledBattleBoard.d.ts +1 -1
- package/dist/components/game/{templates → 2d}/VisualNovelTemplate.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/WorldMapBoard.d.ts +2 -2
- package/dist/components/game/{templates → 2d}/WorldMapTemplate.d.ts +3 -3
- package/dist/components/game/{templates → 2d}/game3dAssetManifest.d.ts +1 -1
- package/dist/components/game/2d/index.d.ts +122 -0
- package/dist/components/game/{organisms/hooks → 2d}/useBattleState.d.ts +1 -1
- package/dist/components/game/{organisms/hooks → 2d}/useCamera.d.ts +1 -1
- package/dist/components/game/{organisms → 2d}/useCanvasEffects.d.ts +1 -1
- package/dist/components/game/{molecules → 2d}/useUnitSpriteAtlas.d.ts +2 -2
- package/dist/components/game/3d/Canvas3D.d.ts +45 -0
- package/dist/components/game/{molecules/three/renderers → 3d}/FeatureRenderer.d.ts +1 -1
- package/dist/components/game/{molecules/three/renderers → 3d}/FeatureRenderer3D.d.ts +1 -1
- package/dist/components/game/{organisms → 3d}/GameBoard3D.d.ts +2 -2
- package/dist/components/game/{molecules → 3d}/GameCanvas3D.d.ts +3 -3
- package/dist/components/game/{templates → 3d}/GameCanvas3DBattleTemplate.d.ts +2 -2
- package/dist/components/game/{templates → 3d}/GameCanvas3DCastleTemplate.d.ts +2 -2
- package/dist/components/game/{templates → 3d}/GameCanvas3DWorldMapTemplate.d.ts +2 -2
- package/dist/components/game/{molecules/three/components → 3d}/PhysicsObject3D.d.ts +1 -1
- package/dist/components/game/{molecules/three/renderers → 3d}/TileRenderer.d.ts +1 -1
- package/dist/components/game/{molecules/three/renderers → 3d}/UnitRenderer.d.ts +3 -3
- package/dist/components/game/{molecules/three → 3d}/index.cjs +218 -301
- package/dist/components/game/{molecules/three → 3d}/index.css +3 -3
- package/dist/components/game/3d/index.d.ts +41 -0
- package/dist/components/game/{molecules/three → 3d}/index.js +29 -113
- package/dist/components/game/{molecules/three → 3d}/patterns.d.ts +5 -5
- package/dist/components/game/{molecules/three/hooks → 3d}/useAssetLoader.d.ts +1 -1
- package/dist/components/game/{molecules/three/hooks → 3d}/useGameCanvas3DEvents.d.ts +1 -1
- package/dist/components/game/{molecules/three/hooks → 3d}/useThree.d.ts +1 -1
- package/dist/components/game/{organisms/utils → shared}/canvasEffects.d.ts +1 -1
- package/dist/components/game/{organisms/utils → shared}/combatPresets.d.ts +1 -1
- package/dist/components/game/{organisms/types → shared}/game.d.ts +2 -2
- package/dist/components/game/shared/index.d.ts +23 -0
- package/dist/components/game/{organisms/types/isometric.d.ts → shared/isometricTypes.d.ts} +3 -7
- package/dist/components/game/{organisms/utils → shared}/spriteAnimation.d.ts +1 -1
- package/dist/components/game/{organisms/utils → shared}/spriteSheetConstants.d.ts +1 -1
- package/dist/components/index.cjs +24732 -25471
- package/dist/components/index.css +0 -504
- package/dist/components/index.js +24287 -25047
- package/dist/context/index.cjs +5 -7
- package/dist/context/index.js +5 -7
- package/dist/docs/index.cjs +108 -53
- package/dist/docs/index.css +0 -504
- package/dist/docs/index.js +108 -53
- package/dist/hooks/index.cjs +7 -9
- package/dist/hooks/index.js +7 -9
- package/dist/providers/index.cjs +43812 -44279
- package/dist/providers/index.css +0 -504
- package/dist/providers/index.js +43764 -44230
- package/dist/runtime/index.cjs +43783 -44250
- package/dist/runtime/index.css +0 -504
- package/dist/runtime/index.js +43642 -44108
- package/package.json +11 -11
- package/dist/components/game/atoms/HealthBar.d.ts +0 -18
- package/dist/components/game/atoms/XPBar.d.ts +0 -20
- package/dist/components/game/atoms/index.d.ts +0 -25
- package/dist/components/game/molecules/ActionButtons.d.ts +0 -38
- package/dist/components/game/molecules/DPad.d.ts +0 -26
- package/dist/components/game/molecules/index.d.ts +0 -32
- package/dist/components/game/molecules/three/components/index.d.ts +0 -10
- package/dist/components/game/molecules/three/index.d.ts +0 -35
- package/dist/components/game/molecules/three/renderers/index.d.ts +0 -11
- package/dist/components/game/organisms/editor/index.d.ts +0 -9
- package/dist/components/game/organisms/hooks/usePhysics2D.d.ts +0 -45
- package/dist/components/game/organisms/hooks/useSpriteAnimations.d.ts +0 -43
- package/dist/components/game/organisms/index.d.ts +0 -66
- package/dist/components/game/organisms/managers/PhysicsManager.d.ts +0 -103
- package/dist/components/game/organisms/physics-sim/index.d.ts +0 -7
- package/dist/components/game/organisms/puzzles/builder/index.d.ts +0 -2
- package/dist/components/game/organisms/puzzles/classifier/index.d.ts +0 -2
- package/dist/components/game/organisms/puzzles/debugger/index.d.ts +0 -2
- package/dist/components/game/organisms/puzzles/event-handler/index.d.ts +0 -8
- package/dist/components/game/organisms/puzzles/negotiator/index.d.ts +0 -2
- package/dist/components/game/organisms/puzzles/sequencer/index.d.ts +0 -8
- package/dist/components/game/organisms/puzzles/simulator/index.d.ts +0 -2
- package/dist/components/game/organisms/puzzles/state-architect/index.d.ts +0 -10
- package/dist/components/game/templates/index.d.ts +0 -4
- /package/dist/components/game/{atoms → 2d}/ActionButton.d.ts +0 -0
- /package/dist/components/game/{organisms → 2d}/CardBattlerBoard.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/CardHand.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/ChoiceButton.d.ts +0 -0
- /package/dist/components/game/{organisms → 2d}/CityBuilderBoard.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/CombatLog.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/ComboCounter.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/ControlButton.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/CraftingRecipe.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/DamageNumber.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/DialogueBox.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/DialogueBubble.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/EnemyPlate.d.ts +0 -0
- /package/dist/components/game/{organisms/puzzles/event-handler → 2d}/EventLog.d.ts +0 -0
- /package/dist/components/game/{organisms → 2d}/GameAudioToggle.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/GameCanvas2D.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/GameHud.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/GameMenu.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/GameOverScreen.d.ts +0 -0
- /package/dist/components/game/{templates → 2d}/GameShell.d.ts +0 -0
- /package/dist/components/game/{templates → 2d}/GameTemplate.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/HealthPanel.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/InventoryGrid.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/InventoryPanel.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/ItemSlot.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/MiniMap.d.ts +0 -0
- /package/dist/components/game/{organisms/puzzles/event-handler → 2d}/ObjectRulePanel.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/PowerupSlots.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/QuestTracker.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/ResourceBar.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/ResourceCounter.d.ts +0 -0
- /package/dist/components/game/{organisms/puzzles/event-handler → 2d}/RuleEditor.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/ScoreBoard.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/ScoreDisplay.d.ts +0 -0
- /package/dist/components/game/{organisms/physics-sim → 2d}/SimulationControls.d.ts +0 -0
- /package/dist/components/game/{organisms/physics-sim → 2d}/SimulationGraph.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/StatBadge.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/StateIndicator.d.ts +0 -0
- /package/dist/components/game/{organisms/puzzles/state-architect → 2d}/StateJsonView.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/StatusEffect.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/TimerDisplay.d.ts +0 -0
- /package/dist/components/game/{organisms → 2d}/TopDownShooterBoard.d.ts +0 -0
- /package/dist/components/game/{organisms → 2d}/TowerDefenseBoard.d.ts +0 -0
- /package/dist/components/game/{organisms → 2d}/TraitSlot.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/TurnIndicator.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/TurnPanel.d.ts +0 -0
- /package/dist/components/game/{molecules → 2d}/UnitCommandBar.d.ts +0 -0
- /package/dist/components/game/{organisms/puzzles/state-architect → 2d}/VariablePanel.d.ts +0 -0
- /package/dist/components/game/{organisms → 2d}/VisualNovelBoard.d.ts +0 -0
- /package/dist/components/game/{atoms → 2d}/WaypointMarker.d.ts +0 -0
- /package/dist/components/game/{organisms/editor → 2d}/editorUtils.d.ts +0 -0
- /package/dist/components/game/{organisms/physics-sim/presets → 2d}/mechanics.d.ts +0 -0
- /package/dist/components/game/{organisms/physics-sim/presets/index.d.ts → 2d/physicsPresets.d.ts} +0 -0
- /package/dist/components/game/{organisms/puzzles/event-handler → 2d}/puzzleObject.d.ts +0 -0
- /package/dist/components/game/{organisms/physics-sim/presets → 2d}/types.d.ts +0 -0
- /package/dist/components/game/{organisms/hooks → 2d}/useGameAudio.d.ts +0 -0
- /package/dist/components/game/{molecules/three/loaders → 3d}/AssetLoader.d.ts +0 -0
- /package/dist/components/game/{molecules/three → 3d}/Camera3D.d.ts +0 -0
- /package/dist/components/game/{molecules/three/components → 3d}/Canvas3DErrorBoundary.d.ts +0 -0
- /package/dist/components/game/{molecules/three/components → 3d}/Canvas3DLoadingState.d.ts +0 -0
- /package/dist/components/game/{molecules/three → 3d}/Lighting3D.d.ts +0 -0
- /package/dist/components/game/{molecules/three/components → 3d}/ModelLoader.d.ts +0 -0
- /package/dist/components/game/{molecules/three → 3d}/Scene3D.d.ts +0 -0
- /package/dist/components/game/{molecules/three/utils → 3d}/culling.d.ts +0 -0
- /package/dist/components/game/{molecules/three/utils → 3d}/grid3D.d.ts +0 -0
- /package/dist/components/game/{molecules/three/hooks → 3d}/useRaycaster.d.ts +0 -0
- /package/dist/components/game/{molecules/three/hooks → 3d}/useSceneGraph.d.ts +0 -0
- /package/dist/components/game/{organisms → shared}/boardEntity.d.ts +0 -0
- /package/dist/components/game/{organisms/utils → shared}/combatEffects.d.ts +0 -0
- /package/dist/components/game/{organisms/types → shared}/effects.d.ts +0 -0
- /package/dist/components/game/{organisms/utils → shared}/isometric.d.ts +0 -0
- /package/dist/components/game/{organisms/utils → shared}/makeAsset.d.ts +0 -0
- /package/dist/components/game/{organisms/types/spriteAnimation.d.ts → shared/spriteAnimationTypes.d.ts} +0 -0
- /package/dist/components/game/{organisms/hooks → shared}/useImageCache.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* components/game/
|
|
1
|
+
/* components/game/3d/Canvas3DLoadingState.css */
|
|
2
2
|
.canvas-3d-loading {
|
|
3
3
|
position: absolute;
|
|
4
4
|
inset: 0;
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
/* components/game/
|
|
154
|
+
/* components/game/3d/Canvas3DErrorBoundary.css */
|
|
155
155
|
.canvas-3d-error {
|
|
156
156
|
position: absolute;
|
|
157
157
|
inset: 0;
|
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
/* components/game/
|
|
317
|
+
/* components/game/3d/GameCanvas3D.css */
|
|
318
318
|
.game-canvas-3d {
|
|
319
319
|
background: #1a1a2e;
|
|
320
320
|
border-radius: 8px;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game 3D (three.js)
|
|
3
|
+
*
|
|
4
|
+
* Three.js components, hooks, loaders, renderers, and the GameCanvas3D family.
|
|
5
|
+
* Code-split behind the `@almadar/ui/components/molecules/game/three` subpath.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export { Scene3D, type Scene3DProps } from './Scene3D';
|
|
10
|
+
export { Camera3D, type Camera3DProps, type Camera3DHandle, type CameraMode } from './Camera3D';
|
|
11
|
+
export { Lighting3D, type Lighting3DProps } from './Lighting3D';
|
|
12
|
+
export { Canvas3DLoadingState, type Canvas3DLoadingStateProps, } from './Canvas3DLoadingState';
|
|
13
|
+
export { Canvas3DErrorBoundary, type Canvas3DErrorBoundaryProps, type Canvas3DErrorBoundaryState, } from './Canvas3DErrorBoundary';
|
|
14
|
+
export { ModelLoader, type ModelLoaderProps, } from './ModelLoader';
|
|
15
|
+
export { PhysicsObject3D, usePhysics3DController, type PhysicsObject3DProps, type Physics3DState, } from './PhysicsObject3D';
|
|
16
|
+
export { useThree, type UseThreeOptions, type UseThreeReturn, } from './useThree';
|
|
17
|
+
export { useAssetLoader, type UseAssetLoaderOptions, type UseAssetLoaderReturn, type AssetLoadingState, } from './useAssetLoader';
|
|
18
|
+
export { useSceneGraph, type UseSceneGraphReturn, type SceneGraphNode, type NodeType, } from './useSceneGraph';
|
|
19
|
+
export { useRaycaster, type UseRaycasterOptions, type UseRaycasterReturn, type RaycastHit, type GridHit, } from './useRaycaster';
|
|
20
|
+
export { useGameCanvas3DEvents, type UseGameCanvas3DEventsOptions, type UseGameCanvas3DEventsReturn, type GameCanvas3DEventConfig, } from './useGameCanvas3DEvents';
|
|
21
|
+
export { AssetLoader, assetLoader, type LoadedModel, } from './AssetLoader';
|
|
22
|
+
export { TileRenderer, type TileRendererProps, } from './TileRenderer';
|
|
23
|
+
export { UnitRenderer, type UnitRendererProps, } from './UnitRenderer';
|
|
24
|
+
export { FeatureRenderer, type FeatureRendererProps, } from './FeatureRenderer';
|
|
25
|
+
export { FeatureRenderer3D, preloadFeatures, type FeatureRenderer3DProps, } from './FeatureRenderer3D';
|
|
26
|
+
export type { UnitAnimationState } from '../shared/spriteAnimationTypes';
|
|
27
|
+
export { GameCanvas3D, type GameCanvas3DProps } from './GameCanvas3D';
|
|
28
|
+
export { Canvas3D, type Canvas3DProps } from './Canvas3D';
|
|
29
|
+
export { GameCanvas3DBattleTemplate, type GameCanvas3DBattleTemplateProps } from './GameCanvas3DBattleTemplate';
|
|
30
|
+
export { GameCanvas3DCastleTemplate, type GameCanvas3DCastleTemplateProps } from './GameCanvas3DCastleTemplate';
|
|
31
|
+
export { GameCanvas3DWorldMapTemplate, type GameCanvas3DWorldMapTemplateProps } from './GameCanvas3DWorldMapTemplate';
|
|
32
|
+
export { gridToWorld, worldToGrid, raycastToPlane, raycastToObjects, gridDistance, gridManhattanDistance, getNeighbors, isInBounds, getCellsInRadius, createGridHighlight, normalizeMouseCoordinates, type Grid3DConfig, type GridCoordinate, } from './grid3D';
|
|
33
|
+
export { Avl3DViewer, type Avl3DViewerProps } from '../../avl/organisms/Avl3DViewer';
|
|
34
|
+
export { Avl3DApplicationScene, type Avl3DApplicationSceneProps } from '../../avl/organisms/Avl3DApplicationScene';
|
|
35
|
+
export { Avl3DOrbitalScene, type Avl3DOrbitalSceneProps } from '../../avl/organisms/Avl3DOrbitalScene';
|
|
36
|
+
export { Avl3DTraitScene, type Avl3DTraitSceneProps } from '../../avl/organisms/Avl3DTraitScene';
|
|
37
|
+
export { Avl3DTransitionScene, type Avl3DTransitionSceneProps } from '../../avl/organisms/Avl3DTransitionScene';
|
|
38
|
+
export { Avl3DEffects, type Avl3DEffectsProps } from '../../avl/organisms/Avl3DEffects';
|
|
39
|
+
export { Avl3DContext, useAvl3DConfig, type Avl3DModelOverrides, type Avl3DConfig } from '../../avl/organisms/avl-3d-context';
|
|
40
|
+
export { AVL_3D_COLORS, CAMERA_POSITIONS, goldenSpiralPositions, fibonacciSpherePositions, orbitRingPositions, arcCurve3D, selfLoopCurve3D, treeLayout3D, type Position3D, } from '../../avl/organisms/avl-3d-layout';
|
|
41
|
+
export { isInFrustum, filterByFrustum, getVisibleIndices, calculateLODLevel, updateInstanceLOD, cullInstancedMesh, SpatialHashGrid, type CullingOptions, type LODLevel, type LODConfig, } from './culling';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React10, { forwardRef, useRef, useEffect, useImperativeHandle, useState, useMemo, useCallback, createContext, Component, useContext, useSyncExternalStore, useReducer } from 'react';
|
|
2
2
|
import { useThree, useFrame, Canvas, useLoader, context } from '@react-three/fiber';
|
|
3
3
|
import * as THREE6 from 'three';
|
|
4
4
|
import { Vector3, QuadraticBezierCurve3, MathUtils, Quaternion } from 'three';
|
|
@@ -470,81 +470,11 @@ function PhysicsObject3D({
|
|
|
470
470
|
entityId,
|
|
471
471
|
modelUrl,
|
|
472
472
|
initialPosition = [0, 0, 0],
|
|
473
|
-
|
|
474
|
-
mass = 1,
|
|
475
|
-
gravity = 9.8,
|
|
476
|
-
groundY = 0,
|
|
477
|
-
scale = 1,
|
|
478
|
-
onPhysicsUpdate,
|
|
479
|
-
onGroundHit,
|
|
480
|
-
onCollision
|
|
473
|
+
scale = 1
|
|
481
474
|
}) {
|
|
482
|
-
|
|
483
|
-
const physicsStateRef = useRef({
|
|
484
|
-
id: entityId,
|
|
485
|
-
x: initialPosition[0],
|
|
486
|
-
y: initialPosition[1],
|
|
487
|
-
z: initialPosition[2],
|
|
488
|
-
vx: initialVelocity[0],
|
|
489
|
-
vy: initialVelocity[1],
|
|
490
|
-
vz: initialVelocity[2],
|
|
491
|
-
rx: 0,
|
|
492
|
-
ry: 0,
|
|
493
|
-
rz: 0,
|
|
494
|
-
isGrounded: false,
|
|
495
|
-
gravity,
|
|
496
|
-
friction: 0.8,
|
|
497
|
-
mass,
|
|
498
|
-
state: "Active"
|
|
499
|
-
});
|
|
500
|
-
const groundHitRef = useRef(false);
|
|
501
|
-
useEffect(() => {
|
|
502
|
-
if (groupRef.current) {
|
|
503
|
-
groupRef.current.position.set(
|
|
504
|
-
initialPosition[0],
|
|
505
|
-
initialPosition[1],
|
|
506
|
-
initialPosition[2]
|
|
507
|
-
);
|
|
508
|
-
}
|
|
509
|
-
}, []);
|
|
510
|
-
useFrame((state, delta) => {
|
|
511
|
-
const physics = physicsStateRef.current;
|
|
512
|
-
if (physics.state !== "Active") return;
|
|
513
|
-
const dt = Math.min(delta, 0.1);
|
|
514
|
-
if (!physics.isGrounded) {
|
|
515
|
-
physics.vy -= physics.gravity * dt;
|
|
516
|
-
}
|
|
517
|
-
physics.x += physics.vx * dt;
|
|
518
|
-
physics.y += physics.vy * dt;
|
|
519
|
-
physics.z += physics.vz * dt;
|
|
520
|
-
const airResistance = Math.pow(0.99, dt * 60);
|
|
521
|
-
physics.vx *= airResistance;
|
|
522
|
-
physics.vz *= airResistance;
|
|
523
|
-
if (physics.y <= groundY) {
|
|
524
|
-
physics.y = groundY;
|
|
525
|
-
if (!physics.isGrounded) {
|
|
526
|
-
physics.isGrounded = true;
|
|
527
|
-
groundHitRef.current = true;
|
|
528
|
-
physics.vx *= physics.friction;
|
|
529
|
-
physics.vz *= physics.friction;
|
|
530
|
-
onGroundHit?.();
|
|
531
|
-
}
|
|
532
|
-
physics.vy = 0;
|
|
533
|
-
} else {
|
|
534
|
-
physics.isGrounded = false;
|
|
535
|
-
}
|
|
536
|
-
if (groupRef.current) {
|
|
537
|
-
groupRef.current.position.set(physics.x, physics.y, physics.z);
|
|
538
|
-
if (!physics.isGrounded) {
|
|
539
|
-
physics.rx += physics.vz * dt * 0.5;
|
|
540
|
-
physics.rz -= physics.vx * dt * 0.5;
|
|
541
|
-
groupRef.current.rotation.set(physics.rx, physics.ry, physics.rz);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
onPhysicsUpdate?.({ ...physics });
|
|
545
|
-
});
|
|
475
|
+
log3.debug("PhysicsObject3D render", { entityId, initialPosition });
|
|
546
476
|
const scaleArray = typeof scale === "number" ? [scale, scale, scale] : scale;
|
|
547
|
-
return /* @__PURE__ */ jsx("group", {
|
|
477
|
+
return /* @__PURE__ */ jsx("group", { position: initialPosition, scale: scaleArray, children: /* @__PURE__ */ jsx(
|
|
548
478
|
ModelLoader,
|
|
549
479
|
{
|
|
550
480
|
url: modelUrl,
|
|
@@ -767,7 +697,7 @@ var AssetLoader = class {
|
|
|
767
697
|
};
|
|
768
698
|
var assetLoader = new AssetLoader();
|
|
769
699
|
|
|
770
|
-
// components/game/
|
|
700
|
+
// components/game/3d/useThree.ts
|
|
771
701
|
var DEFAULT_OPTIONS = {
|
|
772
702
|
cameraMode: "isometric",
|
|
773
703
|
cameraPosition: [10, 10, 10],
|
|
@@ -1487,7 +1417,7 @@ function useEmitEvent() {
|
|
|
1487
1417
|
);
|
|
1488
1418
|
}
|
|
1489
1419
|
|
|
1490
|
-
// components/game/
|
|
1420
|
+
// components/game/3d/useGameCanvas3DEvents.ts
|
|
1491
1421
|
function useGameCanvas3DEvents(options) {
|
|
1492
1422
|
const {
|
|
1493
1423
|
tileClickEvent,
|
|
@@ -1819,8 +1749,6 @@ function TileRenderer({
|
|
|
1819
1749
|
return /* @__PURE__ */ jsx("group", { children: renderIndividualTiles() });
|
|
1820
1750
|
}
|
|
1821
1751
|
function UnitVisual({ unit, position, isSelected, onClick }) {
|
|
1822
|
-
const groupRef = useRef(null);
|
|
1823
|
-
const [animationState, setAnimationState] = useState("idle");
|
|
1824
1752
|
const [isHovered, setIsHovered] = useState(false);
|
|
1825
1753
|
const teamColor = useMemo(() => {
|
|
1826
1754
|
if (unit.faction === "player" || unit.team === "player") return 4491519;
|
|
@@ -1828,12 +1756,6 @@ function UnitVisual({ unit, position, isSelected, onClick }) {
|
|
|
1828
1756
|
if (unit.faction === "neutral" || unit.team === "neutral") return 16777028;
|
|
1829
1757
|
return 8947848;
|
|
1830
1758
|
}, [unit.faction, unit.team]);
|
|
1831
|
-
useFrame((state) => {
|
|
1832
|
-
if (groupRef.current && animationState === "idle") {
|
|
1833
|
-
const y = position[1] + Math.sin(state.clock.elapsedTime * 2 + position[0]) * 0.05;
|
|
1834
|
-
groupRef.current.position.y = y;
|
|
1835
|
-
}
|
|
1836
|
-
});
|
|
1837
1759
|
const healthPercent = useMemo(() => {
|
|
1838
1760
|
if (unit.health === void 0 || unit.maxHealth === void 0) return 1;
|
|
1839
1761
|
return Math.max(0, Math.min(1, unit.health / unit.maxHealth));
|
|
@@ -1846,7 +1768,6 @@ function UnitVisual({ unit, position, isSelected, onClick }) {
|
|
|
1846
1768
|
return /* @__PURE__ */ jsxs(
|
|
1847
1769
|
"group",
|
|
1848
1770
|
{
|
|
1849
|
-
ref: groupRef,
|
|
1850
1771
|
position,
|
|
1851
1772
|
onClick,
|
|
1852
1773
|
onPointerEnter: () => setIsHovered(true),
|
|
@@ -1899,7 +1820,7 @@ function UnitRenderer({
|
|
|
1899
1820
|
onAnimationStateChange,
|
|
1900
1821
|
animationSpeed = 1
|
|
1901
1822
|
}) {
|
|
1902
|
-
const handleUnitClick =
|
|
1823
|
+
const handleUnitClick = React10.useCallback(
|
|
1903
1824
|
(unit) => {
|
|
1904
1825
|
onUnitClick?.(unit);
|
|
1905
1826
|
},
|
|
@@ -2156,8 +2077,8 @@ function FeatureModel({
|
|
|
2156
2077
|
onClick,
|
|
2157
2078
|
onHover
|
|
2158
2079
|
}) {
|
|
2159
|
-
const groupRef = useRef(null);
|
|
2160
2080
|
const { model: loadedModel, isLoading } = useGLTFModel2(feature.assetUrl?.url);
|
|
2081
|
+
const baseRotationY = feature.rotation !== void 0 ? feature.rotation * Math.PI / 180 - Math.PI / 4 : -Math.PI / 4;
|
|
2161
2082
|
const model = useMemo(() => {
|
|
2162
2083
|
if (!loadedModel) return null;
|
|
2163
2084
|
const cloned = loadedModel.clone();
|
|
@@ -2170,14 +2091,6 @@ function FeatureModel({
|
|
|
2170
2091
|
});
|
|
2171
2092
|
return cloned;
|
|
2172
2093
|
}, [loadedModel]);
|
|
2173
|
-
useFrame((state) => {
|
|
2174
|
-
if (groupRef.current) {
|
|
2175
|
-
const featureRotation = feature.rotation;
|
|
2176
|
-
const baseRotation = featureRotation !== void 0 ? featureRotation * Math.PI / 180 - Math.PI / 4 : -Math.PI / 4;
|
|
2177
|
-
const wobble = isSelected ? Math.sin(state.clock.elapsedTime * 2) * 0.1 : 0;
|
|
2178
|
-
groupRef.current.rotation.y = baseRotation + wobble;
|
|
2179
|
-
}
|
|
2180
|
-
});
|
|
2181
2094
|
if (isLoading) {
|
|
2182
2095
|
return /* @__PURE__ */ jsx("group", { position, children: /* @__PURE__ */ jsxs("mesh", { rotation: [Math.PI / 2, 0, 0], children: [
|
|
2183
2096
|
/* @__PURE__ */ jsx("ringGeometry", { args: [0.3, 0.35, 16] }),
|
|
@@ -2209,8 +2122,8 @@ function FeatureModel({
|
|
|
2209
2122
|
return /* @__PURE__ */ jsxs(
|
|
2210
2123
|
"group",
|
|
2211
2124
|
{
|
|
2212
|
-
ref: groupRef,
|
|
2213
2125
|
position,
|
|
2126
|
+
rotation: [0, baseRotationY, 0],
|
|
2214
2127
|
onClick,
|
|
2215
2128
|
onPointerEnter: () => onHover(true),
|
|
2216
2129
|
onPointerLeave: () => onHover(false),
|
|
@@ -2268,7 +2181,7 @@ function preloadFeatures(urls) {
|
|
|
2268
2181
|
});
|
|
2269
2182
|
}
|
|
2270
2183
|
|
|
2271
|
-
// components/game/
|
|
2184
|
+
// components/game/shared/spriteAnimation.ts
|
|
2272
2185
|
function resolveSheetDirection(facing) {
|
|
2273
2186
|
switch (facing) {
|
|
2274
2187
|
case "se":
|
|
@@ -2290,7 +2203,7 @@ function frameRect(frame, row, columns, frameWidth, frameHeight) {
|
|
|
2290
2203
|
};
|
|
2291
2204
|
}
|
|
2292
2205
|
|
|
2293
|
-
// components/game/
|
|
2206
|
+
// components/game/2d/useUnitSpriteAtlas.ts
|
|
2294
2207
|
function unitAtlasUrl(unit) {
|
|
2295
2208
|
return unit.spriteSheet?.url ?? null;
|
|
2296
2209
|
}
|
|
@@ -3027,6 +2940,9 @@ var GameCanvas3D = forwardRef(
|
|
|
3027
2940
|
}
|
|
3028
2941
|
);
|
|
3029
2942
|
GameCanvas3D.displayName = "GameCanvas3D";
|
|
2943
|
+
function Canvas3D(props) {
|
|
2944
|
+
return /* @__PURE__ */ jsx(GameCanvas3D, { ...props });
|
|
2945
|
+
}
|
|
3030
2946
|
var DEFAULT_FAMILY = "lucide";
|
|
3031
2947
|
var VALID_FAMILIES = [
|
|
3032
2948
|
"lucide",
|
|
@@ -3099,7 +3015,7 @@ function loadLib(key, importer) {
|
|
|
3099
3015
|
return p;
|
|
3100
3016
|
}
|
|
3101
3017
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
3102
|
-
const Lazy =
|
|
3018
|
+
const Lazy = React10.lazy(async () => {
|
|
3103
3019
|
const lib = await loadLib(libKey, importer);
|
|
3104
3020
|
const Comp = pick(lib);
|
|
3105
3021
|
if (!Comp) {
|
|
@@ -3109,7 +3025,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
3109
3025
|
return { default: Comp };
|
|
3110
3026
|
});
|
|
3111
3027
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
3112
|
-
|
|
3028
|
+
React10.Suspense,
|
|
3113
3029
|
{
|
|
3114
3030
|
fallback: /* @__PURE__ */ jsx(
|
|
3115
3031
|
"span",
|
|
@@ -3775,7 +3691,7 @@ var Icon = ({
|
|
|
3775
3691
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
3776
3692
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
3777
3693
|
const family = useIconFamily();
|
|
3778
|
-
const RenderedComponent =
|
|
3694
|
+
const RenderedComponent = React10.useMemo(() => {
|
|
3779
3695
|
if (directIcon) return null;
|
|
3780
3696
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
3781
3697
|
}, [directIcon, effectiveName, family]);
|
|
@@ -3895,7 +3811,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3895
3811
|
const IconComp = value;
|
|
3896
3812
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
3897
3813
|
}
|
|
3898
|
-
if (
|
|
3814
|
+
if (React10.isValidElement(value)) {
|
|
3899
3815
|
return value;
|
|
3900
3816
|
}
|
|
3901
3817
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -3904,7 +3820,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3904
3820
|
}
|
|
3905
3821
|
return value;
|
|
3906
3822
|
}
|
|
3907
|
-
var Button =
|
|
3823
|
+
var Button = React10.forwardRef(
|
|
3908
3824
|
({
|
|
3909
3825
|
className,
|
|
3910
3826
|
variant = "primary",
|
|
@@ -4050,7 +3966,7 @@ var Typography = ({
|
|
|
4050
3966
|
}) => {
|
|
4051
3967
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
4052
3968
|
const Component2 = as || defaultElements[variant];
|
|
4053
|
-
return
|
|
3969
|
+
return React10.createElement(
|
|
4054
3970
|
Component2,
|
|
4055
3971
|
{
|
|
4056
3972
|
id,
|
|
@@ -4123,7 +4039,7 @@ var Stack = ({
|
|
|
4123
4039
|
};
|
|
4124
4040
|
const isHorizontal = direction === "horizontal";
|
|
4125
4041
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
4126
|
-
return
|
|
4042
|
+
return React10.createElement(
|
|
4127
4043
|
Component2,
|
|
4128
4044
|
{
|
|
4129
4045
|
className: cn(
|
|
@@ -4148,7 +4064,7 @@ var Stack = ({
|
|
|
4148
4064
|
var VStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "vertical", ...props });
|
|
4149
4065
|
var HStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "horizontal", ...props });
|
|
4150
4066
|
|
|
4151
|
-
// components/game/
|
|
4067
|
+
// components/game/shared/boardEntity.ts
|
|
4152
4068
|
function boardEntity(entity) {
|
|
4153
4069
|
if (!entity) return void 0;
|
|
4154
4070
|
return Array.isArray(entity) ? entity[0] : entity;
|
|
@@ -4498,7 +4414,7 @@ var positionStyles = {
|
|
|
4498
4414
|
fixed: "fixed",
|
|
4499
4415
|
sticky: "sticky"
|
|
4500
4416
|
};
|
|
4501
|
-
var Box =
|
|
4417
|
+
var Box = React10.forwardRef(
|
|
4502
4418
|
({
|
|
4503
4419
|
padding,
|
|
4504
4420
|
paddingX,
|
|
@@ -4563,7 +4479,7 @@ var Box = React11.forwardRef(
|
|
|
4563
4479
|
onPointerDown?.(e);
|
|
4564
4480
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
4565
4481
|
const isClickable = action || onClick;
|
|
4566
|
-
return
|
|
4482
|
+
return React10.createElement(
|
|
4567
4483
|
Component2,
|
|
4568
4484
|
{
|
|
4569
4485
|
ref,
|
|
@@ -4599,7 +4515,7 @@ var Box = React11.forwardRef(
|
|
|
4599
4515
|
);
|
|
4600
4516
|
Box.displayName = "Box";
|
|
4601
4517
|
|
|
4602
|
-
// components/game/
|
|
4518
|
+
// components/game/shared/makeAsset.ts
|
|
4603
4519
|
var ROLE_DEFAULTS = {
|
|
4604
4520
|
tile: { dimension: "2d", animations: ["static"], aspect: "1:1" },
|
|
4605
4521
|
decoration: { dimension: "2d", animations: ["static"], aspect: "1:1" },
|
|
@@ -4623,7 +4539,7 @@ function makeAsset(url, role, overrides = {}) {
|
|
|
4623
4539
|
};
|
|
4624
4540
|
}
|
|
4625
4541
|
|
|
4626
|
-
// components/game/
|
|
4542
|
+
// components/game/2d/game3dAssetManifest.ts
|
|
4627
4543
|
function tileKind(type, passable) {
|
|
4628
4544
|
if (passable === false) return "wall";
|
|
4629
4545
|
if (type === "dirt" || type === "road") return "dirt";
|
|
@@ -7351,7 +7267,7 @@ var Avl3DViewer = ({
|
|
|
7351
7267
|
const handleTraitClick = useCallback((name) => {
|
|
7352
7268
|
dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
|
|
7353
7269
|
}, []);
|
|
7354
|
-
const [highlightedTrait, setHighlightedTrait] =
|
|
7270
|
+
const [highlightedTrait, setHighlightedTrait] = React10.useState(null);
|
|
7355
7271
|
const handleTransitionClick = useCallback((index) => {
|
|
7356
7272
|
dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
|
|
7357
7273
|
}, []);
|
|
@@ -7438,7 +7354,7 @@ var Avl3DViewer = ({
|
|
|
7438
7354
|
gap: "xs",
|
|
7439
7355
|
align: "center",
|
|
7440
7356
|
className: "absolute top-2 left-2 z-10 bg-surface/80 backdrop-blur rounded-md px-3 py-1.5",
|
|
7441
|
-
children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
7357
|
+
children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React10.Fragment, { children: [
|
|
7442
7358
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
|
|
7443
7359
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
7444
7360
|
Box,
|
|
@@ -7714,4 +7630,4 @@ var SpatialHashGrid = class {
|
|
|
7714
7630
|
}
|
|
7715
7631
|
};
|
|
7716
7632
|
|
|
7717
|
-
export { AVL_3D_COLORS, AssetLoader, Avl3DApplicationScene, Avl3DContext, Avl3DEffects, Avl3DOrbitalScene, Avl3DTraitScene, Avl3DTransitionScene, Avl3DViewer, CAMERA_POSITIONS, Camera3D, Canvas3DErrorBoundary, Canvas3DLoadingState, FeatureRenderer, FeatureRenderer3D, GameCanvas3D, GameCanvas3DBattleTemplate, GameCanvas3DCastleTemplate, GameCanvas3DWorldMapTemplate, Lighting3D, ModelLoader, PhysicsObject3D, Scene3D, SpatialHashGrid, TileRenderer, UnitRenderer, arcCurve3D, assetLoader, calculateLODLevel, createGridHighlight, cullInstancedMesh, fibonacciSpherePositions, filterByFrustum, getCellsInRadius, getNeighbors, getVisibleIndices, goldenSpiralPositions, gridDistance, gridManhattanDistance, gridToWorld, isInBounds, isInFrustum, normalizeMouseCoordinates, orbitRingPositions, preloadFeatures, raycastToObjects, raycastToPlane, selfLoopCurve3D, treeLayout3D, updateInstanceLOD, useAssetLoader, useAvl3DConfig, useGameCanvas3DEvents, usePhysics3DController, useRaycaster, useSceneGraph, useThree3 as useThree, worldToGrid };
|
|
7633
|
+
export { AVL_3D_COLORS, AssetLoader, Avl3DApplicationScene, Avl3DContext, Avl3DEffects, Avl3DOrbitalScene, Avl3DTraitScene, Avl3DTransitionScene, Avl3DViewer, CAMERA_POSITIONS, Camera3D, Canvas3D, Canvas3DErrorBoundary, Canvas3DLoadingState, FeatureRenderer, FeatureRenderer3D, GameCanvas3D, GameCanvas3DBattleTemplate, GameCanvas3DCastleTemplate, GameCanvas3DWorldMapTemplate, Lighting3D, ModelLoader, PhysicsObject3D, Scene3D, SpatialHashGrid, TileRenderer, UnitRenderer, arcCurve3D, assetLoader, calculateLODLevel, createGridHighlight, cullInstancedMesh, fibonacciSpherePositions, filterByFrustum, getCellsInRadius, getNeighbors, getVisibleIndices, goldenSpiralPositions, gridDistance, gridManhattanDistance, gridToWorld, isInBounds, isInFrustum, normalizeMouseCoordinates, orbitRingPositions, preloadFeatures, raycastToObjects, raycastToPlane, selfLoopCurve3D, treeLayout3D, updateInstanceLOD, useAssetLoader, useAvl3DConfig, useGameCanvas3DEvents, usePhysics3DController, useRaycaster, useSceneGraph, useThree3 as useThree, worldToGrid };
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* the lazy loader but are intentionally absent here so they don't become
|
|
14
14
|
* render-ui targets.
|
|
15
15
|
*/
|
|
16
|
-
export { GameCanvas3D } from '
|
|
17
|
-
export { GameCanvas3DBattleTemplate } from '
|
|
18
|
-
export { GameCanvas3DCastleTemplate } from '
|
|
19
|
-
export { GameCanvas3DWorldMapTemplate } from '
|
|
20
|
-
export { FeatureRenderer } from './
|
|
16
|
+
export { GameCanvas3D } from './GameCanvas3D';
|
|
17
|
+
export { GameCanvas3DBattleTemplate } from './GameCanvas3DBattleTemplate';
|
|
18
|
+
export { GameCanvas3DCastleTemplate } from './GameCanvas3DCastleTemplate';
|
|
19
|
+
export { GameCanvas3DWorldMapTemplate } from './GameCanvas3DWorldMapTemplate';
|
|
20
|
+
export { FeatureRenderer } from './FeatureRenderer';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EventEmit } from '@almadar/core';
|
|
2
|
-
import type { IsometricTile, IsometricUnit, IsometricFeature } from '
|
|
2
|
+
import type { IsometricTile, IsometricUnit, IsometricFeature } from '../shared/isometricTypes';
|
|
3
3
|
export interface GameCanvas3DEventConfig {
|
|
4
4
|
/** Event name for tile clicks */
|
|
5
5
|
tileClickEvent?: EventEmit<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js';
|
|
3
|
-
import { AssetLoader } from '
|
|
3
|
+
import { AssetLoader } from './AssetLoader';
|
|
4
4
|
export type CameraMode = 'isometric' | 'perspective' | 'top-down';
|
|
5
5
|
export interface UseThreeOptions {
|
|
6
6
|
/** Camera mode for viewing the scene */
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Ported from trait-wars and generalized for any almadar-ui client.
|
|
8
8
|
*/
|
|
9
|
-
import type { CanvasParticle, CanvasSequence, CanvasOverlay, CanvasEffectState, ParticleEmitterConfig, SequenceConfig, OverlayConfig } from '
|
|
9
|
+
import type { CanvasParticle, CanvasSequence, CanvasOverlay, CanvasEffectState, ParticleEmitterConfig, SequenceConfig, OverlayConfig } from './effects';
|
|
10
10
|
/**
|
|
11
11
|
* Draw a sprite tinted with an RGB color onto the main canvas.
|
|
12
12
|
* Uses offscreen canvas with `source-atop` compositing to recolor
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Generalized from trait-wars: uses EffectAssetManifest instead of TraitWarsAssetManifest.
|
|
8
8
|
*/
|
|
9
|
-
import type { CombatActionType, CombatPreset, EffectAssetManifest } from '
|
|
9
|
+
import type { CombatActionType, CombatPreset, EffectAssetManifest } from './effects';
|
|
10
10
|
type PresetFactory = (originX: number, originY: number) => CombatPreset;
|
|
11
11
|
/**
|
|
12
12
|
* Create combat preset factories from an effect asset manifest.
|
|
@@ -12,7 +12,7 @@ export interface GameUnit {
|
|
|
12
12
|
id: string;
|
|
13
13
|
name: string;
|
|
14
14
|
characterType: string;
|
|
15
|
-
team: 'player' | 'enemy';
|
|
15
|
+
team: 'player' | 'enemy' | 'neutral';
|
|
16
16
|
position: Position;
|
|
17
17
|
health: number;
|
|
18
18
|
maxHealth: number;
|
|
@@ -38,7 +38,7 @@ export interface GameState {
|
|
|
38
38
|
units: Record<string, GameUnit>;
|
|
39
39
|
currentPhase: GamePhase;
|
|
40
40
|
currentTurn: number;
|
|
41
|
-
activeTeam: 'player' | 'enemy';
|
|
41
|
+
activeTeam: 'player' | 'enemy' | 'neutral';
|
|
42
42
|
selectedUnitId?: string;
|
|
43
43
|
validMoves: Position[];
|
|
44
44
|
attackTargets: Position[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Game Shared (dimension-agnostic)
|
|
3
|
+
*
|
|
4
|
+
* Render DTO types, pure projection/animation utils, and the shared image cache hook.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export type { IsometricTile, IsometricUnit, IsometricFeature, CameraState, } from './isometricTypes';
|
|
9
|
+
export type { AnimationName, FacingDirection, SpriteDirection, ResolvedFrame, UnitAnimationState, SpriteFrameDims, SpriteSheetUrls, AnimationDef, } from './spriteAnimationTypes';
|
|
10
|
+
export { createInitialGameState, calculateValidMoves, calculateAttackTargets, } from './game';
|
|
11
|
+
export type { Position, GameUnit, UnitTrait, BoardTile, GamePhase, GameState, GameAction, } from './game';
|
|
12
|
+
export * from './effects';
|
|
13
|
+
export * from './boardEntity';
|
|
14
|
+
export * from './makeAsset';
|
|
15
|
+
export { useImageCache } from './useImageCache';
|
|
16
|
+
export { isoToScreen, screenToIso, TILE_WIDTH, TILE_HEIGHT, FLOOR_HEIGHT, DIAMOND_TOP_Y, FEATURE_COLORS, } from './isometric';
|
|
17
|
+
export type { TileLayout } from './isometric';
|
|
18
|
+
export { inferDirection, resolveSheetDirection, getCurrentFrame, resolveFrame, createUnitAnimationState, transitionAnimation, tickAnimationState, } from './spriteAnimation';
|
|
19
|
+
export { SPRITE_SHEET_LAYOUT, SHEET_COLUMNS } from './spriteSheetConstants';
|
|
20
|
+
export { combatAnimations, combatClasses, combatEffects, applyTemporaryEffect, calculateDamage, generateCombatMessage, } from './combatEffects';
|
|
21
|
+
export type { CombatEffect, DamageResult, CombatEventType, CombatEventData, } from './combatEffects';
|
|
22
|
+
export * from './combatPresets';
|
|
23
|
+
export * from './canvasEffects';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Asset } from '@almadar/core';
|
|
2
|
-
import type { AnimationName } from './
|
|
2
|
+
import type { AnimationName } from './spriteAnimationTypes';
|
|
3
|
+
import type { UnitTrait } from './game';
|
|
3
4
|
/**
|
|
4
5
|
* Isometric Game Types
|
|
5
6
|
*
|
|
@@ -84,12 +85,7 @@ export type IsometricUnit = {
|
|
|
84
85
|
/** Maximum health */
|
|
85
86
|
maxHealth?: number;
|
|
86
87
|
/** Trait attachments for state display */
|
|
87
|
-
traits?:
|
|
88
|
-
name: string;
|
|
89
|
-
currentState: string;
|
|
90
|
-
states: string[];
|
|
91
|
-
cooldown: number;
|
|
92
|
-
}[];
|
|
88
|
+
traits?: UnitTrait[];
|
|
93
89
|
/** Previous position for movement trail ghost */
|
|
94
90
|
previousPosition?: {
|
|
95
91
|
x: number;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
import type { AnimationDef, AnimationName, FacingDirection, SpriteDirection, ResolvedFrame, UnitAnimationState, SpriteFrameDims, SpriteSheetUrls } from '
|
|
10
|
+
import type { AnimationDef, AnimationName, FacingDirection, SpriteDirection, ResolvedFrame, UnitAnimationState, SpriteFrameDims, SpriteSheetUrls } from './spriteAnimationTypes';
|
|
11
11
|
/**
|
|
12
12
|
* Infer facing direction from a movement delta on the isometric grid.
|
|
13
13
|
* dx/dy are tile coordinate deltas (not screen pixels).
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
|
-
import type { AnimationDef, AnimationName } from '
|
|
9
|
+
import type { AnimationDef, AnimationName } from './spriteAnimationTypes';
|
|
10
10
|
/** Number of columns in a sprite sheet (frames per row) */
|
|
11
11
|
export declare const SHEET_COLUMNS = 8;
|
|
12
12
|
/**
|