@auraindustry/aurajs 0.0.7 → 0.1.1
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 +98 -2
- package/benchmarks/perf-thresholds.json +54 -0
- package/package.json +4 -7
- package/src/asset-pack.mjs +8 -1
- package/src/authored-project.mjs +1449 -0
- package/src/authored-runtime.mjs +2016 -0
- package/src/authoring/avatar-animation-graph.mjs +648 -0
- package/src/bin-integrity.mjs +272 -0
- package/src/build-contract/assets.mjs +130 -0
- package/src/build-contract/capabilities.mjs +116 -0
- package/src/build-contract/constants.mjs +6 -0
- package/src/build-contract/helpers.mjs +44 -0
- package/src/build-contract/web-templates.mjs +5993 -0
- package/src/build-contract.mjs +27 -2910
- package/src/bundler.mjs +188 -55
- package/src/cli.mjs +4840 -1512
- package/src/commands/project-authoring.mjs +454 -0
- package/src/config.mjs +44 -0
- package/src/conformance/cases/app-and-ui-runtime-cases.mjs +3309 -0
- package/src/conformance/cases/core-runtime-cases.mjs +1431 -0
- package/src/conformance/cases/index.mjs +11 -0
- package/src/conformance/cases/scene3d-and-media-cases.mjs +2094 -0
- package/src/conformance/cases/systems-and-gameplay-cases.mjs +1776 -0
- package/src/conformance/shared.mjs +27 -0
- package/src/conformance-runner.mjs +25 -13
- package/src/conformance.mjs +619 -4020
- package/src/cutscene.mjs +362 -5
- package/src/dev-cli-action.mjs +249 -0
- package/src/dev-cli-inspect.mjs +92 -0
- package/src/dev-cli-state.mjs +80 -0
- package/src/external-asset-cache.mjs +587 -0
- package/src/external-asset-policy.mjs +217 -0
- package/src/external-package-surface.mjs +206 -0
- package/src/game-action-runtime.mjs +869 -0
- package/src/game-state-runtime.mjs +206 -6
- package/src/headless-action.mjs +186 -0
- package/src/headless-test/runtime-animation.mjs +1173 -0
- package/src/headless-test/runtime-coordinator.mjs +1514 -0
- package/src/headless-test/runtime-primitives.mjs +320 -0
- package/src/headless-test/runtime-world.mjs +2253 -0
- package/src/headless-test.mjs +392 -4298
- package/src/host-binary.mjs +342 -14
- package/src/icon-discovery.mjs +64 -0
- package/src/make-catalog.mjs +109 -0
- package/src/make.mjs +197 -0
- package/src/package-integrity.mjs +586 -0
- package/src/perf-benchmark.mjs +353 -0
- package/src/postinstall.mjs +5 -5
- package/src/prefabs/index.mjs +34 -0
- package/src/prefabs/scene-serialization.mjs +184 -0
- package/src/project-importer.mjs +620 -0
- package/src/project-registry.mjs +24 -0
- package/src/publish-command.mjs +195 -0
- package/src/publish-env-example.mjs +83 -0
- package/src/publish-validation.mjs +708 -0
- package/src/retro/assets/compile.mjs +232 -0
- package/src/retro/backend-gba/authoring.mjs +1029 -0
- package/src/retro/backend-gba/rom.mjs +363 -0
- package/src/retro/backend-gbc/rom.mjs +85 -0
- package/src/retro/build.mjs +278 -0
- package/src/retro/cli/commands.mjs +292 -0
- package/src/retro/cli/templates.mjs +84 -0
- package/src/retro/diagnostics/catalog.mjs +110 -0
- package/src/retro/diagnostics/emit.mjs +72 -0
- package/src/retro/emulator/case-overlay.mjs +64 -0
- package/src/retro/emulator/discovery.mjs +158 -0
- package/src/retro/emulator/macos-case-overlay.swift +220 -0
- package/src/retro/emulator/profiles.mjs +146 -0
- package/src/retro/emulator/runner.mjs +289 -0
- package/src/retro/frontend/load-project.mjs +98 -0
- package/src/retro/index.mjs +30 -0
- package/src/retro/ir/build-ir.mjs +108 -0
- package/src/retro/runtime-gba/contract.mjs +151 -0
- package/src/retro/runtime-gbc/contract.mjs +117 -0
- package/src/retro/shared/span.mjs +26 -0
- package/src/retro/shared/targets.mjs +64 -0
- package/src/retro/validator/check-project.mjs +114 -0
- package/src/runtime-hotspot-audit.mjs +707 -0
- package/src/scaffold/config.mjs +1000 -0
- package/src/scaffold/fs.mjs +56 -0
- package/src/scaffold/layout.mjs +318 -0
- package/src/scaffold/project-docs.mjs +439 -0
- package/src/scaffold.mjs +93 -596
- package/src/scene-composition/index.mjs +326 -0
- package/src/scene-composition/runtime.mjs +751 -0
- package/src/self-hosted-assets.mjs +604 -0
- package/src/session-client.mjs +750 -0
- package/src/session-native-launcher.mjs +74 -0
- package/src/session-protocol.mjs +75 -0
- package/src/session-runtime.mjs +321 -0
- package/src/session-server.mjs +360 -0
- package/src/shader-kits/index.mjs +773 -0
- package/src/starter-content-registry.mjs +292 -0
- package/src/state-artifacts.mjs +662 -24
- package/src/state-dev-reload.mjs +99 -2
- package/src/terminal-ui.mjs +245 -0
- package/src/web-conformance.mjs +219 -0
- package/templates/create/2d/config/gameplay/shooter.config.js +26 -0
- package/templates/create/2d/content/gameplay/waves.json +26 -0
- package/templates/create/2d/content/registries/.gitkeep +1 -0
- package/templates/create/2d/docs/design/.gitkeep +1 -0
- package/templates/create/2d/docs/design/loop.md +5 -0
- package/templates/create/2d/prefabs/enemies.prefab.js +90 -0
- package/templates/create/2d/prefabs/enemy-basic.prefab.js +18 -0
- package/templates/create/2d/prefabs/player.prefab.js +36 -0
- package/templates/create/2d/prefabs/projectiles.prefab.js +35 -0
- package/templates/create/2d/scenes/boot.scene.js +12 -0
- package/templates/create/2d/scenes/gameplay.scene.js +230 -0
- package/templates/create/2d/scenes/menu.scene.js +9 -0
- package/templates/create/2d/src/main.js +6 -185
- package/templates/create/2d/src/runtime/app.js +49 -0
- package/templates/create/2d/src/runtime/capabilities.js +35 -0
- package/templates/create/2d/ui/hud.screen.js +40 -0
- package/templates/create/2d/ui/pause.screen.js +149 -0
- package/templates/create/2d/ui/settings.screen.js +347 -0
- package/templates/create/2d/ui/title.screen.js +13 -0
- package/templates/create/2d-adventure/aura.config.json +28 -0
- package/templates/create/2d-adventure/config/gameplay/adventure.config.js +14 -0
- package/templates/create/2d-adventure/content/gameplay/world.js +46 -0
- package/templates/create/2d-adventure/content/registries/.gitkeep +1 -0
- package/templates/create/2d-adventure/docs/design/loop.md +5 -0
- package/templates/create/2d-adventure/prefabs/player.prefab.js +54 -0
- package/templates/create/2d-adventure/prefabs/relic.prefab.js +38 -0
- package/templates/create/2d-adventure/prefabs/world.prefab.js +125 -0
- package/templates/create/2d-adventure/scenes/gameplay.scene.js +256 -0
- package/templates/create/2d-adventure/src/runtime/capabilities.js +34 -0
- package/templates/create/2d-adventure/ui/hud.screen.js +60 -0
- package/templates/create/2d-survivor/config/gameplay/survivor.config.js +33 -0
- package/templates/create/2d-survivor/content/gameplay/spawn-zones.json +29 -0
- package/templates/create/2d-survivor/content/registries/.gitkeep +1 -0
- package/templates/create/2d-survivor/docs/design/.gitkeep +1 -0
- package/templates/create/2d-survivor/docs/design/loop.md +5 -0
- package/templates/create/2d-survivor/prefabs/enemies.prefab.js +178 -0
- package/templates/create/2d-survivor/prefabs/enemy-swarm.prefab.js +18 -0
- package/templates/create/2d-survivor/prefabs/player.prefab.js +42 -0
- package/templates/create/2d-survivor/prefabs/projectiles.prefab.js +56 -0
- package/templates/create/2d-survivor/scenes/boot.scene.js +12 -0
- package/templates/create/2d-survivor/scenes/gameplay.scene.js +314 -0
- package/templates/create/2d-survivor/scenes/menu.scene.js +9 -0
- package/templates/create/2d-survivor/src/main.js +5 -332
- package/templates/create/2d-survivor/src/runtime/app.js +49 -0
- package/templates/create/2d-survivor/src/runtime/capabilities.js +35 -0
- package/templates/create/2d-survivor/ui/hud.screen.js +45 -0
- package/templates/create/2d-survivor/ui/title.screen.js +13 -0
- package/templates/create/3d/assets/models/starter-avatar.gltf +184 -0
- package/templates/create/3d/config/gameplay/.gitkeep +1 -0
- package/templates/create/3d/content/gameplay/checkpoints.json +33 -0
- package/templates/create/3d/content/gameplay/course.js +40 -0
- package/templates/create/3d/content/registries/.gitkeep +1 -0
- package/templates/create/3d/docs/design/.gitkeep +1 -0
- package/templates/create/3d/docs/design/loop.md +5 -0
- package/templates/create/3d/prefabs/checkpoint.prefab.js +15 -0
- package/templates/create/3d/prefabs/player.prefab.js +204 -0
- package/templates/create/3d/prefabs/world.prefab.js +112 -0
- package/templates/create/3d/scenes/boot.scene.js +12 -0
- package/templates/create/3d/scenes/checkpoint.scene.js +9 -0
- package/templates/create/3d/scenes/gameplay.scene.js +292 -0
- package/templates/create/3d/src/main.js +6 -295
- package/templates/create/3d/src/runtime/app.js +49 -0
- package/templates/create/3d/src/runtime/capabilities.js +53 -0
- package/templates/create/3d/src/runtime/materials.js +34 -0
- package/templates/create/3d/src/runtime/state.js +39 -0
- package/templates/create/3d/ui/hud.screen.js +75 -0
- package/templates/create/3d/ui/pause.screen.js +166 -0
- package/templates/create/3d/ui/settings.screen.js +387 -0
- package/templates/create/3d-adventure/assets/models/starter-avatar.gltf +184 -0
- package/templates/create/3d-adventure/aura.config.json +28 -0
- package/templates/create/3d-adventure/config/gameplay/adventure.config.js +9 -0
- package/templates/create/3d-adventure/content/gameplay/course.js +62 -0
- package/templates/create/3d-adventure/content/registries/.gitkeep +1 -0
- package/templates/create/3d-adventure/docs/design/loop.md +5 -0
- package/templates/create/3d-adventure/prefabs/player.prefab.js +168 -0
- package/templates/create/3d-adventure/prefabs/relic.prefab.js +35 -0
- package/templates/create/3d-adventure/prefabs/world.prefab.js +119 -0
- package/templates/create/3d-adventure/scenes/gameplay.scene.js +358 -0
- package/templates/create/3d-adventure/src/runtime/capabilities.js +56 -0
- package/templates/create/3d-adventure/src/runtime/materials.js +39 -0
- package/templates/create/3d-adventure/src/runtime/state.js +31 -0
- package/templates/create/3d-adventure/ui/hud.screen.js +70 -0
- package/templates/create/3d-adventure/ui/pause.screen.js +437 -0
- package/templates/create/3d-collectathon/assets/models/starter-avatar.gltf +184 -0
- package/templates/create/3d-collectathon/config/gameplay/.gitkeep +1 -0
- package/templates/create/3d-collectathon/content/gameplay/collectibles.json +26 -0
- package/templates/create/3d-collectathon/content/gameplay/course.js +46 -0
- package/templates/create/3d-collectathon/content/registries/.gitkeep +1 -0
- package/templates/create/3d-collectathon/docs/design/.gitkeep +1 -0
- package/templates/create/3d-collectathon/docs/design/loop.md +5 -0
- package/templates/create/3d-collectathon/prefabs/collectible.prefab.js +15 -0
- package/templates/create/3d-collectathon/prefabs/player.prefab.js +207 -0
- package/templates/create/3d-collectathon/prefabs/world.prefab.js +112 -0
- package/templates/create/3d-collectathon/scenes/boot.scene.js +12 -0
- package/templates/create/3d-collectathon/scenes/checkpoint.scene.js +9 -0
- package/templates/create/3d-collectathon/scenes/gameplay.scene.js +200 -0
- package/templates/create/3d-collectathon/src/main.js +5 -355
- package/templates/create/3d-collectathon/src/runtime/app.js +49 -0
- package/templates/create/3d-collectathon/src/runtime/capabilities.js +53 -0
- package/templates/create/3d-collectathon/src/runtime/materials.js +34 -0
- package/templates/create/3d-collectathon/src/runtime/state.js +27 -0
- package/templates/create/3d-collectathon/ui/hud.screen.js +66 -0
- package/templates/create/3d-collectathon/ui/pause.screen.js +13 -0
- package/templates/create/blank/config/gameplay/.gitkeep +1 -0
- package/templates/create/blank/content/gameplay/.gitkeep +1 -0
- package/templates/create/blank/content/registries/.gitkeep +1 -0
- package/templates/create/blank/docs/design/.gitkeep +1 -0
- package/templates/create/blank/docs/design/loop.md +5 -0
- package/templates/create/blank/prefabs/.gitkeep +1 -0
- package/templates/create/blank/scenes/.gitkeep +1 -0
- package/templates/create/blank/src/runtime/.gitkeep +1 -0
- package/templates/create/blank/ui/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/assets/audio/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/assets/fonts/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/assets/sprites/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/assets/starter/README.md +11 -0
- package/templates/create/deckbuilder-2d/assets/ui/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/aura.config.json +28 -0
- package/templates/create/deckbuilder-2d/config/gameplay/deckbuilder.config.js +26 -0
- package/templates/create/deckbuilder-2d/content/cards/guard.card.js +19 -0
- package/templates/create/deckbuilder-2d/content/cards/spark.card.js +20 -0
- package/templates/create/deckbuilder-2d/content/cards/starter.deck.js +69 -0
- package/templates/create/deckbuilder-2d/content/cards/strike.card.js +19 -0
- package/templates/create/deckbuilder-2d/content/cards/survey.card.js +20 -0
- package/templates/create/deckbuilder-2d/content/encounters/training-battle.encounter.js +14 -0
- package/templates/create/deckbuilder-2d/content/encounters/training-battle.js +65 -0
- package/templates/create/deckbuilder-2d/content/enemies/training-automaton.enemy.js +48 -0
- package/templates/create/deckbuilder-2d/content/gameplay/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/content/registries/cards.registry.js +26 -0
- package/templates/create/deckbuilder-2d/content/registries/encounters.registry.js +20 -0
- package/templates/create/deckbuilder-2d/content/registries/enemies.registry.js +20 -0
- package/templates/create/deckbuilder-2d/content/registries/relics.registry.js +20 -0
- package/templates/create/deckbuilder-2d/content/relics/ember-charm.relic.js +18 -0
- package/templates/create/deckbuilder-2d/docs/design/loop.md +12 -0
- package/templates/create/deckbuilder-2d/prefabs/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/scenes/boot.scene.js +84 -0
- package/templates/create/deckbuilder-2d/scenes/gameplay.scene.js +641 -0
- package/templates/create/deckbuilder-2d/src/components/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/src/main.js +17 -0
- package/templates/create/deckbuilder-2d/src/runtime/capabilities.js +22 -0
- package/templates/create/deckbuilder-2d/src/shared/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/src/systems/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/tests/smoke/.gitkeep +1 -0
- package/templates/create/deckbuilder-2d/ui/hud.screen.js +80 -0
- package/templates/create/deckbuilder-2d/ui/pause.screen.js +146 -0
- package/templates/create/deckbuilder-2d/ui/settings.screen.js +342 -0
- package/templates/create/local-multiplayer/aura.config.json +41 -0
- package/templates/create/local-multiplayer/config/gameplay/local-multiplayer.config.js +26 -0
- package/templates/create/local-multiplayer/content/gameplay/room-layout.js +13 -0
- package/templates/create/local-multiplayer/content/registries/.gitkeep +1 -0
- package/templates/create/local-multiplayer/docs/design/loop.md +16 -0
- package/templates/create/local-multiplayer/prefabs/player.prefab.js +99 -0
- package/templates/create/local-multiplayer/scenes/boot.scene.js +12 -0
- package/templates/create/local-multiplayer/scenes/gameplay.scene.js +472 -0
- package/templates/create/local-multiplayer/src/main.js +17 -0
- package/templates/create/local-multiplayer/src/runtime/capabilities.js +28 -0
- package/templates/create/local-multiplayer/ui/hud.screen.js +65 -0
- package/templates/create/shared/src/runtime/project-inspector.js +105 -0
- package/templates/create/shared/src/runtime/scene-flow.js +290 -0
- package/templates/create/shared/src/runtime/screen-shell.js +222 -0
- package/templates/create/shared/src/runtime/ui-forms.js +209 -0
- package/templates/create/shared/src/runtime/ui-settings.js +237 -0
- package/templates/create/shared/src/runtime/ui-theme.js +352 -0
- package/templates/create/shared/src/starter-utils/adventure-objectives.js +102 -0
- package/templates/create/shared/src/starter-utils/animation-2d.js +337 -0
- package/templates/create/shared/src/starter-utils/avatar-3d.js +404 -0
- package/templates/create/shared/src/starter-utils/combat-feedback-2d.js +320 -0
- package/templates/create/shared/src/starter-utils/core.js +39 -3
- package/templates/create/shared/src/starter-utils/index.js +8 -2
- package/templates/create/shared/src/starter-utils/platformer-3d.js +34 -3
- package/templates/create/shared/src/starter-utils/triggers.js +662 -0
- package/templates/create/shared/src/starter-utils/tween-2d.js +615 -0
- package/templates/create/video-cutscene/assets/video/.gitkeep +0 -0
- package/templates/create/video-cutscene/aura.config.json +28 -0
- package/templates/create/video-cutscene/config/gameplay/.gitkeep +0 -0
- package/templates/create/video-cutscene/content/gameplay/.gitkeep +0 -0
- package/templates/create/video-cutscene/content/registries/.gitkeep +0 -0
- package/templates/create/video-cutscene/docs/design/loop.md +22 -0
- package/templates/create/video-cutscene/prefabs/.gitkeep +0 -0
- package/templates/create/video-cutscene/scenes/boot.scene.js +11 -0
- package/templates/create/video-cutscene/scenes/cutscene.scene.js +113 -0
- package/templates/create/video-cutscene/scenes/gameplay.scene.js +50 -0
- package/templates/create/video-cutscene/src/main.js +17 -0
- package/templates/create/video-cutscene/src/runtime/app.js +52 -0
- package/templates/create/video-cutscene/src/runtime/capabilities.js +35 -0
- package/templates/create/video-cutscene/src/runtime/state.js +13 -0
- package/templates/create/video-cutscene/ui/.gitkeep +0 -0
- package/templates/create-bin/play.js +1192 -0
- package/templates/make/README.md +46 -0
- package/templates/make/catalog.json +51 -0
- package/templates/make/component/files/{{MAKE_NAME}}.component.js +20 -0
- package/templates/make/component/manifest.json +9 -0
- package/templates/make/data/files/{{MAKE_NAME}}.json +14 -0
- package/templates/make/data/manifest.json +9 -0
- package/templates/make/material/files/{{MAKE_NAME}}.material.json +17 -0
- package/templates/make/material/manifest.json +9 -0
- package/templates/make/prefab/files/{{MAKE_NAME}}.prefab.js +20 -0
- package/templates/make/prefab/manifest.json +9 -0
- package/templates/make/scene/files/{{MAKE_NAME}}.scene.js +31 -0
- package/templates/make/scene/manifest.json +9 -0
- package/templates/make/shader/files/{{MAKE_NAME}}.shader.js +23 -0
- package/templates/make/shader/manifest.json +9 -0
- package/templates/make/system/files/{{MAKE_NAME}}.system.js +15 -0
- package/templates/make/system/manifest.json +9 -0
- package/templates/make/ui-screen/files/{{MAKE_NAME}}.screen.js +16 -0
- package/templates/make/ui-screen/files/{{MAKE_NAME}}.screen.json +23 -0
- package/templates/make/ui-screen/manifest.json +10 -0
- package/templates/make-starters/deckbuilder-2d/card/files/{{MAKE_NAME}}.card.js +22 -0
- package/templates/make-starters/deckbuilder-2d/card/manifest.json +9 -0
- package/templates/make-starters/deckbuilder-2d/catalog.json +34 -0
- package/templates/make-starters/deckbuilder-2d/encounter/files/{{MAKE_NAME}}.encounter.js +18 -0
- package/templates/make-starters/deckbuilder-2d/encounter/manifest.json +9 -0
- package/templates/make-starters/deckbuilder-2d/enemy/files/{{MAKE_NAME}}.enemy.js +28 -0
- package/templates/make-starters/deckbuilder-2d/enemy/manifest.json +9 -0
- package/templates/make-starters/deckbuilder-2d/relic/files/{{MAKE_NAME}}.relic.js +23 -0
- package/templates/make-starters/deckbuilder-2d/relic/manifest.json +9 -0
- package/templates/retro/platformer/README.md +10 -0
- package/templates/retro/platformer/assets/retro/assets.json +91 -0
- package/templates/retro/platformer/aura.config.json +7 -0
- package/templates/retro/platformer/package.json +5 -0
- package/templates/retro/platformer/src/main.js +40 -0
- package/templates/retro/puzzle-grid/README.md +10 -0
- package/templates/retro/puzzle-grid/assets/retro/assets.json +90 -0
- package/templates/retro/puzzle-grid/aura.config.json +7 -0
- package/templates/retro/puzzle-grid/package.json +5 -0
- package/templates/retro/puzzle-grid/src/main.js +29 -0
- package/templates/retro/tactics-grid/README.md +10 -0
- package/templates/retro/tactics-grid/assets/retro/assets.json +90 -0
- package/templates/retro/tactics-grid/aura.config.json +7 -0
- package/templates/retro/tactics-grid/package.json +5 -0
- package/templates/retro/tactics-grid/src/main.js +35 -0
- package/templates/retro/topdown-adventure/README.md +10 -0
- package/templates/retro/topdown-adventure/assets/retro/assets.json +95 -0
- package/templates/retro/topdown-adventure/aura.config.json +7 -0
- package/templates/retro/topdown-adventure/package.json +5 -0
- package/templates/retro/topdown-adventure/src/main.js +29 -0
- package/templates/skills/aurajs/SKILL.md +61 -5
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ensureUiPreferences,
|
|
3
|
+
inspectUiTheme,
|
|
4
|
+
resetUiPreferences,
|
|
5
|
+
updateUiPreferences,
|
|
6
|
+
} from '../src/runtime/ui-theme.js';
|
|
7
|
+
import {
|
|
8
|
+
formatPercentFromTenth,
|
|
9
|
+
listContrastSegmentOptions,
|
|
10
|
+
listDensitySegmentOptions,
|
|
11
|
+
listThemeSegmentOptions,
|
|
12
|
+
readBooleanViewValue,
|
|
13
|
+
readNumberViewValue,
|
|
14
|
+
renderActionStrip,
|
|
15
|
+
renderSegmentedControl,
|
|
16
|
+
} from '../src/runtime/ui-settings.js';
|
|
17
|
+
|
|
18
|
+
const settingsScreen = {
|
|
19
|
+
id: 'settings',
|
|
20
|
+
kind: 'ui-screen',
|
|
21
|
+
role: 'modal',
|
|
22
|
+
draw: drawSettingsScreen,
|
|
23
|
+
notes: [
|
|
24
|
+
'Stage 154 productizes the retained settings flow as a screenShell modal.',
|
|
25
|
+
'Canonical preferences live in appState.ui.preferences while this screen only renders and edits them.',
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
function sizeOfWindow() {
|
|
30
|
+
return aura.window?.getSize?.() || { width: 1360, height: 820 };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function ensureSettingsView(context, appState) {
|
|
34
|
+
if (typeof context.ensureUiState === 'function') {
|
|
35
|
+
return context.ensureUiState('settingsView', {
|
|
36
|
+
activeSection: 'audio',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (!appState.ui || typeof appState.ui !== 'object' || Array.isArray(appState.ui)) {
|
|
40
|
+
appState.ui = {};
|
|
41
|
+
}
|
|
42
|
+
if (!appState.ui.settingsView || typeof appState.ui.settingsView !== 'object' || Array.isArray(appState.ui.settingsView)) {
|
|
43
|
+
appState.ui.settingsView = {
|
|
44
|
+
activeSection: 'audio',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return appState.ui.settingsView;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function ensurePlatformerUiState(context, appState) {
|
|
51
|
+
if (typeof context.ensureUiState === 'function') {
|
|
52
|
+
return context.ensureUiState('platformerHud', {
|
|
53
|
+
showControlsHint: true,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (!appState.ui || typeof appState.ui !== 'object' || Array.isArray(appState.ui)) {
|
|
57
|
+
appState.ui = {};
|
|
58
|
+
}
|
|
59
|
+
if (!appState.ui.platformerHud || typeof appState.ui.platformerHud !== 'object' || Array.isArray(appState.ui.platformerHud)) {
|
|
60
|
+
appState.ui.platformerHud = {
|
|
61
|
+
showControlsHint: true,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return appState.ui.platformerHud;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function currentPreferences(context, appState) {
|
|
68
|
+
if (typeof context.getUiPreferences === 'function') {
|
|
69
|
+
return context.getUiPreferences();
|
|
70
|
+
}
|
|
71
|
+
return ensureUiPreferences(appState);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function currentThemeState(context, appState) {
|
|
75
|
+
if (typeof context.getUiThemeState === 'function') {
|
|
76
|
+
return context.getUiThemeState();
|
|
77
|
+
}
|
|
78
|
+
return inspectUiTheme(appState);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function updatePreferences(context, appState, patch) {
|
|
82
|
+
if (typeof context.updateUiPreferences === 'function') {
|
|
83
|
+
return context.updateUiPreferences(patch);
|
|
84
|
+
}
|
|
85
|
+
return updateUiPreferences(appState, patch);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function resetPreferences(context, appState) {
|
|
89
|
+
if (typeof context.resetUiPreferences === 'function') {
|
|
90
|
+
return context.resetUiPreferences();
|
|
91
|
+
}
|
|
92
|
+
return resetUiPreferences(appState);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function themeSummaryLines(themeState) {
|
|
96
|
+
return [
|
|
97
|
+
`Preset ${themeState?.presetLabel || 'Signal Dawn'}`,
|
|
98
|
+
`Density ${themeState?.density === 'compact' ? 'Compact' : 'Cozy'}`,
|
|
99
|
+
`Contrast ${themeState?.contrast === 'high' ? 'High' : 'Standard'}`,
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function clickedSegmentOption(controlId, optionId) {
|
|
104
|
+
const state = aura.ui.getViewState(`${controlId}-${optionId}`);
|
|
105
|
+
return state?.clicked === true || state?.activated === true;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function renderAudioSection(preferences) {
|
|
109
|
+
aura.ui.beginColumn({
|
|
110
|
+
id: 'platformer-settings-audio',
|
|
111
|
+
gap: 12,
|
|
112
|
+
width: 'fill',
|
|
113
|
+
padding: 14,
|
|
114
|
+
background: '#0d1826',
|
|
115
|
+
borderColor: '#21384d',
|
|
116
|
+
});
|
|
117
|
+
aura.ui.text('platformer-settings-audio-label', {
|
|
118
|
+
text: 'AUDIO',
|
|
119
|
+
size: 11,
|
|
120
|
+
color: '#7fb7ea',
|
|
121
|
+
});
|
|
122
|
+
aura.ui.toggle('platformer-settings-music', {
|
|
123
|
+
label: 'Music playback',
|
|
124
|
+
value: preferences.musicEnabled === true,
|
|
125
|
+
width: 'fill',
|
|
126
|
+
});
|
|
127
|
+
aura.ui.slider('platformer-settings-volume', {
|
|
128
|
+
label: `Master volume ${formatPercentFromTenth(preferences.masterVolume)}`,
|
|
129
|
+
min: 0,
|
|
130
|
+
max: 10,
|
|
131
|
+
step: 1,
|
|
132
|
+
value: preferences.masterVolume,
|
|
133
|
+
width: 'fill',
|
|
134
|
+
});
|
|
135
|
+
aura.ui.text('platformer-settings-audio-note', {
|
|
136
|
+
text: 'The starter treats these values as the canonical shared pause/settings audio seam.',
|
|
137
|
+
size: 12,
|
|
138
|
+
color: '#9db2cb',
|
|
139
|
+
});
|
|
140
|
+
aura.ui.endColumn();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function renderDisplaySection(preferences) {
|
|
144
|
+
aura.ui.beginColumn({
|
|
145
|
+
id: 'platformer-settings-display',
|
|
146
|
+
gap: 12,
|
|
147
|
+
width: 'fill',
|
|
148
|
+
padding: 14,
|
|
149
|
+
background: '#0d1826',
|
|
150
|
+
borderColor: '#21384d',
|
|
151
|
+
});
|
|
152
|
+
aura.ui.text('platformer-settings-display-label', {
|
|
153
|
+
text: 'DISPLAY',
|
|
154
|
+
size: 11,
|
|
155
|
+
color: '#7fb7ea',
|
|
156
|
+
});
|
|
157
|
+
renderSegmentedControl({
|
|
158
|
+
id: 'platformer-settings-theme',
|
|
159
|
+
label: 'Theme preset',
|
|
160
|
+
description: 'Starter-owned semantic presets from src/runtime/ui-theme.js.',
|
|
161
|
+
value: preferences.themeId,
|
|
162
|
+
options: listThemeSegmentOptions(),
|
|
163
|
+
});
|
|
164
|
+
renderSegmentedControl({
|
|
165
|
+
id: 'platformer-settings-density',
|
|
166
|
+
label: 'Density',
|
|
167
|
+
value: preferences.density,
|
|
168
|
+
options: listDensitySegmentOptions(),
|
|
169
|
+
});
|
|
170
|
+
renderSegmentedControl({
|
|
171
|
+
id: 'platformer-settings-contrast',
|
|
172
|
+
label: 'Contrast',
|
|
173
|
+
value: preferences.contrast,
|
|
174
|
+
options: listContrastSegmentOptions(),
|
|
175
|
+
});
|
|
176
|
+
aura.ui.endColumn();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function renderInterfaceSection(preferences, platformerUiState) {
|
|
180
|
+
aura.ui.beginColumn({
|
|
181
|
+
id: 'platformer-settings-interface',
|
|
182
|
+
gap: 12,
|
|
183
|
+
width: 'fill',
|
|
184
|
+
padding: 14,
|
|
185
|
+
background: '#0d1826',
|
|
186
|
+
borderColor: '#21384d',
|
|
187
|
+
});
|
|
188
|
+
aura.ui.text('platformer-settings-interface-label', {
|
|
189
|
+
text: 'INTERFACE',
|
|
190
|
+
size: 11,
|
|
191
|
+
color: '#7fb7ea',
|
|
192
|
+
});
|
|
193
|
+
aura.ui.toggle('platformer-settings-subtitles', {
|
|
194
|
+
label: 'Subtitles',
|
|
195
|
+
value: preferences.subtitlesEnabled === true,
|
|
196
|
+
width: 'fill',
|
|
197
|
+
});
|
|
198
|
+
aura.ui.toggle('platformer-settings-reduce-motion', {
|
|
199
|
+
label: 'Reduce motion',
|
|
200
|
+
value: preferences.reduceMotion === true,
|
|
201
|
+
width: 'fill',
|
|
202
|
+
});
|
|
203
|
+
aura.ui.toggle('platformer-settings-controls-hint', {
|
|
204
|
+
label: 'Show controls hint on restart',
|
|
205
|
+
value: platformerUiState.showControlsHint !== false,
|
|
206
|
+
width: 'fill',
|
|
207
|
+
});
|
|
208
|
+
aura.ui.endColumn();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function createSettingsScreen() {
|
|
212
|
+
return settingsScreen;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export function drawSettingsScreen(_data = {}, context = {}) {
|
|
216
|
+
const appState = context.appState || {};
|
|
217
|
+
const settingsView = ensureSettingsView(context, appState);
|
|
218
|
+
const platformerUiState = ensurePlatformerUiState(context, appState);
|
|
219
|
+
const preferences = currentPreferences(context, appState);
|
|
220
|
+
const themeState = currentThemeState(context, appState);
|
|
221
|
+
const size = sizeOfWindow();
|
|
222
|
+
const panelWidth = Math.min(980, size.width - 72);
|
|
223
|
+
const panelHeight = Math.min(640, size.height - 88);
|
|
224
|
+
const panelX = Math.floor((size.width - panelWidth) * 0.5);
|
|
225
|
+
const panelY = Math.floor((size.height - panelHeight) * 0.5);
|
|
226
|
+
const themeLines = themeSummaryLines(themeState);
|
|
227
|
+
|
|
228
|
+
aura.draw2d.rect(0, 0, size.width, size.height, aura.rgba(0.02, 0.03, 0.06, 0.82));
|
|
229
|
+
|
|
230
|
+
aura.ui.beginView({
|
|
231
|
+
id: 'platformer-settings-root',
|
|
232
|
+
x: panelX,
|
|
233
|
+
y: panelY,
|
|
234
|
+
width: panelWidth,
|
|
235
|
+
height: panelHeight,
|
|
236
|
+
gap: 14,
|
|
237
|
+
padding: 18,
|
|
238
|
+
clip: true,
|
|
239
|
+
background: '#08111b',
|
|
240
|
+
borderColor: '#32506c',
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
aura.ui.text('platformer-settings-eyebrow', {
|
|
244
|
+
text: 'SETTINGS',
|
|
245
|
+
size: 12,
|
|
246
|
+
color: '#86c1f5',
|
|
247
|
+
});
|
|
248
|
+
aura.ui.text('platformer-settings-title', {
|
|
249
|
+
text: 'Retained UI preferences',
|
|
250
|
+
size: 28,
|
|
251
|
+
color: '#f4f8ff',
|
|
252
|
+
});
|
|
253
|
+
aura.ui.text('platformer-settings-copy', {
|
|
254
|
+
text: 'These controls write into appState.ui.preferences and the active theme is applied through src/runtime/ui-theme.js.',
|
|
255
|
+
size: 14,
|
|
256
|
+
color: '#c9d9ea',
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
aura.ui.beginRow({
|
|
260
|
+
id: 'platformer-settings-shell',
|
|
261
|
+
gap: 16,
|
|
262
|
+
width: 'fill',
|
|
263
|
+
height: 'fill',
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
aura.ui.beginColumn({
|
|
267
|
+
id: 'platformer-settings-summary',
|
|
268
|
+
width: 250,
|
|
269
|
+
gap: 10,
|
|
270
|
+
padding: 14,
|
|
271
|
+
background: '#0d1826',
|
|
272
|
+
borderColor: '#21384d',
|
|
273
|
+
});
|
|
274
|
+
aura.ui.text('platformer-settings-summary-label', {
|
|
275
|
+
text: 'LIVE SNAPSHOT',
|
|
276
|
+
size: 11,
|
|
277
|
+
color: '#7fb7ea',
|
|
278
|
+
});
|
|
279
|
+
for (let index = 0; index < themeLines.length; index += 1) {
|
|
280
|
+
aura.ui.text(`platformer-settings-summary-${index}`, {
|
|
281
|
+
text: themeLines[index],
|
|
282
|
+
size: 15,
|
|
283
|
+
color: '#eef5ff',
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
aura.ui.text('platformer-settings-summary-audio', {
|
|
287
|
+
text: `Music ${preferences.musicEnabled ? 'On' : 'Off'} · Volume ${formatPercentFromTenth(preferences.masterVolume)}`,
|
|
288
|
+
size: 14,
|
|
289
|
+
color: '#d1dfef',
|
|
290
|
+
});
|
|
291
|
+
aura.ui.text('platformer-settings-summary-interface', {
|
|
292
|
+
text: `Hints ${platformerUiState.showControlsHint !== false ? 'Shown' : 'Hidden'} · Subtitles ${preferences.subtitlesEnabled ? 'On' : 'Off'}`,
|
|
293
|
+
size: 14,
|
|
294
|
+
color: '#d1dfef',
|
|
295
|
+
});
|
|
296
|
+
aura.ui.text('platformer-settings-summary-note', {
|
|
297
|
+
text: 'The selected section state lives in appState.ui.settingsView while widget focus remains runtime-owned inside aura.ui.',
|
|
298
|
+
size: 12,
|
|
299
|
+
color: '#9db2cb',
|
|
300
|
+
});
|
|
301
|
+
aura.ui.endColumn();
|
|
302
|
+
|
|
303
|
+
aura.ui.beginColumn({
|
|
304
|
+
id: 'platformer-settings-main',
|
|
305
|
+
width: 'fill',
|
|
306
|
+
gap: 12,
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
const sectionTabs = renderSegmentedControl({
|
|
310
|
+
id: 'platformer-settings-sections',
|
|
311
|
+
label: 'Section',
|
|
312
|
+
value: settingsView.activeSection || 'audio',
|
|
313
|
+
options: [
|
|
314
|
+
{ id: 'audio', label: 'Audio' },
|
|
315
|
+
{ id: 'display', label: 'Display' },
|
|
316
|
+
{ id: 'interface', label: 'Interface' },
|
|
317
|
+
],
|
|
318
|
+
});
|
|
319
|
+
if (sectionTabs.changed) {
|
|
320
|
+
settingsView.activeSection = sectionTabs.value;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if ((settingsView.activeSection || 'audio') === 'audio') {
|
|
324
|
+
renderAudioSection(preferences);
|
|
325
|
+
} else if (settingsView.activeSection === 'display') {
|
|
326
|
+
renderDisplaySection(preferences);
|
|
327
|
+
} else {
|
|
328
|
+
renderInterfaceSection(preferences, platformerUiState);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
const actions = renderActionStrip({
|
|
332
|
+
id: 'platformer-settings-actions',
|
|
333
|
+
actions: [
|
|
334
|
+
{ id: 'restore', label: 'Restore Defaults' },
|
|
335
|
+
{ id: 'back', label: 'Back' },
|
|
336
|
+
],
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
aura.ui.endColumn();
|
|
340
|
+
aura.ui.endRow();
|
|
341
|
+
aura.ui.endView();
|
|
342
|
+
|
|
343
|
+
const patch = {};
|
|
344
|
+
const musicEnabled = readBooleanViewValue('platformer-settings-music', preferences.musicEnabled);
|
|
345
|
+
const masterVolume = readNumberViewValue('platformer-settings-volume', preferences.masterVolume);
|
|
346
|
+
const subtitlesEnabled = readBooleanViewValue('platformer-settings-subtitles', preferences.subtitlesEnabled);
|
|
347
|
+
const reduceMotion = readBooleanViewValue('platformer-settings-reduce-motion', preferences.reduceMotion);
|
|
348
|
+
const controlsHint = readBooleanViewValue('platformer-settings-controls-hint', platformerUiState.showControlsHint !== false);
|
|
349
|
+
|
|
350
|
+
if (musicEnabled !== preferences.musicEnabled) patch.musicEnabled = musicEnabled;
|
|
351
|
+
if (masterVolume !== preferences.masterVolume) patch.masterVolume = masterVolume;
|
|
352
|
+
if (subtitlesEnabled !== preferences.subtitlesEnabled) patch.subtitlesEnabled = subtitlesEnabled;
|
|
353
|
+
if (reduceMotion !== preferences.reduceMotion) patch.reduceMotion = reduceMotion;
|
|
354
|
+
|
|
355
|
+
const themeButtons = listThemeSegmentOptions();
|
|
356
|
+
for (const option of themeButtons) {
|
|
357
|
+
if (clickedSegmentOption('platformer-settings-theme', option.id)) {
|
|
358
|
+
patch.themeId = option.id;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
for (const option of listDensitySegmentOptions()) {
|
|
362
|
+
if (clickedSegmentOption('platformer-settings-density', option.id)) {
|
|
363
|
+
patch.density = option.id;
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
for (const option of listContrastSegmentOptions()) {
|
|
367
|
+
if (clickedSegmentOption('platformer-settings-contrast', option.id)) {
|
|
368
|
+
patch.contrast = option.id;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (controlsHint !== (platformerUiState.showControlsHint !== false)) {
|
|
373
|
+
platformerUiState.showControlsHint = controlsHint;
|
|
374
|
+
}
|
|
375
|
+
if (Object.keys(patch).length > 0) {
|
|
376
|
+
updatePreferences(context, appState, patch);
|
|
377
|
+
}
|
|
378
|
+
if (actions.actionId === 'restore') {
|
|
379
|
+
resetPreferences(context, appState);
|
|
380
|
+
platformerUiState.showControlsHint = true;
|
|
381
|
+
settingsView.activeSection = 'audio';
|
|
382
|
+
} else if (actions.actionId === 'back') {
|
|
383
|
+
context.popModalScreen?.({ action: 'back' });
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export default settingsScreen;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
{
|
|
2
|
+
"asset": {
|
|
3
|
+
"version": "2.0"
|
|
4
|
+
},
|
|
5
|
+
"buffers": [
|
|
6
|
+
{
|
|
7
|
+
"byteLength": 876,
|
|
8
|
+
"uri": "data:application/octet-stream;base64,AAAAvwAAAAAAAAC/AAAAPwAAAAAAAAC/AAAAPwAAgD8AAAC/AAAAvwAAgD8AAAC/AAAAvwAAAAAAAAA/AAAAPwAAAAAAAAA/AAAAPwAAgD8AAAA/AAAAvwAAgD8AAAA/AAABAAIAAAACAAMABAAGAAUABAAHAAYAAAAEAAUAAAAFAAEAAwACAAYAAwAGAAcAAQAFAAYAAQAGAAIAAAADAAcAAAAHAAQAAAAAAAAAAAAAAAAAAAAAAM3MTD0AAAAAAAAAAAAAAAAAAAAAAAAAAM3MrD8AAAAAAAAAAIXrsT8AAAAAAAAAAM3MrD8AAAAAAAAAAGZm5j5mZmY/AAAAAAAAAAAAAAAAAAAAAI/CdT0AAAAAAAAAAAAAAAAAAAAAPQrXvuxROD8K16M9PQrXvnsULj8K16O9PQrXvuxROD8K16M9PQrXPuxROD8K16O9PQrXPnsULj8K16M9PQrXPuxROD8K16O9KVwPvuxROD4K16O9KVwPvilcDz4K16M9KVwPvuxROD4K16O9KVwPPuxROD4K16M9KVwPPilcDz4K16O9KVwPPuxROD4K16M9AAAAAM3MzD7NzEw/AAAAAAAAAAAAAAAAAAAAAM3MzD0AAAAAAAAAAAAAAAAAAAAAPQrXvqRwPT8pXA8+PQrXvlK4Hj8pXA++PQrXvqRwPT8pXA8+PQrXPqRwPT8pXA++PQrXPlK4Hj8pXA8+PQrXPqRwPT8pXA++KVwPvq5HYT4pXA++KVwPvgrXoz0pXA8+KVwPvq5HYT4pXA++KVwPPq5HYT4pXA8+KVwPPgrXoz0pXA++KVwPPq5HYT4pXA8+AAAAAJqZmT6amRk/AAAAAAAAAAAAAAAAAAAAAI/CdT6PwnU9AAAAAArXIz2PwvU9PQrXvuxROD8K16M8PQrXvoXrUT8K16M9PQrXvhSuRz8K1yM9PQrXPuxROD8K16O8PQrXPoXrUT8K16O9PQrXPhSuRz8K1yO9AAAAADMzsz4zMzM/AAAAAArXoz2PwvU9AAAAAI/Cdb0K16M8AAAAAI/C9b0K16O9PQrXvlyPQj8K1yM9PQrXvjMzMz8K16M8PQrXvsP1KD8AAAAAPQrXPlyPQj8K1yO9PQrXPjMzMz8K16O8PQrXPsP1KD8AAAAAAAAAAAAAgD4AAAA/"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"bufferViews": [
|
|
12
|
+
{ "buffer": 0, "byteOffset": 0, "byteLength": 96 },
|
|
13
|
+
{ "buffer": 0, "byteOffset": 96, "byteLength": 72 },
|
|
14
|
+
{ "buffer": 0, "byteOffset": 168, "byteLength": 36 },
|
|
15
|
+
{ "buffer": 0, "byteOffset": 204, "byteLength": 36 },
|
|
16
|
+
{ "buffer": 0, "byteOffset": 240, "byteLength": 12 },
|
|
17
|
+
{ "buffer": 0, "byteOffset": 252, "byteLength": 36 },
|
|
18
|
+
{ "buffer": 0, "byteOffset": 288, "byteLength": 36 },
|
|
19
|
+
{ "buffer": 0, "byteOffset": 324, "byteLength": 36 },
|
|
20
|
+
{ "buffer": 0, "byteOffset": 360, "byteLength": 36 },
|
|
21
|
+
{ "buffer": 0, "byteOffset": 396, "byteLength": 36 },
|
|
22
|
+
{ "buffer": 0, "byteOffset": 432, "byteLength": 12 },
|
|
23
|
+
{ "buffer": 0, "byteOffset": 444, "byteLength": 36 },
|
|
24
|
+
{ "buffer": 0, "byteOffset": 480, "byteLength": 36 },
|
|
25
|
+
{ "buffer": 0, "byteOffset": 516, "byteLength": 36 },
|
|
26
|
+
{ "buffer": 0, "byteOffset": 552, "byteLength": 36 },
|
|
27
|
+
{ "buffer": 0, "byteOffset": 588, "byteLength": 36 },
|
|
28
|
+
{ "buffer": 0, "byteOffset": 624, "byteLength": 12 },
|
|
29
|
+
{ "buffer": 0, "byteOffset": 636, "byteLength": 36 },
|
|
30
|
+
{ "buffer": 0, "byteOffset": 672, "byteLength": 36 },
|
|
31
|
+
{ "buffer": 0, "byteOffset": 708, "byteLength": 36 },
|
|
32
|
+
{ "buffer": 0, "byteOffset": 744, "byteLength": 12 },
|
|
33
|
+
{ "buffer": 0, "byteOffset": 756, "byteLength": 36 },
|
|
34
|
+
{ "buffer": 0, "byteOffset": 792, "byteLength": 36 },
|
|
35
|
+
{ "buffer": 0, "byteOffset": 828, "byteLength": 36 },
|
|
36
|
+
{ "buffer": 0, "byteOffset": 864, "byteLength": 12 }
|
|
37
|
+
],
|
|
38
|
+
"accessors": [
|
|
39
|
+
{ "bufferView": 0, "byteOffset": 0, "componentType": 5126, "count": 8, "type": "VEC3" },
|
|
40
|
+
{ "bufferView": 1, "byteOffset": 0, "componentType": 5123, "count": 36, "type": "SCALAR" },
|
|
41
|
+
{ "bufferView": 2, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
42
|
+
{ "bufferView": 3, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
43
|
+
{ "bufferView": 4, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" },
|
|
44
|
+
{ "bufferView": 5, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
45
|
+
{ "bufferView": 6, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
46
|
+
{ "bufferView": 7, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
47
|
+
{ "bufferView": 8, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
48
|
+
{ "bufferView": 9, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
49
|
+
{ "bufferView": 10, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" },
|
|
50
|
+
{ "bufferView": 11, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
51
|
+
{ "bufferView": 12, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
52
|
+
{ "bufferView": 13, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
53
|
+
{ "bufferView": 14, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
54
|
+
{ "bufferView": 15, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
55
|
+
{ "bufferView": 16, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" },
|
|
56
|
+
{ "bufferView": 17, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
57
|
+
{ "bufferView": 18, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
58
|
+
{ "bufferView": 19, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
59
|
+
{ "bufferView": 20, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" },
|
|
60
|
+
{ "bufferView": 21, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
61
|
+
{ "bufferView": 22, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
62
|
+
{ "bufferView": 23, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "VEC3" },
|
|
63
|
+
{ "bufferView": 24, "byteOffset": 0, "componentType": 5126, "count": 3, "type": "SCALAR" }
|
|
64
|
+
],
|
|
65
|
+
"materials": [
|
|
66
|
+
{
|
|
67
|
+
"name": "Body",
|
|
68
|
+
"pbrMetallicRoughness": {
|
|
69
|
+
"baseColorFactor": [0.86, 0.63, 0.4, 1],
|
|
70
|
+
"metallicFactor": 0.04,
|
|
71
|
+
"roughnessFactor": 0.88
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "Accent",
|
|
76
|
+
"pbrMetallicRoughness": {
|
|
77
|
+
"baseColorFactor": [0.15, 0.68, 0.88, 1],
|
|
78
|
+
"metallicFactor": 0.08,
|
|
79
|
+
"roughnessFactor": 0.62
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"meshes": [
|
|
84
|
+
{
|
|
85
|
+
"name": "BodyCube",
|
|
86
|
+
"primitives": [
|
|
87
|
+
{ "attributes": { "POSITION": 0 }, "indices": 1, "material": 0 }
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "AccentCube",
|
|
92
|
+
"primitives": [
|
|
93
|
+
{ "attributes": { "POSITION": 0 }, "indices": 1, "material": 1 }
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"nodes": [
|
|
98
|
+
{ "name": "Root", "children": [1] },
|
|
99
|
+
{ "name": "AvatarRig", "children": [2, 3, 4, 5, 6, 7] },
|
|
100
|
+
{ "name": "Torso", "mesh": 0, "translation": [0, 0.65, 0], "scale": [0.38, 0.6, 0.22] },
|
|
101
|
+
{ "name": "Head", "mesh": 1, "translation": [0, 1.35, 0], "scale": [0.28, 0.28, 0.28] },
|
|
102
|
+
{ "name": "ArmL", "mesh": 1, "translation": [-0.42, 0.72, 0], "scale": [0.12, 0.46, 0.12] },
|
|
103
|
+
{ "name": "ArmR", "mesh": 1, "translation": [0.42, 0.72, 0], "scale": [0.12, 0.46, 0.12] },
|
|
104
|
+
{ "name": "LegL", "mesh": 0, "translation": [-0.14, 0.18, 0], "scale": [0.14, 0.36, 0.14] },
|
|
105
|
+
{ "name": "LegR", "mesh": 0, "translation": [0.14, 0.18, 0], "scale": [0.14, 0.36, 0.14] }
|
|
106
|
+
],
|
|
107
|
+
"scenes": [
|
|
108
|
+
{ "nodes": [0] }
|
|
109
|
+
],
|
|
110
|
+
"scene": 0,
|
|
111
|
+
"animations": [
|
|
112
|
+
{
|
|
113
|
+
"name": "Idle",
|
|
114
|
+
"channels": [
|
|
115
|
+
{ "sampler": 0, "target": { "node": 1, "path": "translation" } },
|
|
116
|
+
{ "sampler": 1, "target": { "node": 3, "path": "translation" } }
|
|
117
|
+
],
|
|
118
|
+
"samplers": [
|
|
119
|
+
{ "input": 4, "output": 2, "interpolation": "LINEAR" },
|
|
120
|
+
{ "input": 4, "output": 3, "interpolation": "LINEAR" }
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"name": "Walk",
|
|
125
|
+
"channels": [
|
|
126
|
+
{ "sampler": 0, "target": { "node": 1, "path": "translation" } },
|
|
127
|
+
{ "sampler": 1, "target": { "node": 4, "path": "translation" } },
|
|
128
|
+
{ "sampler": 2, "target": { "node": 5, "path": "translation" } },
|
|
129
|
+
{ "sampler": 3, "target": { "node": 6, "path": "translation" } },
|
|
130
|
+
{ "sampler": 4, "target": { "node": 7, "path": "translation" } }
|
|
131
|
+
],
|
|
132
|
+
"samplers": [
|
|
133
|
+
{ "input": 10, "output": 5, "interpolation": "LINEAR" },
|
|
134
|
+
{ "input": 10, "output": 6, "interpolation": "LINEAR" },
|
|
135
|
+
{ "input": 10, "output": 7, "interpolation": "LINEAR" },
|
|
136
|
+
{ "input": 10, "output": 8, "interpolation": "LINEAR" },
|
|
137
|
+
{ "input": 10, "output": 9, "interpolation": "LINEAR" }
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "Run",
|
|
142
|
+
"channels": [
|
|
143
|
+
{ "sampler": 0, "target": { "node": 1, "path": "translation" } },
|
|
144
|
+
{ "sampler": 1, "target": { "node": 4, "path": "translation" } },
|
|
145
|
+
{ "sampler": 2, "target": { "node": 5, "path": "translation" } },
|
|
146
|
+
{ "sampler": 3, "target": { "node": 6, "path": "translation" } },
|
|
147
|
+
{ "sampler": 4, "target": { "node": 7, "path": "translation" } }
|
|
148
|
+
],
|
|
149
|
+
"samplers": [
|
|
150
|
+
{ "input": 16, "output": 11, "interpolation": "LINEAR" },
|
|
151
|
+
{ "input": 16, "output": 12, "interpolation": "LINEAR" },
|
|
152
|
+
{ "input": 16, "output": 13, "interpolation": "LINEAR" },
|
|
153
|
+
{ "input": 16, "output": 14, "interpolation": "LINEAR" },
|
|
154
|
+
{ "input": 16, "output": 15, "interpolation": "LINEAR" }
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "Jump",
|
|
159
|
+
"channels": [
|
|
160
|
+
{ "sampler": 0, "target": { "node": 1, "path": "translation" } },
|
|
161
|
+
{ "sampler": 1, "target": { "node": 4, "path": "translation" } },
|
|
162
|
+
{ "sampler": 2, "target": { "node": 5, "path": "translation" } }
|
|
163
|
+
],
|
|
164
|
+
"samplers": [
|
|
165
|
+
{ "input": 20, "output": 17, "interpolation": "LINEAR" },
|
|
166
|
+
{ "input": 20, "output": 18, "interpolation": "LINEAR" },
|
|
167
|
+
{ "input": 20, "output": 19, "interpolation": "LINEAR" }
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "Fall",
|
|
172
|
+
"channels": [
|
|
173
|
+
{ "sampler": 0, "target": { "node": 1, "path": "translation" } },
|
|
174
|
+
{ "sampler": 1, "target": { "node": 4, "path": "translation" } },
|
|
175
|
+
{ "sampler": 2, "target": { "node": 5, "path": "translation" } }
|
|
176
|
+
],
|
|
177
|
+
"samplers": [
|
|
178
|
+
{ "input": 24, "output": 21, "interpolation": "LINEAR" },
|
|
179
|
+
{ "input": 24, "output": 22, "interpolation": "LINEAR" },
|
|
180
|
+
{ "input": 24, "output": 23, "interpolation": "LINEAR" }
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"identity": {
|
|
3
|
+
"name": "{{PROJECT_TITLE}}",
|
|
4
|
+
"version": "{{PROJECT_VERSION}}",
|
|
5
|
+
"executable": "{{PROJECT_BIN_NAME}}",
|
|
6
|
+
"icon": null
|
|
7
|
+
},
|
|
8
|
+
"window": {
|
|
9
|
+
"title": "{{PROJECT_TITLE}}",
|
|
10
|
+
"width": 1280,
|
|
11
|
+
"height": 720,
|
|
12
|
+
"resizable": true,
|
|
13
|
+
"fullscreen": false,
|
|
14
|
+
"vsync": true,
|
|
15
|
+
"hidpi": true
|
|
16
|
+
},
|
|
17
|
+
"build": {
|
|
18
|
+
"entry": "src/main.js",
|
|
19
|
+
"outDir": "build",
|
|
20
|
+
"assetDir": "assets",
|
|
21
|
+
"assetMode": "embed"
|
|
22
|
+
},
|
|
23
|
+
"modules": {
|
|
24
|
+
"physics": false,
|
|
25
|
+
"network": true,
|
|
26
|
+
"steam": false
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export const PLAYER_HALF = { x: 0.45, y: 0.55, z: 0.45 };
|
|
2
|
+
export const MOVE_SPEED = 5.7;
|
|
3
|
+
export const JUMP_SPEED = 8.5;
|
|
4
|
+
export const WORLD_LIMIT = 10.2;
|
|
5
|
+
|
|
6
|
+
export const FLOOR_SCALE = { x: 28, y: 1, z: 28 };
|
|
7
|
+
export const PLAYER_SPAWN = { x: 0, y: 1.1, z: 6.2 };
|
|
8
|
+
export const CAMERA_OFFSET = { x: 7.8, y: 6.4, z: 8.8 };
|
|
9
|
+
export const CAMERA_LOOK_OFFSET = { x: 0, y: 0.2, z: 0 };
|
|
10
|
+
|
|
11
|
+
export const WORLD_PLATFORMS = [
|
|
12
|
+
{ x: -3.8, y: 1.8, z: 3.0, sx: 3.6, sy: 0.5, sz: 2.6 },
|
|
13
|
+
{ x: 1.1, y: 2.6, z: 1.0, sx: 2.8, sy: 0.5, sz: 2.2 },
|
|
14
|
+
{ x: 4.8, y: 3.7, z: -1.8, sx: 3.0, sy: 0.5, sz: 2.0 },
|
|
15
|
+
{ x: -1.2, y: 4.7, z: -3.6, sx: 3.2, sy: 0.5, sz: 2.3 },
|
|
16
|
+
{ x: 4.9, y: 5.5, z: -5.6, sx: 2.8, sy: 0.5, sz: 1.9 },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export const CHECKPOINTS = [
|
|
20
|
+
{ x: 0.0, y: 1.1, z: 6.2, radius: 1.4 },
|
|
21
|
+
{ x: -3.8, y: 2.4, z: 3.0, radius: 1.2 },
|
|
22
|
+
{ x: 1.1, y: 3.2, z: 1.0, radius: 1.2 },
|
|
23
|
+
{ x: -1.2, y: 5.2, z: -3.6, radius: 1.25 },
|
|
24
|
+
{ x: 4.9, y: 6.1, z: -5.6, radius: 1.25 },
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
export const RELIC_SPAWNS = [
|
|
28
|
+
{ id: 'anchor-relay', label: 'Anchor Relay', x: -3.8, y: 2.5, z: 3.0, radius: 0.42 },
|
|
29
|
+
{ id: 'glass-map', label: 'Glass Map', x: 1.1, y: 3.4, z: 1.0, radius: 0.42 },
|
|
30
|
+
{ id: 'pulse-key', label: 'Pulse Key', x: 4.8, y: 4.3, z: -1.8, radius: 0.42 },
|
|
31
|
+
{ id: 'sky-spindle', label: 'Sky Spindle', x: -1.2, y: 5.3, z: -3.6, radius: 0.42 },
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export const BEACON_SITES = [
|
|
35
|
+
{
|
|
36
|
+
id: 'cliff-beacon',
|
|
37
|
+
label: 'Cliff Beacon',
|
|
38
|
+
x: -3.2,
|
|
39
|
+
y: 2.15,
|
|
40
|
+
z: 2.2,
|
|
41
|
+
radius: 0.72,
|
|
42
|
+
requiredRelics: 2,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'summit-beacon',
|
|
46
|
+
label: 'Summit Beacon',
|
|
47
|
+
x: 4.9,
|
|
48
|
+
y: 5.95,
|
|
49
|
+
z: -5.0,
|
|
50
|
+
radius: 0.72,
|
|
51
|
+
requiredRelics: 4,
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
export const MOVING_PLATFORM = {
|
|
56
|
+
from: { x: 0.5, y: 3.0, z: -0.8 },
|
|
57
|
+
to: { x: 3.0, y: 4.2, z: -2.4 },
|
|
58
|
+
size: { x: 2.3, y: 0.4, z: 1.8 },
|
|
59
|
+
periodSeconds: 3.2,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const GOAL_ZONE = { x: 5.4, y: 6.2, z: -5.9, radius: 1.0 };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# 3D Adventure Loop
|
|
2
|
+
|
|
3
|
+
1. Traverse the route, recover four relics, then light both beacons before leaving through the signal arch.
|
|
4
|
+
1. Keep traversal and prompt tuning in `config/gameplay/adventure.config.js` and authored route nouns in `content/gameplay/course.js`.
|
|
5
|
+
1. Extend from here with richer routes, glTF set dressing, and authored encounter beats instead of adding more ad hoc scene constants.
|