@dcl-regenesislabs/web-editor 0.1.1-37509646646.commit-126b34d → 0.1.1-38415884993.commit-9d6277f

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.
Files changed (46) hide show
  1. package/editor.js +1231 -464
  2. package/package.json +2 -2
  3. package/prefabs/announcer/ai.md +9 -2
  4. package/prefabs/announcer/data.json +6 -7
  5. package/prefabs/announcer/scripts/announcer.tsx +16 -37
  6. package/prefabs/catalog.json +1 -1
  7. package/prefabs/game-flow/ai.md +6 -0
  8. package/prefabs/game-flow/data.json +7 -3
  9. package/prefabs/game-flow/scripts/game-flow.ts +22 -5
  10. package/prefabs/health-respawn/ai.md +25 -2
  11. package/prefabs/health-respawn/data.json +8 -1
  12. package/prefabs/health-respawn/scripts/health-respawn.ts +52 -20
  13. package/prefabs/health-respawn/scripts/health.ts +21 -0
  14. package/prefabs/health-respawn/scripts/pure/life.ts +59 -0
  15. package/prefabs/leaderboard/ai.md +27 -9
  16. package/prefabs/leaderboard/composite.json +2 -2
  17. package/prefabs/leaderboard/data.json +14 -7
  18. package/prefabs/leaderboard/scripts/leaderboard-hud.tsx +28 -0
  19. package/prefabs/leaderboard/scripts/leaderboard.ts +41 -5
  20. package/prefabs/leaderboard/scripts/pure/board.ts +10 -3
  21. package/prefabs/run-progress/ai.md +101 -0
  22. package/prefabs/run-progress/composite.json +9 -0
  23. package/prefabs/run-progress/data.json +43 -0
  24. package/prefabs/run-progress/scripts/moving-platform.ts +28 -0
  25. package/prefabs/run-progress/scripts/run-progress.tsx +170 -0
  26. package/prefabs/run-progress/thumbnail.png +0 -0
  27. package/prefabs/server-clock/ai.md +10 -7
  28. package/prefabs/server-clock/data.json +5 -1
  29. package/prefabs/server-clock/scripts/server-clock.ts +7 -6
  30. package/prefabs/trigger-zone/ai.md +13 -7
  31. package/prefabs/trigger-zone/data.json +2 -1
  32. package/prefabs/ui-theme/ai.md +30 -0
  33. package/prefabs/ui-theme/composite.json +31 -0
  34. package/prefabs/ui-theme/data.json +24 -0
  35. package/prefabs/ui-theme/scripts/ui-theme.ts +16 -0
  36. package/prefabs/ui-theme/thumbnail.png +0 -0
  37. package/scene/about +1 -1
  38. package/scene/{bafkreidzfny4im7pqpzuedreg2q5e6pd3vokz7h2py5b6zjxn3er6h4f5i → bafkreifyskofqvjvp22m3eaxz2mpwibp7j4wtimdj5bxtqsd7onkbnjlsa} +1 -1
  39. package/scene/bafybeiblcndgruoz3ewqrheei4moyeoehankul4yd43co33djksumfd3se +90 -0
  40. package/three/worker.js +3832 -0
  41. package/web-build/index.js +6 -3
  42. package/web-build/sdk-snapshot.json +1 -1
  43. package/web-build/worker.js +29 -26
  44. package/dcl-regenesislabs-web-editor-0.1.1-37509646646.commit-126b34d.tgz +0 -0
  45. package/prefabs/server-clock/scripts/clock-hud.tsx +0 -55
  46. package/scene/bafybeihw3xlbff4sf5sc3kvmlmlwf2visnty5lfymawlunzt5vrkp5fd7u +0 -90
@@ -1,55 +0,0 @@
1
- import ReactEcs, { Label, ReactEcsRenderer, UiEntity } from '@dcl/sdk/react-ecs'
2
- import { type Entity } from '@dcl/sdk/ecs'
3
-
4
- let label = ''
5
- let time = ''
6
- let mounted = false
7
-
8
- export function setClockHudText(nextLabel: string, nextTime: string): void {
9
- label = nextLabel
10
- time = nextTime
11
- }
12
-
13
- export type ClockHudPosition = 'top' | 'top left' | 'top right' | 'bottom'
14
-
15
- function justifyFor(where: ClockHudPosition): 'flex-start' | 'flex-end' | 'center' {
16
- switch (where) {
17
- case 'top left':
18
- return 'flex-start'
19
- case 'top right':
20
- return 'flex-end'
21
- default:
22
- return 'center'
23
- }
24
- }
25
-
26
- export function mountClockHud(entity: Entity, where: ClockHudPosition = 'top'): void {
27
- if (mounted) return
28
- mounted = true
29
- const vertical = where === 'bottom' ? { bottom: 24, left: 0 } : { top: 24, left: 0 }
30
- const justify = justifyFor(where)
31
- ReactEcsRenderer.addUiRenderer(entity, () => (
32
- <UiEntity
33
- uiTransform={{
34
- positionType: 'absolute',
35
- position: vertical,
36
- width: '100%',
37
- padding: { left: 24, right: 24 },
38
- justifyContent: justify,
39
- alignItems: 'flex-start'
40
- }}
41
- >
42
- <UiEntity
43
- uiTransform={{
44
- padding: { top: 6, bottom: 8, left: 18, right: 18 },
45
- flexDirection: 'column',
46
- alignItems: 'center'
47
- }}
48
- uiBackground={{ color: { r: 0.06, g: 0.09, b: 0.08, a: 0.6 } }}
49
- >
50
- {label !== '' ? <Label value={label} fontSize={12} color={{ r: 1, g: 1, b: 1, a: 0.75 }} /> : null}
51
- <Label value={time === '' ? '--:--:--' : time} fontSize={26} color={{ r: 1, g: 1, b: 1, a: 1 }} />
52
- </UiEntity>
53
- </UiEntity>
54
- ))
55
- }