@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,561 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.RoomModelVisualization = void 0;
|
|
37
|
+
const PIXI = __importStar(require("pixi.js"));
|
|
38
|
+
const rxjs_1 = require("rxjs");
|
|
39
|
+
const getZOrder_1 = require("../../util/getZOrder");
|
|
40
|
+
const EventManagerContainer_1 = require("../events/EventManagerContainer");
|
|
41
|
+
const Stair_1 = require("./parts/Stair");
|
|
42
|
+
const StairCorner_1 = require("./parts/StairCorner");
|
|
43
|
+
const Tile_1 = require("./parts/Tile");
|
|
44
|
+
const TileCursor_1 = require("./parts/TileCursor");
|
|
45
|
+
const WallLeft_1 = require("./parts/WallLeft");
|
|
46
|
+
const WallOuterCorner_1 = require("./parts/WallOuterCorner");
|
|
47
|
+
const WallRight_1 = require("./parts/WallRight");
|
|
48
|
+
const RoomLandscapeMaskSprite_1 = require("./RoomLandscapeMaskSprite");
|
|
49
|
+
const getTileMapBounds_1 = require("./util/getTileMapBounds");
|
|
50
|
+
const LegacyWallGeometry_1 = require("./util/LegacyWallGeometry");
|
|
51
|
+
class RoomModelVisualization extends PIXI.Container {
|
|
52
|
+
constructor(_eventManager, _application, parsedTileMap) {
|
|
53
|
+
super();
|
|
54
|
+
this._eventManager = _eventManager;
|
|
55
|
+
this._application = _application;
|
|
56
|
+
this.parsedTileMap = parsedTileMap;
|
|
57
|
+
this._hideTileCursor = false;
|
|
58
|
+
this._hideWalls = false;
|
|
59
|
+
this._hideFloor = false;
|
|
60
|
+
this._positionalContainer = new PIXI.Container();
|
|
61
|
+
this._behindWallLayer = new PIXI.Container();
|
|
62
|
+
this._wallLayer = new PIXI.Container();
|
|
63
|
+
this._tileLayer = new PIXI.Container();
|
|
64
|
+
this._primaryLayer = new PIXI.Container();
|
|
65
|
+
this._landscapeLayer = new PIXI.Container();
|
|
66
|
+
this._wallHitAreaLayer = new PIXI.Container();
|
|
67
|
+
this._masksLayer = new PIXI.Container();
|
|
68
|
+
this._walls = [];
|
|
69
|
+
this._tiles = [];
|
|
70
|
+
this._tileCursors = [];
|
|
71
|
+
this._masks = new Map();
|
|
72
|
+
this._parts = new Set();
|
|
73
|
+
this._borderWidth = 8;
|
|
74
|
+
this._tileHeight = 8;
|
|
75
|
+
this._wallHeight = 116;
|
|
76
|
+
this._onActiveTileChange = new rxjs_1.Subject();
|
|
77
|
+
this._onActiveWallChange = new rxjs_1.Subject();
|
|
78
|
+
this._onTileClick = new rxjs_1.Subject();
|
|
79
|
+
this._refreshRoom = false;
|
|
80
|
+
this._rebuildRoom = false;
|
|
81
|
+
this._handleTick = () => {
|
|
82
|
+
if (this._rebuildRoom) {
|
|
83
|
+
this._rebuildRoom = false;
|
|
84
|
+
this._updateHeightmap();
|
|
85
|
+
}
|
|
86
|
+
if (this._refreshRoom) {
|
|
87
|
+
this._refreshRoom = false;
|
|
88
|
+
this._updateParts();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
this._tileMapBounds = (0, getTileMapBounds_1.getTileMapBounds)(this.parsedTileMap.parsedTileTypes, {
|
|
92
|
+
x: this.parsedTileMap.wallOffsets.x,
|
|
93
|
+
y: this.parsedTileMap.wallOffsets.y,
|
|
94
|
+
});
|
|
95
|
+
this._behindWallLayer.label = "BEHIND_WALL";
|
|
96
|
+
this._wallLayer.label = "WALL";
|
|
97
|
+
this._wallHitAreaLayer.label = "WALL_HIT";
|
|
98
|
+
this._tileLayer.label = "TILES";
|
|
99
|
+
this._landscapeLayer.label = "LANDSCAPE";
|
|
100
|
+
this._primaryLayer.label = "PRIMARY";
|
|
101
|
+
this.addChild(this._behindWallLayer);
|
|
102
|
+
this.addChild(this._wallLayer);
|
|
103
|
+
this.addChild(this._wallHitAreaLayer);
|
|
104
|
+
this.addChild(this._tileLayer);
|
|
105
|
+
this.addChild(this._landscapeLayer);
|
|
106
|
+
this.addChild(this._primaryLayer);
|
|
107
|
+
this.addChild(this._masksLayer);
|
|
108
|
+
this._positionalContainer.x = -this.roomBounds.minX;
|
|
109
|
+
this._positionalContainer.y = -this.roomBounds.minY;
|
|
110
|
+
this._primaryLayer.sortableChildren = true;
|
|
111
|
+
this._tileLayer.sortableChildren = true;
|
|
112
|
+
this._primaryLayer.interactiveChildren = false;
|
|
113
|
+
this._tileLayer.interactiveChildren = false;
|
|
114
|
+
this._behindWallLayer.interactiveChildren = false;
|
|
115
|
+
this._landscapeLayer.interactiveChildren = false;
|
|
116
|
+
this._masksLayer.interactiveChildren = false;
|
|
117
|
+
this.addChild(this._positionalContainer);
|
|
118
|
+
this._eventManager.coordinateRoot = this;
|
|
119
|
+
this._eventManagerContainer = new EventManagerContainer_1.EventManagerContainer(this._application, this._eventManager);
|
|
120
|
+
this._updateHeightmap();
|
|
121
|
+
this._application.ticker.add(this._handleTick);
|
|
122
|
+
}
|
|
123
|
+
addPart(part) {
|
|
124
|
+
this._parts.add(part);
|
|
125
|
+
part.update(this._getCurrentRoomPartData());
|
|
126
|
+
return {
|
|
127
|
+
remove: () => {
|
|
128
|
+
this._parts.delete(part);
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
getMaskLevel(roomX, roomY) {
|
|
133
|
+
return {
|
|
134
|
+
roomX,
|
|
135
|
+
roomY,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
get onTileClick() {
|
|
139
|
+
return this._onTileClick;
|
|
140
|
+
}
|
|
141
|
+
get hideFloor() {
|
|
142
|
+
return this._hideFloor;
|
|
143
|
+
}
|
|
144
|
+
set hideFloor(value) {
|
|
145
|
+
this._hideFloor = value;
|
|
146
|
+
this._rebuildRoom = true;
|
|
147
|
+
}
|
|
148
|
+
get hideWalls() {
|
|
149
|
+
return this._hideWalls;
|
|
150
|
+
}
|
|
151
|
+
set hideWalls(value) {
|
|
152
|
+
this._hideWalls = value;
|
|
153
|
+
this._rebuildRoom = true;
|
|
154
|
+
}
|
|
155
|
+
get hideTileCursor() {
|
|
156
|
+
return this._hideTileCursor;
|
|
157
|
+
}
|
|
158
|
+
set hideTileCursor(value) {
|
|
159
|
+
this._hideTileCursor = value;
|
|
160
|
+
this._rebuildRoom = true;
|
|
161
|
+
}
|
|
162
|
+
get wallTexture() {
|
|
163
|
+
return this._wallTexture;
|
|
164
|
+
}
|
|
165
|
+
set wallTexture(value) {
|
|
166
|
+
this._wallTexture = value;
|
|
167
|
+
this._refreshRoom = true;
|
|
168
|
+
}
|
|
169
|
+
get floorTexture() {
|
|
170
|
+
return this._floorTexture;
|
|
171
|
+
}
|
|
172
|
+
set floorTexture(value) {
|
|
173
|
+
this._floorTexture = value;
|
|
174
|
+
this._refreshRoom = true;
|
|
175
|
+
}
|
|
176
|
+
get wallHeight() {
|
|
177
|
+
return this._wallHeight;
|
|
178
|
+
}
|
|
179
|
+
set wallHeight(value) {
|
|
180
|
+
this._wallHeight = value;
|
|
181
|
+
this._refreshRoom = true;
|
|
182
|
+
}
|
|
183
|
+
get tileHeight() {
|
|
184
|
+
return this._tileHeight;
|
|
185
|
+
}
|
|
186
|
+
set tileHeight(value) {
|
|
187
|
+
this._tileHeight = value;
|
|
188
|
+
this._refreshRoom = true;
|
|
189
|
+
}
|
|
190
|
+
get wallDepth() {
|
|
191
|
+
return this._borderWidth;
|
|
192
|
+
}
|
|
193
|
+
set wallDepth(value) {
|
|
194
|
+
this._borderWidth = value;
|
|
195
|
+
this._refreshRoom = true;
|
|
196
|
+
}
|
|
197
|
+
get roomBounds() {
|
|
198
|
+
const hasWalls = this.hideWalls || this.hideFloor;
|
|
199
|
+
const minOffsetY = hasWalls ? 0 : -this._wallHeight - this._borderWidth;
|
|
200
|
+
const minXOffset = hasWalls ? 0 : -this._borderWidth;
|
|
201
|
+
const maxOffsetX = hasWalls ? 0 : this._borderWidth;
|
|
202
|
+
const maxOffsetY = hasWalls ? 0 : this._tileHeight;
|
|
203
|
+
return {
|
|
204
|
+
minX: this._tileMapBounds.minX + minXOffset,
|
|
205
|
+
maxX: this._tileMapBounds.maxX + maxOffsetX,
|
|
206
|
+
minY: this._tileMapBounds.minY + minOffsetY,
|
|
207
|
+
maxY: this._tileMapBounds.maxY + maxOffsetY,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
get rectangle() {
|
|
211
|
+
return {
|
|
212
|
+
x: this.x,
|
|
213
|
+
y: this.y,
|
|
214
|
+
width: this.roomBounds.maxX - this.roomBounds.minX,
|
|
215
|
+
height: this.roomBounds.maxY - this.roomBounds.minY,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
get wallLeftColor() {
|
|
219
|
+
return this._wallLeftColor;
|
|
220
|
+
}
|
|
221
|
+
set wallLeftColor(value) {
|
|
222
|
+
this._wallLeftColor = value;
|
|
223
|
+
this._refreshRoom = true;
|
|
224
|
+
}
|
|
225
|
+
get wallRightColor() {
|
|
226
|
+
return this._wallRightColor;
|
|
227
|
+
}
|
|
228
|
+
set wallRightColor(value) {
|
|
229
|
+
this._wallRightColor = value;
|
|
230
|
+
this._refreshRoom = true;
|
|
231
|
+
}
|
|
232
|
+
get wallTopColor() {
|
|
233
|
+
return this._wallTopColor;
|
|
234
|
+
}
|
|
235
|
+
set wallTopColor(value) {
|
|
236
|
+
this._wallTopColor = value;
|
|
237
|
+
this._refreshRoom = true;
|
|
238
|
+
}
|
|
239
|
+
get tileLeftColor() {
|
|
240
|
+
return this._tileLeftColor;
|
|
241
|
+
}
|
|
242
|
+
set tileLeftColor(value) {
|
|
243
|
+
this._tileLeftColor = value;
|
|
244
|
+
this._refreshRoom = true;
|
|
245
|
+
}
|
|
246
|
+
get tileRightColor() {
|
|
247
|
+
return this._tileRightColor;
|
|
248
|
+
}
|
|
249
|
+
set tileRightColor(value) {
|
|
250
|
+
this._tileRightColor = value;
|
|
251
|
+
this._refreshRoom = true;
|
|
252
|
+
}
|
|
253
|
+
get tileTopColor() {
|
|
254
|
+
return this._tileTopColor;
|
|
255
|
+
}
|
|
256
|
+
set tileTopColor(value) {
|
|
257
|
+
this._tileTopColor = value;
|
|
258
|
+
this._refreshRoom = true;
|
|
259
|
+
}
|
|
260
|
+
get onActiveTileChange() {
|
|
261
|
+
return this._onActiveTileChange.asObservable();
|
|
262
|
+
}
|
|
263
|
+
get onActiveWallChange() {
|
|
264
|
+
return this._onActiveWallChange.asObservable();
|
|
265
|
+
}
|
|
266
|
+
get container() {
|
|
267
|
+
return this._primaryLayer;
|
|
268
|
+
}
|
|
269
|
+
get behindWallContainer() {
|
|
270
|
+
return this._behindWallLayer;
|
|
271
|
+
}
|
|
272
|
+
get landscapeContainer() {
|
|
273
|
+
return this._landscapeLayer;
|
|
274
|
+
}
|
|
275
|
+
get floorContainer() {
|
|
276
|
+
return this._tileLayer;
|
|
277
|
+
}
|
|
278
|
+
get wallContainer() {
|
|
279
|
+
return this._wallLayer;
|
|
280
|
+
}
|
|
281
|
+
destroy() {
|
|
282
|
+
var _a;
|
|
283
|
+
super.destroy();
|
|
284
|
+
this._destroyAllSprites();
|
|
285
|
+
(_a = this._eventManagerContainer) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
286
|
+
this._eventManagerContainer = undefined;
|
|
287
|
+
this._application.ticker.remove(this._handleTick);
|
|
288
|
+
}
|
|
289
|
+
addMask(id, element) {
|
|
290
|
+
const existing = this._masks.get(id);
|
|
291
|
+
const current = existing !== null && existing !== void 0 ? existing : new RoomLandscapeMaskSprite_1.RoomLandscapeMaskSprite({
|
|
292
|
+
renderer: this._application.renderer,
|
|
293
|
+
roomBounds: this.roomBounds,
|
|
294
|
+
});
|
|
295
|
+
current.addSprite(element);
|
|
296
|
+
this._primaryLayer.addChild(current);
|
|
297
|
+
if (existing == null) {
|
|
298
|
+
this._masks.set(id, current);
|
|
299
|
+
this._updateParts();
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
update: () => current.updateSprite(element),
|
|
303
|
+
remove: () => current.removeSprite(element),
|
|
304
|
+
sprite: element,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
getScreenPosition(roomX, roomY, roomZ) {
|
|
308
|
+
return this._getPosition(roomX, roomY, roomZ);
|
|
309
|
+
}
|
|
310
|
+
_getCurrentRoomPartData() {
|
|
311
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
312
|
+
return {
|
|
313
|
+
borderWidth: this._borderWidth,
|
|
314
|
+
tileHeight: this._tileHeight,
|
|
315
|
+
wallHeight: this._getLargestWallHeight(),
|
|
316
|
+
wallLeftColor: (_a = this._wallLeftColor) !== null && _a !== void 0 ? _a : 0x91949f,
|
|
317
|
+
wallRightColor: (_b = this._wallRightColor) !== null && _b !== void 0 ? _b : 0xbbbecd,
|
|
318
|
+
wallTopColor: (_c = this._wallTopColor) !== null && _c !== void 0 ? _c : 0x70727b,
|
|
319
|
+
tileLeftColor: (_d = this._tileLeftColor) !== null && _d !== void 0 ? _d : 0x838357,
|
|
320
|
+
tileRightColor: (_e = this._tileRightColor) !== null && _e !== void 0 ? _e : 0x666644,
|
|
321
|
+
tileTopColor: (_f = this._tileTopColor) !== null && _f !== void 0 ? _f : 0x989865,
|
|
322
|
+
tileTexture: (_g = this._floorTexture) !== null && _g !== void 0 ? _g : PIXI.Texture.WHITE,
|
|
323
|
+
wallTexture: (_h = this._wallTexture) !== null && _h !== void 0 ? _h : PIXI.Texture.WHITE,
|
|
324
|
+
masks: this._masks,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Wall parts subtract their own tile height from this, so it is measured from
|
|
329
|
+
* tile height zero rather than from the lowest tile in the room. Habbo caps
|
|
330
|
+
* how far above the floor a wall may reach, which is what stops a room with a
|
|
331
|
+
* tall platform from growing walls several screens high.
|
|
332
|
+
*/
|
|
333
|
+
_getLargestWallHeight() {
|
|
334
|
+
return (Math.min(LegacyWallGeometry_1.LegacyWallGeometry.MAX_WALL_ADDITIONAL_HEIGHT, this.parsedTileMap.highestTile) *
|
|
335
|
+
32 +
|
|
336
|
+
this._wallHeight);
|
|
337
|
+
}
|
|
338
|
+
_destroyAllSprites() {
|
|
339
|
+
[...this._tileCursors, ...this._tiles, ...this._walls].forEach((part) => part.destroy());
|
|
340
|
+
this._tileCursors = [];
|
|
341
|
+
this._tiles = [];
|
|
342
|
+
this._walls = [];
|
|
343
|
+
}
|
|
344
|
+
_updateHeightmap() {
|
|
345
|
+
this._destroyAllSprites();
|
|
346
|
+
for (let y = 0; y < this.parsedTileMap.parsedTileTypes.length; y++) {
|
|
347
|
+
for (let x = 0; x < this.parsedTileMap.parsedTileTypes[y].length; x++) {
|
|
348
|
+
const cell = this.parsedTileMap.parsedTileTypes[y][x];
|
|
349
|
+
this._createHeightmapElement(cell, x, y);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
this._updateParts();
|
|
353
|
+
this._positionalContainer.x = -this.roomBounds.minX;
|
|
354
|
+
this._positionalContainer.y = -this.roomBounds.minY;
|
|
355
|
+
}
|
|
356
|
+
_updateParts() {
|
|
357
|
+
const currentRoomPartData = this._getCurrentRoomPartData();
|
|
358
|
+
[...this._tiles, ...this._walls, ...this._parts].forEach((tile) => tile.update(currentRoomPartData));
|
|
359
|
+
}
|
|
360
|
+
_createHeightmapElement(element, x, y) {
|
|
361
|
+
switch (element.type) {
|
|
362
|
+
case "wall":
|
|
363
|
+
this._createWallElement(element, x, y, element.height);
|
|
364
|
+
break;
|
|
365
|
+
case "tile":
|
|
366
|
+
this._createTileElement(x, y, element.z);
|
|
367
|
+
break;
|
|
368
|
+
case "door":
|
|
369
|
+
this._createDoor(x, y, element.z, element.wall);
|
|
370
|
+
break;
|
|
371
|
+
case "stairs":
|
|
372
|
+
this._createStair(x, y, element.z, element.kind);
|
|
373
|
+
break;
|
|
374
|
+
case "stairCorner":
|
|
375
|
+
this._createStairCorner(x, y, element.z, element.kind);
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
_createStairCorner(x, y, z, kind) {
|
|
380
|
+
const stair = new StairCorner_1.StairCorner({ type: kind });
|
|
381
|
+
const position = this._getPosition(x, y, z);
|
|
382
|
+
stair.x = position.x;
|
|
383
|
+
stair.y = position.y;
|
|
384
|
+
this._tiles.push(stair);
|
|
385
|
+
this._tileLayer.addChild(stair);
|
|
386
|
+
this._createTileCursor(x, y, z);
|
|
387
|
+
this._createTileCursor(x, y, z + 1);
|
|
388
|
+
}
|
|
389
|
+
_createStair(x, y, z, direction) {
|
|
390
|
+
const stair = new Stair_1.Stair({
|
|
391
|
+
tileHeight: this._tileHeight,
|
|
392
|
+
direction,
|
|
393
|
+
});
|
|
394
|
+
const position = this._getPosition(x, y, z);
|
|
395
|
+
stair.x = position.x;
|
|
396
|
+
stair.y = position.y;
|
|
397
|
+
this._tiles.push(stair);
|
|
398
|
+
this._tileLayer.addChild(stair);
|
|
399
|
+
this._createTileCursor(x, y, z);
|
|
400
|
+
this._createTileCursor(x, y, z + 1);
|
|
401
|
+
}
|
|
402
|
+
_createDoor(x, y, z, wall) {
|
|
403
|
+
this._createTileElement(x, y, z, this._behindWallLayer);
|
|
404
|
+
if (wall) {
|
|
405
|
+
this._createLeftWall(x, y, z, { hideBorder: false, cutawayHeight: 90 });
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
shouldShowBorders(x, y) {
|
|
409
|
+
let bottomTile;
|
|
410
|
+
let rightTile;
|
|
411
|
+
const tileMap = this.parsedTileMap.parsedTileTypes;
|
|
412
|
+
const currentTile = tileMap[y][x];
|
|
413
|
+
if (tileMap[y + 1] !== undefined &&
|
|
414
|
+
tileMap[y + 1][x] !== undefined) {
|
|
415
|
+
bottomTile = tileMap[y + 1][x];
|
|
416
|
+
}
|
|
417
|
+
if (tileMap[y][x + 1] !== undefined) {
|
|
418
|
+
rightTile = tileMap[y][x + 1];
|
|
419
|
+
}
|
|
420
|
+
return {
|
|
421
|
+
showLeftBorder: (!Boolean(bottomTile) ||
|
|
422
|
+
["stairs", "stairCorner", "door", "hidden"].includes(bottomTile === null || bottomTile === void 0 ? void 0 : bottomTile.type) ||
|
|
423
|
+
// @ts-ignore
|
|
424
|
+
((bottomTile === null || bottomTile === void 0 ? void 0 : bottomTile.type) == 'tile' && (bottomTile === null || bottomTile === void 0 ? void 0 : bottomTile.z) != currentTile.z)),
|
|
425
|
+
showRightBorder: (!Boolean(rightTile) ||
|
|
426
|
+
["stairs", "stairCorner", "door", "hidden"].includes(rightTile === null || rightTile === void 0 ? void 0 : rightTile.type) ||
|
|
427
|
+
// @ts-ignore
|
|
428
|
+
((rightTile === null || rightTile === void 0 ? void 0 : rightTile.type) == 'tile' && (rightTile === null || rightTile === void 0 ? void 0 : rightTile.z) != currentTile.z))
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
_createTileElement(x, y, z, container) {
|
|
432
|
+
if (this._hideFloor)
|
|
433
|
+
return;
|
|
434
|
+
const showBorders = this.shouldShowBorders(x, y);
|
|
435
|
+
const tile = new Tile_1.Tile({ color: "#eeeeee", tileHeight: this._tileHeight, showBorders });
|
|
436
|
+
const xEven = x % 2 === 0;
|
|
437
|
+
const yEven = y % 2 === 0;
|
|
438
|
+
tile.tilePositions = new PIXI.Point(xEven ? 32 : 0, yEven ? 32 : 0);
|
|
439
|
+
const position = this._getPosition(x, y, z);
|
|
440
|
+
tile.x = position.x;
|
|
441
|
+
tile.y = position.y;
|
|
442
|
+
(container !== null && container !== void 0 ? container : this._tileLayer).addChild(tile);
|
|
443
|
+
this._tiles.push(tile);
|
|
444
|
+
this._createTileCursor(x, y, z, container);
|
|
445
|
+
}
|
|
446
|
+
_createTileCursor(x, y, z, container) {
|
|
447
|
+
if (this._hideTileCursor)
|
|
448
|
+
return;
|
|
449
|
+
const position = { roomX: x, roomY: y, roomZ: z };
|
|
450
|
+
const cursor = new TileCursor_1.TileCursor(this._eventManager, position, (pos, event) => {
|
|
451
|
+
this._onTileClick.next({ position, event });
|
|
452
|
+
}, () => {
|
|
453
|
+
this._onActiveTileChange.next(position);
|
|
454
|
+
}, () => {
|
|
455
|
+
this._onActiveTileChange.next(undefined);
|
|
456
|
+
});
|
|
457
|
+
const { x: posX, y: posY } = this._getPosition(x, y, z);
|
|
458
|
+
cursor.x = posX;
|
|
459
|
+
cursor.y = posY;
|
|
460
|
+
cursor.zIndex = (0, getZOrder_1.getZOrder)(x, y, z) - 1000;
|
|
461
|
+
this._tileCursors.push(cursor);
|
|
462
|
+
(container !== null && container !== void 0 ? container : this._primaryLayer).addChild(cursor);
|
|
463
|
+
}
|
|
464
|
+
_createRightWall(roomX, roomY, roomZ, options) {
|
|
465
|
+
var _a;
|
|
466
|
+
const wall = new WallRight_1.WallRight({
|
|
467
|
+
hideBorder: (_a = options.hideBorder) !== null && _a !== void 0 ? _a : false,
|
|
468
|
+
onMouseMove: (event) => {
|
|
469
|
+
this._onActiveWallChange.next({
|
|
470
|
+
roomX,
|
|
471
|
+
roomY,
|
|
472
|
+
offsetX: -event.offsetX,
|
|
473
|
+
offsetY: event.offsetY + wall.pixelHeight - 16 - event.offsetX,
|
|
474
|
+
wall: "r",
|
|
475
|
+
});
|
|
476
|
+
},
|
|
477
|
+
onMouseOut: () => {
|
|
478
|
+
this._onActiveWallChange.next(undefined);
|
|
479
|
+
},
|
|
480
|
+
hitAreaContainer: this._wallHitAreaLayer,
|
|
481
|
+
});
|
|
482
|
+
const { x, y } = this._getPosition(roomX, roomY + 1, roomZ);
|
|
483
|
+
wall.x = x + 32;
|
|
484
|
+
wall.y = y;
|
|
485
|
+
wall.roomZ = roomZ;
|
|
486
|
+
this._wallLayer.addChild(wall);
|
|
487
|
+
this._walls.push(wall);
|
|
488
|
+
}
|
|
489
|
+
_createLeftWall(roomX, roomY, roomZ, { hideBorder = false, cutawayHeight, }) {
|
|
490
|
+
if (this._hideWalls)
|
|
491
|
+
return;
|
|
492
|
+
const wall = new WallLeft_1.WallLeft({
|
|
493
|
+
hideBorder,
|
|
494
|
+
onMouseMove: (event) => {
|
|
495
|
+
this._onActiveWallChange.next({
|
|
496
|
+
roomX,
|
|
497
|
+
roomY,
|
|
498
|
+
offsetX: event.offsetX,
|
|
499
|
+
offsetY: event.offsetY + wall.pixelHeight,
|
|
500
|
+
wall: "l",
|
|
501
|
+
});
|
|
502
|
+
},
|
|
503
|
+
onMouseOut: () => {
|
|
504
|
+
this._onActiveWallChange.next(undefined);
|
|
505
|
+
},
|
|
506
|
+
hitAreaContainer: this._wallHitAreaLayer,
|
|
507
|
+
cutawayHeight: cutawayHeight,
|
|
508
|
+
});
|
|
509
|
+
const { x, y } = this._getPosition(roomX + 1, roomY, roomZ);
|
|
510
|
+
wall.x = x;
|
|
511
|
+
wall.y = y;
|
|
512
|
+
wall.roomZ = roomZ;
|
|
513
|
+
this._wallLayer.addChild(wall);
|
|
514
|
+
this._walls.push(wall);
|
|
515
|
+
}
|
|
516
|
+
_createOuterBorder(roomX, roomY, roomZ) {
|
|
517
|
+
const wall = new WallOuterCorner_1.WallOuterCorner();
|
|
518
|
+
const { x, y } = this._getPosition(roomX + 1, roomY, roomZ);
|
|
519
|
+
wall.x = x;
|
|
520
|
+
wall.y = y;
|
|
521
|
+
wall.roomZ = roomZ;
|
|
522
|
+
this._wallLayer.addChild(wall);
|
|
523
|
+
this._walls.push(wall);
|
|
524
|
+
}
|
|
525
|
+
_createWallElement(element, x, y, z) {
|
|
526
|
+
if (this._hideWalls || this._hideFloor)
|
|
527
|
+
return;
|
|
528
|
+
switch (element.kind) {
|
|
529
|
+
case "colWall":
|
|
530
|
+
this._createRightWall(x, y, z, { hideBorder: element.hideBorder });
|
|
531
|
+
break;
|
|
532
|
+
case "rowWall":
|
|
533
|
+
this._createLeftWall(x, y, z, { hideBorder: element.hideBorder });
|
|
534
|
+
break;
|
|
535
|
+
case "innerCorner":
|
|
536
|
+
this._createRightWall(x, y, z, { hideBorder: false });
|
|
537
|
+
this._createLeftWall(x, y, z, { hideBorder: true });
|
|
538
|
+
break;
|
|
539
|
+
case "outerCorner":
|
|
540
|
+
this._createOuterBorder(x, y, z);
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
_getPosition(roomX, roomY, roomZ) {
|
|
545
|
+
const getBasePosition = () => {
|
|
546
|
+
return { x: roomX, y: roomY };
|
|
547
|
+
};
|
|
548
|
+
const { x, y } = getBasePosition();
|
|
549
|
+
const base = 32;
|
|
550
|
+
// TODO: Right now we are subtracting the tileMapBounds here.
|
|
551
|
+
// This is so the landscapes work correctly. This has something with the mask position being negative for some walls.
|
|
552
|
+
// This fixes it for now.
|
|
553
|
+
const xPos = x * base - y * base;
|
|
554
|
+
const yPos = x * (base / 2) + y * (base / 2);
|
|
555
|
+
return {
|
|
556
|
+
x: xPos,
|
|
557
|
+
y: yPos - roomZ * 32,
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
exports.RoomModelVisualization = RoomModelVisualization;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IRoomContext } from "../../interfaces/IRoomContext";
|
|
2
|
+
import { IRoomObject } from "../../interfaces/IRoomObject";
|
|
3
|
+
import { IRoomObjectContainer } from "../../interfaces/IRoomObjectContainer";
|
|
4
|
+
export declare class RoomObjectContainer implements IRoomObjectContainer {
|
|
5
|
+
private _roomObjects;
|
|
6
|
+
private _context;
|
|
7
|
+
get roomObjects(): ReadonlySet<IRoomObject>;
|
|
8
|
+
get context(): IRoomContext | undefined;
|
|
9
|
+
set context(value: IRoomContext | undefined);
|
|
10
|
+
addRoomObject(object: IRoomObject): void;
|
|
11
|
+
removeRoomObject(object: IRoomObject): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoomObjectContainer = void 0;
|
|
4
|
+
class RoomObjectContainer {
|
|
5
|
+
constructor() {
|
|
6
|
+
this._roomObjects = new Set();
|
|
7
|
+
}
|
|
8
|
+
get roomObjects() {
|
|
9
|
+
return this._roomObjects;
|
|
10
|
+
}
|
|
11
|
+
get context() {
|
|
12
|
+
return this._context;
|
|
13
|
+
}
|
|
14
|
+
set context(value) {
|
|
15
|
+
this._context = value;
|
|
16
|
+
}
|
|
17
|
+
addRoomObject(object) {
|
|
18
|
+
if (this._context == null)
|
|
19
|
+
throw new Error("Context wasn't supplied to RoomObjectContainer");
|
|
20
|
+
if (this._roomObjects.has(object)) {
|
|
21
|
+
// The object already exists in this room.
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
object.setParent(this._context);
|
|
25
|
+
this._roomObjects.add(object);
|
|
26
|
+
}
|
|
27
|
+
removeRoomObject(object) {
|
|
28
|
+
if (!this._roomObjects.has(object)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this._roomObjects.delete(object);
|
|
32
|
+
object.destroy();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.RoomObjectContainer = RoomObjectContainer;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as PIXI from "pixi.js";
|
|
2
|
+
import { TileType } from "../../types/TileType";
|
|
3
|
+
import { Room } from "./Room";
|
|
4
|
+
export type EditorPaintCallback = (tiles: Array<{
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}>, type: TileType, expandTo?: {
|
|
8
|
+
minX: number;
|
|
9
|
+
minY: number;
|
|
10
|
+
maxX: number;
|
|
11
|
+
maxY: number;
|
|
12
|
+
}) => void;
|
|
13
|
+
export declare class TileMapEditorLayer extends PIXI.Container {
|
|
14
|
+
private _gridInternal;
|
|
15
|
+
private _gridExternal;
|
|
16
|
+
private _selectionLayer;
|
|
17
|
+
private _hoverLayer;
|
|
18
|
+
private _activeTile;
|
|
19
|
+
private _tilemap;
|
|
20
|
+
private _tilePositions;
|
|
21
|
+
private _dragStart;
|
|
22
|
+
private _dragEnd;
|
|
23
|
+
private _isPainting;
|
|
24
|
+
private _lastHovered;
|
|
25
|
+
private _onPaint;
|
|
26
|
+
private _room;
|
|
27
|
+
private _isPanMode;
|
|
28
|
+
setPanning(active: boolean): void;
|
|
29
|
+
constructor(room: Room, onPaint: EditorPaintCallback);
|
|
30
|
+
setActiveTile(type: TileType): void;
|
|
31
|
+
refresh(): void;
|
|
32
|
+
private _isoPos;
|
|
33
|
+
private _build;
|
|
34
|
+
private _drawDiamondLine;
|
|
35
|
+
private _drawDiamondFill;
|
|
36
|
+
private _isErasing;
|
|
37
|
+
private _drawHover;
|
|
38
|
+
private _drawSelection;
|
|
39
|
+
private _hitTest;
|
|
40
|
+
private _tilesInRect;
|
|
41
|
+
private _commitPaint;
|
|
42
|
+
private _attachEvents;
|
|
43
|
+
destroy(): void;
|
|
44
|
+
}
|