Skip to content

Commit

Permalink
Merge pull request #402 from Quenty/users/quenty/datastore
Browse files Browse the repository at this point in the history
users/quenty/datastore
  • Loading branch information
Quenty authored Aug 23, 2023
2 parents c0cbf5e + a911cda commit df17199
Show file tree
Hide file tree
Showing 165 changed files with 6,493 additions and 969 deletions.
2 changes: 1 addition & 1 deletion aftman.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[tools]
rojo = "quenty/[email protected]"
run-in-roblox = "rojo-rbx/[email protected]"
selene = "Kampfkarren/selene@0.23.1"
selene = "Kampfkarren/selene@0.25.0"
moonwave-extractor = "UpliftGames/[email protected]"
mantle = "blake-mealey/[email protected]"
remodel = "rojo-rbx/[email protected]"
2 changes: 1 addition & 1 deletion games/integration/aftman.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# For more information, see https://github.com/LPGhatguy/aftman
[tools]
rojo = "quenty/[email protected]"
selene = "Kampfkarren/selene@0.23.1"
selene = "Kampfkarren/selene@0.25.0"
6 changes: 5 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Many of these packages represent not just useful code, but useful patterns, or w
### All packages
<!--package-list-generated-start-->

There are 246 packages in Nevermore.
There are 250 packages in Nevermore.

