diff --git a/proto/decentraland/sdk/components/avatar_emote_command.proto b/proto/decentraland/sdk/components/avatar_emote_command.proto index f0c9cb9d..550bd34a 100644 --- a/proto/decentraland/sdk/components/avatar_emote_command.proto +++ b/proto/decentraland/sdk/components/avatar_emote_command.proto @@ -5,8 +5,9 @@ import "decentraland/sdk/components/common/id.proto"; import "decentraland/sdk/components/common/avatar_mask.proto"; option (common.ecs_component_id) = 1088; -// AvatarEmoteCommand is a grow only value set, used to signal the renderer about -// avatar emotes playback. +// AvatarEmoteCommand is a grow only value set, written by the explorer to report +// avatar emote playback to the scene. It is appended to every player entity in the +// scene (the local player and remote avatars alike). message PBAvatarEmoteCommand { string emote_urn = 1; bool loop = 2; diff --git a/proto/decentraland/sdk/components/touch_screen_controls.proto b/proto/decentraland/sdk/components/touch_screen_controls.proto new file mode 100644 index 00000000..6069e280 --- /dev/null +++ b/proto/decentraland/sdk/components/touch_screen_controls.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package decentraland.sdk.components; +import "decentraland/sdk/components/common/id.proto"; +import "decentraland/sdk/components/common/input_action.proto"; +import "decentraland/common/texture.proto"; +option (common.ecs_component_id) = 1218; + +// The TouchScreenControls component lets a scene configure the native on-screen touch +// controls (the mobile joystick + gamepad). It must be set on the RootEntity. +// +// By default every on-screen button is shown; list a button in `touch_inputs` with +// `hide = true` to remove it (declutter). `main_action` picks which action the large +// central button triggers, and `hide_joystick` removes the native virtual joystick. It is +// a no-op on platforms without native on-screen controls (e.g. desktop). +// +// Accepted actions: only the on-screen gamepad actions map to a button — `IA_POINTER`, +// `IA_PRIMARY`, `IA_SECONDARY`, `IA_JUMP`, and `IA_ACTION_3`..`IA_ACTION_6`. Any other +// `InputAction` (movement actions, `IA_ANY`, `IA_MODIFIER`, or unknown/future values) is +// ignored: a `TouchInput` entry naming a non-button action has no effect, and a `main_action` +// that isn't a valid gamepad action falls back to the default central button (`IA_JUMP`). +message PBTouchScreenControls { + // Per-button configuration. A button not listed here keeps its default (shown). + message TouchInput { + common.InputAction input_action = 1; // which on-screen button this configures + bool hide = 2; // hide this button (default: shown) + // Override the button glyph with this texture. For the jump button it replaces all + // of its dynamic states (jump / double-jump / glide). + optional decentraland.common.TextureUnion icon = 3; + } + + repeated TouchInput touch_inputs = 1; + // The large central button's action. Only the gamepad actions are valid: + // jump / pointer / primary (E) / secondary (F) / action_3..action_6 (1/2/3/4). + // When unset, the default central button (jump) is kept. + optional common.InputAction main_action = 2; + bool hide_joystick = 3; // hide the native virtual joystick + bool hide_crosshair = 4; // hide the on-screen crosshair / reticle +} diff --git a/proto/decentraland/sdk/components/ui_input_binding.proto b/proto/decentraland/sdk/components/ui_input_binding.proto new file mode 100644 index 00000000..5d00bdd6 --- /dev/null +++ b/proto/decentraland/sdk/components/ui_input_binding.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; +package decentraland.sdk.components; +import "decentraland/sdk/components/common/id.proto"; +import "decentraland/sdk/components/common/input_action.proto"; +option (common.ecs_component_id) = 1219; + +// The UiInputBinding component binds a UI entity to one or more InputActions. While the +// element is pressed (touch or pointer) the listed actions are held down, driving both +// the local player input and scene InputAction listeners, just like the native on-screen +// buttons. It is typically combined with PBTouchScreenControls to replace the native +// controls with a custom touch UI. +// +// Release semantics: the held actions are released as soon as the press that started them +// ends. A renderer MUST release all actions held by this binding when any of the following +// happens: the press/touch is lifted or cancelled, the pointer/touch leaves the element +// (loses press ownership), the actions list changes (the previous set is released before +// the new set is applied), the component is removed or its actions list becomes empty, the +// UI element is hidden, disabled or removed from the tree, or the scene unloads. In short, +// no action may remain held once the element is no longer both present and actively pressed. +// +// Multi-touch: the binding is a single held state, not reference-counted per pointer. The +// actions are held while the element is pressed and released when that press ends; a second +// simultaneous press on the same element does not stack, and does not extend the hold past +// the first release. +message PBUiInputBinding { + repeated common.InputAction actions = 1; // the input actions fired while this element is pressed +} diff --git a/proto/decentraland/sdk/components/virtual_camera.proto b/proto/decentraland/sdk/components/virtual_camera.proto index 94302069..a8764e68 100644 --- a/proto/decentraland/sdk/components/virtual_camera.proto +++ b/proto/decentraland/sdk/components/virtual_camera.proto @@ -10,7 +10,9 @@ option (common.ecs_component_id) = 1076; // an 'instant' transition (like using speed/time = 0) // * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from // the holding entity transform). +// * The fov defines the Field of View of the virtual camera message PBVirtualCamera { optional common.CameraTransition default_transition = 1; optional uint32 look_at_entity = 2; + optional float fov = 3; // default: 60 } \ No newline at end of file diff --git a/public/sdk-components.proto b/public/sdk-components.proto index a2f966cb..f4198460 100644 --- a/public/sdk-components.proto +++ b/public/sdk-components.proto @@ -29,6 +29,7 @@ import public "decentraland/sdk/components/raycast_result.proto"; import public "decentraland/sdk/components/raycast.proto"; import public "decentraland/sdk/components/realm_info.proto"; import public "decentraland/sdk/components/text_shape.proto"; +import public "decentraland/sdk/components/touch_screen_controls.proto"; import public "decentraland/sdk/components/tween.proto"; import public "decentraland/sdk/components/tween_state.proto"; import public "decentraland/sdk/components/tween_sequence.proto"; @@ -37,6 +38,7 @@ import public "decentraland/sdk/components/ui_dropdown_result.proto"; import public "decentraland/sdk/components/ui_dropdown.proto"; import public "decentraland/sdk/components/ui_input_result.proto"; import public "decentraland/sdk/components/ui_input.proto"; +import public "decentraland/sdk/components/ui_input_binding.proto"; import public "decentraland/sdk/components/ui_text.proto"; import public "decentraland/sdk/components/ui_transform.proto"; import public "decentraland/sdk/components/video_player.proto";