repo stringclasses 341
values | file_path stringlengths 29 173 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 2 1.66M | tokens int64 2 598k |
|---|---|---|---|---|---|
dphfox/Fusion | dphfox-Fusion-2790f7b/src/RobloxExternal.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
--[[
Roblox implementation for Fusion's abstract provider layer.
]]
local RunService = game:GetService("RunService")
local HttpService = game:GetService("HttpService")
local Package = script.Parent
local External = require(Package.External)
local RobloxExternal... | 504 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/Computed.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A specialised state object for tracking single values computed from a
user-defined computation.
https://elttob.uk/Fusion/0.3/api-reference/state/types/computed/
]]
local Package = script.Parent.... | 854 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/For/Disassembly.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Breaks down an input table into reactive sub-objects for each pair.
]]
local Package = script.Parent.Parent.Parent
local Types = require(Package.Types)
local External = require(Package.External)
--... | 1,581 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/For/ForTypes.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Stores types that are commonly used between For objects.
]]
local Package = script.Parent.Parent.Parent
local Types = require(Package.Types)
export type SubObject<S, KI, KO, VI, VO> = {
-- Not al... | 272 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/For/init.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
The generic implementation for all `For` objects.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
-- Graph
local depend = require(Package.Graph.depend)
-- State
local p... | 650 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/ForKeys.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Constructs and returns a new For state object which processes keys and
preserves values.
https://elttob.uk/Fusion/0.3/api-reference/state/members/forkeys/
TODO: the sub objects constructed here... | 645 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/ForPairs.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Constructs and returns a new For state object which processes keys and
values in pairs.
https://elttob.uk/Fusion/0.3/api-reference/state/members/forpairs/
TODO: the sub objects constructed here... | 725 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/ForValues.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Constructs and returns a new For state object which processes values and
preserves keys.
https://elttob.uk/Fusion/0.3/api-reference/state/members/forvalues/
TODO: the sub objects constructed he... | 633 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/Value.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A state object which allows regular Luau code to control its value.
https://elttob.uk/Fusion/0.3/api-reference/state/types/value/
]]
local Package = script.Parent.Parent
local Types = require(Pac... | 464 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/castToState.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Returns the input *only* if it is a state object.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
local function castToState<T>(
target: Types.UsedAs<T>
): Types.Stat... | 128 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/peek.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Extracts a value of type T from its input.
https://elttob.uk/Fusion/0.3/api-reference/state/members/peek/
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
-- State
loc... | 185 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/State/updateAll.luau | luau | .luau | return nil -- dummy file so I can write tests | 10 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Types.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Stores common public-facing type information for Fusion APIs.
]]
export type Error = {
type: "Error",
raw: string,
message: string,
trace: string,
context: string?
}
-- Types that can be expr... | 3,296 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/Contextual.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Time-based contextual values, to allow for transparently passing values down
the call stack.
]]
local Package = script.Parent.Parent
local Types = require(Package.Types)
local External = requir... | 562 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/Safe.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
A variant of xpcall() designed for inline usage, letting you define fallback
values based on caught errors.
]]
local Package = script.Parent.Parent
local function Safe<Success, Fail>(
callbac... | 128 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/isSimilar.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Implements the 'similarity test' used to determine whether two values have
a meaningful difference.
https://elttob.uk/Fusion/0.3/tutorials/best-practices/optimisation/#similarity
]]
local functi... | 208 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/merge.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Attempts to merge a variadic number of tables together.
]]
local Package = script.Parent.Parent
local External = require(Package.External)
local function merge(
overwrite: boolean,
into: {[unkno... | 196 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/nameOf.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Returns the most specific custom name for the given object.
]]
local Package = script.Parent.Parent
-- Utility
local nicknames = require(Package.Utility.nicknames)
local function nameOf(
x: unkno... | 196 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/never.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Never returns.
]]
local function never(): never
error("This codepath should not be reachable")
end
return never | 61 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/nicknames.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Stores nicknames for values that don't support metatables, so that `nameOf`
can return values for them.
]]
return setmetatable({}, {__mode = "k"}) | 73 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/Utility/xtypeof.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
Extended typeof, designed for identifying custom objects.
If given a table with a `type` string, returns that.
Otherwise, returns `typeof()` the argument.
]]
local function xtypeof(
x: unknown
)... | 142 |
dphfox/Fusion | dphfox-Fusion-2790f7b/src/init.luau | luau | .luau | --!strict
--!nolint LocalUnused
--!nolint LocalShadow
local task = nil -- Disable usage of Roblox's task scheduler
--[[
The entry point for the Fusion library.
]]
local Types = require(script.Types)
local External = require(script.External)
type Fusion = Types.Fusion
export type Animatable = Types.Animatable
export... | 638 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/build-rbxm.luau | luau | .luau | local process = require("@lune/process")
process.exec("rojo", { "build", "--output", "crunchyroll.rbxm" }, { stdio = "forward" })
| 40 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/clone-mirrors.luau | luau | .luau | local fs = require("@lune/fs")
local process = require("@lune/process")
local serde = require("@lune/serde")
local mirror_configs = fs.readDir("./benches/mirror_list")
-- thank you nick from lute
local function get_git_version(): { major: number, minor: number, path: number }
local git_ver_string = process.exec("git... | 557 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/dev.luau | luau | .luau | local process = require("@lune/process")
local task = require("@lune/task")
task.spawn(function()
process.exec("rojo", {
"sourcemap",
"roblox-tests.project.json",
"--output",
"sourcemap.json",
"--watch",
"--include-non-scripts",
}, {
stdio = "forward",
})
end)
task.spawn(function()
process.exec("roj... | 116 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/styling.luau | luau | .luau | local process = require("@lune/process")
local directories = { ".lune", "src", "tests" }
-- kinda cursed but, easiest way to do this.
table.insert(directories, "--check")
local result = process.exec("stylua", directories, {
stdio = "forward",
})
process.exit(result.code)
| 68 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/.lune/test.luau | luau | .luau | require("@tests/").unit_tests()
| 8 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/benches/create_bench.luau | luau | .luau | export type Profiler = { Begin: (label: string) -> (), stop: () -> () }
local function create_bench<T...>(
parameter_generator: () -> T...,
bench_table: {
[string]: (profiler: Profiler, T...) -> (),
}
): any
return {
Functions = bench_table,
ParameterGenerator = parameter_generator,
}
end
return create_ben... | 89 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/benches/create_entry.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local create_bench = require(ReplicatedStorage.benches.create_bench)
local rig_template = require(ReplicatedStorage.client.rig) :: any
local SAMPLES = 500
local ANIMATION_TEMPLATE = ReplicatedStorage.benches.assets.orange_justice
type Rig = { __symbol: "... | 363 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/benches/solver.bench.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local create_bench = require(ReplicatedStorage.benches.create_bench)
local create_entry = require(ReplicatedStorage.benches.create_entry)
type Crunchyroll = create_entry.Crunchyroll
local entries = {
latest = create_entry(require(ReplicatedStorage.crunc... | 176 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/animation_solver.luau | luau | .luau | local animation_asset = require("./roblox/animation_asset")
local create_rig = require("./rig")
export type AnimationTrack = {
-- 0-1
alpha: number,
-- 0-1
start_fade_time: number,
stop_fade_time: number,
weight: number,
-- arbitrary number
priority: number,
}
local function quat_dot(a_vector: vector, a_sca... | 1,439 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/easings.luau | luau | .luau | --!native
local function linear(value: number): number
return value
end
local function cubic_in(alpha: number): number
return alpha ^ 3
end
local function cubic_out(alpha: number): number
return 1 - ((1 - alpha) ^ 3)
end
local function cubic_in_out(alpha: number): number
if alpha < 0.5 then
return 4 * (alpha ^... | 1,286 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/init.luau | luau | .luau | local animation_asset = require("@self/roblox/animation_asset")
local animation_solver = require("@self/animation_solver")
local rig = require("@self/rig")
--[=[
@class Crunchyroll
The root module.
]=]
--[=[
@function load_keyframe_sequence
@within Crunchyroll
Load a keyframe sequence from Roblox. This will ... | 579 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/rig.luau | luau | .luau | export type LimbInfo = {
c0: CFrame,
c1: CFrame,
name: string,
children: { LimbInfo }?,
}
export type Limb = {
name: string,
c0: CFrame,
c1: CFrame,
depends_on: string,
}
export type LimbTransform = {
priority: number,
position: vector,
quat_vector: vector,
quat_scalar: number,
}
export type Identity = {... | 462 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/roblox/animation_asset.luau | luau | .luau | local easing = require("../easings")
local easing_enum_map = require("./easing_enum_map")
local rig = require("../rig")
export type PoseNode = {
position: vector,
quat_vector: vector,
quat_scalar: number,
easing_function: (alpha: number) -> number,
}
--- [1] = previous keyframe index
--- [2] = (next keyframe inde... | 1,274 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/src/roblox/easing_enum_map.luau | luau | .luau | local Enum = Enum or (require("@lune/roblox").Enum :: any) :: typeof(Enum)
local easings = require("../easings")
local EASING_IN = Enum.PoseEasingDirection.In
local EASING_OUT = Enum.PoseEasingDirection.Out
local EASING_IN_OUT = Enum.PoseEasingDirection.InOut
local LINEAR = Enum.PoseEasingStyle.Linear
local CUBIC = ... | 396 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/tests/init.luau | luau | .luau | local tests = {}
function tests.unit_tests()
require("@self/unit_tests/fade_time.spec")
end
return tests
| 24 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/tests/roblox/client/rig.luau | luau | .luau | return {
name = "HumanoidRootPart",
c0 = CFrame.identity,
c1 = CFrame.identity,
children = {
{
name = "Torso",
c0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
c1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0),
children = {
{
name = "Head",
c0 = CFrame.new(0, 1, 0, -1, 0, 0, ... | 685 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/tests/roblox/client/runner.client.luau | luau | .luau | local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")
local crunchyroll = require(ReplicatedStorage.crunchyroll)
local rig_template = require("./rig") :: any
local TEST_TRANSFORM = CF... | 1,278 |
ffrostfall/crunchyroll | ffrostfall-crunchyroll-736bdb0/vendor/testkit.luau | luau | .luau | --!nocheck
--!nolint
-------------------------------------------------------------------------------
-- testkit.luau
-- v0.7.3
--------------------------------------------------------------------------------
local color = {
white_underline = function(s: string)
return `\27[1;4m{s}\27[0m`
end,
white = function(s... | 2,796 |
ryanlua/satchel | ryanlua-satchel-567d5aa/models/SatchelLoader/Satchel/init.luau | luau | .luau | return require(script.Packages["satchel"])
| 10 |
ryanlua/satchel | ryanlua-satchel-567d5aa/models/SatchelLoader/init.client.luau | luau | .luau | --[[
💖 Thanks for using Satchel 💖
Satchel is a modern open-source alternative to Roblox's default backpack 🎒
📰 DevForum: https://devforum.roblox.com/t/2451549
🛍️ Creator Store: https://create.roblox.com/store/asset/13947506401
🛝 Playground: https://www.roblox.com/join/bxsl5
]]
require(script.Satchel)
| 105 |
ryanlua/satchel | ryanlua-satchel-567d5aa/src/Attribution.client.luau | luau | .luau | --!strict
--[[
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
]]
--[[
By using Satchel, you agree to provide attribution in one of the following ways:
1. Keep the Att... | 230 |
ryanlua/satchel | ryanlua-satchel-567d5aa/src/init.luau | luau | .luau | --!nolint DeprecatedApi
--[[
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
]]
local ContextActionService = game:GetService("ContextActionService")
local GuiService = ga... | 18,993 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/get.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local Matter_0_8 = require(ReplicatedStorage.Matter_0_8)
local Matter_0_9 = require(ReplicatedStorage.Matter_0_9)
local A, B = Matter.component(), Matter.component()
local A_0_8, B_0... | 432 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/insert.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local A, B = Matter.component(), Matter.component()
local pinnedA, pinnedB = PinnedMatter.component(), PinnedMatter.compone... | 244 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/next.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local world = Matter.World.new()
local pinnedWorld = PinnedMatter.World.new()
local A, B = Matter.component(), Matter.comp... | 264 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/query.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local world = Matter.World.new()
local pinnedWorld = PinnedMatter.World.new()
local A, B = Matter.component(), Matter.comp... | 258 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/stress.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local world = Matter.World.new()
local pinnedWorld = PinnedMatter.World.new()
local A, B, C, D, E, F, G =
Matter.componen... | 747 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/without.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local world = Matter.World.new()
local pinnedWorld = PinnedMatter.World.new()
local A, B, C, D, E, F, G =
Matter.componen... | 639 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/client/systems/roombasHurt.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)
local function roombasHurt(world)
for _, _, model in world:query(Components.Roomba, Components.... | 214 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/client/systems/spinSpinners.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local function spinSpinners(world, _, ui)
if ui.checkbox("Disable Spinning"):checked() then
return
end
local transparency = ui.slider(1)
local randomize = ui.button("Randomize colors!"... | 172 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/game.client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local start = require(ReplicatedStorage.Shared.start)
local receiveReplication = require(ReplicatedStorage.Client.receiveReplication)
local world, state = start({
ReplicatedStorage.Shared.systems,
ReplicatedStorage.Client.systems,
})
receiveReplication(... | 70 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/init.server.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local start = require(ReplicatedStorage.Shared.start)
local setupTags = require(ReplicatedStorage.Shared.setupTags)
local world = start({
script.systems,
ReplicatedStorage.Shared.systems,
})
setupTags(world)
| 59 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/mothershipsSpawnRoombas.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)
local function mothershipsSpawnRoombas(world)
for id, model, lasering, transform in
world:query(Components.Model, Components.Lasering, C... | 271 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/removeMissingModels.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)
local function removeMissingModels(world)
for id, model in world:query(Components.Model) do
for _ in Matter.useEvent(model.model, "Ances... | 191 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/replication.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local useEvent = require(ReplicatedStorage.Lib.Matter).useEvent
local RemoteEvent = Instance.new("RemoteEvent")
RemoteEvent.Name = "MatterRemote"
Rem... | 383 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/roombasMove.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local function roombasMove(world)
local targets = {}
for _, model in world:query(Components.Model, Components.Target) do
table.insert(targets, model.model.PrimaryPart.CFrame.p)
end
for ... | 469 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/spawnRoombas.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local function spawnRoombas(world)
for id, _ in world:query(Components.Transform, Components.Roomba):without(Components.Model) do
local model = ReplicatedStorage.Assets.KillerRoomba:Clone()... | 121 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/shared/components.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Lib.Matter)
local COMPONENTS = {
"Roomba",
"Model",
"Charge",
"Health",
"Target",
"Transform",
"Mothership",
"Lasering",
"DebugLabel",
"Spinner",
}
local components = {}
for _, name in ipairs(COMPONENTS)... | 106 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/shared/start.luau | luau | .luau | local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Packages = ReplicatedStorage.Packages
local Matter = require(ReplicatedStorage.Lib.Matter)
local Plasma = require(Packages.plasma)
local HotR... | 572 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/shared/systems/updateModelAttribute.luau | luau | .luau | local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local name = RunService:IsServer() and "serverEntityId" or "clientEntityId"
local function updateModelAttribute(world)
for id, record in worl... | 103 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/Archetype.luau | luau | .luau | export type EntityId = number
export type ComponentId = number
export type ComponentIds = { ComponentId }
export type Component = { [any]: any }
export type ComponentInstance = { [any]: any }
export type ArchetypeId = string
export type Archetype = {
entities: { EntityId },
componentIds: { ComponentId },
idToIndex... | 278 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/Loop.luau | luau | .luau | local RunService = game:GetService("RunService")
local World = require(script.Parent.World)
local rollingAverage = require(script.Parent.rollingAverage)
local topoRuntime = require(script.Parent.topoRuntime)
local recentErrors = {}
local recentErrorLastTime = 0
local systemNames: { [any]: string } = {}
local functi... | 3,852 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/Queue.luau | luau | .luau | local Queue = {}
Queue.__index = Queue
function Queue.new()
return setmetatable({
_head = nil,
_tail = nil,
}, Queue)
end
function Queue:pushBack(value)
local entry = {
value = value,
next = nil,
}
if self._tail ~= nil then
self._tail.next = entry
end
self._tail = entry
if self._head == nil then
... | 147 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/EventBridge.luau | luau | .luau | local RunService = game:GetService("RunService")
local EventBridge = {}
EventBridge.__index = EventBridge
local debouncedEvents = {
InputChanged = true,
}
local debounce = {}
local function serialize(...)
local first = ...
if first and typeof(first) == "Instance" and first:IsA("InputObject") then
return {
D... | 1,121 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/clientBindings.luau | luau | .luau | local UserInputService = game:GetService("UserInputService")
local CollectionService = game:GetService("CollectionService")
local tags = {
system = "MatterDebuggerTooltip_System",
altHover = "MatterDebuggerTooltip_AltHover",
}
local function getOffset(mousePos: Vector2, tag: string): UDim2
if tag == tags.altHover ... | 370 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/formatTable.luau | luau | .luau | local stringColor = "#dcdcaa"
local numberColor = "#b0c4de"
local keywordColor = "#c586c0"
local dimmedColor = "#808080"
function colorize(value, color)
if type(value) == "number" then
value = string.format("%.1f", value)
end
return `<font color="{color}">{value}</font>`
end
function colorizeMany(color, ...)
l... | 1,158 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/getAllComponentData.luau | luau | .luau | local function getAllComponentData(world, entity: number): { [{ [any]: any }]: { [any]: any } }
local componentToData = {}
local location = world.allEntities[entity]
local archetype = location.archetype
local indexInArchetype = location.indexInArchetype
for index, field in archetype.fields do
local componentId... | 126 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/hookWidgets.luau | luau | .luau | local useCurrentSystem = require(script.Parent.Parent.topoRuntime).useCurrentSystem
local widgets = {
"arrow",
"blur",
"button",
"checkbox",
"error",
"portal",
"row",
"slider",
"spinner",
"window",
"label",
"heading",
"space",
"table",
}
local dummyHandles = {
checkbox = {
clicked = function()
ret... | 454 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/mouseHighlight.luau | luau | .luau | local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local defaultRaycastParams = RaycastParams.new()
defaultRaycastParams.IgnoreWater = true
function getInstanceOnMouse(params: RaycastParams)
local camera = workspace.CurrentCamera
if not camera then
return... | 479 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/ui.luau | luau | .luau | local RunService = game:GetService("RunService")
local rollingAverage = require(script.Parent.Parent.rollingAverage)
local World = require(script.Parent.Parent.World)
local function systemName(system)
local systemFn = if type(system) == "table" then system.system else system
local name = debug.info(systemFn, "n")
... | 2,369 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/codeText.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(text, options)
options = options or {}
local refs = Plasma.useInstance(function(ref)
return create("TextButton", {
[ref] = "label",
BackgroundTransparency = 1,
Text = "",
AutomaticSize = Enum.AutomaticSize.Y,
... | 252 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/container.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(fn, options)
options = options or {}
local padding = options.padding or 5
local refs = Plasma.useInstance(function(ref)
return create("Frame", {
[ref] = "frame",
BackgroundTransparency = 1,
Position = UDim2.new(... | 234 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/errorInspect.luau | luau | .luau | return function(plasma)
return plasma.widget(function(debugger, custom)
local loop = debugger.loop
plasma.window("\xf0\x9f\x92\xa5 Errors", function()
local text, setText = plasma.useState("")
custom.codeText(text)
local items = {}
for index, errorData in loop._systemErrors[debugger.debugSystem] do
... | 267 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/frame.luau | luau | .luau | return function(Plasma)
return Plasma.widget(function()
local refs = Plasma.useInstance(function(ref)
local style = Plasma.useStyle()
local Frame = Instance.new("Frame")
Frame.BackgroundColor3 = style.bg2
Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
Frame.AnchorPoint = Vector2.new(0.5, 0.5)
Frame.Si... | 367 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/hoverInspect.luau | luau | .luau | local formatTableModule = require(script.Parent.Parent.formatTable)
local getAllComponentData = require(script.Parent.Parent.getAllComponentData)
local formatTable = formatTableModule.formatTable
local FormatMode = formatTableModule.FormatMode
return function(plasma)
return plasma.widget(function(world, id, custom)
... | 200 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/link.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(text, options)
options = options or {}
local clicked, setClicked = Plasma.useState(false)
local style = Plasma.useStyle()
local refs = Plasma.useInstance(function(ref)
local colorHover = style.textColor
local darker =... | 619 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/panel.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(children, options)
options = options or {}
Plasma.useInstance(function()
local style = Plasma.useStyle()
local frame = create("Frame", {
Name = "Panel",
BackgroundColor3 = style.bg2,
Position = UDim2.new(0, 0, 0... | 520 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/realmSwitch.luau | luau | .luau | local CollectionService = game:GetService("CollectionService")
return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(options)
local style = Plasma.useStyle()
options = options or {}
local left = options.left
local right = options.right
local isRight = options.isRight
local... | 575 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/selectionList.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
local Item = Plasma.widget(function(text, selected, icon, sideText, barWidth, index)
local clicked, setClicked = Plasma.useState(false)
local rightClicked, setRightClicked = Plasma.useState(false)
local hovered, setHovered = Plasma.useState(false)
local st... | 1,549 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/tooltip.luau | luau | .luau | local CollectionService = game:GetService("CollectionService")
type Options = {
tag: string,
backgroundTransparency: number?,
}
return function(plasma)
local create = plasma.create
return plasma.widget(function(text, options: Options)
local refs = plasma.useInstance(function(ref)
local style = plasma.useSty... | 337 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/valueInspect.luau | luau | .luau | local formatTableModule = require(script.Parent.Parent.formatTable)
local formatTable = formatTableModule.formatTable
return function(plasma)
return plasma.widget(function(objectStack, custom)
local closed = plasma
.window({
title = "Inspect",
closable = true,
}, function()
plasma.row({ padding = ... | 432 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/worldInspect.luau | luau | .luau | local formatTableModule = require(script.Parent.Parent.formatTable)
local getAllComponentData = require(script.Parent.Parent.getAllComponentData)
local formatTable = formatTableModule.formatTable
local BY_COMPONENT_NAME = "ComponentName"
local BY_ENTITY_COUNT = "EntityCount"
return function(plasma)
return plasma.wid... | 1,325 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/hooks/log.luau | luau | .luau | local topoRuntime = require(script.Parent.Parent.topoRuntime)
local format = require(script.Parent.Parent.debugger.formatTable)
--[=[
@within Matter
:::info Topologically-aware function
This function is only usable if called within the context of [`Loop:begin`](/api/Loop#begin).
:::
@param ... any
Logs some t... | 212 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/hooks/useDeltaTime.luau | luau | .luau | local topoRuntime = require(script.Parent.Parent.topoRuntime)
--[=[
@within Matter
:::info Topologically-aware function
This function is only usable if called within the context of [`Loop:begin`](/api/Loop#begin).
:::
Returns the `os.clock()` time delta between the start of this and last frame.
]=]
local functi... | 99 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/hooks/useEvent.luau | luau | .luau | local topoRuntime = require(script.Parent.Parent.topoRuntime)
local Queue = require(script.Parent.Parent.Queue)
local EVENT_CONNECT_METHODS = { "Connect", "on", "connect" }
local CONNECTION_DISCONNECT_METHODS = { "Disconnect", "Destroy", "disconnect", "destroy" }
local function connect(object, callback, event)
local... | 1,389 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/hooks/useThrottle.luau | luau | .luau | local topoRuntime = require(script.Parent.Parent.topoRuntime)
local function cleanup(storage)
return os.clock() < storage.expiry
end
--[=[
@within Matter
:::info Topologically-aware function
This function is only usable if called within the context of [`Loop:begin`](/api/Loop#begin).
:::
Utility for easy time... | 374 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/init.luau | luau | .luau | --[=[
@class Matter
Matter. It's what everything is made out of.
]=]
--[=[
@within Matter
@prop World World
]=]
--[=[
@within Matter
@prop Loop Loop
]=]
--[=[
@within Matter
@prop Debugger Debugger
]=]
--[=[
@within Matter
@prop None None
A value should be interpreted as nil when merging dictionaries.
... | 467 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/rollingAverage.luau | luau | .luau | local MAX_SAMPLES = 60
local function addSample(samples, value)
samples[samples.index or 1] = value
samples.index = if samples.index then (samples.index % MAX_SAMPLES) + 1 else 1
end
local function getAverage(samples)
local sum = 0
for i = 1, #samples do
sum += samples[i]
end
return sum / #samples
end
retu... | 104 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/topoRuntime.luau | luau | .luau | local stack = {}
local function newStackFrame(node)
return {
node = node,
accessedKeys = {},
}
end
local function cleanup()
local currentFrame = stack[#stack]
for baseKey, state in pairs(currentFrame.node.system) do
for key, value in pairs(state.storage) do
if not currentFrame.accessedKeys[baseKey] or n... | 1,192 |
matter-ecs/matter | matter-ecs-matter-f31981b/tests.server.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
require(ReplicatedStorage.TestEZ).TestBootstrap:run({
ReplicatedStorage.Matter,
nil,
{
noXpcallByDefault = true,
},
})
| 50 |
matter-ecs/matter | matter-ecs-matter-f31981b/tests/stressTest.client.luau | luau | .luau | local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local immutable = require(ReplicatedStorage.Matter.immutable)
-- 500 entities
-- 2-30 components on each entity
-- 300 unique components
-- 200 systems
-- 1-1... | 761 |
lisphm/A-Chassis | lisphm-A-Chassis-94c6bbd/Scripts/CustomEngine.luau | luau | .luau | --[[
_____ _ _
/\ / ____| | (_)
/ \ ______| | | |__ __ _ ___ ___ _ ___
/ /\ \______| | | '_ \ / _` / __/ __| / __|
/ ____ \ | |____| | | | (_| \__ \__ \ \__ \
/_/ \_\ \_____|_| |_|\__,_|___/___/_|___/
Version 1... | 807 |
lisphm/A-Chassis | lisphm-A-Chassis-94c6bbd/Scripts/MiscWeld.luau | luau | .luau | --[[
___ _____
/ _ |/ ___/ Avxnturador | Novena midmm5 |
/ __ / /__ LuaInt | Novena
/_/ |_\___/ Detomiks | Base Chassis
Version 1.7
*Credit ... | 676 |
lisphm/A-Chassis | lisphm-A-Chassis-94c6bbd/Scripts/Plugins/Aerodynamics.luau | luau | .luau | --[[
_____ _ _
/\ / ____| | (_)
/ \ ______| | | |__ __ _ ___ ___ _ ___
/ /\ \______| | | '_ \ / _` / __/ __| / __|
/ ____ \ | |____| | | | (_| \__ \__ \ \__ \
/_/ \_\ \_____|_| |_|\__,_|___/___/_|___/
Version 1... | 1,848 |
lisphm/A-Chassis | lisphm-A-Chassis-94c6bbd/Scripts/Plugins/Controls.luau | luau | .luau | --[[
_____ _ _
/\ / ____| | (_)
/ \ ______| | | |__ __ _ ___ ___ _ ___
/ /\ \______| | | '_ \ / _` / __/ __| / __|
/ ____ \ | |____| | | | (_| \__ \__ \ \__ \
/_/ \_\ \_____|_| |_|\__,_|___/___/_|___/
Version 1... | 2,109 |
lisphm/A-Chassis | lisphm-A-Chassis-94c6bbd/Scripts/Plugins/GForces.luau | luau | .luau | --[[
_____ _ _
/\ / ____| | (_)
/ \ ______| | | |__ __ _ ___ ___ _ ___
/ /\ \______| | | '_ \ / _` / __/ __| / __|
/ ____ \ | |____| | | | (_| \__ \__ \ \__ \
/_/ \_\ \_____|_| |_|\__,_|___/___/_|___/
Version 1... | 1,093 |
lisphm/A-Chassis | lisphm-A-Chassis-94c6bbd/Scripts/Plugins/Gauges.luau | luau | .luau | --[[
_____ _ _
/\ / ____| | (_)
/ \ ______| | | |__ __ _ ___ ___ _ ___
/ /\ \______| | | '_ \ / _` / __/ __| / __|
/ ____ \ | |____| | | | (_| \__ \__ \ \__ \
/_/ \_\ \_____|_| |_|\__,_|___/___/_|___/
Version 1... | 5,432 |
lisphm/A-Chassis | lisphm-A-Chassis-94c6bbd/Scripts/Plugins/Ignition.luau | luau | .luau | --[[
_____ _ _
/\ / ____| | (_)
/ \ ______| | | |__ __ _ ___ ___ _ ___
/ /\ \______| | | '_ \ / _` / __/ __| / __|
/ ____ \ | |____| | | | (_| \__ \__ \ \__ \
/_/ \_\ \_____|_| |_|\__,_|___/___/_|___/
Version 1... | 423 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.