| Package | Description | Install | docs | source | changelog | npm |
| ------- | ----------- | ------- | ---- | ------ | --------- | --- |
Expand Down Expand Up @@ -115,9 +115,11 @@ There are 246 packages in Nevermore.
| [DataStore](https://quenty.github.io/NevermoreEngine/api/DataStore) | Quenty's Datastore implementation for Roblox | `npm i @quenty/datastore` | [docs](https://quenty.github.io/NevermoreEngine/api/DataStore) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/datastore) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/datastore/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/datastore) |
| [DeathReport](https://quenty.github.io/NevermoreEngine/api/DeathReportService) | Death report service which will track the deaths of players | `npm i @quenty/deathreport` | [docs](https://quenty.github.io/NevermoreEngine/api/DeathReportService) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/deathreport) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/deathreport/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/deathreport) |
| [debounce](https://quenty.github.io/NevermoreEngine/api/debounce) | debounce a existing function by timeout | `npm i @quenty/debounce` | [docs](https://quenty.github.io/NevermoreEngine/api/debounce) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/debounce) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/debounce/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/debounce) |
| [DefaultValueUtils](https://quenty.github.io/NevermoreEngine/api/DefaultValueUtils) | Helps get the default or zero value for value types in Roblox | `npm i @quenty/defaultvalueutils` | [docs](https://quenty.github.io/NevermoreEngine/api/DefaultValueUtils) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/defaultvalueutils) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/defaultvalueutils/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/defaultvalueutils) |
| [Deferred](https://quenty.github.io/NevermoreEngine/api/deferred) | deferred (otherwise known as fastSpawn) implementation for Roblox | `npm i @quenty/deferred` | [docs](https://quenty.github.io/NevermoreEngine/api/deferred) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/deferred) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/deferred/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/deferred) |
| [DepthOfField](https://quenty.github.io/NevermoreEngine/api/DepthOfFieldService) | Depth of field service to allow multiple systems to write depth of field | `npm i @quenty/depthoffield` | [docs](https://quenty.github.io/NevermoreEngine/api/DepthOfFieldService) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/depthoffield) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/depthoffield/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/depthoffield) |
| [Draw](https://quenty.github.io/NevermoreEngine/api/Draw) | A utility library to debug things in 3D space for Roblox. | `npm i @quenty/draw` | [docs](https://quenty.github.io/NevermoreEngine/api/Draw) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/draw) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/draw/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/draw) |
| [DuckType](https://quenty.github.io/NevermoreEngine/api/DuckTypeUtils) | Utility functions to duck type a value | `npm i @quenty/ducktype` | [docs](https://quenty.github.io/NevermoreEngine/api/DuckTypeUtils) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/ducktype) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/ducktype/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/ducktype) |
| [EllipticCurveCryptography](https://quenty.github.io/NevermoreEngine/api/EllipticCurveCryptography) | Elliptic curve cryptography forked from BoatBomber, forked from ComputerCraft | `npm i @quenty/ellipticcurvecryptography` | [docs](https://quenty.github.io/NevermoreEngine/api/EllipticCurveCryptography) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/ellipticcurvecryptography) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/ellipticcurvecryptography/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/ellipticcurvecryptography) |
| [Elo](https://quenty.github.io/NevermoreEngine/api/EloUtils) | Elo rating utility library. | `npm i @quenty/elo` | [docs](https://quenty.github.io/NevermoreEngine/api/EloUtils) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/elo) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/elo/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/elo) |
| [EnabledMixin](https://quenty.github.io/NevermoreEngine/api/EnabledMixin) | Adds Enabled/Disabled state to class | `npm i @quenty/enabledmixin` | [docs](https://quenty.github.io/NevermoreEngine/api/EnabledMixin) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/enabledmixin) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/enabledmixin/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/enabledmixin) |
Expand Down Expand Up @@ -266,6 +268,7 @@ There are 246 packages in Nevermore.
| [Snackbar](https://quenty.github.io/NevermoreEngine/api/Snackbar) | Snackbars provide lightweight feedback on an operation at the base of the screen. They automatically disappear after a timeout or user interaction. There can only be one on the screen at a time. | `npm i @quenty/snackbar` | [docs](https://quenty.github.io/NevermoreEngine/api/Snackbar) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/snackbar) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/snackbar/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/snackbar) |
| [SocialServiceUtils](https://quenty.github.io/NevermoreEngine/api/SocialServiceUtils) | Utility functions wrapping SocialService with promises | `npm i @quenty/socialserviceutils` | [docs](https://quenty.github.io/NevermoreEngine/api/SocialServiceUtils) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/socialserviceutils) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/socialserviceutils/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/socialserviceutils) |
| [SoftShutdown](https://quenty.github.io/NevermoreEngine/api/SoftShutdownService) | This service lets you shut down servers without losing a bunch of players. When game.OnClose is called, the script teleports everyone in the server into a reserved server. | `npm i @quenty/softshutdown` | [docs](https://quenty.github.io/NevermoreEngine/api/SoftShutdownService) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/softshutdown) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/softshutdown/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/softshutdown) |
| [SoundPlayer](https://quenty.github.io/NevermoreEngine/api/LoopedSoundPlayer) | Sound playback helper | `npm i @quenty/soundplayer` | [docs](https://quenty.github.io/NevermoreEngine/api/LoopedSoundPlayer) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/soundplayer) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/soundplayer/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/soundplayer) |
| [SoundPromiseUtils](https://quenty.github.io/NevermoreEngine/api/SoundUtils) | Utility functions involving sounds and their state | `npm i @quenty/sounds` | [docs](https://quenty.github.io/NevermoreEngine/api/SoundUtils) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/sounds) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/sounds/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/sounds) |
| [SoundPromiseUtils](https://quenty.github.io/NevermoreEngine/api/SpawnService) | Centralized spawning system | `npm i @quenty/spawning` | [docs](https://quenty.github.io/NevermoreEngine/api/SpawnService) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/spawning) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/spawning/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/spawning) |
| [Spring](https://quenty.github.io/NevermoreEngine/api/Spring) | Spring implementation for Roblox | `npm i @quenty/spring` | [docs](https://quenty.github.io/NevermoreEngine/api/Spring) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/spring) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/spring/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/spring) |
Expand All @@ -289,6 +292,7 @@ There are 246 packages in Nevermore.
| [Throttle](https://quenty.github.io/NevermoreEngine/api/throttle) | Adds the throttle function to Roblox | `npm i @quenty/throttle` | [docs](https://quenty.github.io/NevermoreEngine/api/throttle) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/throttle) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/throttle/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/throttle) |
| [Tie](https://quenty.github.io/NevermoreEngine/api/TieInterface) | Tie allows interfaces to be defined between Lua OOP and Roblox objects. | `npm i @quenty/tie` | [docs](https://quenty.github.io/NevermoreEngine/api/TieInterface) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/tie) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/tie/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/tie) |
| [Time](https://quenty.github.io/NevermoreEngine/api/Time) | Library handles time based parsing / operations. Untested. Based off of PHP's time system. Note: This library is out of date, and does not necessarily work. I recommend using os.time() | `npm i @quenty/time` | [docs](https://quenty.github.io/NevermoreEngine/api/Time) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/time) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/time/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/time) |
| [TimedTween](https://quenty.github.io/NevermoreEngine/api/TimedTweenUtils) | Linear timed tweening model | `npm i @quenty/timedtween` | [docs](https://quenty.github.io/NevermoreEngine/api/TimedTweenUtils) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/timedtween) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/timedtween/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/timedtween) |
| [TimeSyncService](https://quenty.github.io/NevermoreEngine/api/TimeSyncService) | Quenty's TimeSyncService keeps time synchronized between all clients and the server | `npm i @quenty/timesyncservice` | [docs](https://quenty.github.io/NevermoreEngine/api/TimeSyncService) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/timesyncservice) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/timesyncservice/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/timesyncservice) |
| [TouchingPartUtils](https://quenty.github.io/NevermoreEngine/api/TouchingPartUtils) | Utility to get touching parts on a Roblox part. This acts as a performance-friendly way to query Roblox's spatial tree. | `npm i @quenty/touchingpartutils` | [docs](https://quenty.github.io/NevermoreEngine/api/TouchingPartUtils) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/touchingpartutils) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/touchingpartutils/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/touchingpartutils) |
| [trajectory](https://quenty.github.io/NevermoreEngine/api/trajectory) | Utility function for estimating low and high arcs of projectiles. Solves for bullet drop given | `npm i @quenty/trajectory` | [docs](https://quenty.github.io/NevermoreEngine/api/trajectory) | [source](https://github.com/Quenty/NevermoreEngine/tree/main/src/trajectory) | [changelog](https://github.com/Quenty/NevermoreEngine/tree/main/src/trajectory/CHANGELOG.md) | [npm](https://www.npmjs.com/package/@quenty/trajectory) |
Expand Down
8 changes: 4 additions & 4 deletions src/acceltween/src/Shared/AccelTween.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ function AccelTween:__index(index)
if AccelTween[index] then
return AccelTween[index]
elseif index == "p" then
local pos, _ = self:_getstate(tick())
local pos, _ = self:_getstate(os.clock())
return pos
elseif index == "v" then
local _, vel = self:_getstate(tick())
local _, vel = self:_getstate(os.clock())
return vel
elseif index == "a" then
return self._accel
elseif index == "t" then
return self._y1
elseif index == "rtime" then
local time = tick()
local time = os.clock()
return time < self._t1 and self._t1 - time or 0
else
error(("Bad index %q"):format(tostring(index)))
Expand Down Expand Up @@ -128,7 +128,7 @@ function AccelTween:_getstate(time)
end

function AccelTween:_setstate(newpos, newvel, newaccel, newtarg)
local time = tick()
local time = os.clock()
local pos, vel = self:_getstate(time)
pos = newpos or pos
vel = newvel or vel
Expand Down
2 changes: 2 additions & 0 deletions src/animations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
"@quenty/maid": "file:../maid",
"@quenty/promisemaid": "file:../promisemaid",
"@quenty/rbxasset": "file:../rbxasset",
"@quenty/rx": "file:../rx",
"@quenty/signal": "file:../signal",
"@quenty/valueobject": "file:../valueobject"
},
"publishConfig": {
Expand Down
10 changes: 7 additions & 3 deletions src/animations/src/Shared/AnimationSlotPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ function AnimationSlotPlayer:Play(id, fadeTime, weight, speed, priority)
local maid = brio:ToMaid()

local track = AnimationUtils.playAnimation(animationTarget, id, fadeTime, weight, speed, priority)
maid:GiveTask(function()
track:AdjustWeight(0, fadeTime or self._defaultFadeTime.Value)
end)
if track then
maid:GiveTask(function()
track:AdjustWeight(0, fadeTime or self._defaultFadeTime.Value)
end)
else
warn("[AnimationSlotPlayer] - Failed to get animation to play")
end
end))

self._maid._current = topMaid
Expand Down
155 changes: 155 additions & 0 deletions src/animations/src/Shared/AnimationTrackPlayer.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
--[=[
@class AnimationTrackPlayer
]=]

local require = require(script.Parent.loader).load(script)

local BaseObject = require("BaseObject")
local ValueObject = require("ValueObject")
local Rx = require("Rx")
local AnimationUtils = require("AnimationUtils")
local Signal = require("Signal")

local AnimationTrackPlayer = setmetatable({}, BaseObject)
AnimationTrackPlayer.ClassName = "AnimationTrackPlayer"
AnimationTrackPlayer.__index = AnimationTrackPlayer

function AnimationTrackPlayer.new(animationTarget, animationId)
local self = setmetatable(BaseObject.new(), AnimationTrackPlayer)

self._animationTarget = ValueObject.new(nil)
self._maid:GiveTask(self._animationTarget)

self._trackId = ValueObject.new(nil)
self._maid:GiveTask(self._trackId)

self._currentTrack = ValueObject.new(nil)
self._maid:GiveTask(self._currentTrack)

self.KeyframeReached = Signal.new()
self._maid:GiveTask(self.KeyframeReached)

self._animationPriority = ValueObject.new(nil)
self._maid:GiveTask(self._animationPriority)

if animationTarget then
self:SetAnimationTarget(animationTarget)
end

if animationId then
self:SetAnimationId(animationId)
end

self:_setupState()

return self
end

function AnimationTrackPlayer:_setupState()
self._maid:GiveTask(Rx.combineLatest({
animationTarget = self._animationTarget:Observe();
trackId = self._trackId:Observe();
animationPriority = self._animationPriority:Observe();
}):Pipe({
Rx.throttleDefer();
}):Subscribe(function(state)
if state.animationTarget and state.trackId then
self._currentTrack.Value = AnimationUtils.getOrCreateAnimationTrack(state.animationTarget, state.trackId, state.animationPriority)
else
self._currentTrack.Value = nil
end
end))

self._maid:GiveTask(self._currentTrack:ObserveBrio(function(track)
return track ~= nil
end):Subscribe(function(brio)
if brio:IsDead() then
return
end

local maid = brio:ToMaid()
local track = brio:GetValue()

maid:GiveTask(track.KeyframeReached:Connect(function(...)
self.KeyframeReached:Fire(...)
end))
end))
end

function AnimationTrackPlayer:SetAnimationId(animationId)
return self._trackId:Mount(animationId)
end

function AnimationTrackPlayer:GetAnimationId()
return self._trackId.Value
end

function AnimationTrackPlayer:SetAnimationTarget(animationTarget)
return self._animationTarget:Mount(animationTarget)
end

function AnimationTrackPlayer:SetWeightTargetIfNotSet(weight, fadeTime)
self._maid._adjustWeight = self:_onEachTrack(function(_maid, track)
if track.WeightTarget ~= weight then
track:AdjustWeight(weight, fadeTime)
end
end)
end

function AnimationTrackPlayer:Play(fadeTime, weight, speed)
if weight then
self._maid._adjustWeight = nil
end

if speed then
self._maid._adjustSpeed = nil
end

self._maid._stop = nil
self._maid._play = self:_onEachTrack(function(_maid, track)
track:Play(fadeTime, weight, speed)
end)
end

function AnimationTrackPlayer:Stop(fadeTime)
self._maid._play = nil
self._maid._stop = self:_onEachTrack(function(_maid, track)
track:Stop(fadeTime)
end)
end

function AnimationTrackPlayer:AdjustWeight(weight, fadeTime)
self._maid._adjustWeight = self:_onEachTrack(function(_maid, track)
track:AdjustWeight(weight, fadeTime)
end)
end

function AnimationTrackPlayer:AdjustSpeed(speed, fadeTime)
self._maid._adjustSpeed = self:_onEachTrack(function(_maid, track)
track:AdjustSpeed(speed, fadeTime)
end)
end

function AnimationTrackPlayer:IsPlaying()
local track = self._currentTrack.Value
if track then
return track.IsPlaying
else
return false
end
end

function AnimationTrackPlayer:_onEachTrack(callback)
return self._currentTrack:ObserveBrio(function(track)
return track ~= nil
end):Subscribe(function(brio)
if brio:IsDead() then
return
end

local track = brio:GetValue()
callback(brio:ToMaid(), track)
end)
end

return AnimationTrackPlayer
41 changes: 41 additions & 0 deletions src/animations/src/Shared/Testing/StudioRigAnimator.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
--[=[
Ship to run animations in hoarcekat
@class StudioRigAnimator
]=]

local require = require(script.Parent.loader).load(script)

local RunService = game:GetService("RunService")

local BaseObject = require("BaseObject")
local AnimationUtils = require("AnimationUtils")

local StudioRigAnimator = setmetatable({}, BaseObject)
StudioRigAnimator.ClassName = "StudioRigAnimator"
StudioRigAnimator.__index = StudioRigAnimator

function StudioRigAnimator.new(animatorOrHumanoid)
local self = setmetatable(BaseObject.new(animatorOrHumanoid), StudioRigAnimator)

if RunService:IsStudio() and not RunService:IsRunning() then
self:_setupStudio()
end

return self
end

function StudioRigAnimator:_setupStudio()
self._animator = AnimationUtils.getOrCreateAnimator(self._obj)
self._lastTime = os.clock()

self._maid:GiveTask(RunService.RenderStepped:Connect(function()
local now = os.clock()
local delta = now - self._lastTime
self._lastTime = now

self._animator:StepAnimations(delta)
end))
end

return StudioRigAnimator
Loading

0 comments on commit df17199

Please sign in to comment.