repo
stringclasses
302 values
file_path
stringlengths
18
241
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
76
697k
tokens
int64
10
271k
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/gsub.luau
luau
.luau
--[[ gsub a function that only gives the first result of string.gsub so the typechecker doesnt scream ]] type GsubSubsitute = | { [string]: string } | ((string) -> string) | string --[[ Returns a copy of `s` in which all or the first `n` occurrences of the pattern are replaced with the given replacement. ]] lo...
130
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/libinfo.luau
luau
.luau
--[[ libinfo utility func for reading LIBRARY.toml files and providing types for LIBINFOs ]] local serde = require("@lune/serde") local fs = require("@lune/fs") type RuntimeInfo = { optional: { string }?, main: string, }? type BaseLibInfo<R> = { tags: { string }, version: string, runtime: R, } type Internal...
339
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/libs_changed.luau
luau
.luau
--[[ libs changed map of each library thats changed based on if it has a release for its latest version or not ]] local get_latest_commit = require("@scripts/get_latest_commit") local richterm = require("@scripts/richterm") local read_dir = require("@scripts/read_dir") local libinfo = require("@scripts/libinfo") lo...
225
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/license.luau
luau
.luau
--[[ license gives the license file as a code comment ]] local process = require("@lune/process") local fs = require("@lune/fs") local new_line_char = if process.os == "windows" then "\r\n" else "\n" local tabbed_license = string.gsub(fs.readFile("LICENSE"), new_line_char, "\n\t") return `--[[\n\t{string.sub(tabb...
102
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/modulify.luau
luau
.luau
--[[ modulify converts a folder to a module script ]] local read_dir = require("@scripts/read_dir") local remove = require("@scripts/remove") local roblox = require("@lune/roblox") local fs = require("@lune/fs") type ModuleScript = roblox.Instance & { Source: string, } type DirInfo = { instance: roblox.Instance...
572
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/pull_requests.luau
luau
.luau
--[[ pull requests gets pull requests after a given unix timestamp ]] local read_dir = require("@scripts/read_dir") local datetime = require("@lune/datetime") local summon = require("@scripts/summon") local serde = require("@lune/serde") export type PullRequestInfo = { merged_at: number, number: number, author:...
540
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/read_dir.luau
luau
.luau
--[[ read dir its the same except it removes .DS_Store ]] local remove = require("@scripts/remove") local fs = require("@lune/fs") local function read_dir(path: string): { string } local contents = fs.readDir(path) local index = table.find(contents, ".DS_Store") if index then remove(contents, index) end r...
87
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/remove.luau
luau
.luau
--[[ remove swap removal func for removing the first index, if the value doesnt exist it'll error ]] local function remove<V>(t: { V }, i: number?): V if not i then i = 1 end local v = t[i :: number] if v ~= nil then if #t ~= 1 then t[i :: number] = t[#t] t[#t] = nil else t[1] = nil end ...
132
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/require_pattern.luau
luau
.luau
--[[ require pattern module for storing require pattern info, and provides a create function for making a require pattern ]] local START = "local%s*%w+%s*=%s*require%s*%([\"'`]" local ENDING = "[\"'`]%)" local function CREATE(path_pattern: string?): string return `{START}{path_pattern or "(.-)"}{ENDING}` end ret...
118
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/summon.luau
luau
.luau
--[[ summon small wrapper around lunes process.spawn, that makes it actually error and sets the shell to the default shell of the os (except macos because it still has bash and bash works fine enough) ]] local process = require("@lune/process") local SHELL = if process.os == "windows" then "powershell" else "bash...
312
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/test_runner.luau
luau
.luau
--[[ test runner script for running tests for ci ]] local libs_changed = require("@scripts/libs_changed") local read_dir = require("@scripts/read_dir") local depgraph = require("@scripts/depgraph") local libinfo = require("@scripts/libinfo") local process = require("@lune/process") local fs = require("@lune/fs") l...
572
gaymeowing/luauberries
gaymeowing-luauberries-056d795/scripts/zip.luau
luau
.luau
--[[ zip utility for zipping folders within lune ]] local summon = require("@scripts/summon") local function zip(path: string): string return summon(`tar -c -z --exclude *.DS_Store {path} `) end return zip
59
gaymeowing/luauberries
gaymeowing-luauberries-056d795/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,788
MadStudioRoblox/Sera
MadStudioRoblox-Sera-1d0c7ce/Sera.luau
luau
.luau
--!strict --!native --[[ MAD STUDIO -[Sera]--------------------------------------- Low-level schematized serialization library Members: Sera.Boolean Sera.Uint8 Sera.Uint16 Sera.Uint32 Sera.Int8 Sera.Int16 Sera.Int32 Sera.Float32 Sera.Float64 Sera.CFrame -- 48 bytes; Full precision Sera.Lo...
5,786
MadStudioRoblox/Sera
MadStudioRoblox-Sera-1d0c7ce/Test.luau
luau
.luau
--!strict local Sera = require(game.ReplicatedStorage.Sera) -- Defining a schema: local CustomType = table.freeze({ Name = "TwoNumbers", Ser = function(b: buffer, offset: number, value: {number}): number buffer.writef64(b, offset, value[1]) buffer.writef64(b, offset + 8, value[2]) return offset + 16 end, D...
579
latte-soft/maui
latte-soft-maui-99e1d35/src/Tarmac/Assets.lua
luau
.lua
-- This file was @generated by Tarmac. It is not intended for manual editing. return { ["MauiLogo-DarkMode"] = "rbxassetid://12558365376", ["MauiLogo-LightMode"] = "rbxassetid://12558365512", }
63
latte-soft/maui
latte-soft-maui-99e1d35/tests/CustomFlags/init.server.lua
luau
.lua
print("Should be running on the server, but we removed context checks via the flag!")
18
latte-soft/maui
latte-soft-maui-99e1d35/tests/CustomPath/UsingFunction/.maui.lua
luau
.lua
return { FormatVersion = 1, Output = { Directory = function() return script.Parent end, ScriptName = "MauiGeneratedOutput" } }
39
latte-soft/maui
latte-soft-maui-99e1d35/tests/CustomPath/UsingInstance/.maui.lua
luau
.lua
return { FormatVersion = 1, Output = { Directory = script.Parent, ScriptName = "MauiGeneratedOutput" } }
32
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Components/ScrollingFrame.luau
luau
.luau
local RunService = game:GetService("RunService") local Src = script:FindFirstAncestor("ultimate-list") local DataSources = require(Src.DataSources) local Dimensions = require(Src.Dimensions) local React = require(Src.Parent.React) local ReactBindingsRenderer = require(Src.Renderers.ReactBindingsRenderer) local ReactSt...
1,184
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Components/init.luau
luau
.luau
local ScrollingFrame = require(script.ScrollingFrame) local Components = {} Components.ScrollingFrame = ScrollingFrame return Components
27
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/DataSources/DataSourceMethods.luau
luau
.luau
local Src = script:FindFirstAncestor("ultimate-list") local DataSources = require(script.Parent) local exhaustiveMatch = require(Src.Util.exhaustiveMatch) local DataSourceMethods = {} function DataSourceMethods.get<T>( dataSource: DataSources.DataSource<T>, startIndex: number ): DataSources.DataSourceCursor<T>? a...
656
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/DataSources/init.luau
luau
.luau
local DataSources = {} export type DataSource<T> = { type: "array", array: { T }, } | { type: "mutableSource", methods: MutableDataSourceMethods<T>, } export type MutableDataSourceMethods<T> = { -- Get a cursor to the nth element get: (startIndex: number) -> DataSourceCursor<T>?, -- Get the total leng...
532
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Dimensions/DimensionsMethods.luau
luau
.luau
-- TODO: Throughout this, assert that UDims are what is expected (scale only on opposite direction) local Src = script:FindFirstAncestor("ultimate-list") local DataSourceMethods = require(Src.DataSources.DataSourceMethods) local DataSources = require(Src.DataSources) local Dimensions = require(script.Parent) local exh...
1,922
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Dimensions/adjustPositionToScrollAxis.luau
luau
.luau
local Src = script:FindFirstAncestor("ultimate-list") local exhaustiveMatch = require(Src.Util.exhaustiveMatch) local function adjustPositionToScrollAxis(position: UDim2, scrollAxis: number, direction: "x" | "y"): UDim2 if direction == "x" then return UDim2.new(0, position.X.Offset - scrollAxis, position.Y.Scale, ...
140
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Dimensions/init.luau
luau
.luau
local Dimensions = {} export type Dimensions<T> = { type: "getter", callback: (value: T, index: number) -> UDimRect, } | { type: "consistentSize", size: number, } | { type: "consistentUDim2", udim2: UDim2, } | { type: "spaced", spacing: number, inner: Dimensions<T>, } export type UDimRect = ...
344
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Renderers/ReactBindingsRenderer.luau
luau
.luau
local Src = script:FindFirstAncestor("ultimate-list") local Dimensions = require(Src.Dimensions) local DimensionsMethods = require(Src.Dimensions.DimensionsMethods) local React = require(Src.Parent.React) local adjustPositionToScrollAxis = require(Src.Dimensions.adjustPositionToScrollAxis) local createDebugLogger = re...
1,816
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Renderers/ReactStateRenderer.luau
luau
.luau
local Src = script:FindFirstAncestor("ultimate-list") local Dimensions = require(Src.Dimensions) local DimensionsMethods = require(Src.Dimensions.DimensionsMethods) local React = require(Src.Parent.React) local Renderers = require(Src.Renderers) local adjustPositionToScrollAxis = require(Src.Dimensions.adjustPositionT...
664
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Renderers/init.luau
luau
.luau
local Src = script:FindFirstAncestor("ultimate-list") local React = require(Src.Parent.React) local Renderers = {} export type Renderer<T> = { type: "byState", callback: (T) -> React.Node, config: StateRendererConfig, } | { type: "byBinding", callback: (React.Binding<T?>) -> React.Node, } export type StateRend...
187
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Util/createDebugLogger.luau
luau
.luau
-- Intentionally using string formatting instead of taking strings directly to avoid -- expensive string formatting in production. local Src = script:FindFirstAncestor("ultimate-list") local DebugFlags = require(Src.DebugFlags) local function createDebugLogger(key: string): <A...>(format: string | (A...) -> (string, ...
145
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Util/exhaustiveMatch.luau
luau
.luau
local function exhaustiveMatch(value: never): never error(`Unknown value in exhaustive match: {value}`) end return exhaustiveMatch
27
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/Util/joinAndMapBindings.luau
luau
.luau
local Src = script:FindFirstAncestor("ultimate-list") local React = require(Src.Parent.React) -- A version of React.joinBindings(data):map(fn) that preserves types. local function joinAndMapBindings<Ret, T1, T2, T3>( fn: (T1, T2, T3) -> Ret, binding1: React.Binding<T1>, binding2: React.Binding<T2>, binding3: Reac...
146
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/createVirtualizedListController/binarySearchIndexRangeInView.lua
luau
.lua
local Src = script:FindFirstAncestor("ultimate-list") local DataSourceMethods = require(Src.DataSources.DataSourceMethods) local DataSources = require(Src.DataSources) local Dimensions = require(Src.Dimensions) local exhaustiveMatch = require(Src.Util.exhaustiveMatch) local function binarySearchIndexRangeInView<T>( ...
631
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/createVirtualizedListController/init.luau
luau
.luau
local Src = script:FindFirstAncestor("ultimate-list") local DataSourceMethods = require(Src.DataSources.DataSourceMethods) local DataSources = require(Src.DataSources) local Dimensions = require(Src.Dimensions) local DimensionsMethods = require(Src.Dimensions.DimensionsMethods) local binarySearchIndexRangeInView = req...
2,055
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/src/init.luau
luau
.luau
local Components = require(script.Components) local DataSources = require(script.DataSources) local DebugFlags = require(script.DebugFlags) local Dimensions = require(script.Dimensions) local Renderers = require(script.Renderers) export type Dimensions<T> = Dimensions.Dimensions<T> export type UDimRect = Dimensions.UD...
182
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/BindingStateSideBySideStressTest.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement local function Demo() ...
592
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/Demos/ChatDemo.story.luau
luau
.luau
-- An example of an efficient chat local ReplicatedStorage = game:GetService("ReplicatedStorage") local TextService = game:GetService("TextService") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStor...
1,214
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/Demos/MultipleItems.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement type Item = { type: ...
729
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentHeightBinding.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
327
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentHeightBindingStressTest.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
306
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentHeightState.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
297
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentHeightStateStressTest.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
290
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentHeightStateUpdates.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement local function Demo() ...
386
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentHeightStateWithSpacing.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
309
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentUDim2Binding.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
331
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentUDim2State.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
315
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentUDim2StateWithSpacing.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
333
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentUDim2WithOffsetState.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
315
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentUDim2WithOffsetStateAndSpacing.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
333
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayConsistentWidthState.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement return function(target)...
297
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayGetterDimensionsBinding.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement type Letter = { text: ...
477
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/ImmutableArrayGetterDimensionsState.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) local e = React.createElement type Letter = { text: ...
454
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/MutableStateConsistentHeightState.story.luau
luau
.luau
local HttpService = game:GetService("HttpService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]) loc...
451
Kampfkarren/ultimate-list
Kampfkarren-ultimate-list-d166119/stories/StyledScrollingFrame.story.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local StylingService = game:GetService("StylingService") local React = require(ReplicatedStorage.Packages.React) local ReactRoblox = require(ReplicatedStorage.DevPackages.ReactRoblox) local UltimateList = require(ReplicatedStorage.Packages["ultimate-list"]...
431
tacheometry/Rostar
tacheometry-Rostar-7b5d979/.lune/UnpackFiles.luau
luau
.luau
local remodel = require("./remodel") local fs = require("@lune/fs") local serde = require("@lune/serde") local informationFile = serde.decode("json", fs.readFile("RostarData.json")) local initialRojoProject do local success, exists = pcall(remodel.isFile, informationFile.rojoProjectPath) if success and exists then ...
2,970
nezuo/spark
nezuo-spark-6d54423/examples/matter/src/client/exampleSystem.luau
luau
.luau
local function exampleSystem(_, state) local actions = state.actions -- Here we use the helper methods we added: justPressed and justReleased. if actions:justPressed("jump") then print("Jumped!") end if actions:justReleased("attack") then print("Attack released!") end local move = actions:clampedAxis2d("m...
103
nezuo/spark
nezuo-spark-6d54423/examples/matter/src/client/init.client.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local Matter = require(ReplicatedStorage.Packages.Matter) local Spark = require(ReplicatedStorage.Packages.Spark) local exampleSystem = require(script.exampleSystem) local updateInput = require(script.update...
341
nezuo/spark
nezuo-spark-6d54423/examples/matter/src/client/updateInput.luau
luau
.luau
local function updateInput(_, state) state.actions:update(state.inputState) state.inputState:clear() end return { system = updateInput, event = "RenderStepped", priority = -math.huge, -- You want to update input before all other systems run. }
57
nezuo/spark
nezuo-spark-6d54423/examples/minimal/src/client/init.client.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local Spark = require(ReplicatedStorage.Packages.Spark) local Actions = Spark.Actions local InputState = Spark.InputState local VirtualAxis2d = Spark.VirtualAxis2d local inputState = InputState.new() loca...
286
nezuo/spark
nezuo-spark-6d54423/examples/rebinding/src/client/UserInterface.luau
luau
.luau
local Players = game:GetService("Players") local UserInterface = {} function UserInterface.createRebindingMenu() local screenGui = Instance.new("ScreenGui") screenGui.Parent = Players.LocalPlayer.PlayerGui local background = Instance.new("Frame") background.AnchorPoint = Vector2.new(0.5, 0.5) background.Positio...
562
nezuo/spark
nezuo-spark-6d54423/examples/rebinding/src/client/init.client.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local UserInputService = game:GetService("UserInputService") local Spark = require(ReplicatedStorage.Packages.Spark) local UserInterface = require(script.UserInterface) local KeyboardBindings = require(ReplicatedStorage.Shared.KeyboardBindings) local Acti...
1,187
nezuo/spark
nezuo-spark-6d54423/examples/rebinding/src/server/init.server.luau
luau
.luau
local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local KeyboardBindings = require(ReplicatedStorage.Shared.KeyboardBindings) local allCustomizedBindings = {} local function onPlayerAdded(player) -- Here you would load the player's custom bindings using DataSt...
364
nezuo/spark
nezuo-spark-6d54423/examples/rebinding/src/shared/KeyboardBindings.luau
luau
.luau
return { jump = { name = "Jump", action = "jump", default = Enum.KeyCode.Space }, moveUp = { name = "Move Up", action = "move", direction = "up", default = Enum.KeyCode.W }, moveDown = { name = "Move Down", action = "move", direction = "down", default = Enum.KeyCode.S }, moveLeft = { name = "Move Left", action = "m...
127
nezuo/spark
nezuo-spark-6d54423/src/Actions.luau
luau
.luau
local UserInputService = game:GetService("UserInputService") local Bindings = require(script.Parent.Binding.Bindings) local Signal = require(script.Parent.Signal) local getDeviceFromInput = require(script.Parent.getDeviceFromInput) local function isInputInDevices(input, devices) if typeof(input) == "table" then if...
2,713
nezuo/spark
nezuo-spark-6d54423/src/Actions.test.luau
luau
.luau
local ReplicatedStorage = game:GetService("ReplicatedStorage") local Spark = require(script.Parent) local VirtualAxis = require(script.Parent.VirtualAxis) local VirtualAxis2d = require(script.Parent.VirtualAxis2d) local MutableInputState = require(ReplicatedStorage.MutableInputState) local Actions = Spark.Actions re...
4,049
nezuo/spark
nezuo-spark-6d54423/src/Binding/ActionConfig.luau
luau
.luau
--[=[ `ActionConfig` allows you to configure an action with modifiers. ```lua local actions = Actions.new({ "look" }):setRebuildBindings(function(bindings) bindings:bind("look") -- ActionConfig is returned by Bindings:bind. :addModifiers(scale(0.5, Vector2.new(0.5, 0.5))) end) ``` @class ActionConfig ]=...
225
nezuo/spark
nezuo-spark-6d54423/src/Binding/Bind.luau
luau
.luau
--[=[ Allows you to add modifiers to a set of inputs. ```lua local actions = Actions.new({ "look" }):setRebuildBindings(function(bindings) bindings:bind( "look", Bind.new(Enum.KeyCode.Thumbstick2):addModifiers(scale(0.5, Vector2.new(0.5, 0.5))) ) end) ``` @class Bind ]=] local Bind = {} Bind.__index =...
219
nezuo/spark
nezuo-spark-6d54423/src/Binding/Bindings.luau
luau
.luau
local ActionConfig = require(script.Parent.ActionConfig) local Bind = require(script.Parent.Bind) --[=[ Bind inputs to actions. ```lua local actions = Actions.new({ "move", "jump" }):setRebuildBindings(function(bindings) bindings:bind("move", VirtualAxis2d.new({ up = Enum.KeyCode.W, down = Enum.KeyCode.S, ...
294
nezuo/spark
nezuo-spark-6d54423/src/InputState.luau
luau
.luau
local UserInputService = game:GetService("UserInputService") local Inputs = require(script.Parent.Inputs) --[=[ Stores input state derived from [UserInputService] and is used to update [Actions]. :::note You should only ever create one `InputState`. ::: @class InputState ]=] local InputState = {} InputState.__...
1,694
nezuo/spark
nezuo-spark-6d54423/src/Inputs.luau
luau
.luau
return { GAMEPAD_TRIGGERS = { [Enum.KeyCode.ButtonL2] = true, [Enum.KeyCode.ButtonR2] = true, }, GAMEPAD_BUTTONS = { [Enum.KeyCode.ButtonA] = true, [Enum.KeyCode.ButtonB] = true, [Enum.KeyCode.ButtonX] = true, [Enum.KeyCode.ButtonY] = true, [Enum.KeyCode.ButtonL1] = true, [Enum.KeyCode.ButtonL3] = tr...
259
nezuo/spark
nezuo-spark-6d54423/src/Modifiers/deadZone.luau
luau
.luau
local function scaledDeadZone(value: number, lowerThreshold: number): number local lowerBound = math.max(math.abs(value) - lowerThreshold, 0) local scaledValue = lowerBound / (1 - lowerThreshold) return math.min(scaledValue, 1) * math.sign(value) end --[=[ Applies a deadzone to the input, then rescales the remain...
466
nezuo/spark
nezuo-spark-6d54423/src/Modifiers/scale.luau
luau
.luau
--[=[ Scales the axis and axis2d values by the given scale factors. Use this to adjust the sensitivity of the input. @param axisScale number @param axis2dScale Vector2 @return Modifier @within Modifiers ]=] local function scale( axisScale: number, axis2dScale: Vector2 ): (pressed: boolean, axis: number, axis2...
142
nezuo/spark
nezuo-spark-6d54423/src/Rebind.luau
luau
.luau
local UserInputService = game:GetService("UserInputService") local getDeviceFromInput = require(script.Parent.getDeviceFromInput) local Inputs = require(script.Parent.Inputs) local Promise = require(script.Parent.Parent.Promise) --[=[ Queries for the first button a user presses. This is useful for rebinding based on...
726
nezuo/spark
nezuo-spark-6d54423/src/Signal.luau
luau
.luau
--[=[ @class Signal ]=] local Signal = {} Signal.__index = Signal function Signal.new() return setmetatable({ connections = {}, }, Signal) end function Signal:fire(...) for _, connection in self.connections do task.spawn(connection, ...) end end --[=[ @param connection function | thread @return () -> () -...
125
nezuo/spark
nezuo-spark-6d54423/src/getDeviceFromInput.luau
luau
.luau
--[=[ Returns the [Device] for the given input if it exists. @param input Button @return Device? @within Spark ]=] local function getDeviceFromInput(input) if typeof(input) ~= "EnumItem" then return nil end if input:IsA("UserInputType") then if string.match(input.Name, "^Gamepad") ~= nil then return "G...
208
nezuo/spark
nezuo-spark-6d54423/src/init.luau
luau
.luau
export type Button = Enum.KeyCode | Enum.UserInputType export type VirtualAxis = { kind: "VirtualAxis", positive: Button?, negative: Button?, } export type VirtualAxis2d = { kind: "VirtualAxis2d", up: Button?, down: Button?, left: Button?, right: Button?, } export type Input = Button | VirtualAxis | VirtualAxis...
1,234
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Addons/InterfaceManager.luau
luau
.luau
local httpService = game:GetService("HttpService") local InterfaceManager = {} do InterfaceManager.Folder = "FluentRenewedSettings" InterfaceManager.Settings = { Theme = "Dark", Acrylic = true, Transparency = true, MenuKeybind = Enum.KeyCode.RightControl } function Interf...
811
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Addons/SaveManager.luau
luau
.luau
local httpService = game:GetService("HttpService") type Dropdown = {Value: any, Values: {i: any}, Multi: boolean, Displayer: (v) -> (n)?, SetValue: (any) -> ()} local DisplayerParser = { Encode = function(Value) local Encoded = {} for Val: any, Bool: boolean in Value do table.insert(Encoded, Val) end r...
2,849
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Example.client.luau
luau
.luau
local Library = require(game:GetService("ReplicatedStorage"):WaitForChild("Fluent"):WaitForChild("MainModule")) local Window = Library:Window{ Title = `Fluent {Library.Version}`, SubTitle = "by Actual Master Oogway", TabWidth = 160, Size = UDim2.fromOffset(830, 525), Resize = true, Acrylic = tr...
2,464
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/BundleModel.luau
luau
.luau
-- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to> local luau = require("@lune/luau") local roblox = require("@lune/roblox") local LuneUtils = require("libraries/LuneUtils") local Log = LuneUtils.Log local StringUtils = LuneUtils.StringUtils local LuaEncode = require("libraries/LuaEncode") ...
2,053
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/Data/DefaultDarkluaConfig.luau
luau
.luau
local serde = require("@lune/serde") local Config = { generator = { name = "dense", column_span = 120, }, rules = { "convert_index_to_field", "compute_expression", "group_local_assignment", "filter_after_early_return", "remove_comments", "remove_empty_do", "remove_function_call_parens", "remove...
157
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/Data/Template.luau
luau
.luau
-- This codegen template *must* be 100% compatible with Lua 5.1x+, NOT just Luau -- With that being said, this explains the weird cflow in some parts return [[ -- ++++++++ WAX BUNDLED DATA BELOW ++++++++ -- -- Will be used later for getting flattened globals local ImportGlobals -- Holds direct closure data (defining...
3,702
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/Libraries/LuneUtils/CommandUtils.luau
luau
.luau
-- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to> local process = require("@lune/process") local CommandUtils = {} function CommandUtils.CommandExists(binary: string): boolean if process.os ~= "windows" then -- Unix-compliance is simple! return process.spawn("type", { binary }, { shell...
176
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/Libraries/LuneUtils/EnsureFileTree.luau
luau
.luau
-- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to> local fs = require("@lune/fs") --[[ This kinda looks like a strange function, because of the format a "FileTree" accepts: ```lua EnsureFileTree({ ["test"] = { ["test.txt"] = "hi", ["test.json"] = "...
303
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/Libraries/LuneUtils/ParseArgs.luau
luau
.luau
-- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to> type OptionsInput = { [string]: { string | number | boolean | nil } } type OptionsOutput = { [string]: string | number | boolean | nil } local process = require("@lune/process") local Log = require("Log") local function ParseArgs(args: { st...
485
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/Libraries/LuneUtils/RecursiveReadDir.luau
luau
.luau
-- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to> local fs = require("@lune/fs") local function RecursiveReadDir(directory: string, _existingFileList: { string }?): { string } if not string.match(directory, "[/\\]$") then directory ..= "/" end local FileList = _existingFileList or {} ...
155
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/Libraries/LuneUtils/Run.luau
luau
.luau
-- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to> local process = require("@lune/process") local Log = require("Log") local function Run( command: string, args: { string }?, directRun: boolean?, errorHandler: (string?) -> ()? ): process.ExecuteResult local Args = args or {} local Dire...
219
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Build/Lib/Libraries/LuneUtils/init.luau
luau
.luau
-- MIT License | Copyright (c) 2023-2024 Latte Softworks <https://latte.to> return { Log = require("Log"), StringUtils = require("StringUtils"), CommandUtils = require("CommandUtils"), WebhookQueue = require("WebhookQueue"), Run = require("Run"), ParseArgs = require("ParseArgs"), EnsureFileTree = require("Ensu...
97
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Lune/Types/regex.luau
luau
.luau
--[=[ @class RegexMatch A match from a regular expression. Contains the following values: - `start` -- The start index of the match in the original string. - `finish` -- The end index of the match in the original string. - `text` -- The text that was matched. - `len` -- The length of the text that was matched...
1,354
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Assets.luau
luau
.luau
return { Close = "rbxassetid://9886659671", Min = "rbxassetid://9886659276", Max = "rbxassetid://9886659406", Restore = "rbxassetid://9886659001", }
60
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Button.luau
luau
.luau
local Root = script.Parent.Parent local Flipper = require(Root.Packages.Flipper) local Creator = require(Root.Modules.Creator) local New = Creator.New local Spring = Flipper.Spring.new return function(Theme, Parent, DialogCheck) local Button = {} DialogCheck = DialogCheck or false Button.Title = New("TextLabel",...
566
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Dialog.luau
luau
.luau
local Root = script.Parent.Parent local Creator = require(Root.Modules.Creator) local Button_Component = require(Root.Components.Button) local Signal = require(Root.Packages.Signal) local New = Creator.New local Dialog = { Window = nil, } function Dialog:Init(Window) Dialog.Window = Window return Dialog end func...
1,253
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Element.luau
luau
.luau
local Root = script.Parent.Parent local Creator = require(Root.Modules.Creator) local New = Creator.New return function(Title, Desc, Parent, Hover, Config) local Element = { CreatedAt = tick() } Config = typeof(Config) == "table" and Config or {} Element.TitleLabel = New("TextLabel", { FontFace = Font.new("r...
1,165
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Notification.luau
luau
.luau
local Root = script.Parent.Parent local Flipper = require(Root.Packages.Flipper) local Creator = require(Root.Modules.Creator) local Acrylic = require(Root.Modules.Acrylic) local Spring = Flipper.Spring.new local Instant = Flipper.Instant.new local New = Creator.New local SoundService = game:GetService("SoundService...
1,689
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Section.luau
luau
.luau
local Root = script.Parent.Parent local Creator = require(Root.Modules.Creator) local New = Creator.New return function(Title, Parent) local Section = {} Section.Layout = New("UIListLayout", { Padding = UDim.new(0, 5), }) Section.Container = New("Frame", { Size = UDim2.new(1, 0, 0, 26), Position = UDim2.f...
448
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Tab.luau
luau
.luau
local Root = script.Parent.Parent local Flipper = require(Root.Packages.Flipper) local Creator = require(Root.Modules.Creator) local New = Creator.New local Spring = Flipper.Spring.new local Instant = Flipper.Instant.new local Components = Root.Components local TabModule = { Window = nil, Tabs = {}, Containers = {...
1,699
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Textbox.luau
luau
.luau
local TextService = game:GetService("TextService") local Root = script.Parent.Parent local Flipper = require(Root.Packages.Flipper) local Creator = require(Root.Modules.Creator) local New = Creator.New return function(Parent, Acrylic) local Textbox = {} Acrylic = Acrylic or false Textbox.Input = New("TextBox", { ...
1,162
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/TitleBar.luau
luau
.luau
local Root = script.Parent.Parent local Creator = require(Root.Modules.Creator) local New = Creator.New local AddSignal = Creator.AddSignal return function(Config) local TitleBar = {} local Library = require(Root) local function BarButton(Icon, Pos, Parent, Debounce, Callback) local Button = { Callback = Ca...
2,013
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Components/Window.luau
luau
.luau
-- a wise man once said: "i will rewrite this someday" local Root = script.Parent.Parent local Flipper = require(Root.Packages.Flipper) local Creator = require(Root.Modules.Creator) local Acrylic = require(Root.Modules.Acrylic) local Signal = require(Root.Packages.Signal) local Assets = require(script.Parent.Assets) l...
4,146
ActualMasterOogway/Fluent-Renewed
ActualMasterOogway-Fluent-Renewed-b224870/Src/Elements/Button.luau
luau
.luau
local Root = script.Parent.Parent local Creator = require(Root.Modules.Creator) local New = Creator.New local Components = Root.Components local Element = {} Element.__index = Element Element.__type = "Button" function Element:New(Config) assert(Config.Title, "Button - Missing Title") Config.Callback = Config.Cal...
270