Skip to content

Commit 7ae2e38

Browse files
authored
feat: pointer max player distance (#1293)
1 parent 1da934f commit 7ae2e38

20 files changed

Lines changed: 61 additions & 54 deletions

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
77
"dependencies": {
88
"@actions/core": "^1.10.0",
9-
"@dcl/protocol": "1.0.0-20755528534.commit-d6cccca",
9+
"@dcl/protocol": "1.0.0-21456739795.commit-eae3f8b",
1010
"@dcl/quickjs-emscripten": "^0.21.0-3680274614.commit-1808aa1",
1111
"@dcl/ts-proto": "1.153.0",
1212
"@types/fs-extra": "^9.0.12",

packages/@dcl/ecs/src/systems/events.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export type EventSystemOptions = {
2121
maxDistance?: number
2222
showFeedback?: boolean
2323
showHighlight?: boolean
24+
maxPlayerDistance?: number
2425
}
2526

2627
export const getDefaultOpts = (opts: Partial<EventSystemOptions> = {}): EventSystemOptions => ({
@@ -157,7 +158,8 @@ export function createPointerEventsSystem(engine: IEngine, inputSystem: IInputSy
157158
showFeedback: opts.showFeedback,
158159
showHighlight: opts.showHighlight,
159160
hoverText: opts.hoverText,
160-
maxDistance: opts.maxDistance
161+
maxDistance: opts.maxDistance,
162+
maxPlayerDistance: opts.maxPlayerDistance
161163
}
162164
})
163165
}

packages/@dcl/playground-assets/etc/playground-assets.api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,7 @@ export type EventSystemOptions = {
11561156
maxDistance?: number;
11571157
showFeedback?: boolean;
11581158
showHighlight?: boolean;
1159+
maxPlayerDistance?: number;
11591160
};
11601161

11611162
// @public
@@ -2886,6 +2887,7 @@ export interface PBPointerEvents_Info {
28862887
button?: InputAction | undefined;
28872888
hoverText?: string | undefined;
28882889
maxDistance?: number | undefined;
2890+
maxPlayerDistance?: number | undefined;
28892891
showFeedback?: boolean | undefined;
28902892
showHighlight?: boolean | undefined;
28912893
}

packages/@dcl/sdk-commands/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@dcl/sdk-commands/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@dcl/inspector": "7.25.0",
1515
"@dcl/linker-dapp": "^0.14.2",
1616
"@dcl/mini-comms": "1.0.1-20230216163137.commit-a4c75be",
17-
"@dcl/protocol": "1.0.0-20755528534.commit-d6cccca",
17+
"@dcl/protocol": "1.0.0-21456739795.commit-eae3f8b",
1818
"@dcl/quests-client": "^1.0.3",
1919
"@dcl/quests-manager": "^0.1.4",
2020
"@dcl/rpc": "^1.1.1",

test/ecs/components/PointerEvents.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ describe('Generated OnPointerDown ProtoBuf', () => {
1515
hoverText: 'Tap to run',
1616
maxDistance: 10,
1717
showFeedback: true,
18-
showHighlight: true
18+
showHighlight: true,
19+
maxPlayerDistance: 10
1920
}
2021
}
2122
]
@@ -30,7 +31,8 @@ describe('Generated OnPointerDown ProtoBuf', () => {
3031
hoverText: 'Run to tap',
3132
maxDistance: 5,
3233
showFeedback: false,
33-
showHighlight: false
34+
showHighlight: false,
35+
maxPlayerDistance: 7
3436
}
3537
}
3638
]
@@ -54,7 +56,8 @@ describe('Generated OnPointerDown ProtoBuf', () => {
5456
hoverText: 'Run to tap',
5557
maxDistance: 5,
5658
showFeedback: false,
57-
showHighlight: false
59+
showHighlight: false,
60+
maxPlayerDistance: 3
5861
}
5962
}
6063
]

