@craft_eco/craft-mcp 0.1.25 → 0.1.26
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/README.md +31 -10
- package/bin/craft-mcp.mjs +10 -8
- package/dist-server/game-workflow/bundle-files.mjs +43 -0
- package/dist-server/game-workflow/engines.mjs +13 -6
- package/dist-server/game-workflow/project-bundles.mjs +90 -0
- package/dist-server/game-workflow/project-context.mjs +91 -0
- package/dist-server/game-workflow/projects.mjs +16 -4
- package/dist-server/game-workflow/publication-materials.mjs +18 -20
- package/dist-server/game-workflow/publications.mjs +15 -17
- package/dist-server/game-workflow/publish-capture.mjs +21 -57
- package/dist-server/integrations/config.mjs +71 -0
- package/dist-server/integrations/files.mjs +54 -0
- package/dist-server/integrations/hosts.mjs +30 -0
- package/dist-server/integrations/install.mjs +86 -0
- package/dist-server/integrations/runtime.mjs +71 -0
- package/dist-server/mcp/publication-page.mjs +18 -50
- package/dist-server/mcp/publish-panel.mjs +28 -35
- package/dist-server/mcp/server.mjs +17 -14
- package/dist-server/preview/preview-launcher.mjs +9 -2
- package/dist-server/preview/preview-start.mjs +2 -2
- package/dist-server/upstream/publication-transport.mjs +19 -19
- package/package.json +10 -2
- package/resources/craft-create/SKILL.md +14 -0
- package/resources/craft-game-maker/SKILL.md +77 -71
- package/resources/craft-game-maker/js.md +10 -10
- package/resources/craft-game-maker/js3d.md +13 -13
- package/resources/game_visual_qa.mjs +1149 -1149
- package/resources/js/bundle.json +93 -0
- package/resources/js/context/AGENTS.md +15 -102
- package/resources/js/context/knowledge/AigcWiring.md +5 -196
- package/resources/js/context/knowledge/AssetUrl.md +5 -20
- package/resources/js/context/knowledge/Layout.md +7 -0
- package/resources/js/context/knowledge/Lifecycle.md +6 -27
- package/resources/js/context/skills/aigc-generate/SKILL.md +6 -141
- package/resources/js/context/skills/asset-search/SKILL.md +5 -62
- package/resources/js/context/skills/asset-search/references/resource-config.md +9 -0
- package/resources/js/context/skills/export-config/SKILL.md +7 -19
- package/resources/js/context/skills/export-config/scripts/export-config.mjs +3 -45
- package/resources/js/context/skills/index.json +30 -0
- package/resources/js/context/skills/visual-qa/SKILL.md +6 -28
- package/resources/js/project/README.md +4 -96
- package/resources/js/project/package.json +1 -2
- package/resources/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +1 -37
- package/resources/js/project/scripts/config-export.mjs +10 -34
- package/resources/js3d/bundle.json +104 -0
- package/resources/js3d/context/AGENTS.md +16 -85
- package/resources/js3d/context/knowledge/AigcWiring.md +9 -0
- package/resources/js3d/context/knowledge/AssetUrl.md +9 -0
- package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +9 -67
- package/resources/js3d/context/knowledge/Layout.md +7 -0
- package/resources/js3d/context/knowledge/Runtime.md +5 -30
- package/resources/js3d/context/skills/aigc-integration/SKILL.md +6 -164
- package/resources/js3d/context/skills/asset-search/SKILL.md +5 -171
- package/resources/js3d/context/skills/asset-search/references/resource-config.md +6 -94
- package/resources/js3d/context/skills/asset-usage-audit/SKILL.md +6 -82
- package/resources/js3d/context/skills/export-config/SKILL.md +7 -11
- package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +3 -55
- package/resources/js3d/context/skills/index.json +42 -0
- package/resources/js3d/context/skills/performance-audit/SKILL.md +8 -153
- package/resources/js3d/context/skills/visual-qa/SKILL.md +14 -0
- package/resources/js3d/project/README.md +4 -103
- package/resources/js3d/project/package.json +1 -2
- package/resources/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
- package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-scene-assets.mjs +3 -28
- package/resources/js3d/project/scripts/config-export.mjs +12 -34
- package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts +8 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.js +39 -0
- package/vendor/agent-cli/dist/src/artifacts/build-failure.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts +5 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js +45 -0
- package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js +2 -1
- package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +2 -0
- package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/prepare.js +7 -2
- package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +2 -0
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +27 -16
- package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts +14 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js +119 -0
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js.map +1 -0
- package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/artifacts/static.js +20 -6
- package/vendor/agent-cli/dist/src/artifacts/static.js.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-protocol.js +24 -2
- package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +1 -1
- package/vendor/agent-cli/dist/src/cli/process-steering.d.ts +21 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.js +66 -0
- package/vendor/agent-cli/dist/src/cli/process-steering.js.map +1 -0
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +1 -1
- package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +1 -1
- package/vendor/agent-cli/dist/src/index.d.ts +4 -1
- package/vendor/agent-cli/dist/src/index.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/index.js +3 -0
- package/vendor/agent-cli/dist/src/index.js.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +29 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +18 -1
- package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/client.d.ts +10 -0
- package/vendor/agent-cli/dist/src/session/client.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/client.js +15 -5
- package/vendor/agent-cli/dist/src/session/client.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/link-session.d.ts +3 -0
- package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/link-session.js +14 -1
- package/vendor/agent-cli/dist/src/session/link-session.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-observability.d.ts +3 -0
- package/vendor/agent-cli/dist/src/session/process-observability.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-observability.js +11 -0
- package/vendor/agent-cli/dist/src/session/process-observability.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-request.d.ts +3 -2
- package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/process-request.js +27 -9
- package/vendor/agent-cli/dist/src/session/process-request.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +1 -0
- package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-start-body.js +8 -3
- package/vendor/agent-cli/dist/src/session/run-start-body.js.map +1 -1
- package/vendor/agent-cli/dist/src/session/run-steer.d.ts +42 -0
- package/vendor/agent-cli/dist/src/session/run-steer.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/session/run-steer.js +205 -0
- package/vendor/agent-cli/dist/src/session/run-steer.js.map +1 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts +6 -0
- package/vendor/agent-cli/dist/src/shared/types.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts +21 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.js +102 -0
- package/vendor/agent-cli/dist/src/tools/context-program-receipt.js.map +1 -0
- package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +1 -1
- package/vendor/agent-cli/dist/src/tools/context-program.js +3 -0
- package/vendor/agent-cli/dist/src/tools/context-program.js.map +1 -1
- package/resources/js/context/.role/AGENTS_DESIGN.md +0 -9
- package/resources/js/context/agents/aigc-asset.md +0 -168
- package/resources/js/context/knowledge/AigcEnabled.md +0 -49
- package/resources/js/context/knowledge/FrontendComponents.md +0 -17
- package/resources/js/context/knowledge/MobileAdaptation.md +0 -73
- package/resources/js/context/knowledge/MobileAdapted.md +0 -36
- package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
- package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -115
- package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -392
- package/resources/js/context/knowledge/PlatformServices.md +0 -190
- package/resources/js/context/knowledge/ProjectDisplayConfig.md +0 -35
- package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
- package/resources/js/context/knowledge/Ui.md +0 -11
- package/resources/js/context/knowledge/UiEditorCompat.md +0 -21
- package/resources/js/context/rules/MultiplayerCapability.md +0 -23
- package/resources/js/context/rules/MultiplayerRoomEntryUX.md +0 -63
- package/resources/js/context/rules/PlatformBoundaryModules.md +0 -44
- package/resources/js/context/rules/preview_ready.md +0 -8
- package/resources/js/context/skills/aigc-generate/knowledge/audio.md +0 -39
- package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +0 -26
- package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +0 -132
- package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +0 -53
- package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +0 -52
- package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +0 -191
- package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +0 -55
- package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +0 -62
- package/resources/js/context/skills/asset-search/scripts/config.json +0 -5
- package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +0 -125
- package/resources/js/context/skills/asset-search/scripts/search.mjs +0 -760
- package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -657
- package/resources/js/context/skills/asset-search/strategies/anim2d.md +0 -42
- package/resources/js/context/skills/asset-search/strategies/audio.md +0 -34
- package/resources/js/context/skills/asset-search/strategies/effect2d.md +0 -31
- package/resources/js/context/skills/asset-search/strategies/texture-prop.md +0 -22
- package/resources/js/context/skills/asset-search/strategies/ui-common.md +0 -40
- package/resources/js/context/skills/asset-search/strategies/ui-style.md +0 -28
- package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
- package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +0 -93
- package/resources/js/context/skills/lightgame-runtime-adapt/project/game-runtime.json +0 -7
- package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +0 -22
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +0 -208
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +0 -37
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +0 -31
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +0 -272
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.d.mts +0 -79
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/platform/platform.mjs +0 -29
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/release.json +0 -22
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/cli.mjs +0 -16
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.d.mts +0 -4
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/project.mjs +0 -50
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +0 -3
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tooling/vite.mjs +0 -72
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.d.mts +0 -24
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/assets.mjs +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.d.mts +0 -10
- package/resources/js/context/skills/lightgame-runtime-adapt/project/runtime/lightgame/1.1.0/tools/astc.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +0 -37
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/cli.mjs +0 -20
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.d.mts +0 -19
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/config.mjs +0 -1
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/installed.json +0 -6
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.d.mts +0 -6
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/project.mjs +0 -77
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.d.mts +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config/vite.mjs +0 -34
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/ui-stage.ts +0 -156
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/display/viewport.ts +0 -249
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/main.ts +0 -87
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/platform.ts +0 -2
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/screenUi.ts +0 -185
- package/resources/js/context/skills/lightgame-runtime-adapt/project/src/style.css +0 -294
- package/resources/js/context/skills/lightgame-runtime-adapt/project/tsconfig.json +0 -20
- package/resources/js/context/skills/lightgame-runtime-adapt/project/vite.config.ts +0 -5
- package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +0 -159
- package/resources/js/context/skills/mobile-adaptation/SKILL.md +0 -277
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -50
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -862
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
- package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -135
- package/resources/js/context/skills/mobile-adaptation/references/input-config.md +0 -342
- package/resources/js/context/skills/mobile-adaptation/references/verification.md +0 -140
- package/resources/js/context/skills/mobile-adaptation/references/web-audio.md +0 -11
- package/resources/js/context/skills/mobile-compat-qa/SKILL.md +0 -53
- package/resources/js/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
- package/resources/js/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
- package/resources/js/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
- package/resources/js/context/skills/optimization-suggestions/SKILL.md +0 -89
- package/resources/js/context/skills/platform-services/SKILL.md +0 -101
- package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
- package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
- package/resources/js/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
- package/resources/js/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
- package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
- package/resources/js/context/skills/platform-services/assets/modules/log.ts +0 -35
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
- package/resources/js/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
- package/resources/js/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
- package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +0 -49
- package/resources/js/context/skills/platform-services/assets/modules/save.mjs +0 -1
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
- package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
- package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
- package/resources/js/context/skills/platform-services/references/api_reference.md +0 -18
- package/resources/js/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
- package/resources/js/context/skills/platform-services/scripts/install.mjs +0 -148
- package/resources/js/context/skills/resolution-adaptation/SKILL.md +0 -47
- package/resources/js/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
- package/resources/js/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -249
- package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +0 -98
- package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -200
- package/resources/js/context/skills/resolution-adaptation/references/audit.md +0 -31
- package/resources/js/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
- package/resources/js/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
- package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
- package/resources/js/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
- package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
- package/resources/js/context/skills/resolution-adaptation/references/world-resize.md +0 -55
- package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
- package/resources/js/context/skills/scene-editor-compat/SKILL.md +0 -94
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +0 -13
- package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +0 -6
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +0 -25
- package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +0 -18
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +0 -42
- package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +0 -144
- package/resources/js/context/skills/scene-editor-compat/docs/contract.md +0 -330
- package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +0 -64
- package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +0 -28
- package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +0 -47
- package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +0 -64
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +0 -38
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +0 -9
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +0 -59
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +0 -30
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +0 -66
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +0 -20
- package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +0 -26
- package/resources/js/context/skills/scene-editor-compat/references/contract.md +0 -73
- package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +0 -162
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +0 -853
- package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +0 -173
- package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -427
- package/resources/js/context/skills/scene-editor-compat/version.json +0 -1
- package/resources/js/context/skills/ui-editor-compat/SKILL.md +0 -48
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -74
- package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
- package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js/context/skills/ui-editor-compat/references/contract.md +0 -132
- package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
- package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
- package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
- package/resources/js/context/skills/version-update/SKILL.md +0 -192
- package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
- package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
- package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
- package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
- package/resources/js/context/version/version.json +0 -1
- package/resources/js/project/SPEC/assist/.gitkeep +0 -0
- package/resources/js/project/SPEC/guide/.gitkeep +0 -0
- package/resources/js/project/SPEC/plan/.gitkeep +0 -0
- package/resources/js/project/SPEC/readme.md +0 -6
- package/resources/js/project/SPEC/res/.gitkeep +0 -0
- package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
- package/resources/js/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
- package/resources/js/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
- package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
- package/resources/js/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -29
- package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
- package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/release.json +0 -37
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
- package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
- package/resources/js/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
- package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
- package/resources/js/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
- package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
- package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
- package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
- package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
- package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
- package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
- package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
- package/resources/js/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js/project/vendor/core-manager-js/package.json +0 -33
- package/resources/js/project/vendor/core-manager-js/src/.versions.json +0 -42
- package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +0 -41
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +0 -93
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +0 -203
- package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +0 -106
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +0 -25
- package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +0 -21
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +0 -65
- package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +0 -340
- package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +0 -87
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +0 -92
- package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +0 -271
- package/resources/js/project/vendor/core-manager-js/src/index.ts +0 -31
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +0 -81
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +0 -43
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +0 -32
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +0 -141
- package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +0 -20
- package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +0 -183
- package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +0 -304
- package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +0 -351
- package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +0 -180
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +0 -13
- package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +0 -14
- package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +0 -68
- package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +0 -433
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +0 -118
- package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +0 -444
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +0 -485
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +0 -66
- package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +0 -149
- package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +0 -9
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +0 -29
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +0 -88
- package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +0 -122
- package/resources/js/project/vendor/core-manager-js/src/runtime.ts +0 -24
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +0 -318
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +0 -151
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +0 -235
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +0 -98
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +0 -94
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +0 -209
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +0 -106
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +0 -341
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +0 -68
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +0 -236
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +0 -22
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +0 -29
- package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +0 -197
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +0 -9
- package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +0 -555
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +0 -112
- package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +0 -178
- package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +0 -246
- package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +0 -139
- package/resources/js/project/vendor/core-manager-js/tsconfig.json +0 -15
- package/resources/js/project/vendor/run.sh +0 -4
- package/resources/js/project/version/craft_feature_version.json +0 -42
- package/resources/js/project/version/project_feature_version.json +0 -11
- package/resources/js3d/context/.role/AGENTS_DESIGN.md +0 -9
- package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +0 -75
- package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +0 -42
- package/resources/js3d/context/knowledge/FrontendComponents.md +0 -19
- package/resources/js3d/context/knowledge/MobileAdaptation.md +0 -73
- package/resources/js3d/context/knowledge/MobileAdapted.md +0 -36
- package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
- package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -117
- package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -430
- package/resources/js3d/context/knowledge/PlatformServices.md +0 -190
- package/resources/js3d/context/knowledge/ProjectDisplayConfig.md +0 -35
- package/resources/js3d/context/knowledge/SceneEditorCompat.md +0 -35
- package/resources/js3d/context/knowledge/StepByStep.md +0 -21
- package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
- package/resources/js3d/context/knowledge/UiEditorCompat.md +0 -21
- package/resources/js3d/context/rules/MultiplayerCapability.md +0 -27
- package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +0 -63
- package/resources/js3d/context/rules/PlatformBoundaryModules.md +0 -44
- package/resources/js3d/context/rules/preview_ready.md +0 -8
- package/resources/js3d/context/skills/aigc-integration/assets/sprite-sheet-player.mjs +0 -70
- package/resources/js3d/context/skills/aigc-integration/callback.md +0 -77
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +0 -23
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +0 -38
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/character2d-aigc-knowledge.md +0 -72
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +0 -33
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +0 -36
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +0 -37
- package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +0 -35
- package/resources/js3d/context/skills/asset-search/references/sprite-sheets.md +0 -58
- package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +0 -62
- package/resources/js3d/context/skills/asset-search/scripts/config.json +0 -235
- package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +0 -905
- package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +0 -79
- package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +0 -74
- package/resources/js3d/context/skills/asset-search/scripts/search.mjs +0 -637
- package/resources/js3d/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -667
- package/resources/js3d/context/skills/asset-search/strategies/anim2d.md +0 -42
- package/resources/js3d/context/skills/asset-search/strategies/effect2d.md +0 -31
- package/resources/js3d/context/skills/asset-usage-audit/references/case-tidewater-zoo.md +0 -89
- package/resources/js3d/context/skills/asset-usage-audit/references/optimization-playbook.md +0 -143
- package/resources/js3d/context/skills/asset-usage-audit/references/usage-model.md +0 -90
- package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
- package/resources/js3d/context/skills/game-art-style/SKILL.md +0 -60
- package/resources/js3d/context/skills/game-art-style/assets/previews/cartoon.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/comic.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/cozy.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/cyber.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/horror.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/lowpoly.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/paper.png +0 -0
- package/resources/js3d/context/skills/game-art-style/assets/previews/voxel.png +0 -0
- package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +0 -38
- package/resources/js3d/context/skills/game-art-style/references/construction.md +0 -111
- package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +0 -105
- package/resources/js3d/context/skills/game-art-style/references/sources.md +0 -25
- package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +0 -175
- package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +0 -168
- package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +0 -191
- package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +0 -165
- package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +0 -173
- package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +0 -185
- package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +0 -181
- package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +0 -189
- package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +0 -88
- package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +0 -301
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -104
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -933
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
- package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -257
- package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +0 -342
- package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +0 -140
- package/resources/js3d/context/skills/mobile-adaptation/references/web-audio.md +0 -11
- package/resources/js3d/context/skills/mobile-compat-qa/SKILL.md +0 -53
- package/resources/js3d/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-form-input.md +0 -10
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
- package/resources/js3d/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
- package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +0 -74
- package/resources/js3d/context/skills/performance-audit/references/case-notes.md +0 -93
- package/resources/js3d/context/skills/performance-audit/references/rules.md +0 -183
- package/resources/js3d/context/skills/platform-services/SKILL.md +0 -101
- package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
- package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-ai-game-sdk.min.js +0 -5
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/qq-session.mjs +0 -208
- package/resources/js3d/context/skills/platform-services/assets/modules/identity/shared.mjs +0 -37
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
- package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
- package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +0 -35
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
- package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.d.mts +0 -31
- package/resources/js3d/context/skills/platform-services/assets/modules/platform-service.mjs +0 -272
- package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +0 -49
- package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +0 -1
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
- package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
- package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
- package/resources/js3d/context/skills/platform-services/references/api_reference.md +0 -18
- package/resources/js3d/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
- package/resources/js3d/context/skills/platform-services/scripts/install.mjs +0 -148
- package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +0 -46
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/ui-stage.ts +0 -156
- package/resources/js3d/context/skills/resolution-adaptation/assets/display/viewport.ts +0 -239
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +0 -129
- package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -188
- package/resources/js3d/context/skills/resolution-adaptation/references/audit.md +0 -31
- package/resources/js3d/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
- package/resources/js3d/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
- package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
- package/resources/js3d/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
- package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
- package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
- package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +0 -599
- package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +0 -141
- package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +0 -92
- package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +0 -125
- package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +0 -113
- package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -1187
- package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +0 -53
- package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +0 -4
- package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +0 -94
- package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +0 -50
- package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +0 -105
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +0 -147
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +0 -79
- package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +0 -56
- package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +0 -51
- package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +0 -55
- package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +0 -78
- package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +0 -84
- package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +0 -120
- package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +0 -4
- package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +0 -238
- package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +0 -59
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -61
- package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
- package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
- package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +0 -110
- package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
- package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
- package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
- package/resources/js3d/context/skills/version-update/SKILL.md +0 -191
- package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
- package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
- package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
- package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
- package/resources/js3d/context/version/version.json +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.d.mts +0 -19
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/config.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-capture-video.mjs +0 -227
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.d.mts +0 -79
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -30
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
- package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +0 -39
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
- package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -7
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.d.mts +0 -24
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/assets.mjs +0 -2
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.d.mts +0 -10
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/astc.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.d.mts +0 -26
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/glb.mjs +0 -351
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
- package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
- package/resources/js3d/project/scripts/refresh-runtime.mjs +0 -50
- package/resources/js3d/project/vendor/core-manager-three/package.json +0 -12
- package/resources/js3d/project/vendor/core-manager-three/src/index.ts +0 -2
- package/resources/js3d/project/vendor/run.sh +0 -4
- package/resources/js3d/project/version/craft_feature_version.json +0 -42
- package/resources/js3d/project/version/project_feature_version.json +0 -11
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts +0 -7
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts.map +0 -1
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js +0 -145
- package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js.map +0 -1
- /package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
- /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
- /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +0 -0
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 显示器适配:短边锁定 + 长边扩展,**方向无关**。
|
|
3
|
-
*
|
|
4
|
-
* 落盘位置:`${CRAFT_PROJECT_DIR}/src/display/viewport.ts`
|
|
5
|
-
* 本文件是纯函数模块:不引用 Phaser、不引用 runtime、不碰 DOM。渲染层、UI 层、
|
|
6
|
-
* 玩法层都从同一份解算结果取值,因此三者的坐标系必然一致。
|
|
7
|
-
*
|
|
8
|
-
* 核心规则:
|
|
9
|
-
* - 哪条轴是短边由**运行时实测**决定:`vw >= vh` 即横向,反之纵向;
|
|
10
|
-
* - 短边逻辑长度恒为 shortEdge(默认 1080);
|
|
11
|
-
* - 长边逻辑长度 = shortEdge × (viewport 长边 / viewport 短边),clamp 到
|
|
12
|
-
* [minLong, maxLong](默认 [1440, 2400])。
|
|
13
|
-
*
|
|
14
|
-
* 由此:
|
|
15
|
-
* - 支持的比例范围内,横竖方向的逻辑区域都铺满容器;
|
|
16
|
-
* - 只有比 4:3 更方、或比 20:9 更长的极端比例才触发 clamp 并留边;
|
|
17
|
-
* - 逻辑像素乘返回的 scale 得到 CSS 像素;控件可读性按实际显示结果检查。
|
|
18
|
-
*
|
|
19
|
-
* `#ui-stage` 的 `data-orientation` 可用于 CSS 重排;需要业务坐标更新时沿现有 resize 链处理。
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/** 可选覆盖项。绝大多数项目不需要传 —— 默认值就是规范值 */
|
|
23
|
-
export interface ViewportOptions {
|
|
24
|
-
/** 短边逻辑长度,默认 1080;不规定控件字号 */
|
|
25
|
-
shortEdge?: number;
|
|
26
|
-
/**
|
|
27
|
-
* 长边 clamp 范围 [min, max],单位为设计像素。
|
|
28
|
-
* 缺省时**按 shortEdge 派生**:`[shortEdge × 4/3, shortEdge × 20/9]`
|
|
29
|
-
* (默认 shortEdge 1080 → [1440, 2400]),即支持 4:3 ~ 20:9。
|
|
30
|
-
* 这样改 shortEdge 不会意外触发 clamp。显式传值则完全按传入的绝对像素。
|
|
31
|
-
*/
|
|
32
|
-
longEdgeClamp?: [number, number];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/** 运行时**实测**方向,不是配置声明 */
|
|
36
|
-
export type Orientation = 'landscape' | 'portrait';
|
|
37
|
-
|
|
38
|
-
/** 一次 resize 的解算结果,UI 层与相机层共用 */
|
|
39
|
-
export interface LogicalSize {
|
|
40
|
-
/** 逻辑宽(设计像素) */
|
|
41
|
-
logicW: number;
|
|
42
|
-
/** 逻辑高(设计像素) */
|
|
43
|
-
logicH: number;
|
|
44
|
-
/** 逻辑像素 → CSS 像素的缩放系数 */
|
|
45
|
-
scale: number;
|
|
46
|
-
/** 居中偏移(CSS 像素)。未触发 clamp 时恒为 0 */
|
|
47
|
-
offsetX: number;
|
|
48
|
-
offsetY: number;
|
|
49
|
-
/** 长边是否被 clamp。为 true 时才会出现留边 */
|
|
50
|
-
clamped: boolean;
|
|
51
|
-
/** 本次解算时 viewport 的实际方向 */
|
|
52
|
-
orientation: Orientation;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** 保守可见区(UI 逻辑坐标,居中),不作为世界或碰撞边界 */
|
|
56
|
-
export interface SafeFrame {
|
|
57
|
-
x: number;
|
|
58
|
-
y: number;
|
|
59
|
-
width: number;
|
|
60
|
-
height: number;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const DEFAULT_SHORT_EDGE = 1080;
|
|
64
|
-
/** 默认支持的长短边比例区间:4:3 ~ 20:9 */
|
|
65
|
-
const DEFAULT_MIN_RATIO = 4 / 3;
|
|
66
|
-
const DEFAULT_MAX_RATIO = 20 / 9;
|
|
67
|
-
|
|
68
|
-
function clamp(value: number, min: number, max: number): number {
|
|
69
|
-
return Math.min(max, Math.max(min, value));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function resolveParams(options?: ViewportOptions): {
|
|
73
|
-
shortEdge: number;
|
|
74
|
-
minLong: number;
|
|
75
|
-
maxLong: number;
|
|
76
|
-
} {
|
|
77
|
-
const rawShort = Number(options?.shortEdge);
|
|
78
|
-
const shortEdge = rawShort > 0 ? rawShort : DEFAULT_SHORT_EDGE;
|
|
79
|
-
// 缺省 clamp 按短边派生,保证换 shortEdge 时比例区间不变
|
|
80
|
-
const [rawMin, rawMax] = options?.longEdgeClamp ?? [
|
|
81
|
-
shortEdge * DEFAULT_MIN_RATIO,
|
|
82
|
-
shortEdge * DEFAULT_MAX_RATIO,
|
|
83
|
-
];
|
|
84
|
-
// 容错:配置写反或非法时退回派生默认,不让一处笔误把画面算崩
|
|
85
|
-
const minLong = rawMin > 0 ? Math.min(rawMin, rawMax) : shortEdge * DEFAULT_MIN_RATIO;
|
|
86
|
-
const maxLong = rawMax > 0 ? Math.max(rawMin, rawMax) : shortEdge * DEFAULT_MAX_RATIO;
|
|
87
|
-
return { shortEdge, minLong, maxLong };
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* 由 viewport 尺寸解算逻辑坐标系,运行时方向由入参实测得出。
|
|
92
|
-
*
|
|
93
|
-
* @param viewportW CSS 像素宽(用容器 clientWidth,不要用 window.innerWidth ——
|
|
94
|
-
* iOS Safari 地址栏收起会改变后者,且预览跑在 iframe 里时它是宿主尺寸)
|
|
95
|
-
* @param viewportH CSS 像素高
|
|
96
|
-
* @param options 可选覆盖;缺省即规范值
|
|
97
|
-
*/
|
|
98
|
-
export function computeLogicalSize(
|
|
99
|
-
viewportW: number,
|
|
100
|
-
viewportH: number,
|
|
101
|
-
options?: ViewportOptions,
|
|
102
|
-
): LogicalSize {
|
|
103
|
-
const { shortEdge, minLong, maxLong } = resolveParams(options);
|
|
104
|
-
|
|
105
|
-
// iframe 尚未布局时宽高为 0,退回横向基准比例,避免除零产生 NaN 污染整条链路
|
|
106
|
-
if (!(viewportW > 0) || !(viewportH > 0)) {
|
|
107
|
-
return {
|
|
108
|
-
logicW: minLong,
|
|
109
|
-
logicH: shortEdge,
|
|
110
|
-
scale: 1,
|
|
111
|
-
offsetX: 0,
|
|
112
|
-
offsetY: 0,
|
|
113
|
-
clamped: false,
|
|
114
|
-
orientation: 'landscape',
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// 方向来自实测。正方形(vw === vh)归为 landscape,避免边界抖动。
|
|
119
|
-
const landscape = viewportW >= viewportH;
|
|
120
|
-
const viewportShort = landscape ? viewportH : viewportW;
|
|
121
|
-
const viewportLong = landscape ? viewportW : viewportH;
|
|
122
|
-
|
|
123
|
-
const rawLong = shortEdge * (viewportLong / viewportShort);
|
|
124
|
-
const logicLong = clamp(rawLong, minLong, maxLong);
|
|
125
|
-
// 浮点比较用绝对误差:rawLong 来自除法,与 clamp 边界直接 !== 会误判
|
|
126
|
-
const clamped = Math.abs(logicLong - rawLong) > 1e-6;
|
|
127
|
-
|
|
128
|
-
const logicW = landscape ? logicLong : shortEdge;
|
|
129
|
-
const logicH = landscape ? shortEdge : logicLong;
|
|
130
|
-
|
|
131
|
-
// 未 clamp 时两轴比值相同,min 取到的就是短边比值,offset 自然为 0;
|
|
132
|
-
// clamp 后逻辑比例与 viewport 不符,min 保证内容不被裁切,多出部分成为留边。
|
|
133
|
-
const scale = Math.min(viewportW / logicW, viewportH / logicH);
|
|
134
|
-
const offsetX = (viewportW - logicW * scale) / 2;
|
|
135
|
-
const offsetY = (viewportH - logicH * scale) / 2;
|
|
136
|
-
|
|
137
|
-
return {
|
|
138
|
-
logicW,
|
|
139
|
-
logicH,
|
|
140
|
-
scale,
|
|
141
|
-
offsetX,
|
|
142
|
-
offsetY,
|
|
143
|
-
clamped,
|
|
144
|
-
orientation: landscape ? 'landscape' : 'portrait',
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 当前方向下必须完整可见的居中区域(逻辑坐标)。
|
|
150
|
-
*
|
|
151
|
-
* 短边方向恒等于 shortEdge(全高/全宽可见),长边方向取 clamp 下限 minLong ——
|
|
152
|
-
* 即最方的受支持比例。在当前方向下该区域完整落在画面内,因此:
|
|
153
|
-
* - 需要持续可见的屏幕内容可按此区域布局,或随方向重新布局;
|
|
154
|
-
* - 世界对象按相机取景保护当前玩法必需区域,不限制在此 UI 坐标框内。
|
|
155
|
-
*
|
|
156
|
-
* **注意 safe frame 随设备方向翻转**(横向 1440×1080 ↔ 纵向 1080×1440)。
|
|
157
|
-
* 跨方向的屏幕布局参考见 `getOmniSafeFrame()`。
|
|
158
|
-
*/
|
|
159
|
-
export function getSafeFrame(logical: LogicalSize, options?: ViewportOptions): SafeFrame {
|
|
160
|
-
const { shortEdge, minLong } = resolveParams(options);
|
|
161
|
-
const landscape = logical.orientation === 'landscape';
|
|
162
|
-
const width = landscape ? Math.min(minLong, logical.logicW) : shortEdge;
|
|
163
|
-
const height = landscape ? shortEdge : Math.min(minLong, logical.logicH);
|
|
164
|
-
return {
|
|
165
|
-
x: (logical.logicW - width) / 2,
|
|
166
|
-
y: (logical.logicH - height) / 2,
|
|
167
|
-
width,
|
|
168
|
-
height,
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* 横竖方向都保证可见的居中方形区域(逻辑坐标,边长 = shortEdge)。
|
|
174
|
-
*
|
|
175
|
-
* 用于需要跨方向持续可见的屏幕内容,例如暂停按钮与提示。
|
|
176
|
-
* 世界对象按实际相机投影与玩法取景处理,不以此框限制世界坐标。
|
|
177
|
-
*/
|
|
178
|
-
export function getOmniSafeFrame(logical: LogicalSize, options?: ViewportOptions): SafeFrame {
|
|
179
|
-
const { shortEdge } = resolveParams(options);
|
|
180
|
-
const side = Math.min(shortEdge, logical.logicW, logical.logicH);
|
|
181
|
-
return {
|
|
182
|
-
x: (logical.logicW - side) / 2,
|
|
183
|
-
y: (logical.logicH - side) / 2,
|
|
184
|
-
width: side,
|
|
185
|
-
height: side,
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* 有界世界的取景矩形(逻辑坐标)。世界**居中**放进逻辑区域,多出的空间向四周均匀延伸。
|
|
191
|
-
*
|
|
192
|
-
* 两条轴各自独立判断,一个表达式覆盖两种情形:
|
|
193
|
-
*
|
|
194
|
-
* | 情形 | 结果 | 表现 |
|
|
195
|
-
* |---|---|---|
|
|
196
|
-
* | 世界 **窄于** 该轴逻辑长度 | 起点取负、长度取逻辑长度 | 取景被钳在居中位,世界居中、两侧留白 |
|
|
197
|
-
* | 世界 **不窄于** 该轴逻辑长度 | 等价于 `(0, 0, worldW, worldH)` | 相机正常跟随滚动 |
|
|
198
|
-
*
|
|
199
|
-
* 因此单轴滚动的横版世界会自动得到「滚动轴滚动 + 另一轴居中留白」,不需要按品类分支。
|
|
200
|
-
*
|
|
201
|
-
* **两个硬约束:**
|
|
202
|
-
*
|
|
203
|
-
* 1. **不要把返回值当作物理 / 碰撞边界。** 物理边界必须保持世界原尺寸
|
|
204
|
-
* `(0, 0, worldW, worldH)`,否则角色能走进留白区。
|
|
205
|
-
* 取景矩形是「镜头能看到哪」,物理边界是「角色能走到哪」,改造后二者不再相等。
|
|
206
|
-
* 2. **必须在 resize 回调里重算并重设。** 逻辑区域是运行时值,转屏或改窗口后旧值立即失效
|
|
207
|
-
* (世界会重新贴边)。Phaser 侧写在 `this.scale.on(Phaser.Scale.Events.RESIZE)` 里,
|
|
208
|
-
* 和背景铺满用的是同一个回调:
|
|
209
|
-
*
|
|
210
|
-
* ```ts
|
|
211
|
-
* private applyCameraBounds(): void {
|
|
212
|
-
* // this.scale.width/height 就是逻辑区域尺寸(入口已 setGameSize),不要再算一遍
|
|
213
|
-
* const b = getCameraBounds(WORLD_W, WORLD_H, this.scale.width, this.scale.height);
|
|
214
|
-
* this.cameras.main.setBounds(b.x, b.y, b.width, b.height);
|
|
215
|
-
* }
|
|
216
|
-
* // create() 与 this.scale.on(Phaser.Scale.Events.RESIZE) 里各调一次
|
|
217
|
-
* ```
|
|
218
|
-
*
|
|
219
|
-
* 另外注意世界坐标会出现**负值区域**(屏幕左边缘可能对应世界 x < 0),
|
|
220
|
-
* 所以出界判定一律用世界坐标与世界尺寸比较,写 `x < 0` 会误判。
|
|
221
|
-
*
|
|
222
|
-
* @param worldW 玩法世界宽(设计像素常量);无界世界传世界包围盒或按需放大
|
|
223
|
-
* @param worldH 玩法世界高
|
|
224
|
-
* @param logicW 当前逻辑区域宽。Phaser 场景里**直接传 `this.scale.width`**
|
|
225
|
-
* @param logicH 当前逻辑区域高。同上,传 `this.scale.height`
|
|
226
|
-
*/
|
|
227
|
-
export interface CameraBounds {
|
|
228
|
-
/** 可能为负:世界窄于逻辑区域时,屏幕左/上边缘落在世界之外 */
|
|
229
|
-
x: number;
|
|
230
|
-
y: number;
|
|
231
|
-
width: number;
|
|
232
|
-
height: number;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
export function getCameraBounds(
|
|
236
|
-
worldW: number,
|
|
237
|
-
worldH: number,
|
|
238
|
-
logicW: number,
|
|
239
|
-
logicH: number,
|
|
240
|
-
): CameraBounds {
|
|
241
|
-
// -(0) 会得到 -0:数值上等价,但 Object.is(-0, 0) 为 false、JSON 往返也会变号,
|
|
242
|
-
// 对外暴露不干净。用 `|| 0` 把 ±0 一律归一到 +0。
|
|
243
|
-
return {
|
|
244
|
-
x: Math.min(0, -(logicW - worldW) / 2) || 0,
|
|
245
|
-
y: Math.min(0, -(logicH - worldH) / 2) || 0,
|
|
246
|
-
width: Math.max(worldW, logicW),
|
|
247
|
-
height: Math.max(worldH, logicH),
|
|
248
|
-
};
|
|
249
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import Phaser from 'phaser';
|
|
2
|
-
import { connectPreview } from './platform';
|
|
3
|
-
import { LoadScene } from './scenes/LoadScene';
|
|
4
|
-
import { PlayScene } from './scenes/PlayScene';
|
|
5
|
-
import './style.css';
|
|
6
|
-
import { initUiStage } from './display/ui-stage';
|
|
7
|
-
import { computeLogicalSize } from './display/viewport';
|
|
8
|
-
import type { LogicalSize } from './display/viewport';
|
|
9
|
-
|
|
10
|
-
const container = document.querySelector<HTMLDivElement>('#game')!;
|
|
11
|
-
const initial: LogicalSize = computeLogicalSize(container.clientWidth, container.clientHeight);
|
|
12
|
-
const ui = initUiStage(container);
|
|
13
|
-
|
|
14
|
-
const game = new Phaser.Game({
|
|
15
|
-
type: Phaser.AUTO,
|
|
16
|
-
parent: 'game',
|
|
17
|
-
banner: false,
|
|
18
|
-
scale: {
|
|
19
|
-
mode: Phaser.Scale.FIT,
|
|
20
|
-
autoCenter: Phaser.Scale.CENTER_BOTH,
|
|
21
|
-
width: initial.logicW,
|
|
22
|
-
height: initial.logicH,
|
|
23
|
-
},
|
|
24
|
-
render: {
|
|
25
|
-
preserveDrawingBuffer: true,
|
|
26
|
-
},
|
|
27
|
-
physics: {
|
|
28
|
-
default: 'arcade',
|
|
29
|
-
},
|
|
30
|
-
scene: [LoadScene],
|
|
31
|
-
callbacks: {
|
|
32
|
-
preBoot: (game) => {
|
|
33
|
-
game.scene.add('PlayScene', PlayScene, false);
|
|
34
|
-
},
|
|
35
|
-
postBoot: (booted) => {
|
|
36
|
-
const canvas = booted.canvas;
|
|
37
|
-
if (!canvas) throw new Error('Phaser 未创建画布');
|
|
38
|
-
const preview = connectPreview(canvas, { uiRoot: '#ui-root' });
|
|
39
|
-
let marked = false;
|
|
40
|
-
booted.registry.set('markPreviewReady', () => {
|
|
41
|
-
if (marked) return;
|
|
42
|
-
marked = true;
|
|
43
|
-
preview.markReady();
|
|
44
|
-
});
|
|
45
|
-
booted.events.on(Phaser.Core.Events.POST_RENDER, () => {
|
|
46
|
-
preview.afterRender();
|
|
47
|
-
});
|
|
48
|
-
(globalThis as unknown as { __qaWarp?: (target: string) => boolean }).__qaWarp = (target) => {
|
|
49
|
-
const want = String(target || '').toLowerCase();
|
|
50
|
-
if (want !== 'play' && want !== 'playscene' && want !== 'game') return false;
|
|
51
|
-
try { booted.scene.stop('LoadScene'); } catch { /* already stopped */ }
|
|
52
|
-
booted.scene.start('PlayScene');
|
|
53
|
-
const loading = document.getElementById('loading');
|
|
54
|
-
if (loading) {
|
|
55
|
-
loading.style.display = 'none';
|
|
56
|
-
loading.setAttribute('aria-hidden', 'true');
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
};
|
|
60
|
-
if (import.meta.hot) {
|
|
61
|
-
import.meta.hot.dispose(() => {
|
|
62
|
-
preview.dispose();
|
|
63
|
-
ui.dispose();
|
|
64
|
-
booted.destroy(true);
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
function applyViewSize(): void {
|
|
72
|
-
const vw = container.clientWidth;
|
|
73
|
-
const vh = container.clientHeight;
|
|
74
|
-
if (!(vw > 0) || !(vh > 0)) return;
|
|
75
|
-
const next = computeLogicalSize(vw, vh);
|
|
76
|
-
if (
|
|
77
|
-
Math.abs(game.scale.width - next.logicW) > 0.5 ||
|
|
78
|
-
Math.abs(game.scale.height - next.logicH) > 0.5
|
|
79
|
-
) {
|
|
80
|
-
game.scale.setGameSize(next.logicW, next.logicH);
|
|
81
|
-
}
|
|
82
|
-
ui.apply(vw, vh);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
new ResizeObserver(applyViewSize).observe(container);
|
|
86
|
-
applyViewSize();
|
|
87
|
-
game.scale.on(Phaser.Scale.Events.RESIZE, () => ui.applyFromContainer());
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { getUiStage } from './display/ui-stage';
|
|
2
|
-
|
|
3
|
-
function setRect(element: HTMLElement, rect: { x: number; y: number; width: number; height: number }): void {
|
|
4
|
-
Object.assign(element.style, { position: 'absolute', left: `${rect.x}px`, top: `${rect.y}px`, width: `${rect.width}px`, height: `${rect.height}px` });
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function createButton(doc: Document, options: { label: string; onClick: () => void; className?: string }) {
|
|
8
|
-
const element = doc.createElement('button');
|
|
9
|
-
element.type = 'button';
|
|
10
|
-
element.textContent = options.label;
|
|
11
|
-
element.className = options.className ?? '';
|
|
12
|
-
element.style.pointerEvents = 'auto';
|
|
13
|
-
element.addEventListener('click', options.onClick);
|
|
14
|
-
return { element, dispose() { element.removeEventListener('click', options.onClick); element.remove(); } };
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const NATIVE_HIT_STYLE_ID = 'screen-ui-native-hit';
|
|
18
|
-
const NATIVE_HIT_CSS = [
|
|
19
|
-
'#game button,#game input,#game select,#game textarea,#game a,#game [role="button"]{pointer-events:auto}',
|
|
20
|
-
'#game button{-webkit-appearance:none;appearance:none}',
|
|
21
|
-
':where(#game) button{border:2px solid var(--hud-btn-edge,rgba(214,181,106,.55));border-radius:var(--hud-btn-radius,10px);background:var(--hud-btn-fill,rgba(28,22,18,.88));color:var(--hud-btn-ink,#f3ead8);font:600 28px/1.2 var(--hud-font,system-ui,"Microsoft YaHei",sans-serif);text-shadow:0 2px 4px rgba(0,0,0,.7)}',
|
|
22
|
-
].join('');
|
|
23
|
-
|
|
24
|
-
function ensureNativeHitCss(doc: Document): void {
|
|
25
|
-
if (doc.getElementById(NATIVE_HIT_STYLE_ID)) return;
|
|
26
|
-
const style = document.createElement('style');
|
|
27
|
-
style.id = NATIVE_HIT_STYLE_ID;
|
|
28
|
-
style.textContent = NATIVE_HIT_CSS;
|
|
29
|
-
doc.head.appendChild(style);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type ScreenRect = { x: number; y: number; width: number; height: number };
|
|
33
|
-
|
|
34
|
-
export type ScreenPanel = {
|
|
35
|
-
root: HTMLDivElement;
|
|
36
|
-
setOpen: (open: boolean) => void;
|
|
37
|
-
isOpen: () => boolean;
|
|
38
|
-
dispose: () => void;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export type ScreenPanelOptions = {
|
|
42
|
-
rect?: ScreenRect;
|
|
43
|
-
scroll?: boolean;
|
|
44
|
-
scrim?: boolean;
|
|
45
|
-
close?: boolean;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export type ScreenUi = {
|
|
49
|
-
width: number;
|
|
50
|
-
height: number;
|
|
51
|
-
layer: (name: string) => HTMLDivElement;
|
|
52
|
-
button: (
|
|
53
|
-
host: string | HTMLElement,
|
|
54
|
-
options: { label: string; rect?: ScreenRect; onClick: () => void },
|
|
55
|
-
) => { element: HTMLButtonElement; dispose: () => void };
|
|
56
|
-
text: (host: string | HTMLElement, options: { text: string }) => HTMLDivElement;
|
|
57
|
-
panel: (options?: ScreenPanelOptions) => ScreenPanel;
|
|
58
|
-
dispose: () => void;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
function isPanelBody(node: HTMLElement): boolean {
|
|
62
|
-
return node.classList.contains('screen-panel-body');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function mountScreenUi(): ScreenUi {
|
|
66
|
-
const host = document.getElementById('game');
|
|
67
|
-
if (!host) throw new Error('#game 不存在');
|
|
68
|
-
ensureNativeHitCss(document);
|
|
69
|
-
const stage = getUiStage();
|
|
70
|
-
|
|
71
|
-
const resolveParent = (target: string | HTMLElement): HTMLDivElement =>
|
|
72
|
-
typeof target === 'string' ? stage.layer(target) : (target as HTMLDivElement);
|
|
73
|
-
|
|
74
|
-
const mountButton = (
|
|
75
|
-
parent: HTMLElement,
|
|
76
|
-
options: { label: string; rect?: ScreenRect; onClick: () => void; className?: string },
|
|
77
|
-
) => {
|
|
78
|
-
const btn = createButton(document, {
|
|
79
|
-
label: options.label,
|
|
80
|
-
onClick: options.onClick,
|
|
81
|
-
...(options.className ? { className: options.className } : {}),
|
|
82
|
-
});
|
|
83
|
-
parent.appendChild(btn.element);
|
|
84
|
-
if (options.rect && !isPanelBody(parent)) {
|
|
85
|
-
setRect(btn.element, options.rect);
|
|
86
|
-
}
|
|
87
|
-
return btn;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
return {
|
|
91
|
-
get width() {
|
|
92
|
-
return stage.logical.logicW;
|
|
93
|
-
},
|
|
94
|
-
get height() {
|
|
95
|
-
return stage.logical.logicH;
|
|
96
|
-
},
|
|
97
|
-
layer: (name) => stage.layer(name),
|
|
98
|
-
button(target, options) {
|
|
99
|
-
return mountButton(resolveParent(target), options);
|
|
100
|
-
},
|
|
101
|
-
text(target, options) {
|
|
102
|
-
const parent = resolveParent(target);
|
|
103
|
-
const el = document.createElement('div');
|
|
104
|
-
el.className = 'screen-text';
|
|
105
|
-
el.textContent = options.text;
|
|
106
|
-
parent.appendChild(el);
|
|
107
|
-
return el;
|
|
108
|
-
},
|
|
109
|
-
panel(options = {}) {
|
|
110
|
-
const useFixed = Boolean(options.rect);
|
|
111
|
-
const scrimOn = options.scrim !== false;
|
|
112
|
-
const closeOn = options.close === true;
|
|
113
|
-
|
|
114
|
-
const scrim = document.createElement('div');
|
|
115
|
-
scrim.className = 'screen-scrim screen-hidden';
|
|
116
|
-
scrim.style.pointerEvents = 'auto';
|
|
117
|
-
scrim.style.inset = '0';
|
|
118
|
-
if (scrimOn) stage.layer('scrim').appendChild(scrim);
|
|
119
|
-
|
|
120
|
-
const box = document.createElement('div');
|
|
121
|
-
box.className = 'screen-panel screen-hidden';
|
|
122
|
-
box.style.pointerEvents = 'auto';
|
|
123
|
-
if (useFixed && options.rect) {
|
|
124
|
-
setRect(box, options.rect);
|
|
125
|
-
box.style.transform = 'none';
|
|
126
|
-
}
|
|
127
|
-
stage.layer('modal').appendChild(box);
|
|
128
|
-
|
|
129
|
-
let open = false;
|
|
130
|
-
const setOpen = (next: boolean) => {
|
|
131
|
-
open = next;
|
|
132
|
-
if (scrimOn) scrim.classList.toggle('screen-hidden', !next);
|
|
133
|
-
box.classList.toggle('screen-hidden', !next);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
let closeBtn: { dispose: () => void } | undefined;
|
|
137
|
-
if (closeOn) {
|
|
138
|
-
const head = document.createElement('div');
|
|
139
|
-
head.className = 'screen-panel-head';
|
|
140
|
-
box.appendChild(head);
|
|
141
|
-
closeBtn = mountButton(head, {
|
|
142
|
-
label: '关闭',
|
|
143
|
-
className: 'screen-panel-close',
|
|
144
|
-
onClick: () => setOpen(false),
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const body = document.createElement('div');
|
|
149
|
-
body.className = 'screen-panel-body';
|
|
150
|
-
body.style.pointerEvents = 'auto';
|
|
151
|
-
if (options.scroll === false) body.style.overflow = 'hidden';
|
|
152
|
-
box.appendChild(body);
|
|
153
|
-
|
|
154
|
-
const onScrimClick = () => {
|
|
155
|
-
if (closeOn) setOpen(false);
|
|
156
|
-
};
|
|
157
|
-
const onKey = (event: KeyboardEvent) => {
|
|
158
|
-
if (!closeOn || event.key !== 'Escape' || !open) return;
|
|
159
|
-
event.preventDefault();
|
|
160
|
-
setOpen(false);
|
|
161
|
-
};
|
|
162
|
-
if (scrimOn) scrim.addEventListener('click', onScrimClick);
|
|
163
|
-
document.addEventListener('keydown', onKey);
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
root: body,
|
|
167
|
-
setOpen,
|
|
168
|
-
isOpen: () => open,
|
|
169
|
-
dispose: () => {
|
|
170
|
-
setOpen(false);
|
|
171
|
-
document.removeEventListener('keydown', onKey);
|
|
172
|
-
if (scrimOn) {
|
|
173
|
-
scrim.removeEventListener('click', onScrimClick);
|
|
174
|
-
scrim.remove();
|
|
175
|
-
}
|
|
176
|
-
closeBtn?.dispose();
|
|
177
|
-
box.remove();
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
},
|
|
181
|
-
dispose: () => {
|
|
182
|
-
/* 舞台由 main.ts 的 initUiStage 持有,Scene 关闭不清掉 #ui-root */
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
}
|