cluaupp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/bin/cluau.js +4 -0
- package/bin/cluaupp.js +4 -0
- package/docs/README.md +20 -0
- package/docs/architecture.md +110 -0
- package/docs/cli.md +69 -0
- package/docs/comparison.md +37 -0
- package/docs/config.md +31 -0
- package/docs/cpp-advanced.md +71 -0
- package/docs/cpp-const.md +52 -0
- package/docs/cpp-organization.md +61 -0
- package/docs/cpp-safety.md +58 -0
- package/docs/cpp-types.md +66 -0
- package/docs/getting-started.md +169 -0
- package/docs/intro.md +37 -0
- package/docs/libraries.md +77 -0
- package/docs/roblox-api.md +81 -0
- package/docs/syntax.md +131 -0
- package/include/cluaupp/datatypes.hpp +581 -0
- package/include/cluaupp/generated/enums.hpp +4920 -0
- package/include/cluaupp/generated/instances.hpp +12489 -0
- package/include/cluaupp/libs/chrono.hpp +26 -0
- package/include/cluaupp/libs/cmdr.hpp +16 -0
- package/include/cluaupp/libs/dataservice.hpp +141 -0
- package/include/cluaupp/libs/display.hpp +13 -0
- package/include/cluaupp/libs/ezvisual.hpp +18 -0
- package/include/cluaupp/libs/formatnumber.hpp +15 -0
- package/include/cluaupp/libs/fusion.hpp +41 -0
- package/include/cluaupp/libs/iris.hpp +40 -0
- package/include/cluaupp/libs/janitor.hpp +35 -0
- package/include/cluaupp/libs/math.hpp +14 -0
- package/include/cluaupp/libs/module3d.hpp +25 -0
- package/include/cluaupp/libs/net.hpp +42 -0
- package/include/cluaupp/libs/promise.hpp +30 -0
- package/include/cluaupp/libs/spring.hpp +18 -0
- package/include/cluaupp/libs/statemachine.hpp +19 -0
- package/include/cluaupp/libs/stickybillboard.hpp +14 -0
- package/include/cluaupp/libs/topbarplus.hpp +29 -0
- package/include/cluaupp/libs/twinkle.hpp +15 -0
- package/include/cluaupp/libs/vfx.hpp +13 -0
- package/include/cluaupp/libs.hpp +25 -0
- package/include/cluaupp/roblox.hpp +28 -0
- package/package.json +65 -0
- package/runtime/ArrayIndexer/init.luau +144 -0
- package/runtime/Chrono/Client/ClientClock.luau +202 -0
- package/runtime/Chrono/Client/InterpolationBuffer.luau +74 -0
- package/runtime/Chrono/Client/ModelResolver.luau +53 -0
- package/runtime/Chrono/Client/Player.luau +113 -0
- package/runtime/Chrono/Client/Receiver.luau +395 -0
- package/runtime/Chrono/Client/Replicate.luau +333 -0
- package/runtime/Chrono/Client/Sender.luau +205 -0
- package/runtime/Chrono/LICENSE +21 -0
- package/runtime/Chrono/Server/EntityGrid.luau +299 -0
- package/runtime/Chrono/Server/Player.luau +141 -0
- package/runtime/Chrono/Server/Receiver.luau +287 -0
- package/runtime/Chrono/Server/Replicate.luau +415 -0
- package/runtime/Chrono/Server/Sender.luau +306 -0
- package/runtime/Chrono/Server/ServerClock.luau +50 -0
- package/runtime/Chrono/Shared/ApplyMounts.luau +137 -0
- package/runtime/Chrono/Shared/Bin.luau +31 -0
- package/runtime/Chrono/Shared/ClockUnwrap.luau +70 -0
- package/runtime/Chrono/Shared/Config.luau +264 -0
- package/runtime/Chrono/Shared/Entity.luau +1016 -0
- package/runtime/Chrono/Shared/Events.luau +39 -0
- package/runtime/Chrono/Shared/Holder.luau +210 -0
- package/runtime/Chrono/Shared/InterpolationMath.luau +51 -0
- package/runtime/Chrono/Shared/ModelHelper.luau +122 -0
- package/runtime/Chrono/Shared/Remotes/ClientClockRelay.model.json +3 -0
- package/runtime/Chrono/Shared/Remotes/ClientHeartbeat.model.json +3 -0
- package/runtime/Chrono/Shared/Remotes/ClientLoaded.model.json +3 -0
- package/runtime/Chrono/Shared/Remotes/Death.model.json +3 -0
- package/runtime/Chrono/Shared/Remotes/Heartbeat.model.json +3 -0
- package/runtime/Chrono/Shared/Remotes/Replicate.model.json +3 -0
- package/runtime/Chrono/Shared/Remotes/ReplicateFull.model.json +3 -0
- package/runtime/Chrono/Shared/Remotes/SafeReplicate.model.json +3 -0
- package/runtime/Chrono/Shared/ReplicationRules.luau +122 -0
- package/runtime/Chrono/Shared/Signal.luau +219 -0
- package/runtime/Chrono/Shared/Snapshots.luau +218 -0
- package/runtime/Chrono/Shared/Stats.luau +204 -0
- package/runtime/Chrono/Shared/Ticker.luau +112 -0
- package/runtime/Chrono/Shared/Types.luau +247 -0
- package/runtime/Chrono/Shared/Warn.luau +33 -0
- package/runtime/Chrono/Shared/_CUSTOM_MODEL_REP/init.model.json +3 -0
- package/runtime/Chrono/_impl/Client/ClientClock.luau +202 -0
- package/runtime/Chrono/_impl/Client/InterpolationBuffer.luau +74 -0
- package/runtime/Chrono/_impl/Client/ModelResolver.luau +53 -0
- package/runtime/Chrono/_impl/Client/Player.luau +113 -0
- package/runtime/Chrono/_impl/Client/Receiver.luau +395 -0
- package/runtime/Chrono/_impl/Client/Replicate.luau +333 -0
- package/runtime/Chrono/_impl/Client/Sender.luau +205 -0
- package/runtime/Chrono/_impl/LICENSE +21 -0
- package/runtime/Chrono/_impl/Server/EntityGrid.luau +299 -0
- package/runtime/Chrono/_impl/Server/Player.luau +141 -0
- package/runtime/Chrono/_impl/Server/Receiver.luau +287 -0
- package/runtime/Chrono/_impl/Server/Replicate.luau +415 -0
- package/runtime/Chrono/_impl/Server/Sender.luau +306 -0
- package/runtime/Chrono/_impl/Server/ServerClock.luau +50 -0
- package/runtime/Chrono/_impl/Shared/ApplyMounts.luau +137 -0
- package/runtime/Chrono/_impl/Shared/Bin.luau +31 -0
- package/runtime/Chrono/_impl/Shared/ClockUnwrap.luau +70 -0
- package/runtime/Chrono/_impl/Shared/Config.luau +264 -0
- package/runtime/Chrono/_impl/Shared/Entity.luau +1016 -0
- package/runtime/Chrono/_impl/Shared/Events.luau +39 -0
- package/runtime/Chrono/_impl/Shared/Holder.luau +210 -0
- package/runtime/Chrono/_impl/Shared/InterpolationMath.luau +51 -0
- package/runtime/Chrono/_impl/Shared/ModelHelper.luau +122 -0
- package/runtime/Chrono/_impl/Shared/Remotes/ClientClockRelay.model.json +3 -0
- package/runtime/Chrono/_impl/Shared/Remotes/ClientHeartbeat.model.json +3 -0
- package/runtime/Chrono/_impl/Shared/Remotes/ClientLoaded.model.json +3 -0
- package/runtime/Chrono/_impl/Shared/Remotes/Death.model.json +3 -0
- package/runtime/Chrono/_impl/Shared/Remotes/Heartbeat.model.json +3 -0
- package/runtime/Chrono/_impl/Shared/Remotes/Replicate.model.json +3 -0
- package/runtime/Chrono/_impl/Shared/Remotes/ReplicateFull.model.json +3 -0
- package/runtime/Chrono/_impl/Shared/Remotes/SafeReplicate.model.json +3 -0
- package/runtime/Chrono/_impl/Shared/ReplicationRules.luau +122 -0
- package/runtime/Chrono/_impl/Shared/Signal.luau +219 -0
- package/runtime/Chrono/_impl/Shared/Snapshots.luau +218 -0
- package/runtime/Chrono/_impl/Shared/Stats.luau +204 -0
- package/runtime/Chrono/_impl/Shared/Ticker.luau +112 -0
- package/runtime/Chrono/_impl/Shared/Types.luau +247 -0
- package/runtime/Chrono/_impl/Shared/Warn.luau +33 -0
- package/runtime/Chrono/_impl/Shared/_CUSTOM_MODEL_REP/init.model.json +3 -0
- package/runtime/Chrono/_impl/init.luau +96 -0
- package/runtime/Chrono/init.luau +14 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/announce.luau +21 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/announceServer.luau +17 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/ban.luau +59 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/banServer.luau +30 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/gotoPlace.luau +35 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/gotoPlaceServer.luau +17 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/kick.luau +19 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/kickServer.luau +27 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/kill.luau +13 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/killServer.luau +13 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/respawn.luau +15 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/respawnServer.luau +7 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/teleport.luau +30 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/teleportServer.luau +26 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/unban.luau +26 -0
- package/runtime/Cmdr/BuiltInCommands/Admin/unbanServer.luau +10 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/blink.luau +35 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/fetch.luau +12 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/fetchServer.luau +7 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/getPlayerPlaceInstance.luau +20 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/getPlayerPlaceInstanceServer.luau +28 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/position.luau +30 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/thru.luau +50 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/uptime.luau +6 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/uptimeServer.luau +12 -0
- package/runtime/Cmdr/BuiltInCommands/Debug/version.luau +12 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/alias.luau +22 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/bind.luau +104 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/clear.luau +20 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/convertTimestamp.luau +18 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/echo.luau +17 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/edit.luau +75 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/exit.luau +11 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/history.luau +27 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/hover.luau +21 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/jsonArrayDecode.luau +25 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/jsonArrayEncode.luau +18 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/len.luau +16 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/math.luau +36 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/pick.luau +21 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/rand.luau +27 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/replace.luau +32 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/resolve.luau +32 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/run.luau +20 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/runLines.luau +34 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/runif.luau +95 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/unbind.luau +27 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/var.luau +29 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/varServer.luau +37 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/varSet.luau +30 -0
- package/runtime/Cmdr/BuiltInCommands/Utility/varSetServer.luau +29 -0
- package/runtime/Cmdr/BuiltInCommands/help.luau +96 -0
- package/runtime/Cmdr/BuiltInTypes/BrickColor.luau +258 -0
- package/runtime/Cmdr/BuiltInTypes/Color3.luau +59 -0
- package/runtime/Cmdr/BuiltInTypes/Command.luau +23 -0
- package/runtime/Cmdr/BuiltInTypes/Duration.luau +111 -0
- package/runtime/Cmdr/BuiltInTypes/JSON.luau +13 -0
- package/runtime/Cmdr/BuiltInTypes/MathOperator.luau +43 -0
- package/runtime/Cmdr/BuiltInTypes/Player.luau +36 -0
- package/runtime/Cmdr/BuiltInTypes/PlayerId.luau +66 -0
- package/runtime/Cmdr/BuiltInTypes/Primitives.luau +145 -0
- package/runtime/Cmdr/BuiltInTypes/StoredKey.luau +33 -0
- package/runtime/Cmdr/BuiltInTypes/Team.luau +49 -0
- package/runtime/Cmdr/BuiltInTypes/Type.luau +23 -0
- package/runtime/Cmdr/BuiltInTypes/URL.luau +18 -0
- package/runtime/Cmdr/BuiltInTypes/UserInput.luau +32 -0
- package/runtime/Cmdr/BuiltInTypes/Vector.luau +58 -0
- package/runtime/Cmdr/CmdrClient/CmdrInterface/AutoComplete.luau +240 -0
- package/runtime/Cmdr/CmdrClient/CmdrInterface/CreateGui.luau +227 -0
- package/runtime/Cmdr/CmdrClient/CmdrInterface/Window.luau +713 -0
- package/runtime/Cmdr/CmdrClient/CmdrInterface/init.luau +18 -0
- package/runtime/Cmdr/CmdrClient/DefaultEventHandlers.luau +18 -0
- package/runtime/Cmdr/CmdrClient/Shared/Argument.luau +395 -0
- package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/HasCharacter.luau +39 -0
- package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/IsDataStoreAvailable.luau +36 -0
- package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/MaxArrayLength.luau +10 -0
- package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/MaxStringLength.luau +10 -0
- package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/NonEmptyString.luau +10 -0
- package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/NotEquals.luau +8 -0
- package/runtime/Cmdr/CmdrClient/Shared/Command.luau +415 -0
- package/runtime/Cmdr/CmdrClient/Shared/Dispatcher.luau +407 -0
- package/runtime/Cmdr/CmdrClient/Shared/Registry.luau +717 -0
- package/runtime/Cmdr/CmdrClient/Shared/Util.luau +879 -0
- package/runtime/Cmdr/CmdrClient/init.luau +377 -0
- package/runtime/Cmdr/LICENSE +21 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/announce.luau +21 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/announceServer.luau +17 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/ban.luau +59 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/banServer.luau +30 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/gotoPlace.luau +35 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/gotoPlaceServer.luau +17 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/kick.luau +19 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/kickServer.luau +27 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/kill.luau +13 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/killServer.luau +13 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/respawn.luau +15 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/respawnServer.luau +7 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/teleport.luau +30 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/teleportServer.luau +26 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/unban.luau +26 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Admin/unbanServer.luau +10 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/blink.luau +35 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/fetch.luau +12 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/fetchServer.luau +7 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/getPlayerPlaceInstance.luau +20 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/getPlayerPlaceInstanceServer.luau +28 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/position.luau +30 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/thru.luau +50 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/uptime.luau +6 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/uptimeServer.luau +12 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Debug/version.luau +12 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/alias.luau +22 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/bind.luau +104 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/clear.luau +20 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/convertTimestamp.luau +18 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/echo.luau +17 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/edit.luau +75 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/exit.luau +11 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/history.luau +27 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/hover.luau +21 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/jsonArrayDecode.luau +25 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/jsonArrayEncode.luau +18 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/len.luau +16 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/math.luau +36 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/pick.luau +21 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/rand.luau +27 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/replace.luau +32 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/resolve.luau +32 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/run.luau +20 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/runLines.luau +34 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/runif.luau +95 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/unbind.luau +27 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/var.luau +29 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/varServer.luau +37 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/varSet.luau +30 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/Utility/varSetServer.luau +29 -0
- package/runtime/Cmdr/_impl/BuiltInCommands/help.luau +96 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/BrickColor.luau +258 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/Color3.luau +59 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/Command.luau +23 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/Duration.luau +111 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/JSON.luau +13 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/MathOperator.luau +43 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/Player.luau +36 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/PlayerId.luau +66 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/Primitives.luau +145 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/StoredKey.luau +33 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/Team.luau +49 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/Type.luau +23 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/URL.luau +18 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/UserInput.luau +32 -0
- package/runtime/Cmdr/_impl/BuiltInTypes/Vector.luau +58 -0
- package/runtime/Cmdr/_impl/CmdrClient/CmdrInterface/AutoComplete.luau +240 -0
- package/runtime/Cmdr/_impl/CmdrClient/CmdrInterface/CreateGui.luau +227 -0
- package/runtime/Cmdr/_impl/CmdrClient/CmdrInterface/Window.luau +713 -0
- package/runtime/Cmdr/_impl/CmdrClient/CmdrInterface/init.luau +18 -0
- package/runtime/Cmdr/_impl/CmdrClient/DefaultEventHandlers.luau +18 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/Argument.luau +395 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/HasCharacter.luau +39 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/IsDataStoreAvailable.luau +36 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/MaxArrayLength.luau +10 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/MaxStringLength.luau +10 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/NonEmptyString.luau +10 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/NotEquals.luau +8 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/Command.luau +415 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/Dispatcher.luau +407 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/Registry.luau +717 -0
- package/runtime/Cmdr/_impl/CmdrClient/Shared/Util.luau +879 -0
- package/runtime/Cmdr/_impl/CmdrClient/init.luau +377 -0
- package/runtime/Cmdr/_impl/LICENSE +21 -0
- package/runtime/Cmdr/_impl/init.luau +178 -0
- package/runtime/Cmdr/init.luau +8 -0
- package/runtime/DataService/Client.luau +209 -0
- package/runtime/DataService/Data.luau +886 -0
- package/runtime/DataService/Enum.luau +6 -0
- package/runtime/DataService/Enums.luau +10 -0
- package/runtime/DataService/Packages/quicknet/DataTypes.luau +70 -0
- package/runtime/DataService/Packages/quicknet/Enums.luau +85 -0
- package/runtime/DataService/Packages/quicknet/EnumsToNativeTypes.luau +57 -0
- package/runtime/DataService/Packages/quicknet/Parser.luau +355 -0
- package/runtime/DataService/Packages/quicknet/QuickNet.luau +953 -0
- package/runtime/DataService/Packages/quicknet/Serialize.luau +2020 -0
- package/runtime/DataService/Packages/quicknet/Types.luau +72 -0
- package/runtime/DataService/Packages/quicknet/init.luau +1 -0
- package/runtime/DataService/Packages/signal/init.luau +433 -0
- package/runtime/DataService/Path.luau +236 -0
- package/runtime/DataService/ProfileStore.luau +2243 -0
- package/runtime/DataService/Replicator.luau +172 -0
- package/runtime/DataService/Server.luau +412 -0
- package/runtime/DataService/init.luau +204 -0
- package/runtime/Display/LICENSE +201 -0
- package/runtime/Display/_impl/LICENSE +201 -0
- package/runtime/Display/_impl/init.luau +269 -0
- package/runtime/Display/_impl/option.luau +237 -0
- package/runtime/Display/init.luau +10 -0
- package/runtime/Display/option.luau +237 -0
- package/runtime/EzVisualz/Dropshadow.luau +148 -0
- package/runtime/EzVisualz/Gradient.luau +452 -0
- package/runtime/EzVisualz/GradientTemplates/Bubblegum.luau +16 -0
- package/runtime/EzVisualz/GradientTemplates/Chrome.luau +16 -0
- package/runtime/EzVisualz/GradientTemplates/Death.luau +15 -0
- package/runtime/EzVisualz/GradientTemplates/Electric.luau +14 -0
- package/runtime/EzVisualz/GradientTemplates/Fire.luau +13 -0
- package/runtime/EzVisualz/GradientTemplates/Galaxy.luau +11 -0
- package/runtime/EzVisualz/GradientTemplates/Ghost.luau +16 -0
- package/runtime/EzVisualz/GradientTemplates/Gold.luau +14 -0
- package/runtime/EzVisualz/GradientTemplates/Green.luau +14 -0
- package/runtime/EzVisualz/GradientTemplates/Ice.luau +14 -0
- package/runtime/EzVisualz/GradientTemplates/Lava.luau +15 -0
- package/runtime/EzVisualz/GradientTemplates/Matrix.luau +19 -0
- package/runtime/EzVisualz/GradientTemplates/Neon.luau +12 -0
- package/runtime/EzVisualz/GradientTemplates/Oceanic.luau +15 -0
- package/runtime/EzVisualz/GradientTemplates/Rainbow.luau +13 -0
- package/runtime/EzVisualz/GradientTemplates/Silver.luau +12 -0
- package/runtime/EzVisualz/GradientTemplates/Sunset.luau +11 -0
- package/runtime/EzVisualz/GradientTemplates/Zebra.luau +18 -0
- package/runtime/EzVisualz/GradientTemplates/init.luau +9 -0
- package/runtime/EzVisualz/LICENSE.md +21 -0
- package/runtime/EzVisualz/Presets/Bubblegum.luau +36 -0
- package/runtime/EzVisualz/Presets/ChromeStroke.luau +15 -0
- package/runtime/EzVisualz/Presets/DeathStroke.luau +15 -0
- package/runtime/EzVisualz/Presets/ElectricStroke.luau +54 -0
- package/runtime/EzVisualz/Presets/FireStroke.luau +29 -0
- package/runtime/EzVisualz/Presets/GalaxyStroke.luau +31 -0
- package/runtime/EzVisualz/Presets/Ghost.luau +10 -0
- package/runtime/EzVisualz/Presets/GhostStroke.luau +15 -0
- package/runtime/EzVisualz/Presets/Gold.luau +10 -0
- package/runtime/EzVisualz/Presets/GoldStroke.luau +15 -0
- package/runtime/EzVisualz/Presets/GreenOutline.luau +23 -0
- package/runtime/EzVisualz/Presets/IceStroke.luau +15 -0
- package/runtime/EzVisualz/Presets/Lava.luau +9 -0
- package/runtime/EzVisualz/Presets/LavaStroke.luau +13 -0
- package/runtime/EzVisualz/Presets/Matrix.luau +21 -0
- package/runtime/EzVisualz/Presets/NeonStroke.luau +30 -0
- package/runtime/EzVisualz/Presets/OceanicStroke.luau +15 -0
- package/runtime/EzVisualz/Presets/Rainbow.luau +9 -0
- package/runtime/EzVisualz/Presets/RainbowOutline.luau +23 -0
- package/runtime/EzVisualz/Presets/RainbowStroke.luau +13 -0
- package/runtime/EzVisualz/Presets/Shine.luau +48 -0
- package/runtime/EzVisualz/Presets/ShineOutline.luau +66 -0
- package/runtime/EzVisualz/Presets/Silver.luau +10 -0
- package/runtime/EzVisualz/Presets/SilverStroke.luau +15 -0
- package/runtime/EzVisualz/Presets/SunsetStroke.luau +31 -0
- package/runtime/EzVisualz/Presets/WaveStroke.luau +33 -0
- package/runtime/EzVisualz/Presets/Zebra.luau +21 -0
- package/runtime/EzVisualz/Presets/init.luau +9 -0
- package/runtime/EzVisualz/Stroke.luau +167 -0
- package/runtime/EzVisualz/Util.luau +7 -0
- package/runtime/EzVisualz/_impl/Dropshadow.luau +148 -0
- package/runtime/EzVisualz/_impl/Gradient.luau +452 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Bubblegum.luau +16 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Chrome.luau +16 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Death.luau +15 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Electric.luau +14 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Fire.luau +13 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Galaxy.luau +11 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Ghost.luau +16 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Gold.luau +14 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Green.luau +14 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Ice.luau +14 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Lava.luau +15 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Matrix.luau +19 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Neon.luau +12 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Oceanic.luau +15 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Rainbow.luau +13 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Silver.luau +12 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Sunset.luau +11 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/Zebra.luau +18 -0
- package/runtime/EzVisualz/_impl/GradientTemplates/init.luau +9 -0
- package/runtime/EzVisualz/_impl/LICENSE.md +21 -0
- package/runtime/EzVisualz/_impl/Presets/Bubblegum.luau +36 -0
- package/runtime/EzVisualz/_impl/Presets/ChromeStroke.luau +15 -0
- package/runtime/EzVisualz/_impl/Presets/DeathStroke.luau +15 -0
- package/runtime/EzVisualz/_impl/Presets/ElectricStroke.luau +54 -0
- package/runtime/EzVisualz/_impl/Presets/FireStroke.luau +29 -0
- package/runtime/EzVisualz/_impl/Presets/GalaxyStroke.luau +31 -0
- package/runtime/EzVisualz/_impl/Presets/Ghost.luau +10 -0
- package/runtime/EzVisualz/_impl/Presets/GhostStroke.luau +15 -0
- package/runtime/EzVisualz/_impl/Presets/Gold.luau +10 -0
- package/runtime/EzVisualz/_impl/Presets/GoldStroke.luau +15 -0
- package/runtime/EzVisualz/_impl/Presets/GreenOutline.luau +23 -0
- package/runtime/EzVisualz/_impl/Presets/IceStroke.luau +15 -0
- package/runtime/EzVisualz/_impl/Presets/Lava.luau +9 -0
- package/runtime/EzVisualz/_impl/Presets/LavaStroke.luau +13 -0
- package/runtime/EzVisualz/_impl/Presets/Matrix.luau +21 -0
- package/runtime/EzVisualz/_impl/Presets/NeonStroke.luau +30 -0
- package/runtime/EzVisualz/_impl/Presets/OceanicStroke.luau +15 -0
- package/runtime/EzVisualz/_impl/Presets/Rainbow.luau +9 -0
- package/runtime/EzVisualz/_impl/Presets/RainbowOutline.luau +23 -0
- package/runtime/EzVisualz/_impl/Presets/RainbowStroke.luau +13 -0
- package/runtime/EzVisualz/_impl/Presets/Shine.luau +48 -0
- package/runtime/EzVisualz/_impl/Presets/ShineOutline.luau +66 -0
- package/runtime/EzVisualz/_impl/Presets/Silver.luau +10 -0
- package/runtime/EzVisualz/_impl/Presets/SilverStroke.luau +15 -0
- package/runtime/EzVisualz/_impl/Presets/SunsetStroke.luau +31 -0
- package/runtime/EzVisualz/_impl/Presets/WaveStroke.luau +33 -0
- package/runtime/EzVisualz/_impl/Presets/Zebra.luau +21 -0
- package/runtime/EzVisualz/_impl/Presets/init.luau +9 -0
- package/runtime/EzVisualz/_impl/Stroke.luau +167 -0
- package/runtime/EzVisualz/_impl/Util.luau +7 -0
- package/runtime/EzVisualz/_impl/init.luau +319 -0
- package/runtime/EzVisualz/_impl/wally.lock +8 -0
- package/runtime/EzVisualz/_impl/wally.toml +8 -0
- package/runtime/EzVisualz/init.luau +9 -0
- package/runtime/EzVisualz/wally.lock +8 -0
- package/runtime/EzVisualz/wally.toml +8 -0
- package/runtime/FormatNumber/LICENSE.md +25 -0
- package/runtime/FormatNumber/Main/DecimalFormatSymbols.lua +43 -0
- package/runtime/FormatNumber/Main/IntegerWidth.lua +41 -0
- package/runtime/FormatNumber/Main/Notation.lua +116 -0
- package/runtime/FormatNumber/Main/Precision.lua +179 -0
- package/runtime/FormatNumber/Main/init.lua +199 -0
- package/runtime/FormatNumber/Simple/init.lua +76 -0
- package/runtime/FormatNumber/Version.lua +82 -0
- package/runtime/FormatNumber/_impl/LICENSE.md +25 -0
- package/runtime/FormatNumber/_impl/Main/DecimalFormatSymbols.lua +43 -0
- package/runtime/FormatNumber/_impl/Main/IntegerWidth.lua +41 -0
- package/runtime/FormatNumber/_impl/Main/Notation.lua +116 -0
- package/runtime/FormatNumber/_impl/Main/Precision.lua +179 -0
- package/runtime/FormatNumber/_impl/Main/init.lua +199 -0
- package/runtime/FormatNumber/_impl/Simple/init.lua +76 -0
- package/runtime/FormatNumber/_impl/Version.lua +82 -0
- package/runtime/FormatNumber/_impl/_internal/class.lua +204 -0
- package/runtime/FormatNumber/_impl/_internal/decimal_conversion.lua +30 -0
- package/runtime/FormatNumber/_impl/_internal/enums.lua +55 -0
- package/runtime/FormatNumber/_impl/_internal/format.lua +342 -0
- package/runtime/FormatNumber/_impl/_internal/formatter_settings.lua +160 -0
- package/runtime/FormatNumber/_impl/_internal/init.lua +8 -0
- package/runtime/FormatNumber/_impl/_internal/skeleton.lua +541 -0
- package/runtime/FormatNumber/_impl/init.lua +20 -0
- package/runtime/FormatNumber/_internal/class.lua +204 -0
- package/runtime/FormatNumber/_internal/decimal_conversion.lua +30 -0
- package/runtime/FormatNumber/_internal/enums.lua +55 -0
- package/runtime/FormatNumber/_internal/format.lua +342 -0
- package/runtime/FormatNumber/_internal/formatter_settings.lua +160 -0
- package/runtime/FormatNumber/_internal/init.lua +8 -0
- package/runtime/FormatNumber/_internal/skeleton.lua +541 -0
- package/runtime/FormatNumber/init.lua +20 -0
- package/runtime/FormatNumber/init.luau +20 -0
- package/runtime/Fusion/Animation/ExternalTime.luau +84 -0
- package/runtime/Fusion/Animation/Spring.luau +313 -0
- package/runtime/Fusion/Animation/Stopwatch.luau +128 -0
- package/runtime/Fusion/Animation/Tween.luau +178 -0
- package/runtime/Fusion/Animation/getTweenDuration.luau +27 -0
- package/runtime/Fusion/Animation/getTweenRatio.luau +47 -0
- package/runtime/Fusion/Animation/lerpType.luau +164 -0
- package/runtime/Fusion/Animation/packType.luau +100 -0
- package/runtime/Fusion/Animation/springCoefficients.luau +80 -0
- package/runtime/Fusion/Animation/unpackType.luau +103 -0
- package/runtime/Fusion/Colour/Oklab.luau +70 -0
- package/runtime/Fusion/Colour/sRGB.luau +47 -0
- package/runtime/Fusion/External.luau +156 -0
- package/runtime/Fusion/ExternalDebug.luau +70 -0
- package/runtime/Fusion/Graph/Observer.luau +111 -0
- package/runtime/Fusion/Graph/castToGraph.luau +29 -0
- package/runtime/Fusion/Graph/change.luau +81 -0
- package/runtime/Fusion/Graph/depend.luau +33 -0
- package/runtime/Fusion/Graph/evaluate.luau +56 -0
- package/runtime/Fusion/Instances/Attribute.luau +58 -0
- package/runtime/Fusion/Instances/AttributeChange.luau +47 -0
- package/runtime/Fusion/Instances/AttributeOut.luau +63 -0
- package/runtime/Fusion/Instances/Child.luau +21 -0
- package/runtime/Fusion/Instances/Children.luau +148 -0
- package/runtime/Fusion/Instances/Hydrate.luau +29 -0
- package/runtime/Fusion/Instances/New.luau +48 -0
- package/runtime/Fusion/Instances/OnChange.luau +50 -0
- package/runtime/Fusion/Instances/OnEvent.luau +54 -0
- package/runtime/Fusion/Instances/Out.luau +69 -0
- package/runtime/Fusion/Instances/Tag.luau +61 -0
- package/runtime/Fusion/Instances/applyInstanceProps.luau +149 -0
- package/runtime/Fusion/Instances/defaultProps.luau +194 -0
- package/runtime/Fusion/LICENSE +21 -0
- package/runtime/Fusion/Logging/formatError.luau +49 -0
- package/runtime/Fusion/Logging/messages.luau +46 -0
- package/runtime/Fusion/Logging/parseError.luau +25 -0
- package/runtime/Fusion/Memory/checkLifetime.luau +134 -0
- package/runtime/Fusion/Memory/deriveScope.luau +24 -0
- package/runtime/Fusion/Memory/deriveScopeImpl.luau +40 -0
- package/runtime/Fusion/Memory/doCleanup.luau +91 -0
- package/runtime/Fusion/Memory/innerScope.luau +34 -0
- package/runtime/Fusion/Memory/insert.luau +22 -0
- package/runtime/Fusion/Memory/needsDestruction.luau +17 -0
- package/runtime/Fusion/Memory/scoped.luau +24 -0
- package/runtime/Fusion/RobloxExternal.luau +98 -0
- package/runtime/Fusion/State/Computed.luau +122 -0
- package/runtime/Fusion/State/For/Disassembly.luau +207 -0
- package/runtime/Fusion/State/For/ForTypes.luau +30 -0
- package/runtime/Fusion/State/For/init.luau +101 -0
- package/runtime/Fusion/State/ForKeys.luau +88 -0
- package/runtime/Fusion/State/ForPairs.luau +91 -0
- package/runtime/Fusion/State/ForValues.luau +88 -0
- package/runtime/Fusion/State/Value.luau +76 -0
- package/runtime/Fusion/State/castToState.luau +26 -0
- package/runtime/Fusion/State/peek.luau +31 -0
- package/runtime/Fusion/State/updateAll.luau +1 -0
- package/runtime/Fusion/Types.luau +318 -0
- package/runtime/Fusion/Utility/Contextual.luau +91 -0
- package/runtime/Fusion/Utility/Safe.luau +23 -0
- package/runtime/Fusion/Utility/isSimilar.luau +29 -0
- package/runtime/Fusion/Utility/merge.luau +35 -0
- package/runtime/Fusion/Utility/nameOf.luau +35 -0
- package/runtime/Fusion/Utility/never.luau +14 -0
- package/runtime/Fusion/Utility/nicknames.luau +11 -0
- package/runtime/Fusion/Utility/xtypeof.luau +27 -0
- package/runtime/Fusion/_impl/Animation/ExternalTime.luau +84 -0
- package/runtime/Fusion/_impl/Animation/Spring.luau +313 -0
- package/runtime/Fusion/_impl/Animation/Stopwatch.luau +128 -0
- package/runtime/Fusion/_impl/Animation/Tween.luau +178 -0
- package/runtime/Fusion/_impl/Animation/getTweenDuration.luau +27 -0
- package/runtime/Fusion/_impl/Animation/getTweenRatio.luau +47 -0
- package/runtime/Fusion/_impl/Animation/lerpType.luau +164 -0
- package/runtime/Fusion/_impl/Animation/packType.luau +100 -0
- package/runtime/Fusion/_impl/Animation/springCoefficients.luau +80 -0
- package/runtime/Fusion/_impl/Animation/unpackType.luau +103 -0
- package/runtime/Fusion/_impl/Colour/Oklab.luau +70 -0
- package/runtime/Fusion/_impl/Colour/sRGB.luau +47 -0
- package/runtime/Fusion/_impl/External.luau +156 -0
- package/runtime/Fusion/_impl/ExternalDebug.luau +70 -0
- package/runtime/Fusion/_impl/Graph/Observer.luau +111 -0
- package/runtime/Fusion/_impl/Graph/castToGraph.luau +29 -0
- package/runtime/Fusion/_impl/Graph/change.luau +81 -0
- package/runtime/Fusion/_impl/Graph/depend.luau +33 -0
- package/runtime/Fusion/_impl/Graph/evaluate.luau +56 -0
- package/runtime/Fusion/_impl/Instances/Attribute.luau +58 -0
- package/runtime/Fusion/_impl/Instances/AttributeChange.luau +47 -0
- package/runtime/Fusion/_impl/Instances/AttributeOut.luau +63 -0
- package/runtime/Fusion/_impl/Instances/Child.luau +21 -0
- package/runtime/Fusion/_impl/Instances/Children.luau +148 -0
- package/runtime/Fusion/_impl/Instances/Hydrate.luau +29 -0
- package/runtime/Fusion/_impl/Instances/New.luau +48 -0
- package/runtime/Fusion/_impl/Instances/OnChange.luau +50 -0
- package/runtime/Fusion/_impl/Instances/OnEvent.luau +54 -0
- package/runtime/Fusion/_impl/Instances/Out.luau +69 -0
- package/runtime/Fusion/_impl/Instances/Tag.luau +61 -0
- package/runtime/Fusion/_impl/Instances/applyInstanceProps.luau +149 -0
- package/runtime/Fusion/_impl/Instances/defaultProps.luau +194 -0
- package/runtime/Fusion/_impl/LICENSE +21 -0
- package/runtime/Fusion/_impl/Logging/formatError.luau +49 -0
- package/runtime/Fusion/_impl/Logging/messages.luau +46 -0
- package/runtime/Fusion/_impl/Logging/parseError.luau +25 -0
- package/runtime/Fusion/_impl/Memory/checkLifetime.luau +134 -0
- package/runtime/Fusion/_impl/Memory/deriveScope.luau +24 -0
- package/runtime/Fusion/_impl/Memory/deriveScopeImpl.luau +40 -0
- package/runtime/Fusion/_impl/Memory/doCleanup.luau +91 -0
- package/runtime/Fusion/_impl/Memory/innerScope.luau +34 -0
- package/runtime/Fusion/_impl/Memory/insert.luau +22 -0
- package/runtime/Fusion/_impl/Memory/needsDestruction.luau +17 -0
- package/runtime/Fusion/_impl/Memory/scoped.luau +24 -0
- package/runtime/Fusion/_impl/RobloxExternal.luau +98 -0
- package/runtime/Fusion/_impl/State/Computed.luau +122 -0
- package/runtime/Fusion/_impl/State/For/Disassembly.luau +207 -0
- package/runtime/Fusion/_impl/State/For/ForTypes.luau +30 -0
- package/runtime/Fusion/_impl/State/For/init.luau +101 -0
- package/runtime/Fusion/_impl/State/ForKeys.luau +88 -0
- package/runtime/Fusion/_impl/State/ForPairs.luau +91 -0
- package/runtime/Fusion/_impl/State/ForValues.luau +88 -0
- package/runtime/Fusion/_impl/State/Value.luau +76 -0
- package/runtime/Fusion/_impl/State/castToState.luau +26 -0
- package/runtime/Fusion/_impl/State/peek.luau +31 -0
- package/runtime/Fusion/_impl/State/updateAll.luau +1 -0
- package/runtime/Fusion/_impl/Types.luau +318 -0
- package/runtime/Fusion/_impl/Utility/Contextual.luau +91 -0
- package/runtime/Fusion/_impl/Utility/Safe.luau +23 -0
- package/runtime/Fusion/_impl/Utility/isSimilar.luau +29 -0
- package/runtime/Fusion/_impl/Utility/merge.luau +35 -0
- package/runtime/Fusion/_impl/Utility/nameOf.luau +35 -0
- package/runtime/Fusion/_impl/Utility/never.luau +14 -0
- package/runtime/Fusion/_impl/Utility/nicknames.luau +11 -0
- package/runtime/Fusion/_impl/Utility/xtypeof.luau +27 -0
- package/runtime/Fusion/_impl/init.luau +83 -0
- package/runtime/Fusion/init.luau +27 -0
- package/runtime/Iris/API.lua +2085 -0
- package/runtime/Iris/Internal.lua +895 -0
- package/runtime/Iris/LICENSE.txt +21 -0
- package/runtime/Iris/PubTypes.lua +43 -0
- package/runtime/Iris/Types.lua +660 -0
- package/runtime/Iris/WidgetTypes.lua +521 -0
- package/runtime/Iris/_impl/API.lua +2085 -0
- package/runtime/Iris/_impl/Internal.lua +895 -0
- package/runtime/Iris/_impl/LICENSE.txt +21 -0
- package/runtime/Iris/_impl/PubTypes.lua +43 -0
- package/runtime/Iris/_impl/Types.lua +660 -0
- package/runtime/Iris/_impl/WidgetTypes.lua +521 -0
- package/runtime/Iris/_impl/config.lua +305 -0
- package/runtime/Iris/_impl/init.lua +696 -0
- package/runtime/Iris/_impl/widgets/Button.lua +90 -0
- package/runtime/Iris/_impl/widgets/Checkbox.lua +115 -0
- package/runtime/Iris/_impl/widgets/Combo.lua +492 -0
- package/runtime/Iris/_impl/widgets/Format.lua +140 -0
- package/runtime/Iris/_impl/widgets/Image.lua +155 -0
- package/runtime/Iris/_impl/widgets/Input.lua +1232 -0
- package/runtime/Iris/_impl/widgets/Menu.lua +599 -0
- package/runtime/Iris/_impl/widgets/Plot.lua +639 -0
- package/runtime/Iris/_impl/widgets/RadioButton.lua +126 -0
- package/runtime/Iris/_impl/widgets/Root.lua +143 -0
- package/runtime/Iris/_impl/widgets/Tab.lua +333 -0
- package/runtime/Iris/_impl/widgets/Table.lua +635 -0
- package/runtime/Iris/_impl/widgets/Text.lua +132 -0
- package/runtime/Iris/_impl/widgets/Tree.lua +287 -0
- package/runtime/Iris/_impl/widgets/Window.lua +1075 -0
- package/runtime/Iris/_impl/widgets/init.lua +447 -0
- package/runtime/Iris/config.lua +305 -0
- package/runtime/Iris/init.lua +696 -0
- package/runtime/Iris/init.luau +12 -0
- package/runtime/Iris/widgets/Button.lua +90 -0
- package/runtime/Iris/widgets/Checkbox.lua +115 -0
- package/runtime/Iris/widgets/Combo.lua +492 -0
- package/runtime/Iris/widgets/Format.lua +140 -0
- package/runtime/Iris/widgets/Image.lua +155 -0
- package/runtime/Iris/widgets/Input.lua +1232 -0
- package/runtime/Iris/widgets/Menu.lua +599 -0
- package/runtime/Iris/widgets/Plot.lua +639 -0
- package/runtime/Iris/widgets/RadioButton.lua +126 -0
- package/runtime/Iris/widgets/Root.lua +143 -0
- package/runtime/Iris/widgets/Tab.lua +333 -0
- package/runtime/Iris/widgets/Table.lua +635 -0
- package/runtime/Iris/widgets/Text.lua +132 -0
- package/runtime/Iris/widgets/Tree.lua +287 -0
- package/runtime/Iris/widgets/Window.lua +1075 -0
- package/runtime/Iris/widgets/init.lua +447 -0
- package/runtime/Janitor/FastDefer.luau +33 -0
- package/runtime/Janitor/LICENSE +21 -0
- package/runtime/Janitor/_impl/FastDefer.luau +33 -0
- package/runtime/Janitor/_impl/LICENSE +21 -0
- package/runtime/Janitor/_impl/init.luau +999 -0
- package/runtime/Janitor/init.luau +45 -0
- package/runtime/MathUtils/init.luau +100 -0
- package/runtime/Module3D/LICENSE +21 -0
- package/runtime/Module3D/_impl/LICENSE +21 -0
- package/runtime/Module3D/_impl/init.luau +269 -0
- package/runtime/Module3D/init.luau +14 -0
- package/runtime/Net/init.luau +125 -0
- package/runtime/Net/src/codec.luau +153 -0
- package/runtime/Occlude/init.luau +54 -0
- package/runtime/Promise/LICENSE +21 -0
- package/runtime/Promise/_impl/LICENSE +21 -0
- package/runtime/Promise/_impl/init.lua +1991 -0
- package/runtime/Promise/init.lua +1990 -0
- package/runtime/Promise/init.luau +13 -0
- package/runtime/Promise/types.luau +46 -0
- package/runtime/SOURCES.md +22 -0
- package/runtime/Spring/LICENSE +201 -0
- package/runtime/Spring/_impl/LICENSE +201 -0
- package/runtime/Spring/_impl/init.luau +111 -0
- package/runtime/Spring/init.luau +24 -0
- package/runtime/StateMachine/Classes/State.lua +375 -0
- package/runtime/StateMachine/Classes/Transition.lua +336 -0
- package/runtime/StateMachine/Functions/deepCopy.lua +19 -0
- package/runtime/StateMachine/Functions/mergeTables.lua +22 -0
- package/runtime/StateMachine/LICENSE +19 -0
- package/runtime/StateMachine/Vendor/Signal.lua +386 -0
- package/runtime/StateMachine/Vendor/Trove.lua +188 -0
- package/runtime/StateMachine/_impl/Classes/State.lua +375 -0
- package/runtime/StateMachine/_impl/Classes/Transition.lua +336 -0
- package/runtime/StateMachine/_impl/Functions/deepCopy.lua +19 -0
- package/runtime/StateMachine/_impl/Functions/mergeTables.lua +22 -0
- package/runtime/StateMachine/_impl/LICENSE +19 -0
- package/runtime/StateMachine/_impl/Vendor/Signal.lua +386 -0
- package/runtime/StateMachine/_impl/Vendor/Trove.lua +188 -0
- package/runtime/StateMachine/_impl/init.lua +595 -0
- package/runtime/StateMachine/init.lua +595 -0
- package/runtime/StateMachine/init.luau +10 -0
- package/runtime/StickyBillboard/init.luau +167 -0
- package/runtime/TopbarPlus/Attribute.lua +35 -0
- package/runtime/TopbarPlus/Elements/Caption.lua +316 -0
- package/runtime/TopbarPlus/Elements/Container.lua +215 -0
- package/runtime/TopbarPlus/Elements/Dropdown.lua +315 -0
- package/runtime/TopbarPlus/Elements/Indicator.lua +91 -0
- package/runtime/TopbarPlus/Elements/Menu.lua +180 -0
- package/runtime/TopbarPlus/Elements/Notice.lua +113 -0
- package/runtime/TopbarPlus/Elements/Selection.lua +49 -0
- package/runtime/TopbarPlus/Elements/Widget.lua +437 -0
- package/runtime/TopbarPlus/Features/Gamepad.lua +201 -0
- package/runtime/TopbarPlus/Features/Overflow.lua +360 -0
- package/runtime/TopbarPlus/Features/Themes/Classic.lua +27 -0
- package/runtime/TopbarPlus/Features/Themes/Default.lua +75 -0
- package/runtime/TopbarPlus/Features/Themes/init.lua +353 -0
- package/runtime/TopbarPlus/LICENSE +381 -0
- package/runtime/TopbarPlus/Packages/GoodSignal.lua +182 -0
- package/runtime/TopbarPlus/Packages/Janitor.lua +322 -0
- package/runtime/TopbarPlus/Reference.lua +30 -0
- package/runtime/TopbarPlus/Types.lua +477 -0
- package/runtime/TopbarPlus/Utility.lua +462 -0
- package/runtime/TopbarPlus/VERSION.lua +51 -0
- package/runtime/TopbarPlus/_impl/Attribute.lua +35 -0
- package/runtime/TopbarPlus/_impl/Elements/Caption.lua +316 -0
- package/runtime/TopbarPlus/_impl/Elements/Container.lua +215 -0
- package/runtime/TopbarPlus/_impl/Elements/Dropdown.lua +315 -0
- package/runtime/TopbarPlus/_impl/Elements/Indicator.lua +91 -0
- package/runtime/TopbarPlus/_impl/Elements/Menu.lua +180 -0
- package/runtime/TopbarPlus/_impl/Elements/Notice.lua +113 -0
- package/runtime/TopbarPlus/_impl/Elements/Selection.lua +49 -0
- package/runtime/TopbarPlus/_impl/Elements/Widget.lua +437 -0
- package/runtime/TopbarPlus/_impl/Features/Gamepad.lua +201 -0
- package/runtime/TopbarPlus/_impl/Features/Overflow.lua +360 -0
- package/runtime/TopbarPlus/_impl/Features/Themes/Classic.lua +27 -0
- package/runtime/TopbarPlus/_impl/Features/Themes/Default.lua +75 -0
- package/runtime/TopbarPlus/_impl/Features/Themes/init.lua +353 -0
- package/runtime/TopbarPlus/_impl/LICENSE +381 -0
- package/runtime/TopbarPlus/_impl/Packages/GoodSignal.lua +182 -0
- package/runtime/TopbarPlus/_impl/Packages/Janitor.lua +322 -0
- package/runtime/TopbarPlus/_impl/Reference.lua +30 -0
- package/runtime/TopbarPlus/_impl/Types.lua +477 -0
- package/runtime/TopbarPlus/_impl/Utility.lua +462 -0
- package/runtime/TopbarPlus/_impl/VERSION.lua +51 -0
- package/runtime/TopbarPlus/_impl/init.lua +1249 -0
- package/runtime/TopbarPlus/init.lua +1249 -0
- package/runtime/TopbarPlus/init.luau +8 -0
- package/runtime/Twinkle/init.luau +157 -0
- package/runtime/VfxUtil/init.luau +164 -0
- package/src/api.generated.js +3675 -0
- package/src/api.js +57 -0
- package/src/architecture.js +393 -0
- package/src/cli.js +192 -0
- package/src/compile.js +40 -0
- package/src/emit.js +213 -0
- package/src/lex.js +149 -0
- package/src/libs.js +355 -0
- package/src/parse.js +421 -0
- package/src/preprocess.js +80 -0
- package/src/understand.js +453 -0
- package/templates/game/.clangd +5 -0
- package/templates/game/.vscode/c_cpp_properties.json +23 -0
- package/templates/game/.vscode/settings.json +12 -0
- package/templates/game/Packages/.gitkeep +0 -0
- package/templates/game/cluaupp.config.json +6 -0
- package/templates/game/compile_flags.txt +3 -0
- package/templates/game/default.project.json +39 -0
- package/templates/game/package.json +9 -0
- package/templates/game/src/client/init.client.cpp +5 -0
- package/templates/game/src/server/leaderstats.server.cpp +28 -0
- package/templates/game/src/shared/config.cpp +5 -0
- package/templates/game/src/shared/config.h +3 -0
- package/templates/game/wally.toml +11 -0
|
@@ -0,0 +1,895 @@
|
|
|
1
|
+
local Types = require(script.Parent.Types)
|
|
2
|
+
|
|
3
|
+
return function(Iris: Types.Iris): Types.Internal
|
|
4
|
+
--[=[
|
|
5
|
+
@class Internal
|
|
6
|
+
An internal class within Iris containing all the backend data and functions for Iris to operate.
|
|
7
|
+
It is recommended that you don't generally interact with Internal unless you understand what you are doing.
|
|
8
|
+
]=]
|
|
9
|
+
local Internal = {} :: Types.Internal
|
|
10
|
+
|
|
11
|
+
--[[
|
|
12
|
+
---------------------------------
|
|
13
|
+
[SECTION] Properties
|
|
14
|
+
---------------------------------
|
|
15
|
+
]]
|
|
16
|
+
|
|
17
|
+
Internal._version = [[ 2.5.1 ]]
|
|
18
|
+
|
|
19
|
+
Internal._started = false -- has Iris.connect been called yet
|
|
20
|
+
Internal._shutdown = false
|
|
21
|
+
Internal._cycleTick = 0 -- increments for each call to Cycle, used to determine the relative age and freshness of generated widgets
|
|
22
|
+
Internal._deltaTime = 0
|
|
23
|
+
|
|
24
|
+
-- Refresh
|
|
25
|
+
Internal._globalRefreshRequested = false -- refresh means that all GUI is destroyed and regenerated, usually because a style change was made and needed to be propogated to all UI
|
|
26
|
+
Internal._refreshCounter = 0 -- if true, when _Insert is called, the widget called will be regenerated
|
|
27
|
+
Internal._refreshLevel = 1
|
|
28
|
+
Internal._refreshStack = table.create(16)
|
|
29
|
+
|
|
30
|
+
-- Widgets & Instances
|
|
31
|
+
Internal._widgets = {}
|
|
32
|
+
Internal._stackIndex = 1 -- Points to the index that IDStack is currently in, when computing cycle
|
|
33
|
+
Internal._rootInstance = nil
|
|
34
|
+
Internal._rootWidget = {
|
|
35
|
+
ID = "R",
|
|
36
|
+
type = "Root",
|
|
37
|
+
Instance = Internal._rootInstance,
|
|
38
|
+
ZIndex = 0,
|
|
39
|
+
ZOffset = 0,
|
|
40
|
+
}
|
|
41
|
+
Internal._lastWidget = Internal._rootWidget -- widget which was most recently rendered
|
|
42
|
+
|
|
43
|
+
-- Config
|
|
44
|
+
Internal._rootConfig = {} -- root style which all widgets derive from
|
|
45
|
+
Internal._config = Internal._rootConfig
|
|
46
|
+
|
|
47
|
+
-- ID
|
|
48
|
+
Internal._IDStack = { "R" }
|
|
49
|
+
Internal._usedIDs = {} -- hash of IDs which are already used in a cycle, value is the # of occurances so that getID can assign a unique ID for each occurance
|
|
50
|
+
Internal._pushedIds = {}
|
|
51
|
+
Internal._newID = false
|
|
52
|
+
Internal._nextWidgetId = nil
|
|
53
|
+
|
|
54
|
+
-- State
|
|
55
|
+
Internal._states = {} -- Iris.States
|
|
56
|
+
|
|
57
|
+
-- Callback
|
|
58
|
+
Internal._postCycleCallbacks = {}
|
|
59
|
+
Internal._connectedFunctions = {} -- functions which run each Iris cycle, connected by the user
|
|
60
|
+
Internal._connections = {}
|
|
61
|
+
Internal._initFunctions = {}
|
|
62
|
+
|
|
63
|
+
-- Error
|
|
64
|
+
Internal._fullErrorTracebacks = game:GetService("RunService"):IsStudio()
|
|
65
|
+
|
|
66
|
+
--[=[
|
|
67
|
+
@within Internal
|
|
68
|
+
@prop _cycleCoroutine thread
|
|
69
|
+
|
|
70
|
+
The thread which handles all connected functions. Each connection is within a pcall statement which prevents
|
|
71
|
+
Iris from crashing and instead stopping at the error.
|
|
72
|
+
]=]
|
|
73
|
+
Internal._cycleCoroutine = coroutine.create(function()
|
|
74
|
+
while Internal._started do
|
|
75
|
+
for _, callback in Internal._connectedFunctions do
|
|
76
|
+
debug.profilebegin("Iris/Connection")
|
|
77
|
+
local status, _error: string = pcall(callback)
|
|
78
|
+
debug.profileend()
|
|
79
|
+
if not status then
|
|
80
|
+
-- any error reserts the _stackIndex for the next frame and yields the error.
|
|
81
|
+
Internal._stackIndex = 1
|
|
82
|
+
coroutine.yield(false, _error)
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
-- after all callbacks, we yield so it only runs once a frame.
|
|
86
|
+
coroutine.yield(true)
|
|
87
|
+
end
|
|
88
|
+
end)
|
|
89
|
+
|
|
90
|
+
--[[
|
|
91
|
+
-----------------------
|
|
92
|
+
[SECTION] State
|
|
93
|
+
-----------------------
|
|
94
|
+
]]
|
|
95
|
+
|
|
96
|
+
--[=[
|
|
97
|
+
@class State
|
|
98
|
+
This class wraps a value in getters and setters, its main purpose is to allow primatives to be passed as objects.
|
|
99
|
+
Constructors for this class are available in [Iris]
|
|
100
|
+
|
|
101
|
+
```lua
|
|
102
|
+
local state = Iris.State(0) -- we initialise the state with a value of 0
|
|
103
|
+
|
|
104
|
+
-- these are equivalent. Ideally you should use `:get()` and ignore `.value`.
|
|
105
|
+
print(state:get())
|
|
106
|
+
print(state.value)
|
|
107
|
+
|
|
108
|
+
state:set(state:get() + 1) -- increments the state by getting the current value and adding 1.
|
|
109
|
+
|
|
110
|
+
state:onChange(function(newValue)
|
|
111
|
+
print(`The value of the state is now: {newValue}`)
|
|
112
|
+
end)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
:::caution Caution: Callbacks
|
|
116
|
+
Never call `:set()` on a state when inside the `:onChange()` callback of the same state. This will cause a continous callback.
|
|
117
|
+
|
|
118
|
+
Never chain states together so that each state changes the value of another state in a cyclic nature. This will cause a continous callback.
|
|
119
|
+
:::
|
|
120
|
+
]=]
|
|
121
|
+
local StateClass = {}
|
|
122
|
+
StateClass.__index = StateClass
|
|
123
|
+
|
|
124
|
+
--[=[
|
|
125
|
+
@within State
|
|
126
|
+
@method get<T>
|
|
127
|
+
@return T
|
|
128
|
+
|
|
129
|
+
Returns the states current value.
|
|
130
|
+
]=]
|
|
131
|
+
function StateClass:get<T>() -- you can also simply use .value
|
|
132
|
+
return self.value
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
--[=[
|
|
136
|
+
@within State
|
|
137
|
+
@method set<T>
|
|
138
|
+
@param newValue T
|
|
139
|
+
@param force boolean? -- force an update to all connections
|
|
140
|
+
@return T
|
|
141
|
+
|
|
142
|
+
Allows the caller to assign the state object a new value, and returns the new value.
|
|
143
|
+
]=]
|
|
144
|
+
function StateClass:set<T>(newValue: T, force: true?)
|
|
145
|
+
if newValue == self.value and force ~= true then
|
|
146
|
+
-- no need to update on no change.
|
|
147
|
+
return self.value
|
|
148
|
+
end
|
|
149
|
+
self.value = newValue
|
|
150
|
+
self.lastChangeTick = Iris.Internal._cycleTick
|
|
151
|
+
for _, thisWidget: Types.Widget in self.ConnectedWidgets do
|
|
152
|
+
if thisWidget.lastCycleTick ~= -1 then
|
|
153
|
+
Internal._widgets[thisWidget.type].UpdateState(thisWidget)
|
|
154
|
+
end
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
for _, callback in self.ConnectedFunctions do
|
|
158
|
+
callback(newValue)
|
|
159
|
+
end
|
|
160
|
+
return self.value
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
--[=[
|
|
164
|
+
@within State
|
|
165
|
+
@method onChange<T>
|
|
166
|
+
@param callback (newValue: T) -> ()
|
|
167
|
+
@return () -> ()
|
|
168
|
+
|
|
169
|
+
Allows the caller to connect a callback which is called when the states value is changed.
|
|
170
|
+
|
|
171
|
+
:::caution Caution: Single
|
|
172
|
+
Calling `:onChange()` every frame will add a new function every frame.
|
|
173
|
+
You must ensure you are only calling `:onChange()` once for each callback for the state's entire lifetime.
|
|
174
|
+
:::
|
|
175
|
+
]=]
|
|
176
|
+
function StateClass:onChange<T>(callback: (newValue: T) -> ())
|
|
177
|
+
local connectionIndex: number = #self.ConnectedFunctions + 1
|
|
178
|
+
self.ConnectedFunctions[connectionIndex] = callback
|
|
179
|
+
return function()
|
|
180
|
+
self.ConnectedFunctions[connectionIndex] = nil
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
--[=[
|
|
185
|
+
@within State
|
|
186
|
+
@method changed<T>
|
|
187
|
+
@return boolean
|
|
188
|
+
|
|
189
|
+
Returns true if the state was changed on this frame.
|
|
190
|
+
]=]
|
|
191
|
+
function StateClass:changed<T>()
|
|
192
|
+
return self.lastChangeTick + 1 == Internal._cycleTick
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
Internal.StateClass = StateClass
|
|
196
|
+
|
|
197
|
+
--[[
|
|
198
|
+
---------------------------
|
|
199
|
+
[SECTION] Functions
|
|
200
|
+
---------------------------
|
|
201
|
+
]]
|
|
202
|
+
|
|
203
|
+
--[=[
|
|
204
|
+
@within Internal
|
|
205
|
+
@function _cycle
|
|
206
|
+
|
|
207
|
+
Called every frame to handle all of the widget management. Any previous frame data is ammended and everything updates.
|
|
208
|
+
]=]
|
|
209
|
+
function Internal._cycle(deltaTime: number)
|
|
210
|
+
-- debug.profilebegin("Iris/Cycle")
|
|
211
|
+
if Iris.Disabled then
|
|
212
|
+
return -- Stops all rendering, effectively freezes the current frame with no interaction.
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
Internal._rootWidget.lastCycleTick = Internal._cycleTick
|
|
216
|
+
if Internal._rootInstance == nil or Internal._rootInstance.Parent == nil then
|
|
217
|
+
Iris.ForceRefresh()
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
for _, widget in Internal._lastVDOM do
|
|
221
|
+
if widget.lastCycleTick ~= Internal._cycleTick and (widget.lastCycleTick ~= -1) then
|
|
222
|
+
-- a widget which used to be rendered was not called last frame, so we discard it.
|
|
223
|
+
-- if the cycle tick is -1 we have already discarded it.
|
|
224
|
+
Internal._DiscardWidget(widget)
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
-- represents all widgets created last frame. We keep the _lastVDOM to reuse widgets from the previous frame
|
|
229
|
+
-- rather than creating a new instance every frame.
|
|
230
|
+
setmetatable(Internal._lastVDOM, { __mode = "kv" })
|
|
231
|
+
Internal._lastVDOM = Internal._VDOM
|
|
232
|
+
Internal._VDOM = Internal._generateEmptyVDOM()
|
|
233
|
+
|
|
234
|
+
-- anything that wnats to run before the frame.
|
|
235
|
+
task.spawn(function()
|
|
236
|
+
-- debug.profilebegin("Iris/PostCycleCallbacks")
|
|
237
|
+
for _, callback in Internal._postCycleCallbacks do
|
|
238
|
+
callback()
|
|
239
|
+
end
|
|
240
|
+
-- debug.profileend()
|
|
241
|
+
end)
|
|
242
|
+
|
|
243
|
+
if Internal._globalRefreshRequested then
|
|
244
|
+
-- rerender every widget
|
|
245
|
+
--debug.profilebegin("Iris Refresh")
|
|
246
|
+
Internal._generateSelectionImageObject()
|
|
247
|
+
Internal._globalRefreshRequested = false
|
|
248
|
+
for _, widget in Internal._lastVDOM do
|
|
249
|
+
Internal._DiscardWidget(widget)
|
|
250
|
+
end
|
|
251
|
+
Internal._generateRootInstance()
|
|
252
|
+
Internal._lastVDOM = Internal._generateEmptyVDOM()
|
|
253
|
+
--debug.profileend()
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
-- update counters
|
|
257
|
+
Internal._cycleTick += 1
|
|
258
|
+
Internal._deltaTime = deltaTime
|
|
259
|
+
table.clear(Internal._usedIDs)
|
|
260
|
+
|
|
261
|
+
-- if Internal.parentInstance:IsA("GuiBase2d") and math.min(Internal.parentInstance.AbsoluteSize.X, Internal.parentInstance.AbsoluteSize.Y) < 100 then
|
|
262
|
+
-- error("Iris Parent Instance is too small")
|
|
263
|
+
-- end
|
|
264
|
+
local compatibleParent = (Internal.parentInstance:IsA("GuiBase2d") or Internal.parentInstance:IsA("BasePlayerGui"))
|
|
265
|
+
if compatibleParent == false then
|
|
266
|
+
error("The Iris parent instance will not display any GUIs.")
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
-- if we are running in Studio, we want full error tracebacks, so we don't have
|
|
270
|
+
-- any pcall to protect from an error.
|
|
271
|
+
if Internal._fullErrorTracebacks then
|
|
272
|
+
-- debug.profilebegin("Iris/Cycle/Callback")
|
|
273
|
+
for _, callback in Internal._connectedFunctions do
|
|
274
|
+
callback()
|
|
275
|
+
end
|
|
276
|
+
else
|
|
277
|
+
-- debug.profilebegin("Iris/Cycle/Coroutine")
|
|
278
|
+
|
|
279
|
+
-- each frame we check on our thread status.
|
|
280
|
+
local coroutineStatus = coroutine.status(Internal._cycleCoroutine)
|
|
281
|
+
if coroutineStatus == "suspended" then
|
|
282
|
+
-- suspended means it yielded, either because it was a complete success
|
|
283
|
+
-- or it caught an error in the code. We run it again for this frame.
|
|
284
|
+
local _, success, result = coroutine.resume(Internal._cycleCoroutine)
|
|
285
|
+
if success == false then
|
|
286
|
+
-- Connected function code errored
|
|
287
|
+
error(result, 0)
|
|
288
|
+
end
|
|
289
|
+
elseif coroutineStatus == "running" then
|
|
290
|
+
-- still running (probably because of an asynchronous method inside a connection).
|
|
291
|
+
error("Iris cycleCoroutine took to long to yield. Connected functions should not yield.")
|
|
292
|
+
else
|
|
293
|
+
-- should never reach this (nothing you can do).
|
|
294
|
+
error("unrecoverable state")
|
|
295
|
+
end
|
|
296
|
+
-- debug.profileend()
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
if Internal._stackIndex ~= 1 then
|
|
300
|
+
-- has to be larger than 1 because of the check that it isnt below 1 in Iris.End
|
|
301
|
+
Internal._stackIndex = 1
|
|
302
|
+
error("Too few calls to Iris.End().", 0)
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
-- Errors if the end user forgot to pop all their ids as they would leak over into the next frame
|
|
306
|
+
-- could also just clear, but that might be confusing behaviour.
|
|
307
|
+
if #Internal._pushedIds ~= 0 then
|
|
308
|
+
error("Too few calls to Iris.PopId().", 0)
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
-- debug.profileend()
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
--[=[
|
|
315
|
+
@within Internal
|
|
316
|
+
@ignore
|
|
317
|
+
@function _NoOp
|
|
318
|
+
|
|
319
|
+
A dummy function which does nothing. Used as a placeholder for optional methods in a widget class.
|
|
320
|
+
Used in `Internal.WidgetConstructor`
|
|
321
|
+
]=]
|
|
322
|
+
function Internal._NoOp() end
|
|
323
|
+
|
|
324
|
+
-- Widget
|
|
325
|
+
|
|
326
|
+
--[=[
|
|
327
|
+
@within Internal
|
|
328
|
+
@function WidgetConstructor
|
|
329
|
+
@param type string -- name used to denote the widget class.
|
|
330
|
+
@param widgetClass Types.WidgetClass -- table of methods for the new widget.
|
|
331
|
+
|
|
332
|
+
For each widget, a widget class is created which handles all the operations of a widget. This removes the class nature
|
|
333
|
+
of widgets, and simplifies the available functions which can be applied to any widget. The widgets themselves are
|
|
334
|
+
dumb tables containing all the data but no methods to handle any of the data apart from events.
|
|
335
|
+
]=]
|
|
336
|
+
function Internal.WidgetConstructor(type: string, widgetClass: Types.WidgetClass)
|
|
337
|
+
local Fields = {
|
|
338
|
+
All = {
|
|
339
|
+
Required = {
|
|
340
|
+
"Generate", -- generates the instance.
|
|
341
|
+
"Discard",
|
|
342
|
+
"Update",
|
|
343
|
+
|
|
344
|
+
-- not methods !
|
|
345
|
+
"Args",
|
|
346
|
+
"Events",
|
|
347
|
+
"hasChildren",
|
|
348
|
+
"hasState",
|
|
349
|
+
},
|
|
350
|
+
Optional = {},
|
|
351
|
+
},
|
|
352
|
+
IfState = {
|
|
353
|
+
Required = {
|
|
354
|
+
"GenerateState",
|
|
355
|
+
"UpdateState",
|
|
356
|
+
},
|
|
357
|
+
Optional = {},
|
|
358
|
+
},
|
|
359
|
+
IfChildren = {
|
|
360
|
+
Required = {
|
|
361
|
+
"ChildAdded", -- returns the parent of the child widget.
|
|
362
|
+
},
|
|
363
|
+
Optional = {
|
|
364
|
+
"ChildDiscarded",
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
-- we ensure all essential functions and properties are present, otherwise the code will break later.
|
|
370
|
+
-- some functions will only be needed if the widget has children or has state.
|
|
371
|
+
local thisWidget = {} :: Types.WidgetClass
|
|
372
|
+
for _, field in Fields.All.Required do
|
|
373
|
+
assert(widgetClass[field] ~= nil, `field {field} is missing from widget {type}, it is required for all widgets`)
|
|
374
|
+
thisWidget[field] = widgetClass[field]
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
for _, field in Fields.All.Optional do
|
|
378
|
+
if widgetClass[field] == nil then
|
|
379
|
+
-- assign a dummy function which does nothing.
|
|
380
|
+
thisWidget[field] = Internal._NoOp
|
|
381
|
+
else
|
|
382
|
+
thisWidget[field] = widgetClass[field]
|
|
383
|
+
end
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
if widgetClass.hasState then
|
|
387
|
+
for _, field in Fields.IfState.Required do
|
|
388
|
+
assert(widgetClass[field] ~= nil, `field {field} is missing from widget {type}, it is required for all widgets with state`)
|
|
389
|
+
thisWidget[field] = widgetClass[field]
|
|
390
|
+
end
|
|
391
|
+
for _, field in Fields.IfState.Optional do
|
|
392
|
+
if widgetClass[field] == nil then
|
|
393
|
+
thisWidget[field] = Internal._NoOp
|
|
394
|
+
else
|
|
395
|
+
thisWidget[field] = widgetClass[field]
|
|
396
|
+
end
|
|
397
|
+
end
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
if widgetClass.hasChildren then
|
|
401
|
+
for _, field in Fields.IfChildren.Required do
|
|
402
|
+
assert(widgetClass[field] ~= nil, `field {field} is missing from widget {type}, it is required for all widgets with children`)
|
|
403
|
+
thisWidget[field] = widgetClass[field]
|
|
404
|
+
end
|
|
405
|
+
for _, field in Fields.IfChildren.Optional do
|
|
406
|
+
if widgetClass[field] == nil then
|
|
407
|
+
thisWidget[field] = Internal._NoOp
|
|
408
|
+
else
|
|
409
|
+
thisWidget[field] = widgetClass[field]
|
|
410
|
+
end
|
|
411
|
+
end
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
-- an internal table of all widgets to the widget class.
|
|
415
|
+
Internal._widgets[type] = thisWidget
|
|
416
|
+
-- allowing access to the index for each widget argument.
|
|
417
|
+
Iris.Args[type] = thisWidget.Args
|
|
418
|
+
|
|
419
|
+
local ArgNames = {}
|
|
420
|
+
for index, argument in thisWidget.Args do
|
|
421
|
+
ArgNames[argument] = index
|
|
422
|
+
end
|
|
423
|
+
thisWidget.ArgNames = ArgNames
|
|
424
|
+
|
|
425
|
+
for index, _ in thisWidget.Events do
|
|
426
|
+
if Iris.Events[index] == nil then
|
|
427
|
+
Iris.Events[index] = function()
|
|
428
|
+
return Internal._EventCall(Internal._lastWidget, index)
|
|
429
|
+
end
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
end
|
|
433
|
+
|
|
434
|
+
--[=[
|
|
435
|
+
@within Internal
|
|
436
|
+
@function _Insert
|
|
437
|
+
@param widgetType: string -- name of widget class.
|
|
438
|
+
@param arguments { [string]: number } -- arguments of the widget.
|
|
439
|
+
@param states { [string]: States<any> }? -- states of the widget.
|
|
440
|
+
@return Widget -- the widget.
|
|
441
|
+
|
|
442
|
+
Every widget is created through _Insert. An ID is generated based on the line of the calling code and is used to
|
|
443
|
+
find the previous frame widget if it exists. If no widget exists, a new one is created.
|
|
444
|
+
]=]
|
|
445
|
+
function Internal._Insert(widgetType: string, args: Types.WidgetArguments?, states: Types.WidgetStates?)
|
|
446
|
+
local ID = Internal._getID(3)
|
|
447
|
+
--debug.profilebegin(ID)
|
|
448
|
+
|
|
449
|
+
-- fetch the widget class which contains all the functions for the widget.
|
|
450
|
+
local thisWidgetClass = Internal._widgets[widgetType]
|
|
451
|
+
|
|
452
|
+
if Internal._VDOM[ID] then
|
|
453
|
+
-- widget already created once this frame, so we can append to it.
|
|
454
|
+
return Internal._ContinueWidget(ID, widgetType)
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
local arguments = {} :: Types.Arguments
|
|
458
|
+
if args ~= nil then
|
|
459
|
+
if type(args) ~= "table" then
|
|
460
|
+
args = { args }
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
-- convert the arguments to a key-value dictionary so arguments can be referred to by their name and not index.
|
|
464
|
+
for index, argument in args do
|
|
465
|
+
assert(index > 0, `Widget Arguments must be a positive number, not {index} of type {typeof(index)} for {argument}.`)
|
|
466
|
+
arguments[thisWidgetClass.ArgNames[index]] = argument
|
|
467
|
+
end
|
|
468
|
+
end
|
|
469
|
+
-- prevents tampering with the arguments which are used to check for changes.
|
|
470
|
+
table.freeze(arguments)
|
|
471
|
+
|
|
472
|
+
local lastWidget = Internal._lastVDOM[ID]
|
|
473
|
+
if lastWidget then
|
|
474
|
+
if Internal._refreshCounter > 0 or widgetType ~= lastWidget.type then
|
|
475
|
+
-- every widget is being redrawn, or this widget type has changed
|
|
476
|
+
Internal._DiscardWidget(lastWidget)
|
|
477
|
+
lastWidget = nil
|
|
478
|
+
end
|
|
479
|
+
end
|
|
480
|
+
local thisWidget = if lastWidget == nil then Internal._GenNewWidget(widgetType, arguments, states, ID) else lastWidget
|
|
481
|
+
|
|
482
|
+
local parentWidget = thisWidget.parentWidget
|
|
483
|
+
|
|
484
|
+
if thisWidget.type ~= "Window" and thisWidget.type ~= "Tooltip" then
|
|
485
|
+
if thisWidget.ZIndex ~= parentWidget.ZOffset then
|
|
486
|
+
parentWidget.ZUpdate = true
|
|
487
|
+
end
|
|
488
|
+
|
|
489
|
+
if parentWidget.ZUpdate then
|
|
490
|
+
thisWidget.ZIndex = parentWidget.ZOffset
|
|
491
|
+
if thisWidget.Instance then
|
|
492
|
+
thisWidget.Instance.ZIndex = thisWidget.ZIndex
|
|
493
|
+
thisWidget.Instance.LayoutOrder = thisWidget.ZIndex
|
|
494
|
+
end
|
|
495
|
+
end
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
-- since rows are not instances, but will be removed if not updated, we have to add specific table code.
|
|
499
|
+
if parentWidget.type == "Table" then
|
|
500
|
+
local Table = parentWidget :: Types.Table
|
|
501
|
+
Table._rowCycles[Table._rowIndex] = Internal._cycleTick
|
|
502
|
+
end
|
|
503
|
+
|
|
504
|
+
if Internal._deepCompare(thisWidget.providedArguments, arguments) == false then
|
|
505
|
+
-- the widgets arguments have changed, the widget should update to reflect changes.
|
|
506
|
+
-- providedArguments is the frozen table which will not change.
|
|
507
|
+
-- the arguments can be altered internally, which happens for the input widgets.
|
|
508
|
+
thisWidget.arguments = Internal._deepCopy(arguments)
|
|
509
|
+
thisWidget.providedArguments = arguments
|
|
510
|
+
thisWidgetClass.Update(thisWidget)
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
thisWidget.lastCycleTick = Internal._cycleTick
|
|
514
|
+
parentWidget.ZOffset += 1
|
|
515
|
+
|
|
516
|
+
if thisWidgetClass.hasChildren then
|
|
517
|
+
local thisParent = thisWidget :: Types.ParentWidget
|
|
518
|
+
-- a parent widget, so we increase our depth.
|
|
519
|
+
thisParent.ZOffset = 0
|
|
520
|
+
thisParent.ZUpdate = false
|
|
521
|
+
Internal._stackIndex += 1
|
|
522
|
+
Internal._IDStack[Internal._stackIndex] = thisWidget.ID
|
|
523
|
+
end
|
|
524
|
+
|
|
525
|
+
Internal._VDOM[ID] = thisWidget
|
|
526
|
+
Internal._lastWidget = thisWidget
|
|
527
|
+
|
|
528
|
+
--debug.profileend()
|
|
529
|
+
|
|
530
|
+
return thisWidget
|
|
531
|
+
end
|
|
532
|
+
|
|
533
|
+
--[=[
|
|
534
|
+
@within Internal
|
|
535
|
+
@function _GenNewWidget
|
|
536
|
+
@param widgetType string
|
|
537
|
+
@param arguments { [string]: any } -- arguments of the widget.
|
|
538
|
+
@param states { [string]: State<any> }? -- states of the widget.
|
|
539
|
+
@param ID ID -- id of the new widget. Determined in `Internal._Insert`
|
|
540
|
+
@return Widget -- the newly created widget.
|
|
541
|
+
|
|
542
|
+
All widgets are created as tables with properties. The widget class contains the functions to create the UI instances and
|
|
543
|
+
update the widget or change state.
|
|
544
|
+
]=]
|
|
545
|
+
function Internal._GenNewWidget(widgetType: string, arguments: Types.Arguments, states: Types.WidgetStates?, ID: Types.ID)
|
|
546
|
+
local parentId = Internal._IDStack[Internal._stackIndex]
|
|
547
|
+
local parentWidget: Types.ParentWidget = Internal._VDOM[parentId]
|
|
548
|
+
local thisWidgetClass = Internal._widgets[widgetType]
|
|
549
|
+
|
|
550
|
+
-- widgets are just tables with properties.
|
|
551
|
+
local thisWidget = {} :: Types.Widget
|
|
552
|
+
setmetatable(thisWidget, thisWidget)
|
|
553
|
+
|
|
554
|
+
thisWidget.ID = ID
|
|
555
|
+
thisWidget.type = widgetType
|
|
556
|
+
thisWidget.parentWidget = parentWidget
|
|
557
|
+
thisWidget.trackedEvents = {}
|
|
558
|
+
-- thisWidget.UID = HttpService:GenerateGUID(false):sub(0, 8)
|
|
559
|
+
|
|
560
|
+
-- widgets have lots of space to ensure they are always visible.
|
|
561
|
+
thisWidget.ZIndex = parentWidget.ZOffset
|
|
562
|
+
|
|
563
|
+
thisWidget.Instance = thisWidgetClass.Generate(thisWidget)
|
|
564
|
+
-- tooltips set their parent in the generation method, so we need to udpate it here
|
|
565
|
+
parentWidget = thisWidget.parentWidget
|
|
566
|
+
|
|
567
|
+
if Internal._config.Parent then
|
|
568
|
+
thisWidget.Instance.Parent = Internal._config.Parent
|
|
569
|
+
else
|
|
570
|
+
thisWidget.Instance.Parent = Internal._widgets[parentWidget.type].ChildAdded(parentWidget, thisWidget)
|
|
571
|
+
end
|
|
572
|
+
|
|
573
|
+
-- we can modify the arguments table, but keep a frozen copy to compare for user-end changes.
|
|
574
|
+
thisWidget.providedArguments = arguments
|
|
575
|
+
thisWidget.arguments = Internal._deepCopy(arguments)
|
|
576
|
+
thisWidgetClass.Update(thisWidget)
|
|
577
|
+
|
|
578
|
+
local eventMTParent
|
|
579
|
+
if thisWidgetClass.hasState then
|
|
580
|
+
local stateWidget = thisWidget :: Types.StateWidget
|
|
581
|
+
if states then
|
|
582
|
+
for index, state in states do
|
|
583
|
+
if not (type(state) == "table" and getmetatable(state :: any) == Internal.StateClass) then
|
|
584
|
+
-- generate a new state.
|
|
585
|
+
states[index] = Internal._widgetState(stateWidget, index, state)
|
|
586
|
+
end
|
|
587
|
+
states[index].lastChangeTick = Internal._cycleTick
|
|
588
|
+
end
|
|
589
|
+
|
|
590
|
+
stateWidget.state = states
|
|
591
|
+
for _, state in states do
|
|
592
|
+
state.ConnectedWidgets[stateWidget.ID] = stateWidget
|
|
593
|
+
end
|
|
594
|
+
else
|
|
595
|
+
stateWidget.state = {}
|
|
596
|
+
end
|
|
597
|
+
|
|
598
|
+
thisWidgetClass.GenerateState(stateWidget)
|
|
599
|
+
thisWidgetClass.UpdateState(stateWidget)
|
|
600
|
+
|
|
601
|
+
-- the state MT can't be itself because state has to explicitly only contain stateClass objects
|
|
602
|
+
stateWidget.stateMT = {}
|
|
603
|
+
setmetatable(stateWidget.state, stateWidget.stateMT)
|
|
604
|
+
|
|
605
|
+
stateWidget.__index = stateWidget.state
|
|
606
|
+
eventMTParent = stateWidget.stateMT
|
|
607
|
+
else
|
|
608
|
+
eventMTParent = thisWidget
|
|
609
|
+
end
|
|
610
|
+
|
|
611
|
+
eventMTParent.__index = function(_, eventName)
|
|
612
|
+
return function()
|
|
613
|
+
return Internal._EventCall(thisWidget, eventName)
|
|
614
|
+
end
|
|
615
|
+
end
|
|
616
|
+
return thisWidget
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
--[=[
|
|
620
|
+
@within Internal
|
|
621
|
+
@function _ContinueWidget
|
|
622
|
+
@param ID ID -- id of the widget.
|
|
623
|
+
@param widgetType string
|
|
624
|
+
@return Widget -- the widget.
|
|
625
|
+
|
|
626
|
+
Since the widget has already been created this frame, we can just add it back to the stack. There is no checking of
|
|
627
|
+
arguments or states.
|
|
628
|
+
Basically equivalent to the end of `Internal._Insert`.
|
|
629
|
+
]=]
|
|
630
|
+
function Internal._ContinueWidget(ID: Types.ID, widgetType: string)
|
|
631
|
+
local thisWidgetClass = Internal._widgets[widgetType]
|
|
632
|
+
local thisWidget = Internal._VDOM[ID]
|
|
633
|
+
|
|
634
|
+
if thisWidgetClass.hasChildren then
|
|
635
|
+
-- a parent widget so we increase our depth.
|
|
636
|
+
Internal._stackIndex += 1
|
|
637
|
+
Internal._IDStack[Internal._stackIndex] = thisWidget.ID
|
|
638
|
+
end
|
|
639
|
+
|
|
640
|
+
Internal._lastWidget = thisWidget
|
|
641
|
+
return thisWidget
|
|
642
|
+
end
|
|
643
|
+
|
|
644
|
+
--[=[
|
|
645
|
+
@within Internal
|
|
646
|
+
@function _DiscardWidget
|
|
647
|
+
@param widgetToDiscard Widget
|
|
648
|
+
|
|
649
|
+
Destroys the widget instance and updates any parent. This happens if the widget was not called in the
|
|
650
|
+
previous frame. There is no code which needs to update any widget tables since they are already reset
|
|
651
|
+
at the start before discarding happens.
|
|
652
|
+
]=]
|
|
653
|
+
function Internal._DiscardWidget(widgetToDiscard: Types.Widget)
|
|
654
|
+
local widgetParent = widgetToDiscard.parentWidget
|
|
655
|
+
if widgetParent then
|
|
656
|
+
-- if the parent needs to update it's children.
|
|
657
|
+
Internal._widgets[widgetParent.type].ChildDiscarded(widgetParent, widgetToDiscard)
|
|
658
|
+
end
|
|
659
|
+
|
|
660
|
+
-- using the widget class discard function.
|
|
661
|
+
Internal._widgets[widgetToDiscard.type].Discard(widgetToDiscard)
|
|
662
|
+
|
|
663
|
+
-- mark as discarded
|
|
664
|
+
widgetToDiscard.lastCycleTick = -1
|
|
665
|
+
end
|
|
666
|
+
|
|
667
|
+
--[=[
|
|
668
|
+
@within Internal
|
|
669
|
+
@function _widgetState
|
|
670
|
+
@param thisWidget Widget -- widget the state belongs to.
|
|
671
|
+
@param stateName string
|
|
672
|
+
@param initialValue any
|
|
673
|
+
@return State<any> -- the state for the widget.
|
|
674
|
+
|
|
675
|
+
Connects the state to the widget. If no state exists then a new one is created. Called for every state in every
|
|
676
|
+
widget if the user does not provide a state.
|
|
677
|
+
]=]
|
|
678
|
+
function Internal._widgetState<T>(thisWidget: Types.StateWidget, stateName: string, initialValue: T)
|
|
679
|
+
local ID = thisWidget.ID .. stateName
|
|
680
|
+
if Internal._states[ID] then
|
|
681
|
+
Internal._states[ID].ConnectedWidgets[thisWidget.ID] = thisWidget
|
|
682
|
+
Internal._states[ID].lastChangeTick = Internal._cycleTick
|
|
683
|
+
return Internal._states[ID]
|
|
684
|
+
else
|
|
685
|
+
local newState = {
|
|
686
|
+
ID = ID,
|
|
687
|
+
value = initialValue,
|
|
688
|
+
lastChangeTick = Internal._cycleTick,
|
|
689
|
+
ConnectedWidgets = { [thisWidget.ID] = thisWidget },
|
|
690
|
+
ConnectedFunctions = {},
|
|
691
|
+
} :: Types.State<T>
|
|
692
|
+
setmetatable(newState, Internal.StateClass)
|
|
693
|
+
Internal._states[ID] = newState
|
|
694
|
+
return newState
|
|
695
|
+
end
|
|
696
|
+
end
|
|
697
|
+
|
|
698
|
+
--[=[
|
|
699
|
+
@within Internal
|
|
700
|
+
@function _EventCall
|
|
701
|
+
@param thisWidget Widget
|
|
702
|
+
@param evetName string
|
|
703
|
+
@return boolean -- the value of the event.
|
|
704
|
+
|
|
705
|
+
A wrapper for any event on any widget. Automatically, Iris does not initialize events unless they are explicitly
|
|
706
|
+
called so in the first frame, the event connections are set up. Every event is a function which returns a boolean.
|
|
707
|
+
]=]
|
|
708
|
+
function Internal._EventCall(thisWidget: Types.Widget, eventName: string)
|
|
709
|
+
local Events = Internal._widgets[thisWidget.type].Events
|
|
710
|
+
local Event = Events[eventName]
|
|
711
|
+
assert(Event ~= nil, `widget {thisWidget.type} has no event of name {eventName}`)
|
|
712
|
+
|
|
713
|
+
if thisWidget.trackedEvents[eventName] == nil then
|
|
714
|
+
Event.Init(thisWidget)
|
|
715
|
+
thisWidget.trackedEvents[eventName] = true
|
|
716
|
+
end
|
|
717
|
+
return Event.Get(thisWidget)
|
|
718
|
+
end
|
|
719
|
+
|
|
720
|
+
--[=[
|
|
721
|
+
@within Internal
|
|
722
|
+
@function _GetParentWidget
|
|
723
|
+
@return Widget -- the parent widget
|
|
724
|
+
|
|
725
|
+
Returns the parent widget of the currently active widget, based on the stack depth.
|
|
726
|
+
]=]
|
|
727
|
+
function Internal._GetParentWidget(): Types.ParentWidget
|
|
728
|
+
return Internal._VDOM[Internal._IDStack[Internal._stackIndex]]
|
|
729
|
+
end
|
|
730
|
+
|
|
731
|
+
-- Generate
|
|
732
|
+
|
|
733
|
+
--[=[
|
|
734
|
+
@ignore
|
|
735
|
+
@within Internal
|
|
736
|
+
@function _generateEmptyVDOM
|
|
737
|
+
@return { [ID]: Widget }
|
|
738
|
+
|
|
739
|
+
Creates the VDOM at the start of each frame containing just the root instance.
|
|
740
|
+
]=]
|
|
741
|
+
function Internal._generateEmptyVDOM()
|
|
742
|
+
return {
|
|
743
|
+
["R"] = Internal._rootWidget,
|
|
744
|
+
}
|
|
745
|
+
end
|
|
746
|
+
|
|
747
|
+
--[=[
|
|
748
|
+
@ignore
|
|
749
|
+
@within Internal
|
|
750
|
+
@function _generateRootInstance
|
|
751
|
+
|
|
752
|
+
Creates the root instance.
|
|
753
|
+
]=]
|
|
754
|
+
function Internal._generateRootInstance()
|
|
755
|
+
-- unsafe to call before Internal.connect
|
|
756
|
+
Internal._rootInstance = Internal._widgets["Root"].Generate(Internal._widgets["Root"])
|
|
757
|
+
Internal._rootInstance.Parent = Internal.parentInstance
|
|
758
|
+
Internal._rootWidget.Instance = Internal._rootInstance
|
|
759
|
+
end
|
|
760
|
+
|
|
761
|
+
--[=[
|
|
762
|
+
@ignore
|
|
763
|
+
@within Internal
|
|
764
|
+
@function _generateSelctionImageObject
|
|
765
|
+
|
|
766
|
+
Creates the selection object for buttons.
|
|
767
|
+
]=]
|
|
768
|
+
function Internal._generateSelectionImageObject()
|
|
769
|
+
if Internal.SelectionImageObject then
|
|
770
|
+
Internal.SelectionImageObject:Destroy()
|
|
771
|
+
end
|
|
772
|
+
|
|
773
|
+
local SelectionImageObject = Instance.new("Frame")
|
|
774
|
+
SelectionImageObject.Position = UDim2.fromOffset(-1, -1)
|
|
775
|
+
SelectionImageObject.Size = UDim2.new(1, 2, 1, 2)
|
|
776
|
+
SelectionImageObject.BackgroundColor3 = Internal._config.SelectionImageObjectColor
|
|
777
|
+
SelectionImageObject.BackgroundTransparency = Internal._config.SelectionImageObjectTransparency
|
|
778
|
+
SelectionImageObject.BorderSizePixel = 0
|
|
779
|
+
|
|
780
|
+
Internal._utility.UIStroke(SelectionImageObject, 1, Internal._config.SelectionImageObjectBorderColor, Internal._config.SelectionImageObjectBorderTransparency)
|
|
781
|
+
Internal._utility.UICorner(SelectionImageObject, 2)
|
|
782
|
+
|
|
783
|
+
Internal.SelectionImageObject = SelectionImageObject
|
|
784
|
+
end
|
|
785
|
+
|
|
786
|
+
-- Utility
|
|
787
|
+
|
|
788
|
+
--[=[
|
|
789
|
+
@within Internal
|
|
790
|
+
@function _getID
|
|
791
|
+
@param levelsToIgnore number -- used to skip over internal calls to `_getID`.
|
|
792
|
+
@return ID
|
|
793
|
+
|
|
794
|
+
Generates a unique ID for each widget which is based on the line that the widget is
|
|
795
|
+
created from. This ensures that the function is heuristic and always returns the same
|
|
796
|
+
id for the same widget.
|
|
797
|
+
]=]
|
|
798
|
+
function Internal._getID(levelsToIgnore: number)
|
|
799
|
+
if Internal._nextWidgetId then
|
|
800
|
+
local ID = Internal._nextWidgetId
|
|
801
|
+
Internal._nextWidgetId = nil
|
|
802
|
+
return ID
|
|
803
|
+
end
|
|
804
|
+
|
|
805
|
+
local i = 1 + (levelsToIgnore or 1)
|
|
806
|
+
local ID = ""
|
|
807
|
+
local levelInfo = debug.info(i, "l")
|
|
808
|
+
while levelInfo ~= -1 and levelInfo ~= nil do
|
|
809
|
+
ID ..= "+" .. levelInfo
|
|
810
|
+
i += 1
|
|
811
|
+
levelInfo = debug.info(i, "l")
|
|
812
|
+
end
|
|
813
|
+
|
|
814
|
+
local discriminator = Internal._usedIDs[ID]
|
|
815
|
+
if discriminator then
|
|
816
|
+
Internal._usedIDs[ID] += 1
|
|
817
|
+
discriminator += 1
|
|
818
|
+
else
|
|
819
|
+
Internal._usedIDs[ID] = 1
|
|
820
|
+
discriminator = 1
|
|
821
|
+
end
|
|
822
|
+
|
|
823
|
+
if #Internal._pushedIds == 0 then
|
|
824
|
+
return ID .. ":" .. discriminator
|
|
825
|
+
elseif Internal._newID then
|
|
826
|
+
Internal._newID = false
|
|
827
|
+
return ID .. "::" .. table.concat(Internal._pushedIds, "\\")
|
|
828
|
+
else
|
|
829
|
+
return ID .. ":" .. discriminator .. ":" .. table.concat(Internal._pushedIds, "\\")
|
|
830
|
+
end
|
|
831
|
+
end
|
|
832
|
+
|
|
833
|
+
--[=[
|
|
834
|
+
@ignore
|
|
835
|
+
@within Internal
|
|
836
|
+
@function _deepCompare
|
|
837
|
+
@param t1 {}
|
|
838
|
+
@param t2 {}
|
|
839
|
+
@return boolean
|
|
840
|
+
|
|
841
|
+
Compares two tables to check if they are the same. It uses a recursive iteration through one table
|
|
842
|
+
to compare against the other. Used to determine if the arguments of a widget have changed since last
|
|
843
|
+
frame.
|
|
844
|
+
]=]
|
|
845
|
+
function Internal._deepCompare(t1: {}, t2: {})
|
|
846
|
+
-- unoptimized ?
|
|
847
|
+
for i, v1 in t1 do
|
|
848
|
+
local v2 = t2[i]
|
|
849
|
+
if type(v1) == "table" then
|
|
850
|
+
if v2 and type(v2) == "table" then
|
|
851
|
+
if Internal._deepCompare(v1, v2) == false then
|
|
852
|
+
return false
|
|
853
|
+
end
|
|
854
|
+
else
|
|
855
|
+
return false
|
|
856
|
+
end
|
|
857
|
+
else
|
|
858
|
+
if type(v1) ~= type(v2) or v1 ~= v2 then
|
|
859
|
+
return false
|
|
860
|
+
end
|
|
861
|
+
end
|
|
862
|
+
end
|
|
863
|
+
|
|
864
|
+
return true
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
--[=[
|
|
868
|
+
@ignore
|
|
869
|
+
@within Internal
|
|
870
|
+
@function _deepCopy
|
|
871
|
+
@param t {}
|
|
872
|
+
@return {}
|
|
873
|
+
|
|
874
|
+
Performs a deep copy of a table so that neither table contains a shared reference.
|
|
875
|
+
]=]
|
|
876
|
+
function Internal._deepCopy(t: {}): {}
|
|
877
|
+
local copy: {} = table.clone(t)
|
|
878
|
+
|
|
879
|
+
for k, v in t do
|
|
880
|
+
if type(v) == "table" then
|
|
881
|
+
copy[k] = Internal._deepCopy(v)
|
|
882
|
+
end
|
|
883
|
+
end
|
|
884
|
+
|
|
885
|
+
return copy
|
|
886
|
+
end
|
|
887
|
+
|
|
888
|
+
-- VDOM
|
|
889
|
+
Internal._lastVDOM = Internal._generateEmptyVDOM()
|
|
890
|
+
Internal._VDOM = Internal._generateEmptyVDOM()
|
|
891
|
+
|
|
892
|
+
Iris.Internal = Internal
|
|
893
|
+
Iris._config = Internal._config
|
|
894
|
+
return Internal
|
|
895
|
+
end
|