Skip to content

Commit

Permalink
Merge pull request #1168 from overte-org/fix/unequip
Browse files Browse the repository at this point in the history
Fix Uuid.NULL behavior
  • Loading branch information
ksuprynowicz authored Oct 22, 2024
2 parents 9da839f + d38ebbd commit 1576351
Show file tree
Hide file tree
Showing 24 changed files with 114 additions and 114 deletions.
4 changes: 2 additions & 2 deletions interface/src/scripting/Audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable {
* Audio is recorded to snapshots directory specified in settings.
* @function Audio.startRecording
* @returns {Uuid} A valid <code>Uuid</code> if the specified file could be opened and audio recording has started, otherwise
* <code>Uuid.NULL</code>.
* <code>Uuid.NONE</code>.
* @example <caption>Make a 10 second audio recording.</caption>
* if (Audio.startRecording() !== Uuid.NULL) {
* if (Audio.startRecording() !== Uuid.NONE) {
* Script.setTimeout(function () {
* Audio.stopRecording();
* print("Audio recording finished.");
Expand Down
8 changes: 4 additions & 4 deletions interface/src/ui/overlays/Overlays.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ParabolaToOverlayIntersectionResult {
*
* @property {Uuid} keyboardFocusOverlay - The <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay
* ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus. If no overlay (entity) has keyboard focus,
* returns <code>null</code>; set to <code>null</code> or {@link Uuid(0)|Uuid.NULL} to clear keyboard focus.
* returns <code>null</code>; set to <code>null</code> or {@link Uuid(0)|Uuid.NONE} to clear keyboard focus.
*/

class Overlays : public QObject {
Expand Down Expand Up @@ -125,7 +125,7 @@ public slots:
* @function Overlays.addOverlay
* @param {Overlays.OverlayType} type - The type of the overlay to add.
* @param {Overlays.OverlayProperties} properties - The properties of the overlay to add.
* @returns {Uuid} The ID of the newly created overlay if successful, otherwise {@link Uuid(0)|Uuid.NULL}.
* @returns {Uuid} The ID of the newly created overlay if successful, otherwise {@link Uuid(0)|Uuid.NONE}.
* @example <caption>Add a cube overlay in front of your avatar.</caption>
* var overlay = Overlays.addOverlay("cube", {
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })),
Expand All @@ -141,7 +141,7 @@ public slots:
* <p>Note: For cloning behavior of 3D overlays and entities, see {@link Entities.cloneEntity}.</p>
* @function Overlays.cloneOverlay
* @param {Uuid} id - The ID of the overlay (or entity) to clone.
* @returns {Uuid} The ID of the new overlay (or entity) if successful, otherwise {@link Uuid(0)|Uuid.NULL}.
* @returns {Uuid} The ID of the new overlay (or entity) if successful, otherwise {@link Uuid(0)|Uuid.NONE}.
*/
QUuid cloneOverlay(const QUuid& id);

Expand Down Expand Up @@ -535,7 +535,7 @@ public slots:
* @function Overlays.setKeyboardFocusOverlay
* @param {Uuid} id - The ID of the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay
* ({@link Entities.EntityProperties-Web|Web} entity) to set keyboard focus to. Use <code>null</code> or
* {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an overlay (entity).
* {@link Uuid(0)|Uuid.NONE} to unset keyboard focus from an overlay (entity).
*/
void setKeyboardFocusOverlay(const QUuid& id) { DependencyManager::get<EntityScriptingInterface>()->setKeyboardFocusEntity(id); }

Expand Down
4 changes: 2 additions & 2 deletions libraries/avatars-renderer/src/avatars-renderer/Avatar.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class Avatar : public AvatarData, public scriptable::ModelProvider, public MetaM
/*@jsdoc
* Gets the ID of the entity or avatar that the avatar is parented to.
* @function MyAvatar.getParentID
* @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NULL} if not parented.
* @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NONE} if not parented.
*/
// This calls through to the SpatiallyNestable versions, but is here to expose these to JavaScript.
Q_INVOKABLE virtual const QUuid getParentID() const override { return SpatiallyNestable::getParentID(); }
Expand All @@ -452,7 +452,7 @@ class Avatar : public AvatarData, public scriptable::ModelProvider, public MetaM
* Sets the ID of the entity or avatar that the avatar is parented to.
* @function MyAvatar.setParentID
* @param {Uuid} parentID - The ID of the entity or avatar that the avatar should be parented to. Set to
* {@link Uuid(0)|Uuid.NULL} to unparent.
* {@link Uuid(0)|Uuid.NONE} to unparent.
*/
// This calls through to the SpatiallyNestable versions, but is here to expose these to JavaScript.
Q_INVOKABLE virtual void setParentID(const QUuid& parentID) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public slots:
/*@jsdoc
* Gets the ID of the entity or avatar that the avatar is parented to.
* @function ScriptAvatar.getParentID
* @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NULL} if not parented
* @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NONE} if not parented
* or avatar data aren't available.
*/
QUuid getParentID() const;
Expand Down
34 changes: 17 additions & 17 deletions libraries/entities/src/EntityItemPropertiesDocs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
* <code>false</code> if it isn't. The value is per the <code>entityHostType</code> property value, set at entity creation
* by one of the {@link Entities.addEntity} methods. <em>Read-only.</em>
*
* @property {Uuid} owningAvatarID=Uuid.NULL - The session ID of the owning avatar if <code>avatarEntity</code> is
* <code>true</code>, otherwise {@link Uuid(0)|Uuid.NULL}. <em>Read-only.</em>
* @property {Uuid} owningAvatarID=Uuid.NONE - The session ID of the owning avatar if <code>avatarEntity</code> is
* <code>true</code>, otherwise {@link Uuid(0)|Uuid.NONE}. <em>Read-only.</em>
*
* @property {number} created - When the entity was created, expressed as the number of microseconds since
* 1970-01-01T00:00:00 UTC. <em>Read-only.</em>
Expand Down Expand Up @@ -131,8 +131,8 @@
* button beside the "script URL" field in properties tab of the Create app works.
* @property {string} serverScripts="" - The URL of the server entity script, if any, that is attached to the entity.
*
* @property {Uuid} parentID=Uuid.NULL - The ID of the entity or avatar that the entity is parented to. A value of
* {@link Uuid(0)|Uuid.NULL} is used if the entity is not parented.
* @property {Uuid} parentID=Uuid.NONE - The ID of the entity or avatar that the entity is parented to. A value of
* {@link Uuid(0)|Uuid.NONE} is used if the entity is not parented.
* @property {number} parentJointIndex=65535 - The joint of the entity or avatar that the entity is parented to. Use
* <code>65535</code> or <code>-1</code> to parent to the entity or avatar's position and orientation rather than a joint.
* @property {Vec3} localPosition=0,0,0 - The position of the entity relative to its parent if the entity is parented,
Expand Down Expand Up @@ -184,7 +184,7 @@
*
* @property {MirrorMode} mirrorMode="none" - If this entity should render as a mirror (reflecting the view of the camera),
* a portal (reflecting the view through its <code>portalExitID</code>), or normally.
* @property {Uuid} portalExitID=Uuid.NULL - The ID of the entity that should act as the portal exit if the <code>mirrorMode</code>
* @property {Uuid} portalExitID=Uuid.NONE - The ID of the entity that should act as the portal exit if the <code>mirrorMode</code>
* is set to <code>portal</code>.
*
* @comment The different entity types have additional properties as follows:
Expand Down Expand Up @@ -612,18 +612,18 @@
* JPG or PNG format. If no texture is specified the surfaces display white.
* @property {string} zTextureURL="" - The URL of the texture to map to surfaces perpendicular to the entity's local z-axis.
* JPG or PNG format. If no texture is specified the surfaces display white.
* @property {Uuid} xNNeighborID=Uuid.NULL - The ID of the neighboring PolyVox entity in the entity's -ve local x-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
* @property {Uuid} yNNeighborID=Uuid.NULL - The ID of the neighboring PolyVox entity in the entity's -ve local y-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
* @property {Uuid} zNNeighborID=Uuid.NULL - The ID of the neighboring PolyVox entity in the entity's -ve local z-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
* @property {Uuid} xPNeighborID=Uuid.NULL - The ID of the neighboring PolyVox entity in the entity's +ve local x-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
* @property {Uuid} yPNeighborID=Uuid.NULL - The ID of the neighboring PolyVox entity in the entity's +ve local y-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
* @property {Uuid} zPNeighborID=Uuid.NULL - The ID of the neighboring PolyVox entity in the entity's +ve local z-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NULL} if there is none or you don't want to join them.
* @property {Uuid} xNNeighborID=Uuid.NONE - The ID of the neighboring PolyVox entity in the entity's -ve local x-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NONE} if there is none or you don't want to join them.
* @property {Uuid} yNNeighborID=Uuid.NONE - The ID of the neighboring PolyVox entity in the entity's -ve local y-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NONE} if there is none or you don't want to join them.
* @property {Uuid} zNNeighborID=Uuid.NONE - The ID of the neighboring PolyVox entity in the entity's -ve local z-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NONE} if there is none or you don't want to join them.
* @property {Uuid} xPNeighborID=Uuid.NONE - The ID of the neighboring PolyVox entity in the entity's +ve local x-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NONE} if there is none or you don't want to join them.
* @property {Uuid} yPNeighborID=Uuid.NONE - The ID of the neighboring PolyVox entity in the entity's +ve local y-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NONE} if there is none or you don't want to join them.
* @property {Uuid} zPNeighborID=Uuid.NONE - The ID of the neighboring PolyVox entity in the entity's +ve local z-axis
* direction, if you want them joined. Set to {@link Uuid(0)|Uuid.NONE} if there is none or you don't want to join them.
* @example <caption>Create a textured PolyVox sphere.</caption>
* var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.5, z: -8 }));
* var texture = "http://public.highfidelity.com/cozza13/tuscany/Concrete2.jpg";
Expand Down
20 changes: 10 additions & 10 deletions libraries/entities/src/EntityScriptingInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class ParabolaToEntityIntersectionResult {
* @hifi-assignment-client
*
* @property {Uuid} keyboardFocusEntity - The {@link Entities.EntityProperties-Web|Web} entity that has keyboard focus. If no
* Web entity has keyboard focus, returns <code>null</code>; set to <code>null</code> or {@link Uuid(0)|Uuid.NULL} to clear
* Web entity has keyboard focus, returns <code>null</code>; set to <code>null</code> or {@link Uuid(0)|Uuid.NONE} to clear
* keyboard focus.
*/
/// handles scripting of Entity commands from JS passed to assigned clients
Expand Down Expand Up @@ -323,7 +323,7 @@ public slots:
* @param {Entities.EntityProperties} properties - The properties of the entity to create.
* @param {Entities.EntityHostType} [entityHostType="domain"] - The type of entity to create.
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid(0)|Uuid.NULL}.
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid(0)|Uuid.NONE}.
* @example <caption>Create a box domain entity in front of your avatar.</caption>
* var entityID = Entities.addEntity({
* type: "Box",
Expand Down Expand Up @@ -354,7 +354,7 @@ public slots:
* @param {Entities.EntityProperties} properties - The properties of the entity to create.
* @param {boolean} [avatarEntity=false] - <code>true</code> to create an avatar entity, <code>false</code> to create a
* domain entity.
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid(0)|Uuid.NULL}.
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid(0)|Uuid.NONE}.
*/
Q_INVOKABLE QUuid addEntity(const EntityItemProperties& properties, bool avatarEntity = false) {
entity::HostType entityHostType = avatarEntity ? entity::HostType::AVATAR : entity::HostType::DOMAIN;
Expand All @@ -378,7 +378,7 @@ public slots:
* <code>true</code> in order to be cloned.</p>
* @function Entities.cloneEntity
* @param {Uuid} entityID - The ID of the entity to clone.
* @returns {Uuid} The ID of the new entity if successfully cloned, otherwise {@link Uuid(0)|Uuid.NULL}.
* @returns {Uuid} The ID of the new entity if successfully cloned, otherwise {@link Uuid(0)|Uuid.NONE}.
*/
Q_INVOKABLE QUuid cloneEntity(const QUuid& entityID);

Expand Down Expand Up @@ -429,7 +429,7 @@ public slots:
* @function Entities.editEntity
* @param {Uuid} entityID - The ID of the entity to edit.
* @param {Entities.EntityProperties} properties - The new property values.
* @returns {Uuid} The ID of the entity if the edit was successful, otherwise <code>null</code> or {@link Uuid|Uuid.NULL}.
* @returns {Uuid} The ID of the entity if the edit was successful, otherwise <code>null</code> or {@link Uuid|Uuid.NONE}.
* @example <caption>Change the color of an entity.</caption>
* var entityID = Entities.addEntity({
* type: "Box",
Expand Down Expand Up @@ -1681,7 +1681,7 @@ public slots:
* }
*
* var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 2, z: -5 }));
* var root = createEntity("Root", position, Uuid.NULL);
* var root = createEntity("Root", position, Uuid.NONE);
* var child = createEntity("Child", Vec3.sum(position, { x: 0, y: -1, z: 0 }), root);
* var grandChild = createEntity("Grandchild", Vec3.sum(position, { x: 0, y: -2, z: 0 }), child);
*
Expand Down Expand Up @@ -1713,7 +1713,7 @@ public slots:
* }
*
* var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 2, z: -5 }));
* var root = createEntity("Root", position, Uuid.NULL);
* var root = createEntity("Root", position, Uuid.NONE);
* var child = createEntity("Child", Vec3.sum(position, { x: 0, y: -1, z: 0 }), root);
*
* Script.setTimeout(function () { // Wait for the entity to be created before editing.
Expand Down Expand Up @@ -1749,7 +1749,7 @@ public slots:
* }
*
* var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 2, z: -5 }));
* var root = createEntity("Root", position, Uuid.NULL);
* var root = createEntity("Root", position, Uuid.NONE);
* var child = createEntity("Child", Vec3.sum(position, { x: 0, y: -1, z: 0 }), root);
* var grandChild = createEntity("Grandchild", Vec3.sum(position, { x: 0, y: -2, z: 0 }), child);
*
Expand Down Expand Up @@ -1785,7 +1785,7 @@ public slots:
* Sets the {@link Entities.EntityProperties-Web|Web} entity that has keyboard focus.
* @function Entities.setKeyboardFocusEntity
* @param {Uuid} id - The ID of the {@link Entities.EntityProperties-Web|Web} entity to set keyboard focus to. Use
* <code>null</code> or {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an entity.
* <code>null</code> or {@link Uuid(0)|Uuid.NONE} to unset keyboard focus from an entity.
*/
Q_INVOKABLE void setKeyboardFocusEntity(const QUuid& id);

Expand Down Expand Up @@ -2017,7 +2017,7 @@ public slots:
*
* var position = Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 2, z: -5 }));
*
* var parent = createEntity(position, MyAvatar.orientation, Uuid.NULL);
* var parent = createEntity(position, MyAvatar.orientation, Uuid.NONE);
*
* var childTranslation = { x: 0, y: -1.5, z: 0 };
* var childRotation = Quat.fromPitchYawRollDegrees(0, 45, 0);
Expand Down
6 changes: 3 additions & 3 deletions libraries/networking/src/AddressManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const QString GET_PLACE = "/api/v1/places/%1";
* @hifi-avatar
* @hifi-assignment-client
*
* @property {Uuid} domainID - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid(0)|Uuid.NULL} if you're not
* @property {Uuid} domainID - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid(0)|Uuid.NONE} if you're not
* connected to the domain or are in a serverless domain.
* <em>Read-only.</em>
* @property {string} hostname - The name of the domain for your current directory services address (e.g., <code>"DomainName"</code>,
Expand Down Expand Up @@ -83,7 +83,7 @@ const QString GET_PLACE = "/api/v1/places/%1";
* @deprecated This API is deprecated and will be removed. Use the {@link location} or {@link Window|Window.location} APIs
* instead.
*
* @property {Uuid} domainID - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid(0)|Uuid.NULL} if you're not
* @property {Uuid} domainID - A UUID uniquely identifying the domain you're visiting. Is {@link Uuid(0)|Uuid.NONE} if you're not
* connected to the domain or are in a serverless domain.
* <em>Read-only.</em>
* @property {string} hostname - The name of the domain for your current directory services address (e.g., <code>"DomainName"</code>,
Expand Down Expand Up @@ -397,7 +397,7 @@ public slots:
* Triggered when a request is made to go to a URL or IP address.
* @function location.possibleDomainChangeRequired
* @param {string} domainURL - The URL of the domain.
* @param {Uuid} domainID - The UUID of the domain to go to. May be {@link Uuid|Uuid.NULL} if not yet known.
* @param {Uuid} domainID - The UUID of the domain to go to. May be {@link Uuid|Uuid.NONE} if not yet known.
* @returns {Signal}
*/
// No example because this function isn't typically used in scripts.
Expand Down
4 changes: 2 additions & 2 deletions libraries/script-engine/src/ScriptManagerScriptingInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ class ScriptManagerScriptingInterface : public QObject {
* @param {Uuid} entityID - The ID of the entity running the entity script.
* @param {string} methodName - The name of the method to call.
* @param {string[]} [parameters=[]] - The parameters to call the specified method with.
* @param {Uuid} [remoteCallerID=Uuid.NULL] - An ID that identifies the caller.
* @param {Uuid} [remoteCallerID=Uuid.NONE] - An ID that identifies the caller.
*/
Q_INVOKABLE void callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName,
const QStringList& params = QStringList(),
Expand Down Expand Up @@ -740,7 +740,7 @@ class ScriptManagerScriptingInterface : public QObject {
* @returns {Signal}
* @example <caption>Get the ID of the entity that a client entity script is running in.</caption>
* var entityScript = function () {
* this.entityID = Uuid.NULL;
* this.entityID = Uuid.NONE;
* };
*
* Script.entityScriptPreloadFinished.connect(function (entityID) {
Expand Down
Loading

0 comments on commit 1576351

Please sign in to comment.