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,1232 @@
|
|
|
1
|
+
local Types = require(script.Parent.Parent.Types)
|
|
2
|
+
|
|
3
|
+
type InputDataTypes = "Num" | "Vector2" | "Vector3" | "UDim" | "UDim2" | "Color3" | "Color4" | "Rect" | "Enum" | "" | string
|
|
4
|
+
type InputType = "Input" | "Drag" | "Slider"
|
|
5
|
+
|
|
6
|
+
return function(Iris: Types.Internal, widgets: Types.WidgetUtility)
|
|
7
|
+
local numberChanged = {
|
|
8
|
+
["Init"] = function(_thisWidget: Types.Widget) end,
|
|
9
|
+
["Get"] = function(thisWidget: Types.Input<any>)
|
|
10
|
+
return thisWidget.lastNumberChangedTick == Iris._cycleTick
|
|
11
|
+
end,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
local function getValueByIndex<T>(value: T, index: number, arguments: Types.Arguments)
|
|
15
|
+
local val = value :: unknown
|
|
16
|
+
if typeof(val) == "number" then
|
|
17
|
+
return val
|
|
18
|
+
elseif typeof(val) == "Vector2" then
|
|
19
|
+
if index == 1 then
|
|
20
|
+
return val.X
|
|
21
|
+
elseif index == 2 then
|
|
22
|
+
return val.Y
|
|
23
|
+
end
|
|
24
|
+
elseif typeof(val) == "Vector3" then
|
|
25
|
+
if index == 1 then
|
|
26
|
+
return val.X
|
|
27
|
+
elseif index == 2 then
|
|
28
|
+
return val.Y
|
|
29
|
+
elseif index == 3 then
|
|
30
|
+
return val.Z
|
|
31
|
+
end
|
|
32
|
+
elseif typeof(val) == "UDim" then
|
|
33
|
+
if index == 1 then
|
|
34
|
+
return val.Scale
|
|
35
|
+
elseif index == 2 then
|
|
36
|
+
return val.Offset
|
|
37
|
+
end
|
|
38
|
+
elseif typeof(val) == "UDim2" then
|
|
39
|
+
if index == 1 then
|
|
40
|
+
return val.X.Scale
|
|
41
|
+
elseif index == 2 then
|
|
42
|
+
return val.X.Offset
|
|
43
|
+
elseif index == 3 then
|
|
44
|
+
return val.Y.Scale
|
|
45
|
+
elseif index == 4 then
|
|
46
|
+
return val.Y.Offset
|
|
47
|
+
end
|
|
48
|
+
elseif typeof(val) == "Color3" then
|
|
49
|
+
local color = if arguments.UseHSV then { val:ToHSV() } else { val.R, val.G, val.B }
|
|
50
|
+
if index == 1 then
|
|
51
|
+
return color[1]
|
|
52
|
+
elseif index == 2 then
|
|
53
|
+
return color[2]
|
|
54
|
+
elseif index == 3 then
|
|
55
|
+
return color[3]
|
|
56
|
+
end
|
|
57
|
+
elseif typeof(val) == "Rect" then
|
|
58
|
+
if index == 1 then
|
|
59
|
+
return val.Min.X
|
|
60
|
+
elseif index == 2 then
|
|
61
|
+
return val.Min.Y
|
|
62
|
+
elseif index == 3 then
|
|
63
|
+
return val.Max.X
|
|
64
|
+
elseif index == 4 then
|
|
65
|
+
return val.Max.Y
|
|
66
|
+
end
|
|
67
|
+
elseif typeof(val) == "table" then
|
|
68
|
+
return val[index]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
error(`Incorrect datatype or value: {value} {typeof(value)} {index}.`)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
local function updateValueByIndex<T>(value: T, index: number, newValue: number, arguments: Types.Arguments): T
|
|
75
|
+
local val = value :: unknown
|
|
76
|
+
if typeof(val) == "number" then
|
|
77
|
+
return newValue :: any
|
|
78
|
+
elseif typeof(val) == "Vector2" then
|
|
79
|
+
if index == 1 then
|
|
80
|
+
return Vector2.new(newValue, val.Y) :: any
|
|
81
|
+
elseif index == 2 then
|
|
82
|
+
return Vector2.new(val.X, newValue) :: any
|
|
83
|
+
end
|
|
84
|
+
elseif typeof(val) == "Vector3" then
|
|
85
|
+
if index == 1 then
|
|
86
|
+
return Vector3.new(newValue, val.Y, val.Z) :: any
|
|
87
|
+
elseif index == 2 then
|
|
88
|
+
return Vector3.new(val.X, newValue, val.Z) :: any
|
|
89
|
+
elseif index == 3 then
|
|
90
|
+
return Vector3.new(val.X, val.Y, newValue) :: any
|
|
91
|
+
end
|
|
92
|
+
elseif typeof(val) == "UDim" then
|
|
93
|
+
if index == 1 then
|
|
94
|
+
return UDim.new(newValue, val.Offset) :: any
|
|
95
|
+
elseif index == 2 then
|
|
96
|
+
return UDim.new(val.Scale, newValue) :: any
|
|
97
|
+
end
|
|
98
|
+
elseif typeof(val) == "UDim2" then
|
|
99
|
+
if index == 1 then
|
|
100
|
+
return UDim2.new(UDim.new(newValue, val.X.Offset), val.Y) :: any
|
|
101
|
+
elseif index == 2 then
|
|
102
|
+
return UDim2.new(UDim.new(val.X.Scale, newValue), val.Y) :: any
|
|
103
|
+
elseif index == 3 then
|
|
104
|
+
return UDim2.new(val.X, UDim.new(newValue, val.Y.Offset)) :: any
|
|
105
|
+
elseif index == 4 then
|
|
106
|
+
return UDim2.new(val.X, UDim.new(val.Y.Scale, newValue)) :: any
|
|
107
|
+
end
|
|
108
|
+
elseif typeof(val) == "Rect" then
|
|
109
|
+
if index == 1 then
|
|
110
|
+
return Rect.new(Vector2.new(newValue, val.Min.Y), val.Max) :: any
|
|
111
|
+
elseif index == 2 then
|
|
112
|
+
return Rect.new(Vector2.new(val.Min.X, newValue), val.Max) :: any
|
|
113
|
+
elseif index == 3 then
|
|
114
|
+
return Rect.new(val.Min, Vector2.new(newValue, val.Max.Y)) :: any
|
|
115
|
+
elseif index == 4 then
|
|
116
|
+
return Rect.new(val.Min, Vector2.new(val.Max.X, newValue)) :: any
|
|
117
|
+
end
|
|
118
|
+
elseif typeof(val) == "Color3" then
|
|
119
|
+
if arguments.UseHSV then
|
|
120
|
+
local h: number, s: number, v: number = val:ToHSV()
|
|
121
|
+
if index == 1 then
|
|
122
|
+
return Color3.fromHSV(newValue, s, v) :: any
|
|
123
|
+
elseif index == 2 then
|
|
124
|
+
return Color3.fromHSV(h, newValue, v) :: any
|
|
125
|
+
elseif index == 3 then
|
|
126
|
+
return Color3.fromHSV(h, s, newValue) :: any
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
if index == 1 then
|
|
130
|
+
return Color3.new(newValue, val.G, val.B) :: any
|
|
131
|
+
elseif index == 2 then
|
|
132
|
+
return Color3.new(val.R, newValue, val.B) :: any
|
|
133
|
+
elseif index == 3 then
|
|
134
|
+
return Color3.new(val.R, val.G, newValue) :: any
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
error(`Incorrect datatype or value {value} {typeof(value)} {index}.`)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
local defaultIncrements: { [InputDataTypes]: { number } } = {
|
|
142
|
+
Num = { 1 },
|
|
143
|
+
Vector2 = { 1, 1 },
|
|
144
|
+
Vector3 = { 1, 1, 1 },
|
|
145
|
+
UDim = { 0.01, 1 },
|
|
146
|
+
UDim2 = { 0.01, 1, 0.01, 1 },
|
|
147
|
+
Color3 = { 1, 1, 1 },
|
|
148
|
+
Color4 = { 1, 1, 1, 1 },
|
|
149
|
+
Rect = { 1, 1, 1, 1 },
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
local defaultMin: { [InputDataTypes]: { number } } = {
|
|
153
|
+
Num = { 0 },
|
|
154
|
+
Vector2 = { 0, 0 },
|
|
155
|
+
Vector3 = { 0, 0, 0 },
|
|
156
|
+
UDim = { 0, 0 },
|
|
157
|
+
UDim2 = { 0, 0, 0, 0 },
|
|
158
|
+
Rect = { 0, 0, 0, 0 },
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
local defaultMax: { [InputDataTypes]: { number } } = {
|
|
162
|
+
Num = { 100 },
|
|
163
|
+
Vector2 = { 100, 100 },
|
|
164
|
+
Vector3 = { 100, 100, 100 },
|
|
165
|
+
UDim = { 1, 960 },
|
|
166
|
+
UDim2 = { 1, 960, 1, 960 },
|
|
167
|
+
Rect = { 960, 960, 960, 960 },
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
local defaultPrefx: { [InputDataTypes]: { string } } = {
|
|
171
|
+
Num = { "" },
|
|
172
|
+
Vector2 = { "X: ", "Y: " },
|
|
173
|
+
Vector3 = { "X: ", "Y: ", "Z: " },
|
|
174
|
+
UDim = { "", "" },
|
|
175
|
+
UDim2 = { "", "", "", "" },
|
|
176
|
+
Color3_RGB = { "R: ", "G: ", "B: " },
|
|
177
|
+
Color3_HSV = { "H: ", "S: ", "V: " },
|
|
178
|
+
Color4_RGB = { "R: ", "G: ", "B: ", "T: " },
|
|
179
|
+
Color4_HSV = { "H: ", "S: ", "V: ", "T: " },
|
|
180
|
+
Rect = { "X: ", "Y: ", "X: ", "Y: " },
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
local defaultSigFigs: { [InputDataTypes]: { number } } = {
|
|
184
|
+
Num = { 0 },
|
|
185
|
+
Vector2 = { 0, 0 },
|
|
186
|
+
Vector3 = { 0, 0, 0 },
|
|
187
|
+
UDim = { 3, 0 },
|
|
188
|
+
UDim2 = { 3, 0, 3, 0 },
|
|
189
|
+
Color3 = { 0, 0, 0 },
|
|
190
|
+
Color4 = { 0, 0, 0, 0 },
|
|
191
|
+
Rect = { 0, 0, 0, 0 },
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
local function generateAbstract<T>(inputType: InputType, dataType: InputDataTypes, components: number, defaultValue: T): Types.WidgetClass
|
|
195
|
+
return {
|
|
196
|
+
hasState = true,
|
|
197
|
+
hasChildren = false,
|
|
198
|
+
Args = {
|
|
199
|
+
["Text"] = 1,
|
|
200
|
+
["Increment"] = 2,
|
|
201
|
+
["Min"] = 3,
|
|
202
|
+
["Max"] = 4,
|
|
203
|
+
["Format"] = 5,
|
|
204
|
+
},
|
|
205
|
+
Events = {
|
|
206
|
+
["numberChanged"] = numberChanged,
|
|
207
|
+
["hovered"] = widgets.EVENTS.hover(function(thisWidget: Types.Widget)
|
|
208
|
+
return thisWidget.Instance
|
|
209
|
+
end),
|
|
210
|
+
},
|
|
211
|
+
GenerateState = function(thisWidget: Types.Input<T>)
|
|
212
|
+
if thisWidget.state.number == nil then
|
|
213
|
+
thisWidget.state.number = Iris._widgetState(thisWidget, "number", defaultValue)
|
|
214
|
+
end
|
|
215
|
+
if thisWidget.state.editingText == nil then
|
|
216
|
+
thisWidget.state.editingText = Iris._widgetState(thisWidget, "editingText", 0)
|
|
217
|
+
end
|
|
218
|
+
end,
|
|
219
|
+
Update = function(thisWidget: Types.Input<T>)
|
|
220
|
+
local Input = thisWidget.Instance :: GuiObject
|
|
221
|
+
local TextLabel: TextLabel = Input.TextLabel
|
|
222
|
+
TextLabel.Text = thisWidget.arguments.Text or `Input {dataType}`
|
|
223
|
+
|
|
224
|
+
if thisWidget.arguments.Format and typeof(thisWidget.arguments.Format) ~= "table" then
|
|
225
|
+
thisWidget.arguments.Format = { thisWidget.arguments.Format }
|
|
226
|
+
elseif not thisWidget.arguments.Format then
|
|
227
|
+
-- we calculate the format for the s.f. using the max, min and increment arguments.
|
|
228
|
+
local format = {}
|
|
229
|
+
for index = 1, components do
|
|
230
|
+
local sigfigs = defaultSigFigs[dataType][index]
|
|
231
|
+
|
|
232
|
+
if thisWidget.arguments.Increment then
|
|
233
|
+
local value = getValueByIndex(thisWidget.arguments.Increment, index, thisWidget.arguments :: any)
|
|
234
|
+
sigfigs = math.max(sigfigs, math.ceil(-math.log10(value == 0 and 1 or value)), sigfigs)
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if thisWidget.arguments.Max then
|
|
238
|
+
local value = getValueByIndex(thisWidget.arguments.Max, index, thisWidget.arguments :: any)
|
|
239
|
+
sigfigs = math.max(sigfigs, math.ceil(-math.log10(value == 0 and 1 or value)), sigfigs)
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if thisWidget.arguments.Min then
|
|
243
|
+
local value = getValueByIndex(thisWidget.arguments.Min, index, thisWidget.arguments :: any)
|
|
244
|
+
sigfigs = math.max(sigfigs, math.ceil(-math.log10(value == 0 and 1 or value)), sigfigs)
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
if sigfigs > 0 then
|
|
248
|
+
-- we know it's a float.
|
|
249
|
+
format[index] = `%.{sigfigs}f`
|
|
250
|
+
else
|
|
251
|
+
format[index] = "%d"
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
thisWidget.arguments.Format = format
|
|
256
|
+
thisWidget.arguments.Prefix = defaultPrefx[dataType]
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
if inputType == "Input" and dataType == "Num" then
|
|
260
|
+
Input.SubButton.Visible = not thisWidget.arguments.NoButtons
|
|
261
|
+
Input.AddButton.Visible = not thisWidget.arguments.NoButtons
|
|
262
|
+
local InputField: TextBox = Input.InputField1
|
|
263
|
+
local rightPadding = if thisWidget.arguments.NoButtons then 0 else (2 * Iris._config.ItemInnerSpacing.X) + (2 * (Iris._config.TextSize + 2 * Iris._config.FramePadding.Y))
|
|
264
|
+
InputField.Size = UDim2.new(UDim.new(Iris._config.ContentWidth.Scale, Iris._config.ContentWidth.Offset - rightPadding), Iris._config.ContentHeight)
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
if inputType == "Slider" then
|
|
268
|
+
for index = 1, components do
|
|
269
|
+
local SliderField = Input:FindFirstChild("SliderField" .. tostring(index)) :: TextButton
|
|
270
|
+
local GrabBar: Frame = SliderField.GrabBar
|
|
271
|
+
|
|
272
|
+
local increment = thisWidget.arguments.Increment and getValueByIndex(thisWidget.arguments.Increment, index, thisWidget.arguments :: any) or defaultIncrements[dataType][index]
|
|
273
|
+
local min = thisWidget.arguments.Min and getValueByIndex(thisWidget.arguments.Min, index, thisWidget.arguments :: any) or defaultMin[dataType][index]
|
|
274
|
+
local max = thisWidget.arguments.Max and getValueByIndex(thisWidget.arguments.Max, index, thisWidget.arguments :: any) or defaultMax[dataType][index]
|
|
275
|
+
|
|
276
|
+
local grabScaleSize = 1 / math.floor((1 + max - min) / increment)
|
|
277
|
+
|
|
278
|
+
GrabBar.Size = UDim2.fromScale(grabScaleSize, 1)
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
local callbackIndex = #Iris._postCycleCallbacks + 1
|
|
282
|
+
local desiredCycleTick = Iris._cycleTick + 1
|
|
283
|
+
Iris._postCycleCallbacks[callbackIndex] = function()
|
|
284
|
+
if Iris._cycleTick >= desiredCycleTick then
|
|
285
|
+
if thisWidget.lastCycleTick ~= -1 then
|
|
286
|
+
thisWidget.state.number.lastChangeTick = Iris._cycleTick
|
|
287
|
+
Iris._widgets[`Slider{dataType}`].UpdateState(thisWidget)
|
|
288
|
+
end
|
|
289
|
+
Iris._postCycleCallbacks[callbackIndex] = nil
|
|
290
|
+
end
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
end,
|
|
294
|
+
Discard = function(thisWidget: Types.Input<T>)
|
|
295
|
+
thisWidget.Instance:Destroy()
|
|
296
|
+
widgets.discardState(thisWidget)
|
|
297
|
+
end,
|
|
298
|
+
} :: Types.WidgetClass
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
local function focusLost<T>(thisWidget: Types.Input<T>, InputField: TextBox, index: number, dataType: InputDataTypes)
|
|
302
|
+
local newValue = tonumber(InputField.Text:match("-?%d*%.?%d*"))
|
|
303
|
+
local state = thisWidget.state.number
|
|
304
|
+
local widget = thisWidget
|
|
305
|
+
if dataType == "Color4" and index == 4 then
|
|
306
|
+
state = widget.state.transparency
|
|
307
|
+
elseif dataType == "Color3" or dataType == "Color4" then
|
|
308
|
+
state = widget.state.color
|
|
309
|
+
end
|
|
310
|
+
if newValue ~= nil then
|
|
311
|
+
if dataType == "Color3" or dataType == "Color4" and not widget.arguments.UseFloats then
|
|
312
|
+
newValue = newValue / 255
|
|
313
|
+
end
|
|
314
|
+
if thisWidget.arguments.Min ~= nil then
|
|
315
|
+
newValue = math.max(newValue, getValueByIndex(thisWidget.arguments.Min, index, thisWidget.arguments :: any))
|
|
316
|
+
end
|
|
317
|
+
if thisWidget.arguments.Max ~= nil then
|
|
318
|
+
newValue = math.min(newValue, getValueByIndex(thisWidget.arguments.Max, index, thisWidget.arguments :: any))
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
if thisWidget.arguments.Increment then
|
|
322
|
+
newValue = math.round(newValue / getValueByIndex(thisWidget.arguments.Increment, index, thisWidget.arguments :: any)) * getValueByIndex(thisWidget.arguments.Increment, index, thisWidget.arguments :: any)
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
state:set(updateValueByIndex(state.value, index, newValue, thisWidget.arguments :: any))
|
|
326
|
+
thisWidget.lastNumberChangedTick = Iris._cycleTick + 1
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
local value = getValueByIndex(state.value, index, thisWidget.arguments :: any)
|
|
330
|
+
if dataType == "Color3" or dataType == "Color4" and not widget.arguments.UseFloats then
|
|
331
|
+
value = math.round(value * 255)
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
local format = thisWidget.arguments.Format[index] or thisWidget.arguments.Format[1]
|
|
335
|
+
if thisWidget.arguments.Prefix then
|
|
336
|
+
format = thisWidget.arguments.Prefix[index] .. format
|
|
337
|
+
end
|
|
338
|
+
InputField.Text = string.format(format, value)
|
|
339
|
+
|
|
340
|
+
thisWidget.state.editingText:set(0)
|
|
341
|
+
InputField:ReleaseFocus(true)
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
--[[
|
|
345
|
+
Input
|
|
346
|
+
]]
|
|
347
|
+
local generateInputScalar: <T>(dataType: InputDataTypes, components: number, defaultValue: T) -> Types.WidgetClass
|
|
348
|
+
do
|
|
349
|
+
local function generateButtons(thisWidget: Types.Input<number>, parent: GuiObject, textHeight: number)
|
|
350
|
+
local SubButton = widgets.abstractButton.Generate(thisWidget) :: TextButton
|
|
351
|
+
SubButton.Name = "SubButton"
|
|
352
|
+
SubButton.Size = UDim2.fromOffset(Iris._config.TextSize + 2 * Iris._config.FramePadding.Y, Iris._config.TextSize)
|
|
353
|
+
SubButton.Text = "-"
|
|
354
|
+
SubButton.TextXAlignment = Enum.TextXAlignment.Center
|
|
355
|
+
SubButton.ZIndex = 5
|
|
356
|
+
SubButton.LayoutOrder = 5
|
|
357
|
+
SubButton.Parent = parent
|
|
358
|
+
|
|
359
|
+
widgets.applyButtonClick(SubButton, function()
|
|
360
|
+
local isCtrlHeld = widgets.UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or widgets.UserInputService:IsKeyDown(Enum.KeyCode.RightControl)
|
|
361
|
+
local changeValue = (thisWidget.arguments.Increment and getValueByIndex(thisWidget.arguments.Increment, 1, thisWidget.arguments :: Types.Argument) or 1) * (isCtrlHeld and 100 or 1)
|
|
362
|
+
local newValue = thisWidget.state.number.value - changeValue
|
|
363
|
+
if thisWidget.arguments.Min ~= nil then
|
|
364
|
+
newValue = math.max(newValue, getValueByIndex(thisWidget.arguments.Min, 1, thisWidget.arguments :: Types.Argument))
|
|
365
|
+
end
|
|
366
|
+
if thisWidget.arguments.Max ~= nil then
|
|
367
|
+
newValue = math.min(newValue, getValueByIndex(thisWidget.arguments.Max, 1, thisWidget.arguments :: Types.Argument))
|
|
368
|
+
end
|
|
369
|
+
thisWidget.state.number:set(newValue)
|
|
370
|
+
thisWidget.lastNumberChangedTick = Iris._cycleTick + 1
|
|
371
|
+
end)
|
|
372
|
+
|
|
373
|
+
local AddButton = widgets.abstractButton.Generate(thisWidget) :: TextButton
|
|
374
|
+
AddButton.Name = "AddButton"
|
|
375
|
+
AddButton.Size = UDim2.fromOffset(Iris._config.TextSize + 2 * Iris._config.FramePadding.Y, Iris._config.TextSize)
|
|
376
|
+
AddButton.Text = "+"
|
|
377
|
+
AddButton.TextXAlignment = Enum.TextXAlignment.Center
|
|
378
|
+
AddButton.ZIndex = 6
|
|
379
|
+
AddButton.LayoutOrder = 6
|
|
380
|
+
AddButton.Parent = parent
|
|
381
|
+
|
|
382
|
+
widgets.applyButtonClick(AddButton, function()
|
|
383
|
+
local isCtrlHeld = widgets.UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or widgets.UserInputService:IsKeyDown(Enum.KeyCode.RightControl)
|
|
384
|
+
local changeValue = (thisWidget.arguments.Increment and getValueByIndex(thisWidget.arguments.Increment, 1, thisWidget.arguments :: Types.Argument) or 1) * (isCtrlHeld and 100 or 1)
|
|
385
|
+
local newValue = thisWidget.state.number.value + changeValue
|
|
386
|
+
if thisWidget.arguments.Min ~= nil then
|
|
387
|
+
newValue = math.max(newValue, getValueByIndex(thisWidget.arguments.Min, 1, thisWidget.arguments :: Types.Argument))
|
|
388
|
+
end
|
|
389
|
+
if thisWidget.arguments.Max ~= nil then
|
|
390
|
+
newValue = math.min(newValue, getValueByIndex(thisWidget.arguments.Max, 1, thisWidget.arguments :: Types.Argument))
|
|
391
|
+
end
|
|
392
|
+
thisWidget.state.number:set(newValue)
|
|
393
|
+
thisWidget.lastNumberChangedTick = Iris._cycleTick + 1
|
|
394
|
+
end)
|
|
395
|
+
|
|
396
|
+
return 2 * Iris._config.ItemInnerSpacing.X + 2 * textHeight
|
|
397
|
+
end
|
|
398
|
+
|
|
399
|
+
local function generateField<T>(thisWidget: Types.Input<T>, index: number, componentWidth: UDim, dataType: InputDataTypes)
|
|
400
|
+
local InputField = Instance.new("TextBox")
|
|
401
|
+
InputField.Name = "InputField" .. tostring(index)
|
|
402
|
+
InputField.AutomaticSize = Enum.AutomaticSize.Y
|
|
403
|
+
InputField.Size = UDim2.new(componentWidth, Iris._config.ContentHeight)
|
|
404
|
+
InputField.BackgroundColor3 = Iris._config.FrameBgColor
|
|
405
|
+
InputField.BackgroundTransparency = Iris._config.FrameBgTransparency
|
|
406
|
+
InputField.TextTruncate = Enum.TextTruncate.AtEnd
|
|
407
|
+
InputField.ClearTextOnFocus = false
|
|
408
|
+
InputField.ZIndex = index
|
|
409
|
+
InputField.LayoutOrder = index
|
|
410
|
+
InputField.ClipsDescendants = true
|
|
411
|
+
|
|
412
|
+
widgets.applyFrameStyle(InputField)
|
|
413
|
+
widgets.applyTextStyle(InputField)
|
|
414
|
+
widgets.UISizeConstraint(InputField, Vector2.xAxis)
|
|
415
|
+
|
|
416
|
+
InputField.FocusLost:Connect(function()
|
|
417
|
+
focusLost(thisWidget, InputField, index, dataType)
|
|
418
|
+
end)
|
|
419
|
+
|
|
420
|
+
InputField.Focused:Connect(function()
|
|
421
|
+
-- this highlights the entire field
|
|
422
|
+
InputField.CursorPosition = #InputField.Text + 1
|
|
423
|
+
InputField.SelectionStart = 1
|
|
424
|
+
|
|
425
|
+
thisWidget.state.editingText:set(index)
|
|
426
|
+
end)
|
|
427
|
+
|
|
428
|
+
return InputField
|
|
429
|
+
end
|
|
430
|
+
|
|
431
|
+
function generateInputScalar<T>(dataType: InputDataTypes, components: number, defaultValue: T)
|
|
432
|
+
local input = generateAbstract("Input", dataType, components, defaultValue)
|
|
433
|
+
|
|
434
|
+
return widgets.extend(input, {
|
|
435
|
+
Generate = function(thisWidget: Types.Input<T>)
|
|
436
|
+
local Input = Instance.new("Frame")
|
|
437
|
+
Input.Name = "Iris_Input" .. dataType
|
|
438
|
+
Input.AutomaticSize = Enum.AutomaticSize.Y
|
|
439
|
+
Input.Size = UDim2.new(Iris._config.ItemWidth, UDim.new())
|
|
440
|
+
Input.BackgroundTransparency = 1
|
|
441
|
+
Input.BorderSizePixel = 0
|
|
442
|
+
|
|
443
|
+
widgets.UIListLayout(Input, Enum.FillDirection.Horizontal, UDim.new(0, Iris._config.ItemInnerSpacing.X)).VerticalAlignment = Enum.VerticalAlignment.Center
|
|
444
|
+
|
|
445
|
+
-- we add plus and minus buttons if there is only one box. This can be disabled through the argument.
|
|
446
|
+
local rightPadding = 0
|
|
447
|
+
local textHeight = Iris._config.TextSize + 2 * Iris._config.FramePadding.Y
|
|
448
|
+
|
|
449
|
+
if components == 1 then
|
|
450
|
+
rightPadding = generateButtons(thisWidget :: any, Input, textHeight)
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
-- we divide the total area evenly between each field. This includes accounting for any additional boxes and the offset.
|
|
454
|
+
-- for the final field, we make sure it's flush by calculating the space avaiable for it. This only makes the Vector2 box
|
|
455
|
+
-- 4 pixels shorter, all for the sake of flush.
|
|
456
|
+
local componentWidth = UDim.new(Iris._config.ContentWidth.Scale / components, (Iris._config.ContentWidth.Offset - (Iris._config.ItemInnerSpacing.X * (components - 1)) - rightPadding) / components)
|
|
457
|
+
local totalWidth = UDim.new(componentWidth.Scale * (components - 1), (componentWidth.Offset * (components - 1)) + (Iris._config.ItemInnerSpacing.X * (components - 1)) + rightPadding)
|
|
458
|
+
local lastComponentWidth = Iris._config.ContentWidth - totalWidth
|
|
459
|
+
|
|
460
|
+
-- we handle each component individually since they don't need to interact with each other.
|
|
461
|
+
for index = 1, components do
|
|
462
|
+
generateField(thisWidget, index, if index == components then lastComponentWidth else componentWidth, dataType).Parent = Input
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
local TextLabel = Instance.new("TextLabel")
|
|
466
|
+
TextLabel.Name = "TextLabel"
|
|
467
|
+
TextLabel.AutomaticSize = Enum.AutomaticSize.XY
|
|
468
|
+
TextLabel.BackgroundTransparency = 1
|
|
469
|
+
TextLabel.BorderSizePixel = 0
|
|
470
|
+
TextLabel.LayoutOrder = 7
|
|
471
|
+
|
|
472
|
+
widgets.applyTextStyle(TextLabel)
|
|
473
|
+
|
|
474
|
+
TextLabel.Parent = Input
|
|
475
|
+
|
|
476
|
+
return Input
|
|
477
|
+
end,
|
|
478
|
+
UpdateState = function(thisWidget: Types.Input<T>)
|
|
479
|
+
local Input = thisWidget.Instance :: GuiObject
|
|
480
|
+
|
|
481
|
+
for index = 1, components do
|
|
482
|
+
local InputField: TextBox = Input:FindFirstChild("InputField" .. tostring(index))
|
|
483
|
+
local format = thisWidget.arguments.Format[index] or thisWidget.arguments.Format[1]
|
|
484
|
+
if thisWidget.arguments.Prefix then
|
|
485
|
+
format = thisWidget.arguments.Prefix[index] .. format
|
|
486
|
+
end
|
|
487
|
+
InputField.Text = string.format(format, getValueByIndex(thisWidget.state.number.value, index, thisWidget.arguments :: any))
|
|
488
|
+
end
|
|
489
|
+
end,
|
|
490
|
+
})
|
|
491
|
+
end
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
--[[
|
|
495
|
+
Drag
|
|
496
|
+
]]
|
|
497
|
+
local generateDragScalar: <T>(dataType: InputDataTypes, components: number, defaultValue: T) -> Types.WidgetClass
|
|
498
|
+
local generateColorDragScalar: (dataType: InputDataTypes, ...any) -> Types.WidgetClass
|
|
499
|
+
do
|
|
500
|
+
local PreviouseMouseXPosition = 0
|
|
501
|
+
local AnyActiveDrag = false
|
|
502
|
+
local ActiveDrag: Types.Input<Types.InputDataType>? = nil
|
|
503
|
+
local ActiveIndex = 0
|
|
504
|
+
local ActiveDataType: InputDataTypes | "" = ""
|
|
505
|
+
|
|
506
|
+
local function updateActiveDrag()
|
|
507
|
+
local currentMouseX = widgets.getMouseLocation().X
|
|
508
|
+
local mouseXDelta = currentMouseX - PreviouseMouseXPosition
|
|
509
|
+
PreviouseMouseXPosition = currentMouseX
|
|
510
|
+
if AnyActiveDrag == false then
|
|
511
|
+
return
|
|
512
|
+
end
|
|
513
|
+
if ActiveDrag == nil then
|
|
514
|
+
return
|
|
515
|
+
end
|
|
516
|
+
|
|
517
|
+
local state = ActiveDrag.state.number
|
|
518
|
+
if ActiveDataType == "Color3" or ActiveDataType == "Color4" then
|
|
519
|
+
local Drag = ActiveDrag
|
|
520
|
+
state = Drag.state.color
|
|
521
|
+
if ActiveIndex == 4 then
|
|
522
|
+
state = Drag.state.transparency
|
|
523
|
+
end
|
|
524
|
+
end
|
|
525
|
+
|
|
526
|
+
local increment = ActiveDrag.arguments.Increment and getValueByIndex(ActiveDrag.arguments.Increment, ActiveIndex, ActiveDrag.arguments :: any) or defaultIncrements[ActiveDataType][ActiveIndex]
|
|
527
|
+
increment *= (widgets.UserInputService:IsKeyDown(Enum.KeyCode.LeftShift) or widgets.UserInputService:IsKeyDown(Enum.KeyCode.RightShift)) and 10 or 1
|
|
528
|
+
increment *= (widgets.UserInputService:IsKeyDown(Enum.KeyCode.LeftAlt) or widgets.UserInputService:IsKeyDown(Enum.KeyCode.RightAlt)) and 0.1 or 1
|
|
529
|
+
-- we increase the speed for Color3 and Color4 since it's too slow because the increment argument needs to be low.
|
|
530
|
+
increment *= (ActiveDataType == "Color3" or ActiveDataType == "Color4") and 5 or 1
|
|
531
|
+
|
|
532
|
+
local value = getValueByIndex(state.value, ActiveIndex, ActiveDrag.arguments :: any)
|
|
533
|
+
local newValue = value + (mouseXDelta * increment)
|
|
534
|
+
|
|
535
|
+
if ActiveDrag.arguments.Min ~= nil then
|
|
536
|
+
newValue = math.max(newValue, getValueByIndex(ActiveDrag.arguments.Min, ActiveIndex, ActiveDrag.arguments :: any))
|
|
537
|
+
end
|
|
538
|
+
if ActiveDrag.arguments.Max ~= nil then
|
|
539
|
+
newValue = math.min(newValue, getValueByIndex(ActiveDrag.arguments.Max, ActiveIndex, ActiveDrag.arguments :: any))
|
|
540
|
+
end
|
|
541
|
+
|
|
542
|
+
state:set(updateValueByIndex(state.value, ActiveIndex, newValue, ActiveDrag.arguments :: any))
|
|
543
|
+
ActiveDrag.lastNumberChangedTick = Iris._cycleTick + 1
|
|
544
|
+
end
|
|
545
|
+
|
|
546
|
+
local function DragMouseDown(thisWidget: Types.Input<Types.InputDataType>, dataTypes: InputDataTypes, index: number, x: number, y: number)
|
|
547
|
+
local currentTime = widgets.getTime()
|
|
548
|
+
local isTimeValid = currentTime - thisWidget.lastClickedTime < Iris._config.MouseDoubleClickTime
|
|
549
|
+
local isCtrlHeld = widgets.UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or widgets.UserInputService:IsKeyDown(Enum.KeyCode.RightControl)
|
|
550
|
+
if (isTimeValid and (Vector2.new(x, y) - thisWidget.lastClickedPosition).Magnitude < Iris._config.MouseDoubleClickMaxDist) or isCtrlHeld then
|
|
551
|
+
thisWidget.state.editingText:set(index)
|
|
552
|
+
else
|
|
553
|
+
thisWidget.lastClickedTime = currentTime
|
|
554
|
+
thisWidget.lastClickedPosition = Vector2.new(x, y)
|
|
555
|
+
|
|
556
|
+
AnyActiveDrag = true
|
|
557
|
+
ActiveDrag = thisWidget
|
|
558
|
+
ActiveIndex = index
|
|
559
|
+
ActiveDataType = dataTypes
|
|
560
|
+
updateActiveDrag()
|
|
561
|
+
end
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
widgets.registerEvent("InputChanged", function()
|
|
565
|
+
if not Iris._started then
|
|
566
|
+
return
|
|
567
|
+
end
|
|
568
|
+
updateActiveDrag()
|
|
569
|
+
end)
|
|
570
|
+
|
|
571
|
+
widgets.registerEvent("InputEnded", function(inputObject: InputObject)
|
|
572
|
+
if not Iris._started then
|
|
573
|
+
return
|
|
574
|
+
end
|
|
575
|
+
if inputObject.UserInputType == Enum.UserInputType.MouseButton1 and AnyActiveDrag then
|
|
576
|
+
AnyActiveDrag = false
|
|
577
|
+
ActiveDrag = nil
|
|
578
|
+
ActiveIndex = 0
|
|
579
|
+
end
|
|
580
|
+
end)
|
|
581
|
+
|
|
582
|
+
local function generateField<T>(thisWidget: Types.Input<T>, index: number, componentSize: UDim2, dataType: InputDataTypes)
|
|
583
|
+
local DragField = Instance.new("TextButton")
|
|
584
|
+
DragField.Name = "DragField" .. tostring(index)
|
|
585
|
+
DragField.AutomaticSize = Enum.AutomaticSize.Y
|
|
586
|
+
DragField.Size = componentSize
|
|
587
|
+
DragField.BackgroundColor3 = Iris._config.FrameBgColor
|
|
588
|
+
DragField.BackgroundTransparency = Iris._config.FrameBgTransparency
|
|
589
|
+
DragField.Text = ""
|
|
590
|
+
DragField.AutoButtonColor = false
|
|
591
|
+
DragField.LayoutOrder = index
|
|
592
|
+
DragField.ClipsDescendants = true
|
|
593
|
+
|
|
594
|
+
widgets.applyFrameStyle(DragField)
|
|
595
|
+
widgets.applyTextStyle(DragField)
|
|
596
|
+
widgets.UISizeConstraint(DragField, Vector2.xAxis)
|
|
597
|
+
|
|
598
|
+
DragField.TextXAlignment = Enum.TextXAlignment.Center
|
|
599
|
+
|
|
600
|
+
widgets.applyInteractionHighlights("Background", DragField, DragField, {
|
|
601
|
+
Color = Iris._config.FrameBgColor,
|
|
602
|
+
Transparency = Iris._config.FrameBgTransparency,
|
|
603
|
+
HoveredColor = Iris._config.FrameBgHoveredColor,
|
|
604
|
+
HoveredTransparency = Iris._config.FrameBgHoveredTransparency,
|
|
605
|
+
ActiveColor = Iris._config.FrameBgActiveColor,
|
|
606
|
+
ActiveTransparency = Iris._config.FrameBgActiveTransparency,
|
|
607
|
+
})
|
|
608
|
+
|
|
609
|
+
local InputField = Instance.new("TextBox")
|
|
610
|
+
InputField.Name = "InputField"
|
|
611
|
+
InputField.Size = UDim2.fromScale(1, 1)
|
|
612
|
+
InputField.BackgroundTransparency = 1
|
|
613
|
+
InputField.ClearTextOnFocus = false
|
|
614
|
+
InputField.TextTruncate = Enum.TextTruncate.AtEnd
|
|
615
|
+
InputField.ClipsDescendants = true
|
|
616
|
+
InputField.Visible = false
|
|
617
|
+
|
|
618
|
+
widgets.applyFrameStyle(InputField, true)
|
|
619
|
+
widgets.applyTextStyle(InputField)
|
|
620
|
+
|
|
621
|
+
InputField.Parent = DragField
|
|
622
|
+
|
|
623
|
+
InputField.FocusLost:Connect(function()
|
|
624
|
+
focusLost(thisWidget, InputField, index, dataType)
|
|
625
|
+
end)
|
|
626
|
+
|
|
627
|
+
InputField.Focused:Connect(function()
|
|
628
|
+
-- this highlights the entire field
|
|
629
|
+
InputField.CursorPosition = #InputField.Text + 1
|
|
630
|
+
InputField.SelectionStart = 1
|
|
631
|
+
|
|
632
|
+
thisWidget.state.editingText:set(index)
|
|
633
|
+
end)
|
|
634
|
+
|
|
635
|
+
widgets.applyButtonDown(DragField, function(x: number, y: number)
|
|
636
|
+
DragMouseDown(thisWidget :: any, dataType, index, x, y)
|
|
637
|
+
end)
|
|
638
|
+
|
|
639
|
+
return DragField
|
|
640
|
+
end
|
|
641
|
+
|
|
642
|
+
function generateDragScalar<T>(dataType: InputDataTypes, components: number, defaultValue: T)
|
|
643
|
+
local input = generateAbstract("Drag", dataType, components, defaultValue)
|
|
644
|
+
|
|
645
|
+
return widgets.extend(input, {
|
|
646
|
+
Generate = function(thisWidget: Types.Input<T>)
|
|
647
|
+
thisWidget.lastClickedTime = -1
|
|
648
|
+
thisWidget.lastClickedPosition = Vector2.zero
|
|
649
|
+
|
|
650
|
+
local Drag = Instance.new("Frame")
|
|
651
|
+
Drag.Name = "Iris_Drag" .. dataType
|
|
652
|
+
Drag.AutomaticSize = Enum.AutomaticSize.Y
|
|
653
|
+
Drag.Size = UDim2.new(Iris._config.ItemWidth, UDim.new())
|
|
654
|
+
Drag.BackgroundTransparency = 1
|
|
655
|
+
Drag.BorderSizePixel = 0
|
|
656
|
+
|
|
657
|
+
widgets.UIListLayout(Drag, Enum.FillDirection.Horizontal, UDim.new(0, Iris._config.ItemInnerSpacing.X)).VerticalAlignment = Enum.VerticalAlignment.Center
|
|
658
|
+
|
|
659
|
+
-- we add a color box if it is Color3 or Color4.
|
|
660
|
+
local rightPadding = 0
|
|
661
|
+
local textHeight = Iris._config.TextSize + 2 * Iris._config.FramePadding.Y
|
|
662
|
+
|
|
663
|
+
if dataType == "Color3" or dataType == "Color4" then
|
|
664
|
+
rightPadding += Iris._config.ItemInnerSpacing.X + textHeight
|
|
665
|
+
|
|
666
|
+
local ColorBox = Instance.new("ImageLabel")
|
|
667
|
+
ColorBox.Name = "ColorBox"
|
|
668
|
+
ColorBox.Size = UDim2.fromOffset(textHeight, textHeight)
|
|
669
|
+
ColorBox.BorderSizePixel = 0
|
|
670
|
+
ColorBox.Image = widgets.ICONS.ALPHA_BACKGROUND_TEXTURE
|
|
671
|
+
ColorBox.ImageTransparency = 1
|
|
672
|
+
ColorBox.LayoutOrder = 5
|
|
673
|
+
|
|
674
|
+
widgets.applyFrameStyle(ColorBox, true)
|
|
675
|
+
|
|
676
|
+
ColorBox.Parent = Drag
|
|
677
|
+
end
|
|
678
|
+
|
|
679
|
+
-- we divide the total area evenly between each field. This includes accounting for any additional boxes and the offset.
|
|
680
|
+
-- for the final field, we make sure it's flush by calculating the space avaiable for it. This only makes the Vector2 box
|
|
681
|
+
-- 4 pixels shorter, all for the sake of flush.
|
|
682
|
+
local componentWidth = UDim.new(Iris._config.ContentWidth.Scale / components, (Iris._config.ContentWidth.Offset - (Iris._config.ItemInnerSpacing.X * (components - 1)) - rightPadding) / components)
|
|
683
|
+
local totalWidth = UDim.new(componentWidth.Scale * (components - 1), (componentWidth.Offset * (components - 1)) + (Iris._config.ItemInnerSpacing.X * (components - 1)) + rightPadding)
|
|
684
|
+
local lastComponentWidth = Iris._config.ContentWidth - totalWidth
|
|
685
|
+
|
|
686
|
+
for index = 1, components do
|
|
687
|
+
generateField(thisWidget, index, if index == components then UDim2.new(lastComponentWidth, Iris._config.ContentHeight) else UDim2.new(componentWidth, Iris._config.ContentHeight), dataType).Parent = Drag
|
|
688
|
+
end
|
|
689
|
+
|
|
690
|
+
local TextLabel = Instance.new("TextLabel")
|
|
691
|
+
TextLabel.Name = "TextLabel"
|
|
692
|
+
TextLabel.AutomaticSize = Enum.AutomaticSize.XY
|
|
693
|
+
TextLabel.BackgroundTransparency = 1
|
|
694
|
+
TextLabel.BorderSizePixel = 0
|
|
695
|
+
TextLabel.LayoutOrder = 6
|
|
696
|
+
|
|
697
|
+
widgets.applyTextStyle(TextLabel)
|
|
698
|
+
|
|
699
|
+
TextLabel.Parent = Drag
|
|
700
|
+
|
|
701
|
+
return Drag
|
|
702
|
+
end,
|
|
703
|
+
UpdateState = function(thisWidget: Types.Input<T>)
|
|
704
|
+
local Drag = thisWidget.Instance :: Frame
|
|
705
|
+
|
|
706
|
+
local widget = thisWidget :: any
|
|
707
|
+
for index = 1, components do
|
|
708
|
+
local state = thisWidget.state.number
|
|
709
|
+
if dataType == "Color3" or dataType == "Color4" then
|
|
710
|
+
state = widget.state.color
|
|
711
|
+
if index == 4 then
|
|
712
|
+
state = widget.state.transparency
|
|
713
|
+
end
|
|
714
|
+
end
|
|
715
|
+
local DragField = Drag:FindFirstChild("DragField" .. tostring(index)) :: TextButton
|
|
716
|
+
local InputField: TextBox = DragField.InputField
|
|
717
|
+
local value = getValueByIndex(state.value, index, thisWidget.arguments :: any)
|
|
718
|
+
if (dataType == "Color3" or dataType == "Color4") and not widget.arguments.UseFloats then
|
|
719
|
+
value = math.round(value * 255)
|
|
720
|
+
end
|
|
721
|
+
|
|
722
|
+
local format = thisWidget.arguments.Format[index] or thisWidget.arguments.Format[1]
|
|
723
|
+
if thisWidget.arguments.Prefix then
|
|
724
|
+
format = thisWidget.arguments.Prefix[index] .. format
|
|
725
|
+
end
|
|
726
|
+
DragField.Text = string.format(format, value)
|
|
727
|
+
InputField.Text = tostring(value)
|
|
728
|
+
|
|
729
|
+
if thisWidget.state.editingText.value == index then
|
|
730
|
+
InputField.Visible = true
|
|
731
|
+
InputField:CaptureFocus()
|
|
732
|
+
DragField.TextTransparency = 1
|
|
733
|
+
else
|
|
734
|
+
InputField.Visible = false
|
|
735
|
+
DragField.TextTransparency = Iris._config.TextTransparency
|
|
736
|
+
end
|
|
737
|
+
end
|
|
738
|
+
|
|
739
|
+
if dataType == "Color3" or dataType == "Color4" then
|
|
740
|
+
local ColorBox: ImageLabel = Drag.ColorBox
|
|
741
|
+
|
|
742
|
+
ColorBox.BackgroundColor3 = widget.state.color.value
|
|
743
|
+
|
|
744
|
+
if dataType == "Color4" then
|
|
745
|
+
ColorBox.ImageTransparency = 1 - widget.state.transparency.value
|
|
746
|
+
end
|
|
747
|
+
end
|
|
748
|
+
end,
|
|
749
|
+
})
|
|
750
|
+
end
|
|
751
|
+
|
|
752
|
+
function generateColorDragScalar(dataType: InputDataTypes, ...: any)
|
|
753
|
+
local defaultValues = { ... }
|
|
754
|
+
local input = generateDragScalar(dataType, dataType == "Color4" and 4 or 3, defaultValues[1])
|
|
755
|
+
|
|
756
|
+
return widgets.extend(input, {
|
|
757
|
+
Args = {
|
|
758
|
+
["Text"] = 1,
|
|
759
|
+
["UseFloats"] = 2,
|
|
760
|
+
["UseHSV"] = 3,
|
|
761
|
+
["Format"] = 4,
|
|
762
|
+
},
|
|
763
|
+
Update = function(thisWidget: Types.InputColor4)
|
|
764
|
+
local Input = thisWidget.Instance :: GuiObject
|
|
765
|
+
local TextLabel: TextLabel = Input.TextLabel
|
|
766
|
+
TextLabel.Text = thisWidget.arguments.Text or `Drag {dataType}`
|
|
767
|
+
|
|
768
|
+
if thisWidget.arguments.Format and typeof(thisWidget.arguments.Format) ~= "table" then
|
|
769
|
+
thisWidget.arguments.Format = { thisWidget.arguments.Format }
|
|
770
|
+
elseif not thisWidget.arguments.Format then
|
|
771
|
+
if thisWidget.arguments.UseFloats then
|
|
772
|
+
thisWidget.arguments.Format = { "%.3f" }
|
|
773
|
+
else
|
|
774
|
+
thisWidget.arguments.Format = { "%d" }
|
|
775
|
+
end
|
|
776
|
+
|
|
777
|
+
thisWidget.arguments.Prefix = defaultPrefx[dataType .. if thisWidget.arguments.UseHSV then "_HSV" else "_RGB"]
|
|
778
|
+
end
|
|
779
|
+
|
|
780
|
+
thisWidget.arguments.Min = { 0, 0, 0, 0 }
|
|
781
|
+
thisWidget.arguments.Max = { 1, 1, 1, 1 }
|
|
782
|
+
thisWidget.arguments.Increment = { 0.001, 0.001, 0.001, 0.001 }
|
|
783
|
+
|
|
784
|
+
-- since the state values have changed display, we call an update. The check is because state is not
|
|
785
|
+
-- initialised on creation, so it would error otherwise.
|
|
786
|
+
if thisWidget.state then
|
|
787
|
+
thisWidget.state.color.lastChangeTick = Iris._cycleTick
|
|
788
|
+
if dataType == "Color4" then
|
|
789
|
+
thisWidget.state.transparency.lastChangeTick = Iris._cycleTick
|
|
790
|
+
end
|
|
791
|
+
Iris._widgets[thisWidget.type].UpdateState(thisWidget)
|
|
792
|
+
end
|
|
793
|
+
end,
|
|
794
|
+
GenerateState = function(thisWidget: Types.InputColor4)
|
|
795
|
+
if thisWidget.state.color == nil then
|
|
796
|
+
thisWidget.state.color = Iris._widgetState(thisWidget, "color", defaultValues[1])
|
|
797
|
+
end
|
|
798
|
+
if dataType == "Color4" then
|
|
799
|
+
if thisWidget.state.transparency == nil then
|
|
800
|
+
thisWidget.state.transparency = Iris._widgetState(thisWidget, "transparency", defaultValues[2])
|
|
801
|
+
end
|
|
802
|
+
end
|
|
803
|
+
if thisWidget.state.editingText == nil then
|
|
804
|
+
thisWidget.state.editingText = Iris._widgetState(thisWidget, "editingText", false)
|
|
805
|
+
end
|
|
806
|
+
end,
|
|
807
|
+
})
|
|
808
|
+
end
|
|
809
|
+
end
|
|
810
|
+
|
|
811
|
+
--[[
|
|
812
|
+
Slider
|
|
813
|
+
]]
|
|
814
|
+
local generateSliderScalar: <T>(dataType: InputDataTypes, components: number, defaultValue: T) -> Types.WidgetClass
|
|
815
|
+
local generateEnumSliderScalar: (enum: Enum, item: EnumItem) -> Types.WidgetClass
|
|
816
|
+
do
|
|
817
|
+
local AnyActiveSlider = false
|
|
818
|
+
local ActiveSlider: Types.Input<Types.InputDataType>? = nil
|
|
819
|
+
local ActiveIndex = 0
|
|
820
|
+
local ActiveDataType: InputDataTypes | "" = ""
|
|
821
|
+
|
|
822
|
+
local function updateActiveSlider()
|
|
823
|
+
if AnyActiveSlider == false then
|
|
824
|
+
return
|
|
825
|
+
end
|
|
826
|
+
if ActiveSlider == nil then
|
|
827
|
+
return
|
|
828
|
+
end
|
|
829
|
+
|
|
830
|
+
local Slider = ActiveSlider.Instance :: Frame
|
|
831
|
+
local SliderField = Slider:FindFirstChild("SliderField" .. tostring(ActiveIndex)) :: TextButton
|
|
832
|
+
local GrabBar: Frame = SliderField.GrabBar
|
|
833
|
+
|
|
834
|
+
local increment = ActiveSlider.arguments.Increment and getValueByIndex(ActiveSlider.arguments.Increment, ActiveIndex, ActiveSlider.arguments :: any) or defaultIncrements[ActiveDataType][ActiveIndex]
|
|
835
|
+
local min = ActiveSlider.arguments.Min and getValueByIndex(ActiveSlider.arguments.Min, ActiveIndex, ActiveSlider.arguments :: any) or defaultMin[ActiveDataType][ActiveIndex]
|
|
836
|
+
local max = ActiveSlider.arguments.Max and getValueByIndex(ActiveSlider.arguments.Max, ActiveIndex, ActiveSlider.arguments :: any) or defaultMax[ActiveDataType][ActiveIndex]
|
|
837
|
+
|
|
838
|
+
local GrabWidth = GrabBar.AbsoluteSize.X
|
|
839
|
+
local Offset = widgets.getMouseLocation().X - (SliderField.AbsolutePosition.X - widgets.GuiOffset.X + GrabWidth / 2)
|
|
840
|
+
local Ratio = Offset / (SliderField.AbsoluteSize.X - GrabWidth)
|
|
841
|
+
local Positions = math.floor((max - min) / increment)
|
|
842
|
+
local newValue = math.clamp(math.round(Ratio * Positions) * increment + min, min, max)
|
|
843
|
+
|
|
844
|
+
ActiveSlider.state.number:set(updateValueByIndex(ActiveSlider.state.number.value, ActiveIndex, newValue, ActiveSlider.arguments :: any))
|
|
845
|
+
ActiveSlider.lastNumberChangedTick = Iris._cycleTick + 1
|
|
846
|
+
end
|
|
847
|
+
|
|
848
|
+
local function SliderMouseDown(thisWidget: Types.Input<Types.InputDataType>, dataType: InputDataTypes, index: number)
|
|
849
|
+
local isCtrlHeld = widgets.UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) or widgets.UserInputService:IsKeyDown(Enum.KeyCode.RightControl)
|
|
850
|
+
if isCtrlHeld then
|
|
851
|
+
thisWidget.state.editingText:set(index)
|
|
852
|
+
else
|
|
853
|
+
AnyActiveSlider = true
|
|
854
|
+
ActiveSlider = thisWidget
|
|
855
|
+
ActiveIndex = index
|
|
856
|
+
ActiveDataType = dataType
|
|
857
|
+
updateActiveSlider()
|
|
858
|
+
end
|
|
859
|
+
end
|
|
860
|
+
|
|
861
|
+
widgets.registerEvent("InputChanged", function()
|
|
862
|
+
if not Iris._started then
|
|
863
|
+
return
|
|
864
|
+
end
|
|
865
|
+
updateActiveSlider()
|
|
866
|
+
end)
|
|
867
|
+
|
|
868
|
+
widgets.registerEvent("InputEnded", function(inputObject: InputObject)
|
|
869
|
+
if not Iris._started then
|
|
870
|
+
return
|
|
871
|
+
end
|
|
872
|
+
if inputObject.UserInputType == Enum.UserInputType.MouseButton1 and AnyActiveSlider then
|
|
873
|
+
AnyActiveSlider = false
|
|
874
|
+
ActiveSlider = nil
|
|
875
|
+
ActiveIndex = 0
|
|
876
|
+
ActiveDataType = ""
|
|
877
|
+
end
|
|
878
|
+
end)
|
|
879
|
+
|
|
880
|
+
local function generateField<T>(thisWidget: Types.Input<T>, index: number, componentSize: UDim2, dataType: InputDataTypes)
|
|
881
|
+
local SliderField = Instance.new("TextButton")
|
|
882
|
+
SliderField.Name = "SliderField" .. tostring(index)
|
|
883
|
+
SliderField.AutomaticSize = Enum.AutomaticSize.Y
|
|
884
|
+
SliderField.Size = componentSize
|
|
885
|
+
SliderField.BackgroundColor3 = Iris._config.FrameBgColor
|
|
886
|
+
SliderField.BackgroundTransparency = Iris._config.FrameBgTransparency
|
|
887
|
+
SliderField.Text = ""
|
|
888
|
+
SliderField.AutoButtonColor = false
|
|
889
|
+
SliderField.LayoutOrder = index
|
|
890
|
+
SliderField.ClipsDescendants = true
|
|
891
|
+
|
|
892
|
+
widgets.applyFrameStyle(SliderField)
|
|
893
|
+
widgets.applyTextStyle(SliderField)
|
|
894
|
+
widgets.UISizeConstraint(SliderField, Vector2.xAxis)
|
|
895
|
+
|
|
896
|
+
local OverlayText = Instance.new("TextLabel")
|
|
897
|
+
OverlayText.Name = "OverlayText"
|
|
898
|
+
OverlayText.Size = UDim2.fromScale(1, 1)
|
|
899
|
+
OverlayText.BackgroundTransparency = 1
|
|
900
|
+
OverlayText.BorderSizePixel = 0
|
|
901
|
+
OverlayText.ZIndex = 10
|
|
902
|
+
OverlayText.ClipsDescendants = true
|
|
903
|
+
|
|
904
|
+
widgets.applyTextStyle(OverlayText)
|
|
905
|
+
|
|
906
|
+
OverlayText.TextXAlignment = Enum.TextXAlignment.Center
|
|
907
|
+
|
|
908
|
+
OverlayText.Parent = SliderField
|
|
909
|
+
|
|
910
|
+
widgets.applyInteractionHighlights("Background", SliderField, SliderField, {
|
|
911
|
+
Color = Iris._config.FrameBgColor,
|
|
912
|
+
Transparency = Iris._config.FrameBgTransparency,
|
|
913
|
+
HoveredColor = Iris._config.FrameBgHoveredColor,
|
|
914
|
+
HoveredTransparency = Iris._config.FrameBgHoveredTransparency,
|
|
915
|
+
ActiveColor = Iris._config.FrameBgActiveColor,
|
|
916
|
+
ActiveTransparency = Iris._config.FrameBgActiveTransparency,
|
|
917
|
+
})
|
|
918
|
+
|
|
919
|
+
local InputField = Instance.new("TextBox")
|
|
920
|
+
InputField.Name = "InputField"
|
|
921
|
+
InputField.Size = UDim2.fromScale(1, 1)
|
|
922
|
+
InputField.BackgroundTransparency = 1
|
|
923
|
+
InputField.ClearTextOnFocus = false
|
|
924
|
+
InputField.TextTruncate = Enum.TextTruncate.AtEnd
|
|
925
|
+
InputField.ClipsDescendants = true
|
|
926
|
+
InputField.Visible = false
|
|
927
|
+
|
|
928
|
+
widgets.applyFrameStyle(InputField, true)
|
|
929
|
+
widgets.applyTextStyle(InputField)
|
|
930
|
+
|
|
931
|
+
InputField.Parent = SliderField
|
|
932
|
+
|
|
933
|
+
InputField.FocusLost:Connect(function()
|
|
934
|
+
focusLost(thisWidget, InputField, index, dataType)
|
|
935
|
+
end)
|
|
936
|
+
|
|
937
|
+
InputField.Focused:Connect(function()
|
|
938
|
+
-- this highlights the entire field
|
|
939
|
+
InputField.CursorPosition = #InputField.Text + 1
|
|
940
|
+
InputField.SelectionStart = 1
|
|
941
|
+
|
|
942
|
+
thisWidget.state.editingText:set(index)
|
|
943
|
+
end)
|
|
944
|
+
|
|
945
|
+
widgets.applyButtonDown(SliderField, function()
|
|
946
|
+
SliderMouseDown(thisWidget :: any, dataType, index)
|
|
947
|
+
end)
|
|
948
|
+
|
|
949
|
+
local GrabBar = Instance.new("Frame")
|
|
950
|
+
GrabBar.Name = "GrabBar"
|
|
951
|
+
GrabBar.AnchorPoint = Vector2.new(0.5, 0.5)
|
|
952
|
+
GrabBar.Position = UDim2.fromScale(0, 0.5)
|
|
953
|
+
GrabBar.BackgroundColor3 = Iris._config.SliderGrabColor
|
|
954
|
+
GrabBar.Transparency = Iris._config.SliderGrabTransparency
|
|
955
|
+
GrabBar.BorderSizePixel = 0
|
|
956
|
+
GrabBar.ZIndex = 5
|
|
957
|
+
|
|
958
|
+
widgets.applyInteractionHighlights("Background", SliderField, GrabBar, {
|
|
959
|
+
Color = Iris._config.SliderGrabColor,
|
|
960
|
+
Transparency = Iris._config.SliderGrabTransparency,
|
|
961
|
+
HoveredColor = Iris._config.SliderGrabColor,
|
|
962
|
+
HoveredTransparency = Iris._config.SliderGrabTransparency,
|
|
963
|
+
ActiveColor = Iris._config.SliderGrabActiveColor,
|
|
964
|
+
ActiveTransparency = Iris._config.SliderGrabActiveTransparency,
|
|
965
|
+
})
|
|
966
|
+
|
|
967
|
+
if Iris._config.GrabRounding > 0 then
|
|
968
|
+
widgets.UICorner(GrabBar, Iris._config.GrabRounding)
|
|
969
|
+
end
|
|
970
|
+
|
|
971
|
+
widgets.UISizeConstraint(GrabBar, Vector2.new(Iris._config.GrabMinSize, 0))
|
|
972
|
+
|
|
973
|
+
GrabBar.Parent = SliderField
|
|
974
|
+
|
|
975
|
+
return SliderField
|
|
976
|
+
end
|
|
977
|
+
|
|
978
|
+
function generateSliderScalar<T>(dataType: InputDataTypes, components: number, defaultValue: T)
|
|
979
|
+
local input = generateAbstract("Slider", dataType, components, defaultValue)
|
|
980
|
+
|
|
981
|
+
return widgets.extend(input, {
|
|
982
|
+
Generate = function(thisWidget: Types.Input<T>)
|
|
983
|
+
local Slider = Instance.new("Frame")
|
|
984
|
+
Slider.Name = "Iris_Slider" .. dataType
|
|
985
|
+
Slider.AutomaticSize = Enum.AutomaticSize.Y
|
|
986
|
+
Slider.Size = UDim2.new(Iris._config.ItemWidth, UDim.new())
|
|
987
|
+
Slider.BackgroundTransparency = 1
|
|
988
|
+
Slider.BorderSizePixel = 0
|
|
989
|
+
|
|
990
|
+
widgets.UIListLayout(Slider, Enum.FillDirection.Horizontal, UDim.new(0, Iris._config.ItemInnerSpacing.X)).VerticalAlignment = Enum.VerticalAlignment.Center
|
|
991
|
+
|
|
992
|
+
-- we divide the total area evenly between each field. This includes accounting for any additional boxes and the offset.
|
|
993
|
+
-- for the final field, we make sure it's flush by calculating the space avaiable for it. This only makes the Vector2 box
|
|
994
|
+
-- 4 pixels shorter, all for the sake of flush.
|
|
995
|
+
local componentWidth = UDim.new(Iris._config.ContentWidth.Scale / components, (Iris._config.ContentWidth.Offset - (Iris._config.ItemInnerSpacing.X * (components - 1))) / components)
|
|
996
|
+
local totalWidth = UDim.new(componentWidth.Scale * (components - 1), (componentWidth.Offset * (components - 1)) + (Iris._config.ItemInnerSpacing.X * (components - 1)))
|
|
997
|
+
local lastComponentWidth = Iris._config.ContentWidth - totalWidth
|
|
998
|
+
|
|
999
|
+
for index = 1, components do
|
|
1000
|
+
generateField(thisWidget, index, if index == components then UDim2.new(lastComponentWidth, Iris._config.ContentHeight) else UDim2.new(componentWidth, Iris._config.ContentHeight), dataType).Parent = Slider
|
|
1001
|
+
end
|
|
1002
|
+
|
|
1003
|
+
local TextLabel = Instance.new("TextLabel")
|
|
1004
|
+
TextLabel.Name = "TextLabel"
|
|
1005
|
+
TextLabel.AutomaticSize = Enum.AutomaticSize.XY
|
|
1006
|
+
TextLabel.BackgroundTransparency = 1
|
|
1007
|
+
TextLabel.BorderSizePixel = 0
|
|
1008
|
+
TextLabel.LayoutOrder = 5
|
|
1009
|
+
|
|
1010
|
+
widgets.applyTextStyle(TextLabel)
|
|
1011
|
+
|
|
1012
|
+
TextLabel.Parent = Slider
|
|
1013
|
+
|
|
1014
|
+
return Slider
|
|
1015
|
+
end,
|
|
1016
|
+
UpdateState = function(thisWidget: Types.Input<T>)
|
|
1017
|
+
local Slider = thisWidget.Instance :: Frame
|
|
1018
|
+
|
|
1019
|
+
for index = 1, components do
|
|
1020
|
+
local SliderField = Slider:FindFirstChild("SliderField" .. tostring(index)) :: TextButton
|
|
1021
|
+
local InputField: TextBox = SliderField.InputField
|
|
1022
|
+
local OverlayText: TextLabel = SliderField.OverlayText
|
|
1023
|
+
local GrabBar: Frame = SliderField.GrabBar
|
|
1024
|
+
|
|
1025
|
+
local value = getValueByIndex(thisWidget.state.number.value, index, thisWidget.arguments :: any)
|
|
1026
|
+
local format = thisWidget.arguments.Format[index] or thisWidget.arguments.Format[1]
|
|
1027
|
+
if thisWidget.arguments.Prefix then
|
|
1028
|
+
format = thisWidget.arguments.Prefix[index] .. format
|
|
1029
|
+
end
|
|
1030
|
+
|
|
1031
|
+
OverlayText.Text = string.format(format, value)
|
|
1032
|
+
InputField.Text = tostring(value)
|
|
1033
|
+
|
|
1034
|
+
local increment = thisWidget.arguments.Increment and getValueByIndex(thisWidget.arguments.Increment, index, thisWidget.arguments :: any) or defaultIncrements[dataType][index]
|
|
1035
|
+
local min = thisWidget.arguments.Min and getValueByIndex(thisWidget.arguments.Min, index, thisWidget.arguments :: any) or defaultMin[dataType][index]
|
|
1036
|
+
local max = thisWidget.arguments.Max and getValueByIndex(thisWidget.arguments.Max, index, thisWidget.arguments :: any) or defaultMax[dataType][index]
|
|
1037
|
+
|
|
1038
|
+
local SliderWidth = SliderField.AbsoluteSize.X
|
|
1039
|
+
local PaddedWidth = SliderWidth - GrabBar.AbsoluteSize.X
|
|
1040
|
+
local Ratio = (value - min) / (max - min)
|
|
1041
|
+
local Positions = math.floor((max - min) / increment)
|
|
1042
|
+
local ClampedRatio = math.clamp(math.floor((Ratio * Positions)) / Positions, 0, 1)
|
|
1043
|
+
local PaddedRatio = ((PaddedWidth / SliderWidth) * ClampedRatio) + ((1 - (PaddedWidth / SliderWidth)) / 2)
|
|
1044
|
+
|
|
1045
|
+
GrabBar.Position = UDim2.fromScale(PaddedRatio, 0.5)
|
|
1046
|
+
|
|
1047
|
+
if thisWidget.state.editingText.value == index then
|
|
1048
|
+
InputField.Visible = true
|
|
1049
|
+
OverlayText.Visible = false
|
|
1050
|
+
GrabBar.Visible = false
|
|
1051
|
+
InputField:CaptureFocus()
|
|
1052
|
+
else
|
|
1053
|
+
InputField.Visible = false
|
|
1054
|
+
OverlayText.Visible = true
|
|
1055
|
+
GrabBar.Visible = true
|
|
1056
|
+
end
|
|
1057
|
+
end
|
|
1058
|
+
end,
|
|
1059
|
+
})
|
|
1060
|
+
end
|
|
1061
|
+
|
|
1062
|
+
function generateEnumSliderScalar(enum: Enum, item: EnumItem)
|
|
1063
|
+
local input: Types.WidgetClass = generateSliderScalar("Enum", 1, item.Value)
|
|
1064
|
+
local valueToName = { string }
|
|
1065
|
+
|
|
1066
|
+
for _, enumItem in enum:GetEnumItems() do
|
|
1067
|
+
valueToName[enumItem.Value] = enumItem.Name
|
|
1068
|
+
end
|
|
1069
|
+
|
|
1070
|
+
return widgets.extend(input, {
|
|
1071
|
+
Args = {
|
|
1072
|
+
["Text"] = 1,
|
|
1073
|
+
},
|
|
1074
|
+
Update = function(thisWidget: Types.InputEnum)
|
|
1075
|
+
local Input = thisWidget.Instance :: GuiObject
|
|
1076
|
+
local TextLabel: TextLabel = Input.TextLabel
|
|
1077
|
+
TextLabel.Text = thisWidget.arguments.Text or "Input Enum"
|
|
1078
|
+
|
|
1079
|
+
thisWidget.arguments.Increment = 1
|
|
1080
|
+
thisWidget.arguments.Min = 0
|
|
1081
|
+
thisWidget.arguments.Max = #enum:GetEnumItems() - 1
|
|
1082
|
+
|
|
1083
|
+
local SliderField = Input:FindFirstChild("SliderField1") :: TextButton
|
|
1084
|
+
local GrabBar: Frame = SliderField.GrabBar
|
|
1085
|
+
|
|
1086
|
+
local grabScaleSize = 1 / math.floor(#enum:GetEnumItems())
|
|
1087
|
+
|
|
1088
|
+
GrabBar.Size = UDim2.fromScale(grabScaleSize, 1)
|
|
1089
|
+
end,
|
|
1090
|
+
GenerateState = function(thisWidget: Types.InputEnum)
|
|
1091
|
+
if thisWidget.state.number == nil then
|
|
1092
|
+
thisWidget.state.number = Iris._widgetState(thisWidget, "number", item.Value)
|
|
1093
|
+
end
|
|
1094
|
+
if thisWidget.state.enumItem == nil then
|
|
1095
|
+
thisWidget.state.enumItem = Iris._widgetState(thisWidget, "enumItem", item)
|
|
1096
|
+
end
|
|
1097
|
+
if thisWidget.state.editingText == nil then
|
|
1098
|
+
thisWidget.state.editingText = Iris._widgetState(thisWidget, "editingText", false)
|
|
1099
|
+
end
|
|
1100
|
+
end,
|
|
1101
|
+
})
|
|
1102
|
+
end
|
|
1103
|
+
end
|
|
1104
|
+
|
|
1105
|
+
do
|
|
1106
|
+
local inputNum: Types.WidgetClass = generateInputScalar("Num", 1, 0)
|
|
1107
|
+
inputNum.Args["NoButtons"] = 6
|
|
1108
|
+
Iris.WidgetConstructor("InputNum", inputNum)
|
|
1109
|
+
end
|
|
1110
|
+
Iris.WidgetConstructor("InputVector2", generateInputScalar("Vector2", 2, Vector2.zero))
|
|
1111
|
+
Iris.WidgetConstructor("InputVector3", generateInputScalar("Vector3", 3, Vector3.zero))
|
|
1112
|
+
Iris.WidgetConstructor("InputUDim", generateInputScalar("UDim", 2, UDim.new()))
|
|
1113
|
+
Iris.WidgetConstructor("InputUDim2", generateInputScalar("UDim2", 4, UDim2.new()))
|
|
1114
|
+
Iris.WidgetConstructor("InputRect", generateInputScalar("Rect", 4, Rect.new(0, 0, 0, 0)))
|
|
1115
|
+
|
|
1116
|
+
Iris.WidgetConstructor("DragNum", generateDragScalar("Num", 1, 0))
|
|
1117
|
+
Iris.WidgetConstructor("DragVector2", generateDragScalar("Vector2", 2, Vector2.zero))
|
|
1118
|
+
Iris.WidgetConstructor("DragVector3", generateDragScalar("Vector3", 3, Vector3.zero))
|
|
1119
|
+
Iris.WidgetConstructor("DragUDim", generateDragScalar("UDim", 2, UDim.new()))
|
|
1120
|
+
Iris.WidgetConstructor("DragUDim2", generateDragScalar("UDim2", 4, UDim2.new()))
|
|
1121
|
+
Iris.WidgetConstructor("DragRect", generateDragScalar("Rect", 4, Rect.new(0, 0, 0, 0)))
|
|
1122
|
+
|
|
1123
|
+
Iris.WidgetConstructor("InputColor3", generateColorDragScalar("Color3", Color3.fromRGB(0, 0, 0)))
|
|
1124
|
+
Iris.WidgetConstructor("InputColor4", generateColorDragScalar("Color4", Color3.fromRGB(0, 0, 0), 0))
|
|
1125
|
+
|
|
1126
|
+
Iris.WidgetConstructor("SliderNum", generateSliderScalar("Num", 1, 0))
|
|
1127
|
+
Iris.WidgetConstructor("SliderVector2", generateSliderScalar("Vector2", 2, Vector2.zero))
|
|
1128
|
+
Iris.WidgetConstructor("SliderVector3", generateSliderScalar("Vector3", 3, Vector3.zero))
|
|
1129
|
+
Iris.WidgetConstructor("SliderUDim", generateSliderScalar("UDim", 2, UDim.new()))
|
|
1130
|
+
Iris.WidgetConstructor("SliderUDim2", generateSliderScalar("UDim2", 4, UDim2.new()))
|
|
1131
|
+
Iris.WidgetConstructor("SliderRect", generateSliderScalar("Rect", 4, Rect.new(0, 0, 0, 0)))
|
|
1132
|
+
-- Iris.WidgetConstructor("SliderEnum", generateSliderScalar("Enum", 4, 0))
|
|
1133
|
+
|
|
1134
|
+
-- stylua: ignore
|
|
1135
|
+
Iris.WidgetConstructor("InputText", {
|
|
1136
|
+
hasState = true,
|
|
1137
|
+
hasChildren = false,
|
|
1138
|
+
Args = {
|
|
1139
|
+
["Text"] = 1,
|
|
1140
|
+
["TextHint"] = 2,
|
|
1141
|
+
["ReadOnly"] = 3,
|
|
1142
|
+
["MultiLine"] = 4,
|
|
1143
|
+
},
|
|
1144
|
+
Events = {
|
|
1145
|
+
["textChanged"] = {
|
|
1146
|
+
["Init"] = function(thisWidget: Types.InputText)
|
|
1147
|
+
thisWidget.lastTextChangedTick = 0
|
|
1148
|
+
end,
|
|
1149
|
+
["Get"] = function(thisWidget: Types.InputText)
|
|
1150
|
+
return thisWidget.lastTextChangedTick == Iris._cycleTick
|
|
1151
|
+
end,
|
|
1152
|
+
},
|
|
1153
|
+
["hovered"] = widgets.EVENTS.hover(function(thisWidget: Types.Widget)
|
|
1154
|
+
return thisWidget.Instance
|
|
1155
|
+
end),
|
|
1156
|
+
},
|
|
1157
|
+
Generate = function(thisWidget: Types.InputText)
|
|
1158
|
+
local InputText: Frame = Instance.new("Frame")
|
|
1159
|
+
InputText.Name = "Iris_InputText"
|
|
1160
|
+
InputText.AutomaticSize = Enum.AutomaticSize.Y
|
|
1161
|
+
InputText.Size = UDim2.new(Iris._config.ItemWidth, UDim.new())
|
|
1162
|
+
InputText.BackgroundTransparency = 1
|
|
1163
|
+
InputText.BorderSizePixel = 0
|
|
1164
|
+
widgets.UIListLayout(InputText, Enum.FillDirection.Horizontal, UDim.new(0, Iris._config.ItemInnerSpacing.X)).VerticalAlignment = Enum.VerticalAlignment.Center
|
|
1165
|
+
|
|
1166
|
+
local InputField: TextBox = Instance.new("TextBox")
|
|
1167
|
+
InputField.Name = "InputField"
|
|
1168
|
+
InputField.AutomaticSize = Enum.AutomaticSize.Y
|
|
1169
|
+
InputField.Size = UDim2.new(Iris._config.ContentWidth, Iris._config.ContentHeight)
|
|
1170
|
+
InputField.BackgroundColor3 = Iris._config.FrameBgColor
|
|
1171
|
+
InputField.BackgroundTransparency = Iris._config.FrameBgTransparency
|
|
1172
|
+
InputField.Text = ""
|
|
1173
|
+
InputField.TextYAlignment = Enum.TextYAlignment.Top
|
|
1174
|
+
InputField.PlaceholderColor3 = Iris._config.TextDisabledColor
|
|
1175
|
+
InputField.ClearTextOnFocus = false
|
|
1176
|
+
InputField.ClipsDescendants = true
|
|
1177
|
+
|
|
1178
|
+
widgets.applyFrameStyle(InputField)
|
|
1179
|
+
widgets.applyTextStyle(InputField)
|
|
1180
|
+
widgets.UISizeConstraint(InputField, Vector2.xAxis) -- prevents sizes beaking when getting too small.
|
|
1181
|
+
-- InputField.UIPadding.PaddingLeft = UDim.new(0, Iris._config.ItemInnerSpacing.X)
|
|
1182
|
+
-- InputField.UIPadding.PaddingRight = UDim.new(0, 0)
|
|
1183
|
+
InputField.Parent = InputText
|
|
1184
|
+
|
|
1185
|
+
InputField.FocusLost:Connect(function()
|
|
1186
|
+
thisWidget.state.text:set(InputField.Text)
|
|
1187
|
+
thisWidget.lastTextChangedTick = Iris._cycleTick + 1
|
|
1188
|
+
end)
|
|
1189
|
+
|
|
1190
|
+
local frameHeight: number = Iris._config.TextSize + 2 * Iris._config.FramePadding.Y
|
|
1191
|
+
|
|
1192
|
+
local TextLabel: TextLabel = Instance.new("TextLabel")
|
|
1193
|
+
TextLabel.Name = "TextLabel"
|
|
1194
|
+
TextLabel.AutomaticSize = Enum.AutomaticSize.X
|
|
1195
|
+
TextLabel.Size = UDim2.fromOffset(0, frameHeight)
|
|
1196
|
+
TextLabel.BackgroundTransparency = 1
|
|
1197
|
+
TextLabel.BorderSizePixel = 0
|
|
1198
|
+
TextLabel.LayoutOrder = 1
|
|
1199
|
+
|
|
1200
|
+
widgets.applyTextStyle(TextLabel)
|
|
1201
|
+
|
|
1202
|
+
TextLabel.Parent = InputText
|
|
1203
|
+
|
|
1204
|
+
return InputText
|
|
1205
|
+
end,
|
|
1206
|
+
GenerateState = function(thisWidget: Types.InputText)
|
|
1207
|
+
if thisWidget.state.text == nil then
|
|
1208
|
+
thisWidget.state.text = Iris._widgetState(thisWidget, "text", "")
|
|
1209
|
+
end
|
|
1210
|
+
end,
|
|
1211
|
+
Update = function(thisWidget: Types.InputText)
|
|
1212
|
+
local InputText = thisWidget.Instance :: Frame
|
|
1213
|
+
local TextLabel: TextLabel = InputText.TextLabel
|
|
1214
|
+
local InputField: TextBox = InputText.InputField
|
|
1215
|
+
|
|
1216
|
+
TextLabel.Text = thisWidget.arguments.Text or "Input Text"
|
|
1217
|
+
InputField.PlaceholderText = thisWidget.arguments.TextHint or ""
|
|
1218
|
+
InputField.TextEditable = not thisWidget.arguments.ReadOnly
|
|
1219
|
+
InputField.MultiLine = thisWidget.arguments.MultiLine or false
|
|
1220
|
+
end,
|
|
1221
|
+
UpdateState = function(thisWidget: Types.InputText)
|
|
1222
|
+
local InputText = thisWidget.Instance :: Frame
|
|
1223
|
+
local InputField: TextBox = InputText.InputField
|
|
1224
|
+
|
|
1225
|
+
InputField.Text = thisWidget.state.text.value
|
|
1226
|
+
end,
|
|
1227
|
+
Discard = function(thisWidget: Types.InputText)
|
|
1228
|
+
thisWidget.Instance:Destroy()
|
|
1229
|
+
widgets.discardState(thisWidget)
|
|
1230
|
+
end,
|
|
1231
|
+
} :: Types.WidgetClass)
|
|
1232
|
+
end
|