test/snapshots/development-bundles/static-scene.test.ts.crdt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SCENE_COMPILED_JS_SIZE_PROD=503.9k bytes
1+
SCENE_COMPILED_JS_SIZE_PROD=504.2k bytes
22
THE BUNDLE HAS SOURCEMAPS
33
(start empty vm 0.21.0-3680274614.commit-1808aa1)
44
OPCODES ~= 0k
@@ -11,7 +11,7 @@ EVAL test/snapshots/development-bundles/static-scene.test.js
1111
REQUIRE: ~system/EngineApi
1212
REQUIRE: ~system/EngineApi
1313
OPCODES ~= 61k
14-
MALLOC_COUNT = 14795
14+
MALLOC_COUNT = 14796
1515
ALIVE_OBJS_DELTA ~= 2.93k
1616
CALL onStart()
1717
main.crdt: PUT_COMPONENT e=0x200 c=1 t=0 data={"position":{"x":5.880000114440918,"y":2.7916901111602783,"z":7.380000114440918},"rotation":{"x":0,"y":0,"z":0,"w":1},"scale":{"x":1,"y":1,"z":1},"parent":0}
@@ -56,4 +56,4 @@ CALL onUpdate(0.1)
5656
OPCODES ~= 3k
5757
MALLOC_COUNT = -5
5858
ALIVE_OBJS_DELTA ~= 0.00k
59-
MEMORY_USAGE_COUNT ~= 1308.08k bytes
59+
MEMORY_USAGE_COUNT ~= 1308.50k bytes

test/snapshots/development-bundles/testing-fw.test.ts.crdt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SCENE_COMPILED_JS_SIZE_PROD=504.5k bytes
1+
SCENE_COMPILED_JS_SIZE_PROD=504.8k bytes
22
THE BUNDLE HAS SOURCEMAPS
33
(start empty vm 0.21.0-3680274614.commit-1808aa1)
44
OPCODES ~= 0k
@@ -11,7 +11,7 @@ EVAL test/snapshots/development-bundles/testing-fw.test.js
1111
REQUIRE: ~system/EngineApi
1212
REQUIRE: ~system/EngineApi
1313
OPCODES ~= 70k
14-
MALLOC_COUNT = 15325
14+
MALLOC_COUNT = 15326
1515
ALIVE_OBJS_DELTA ~= 3.09k
1616
CALL onStart()
1717
LOG: ["Adding one to position.y=0"]
@@ -64,4 +64,4 @@ CALL onUpdate(0.1)
6464
OPCODES ~= 5k
6565
MALLOC_COUNT = -40
6666
ALIVE_OBJS_DELTA ~= -0.01k
67-
MEMORY_USAGE_COUNT ~= 1316.98k bytes
67+
MEMORY_USAGE_COUNT ~= 1317.39k bytes

test/snapshots/development-bundles/two-way-crdt.test.ts.crdt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SCENE_COMPILED_JS_SIZE_PROD=504.5k bytes
1+
SCENE_COMPILED_JS_SIZE_PROD=504.8k bytes
22
THE BUNDLE HAS SOURCEMAPS
33
(start empty vm 0.21.0-3680274614.commit-1808aa1)
44
OPCODES ~= 0k
@@ -11,7 +11,7 @@ EVAL test/snapshots/development-bundles/two-way-crdt.test.js
1111
REQUIRE: ~system/EngineApi
1212
REQUIRE: ~system/EngineApi
1313
OPCODES ~= 70k
14-
MALLOC_COUNT = 15325
14+
MALLOC_COUNT = 15326
1515
ALIVE_OBJS_DELTA ~= 3.09k
1616
CALL onStart()
1717
LOG: ["Adding one to position.y=0"]
@@ -64,4 +64,4 @@ CALL onUpdate(0.1)
6464
OPCODES ~= 5k
6565
MALLOC_COUNT = -40
6666
ALIVE_OBJS_DELTA ~= -0.01k
67-
MEMORY_USAGE_COUNT ~= 1316.98k bytes
67+
MEMORY_USAGE_COUNT ~= 1317.39k bytes

0 commit comments

Comments
 (0)