Releases: casual-simulation/casualos
Releases Β· casual-simulation/casualos
v3.1.2
π Improvements
- Improved
os.registerTagPrefix(prefix, options?)
to accept aname
property in theoptions
object that will be used as a hint for the user. - Added support for Vector and Rotation values for many tags. The following tags have been added as alternatives to using multiple tags to contain 3D information:
cameraPosition
replacescameraPositionX
,cameraPositionY
, andcameraPositionZ
.cameraRotation
replacescameraRotationX
,cameraRotationY
, andcameraRotationZ
.cameraFocus
replacescameraFocusX
,cameraFocusY
, andcameraFocusZ
.cameraPositionOffset
replacescameraPositionOffsetX
,cameraPositionOffsetY
, andcameraPositionOffsetZ
.cameraRotationOffset
replacescameraRotationOffsetX
,cameraRotationOffsetY
, andcameraRotationOffsetZ
.deviceRotation
replacesdeviceRotationX
,deviceRotationY
, anddeviceRotationZ
.portalPannableMin
replacesportalPannableMinX
andportalPannableMinY
.portalPannableMax
replacesportalPannableMaxX
andportalPannableMaxY
.pointerPixel
replacespointerPixelX
andpointerPixelY
.mousePointerPosition
replacesmousePointerPositionX
,mousePointerPositionY
, andmousePointerPositionZ
.mousePointerRotation
replacesmousePointerRotationX
,mousePointerRotationY
, andmousePointerRotationZ
.leftPointerPosition
replacesleftPointerPositionX
,leftPointerPositionY
, andleftPointerPositionZ
.leftPointerRotation
replacesleftPointerRotationX
,leftPointerRotationY
, andleftPointerRotationZ
.rightPointerPosition
replacesrightPointerPositionX
,rightPointerPositionY
, andrightPointerPositionZ
.rightPointerRotation
replacesrightPointerRotationX
,rightPointerRotationY
, andrightPointerRotationZ
.cursorHotspot
replacescursorHotspotX
andcursorHotspotY
.portalCursorHotspot
replacesportalCursorHotspotX
andportalCursorHotspotY
.
- Added the
os.requestWakeLock()
,os.disableWakeLock()
, andos.getWakeLockConfiguration()
functions.os.requestWakeLock()
asks the user for the ability to keep the screen awake, and if they accept will enable a wake lock that will keep the screen on. Returns a promise that resolves once the wake lock has been granted.os.disableWakeLock()
disables the wake lock and allows the computer to sleep. Returns a promise that resolves once the wake lock has been disabled.os.getWakeLockConfiguration()
gets the current wake lock status. Returns a promise that resolves with the wake lock information.
- Improved
math.intersectPlane()
to accept two additional optional parameters which represent the normal and origin of the plane that the ray should be intersected with.- The new function definition is
math.intersectPlane(origin, direction, planeNormal?, planeDirection)
.planeNormal
is optional and is the normal vector that the plane should use. It defaults toβ‘οΈ0,0,1
.planeDirection
is optional and is the 3D position that the center of the plane should travel through. It defaults toβ‘οΈ0,0,0
.
- The new function definition is
π Bug Fixes
- Fixed an issue where keys reported in
onKeyUp
andonKeyDown
could be specified in the incorrect order.
v3.1.1
π Improvements
- Added the
codeButton
form.- When the bot is placed in a tag dimension (dimension of the form
{botID}.{tag}
) and its form is set tocodeButton
, then it will appear in the multi-line code editor for that tag as a clickable text element. - As such, in order for the button to appear, the bot also needs a
label
tag. - The button can be positioned by line number by using the
[dimension]Start
tag, and the[dimension]End
tag can be used to specify the priority that the button should have compared to other buttons on the same line (higher numbers means lower priority). - When clicked, the button will receive an
@onClick
whisper.
- When the bot is placed in a tag dimension (dimension of the form
- Added the
formRenderOrder
tag.- This tag sets the render order that should be used for a bot in the grid portals.
- Setting this property to a value other than 0 overrides the automatically calculated render order which is based on the distance of each bot to the portal camera.
- It is not recommended to use this tag unless you are dealing with transparency issues caused by overlapping PNG images.
v3.1.0
π Improvements
- Added the
os.createInitializationUpdate(bots)
andos.applyUpdatesToInst(update)
functions.os.createInitializationUpdate(bots)
creates updates that can be used to ensure that an inst is initialized with a specific set of bots. This function is useful for encoding initialization logic that should only be performed in an inst once.bots
- The list of bots that should be included in the update.
os.applyUpdatesToInst(updates)
applies the given list of updates to the current inst.updates
- The list of updates that should be applied to the inst.
- Improved custom apps to support SVG elements.
π Bug Fixes
- Fixed an issue where billboarded bots would display incorrectly when they were parented under a rotated dimension or transformer.
v3.0.21
π Bug Fixes
- Fixed an issue where deleting a GLTF would cause the gridPortal to stop working.
v3.0.20
π Improvements
- Added the ability to use your fingers to click bots in VR/AR.
- Any device that supports the WebXR Hand input module should work.
- Tested with the Oculus Quest 2.
- Added the
keyboard
form.- This creates a virtual keyboard that the user can interact with.
- Clicking keys on the keyboard sends a
@onKeyClick
whisper to the bot.
- Improved the system portal diff tab to set the
editingBot
,editingTag
, andeditingTagSpace
tags on the configBot. - Added the
os.startFormAnimation(bot, animationName, options?)
,os.stopFormAnimation(bot, options?)
,os.listFormAnimations(botOrAddress)
, andos.bufferFormAddressGLTF(address)
functions.os.startFormAnimation(bot, animationName, options?)
is used to trigger an animation on the given bot. Returns a promise that resolves when the animation has started. It accepts the following parameters:bot
- The bot or list of bots that the animation should be triggered on.animationName
- The name or index of the animation that should be started.options
- The additional parameters that should be used for the animation. Optional. It should be an object with the following properties:startTime
- The time that the animation should start playing. It should be the number of miliseconds since the Unix Epoch.initialTime
- The time within the animation clip that the animation should start at in miliseconds.timeScale
- The rate at which the animation plays.loop
- Options for looping. It should be an object with the following properties:mode
- How the animation should loop. It should be eitherrepeat
orpingPong
.count
- The number of times that the animation should loop.
clampWhenFinished
- Whether the final animation values should be preserved when the animation finishes.crossFadeDuration
- The number of miliseconds that the animation should take to cross fade from the previous animation.fadeDuration
- The number of miliseconds that the animation should take to fade in.animationAddress
- The address that the animations should be loaded from.
os.stopFormAnimation(bot, options?)
is used to stop animations on the given bot. Returns a promise that resolves when the animation has stopped. It accepts the following parameters:bot
- The bot or list of bots that animations should be stopped on.options
- The options that should be used to stop the animations. Optional. It should be an object with the following properties:stopTime
- The time that the animation should stop playing. It should be the number of miliseconds since the Unix Epoch.fadeDuration
- The number of miliseconds that the animation should take to fade out.
os.listFormAnimations(botOrAddress)
is used to retrieve the list of animations that are available on a form. Returns a promise that resolves with the animation list. It accepts the following parameters:botOrAddress
- The bot or address that the animation list should be retrieved for.
os.bufferFormAddressGLTF(address)
is used to pre-cache the given address as a GLTF mesh for future use. Returns a promise that resolves when the address has been buffered. It accepts the following parameters:address
- The address that should be loaded.
- Added several listeners that can be used to observe animation changes on bots.
- Currently, they are only sent for animations that are started via
os.startFormAnimation()
. Animations that are triggered via the#formAnimation
tag orexperiment.localFormAnimation()
are not supported. @onFormAnimationStarted
and@onAnyFormAnimationStarted
are sent when an animation has been started.@onFormAnimationStopped
and@onAnyFormAnimationStopped
are sent when an animation has been manually stopped.@onFormAnimationFinished
and@onAnyFormAnimationFinished
are sent when an animation finishes playing.@onFormAnimationLooped
and@onAnyFormAnimationLooped
are sent when an animation restarts per the looping rules that were given in the options object.
- Currently, they are only sent for animations that are started via
- Added support for the
scrollTop
andoffsetHeight
properties for<section>
elements. - Added the
@onDocumentAvailable
listener.@onDocumentAvailable
is a shout that is sent onceglobalThis.document
is first available for scripts to use.- Because of this feature, scripts can now interact with custom apps via
globalThis.document
instead ofos.registerApp()
andos.compileApp()
. - This feature still uses a separate document instances for
os.registerApp()
, so changes toglobalThis.document
will not conflict with any other custom apps.
- Added the Preact render() function to
os.appHooks
. - Improved tooltips to always render entirely on screen. This can help in scenarios where the tooltip should be shown close to the edge of the screen.
π Bug Fixes
- Fixed an issue where
cursor
bots would not update in the multiline editor unless no bots changed for 75ms. - Fixed an issue where
cursor
bots would be duplicated if the user closed the portal that contained the multiline editor and then opened it again. - Fixed an issue where images that were loaded via custom apps would later fail to load as a
formAddress
. - Fixed an issue where floating labels did not work on bots that were transformed by another bot.
- Fixed an issue where tooltips that had multiple words would always word wrap. Now, they will only word wrap if wider than 200px.
v3.0.19
π Bug Fixes
- Fixed an issue that would allow browsers to cache certain HTML files when they should not.
- Fixed an issue where subjectless keys would not work with the new auth system.
- Fixed an issue where the background for floating labels would not match the label if the bot was rotated.
v3.0.18
π₯ Breaking Changes
- Changed uploads to PDF files to upload the binary data of the PDF instead of automatically converting it to UTF-8.
- This affects both
os.showUploadFiles()
and@onFileUpload
.
- This affects both
π Improvements
- Switched PublicOS from Magic.link to a custom auth implementation that gives us more flexibility around how we manage user accounts.
- This is purely an implementation detail, and should not affect any PublicOS/CasualOS features.
- Added the ability to see active PublicOS authentication sessions, when they were granted, and what IP Address they were granted to.
- Improved Custom HTML Apps to copy the following properties from specific element types when an event (like
onLoad
) happens:<img>
- The following properties are copied:width
height
naturalWidth
naturalHeight
currentSrc
<video>
- The following properties are copied:videoWidth
videoHeight
duration
currentSrc
- Moved the "Exit to Grid Portal" button in the system portal from the lower right corner to the lower left corner.
- Improved the systemPortal to support global search by exact matches for
#id
and#space
. - Improved the systemPortal to support comparing systems of bots against each other.
- This works by comparing two separate system tags. The first tag is
#system
(or whatever is specified by#systemPortalTag
on the config bot) and the second tag is specified by the#systemPortalDiff
on the config bot. - For example, if the
#systemPortal
is set tocustom
and the#systemPortalDiff
tag is set tosystem2
, then bots that containcustom
in their#system
tag will be compared against bots that match using their#system2
tag. - The result is useful for creating visualizations of change for system bots.
- See the documentation for more information.
- Also check out the example: https://ab1.bot/?ab=diffPortalExample
- This works by comparing two separate system tags. The first tag is
- Added the
os.appHooks
property that contains hook functions.- Hook functions make managing custom app states easier and less tedious.
π Bug Fixes
- Fixed an issue where entering an invalid value into an input box in a custom app would cause the input box to be automatically cleared.
- Fixed an issue where the base color on GLTF models would be overridden with white if no color tag was specified.
- Fixed an issue where self-closing JSX elements that contained attributes would not be compiled correctly.
- Fixed an issue where the meetPortal could fail to start if the meet portal properties were changed before it finished loading external scripts.
- Fixed how progress bars position themselves to better match how labels position themselves.
- Fixed an issue where custom app elements did not support CSS Style properties that started with a hyphen (
-
).
v3.0.17
π Bug Fixes
- Fixed an issue where calling
os.focusOn()
for the mapPortal before the portal has finished loading would cause the camera to focus on an incorrect location. - Fixed an issue where labels would fail to show up on billboarded bots that are directly below or above the portal camera.
- Fixed an issue where hex bot forms were positioned incorrectly.
v3.0.16
π Improvements
- Added the
uv
property to@onClick
,@onAnyBotClicked
,@onDrag
, and@onAnyBotDrag
shouts.- This property contains the UV Coordinates of the texture on the clicked bot that the user clicked.
- UV coordinates are a 2D vector representing the X and Y location on the texture (i.e.
formAddress
) on the bot that was clicked. - UV coordinates are mapped as follows:
- Bottom left of the texture is:
(0, 0)
- Bottom right is:
(1, 0)
- Top left is:
(0, 1)
- Top right is:
(1, 1)
- Bottom left of the texture is:
- Added the
os.raycast(portal, origin, direction)
andos.raycastFromCamera(portal, viewportPosition)
functions.- These functions are useful for finding what bots a particular ray would hit. For example, you could query what bots are under a particular spot of the screen with
os.raycastFromCamera()
. - Currently, the
grid
,miniGrid
,map
andminiMap
portals are supported. - See the documentation for more information and examples.
- These functions are useful for finding what bots a particular ray would hit. For example, you could query what bots are under a particular spot of the screen with
- Added the
os.calculateRayFromCamera(portal, viewportPosition)
function.- This function is useful for finding the 3D path (ray) that travels through a particular screen position of the specified portal's camera.
- Currently, the
grid
,miniGrid
,map
andminiMap
portals are supported. - See the documentation for more information and examples.
- Improved
os.getPublicRecordKey()
to return anerrorReason
for failed requests.
π Bug Fixes
- Fixed
lineStyle = wall
to support the coordinate system changes from v3.0.11.
v3.0.15
π Improvements
- Improved the login system to record user's email/phone number so that we can migrate off of magic.link in the future.