@wiredsnippets/wsproom 0.0.0-stage → 2.0.0
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/COPYING +674 -0
- package/COPYING.LESSER +165 -0
- package/README.md +76 -2
- package/dist/__mocks__/setupTests.d.ts +0 -0
- package/dist/__mocks__/setupTests.js +34 -0
- package/dist/assets/IAssetBundle.d.ts +4 -0
- package/dist/assets/IAssetBundle.js +2 -0
- package/dist/assets/LegacyAssetBundle.d.ts +9 -0
- package/dist/assets/LegacyAssetBundle.js +29 -0
- package/dist/assets/WsproomAssetBundle.d.ts +18 -0
- package/dist/assets/WsproomAssetBundle.js +86 -0
- package/dist/data/XmlData.d.ts +6 -0
- package/dist/data/XmlData.js +15 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.js +73 -0
- package/dist/interfaces/IAnimationTicker.d.ts +4 -0
- package/dist/interfaces/IAnimationTicker.js +2 -0
- package/dist/interfaces/IAvatarLoader.d.ts +12 -0
- package/dist/interfaces/IAvatarLoader.js +2 -0
- package/dist/interfaces/IConfiguration.d.ts +13 -0
- package/dist/interfaces/IConfiguration.js +2 -0
- package/dist/interfaces/IFurnitureData.d.ts +13 -0
- package/dist/interfaces/IFurnitureData.js +2 -0
- package/dist/interfaces/IFurnitureLoader.d.ts +13 -0
- package/dist/interfaces/IFurnitureLoader.js +2 -0
- package/dist/interfaces/IHitDetection.d.ts +0 -0
- package/dist/interfaces/IHitDetection.js +1 -0
- package/dist/interfaces/IRoomContext.d.ts +26 -0
- package/dist/interfaces/IRoomContext.js +2 -0
- package/dist/interfaces/IRoomGeometry.d.ts +6 -0
- package/dist/interfaces/IRoomGeometry.js +2 -0
- package/dist/interfaces/IRoomObject.d.ts +5 -0
- package/dist/interfaces/IRoomObject.js +2 -0
- package/dist/interfaces/IRoomObjectContainer.d.ts +5 -0
- package/dist/interfaces/IRoomObjectContainer.js +2 -0
- package/dist/interfaces/IRoomVisualization.d.ts +25 -0
- package/dist/interfaces/IRoomVisualization.js +2 -0
- package/dist/interfaces/ITextureable.d.ts +5 -0
- package/dist/interfaces/ITextureable.js +2 -0
- package/dist/interfaces/ITileMap.d.ts +5 -0
- package/dist/interfaces/ITileMap.js +2 -0
- package/dist/objects/RoomObject.d.ts +24 -0
- package/dist/objects/RoomObject.js +69 -0
- package/dist/objects/Wsproom.d.ts +22 -0
- package/dist/objects/Wsproom.js +86 -0
- package/dist/objects/animation/AnimationTicker.d.ts +13 -0
- package/dist/objects/animation/AnimationTicker.js +37 -0
- package/dist/objects/animation/ObjectAnimation.d.ts +36 -0
- package/dist/objects/animation/ObjectAnimation.js +93 -0
- package/dist/objects/avatar/Avatar.d.ts +244 -0
- package/dist/objects/avatar/Avatar.js +548 -0
- package/dist/objects/avatar/AvatarAssetLibraryCollection.d.ts +20 -0
- package/dist/objects/avatar/AvatarAssetLibraryCollection.js +70 -0
- package/dist/objects/avatar/AvatarEffectBundle.d.ts +15 -0
- package/dist/objects/avatar/AvatarEffectBundle.js +34 -0
- package/dist/objects/avatar/AvatarLoader.d.ts +33 -0
- package/dist/objects/avatar/AvatarLoader.js +218 -0
- package/dist/objects/avatar/BaseAvatar.d.ts +84 -0
- package/dist/objects/avatar/BaseAvatar.js +386 -0
- package/dist/objects/avatar/data/AvatarActionsData.d.ts +12 -0
- package/dist/objects/avatar/data/AvatarActionsData.js +84 -0
- package/dist/objects/avatar/data/AvatarAnimationData.d.ts +14 -0
- package/dist/objects/avatar/data/AvatarAnimationData.js +126 -0
- package/dist/objects/avatar/data/AvatarData.d.ts +6 -0
- package/dist/objects/avatar/data/AvatarData.js +15 -0
- package/dist/objects/avatar/data/AvatarEffectData.d.ts +31 -0
- package/dist/objects/avatar/data/AvatarEffectData.js +186 -0
- package/dist/objects/avatar/data/AvatarEffectMap.d.ts +9 -0
- package/dist/objects/avatar/data/AvatarEffectMap.js +38 -0
- package/dist/objects/avatar/data/AvatarGeometryData.d.ts +17 -0
- package/dist/objects/avatar/data/AvatarGeometryData.js +122 -0
- package/dist/objects/avatar/data/AvatarManifestData.d.ts +12 -0
- package/dist/objects/avatar/data/AvatarManifestData.js +55 -0
- package/dist/objects/avatar/data/AvatarOffsetsData.d.ts +10 -0
- package/dist/objects/avatar/data/AvatarOffsetsData.js +17 -0
- package/dist/objects/avatar/data/AvatarPartSetsData.d.ts +12 -0
- package/dist/objects/avatar/data/AvatarPartSetsData.js +38 -0
- package/dist/objects/avatar/data/FigureData.d.ts +14 -0
- package/dist/objects/avatar/data/FigureData.js +106 -0
- package/dist/objects/avatar/data/FigureMapData.d.ts +11 -0
- package/dist/objects/avatar/data/FigureMapData.js +47 -0
- package/dist/objects/avatar/data/ManifestLibrary.d.ts +12 -0
- package/dist/objects/avatar/data/ManifestLibrary.js +29 -0
- package/dist/objects/avatar/data/interfaces/IAvatarActionsData.d.ts +18 -0
- package/dist/objects/avatar/data/interfaces/IAvatarActionsData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IAvatarAnimationData.d.ts +10 -0
- package/dist/objects/avatar/data/interfaces/IAvatarAnimationData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IAvatarEffectBundle.d.ts +9 -0
- package/dist/objects/avatar/data/interfaces/IAvatarEffectBundle.js +2 -0
- package/dist/objects/avatar/data/interfaces/IAvatarEffectData.d.ts +49 -0
- package/dist/objects/avatar/data/interfaces/IAvatarEffectData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IAvatarEffectMap.d.ts +9 -0
- package/dist/objects/avatar/data/interfaces/IAvatarEffectMap.js +2 -0
- package/dist/objects/avatar/data/interfaces/IAvatarGeometryData.d.ts +23 -0
- package/dist/objects/avatar/data/interfaces/IAvatarGeometryData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IAvatarManifestData.d.ts +18 -0
- package/dist/objects/avatar/data/interfaces/IAvatarManifestData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IAvatarOffsetsData.d.ts +6 -0
- package/dist/objects/avatar/data/interfaces/IAvatarOffsetsData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IAvatarPartSetsData.d.ts +7 -0
- package/dist/objects/avatar/data/interfaces/IAvatarPartSetsData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IFigureData.d.ts +11 -0
- package/dist/objects/avatar/data/interfaces/IFigureData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IFigureMapData.d.ts +4 -0
- package/dist/objects/avatar/data/interfaces/IFigureMapData.js +2 -0
- package/dist/objects/avatar/data/interfaces/IManifestLibrary.d.ts +6 -0
- package/dist/objects/avatar/data/interfaces/IManifestLibrary.js +2 -0
- package/dist/objects/avatar/data/static/actions.xml.d.ts +1 -0
- package/dist/objects/avatar/data/static/actions.xml.js +4 -0
- package/dist/objects/avatar/data/static/animation.xml.d.ts +1 -0
- package/dist/objects/avatar/data/static/animation.xml.js +4 -0
- package/dist/objects/avatar/data/static/geometry.xml.d.ts +1 -0
- package/dist/objects/avatar/data/static/geometry.xml.js +4 -0
- package/dist/objects/avatar/data/static/partsets.xml.d.ts +1 -0
- package/dist/objects/avatar/data/static/partsets.xml.js +4 -0
- package/dist/objects/avatar/enum/AvatarAction.d.ts +29 -0
- package/dist/objects/avatar/enum/AvatarAction.js +33 -0
- package/dist/objects/avatar/enum/AvatarFigurePartType.d.ts +27 -0
- package/dist/objects/avatar/enum/AvatarFigurePartType.js +31 -0
- package/dist/objects/avatar/structure/AvatarAdditionPart.d.ts +32 -0
- package/dist/objects/avatar/structure/AvatarAdditionPart.js +136 -0
- package/dist/objects/avatar/structure/AvatarBodyPart.d.ts +30 -0
- package/dist/objects/avatar/structure/AvatarBodyPart.js +96 -0
- package/dist/objects/avatar/structure/AvatarBodyPartList.d.ts +36 -0
- package/dist/objects/avatar/structure/AvatarBodyPartList.js +91 -0
- package/dist/objects/avatar/structure/AvatarDrawDefinition.d.ts +39 -0
- package/dist/objects/avatar/structure/AvatarDrawDefinition.js +135 -0
- package/dist/objects/avatar/structure/AvatarEffectPart.d.ts +25 -0
- package/dist/objects/avatar/structure/AvatarEffectPart.js +118 -0
- package/dist/objects/avatar/structure/AvatarPart.d.ts +54 -0
- package/dist/objects/avatar/structure/AvatarPart.js +162 -0
- package/dist/objects/avatar/structure/AvatarPartList.d.ts +30 -0
- package/dist/objects/avatar/structure/AvatarPartList.js +80 -0
- package/dist/objects/avatar/structure/BodyPartDrawOrder.d.ts +3 -0
- package/dist/objects/avatar/structure/BodyPartDrawOrder.js +170 -0
- package/dist/objects/avatar/structure/interface/IAvatarDrawablePart.d.ts +4 -0
- package/dist/objects/avatar/structure/interface/IAvatarDrawablePart.js +2 -0
- package/dist/objects/avatar/structure/interface/IAvatarEffectPart.d.ts +7 -0
- package/dist/objects/avatar/structure/interface/IAvatarEffectPart.js +2 -0
- package/dist/objects/avatar/types/index.d.ts +43 -0
- package/dist/objects/avatar/types/index.js +2 -0
- package/dist/objects/avatar/util/createLookServer.d.ts +18 -0
- package/dist/objects/avatar/util/createLookServer.js +18 -0
- package/dist/objects/avatar/util/getAssetForFrame.d.ts +21 -0
- package/dist/objects/avatar/util/getAssetForFrame.js +42 -0
- package/dist/objects/avatar/util/getAssetFromPartMeta.d.ts +30 -0
- package/dist/objects/avatar/util/getAssetFromPartMeta.js +50 -0
- package/dist/objects/avatar/util/getAvatarDirection.d.ts +1 -0
- package/dist/objects/avatar/util/getAvatarDirection.js +18 -0
- package/dist/objects/avatar/util/getAvatarDrawDefinition.d.ts +22 -0
- package/dist/objects/avatar/util/getAvatarDrawDefinition.js +31 -0
- package/dist/objects/avatar/util/getDrawOrderForActions.d.ts +4 -0
- package/dist/objects/avatar/util/getDrawOrderForActions.js +22 -0
- package/dist/objects/avatar/util/getEffectSprite.d.ts +9 -0
- package/dist/objects/avatar/util/getEffectSprite.js +27 -0
- package/dist/objects/avatar/util/getFlippedMetaData.d.ts +36 -0
- package/dist/objects/avatar/util/getFlippedMetaData.js +95 -0
- package/dist/objects/avatar/util/getLibrariesForLook.d.ts +7 -0
- package/dist/objects/avatar/util/getLibrariesForLook.js +32 -0
- package/dist/objects/avatar/util/index.d.ts +1 -0
- package/dist/objects/avatar/util/index.js +17 -0
- package/dist/objects/avatar/util/parseLookString.d.ts +5 -0
- package/dist/objects/avatar/util/parseLookString.js +15 -0
- package/dist/objects/events/EventEmitter.d.ts +11 -0
- package/dist/objects/events/EventEmitter.js +31 -0
- package/dist/objects/events/EventManager.d.ts +27 -0
- package/dist/objects/events/EventManager.js +248 -0
- package/dist/objects/events/EventManagerContainer.d.ts +11 -0
- package/dist/objects/events/EventManagerContainer.js +36 -0
- package/dist/objects/events/EventManagerNode.d.ts +16 -0
- package/dist/objects/events/EventManagerNode.js +55 -0
- package/dist/objects/events/EventOverOutHandler.d.ts +24 -0
- package/dist/objects/events/EventOverOutHandler.js +90 -0
- package/dist/objects/events/interfaces/IEventGroup.d.ts +7 -0
- package/dist/objects/events/interfaces/IEventGroup.js +6 -0
- package/dist/objects/events/interfaces/IEventHandler.d.ts +9 -0
- package/dist/objects/events/interfaces/IEventHandler.js +2 -0
- package/dist/objects/events/interfaces/IEventHittable.d.ts +9 -0
- package/dist/objects/events/interfaces/IEventHittable.js +2 -0
- package/dist/objects/events/interfaces/IEventManager.d.ts +8 -0
- package/dist/objects/events/interfaces/IEventManager.js +2 -0
- package/dist/objects/events/interfaces/IEventManagerEvent.d.ts +11 -0
- package/dist/objects/events/interfaces/IEventManagerEvent.js +2 -0
- package/dist/objects/events/interfaces/IEventManagerNode.d.ts +3 -0
- package/dist/objects/events/interfaces/IEventManagerNode.js +2 -0
- package/dist/objects/events/interfaces/IEventTarget.d.ts +4 -0
- package/dist/objects/events/interfaces/IEventTarget.js +2 -0
- package/dist/objects/furniture/BaseFurniture.d.ts +152 -0
- package/dist/objects/furniture/BaseFurniture.js +519 -0
- package/dist/objects/furniture/FloorFurniture.d.ts +163 -0
- package/dist/objects/furniture/FloorFurniture.js +320 -0
- package/dist/objects/furniture/FurnitureData.d.ts +14 -0
- package/dist/objects/furniture/FurnitureData.js +73 -0
- package/dist/objects/furniture/FurnitureExtraData.d.ts +4 -0
- package/dist/objects/furniture/FurnitureExtraData.js +2 -0
- package/dist/objects/furniture/FurnitureFetchInfo.d.ts +5 -0
- package/dist/objects/furniture/FurnitureFetchInfo.js +2 -0
- package/dist/objects/furniture/FurnitureHelper.d.ts +17 -0
- package/dist/objects/furniture/FurnitureHelper.js +90 -0
- package/dist/objects/furniture/FurnitureLoader.d.ts +22 -0
- package/dist/objects/furniture/FurnitureLoader.js +85 -0
- package/dist/objects/furniture/FurnitureRoomVisualization.d.ts +10 -0
- package/dist/objects/furniture/FurnitureRoomVisualization.js +26 -0
- package/dist/objects/furniture/FurnitureSprite.d.ts +25 -0
- package/dist/objects/furniture/FurnitureSprite.js +69 -0
- package/dist/objects/furniture/FurnitureVisualizationView.d.ts +66 -0
- package/dist/objects/furniture/FurnitureVisualizationView.js +482 -0
- package/dist/objects/furniture/IFurniture.d.ts +26 -0
- package/dist/objects/furniture/IFurniture.js +2 -0
- package/dist/objects/furniture/IFurnitureAssetBundle.d.ts +12 -0
- package/dist/objects/furniture/IFurnitureAssetBundle.js +2 -0
- package/dist/objects/furniture/IFurnitureVisualization.d.ts +11 -0
- package/dist/objects/furniture/IFurnitureVisualization.js +2 -0
- package/dist/objects/furniture/IFurnitureVisualizationView.d.ts +63 -0
- package/dist/objects/furniture/IFurnitureVisualizationView.js +2 -0
- package/dist/objects/furniture/JsonFurnitureAssetBundle.d.ts +18 -0
- package/dist/objects/furniture/JsonFurnitureAssetBundle.js +89 -0
- package/dist/objects/furniture/WallFurniture.d.ts +90 -0
- package/dist/objects/furniture/WallFurniture.js +229 -0
- package/dist/objects/furniture/XmlFurnitureAssetBundle.d.ts +17 -0
- package/dist/objects/furniture/XmlFurnitureAssetBundle.js +35 -0
- package/dist/objects/furniture/data/FurnitureAssetsData.d.ts +11 -0
- package/dist/objects/furniture/data/FurnitureAssetsData.js +51 -0
- package/dist/objects/furniture/data/FurnitureAssetsJson.d.ts +4 -0
- package/dist/objects/furniture/data/FurnitureAssetsJson.js +2 -0
- package/dist/objects/furniture/data/FurnitureIndexData.d.ts +14 -0
- package/dist/objects/furniture/data/FurnitureIndexData.js +30 -0
- package/dist/objects/furniture/data/FurnitureIndexJson.d.ts +4 -0
- package/dist/objects/furniture/data/FurnitureIndexJson.js +2 -0
- package/dist/objects/furniture/data/FurnitureJson.d.ts +11 -0
- package/dist/objects/furniture/data/FurnitureJson.js +2 -0
- package/dist/objects/furniture/data/FurnitureLogicData.d.ts +10 -0
- package/dist/objects/furniture/data/FurnitureLogicData.js +43 -0
- package/dist/objects/furniture/data/FurnitureLogicJson.d.ts +3 -0
- package/dist/objects/furniture/data/FurnitureLogicJson.js +2 -0
- package/dist/objects/furniture/data/FurnitureVisualizationData.d.ts +26 -0
- package/dist/objects/furniture/data/FurnitureVisualizationData.js +281 -0
- package/dist/objects/furniture/data/FurnitureVisualizationJson.d.ts +37 -0
- package/dist/objects/furniture/data/FurnitureVisualizationJson.js +2 -0
- package/dist/objects/furniture/data/JsonFurnitureAssetsData.d.ts +8 -0
- package/dist/objects/furniture/data/JsonFurnitureAssetsData.js +16 -0
- package/dist/objects/furniture/data/JsonFurnitureLogicData.d.ts +7 -0
- package/dist/objects/furniture/data/JsonFurnitureLogicData.js +12 -0
- package/dist/objects/furniture/data/JsonFurnitureVisualizationData.d.ts +18 -0
- package/dist/objects/furniture/data/JsonFurnitureVisualizationData.js +95 -0
- package/dist/objects/furniture/data/interfaces/IFurnitureAssetsData.d.ts +12 -0
- package/dist/objects/furniture/data/interfaces/IFurnitureAssetsData.js +2 -0
- package/dist/objects/furniture/data/interfaces/IFurnitureIndexData.d.ts +4 -0
- package/dist/objects/furniture/data/interfaces/IFurnitureIndexData.js +2 -0
- package/dist/objects/furniture/data/interfaces/IFurnitureLogicData.d.ts +13 -0
- package/dist/objects/furniture/data/interfaces/IFurnitureLogicData.js +2 -0
- package/dist/objects/furniture/data/interfaces/IFurnitureVisualizationData.d.ts +37 -0
- package/dist/objects/furniture/data/interfaces/IFurnitureVisualizationData.js +2 -0
- package/dist/objects/furniture/filter/ActiveWiredFilter.d.ts +4 -0
- package/dist/objects/furniture/filter/ActiveWiredFilter.js +77 -0
- package/dist/objects/furniture/filter/HighlightFilter.d.ts +6 -0
- package/dist/objects/furniture/filter/HighlightFilter.js +93 -0
- package/dist/objects/furniture/filter/filterVertex.d.ts +1 -0
- package/dist/objects/furniture/filter/filterVertex.js +32 -0
- package/dist/objects/furniture/util/DrawDefinition.d.ts +18 -0
- package/dist/objects/furniture/util/DrawDefinition.js +2 -0
- package/dist/objects/furniture/util/IFurnitureEventHandlers.d.ts +9 -0
- package/dist/objects/furniture/util/IFurnitureEventHandlers.js +2 -0
- package/dist/objects/furniture/util/getDirectionForFurniture.d.ts +1 -0
- package/dist/objects/furniture/util/getDirectionForFurniture.js +18 -0
- package/dist/objects/furniture/util/getFurniDrawDefinition.d.ts +14 -0
- package/dist/objects/furniture/util/getFurniDrawDefinition.js +101 -0
- package/dist/objects/furniture/util/getFurnitureFetch.d.ts +3 -0
- package/dist/objects/furniture/util/getFurnitureFetch.js +14 -0
- package/dist/objects/furniture/util/index.d.ts +4 -0
- package/dist/objects/furniture/util/index.js +21 -0
- package/dist/objects/furniture/util/loadFurni.d.ts +20 -0
- package/dist/objects/furniture/util/loadFurni.js +49 -0
- package/dist/objects/furniture/util/visualization/VisualizationXml.d.ts +73 -0
- package/dist/objects/furniture/util/visualization/VisualizationXml.js +2 -0
- package/dist/objects/furniture/util/visualization/parseAnimations.d.ts +10 -0
- package/dist/objects/furniture/util/visualization/parseAnimations.js +35 -0
- package/dist/objects/furniture/util/visualization/parseColors.d.ts +2 -0
- package/dist/objects/furniture/util/visualization/parseColors.js +19 -0
- package/dist/objects/furniture/util/visualization/parseDirections.d.ts +5 -0
- package/dist/objects/furniture/util/visualization/parseDirections.js +27 -0
- package/dist/objects/furniture/util/visualization/parseLayers.d.ts +9 -0
- package/dist/objects/furniture/util/visualization/parseLayers.js +19 -0
- package/dist/objects/furniture/util/visualization/parseVisualization.d.ts +17 -0
- package/dist/objects/furniture/util/visualization/parseVisualization.js +44 -0
- package/dist/objects/furniture/visualization/AnimatedFurnitureVisualization.d.ts +40 -0
- package/dist/objects/furniture/visualization/AnimatedFurnitureVisualization.js +214 -0
- package/dist/objects/furniture/visualization/BasicFurnitureVisualization.d.ts +19 -0
- package/dist/objects/furniture/visualization/BasicFurnitureVisualization.js +54 -0
- package/dist/objects/furniture/visualization/FurnitureBottleVisualization.d.ts +17 -0
- package/dist/objects/furniture/visualization/FurnitureBottleVisualization.js +65 -0
- package/dist/objects/furniture/visualization/FurnitureGuildCustomizedVisualization.d.ts +28 -0
- package/dist/objects/furniture/visualization/FurnitureGuildCustomizedVisualization.js +87 -0
- package/dist/objects/furniture/visualization/FurnitureVisualization.d.ts +16 -0
- package/dist/objects/furniture/visualization/FurnitureVisualization.js +24 -0
- package/dist/objects/hitdetection/ClickHandler.d.ts +25 -0
- package/dist/objects/hitdetection/ClickHandler.js +79 -0
- package/dist/objects/hitdetection/HitSprite.d.ts +65 -0
- package/dist/objects/hitdetection/HitSprite.js +223 -0
- package/dist/objects/hitdetection/HitTexture.d.ts +21 -0
- package/dist/objects/hitdetection/HitTexture.js +153 -0
- package/dist/objects/interfaces/IMoveable.d.ts +4 -0
- package/dist/objects/interfaces/IMoveable.js +2 -0
- package/dist/objects/interfaces/IScreenPositioned.d.ts +6 -0
- package/dist/objects/interfaces/IScreenPositioned.js +2 -0
- package/dist/objects/room/ILandscapeContainer.d.ts +6 -0
- package/dist/objects/room/ILandscapeContainer.js +2 -0
- package/dist/objects/room/IRoomRectangle.d.ts +9 -0
- package/dist/objects/room/IRoomRectangle.js +2 -0
- package/dist/objects/room/ITileColorable.d.ts +7 -0
- package/dist/objects/room/ITileColorable.js +2 -0
- package/dist/objects/room/IWallColorable.d.ts +7 -0
- package/dist/objects/room/IWallColorable.js +2 -0
- package/dist/objects/room/Landscape.d.ts +92 -0
- package/dist/objects/room/Landscape.js +389 -0
- package/dist/objects/room/ParsedTileMap.d.ts +14 -0
- package/dist/objects/room/ParsedTileMap.js +26 -0
- package/dist/objects/room/Pathfinding.d.ts +31 -0
- package/dist/objects/room/Pathfinding.js +241 -0
- package/dist/objects/room/Room.d.ts +182 -0
- package/dist/objects/room/Room.js +394 -0
- package/dist/objects/room/RoomCamera.d.ts +56 -0
- package/dist/objects/room/RoomCamera.js +358 -0
- package/dist/objects/room/RoomLandscapeMaskSprite.d.ts +38 -0
- package/dist/objects/room/RoomLandscapeMaskSprite.js +100 -0
- package/dist/objects/room/RoomModelVisualization.d.ts +132 -0
- package/dist/objects/room/RoomModelVisualization.js +561 -0
- package/dist/objects/room/RoomObjectContainer.d.ts +12 -0
- package/dist/objects/room/RoomObjectContainer.js +35 -0
- package/dist/objects/room/TileMapEditorLayer.d.ts +44 -0
- package/dist/objects/room/TileMapEditorLayer.js +331 -0
- package/dist/objects/room/data/LandscapeData.d.ts +26 -0
- package/dist/objects/room/data/LandscapeData.js +132 -0
- package/dist/objects/room/matrixes.d.ts +9 -0
- package/dist/objects/room/matrixes.js +35 -0
- package/dist/objects/room/parts/IRoomPart.d.ts +4 -0
- package/dist/objects/room/parts/IRoomPart.js +2 -0
- package/dist/objects/room/parts/RoomPartData.d.ts +15 -0
- package/dist/objects/room/parts/RoomPartData.js +2 -0
- package/dist/objects/room/parts/Stair.d.ts +23 -0
- package/dist/objects/room/parts/Stair.js +127 -0
- package/dist/objects/room/parts/StairCorner.d.ts +22 -0
- package/dist/objects/room/parts/StairCorner.js +192 -0
- package/dist/objects/room/parts/Tile.d.ts +33 -0
- package/dist/objects/room/parts/Tile.js +138 -0
- package/dist/objects/room/parts/TileCursor.d.ts +43 -0
- package/dist/objects/room/parts/TileCursor.js +193 -0
- package/dist/objects/room/parts/WallLeft.d.ts +47 -0
- package/dist/objects/room/parts/WallLeft.js +179 -0
- package/dist/objects/room/parts/WallOuterCorner.d.ts +16 -0
- package/dist/objects/room/parts/WallOuterCorner.js +84 -0
- package/dist/objects/room/parts/WallRight.d.ts +5 -0
- package/dist/objects/room/parts/WallRight.js +18 -0
- package/dist/objects/room/util/LegacyWallGeometry.d.ts +33 -0
- package/dist/objects/room/util/LegacyWallGeometry.js +93 -0
- package/dist/objects/room/util/createPlaneMatrix.d.ts +26 -0
- package/dist/objects/room/util/createPlaneMatrix.js +63 -0
- package/dist/objects/room/util/getMaskId.d.ts +1 -0
- package/dist/objects/room/util/getMaskId.js +13 -0
- package/dist/objects/room/util/getPosition.d.ts +7 -0
- package/dist/objects/room/util/getPosition.js +14 -0
- package/dist/objects/room/util/getTileColors.d.ts +10 -0
- package/dist/objects/room/util/getTileColors.js +34 -0
- package/dist/objects/room/util/getTileMapBounds.d.ts +10 -0
- package/dist/objects/room/util/getTileMapBounds.js +40 -0
- package/dist/objects/room/util/getTilePosition.d.ts +2 -0
- package/dist/objects/room/util/getTilePosition.js +42 -0
- package/dist/objects/room/util/getTilePositionForTile.d.ts +11 -0
- package/dist/objects/room/util/getTilePositionForTile.js +11 -0
- package/dist/types/RoomPosition.d.ts +44 -0
- package/dist/types/RoomPosition.js +2 -0
- package/dist/types/TileType.d.ts +2 -0
- package/dist/types/TileType.js +2 -0
- package/dist/types/WallPosition.d.ts +23 -0
- package/dist/types/WallPosition.js +2 -0
- package/dist/types/types.d.ts +0 -0
- package/dist/types/types.js +1 -0
- package/dist/util/applyTextureProperties.d.ts +2 -0
- package/dist/util/applyTextureProperties.js +6 -0
- package/dist/util/associateBy.d.ts +1 -0
- package/dist/util/associateBy.js +11 -0
- package/dist/util/furnitureDataTransformers.d.ts +27 -0
- package/dist/util/furnitureDataTransformers.js +58 -0
- package/dist/util/getIntFromHex.d.ts +1 -0
- package/dist/util/getIntFromHex.js +6 -0
- package/dist/util/getNumberFromAttribute.d.ts +1 -0
- package/dist/util/getNumberFromAttribute.js +11 -0
- package/dist/util/getTileInfo.d.ts +31 -0
- package/dist/util/getTileInfo.js +107 -0
- package/dist/util/getZOrder.d.ts +1 -0
- package/dist/util/getZOrder.js +6 -0
- package/dist/util/isPointInside.d.ts +1 -0
- package/dist/util/isPointInside.js +18 -0
- package/dist/util/isSetEqual.d.ts +1 -0
- package/dist/util/isSetEqual.js +11 -0
- package/dist/util/isTile.d.ts +1 -0
- package/dist/util/isTile.js +5 -0
- package/dist/util/loadImageFromBlob.d.ts +1 -0
- package/dist/util/loadImageFromBlob.js +13 -0
- package/dist/util/loadImageFromUrl.d.ts +1 -0
- package/dist/util/loadImageFromUrl.js +14 -0
- package/dist/util/loadRoomTexture.d.ts +2 -0
- package/dist/util/loadRoomTexture.js +51 -0
- package/dist/util/mock.d.ts +1 -0
- package/dist/util/mock.js +6 -0
- package/dist/util/notNullOrUndefined.d.ts +1 -0
- package/dist/util/notNullOrUndefined.js +6 -0
- package/dist/util/parseTileMap.d.ts +49 -0
- package/dist/util/parseTileMap.js +188 -0
- package/dist/util/parseTileMapString.d.ts +2 -0
- package/dist/util/parseTileMapString.js +16 -0
- package/dist/util/tilemap/findEntranceTile.d.ts +5 -0
- package/dist/util/tilemap/findEntranceTile.js +24 -0
- package/dist/util/tilemap/getColumnWalls.d.ts +8 -0
- package/dist/util/tilemap/getColumnWalls.js +43 -0
- package/dist/util/tilemap/getRowWalls.d.ts +8 -0
- package/dist/util/tilemap/getRowWalls.js +43 -0
- package/dist/util/tilemap/hasWallTiles.d.ts +2 -0
- package/dist/util/tilemap/hasWallTiles.js +9 -0
- package/dist/util/tilemap/padTileMap.d.ts +6 -0
- package/dist/util/tilemap/padTileMap.js +24 -0
- package/dist/util/tilemap/traceWalls.d.ts +25 -0
- package/dist/util/tilemap/traceWalls.js +379 -0
- package/dist/util/tilemap/wallsFromContour.d.ts +20 -0
- package/dist/util/tilemap/wallsFromContour.js +48 -0
- package/dist/util/traverseDOMTree.d.ts +4 -0
- package/dist/util/traverseDOMTree.js +8 -0
- package/dist-esm/__mocks__/setupTests.js +34 -0
- package/dist-esm/assets/IAssetBundle.js +1 -0
- package/dist-esm/assets/LegacyAssetBundle.js +25 -0
- package/dist-esm/assets/WsproomAssetBundle.js +79 -0
- package/dist-esm/data/XmlData.js +11 -0
- package/dist-esm/index.js +33 -0
- package/dist-esm/interfaces/IAnimationTicker.js +1 -0
- package/dist-esm/interfaces/IAvatarLoader.js +1 -0
- package/dist-esm/interfaces/IConfiguration.js +1 -0
- package/dist-esm/interfaces/IFurnitureData.js +1 -0
- package/dist-esm/interfaces/IFurnitureLoader.js +1 -0
- package/dist-esm/interfaces/IHitDetection.js +1 -0
- package/dist-esm/interfaces/IRoomContext.js +1 -0
- package/dist-esm/interfaces/IRoomGeometry.js +1 -0
- package/dist-esm/interfaces/IRoomObject.js +1 -0
- package/dist-esm/interfaces/IRoomObjectContainer.js +1 -0
- package/dist-esm/interfaces/IRoomVisualization.js +1 -0
- package/dist-esm/interfaces/ITextureable.js +1 -0
- package/dist-esm/interfaces/ITileMap.js +1 -0
- package/dist-esm/objects/RoomObject.js +65 -0
- package/dist-esm/objects/Wsproom.js +49 -0
- package/dist-esm/objects/animation/AnimationTicker.js +33 -0
- package/dist-esm/objects/animation/ObjectAnimation.js +89 -0
- package/dist-esm/objects/avatar/Avatar.js +544 -0
- package/dist-esm/objects/avatar/AvatarAssetLibraryCollection.js +66 -0
- package/dist-esm/objects/avatar/AvatarEffectBundle.js +30 -0
- package/dist-esm/objects/avatar/AvatarLoader.js +211 -0
- package/dist-esm/objects/avatar/BaseAvatar.js +349 -0
- package/dist-esm/objects/avatar/data/AvatarActionsData.js +80 -0
- package/dist-esm/objects/avatar/data/AvatarAnimationData.js +122 -0
- package/dist-esm/objects/avatar/data/AvatarData.js +11 -0
- package/dist-esm/objects/avatar/data/AvatarEffectData.js +182 -0
- package/dist-esm/objects/avatar/data/AvatarEffectMap.js +34 -0
- package/dist-esm/objects/avatar/data/AvatarGeometryData.js +118 -0
- package/dist-esm/objects/avatar/data/AvatarManifestData.js +51 -0
- package/dist-esm/objects/avatar/data/AvatarOffsetsData.js +13 -0
- package/dist-esm/objects/avatar/data/AvatarPartSetsData.js +34 -0
- package/dist-esm/objects/avatar/data/FigureData.js +102 -0
- package/dist-esm/objects/avatar/data/FigureMapData.js +43 -0
- package/dist-esm/objects/avatar/data/ManifestLibrary.js +25 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarActionsData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarAnimationData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarEffectBundle.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarEffectData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarEffectMap.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarGeometryData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarManifestData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarOffsetsData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IAvatarPartSetsData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IFigureData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IFigureMapData.js +1 -0
- package/dist-esm/objects/avatar/data/interfaces/IManifestLibrary.js +1 -0
- package/dist-esm/objects/avatar/data/static/actions.xml.js +1 -0
- package/dist-esm/objects/avatar/data/static/animation.xml.js +1 -0
- package/dist-esm/objects/avatar/data/static/geometry.xml.js +1 -0
- package/dist-esm/objects/avatar/data/static/partsets.xml.js +1 -0
- package/dist-esm/objects/avatar/enum/AvatarAction.js +30 -0
- package/dist-esm/objects/avatar/enum/AvatarFigurePartType.js +28 -0
- package/dist-esm/objects/avatar/structure/AvatarAdditionPart.js +132 -0
- package/dist-esm/objects/avatar/structure/AvatarBodyPart.js +92 -0
- package/dist-esm/objects/avatar/structure/AvatarBodyPartList.js +87 -0
- package/dist-esm/objects/avatar/structure/AvatarDrawDefinition.js +131 -0
- package/dist-esm/objects/avatar/structure/AvatarEffectPart.js +113 -0
- package/dist-esm/objects/avatar/structure/AvatarPart.js +158 -0
- package/dist-esm/objects/avatar/structure/AvatarPartList.js +76 -0
- package/dist-esm/objects/avatar/structure/BodyPartDrawOrder.js +166 -0
- package/dist-esm/objects/avatar/structure/interface/IAvatarDrawablePart.js +1 -0
- package/dist-esm/objects/avatar/structure/interface/IAvatarEffectPart.js +1 -0
- package/dist-esm/objects/avatar/types/index.js +1 -0
- package/dist-esm/objects/avatar/util/createLookServer.js +15 -0
- package/dist-esm/objects/avatar/util/getAssetForFrame.js +39 -0
- package/dist-esm/objects/avatar/util/getAssetFromPartMeta.js +46 -0
- package/dist-esm/objects/avatar/util/getAvatarDirection.js +15 -0
- package/dist-esm/objects/avatar/util/getAvatarDrawDefinition.js +27 -0
- package/dist-esm/objects/avatar/util/getDrawOrderForActions.js +19 -0
- package/dist-esm/objects/avatar/util/getEffectSprite.js +24 -0
- package/dist-esm/objects/avatar/util/getFlippedMetaData.js +89 -0
- package/dist-esm/objects/avatar/util/getLibrariesForLook.js +29 -0
- package/dist-esm/objects/avatar/util/index.js +1 -0
- package/dist-esm/objects/avatar/util/parseLookString.js +12 -0
- package/dist-esm/objects/events/EventEmitter.js +27 -0
- package/dist-esm/objects/events/EventManager.js +241 -0
- package/dist-esm/objects/events/EventManagerContainer.js +32 -0
- package/dist-esm/objects/events/EventManagerNode.js +51 -0
- package/dist-esm/objects/events/EventOverOutHandler.js +86 -0
- package/dist-esm/objects/events/interfaces/IEventGroup.js +3 -0
- package/dist-esm/objects/events/interfaces/IEventHandler.js +1 -0
- package/dist-esm/objects/events/interfaces/IEventHittable.js +1 -0
- package/dist-esm/objects/events/interfaces/IEventManager.js +1 -0
- package/dist-esm/objects/events/interfaces/IEventManagerEvent.js +1 -0
- package/dist-esm/objects/events/interfaces/IEventManagerNode.js +1 -0
- package/dist-esm/objects/events/interfaces/IEventTarget.js +1 -0
- package/dist-esm/objects/furniture/BaseFurniture.js +482 -0
- package/dist-esm/objects/furniture/FloorFurniture.js +316 -0
- package/dist-esm/objects/furniture/FurnitureData.js +69 -0
- package/dist-esm/objects/furniture/FurnitureExtraData.js +1 -0
- package/dist-esm/objects/furniture/FurnitureFetchInfo.js +1 -0
- package/dist-esm/objects/furniture/FurnitureHelper.js +53 -0
- package/dist-esm/objects/furniture/FurnitureLoader.js +81 -0
- package/dist-esm/objects/furniture/FurnitureRoomVisualization.js +22 -0
- package/dist-esm/objects/furniture/FurnitureSprite.js +65 -0
- package/dist-esm/objects/furniture/FurnitureVisualizationView.js +478 -0
- package/dist-esm/objects/furniture/IFurniture.js +1 -0
- package/dist-esm/objects/furniture/IFurnitureAssetBundle.js +1 -0
- package/dist-esm/objects/furniture/IFurnitureVisualization.js +1 -0
- package/dist-esm/objects/furniture/IFurnitureVisualizationView.js +1 -0
- package/dist-esm/objects/furniture/JsonFurnitureAssetBundle.js +52 -0
- package/dist-esm/objects/furniture/WallFurniture.js +225 -0
- package/dist-esm/objects/furniture/XmlFurnitureAssetBundle.js +31 -0
- package/dist-esm/objects/furniture/data/FurnitureAssetsData.js +47 -0
- package/dist-esm/objects/furniture/data/FurnitureAssetsJson.js +1 -0
- package/dist-esm/objects/furniture/data/FurnitureIndexData.js +26 -0
- package/dist-esm/objects/furniture/data/FurnitureIndexJson.js +1 -0
- package/dist-esm/objects/furniture/data/FurnitureJson.js +1 -0
- package/dist-esm/objects/furniture/data/FurnitureLogicData.js +39 -0
- package/dist-esm/objects/furniture/data/FurnitureLogicJson.js +1 -0
- package/dist-esm/objects/furniture/data/FurnitureVisualizationData.js +277 -0
- package/dist-esm/objects/furniture/data/FurnitureVisualizationJson.js +1 -0
- package/dist-esm/objects/furniture/data/JsonFurnitureAssetsData.js +12 -0
- package/dist-esm/objects/furniture/data/JsonFurnitureLogicData.js +8 -0
- package/dist-esm/objects/furniture/data/JsonFurnitureVisualizationData.js +91 -0
- package/dist-esm/objects/furniture/data/interfaces/IFurnitureAssetsData.js +1 -0
- package/dist-esm/objects/furniture/data/interfaces/IFurnitureIndexData.js +1 -0
- package/dist-esm/objects/furniture/data/interfaces/IFurnitureLogicData.js +1 -0
- package/dist-esm/objects/furniture/data/interfaces/IFurnitureVisualizationData.js +1 -0
- package/dist-esm/objects/furniture/filter/ActiveWiredFilter.js +40 -0
- package/dist-esm/objects/furniture/filter/HighlightFilter.js +56 -0
- package/dist-esm/objects/furniture/filter/filterVertex.js +29 -0
- package/dist-esm/objects/furniture/util/DrawDefinition.js +1 -0
- package/dist-esm/objects/furniture/util/IFurnitureEventHandlers.js +1 -0
- package/dist-esm/objects/furniture/util/getDirectionForFurniture.js +15 -0
- package/dist-esm/objects/furniture/util/getFurniDrawDefinition.js +98 -0
- package/dist-esm/objects/furniture/util/getFurnitureFetch.js +11 -0
- package/dist-esm/objects/furniture/util/index.js +4 -0
- package/dist-esm/objects/furniture/util/loadFurni.js +46 -0
- package/dist-esm/objects/furniture/util/visualization/VisualizationXml.js +1 -0
- package/dist-esm/objects/furniture/util/visualization/parseAnimations.js +32 -0
- package/dist-esm/objects/furniture/util/visualization/parseColors.js +16 -0
- package/dist-esm/objects/furniture/util/visualization/parseDirections.js +24 -0
- package/dist-esm/objects/furniture/util/visualization/parseLayers.js +16 -0
- package/dist-esm/objects/furniture/util/visualization/parseVisualization.js +41 -0
- package/dist-esm/objects/furniture/visualization/AnimatedFurnitureVisualization.js +210 -0
- package/dist-esm/objects/furniture/visualization/BasicFurnitureVisualization.js +50 -0
- package/dist-esm/objects/furniture/visualization/FurnitureBottleVisualization.js +61 -0
- package/dist-esm/objects/furniture/visualization/FurnitureGuildCustomizedVisualization.js +83 -0
- package/dist-esm/objects/furniture/visualization/FurnitureVisualization.js +20 -0
- package/dist-esm/objects/hitdetection/ClickHandler.js +75 -0
- package/dist-esm/objects/hitdetection/HitSprite.js +186 -0
- package/dist-esm/objects/hitdetection/HitTexture.js +116 -0
- package/dist-esm/objects/interfaces/IMoveable.js +1 -0
- package/dist-esm/objects/interfaces/IScreenPositioned.js +1 -0
- package/dist-esm/objects/room/ILandscapeContainer.js +1 -0
- package/dist-esm/objects/room/IRoomRectangle.js +1 -0
- package/dist-esm/objects/room/ITileColorable.js +1 -0
- package/dist-esm/objects/room/IWallColorable.js +1 -0
- package/dist-esm/objects/room/Landscape.js +349 -0
- package/dist-esm/objects/room/ParsedTileMap.js +22 -0
- package/dist-esm/objects/room/Pathfinding.js +204 -0
- package/dist-esm/objects/room/Room.js +357 -0
- package/dist-esm/objects/room/RoomCamera.js +321 -0
- package/dist-esm/objects/room/RoomLandscapeMaskSprite.js +63 -0
- package/dist-esm/objects/room/RoomModelVisualization.js +524 -0
- package/dist-esm/objects/room/RoomObjectContainer.js +31 -0
- package/dist-esm/objects/room/TileMapEditorLayer.js +294 -0
- package/dist-esm/objects/room/data/LandscapeData.js +128 -0
- package/dist-esm/objects/room/matrixes.js +30 -0
- package/dist-esm/objects/room/parts/IRoomPart.js +1 -0
- package/dist-esm/objects/room/parts/RoomPartData.js +1 -0
- package/dist-esm/objects/room/parts/Stair.js +90 -0
- package/dist-esm/objects/room/parts/StairCorner.js +155 -0
- package/dist-esm/objects/room/parts/Tile.js +101 -0
- package/dist-esm/objects/room/parts/TileCursor.js +156 -0
- package/dist-esm/objects/room/parts/WallLeft.js +142 -0
- package/dist-esm/objects/room/parts/WallOuterCorner.js +47 -0
- package/dist-esm/objects/room/parts/WallRight.js +14 -0
- package/dist-esm/objects/room/util/LegacyWallGeometry.js +89 -0
- package/dist-esm/objects/room/util/createPlaneMatrix.js +27 -0
- package/dist-esm/objects/room/util/getMaskId.js +10 -0
- package/dist-esm/objects/room/util/getPosition.js +11 -0
- package/dist-esm/objects/room/util/getTileColors.js +30 -0
- package/dist-esm/objects/room/util/getTileMapBounds.js +37 -0
- package/dist-esm/objects/room/util/getTilePosition.js +6 -0
- package/dist-esm/objects/room/util/getTilePositionForTile.js +8 -0
- package/dist-esm/types/RoomPosition.js +1 -0
- package/dist-esm/types/TileType.js +1 -0
- package/dist-esm/types/WallPosition.js +1 -0
- package/dist-esm/types/types.js +1 -0
- package/dist-esm/util/applyTextureProperties.js +3 -0
- package/dist-esm/util/associateBy.js +8 -0
- package/dist-esm/util/furnitureDataTransformers.js +53 -0
- package/dist-esm/util/getIntFromHex.js +3 -0
- package/dist-esm/util/getNumberFromAttribute.js +8 -0
- package/dist-esm/util/getTileInfo.js +103 -0
- package/dist-esm/util/getZOrder.js +3 -0
- package/dist-esm/util/isPointInside.js +15 -0
- package/dist-esm/util/isSetEqual.js +8 -0
- package/dist-esm/util/isTile.js +1 -0
- package/dist-esm/util/loadImageFromBlob.js +10 -0
- package/dist-esm/util/loadImageFromUrl.js +11 -0
- package/dist-esm/util/loadRoomTexture.js +15 -0
- package/dist-esm/util/mock.js +3 -0
- package/dist-esm/util/notNullOrUndefined.js +3 -0
- package/dist-esm/util/parseTileMap.js +185 -0
- package/dist-esm/util/parseTileMapString.js +13 -0
- package/dist-esm/util/tilemap/findEntranceTile.js +21 -0
- package/dist-esm/util/tilemap/getColumnWalls.js +40 -0
- package/dist-esm/util/tilemap/getRowWalls.js +40 -0
- package/dist-esm/util/tilemap/hasWallTiles.js +6 -0
- package/dist-esm/util/tilemap/padTileMap.js +21 -0
- package/dist-esm/util/tilemap/traceWalls.js +376 -0
- package/dist-esm/util/tilemap/wallsFromContour.js +45 -0
- package/dist-esm/util/traverseDOMTree.js +5 -0
- package/package.json +102 -3
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Avatar = void 0;
|
|
4
|
+
const RoomObject_1 = require("../RoomObject");
|
|
5
|
+
const getZOrder_1 = require("../../util/getZOrder");
|
|
6
|
+
const BaseAvatar_1 = require("./BaseAvatar");
|
|
7
|
+
const ObjectAnimation_1 = require("../animation/ObjectAnimation");
|
|
8
|
+
const AvatarAction_1 = require("./enum/AvatarAction");
|
|
9
|
+
class Avatar extends RoomObject_1.RoomObject {
|
|
10
|
+
constructor({ look, roomX, roomY, roomZ, direction, headDirection, }) {
|
|
11
|
+
super();
|
|
12
|
+
this._walking = false;
|
|
13
|
+
this._moving = false;
|
|
14
|
+
this._frame = 0;
|
|
15
|
+
this._waving = false;
|
|
16
|
+
this._direction = 0;
|
|
17
|
+
this._roomX = 0;
|
|
18
|
+
this._roomY = 0;
|
|
19
|
+
this._roomZ = 0;
|
|
20
|
+
this._animatedPosition = { roomX: 0, roomY: 0, roomZ: 0 };
|
|
21
|
+
this._actions = new Set();
|
|
22
|
+
this._loaded = false;
|
|
23
|
+
this._onClick = undefined;
|
|
24
|
+
this._onDoubleClick = undefined;
|
|
25
|
+
this._onPointerDown = undefined;
|
|
26
|
+
this._onPointerUp = undefined;
|
|
27
|
+
this._onPointerOver = undefined;
|
|
28
|
+
this._onPointerOut = undefined;
|
|
29
|
+
this._onStopWalkingCallback = undefined;
|
|
30
|
+
this._direction = direction;
|
|
31
|
+
this._look = look;
|
|
32
|
+
this._roomX = roomX;
|
|
33
|
+
this._roomY = roomY;
|
|
34
|
+
this._roomZ = roomZ;
|
|
35
|
+
this._headDirection = headDirection;
|
|
36
|
+
this._placeholderSprites = new BaseAvatar_1.BaseAvatar({
|
|
37
|
+
look: this._getPlaceholderLookOptions(),
|
|
38
|
+
zIndex: this._calculateZIndex(),
|
|
39
|
+
position: { x: 0, y: 0 },
|
|
40
|
+
onLoad: () => {
|
|
41
|
+
this._updateAvatarSprites();
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
this._placeholderSprites.alpha = 0.5;
|
|
45
|
+
this._avatarSprites = this._placeholderSprites;
|
|
46
|
+
this._loadingAvatarSprites = new BaseAvatar_1.BaseAvatar({
|
|
47
|
+
look: this._getLookOptions(),
|
|
48
|
+
position: { x: 0, y: 0 },
|
|
49
|
+
zIndex: this._calculateZIndex(),
|
|
50
|
+
onLoad: () => {
|
|
51
|
+
this._loaded = true;
|
|
52
|
+
this._updateAvatarSprites();
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
setLook(look) {
|
|
57
|
+
this._look = look;
|
|
58
|
+
this._updateAvatarSprites();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The look of the avatar
|
|
62
|
+
*/
|
|
63
|
+
get look() {
|
|
64
|
+
return this._look;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Set this with a callback if you want to capture clicks on the Avatar.
|
|
68
|
+
*/
|
|
69
|
+
get onClick() {
|
|
70
|
+
return this._onClick;
|
|
71
|
+
}
|
|
72
|
+
set onClick(value) {
|
|
73
|
+
this._onClick = value;
|
|
74
|
+
this._updateEventHandlers();
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Set this with a callback if you want to capture double clicks on the Avatar.
|
|
78
|
+
*/
|
|
79
|
+
get onDoubleClick() {
|
|
80
|
+
return this._onDoubleClick;
|
|
81
|
+
}
|
|
82
|
+
set onDoubleClick(value) {
|
|
83
|
+
this._onDoubleClick = value;
|
|
84
|
+
this._updateEventHandlers();
|
|
85
|
+
}
|
|
86
|
+
get onPointerDown() {
|
|
87
|
+
return this._onPointerDown;
|
|
88
|
+
}
|
|
89
|
+
set onPointerDown(value) {
|
|
90
|
+
this._onPointerDown = value;
|
|
91
|
+
this._updateEventHandlers();
|
|
92
|
+
}
|
|
93
|
+
get onPointerUp() {
|
|
94
|
+
return this._onPointerUp;
|
|
95
|
+
}
|
|
96
|
+
set onPointerUp(value) {
|
|
97
|
+
this._onPointerUp = value;
|
|
98
|
+
this._updateEventHandlers();
|
|
99
|
+
}
|
|
100
|
+
get onPointerOver() {
|
|
101
|
+
return this._onPointerOver;
|
|
102
|
+
}
|
|
103
|
+
set onPointerOver(value) {
|
|
104
|
+
this._onPointerOver = value;
|
|
105
|
+
this._updateEventHandlers();
|
|
106
|
+
}
|
|
107
|
+
get onPointerOut() {
|
|
108
|
+
return this._onPointerOut;
|
|
109
|
+
}
|
|
110
|
+
set onPointerOut(value) {
|
|
111
|
+
this._onPointerOut = value;
|
|
112
|
+
this._updateEventHandlers();
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The x position of the avatar in the room.
|
|
116
|
+
* The y-Axis is marked in the following graphic:
|
|
117
|
+
*
|
|
118
|
+
* ```
|
|
119
|
+
* |
|
|
120
|
+
* |
|
|
121
|
+
* |
|
|
122
|
+
* / \
|
|
123
|
+
* / \ <- x-Axis
|
|
124
|
+
* / \
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
get roomX() {
|
|
128
|
+
return this._roomX;
|
|
129
|
+
}
|
|
130
|
+
set roomX(value) {
|
|
131
|
+
this._roomX = value;
|
|
132
|
+
this._updatePosition();
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* The y position of the avatar in the room.
|
|
136
|
+
* The y-Axis is marked in the following graphic:
|
|
137
|
+
*
|
|
138
|
+
* ```
|
|
139
|
+
* |
|
|
140
|
+
* |
|
|
141
|
+
* |
|
|
142
|
+
* / \
|
|
143
|
+
* y-Axis -> / \
|
|
144
|
+
* / \
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
get roomY() {
|
|
148
|
+
return this._roomY;
|
|
149
|
+
}
|
|
150
|
+
set roomY(value) {
|
|
151
|
+
this._roomY = value;
|
|
152
|
+
this._updatePosition();
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The z position of the avatar in the room.
|
|
156
|
+
* The z-Axis is marked in the following graphic:
|
|
157
|
+
*
|
|
158
|
+
* ```
|
|
159
|
+
* |
|
|
160
|
+
* z-Axis -> |
|
|
161
|
+
* |
|
|
162
|
+
* / \
|
|
163
|
+
* / \
|
|
164
|
+
* / \
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
get roomZ() {
|
|
168
|
+
return this._roomZ;
|
|
169
|
+
}
|
|
170
|
+
set roomZ(value) {
|
|
171
|
+
this._roomZ = value;
|
|
172
|
+
this._updatePosition();
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Sets the item of the user. Note that this won't have an effect if you don't supply
|
|
176
|
+
* an action which supports items. These are usually `CarryItem` and `UseItem`.
|
|
177
|
+
*/
|
|
178
|
+
get item() {
|
|
179
|
+
return this._item;
|
|
180
|
+
}
|
|
181
|
+
set item(value) {
|
|
182
|
+
this._item = value;
|
|
183
|
+
this._updateAvatarSprites();
|
|
184
|
+
}
|
|
185
|
+
get effect() {
|
|
186
|
+
return this._effect;
|
|
187
|
+
}
|
|
188
|
+
set effect(value) {
|
|
189
|
+
this._effect = value;
|
|
190
|
+
this._updateAvatarSprites();
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Sets the direction of the avatar. Following numbers map to the
|
|
194
|
+
* following directions of the avatar:
|
|
195
|
+
*
|
|
196
|
+
* ```
|
|
197
|
+
* x-Axis
|
|
198
|
+
* x--------------
|
|
199
|
+
* |
|
|
200
|
+
* | 7 0 1
|
|
201
|
+
* |
|
|
202
|
+
* y-Axis | 6 x 2
|
|
203
|
+
* |
|
|
204
|
+
* | 5 4 3
|
|
205
|
+
*
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
get direction() {
|
|
209
|
+
return this._direction;
|
|
210
|
+
}
|
|
211
|
+
set direction(value) {
|
|
212
|
+
this._direction = value;
|
|
213
|
+
this._updateAvatarSprites();
|
|
214
|
+
}
|
|
215
|
+
get headDirection() {
|
|
216
|
+
return this._headDirection;
|
|
217
|
+
}
|
|
218
|
+
set headDirection(value) {
|
|
219
|
+
this._headDirection = value;
|
|
220
|
+
this._updateAvatarSprites();
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* If set to true, the avatar will be waving. You can
|
|
224
|
+
* achieve the same behavior by adding the wave action manually
|
|
225
|
+
* through `addAction`.
|
|
226
|
+
*/
|
|
227
|
+
get waving() {
|
|
228
|
+
return this._waving;
|
|
229
|
+
}
|
|
230
|
+
set waving(value) {
|
|
231
|
+
this._waving = value;
|
|
232
|
+
this._updateAvatarSprites();
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* The active actions of the avatar.
|
|
236
|
+
*/
|
|
237
|
+
get actions() {
|
|
238
|
+
return this._actions;
|
|
239
|
+
}
|
|
240
|
+
set actions(value) {
|
|
241
|
+
this._actions = value;
|
|
242
|
+
this._updateAvatarSprites();
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* The apparent position of the avatar on the screen. This is useful
|
|
246
|
+
* for placing UI relative to the user.
|
|
247
|
+
*/
|
|
248
|
+
get screenPosition() {
|
|
249
|
+
const worldTransform = this._avatarSprites.getGlobalPosition();
|
|
250
|
+
if (worldTransform == null)
|
|
251
|
+
return;
|
|
252
|
+
return {
|
|
253
|
+
x: worldTransform.x,
|
|
254
|
+
y: worldTransform.y,
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Clears the enqueued movement of the avatar.
|
|
259
|
+
*/
|
|
260
|
+
clearMovement() {
|
|
261
|
+
var _a;
|
|
262
|
+
const current = (_a = this._moveAnimation) === null || _a === void 0 ? void 0 : _a.clear();
|
|
263
|
+
if (current != null) {
|
|
264
|
+
this.roomX = current.roomX;
|
|
265
|
+
this.roomY = current.roomY;
|
|
266
|
+
this.roomZ = current.roomZ;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Walk the user to a position. This will trigger the walking animation, change the direction
|
|
271
|
+
* and smoothly move the user to its new position. Note that you have to implement
|
|
272
|
+
* your own pathfinding logic on top of it.
|
|
273
|
+
*
|
|
274
|
+
* @param roomX New x-Position
|
|
275
|
+
* @param roomY New y-Position
|
|
276
|
+
* @param roomZ New z-Position
|
|
277
|
+
* @param options Optionally specify the direction/headDirection of user movement
|
|
278
|
+
*/
|
|
279
|
+
walk(roomX, roomY, roomZ, options) {
|
|
280
|
+
var _a;
|
|
281
|
+
(_a = this._moveAnimation) === null || _a === void 0 ? void 0 : _a.move({ roomX: this.roomX, roomY: this.roomY, roomZ: this.roomZ }, { roomX, roomY, roomZ }, {
|
|
282
|
+
direction: options === null || options === void 0 ? void 0 : options.direction,
|
|
283
|
+
headDirection: options === null || options === void 0 ? void 0 : options.headDirection,
|
|
284
|
+
type: "walk",
|
|
285
|
+
});
|
|
286
|
+
this._roomX = roomX;
|
|
287
|
+
this._roomY = roomY;
|
|
288
|
+
this._roomZ = roomZ;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Move the user to a new position. This will smoothly animate the user to the
|
|
292
|
+
* specified position.
|
|
293
|
+
*
|
|
294
|
+
* @param roomX New x-Position
|
|
295
|
+
* @param roomY New y-Position
|
|
296
|
+
* @param roomZ New z-Position
|
|
297
|
+
*/
|
|
298
|
+
move(roomX, roomY, roomZ, options = { animation: true }) {
|
|
299
|
+
var _a;
|
|
300
|
+
if (options === null || options === void 0 ? void 0 : options.animation) {
|
|
301
|
+
(_a = this._moveAnimation) === null || _a === void 0 ? void 0 : _a.move({ roomX: this.roomX, roomY: this.roomY, roomZ: this.roomZ }, { roomX, roomY, roomZ }, { type: "move" });
|
|
302
|
+
}
|
|
303
|
+
this._roomX = roomX;
|
|
304
|
+
this._roomY = roomY;
|
|
305
|
+
this._roomZ = roomZ;
|
|
306
|
+
this._updatePosition();
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* @deprecated Use `screenPosition` instead. This will be the actual position on the screen.
|
|
310
|
+
*/
|
|
311
|
+
getScreenPosition() {
|
|
312
|
+
return {
|
|
313
|
+
x: this._avatarSprites.x,
|
|
314
|
+
y: this._avatarSprites.y,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
registered() {
|
|
318
|
+
if (this._placeholderSprites != null) {
|
|
319
|
+
this._placeholderSprites.dependencies = {
|
|
320
|
+
animationTicker: this.animationTicker,
|
|
321
|
+
avatarLoader: this.avatarLoader,
|
|
322
|
+
eventManager: this.eventManager,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
this._loadingAvatarSprites.dependencies = {
|
|
326
|
+
animationTicker: this.animationTicker,
|
|
327
|
+
avatarLoader: this.avatarLoader,
|
|
328
|
+
eventManager: this.eventManager,
|
|
329
|
+
};
|
|
330
|
+
this._updateAvatarSprites();
|
|
331
|
+
this._moveAnimation = new ObjectAnimation_1.ObjectAnimation(this.animationTicker, {
|
|
332
|
+
onUpdatePosition: (position) => {
|
|
333
|
+
this._animatedPosition = position;
|
|
334
|
+
this._updatePosition();
|
|
335
|
+
},
|
|
336
|
+
onStart: (data) => {
|
|
337
|
+
if (data.type === "walk") {
|
|
338
|
+
this._startWalking(data.direction, data.headDirection);
|
|
339
|
+
this._moving = false;
|
|
340
|
+
}
|
|
341
|
+
else if (data.type === "move") {
|
|
342
|
+
this._stopWalking();
|
|
343
|
+
this._moving = true;
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
onStop: () => {
|
|
347
|
+
this._stopWalking();
|
|
348
|
+
this._moving = false;
|
|
349
|
+
},
|
|
350
|
+
}, this.configuration.avatarMovementDuration);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Make an action active.
|
|
354
|
+
* @param action The action to add
|
|
355
|
+
*/
|
|
356
|
+
addAction(action) {
|
|
357
|
+
this.actions = new Set(this._actions).add(action);
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Remove an action from the active actions.
|
|
361
|
+
* @param action The action to remove
|
|
362
|
+
*/
|
|
363
|
+
removeAction(action) {
|
|
364
|
+
const newSet = new Set(this._actions);
|
|
365
|
+
newSet.delete(action);
|
|
366
|
+
this.actions = newSet;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Check if an action is active.
|
|
370
|
+
* @param action The action to check
|
|
371
|
+
*/
|
|
372
|
+
hasAction(action) {
|
|
373
|
+
return this.actions.has(action);
|
|
374
|
+
}
|
|
375
|
+
destroyed() {
|
|
376
|
+
var _a, _b;
|
|
377
|
+
(_a = this._avatarSprites) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
378
|
+
if (this._cancelAnimation != null) {
|
|
379
|
+
this._cancelAnimation();
|
|
380
|
+
}
|
|
381
|
+
(_b = this._moveAnimation) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
382
|
+
}
|
|
383
|
+
_updateEventHandlers() {
|
|
384
|
+
if (this._placeholderSprites != null) {
|
|
385
|
+
this._placeholderSprites.onClick = this._onClick;
|
|
386
|
+
this._placeholderSprites.onDoubleClick = this._onDoubleClick;
|
|
387
|
+
this._placeholderSprites.onPointerDown = this._onPointerDown;
|
|
388
|
+
this._placeholderSprites.onPointerUp = this._onPointerUp;
|
|
389
|
+
this._placeholderSprites.onPointerOut = this._onPointerOut;
|
|
390
|
+
this._placeholderSprites.onPointerOver = this._onPointerOver;
|
|
391
|
+
}
|
|
392
|
+
this._loadingAvatarSprites.onClick = this._onClick;
|
|
393
|
+
this._loadingAvatarSprites.onDoubleClick = this._onDoubleClick;
|
|
394
|
+
this._loadingAvatarSprites.onPointerDown = this._onPointerDown;
|
|
395
|
+
this._loadingAvatarSprites.onPointerUp = this._onPointerUp;
|
|
396
|
+
this._loadingAvatarSprites.onPointerOut = this._onPointerOut;
|
|
397
|
+
this._loadingAvatarSprites.onPointerOver = this._onPointerOver;
|
|
398
|
+
}
|
|
399
|
+
_getPlaceholderLookOptions() {
|
|
400
|
+
return {
|
|
401
|
+
actions: new Set(),
|
|
402
|
+
direction: this.direction,
|
|
403
|
+
headDirection: this.direction,
|
|
404
|
+
look: "hd-99999-99999",
|
|
405
|
+
effect: undefined,
|
|
406
|
+
initial: false,
|
|
407
|
+
item: undefined,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
_getCurrentLookOptions() {
|
|
411
|
+
if (!this._loaded)
|
|
412
|
+
return this._getPlaceholderLookOptions();
|
|
413
|
+
return this._getLookOptions();
|
|
414
|
+
}
|
|
415
|
+
_getLookOptions() {
|
|
416
|
+
const combinedActions = new Set(this.actions);
|
|
417
|
+
if (this._walking) {
|
|
418
|
+
combinedActions.add(AvatarAction_1.AvatarAction.Move);
|
|
419
|
+
}
|
|
420
|
+
if (this.waving) {
|
|
421
|
+
combinedActions.add(AvatarAction_1.AvatarAction.Wave);
|
|
422
|
+
}
|
|
423
|
+
if (combinedActions.has(AvatarAction_1.AvatarAction.Lay) && this._walking) {
|
|
424
|
+
combinedActions.delete(AvatarAction_1.AvatarAction.Lay);
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
actions: combinedActions,
|
|
428
|
+
direction: this.direction,
|
|
429
|
+
headDirection: this.headDirection,
|
|
430
|
+
look: this._look,
|
|
431
|
+
item: this.item,
|
|
432
|
+
effect: this.effect,
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
_updateAvatarSprites() {
|
|
436
|
+
if (!this.mounted)
|
|
437
|
+
return;
|
|
438
|
+
if (this._loaded) {
|
|
439
|
+
if (this._placeholderSprites != null) {
|
|
440
|
+
this._placeholderSprites.destroy();
|
|
441
|
+
}
|
|
442
|
+
this._placeholderSprites = undefined;
|
|
443
|
+
this._avatarSprites = this._loadingAvatarSprites;
|
|
444
|
+
}
|
|
445
|
+
else if (this._placeholderSprites != null) {
|
|
446
|
+
this._avatarSprites = this._placeholderSprites;
|
|
447
|
+
}
|
|
448
|
+
const look = this._getCurrentLookOptions();
|
|
449
|
+
const animating = true;
|
|
450
|
+
if (animating) {
|
|
451
|
+
this._startAnimation();
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
this._stopAnimation();
|
|
455
|
+
}
|
|
456
|
+
const avatarSprites = this._avatarSprites;
|
|
457
|
+
if (avatarSprites != null) {
|
|
458
|
+
avatarSprites.lookOptions = look;
|
|
459
|
+
}
|
|
460
|
+
this._updatePosition();
|
|
461
|
+
this._updateEventHandlers();
|
|
462
|
+
}
|
|
463
|
+
_updateFrame() {
|
|
464
|
+
this._avatarSprites.currentFrame = this._frame;
|
|
465
|
+
}
|
|
466
|
+
_startAnimation() {
|
|
467
|
+
if (this._cancelAnimation != null)
|
|
468
|
+
return;
|
|
469
|
+
this._frame = 0;
|
|
470
|
+
const start = this.animationTicker.current();
|
|
471
|
+
this._cancelAnimation = this.animationTicker.subscribe((value) => {
|
|
472
|
+
this._frame = value - start;
|
|
473
|
+
this._updateFrame();
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
_stopAnimation() {
|
|
477
|
+
this._frame = 0;
|
|
478
|
+
if (this._cancelAnimation != null) {
|
|
479
|
+
this._cancelAnimation();
|
|
480
|
+
this._cancelAnimation = undefined;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
_startWalking(direction, headDirection) {
|
|
484
|
+
this._walking = true;
|
|
485
|
+
if (direction != null) {
|
|
486
|
+
this.direction = direction;
|
|
487
|
+
}
|
|
488
|
+
if (headDirection != null) {
|
|
489
|
+
this.headDirection = headDirection;
|
|
490
|
+
}
|
|
491
|
+
this._updateAvatarSprites();
|
|
492
|
+
}
|
|
493
|
+
_stopWalking() {
|
|
494
|
+
this._walking = false;
|
|
495
|
+
this._updateAvatarSprites();
|
|
496
|
+
if (this._onStopWalkingCallback) {
|
|
497
|
+
this._onStopWalkingCallback();
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
set onStopWalkingCallback(value) {
|
|
501
|
+
this._onStopWalkingCallback = value;
|
|
502
|
+
}
|
|
503
|
+
_calculateZIndex() {
|
|
504
|
+
return this._getZIndexAtPosition(this.roomX, this.roomY, this.roomZ);
|
|
505
|
+
}
|
|
506
|
+
_getDisplayRoomPosition() {
|
|
507
|
+
if (this._walking || this._moving) {
|
|
508
|
+
return this._animatedPosition;
|
|
509
|
+
}
|
|
510
|
+
return {
|
|
511
|
+
roomX: this.roomX,
|
|
512
|
+
roomY: this.roomY,
|
|
513
|
+
roomZ: this.roomZ,
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
_getZIndexAtPosition(roomX, roomY, roomZ) {
|
|
517
|
+
let zOffset = 1;
|
|
518
|
+
if (this._getCurrentLookOptions().actions.has(AvatarAction_1.AvatarAction.Lay)) {
|
|
519
|
+
zOffset += 2000;
|
|
520
|
+
}
|
|
521
|
+
return (0, getZOrder_1.getZOrder)(roomX, roomY, roomZ) + zOffset;
|
|
522
|
+
}
|
|
523
|
+
_updatePosition() {
|
|
524
|
+
if (!this.mounted)
|
|
525
|
+
return;
|
|
526
|
+
const { roomX, roomY, roomZ } = this._getDisplayRoomPosition();
|
|
527
|
+
const { x, y } = this.geometry.getPosition(roomX, roomY, roomZ);
|
|
528
|
+
const roomXrounded = Math.round(roomX);
|
|
529
|
+
const roomYrounded = Math.round(roomY);
|
|
530
|
+
if (this._avatarSprites != null) {
|
|
531
|
+
this._avatarSprites.x = Math.round(x);
|
|
532
|
+
this._avatarSprites.y = Math.round(y);
|
|
533
|
+
const zIndex = this._getZIndexAtPosition(roomXrounded, roomYrounded, this.roomZ);
|
|
534
|
+
this._avatarSprites.zIndex = zIndex;
|
|
535
|
+
this._avatarSprites.spritesZIndex = zIndex;
|
|
536
|
+
}
|
|
537
|
+
const item = this.tilemap.getTileAtPosition(roomXrounded, roomYrounded);
|
|
538
|
+
if ((item === null || item === void 0 ? void 0 : item.type) === "door") {
|
|
539
|
+
this.roomVisualization.container.removeChild(this._avatarSprites);
|
|
540
|
+
this.roomVisualization.behindWallContainer.addChild(this._avatarSprites);
|
|
541
|
+
}
|
|
542
|
+
if (item == null || item.type !== "door") {
|
|
543
|
+
this.roomVisualization.behindWallContainer.removeChild(this._avatarSprites);
|
|
544
|
+
this.roomVisualization.container.addChild(this._avatarSprites);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
exports.Avatar = Avatar;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HitTexture } from "../hitdetection/HitTexture";
|
|
2
|
+
import { IAvatarOffsetsData } from "./data/interfaces/IAvatarOffsetsData";
|
|
3
|
+
import { IManifestLibrary } from "./data/interfaces/IManifestLibrary";
|
|
4
|
+
declare const NO_ASSET: unique symbol;
|
|
5
|
+
export declare class AvatarAssetLibraryCollection implements IAvatarOffsetsData {
|
|
6
|
+
private _assets;
|
|
7
|
+
private _libraries;
|
|
8
|
+
private _opened;
|
|
9
|
+
private _loadTextures;
|
|
10
|
+
private _textures;
|
|
11
|
+
open(bundle: IManifestLibrary): Promise<void>;
|
|
12
|
+
loadTextures(ids: string[]): Promise<(typeof NO_ASSET | HitTexture)[]>;
|
|
13
|
+
getOffsets(fileName: string): {
|
|
14
|
+
offsetX: number;
|
|
15
|
+
offsetY: number;
|
|
16
|
+
} | undefined;
|
|
17
|
+
getTexture(fileName: string): HitTexture | undefined;
|
|
18
|
+
private _loadTexture;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AvatarAssetLibraryCollection = void 0;
|
|
4
|
+
const NO_ASSET = Symbol("NO_ASSET");
|
|
5
|
+
class AvatarAssetLibraryCollection {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._assets = new Map();
|
|
8
|
+
this._libraries = new Map();
|
|
9
|
+
this._opened = new Set();
|
|
10
|
+
this._loadTextures = new Map();
|
|
11
|
+
this._textures = new Map();
|
|
12
|
+
}
|
|
13
|
+
async open(bundle) {
|
|
14
|
+
if (this._opened.has(bundle))
|
|
15
|
+
return;
|
|
16
|
+
this._opened.add(bundle);
|
|
17
|
+
const manifest = await bundle.getManifest();
|
|
18
|
+
await Promise.all(manifest.getAssets().map(async (asset) => {
|
|
19
|
+
this._assets.set(asset.name, asset);
|
|
20
|
+
this._libraries.set(asset.name, bundle);
|
|
21
|
+
}));
|
|
22
|
+
await Promise.all(manifest.getAliases().map((alias) => {
|
|
23
|
+
const base = manifest.getAssetByName(alias.link);
|
|
24
|
+
if (base != null) {
|
|
25
|
+
this._assets.set(alias.name, {
|
|
26
|
+
...base,
|
|
27
|
+
flipH: alias.fliph,
|
|
28
|
+
flipV: alias.flipv,
|
|
29
|
+
});
|
|
30
|
+
this._libraries.set(alias.name, bundle);
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
async loadTextures(ids) {
|
|
35
|
+
return Promise.all(ids.map((id) => this._loadTexture(id)));
|
|
36
|
+
}
|
|
37
|
+
getOffsets(fileName) {
|
|
38
|
+
const asset = this._assets.get(fileName);
|
|
39
|
+
if (asset == null)
|
|
40
|
+
return;
|
|
41
|
+
return {
|
|
42
|
+
offsetX: asset.x,
|
|
43
|
+
offsetY: asset.y,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
getTexture(fileName) {
|
|
47
|
+
const texture = this._textures.get(fileName);
|
|
48
|
+
if (texture === NO_ASSET)
|
|
49
|
+
return;
|
|
50
|
+
return texture;
|
|
51
|
+
}
|
|
52
|
+
_loadTexture(id) {
|
|
53
|
+
var _a;
|
|
54
|
+
var _b;
|
|
55
|
+
const current = this._loadTextures.get(id);
|
|
56
|
+
if (current != null)
|
|
57
|
+
return current;
|
|
58
|
+
const actualId = (_b = (_a = this._assets.get(id)) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : id;
|
|
59
|
+
const manifestLibrary = this._libraries.get(id);
|
|
60
|
+
if (manifestLibrary == null)
|
|
61
|
+
throw new Error(`Couldn't find library for ${id}`);
|
|
62
|
+
const promise = manifestLibrary.getTexture(actualId).then((value) => {
|
|
63
|
+
this._textures.set(id, value !== null && value !== void 0 ? value : NO_ASSET);
|
|
64
|
+
return value !== null && value !== void 0 ? value : NO_ASSET;
|
|
65
|
+
});
|
|
66
|
+
this._loadTextures.set(id, promise);
|
|
67
|
+
return promise;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.AvatarAssetLibraryCollection = AvatarAssetLibraryCollection;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IAssetBundle } from "../../assets/IAssetBundle";
|
|
2
|
+
import { HitTexture } from "../hitdetection/HitTexture";
|
|
3
|
+
import { IAvatarEffectBundle } from "./data/interfaces/IAvatarEffectBundle";
|
|
4
|
+
import { IAvatarEffectData } from "./data/interfaces/IAvatarEffectData";
|
|
5
|
+
import { IAvatarManifestData } from "./data/interfaces/IAvatarManifestData";
|
|
6
|
+
export declare class AvatarEffectBundle implements IAvatarEffectBundle {
|
|
7
|
+
private _bundle;
|
|
8
|
+
private _data;
|
|
9
|
+
private _textures;
|
|
10
|
+
private _manifest;
|
|
11
|
+
constructor(_bundle: IAssetBundle);
|
|
12
|
+
getData(): Promise<IAvatarEffectData>;
|
|
13
|
+
getTexture(name: string): Promise<HitTexture>;
|
|
14
|
+
getManifest(): Promise<IAvatarManifestData>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AvatarEffectBundle = void 0;
|
|
4
|
+
const HitTexture_1 = require("../hitdetection/HitTexture");
|
|
5
|
+
const AvatarEffectData_1 = require("./data/AvatarEffectData");
|
|
6
|
+
const AvatarManifestData_1 = require("./data/AvatarManifestData");
|
|
7
|
+
class AvatarEffectBundle {
|
|
8
|
+
constructor(_bundle) {
|
|
9
|
+
this._bundle = _bundle;
|
|
10
|
+
this._textures = new Map();
|
|
11
|
+
this._data = _bundle
|
|
12
|
+
.getString(`animation.bin`)
|
|
13
|
+
.then((xml) => new AvatarEffectData_1.AvatarEffectData(xml));
|
|
14
|
+
this._manifest = _bundle
|
|
15
|
+
.getString(`manifest.bin`)
|
|
16
|
+
.then((xml) => new AvatarManifestData_1.AvatarManifestData(xml));
|
|
17
|
+
}
|
|
18
|
+
async getData() {
|
|
19
|
+
return this._data;
|
|
20
|
+
}
|
|
21
|
+
async getTexture(name) {
|
|
22
|
+
const current = this._textures.get(name);
|
|
23
|
+
if (current != null)
|
|
24
|
+
return current;
|
|
25
|
+
const blob = await this._bundle.getBlob(`${name}.png`);
|
|
26
|
+
const texture = HitTexture_1.HitTexture.fromBlob(blob);
|
|
27
|
+
this._textures.set(name, texture);
|
|
28
|
+
return texture;
|
|
29
|
+
}
|
|
30
|
+
async getManifest() {
|
|
31
|
+
return this._manifest;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.AvatarEffectBundle = AvatarEffectBundle;
|