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,1249 @@
|
|
|
1
|
+
--!nonstrict
|
|
2
|
+
--[[
|
|
3
|
+
|
|
4
|
+
The majority of this code is an interface designed to make it easy for you to
|
|
5
|
+
work with TopbarPlus (most methods for instance reference :modifyTheme()).
|
|
6
|
+
The processing overhead mainly consists of applying themes and calculating
|
|
7
|
+
appearance (such as size and width of labels) which is handled in about
|
|
8
|
+
200 lines of code here and the Widget UI module. This has been achieved
|
|
9
|
+
in v3 by outsourcing a majority of previous calculations to inbuilt Roblox
|
|
10
|
+
features like UIListLayouts.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
v3 provides inbuilt support for controllers (simply press DPadUp),
|
|
14
|
+
touch devices (phones, tablets , etc), localization (automatic resizing
|
|
15
|
+
of widgets, autolocalize for relevant labels), backwards compatability
|
|
16
|
+
with the old topbar, and more.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
My primary goals for the v3 re-write have been to:
|
|
20
|
+
|
|
21
|
+
1. Improve code readability and organisation (reduced lines of code within
|
|
22
|
+
Icon+IconController from 3200 to ~950, separated UI elements, etc)
|
|
23
|
+
|
|
24
|
+
2. Improve ease-of-use (themes now actually make sense and can account
|
|
25
|
+
for any modifications you want, converted to a package for
|
|
26
|
+
quick installation and easy-comparisons of new updates, etc)
|
|
27
|
+
|
|
28
|
+
3. Provide support for all key features of the new Roblox topbar
|
|
29
|
+
while improving performance of the module (deferring and collecting
|
|
30
|
+
changes then calling as a singular, utilizing inbuilt Roblox features
|
|
31
|
+
such as UILIstLayouts, etc)
|
|
32
|
+
|
|
33
|
+
--]]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
-- SERVICES
|
|
38
|
+
local UserInputService = game:GetService("UserInputService")
|
|
39
|
+
local ContentProvider = game:GetService("ContentProvider")
|
|
40
|
+
local StarterGui = game:GetService("StarterGui")
|
|
41
|
+
local Players = game:GetService("Players")
|
|
42
|
+
local Types = require(script.Types)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
-- TYPES
|
|
47
|
+
export type Icon = Types.Icon
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
-- REFERENCE HANDLER
|
|
52
|
+
-- Multiple Icons packages may exist at runtime (for instance if the developer additionally uses HD Admin)
|
|
53
|
+
-- therefore this ensures that the first required package becomes the dominant and only functioning module
|
|
54
|
+
local iconModule = script
|
|
55
|
+
local Reference = require(iconModule.Reference)
|
|
56
|
+
local referenceObject = Reference.getObject()
|
|
57
|
+
local leadPackage = referenceObject and referenceObject.Value
|
|
58
|
+
if leadPackage and leadPackage ~= iconModule then
|
|
59
|
+
return require(leadPackage) :: Types.StaticIcon
|
|
60
|
+
end
|
|
61
|
+
if not referenceObject then
|
|
62
|
+
Reference.addToReplicatedStorage()
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
-- MODULES
|
|
68
|
+
local Signal = require(iconModule.Packages.GoodSignal)
|
|
69
|
+
local Janitor = require(iconModule.Packages.Janitor)
|
|
70
|
+
local Utility = require(iconModule.Utility)
|
|
71
|
+
local Themes = require(iconModule.Features.Themes)
|
|
72
|
+
local Gamepad = require(iconModule.Features.Gamepad)
|
|
73
|
+
local Overflow = require(iconModule.Features.Overflow)
|
|
74
|
+
local Icon = {}
|
|
75
|
+
Icon.__index = Icon
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
--- LOCAL
|
|
80
|
+
local localPlayer = Players.LocalPlayer
|
|
81
|
+
local themes = iconModule.Features.Themes
|
|
82
|
+
local iconsDict = {}
|
|
83
|
+
local anyIconSelected = Signal.new()
|
|
84
|
+
local elements = iconModule.Elements
|
|
85
|
+
local totalCreatedIcons = 0
|
|
86
|
+
local preferredInput = {
|
|
87
|
+
mobile = Enum.PreferredInput.Touch,
|
|
88
|
+
desktop = Enum.PreferredInput.KeyboardAndMouse,
|
|
89
|
+
console = Enum.PreferredInput.Gamepad
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
-- PUBLIC VARIABLES
|
|
95
|
+
Icon.baseDisplayOrderChanged = Signal.new()
|
|
96
|
+
Icon.baseDisplayOrder = 10
|
|
97
|
+
Icon.baseTheme = require(themes.Default)
|
|
98
|
+
Icon.isOldTopbar = false -- Logic has been moved to Container
|
|
99
|
+
Icon.iconsDictionary = iconsDict
|
|
100
|
+
Icon.insetHeightChanged = Signal.new()
|
|
101
|
+
Icon.container = require(elements.Container)(Icon)
|
|
102
|
+
Icon.topbarEnabled = true
|
|
103
|
+
Icon.iconAdded = Signal.new()
|
|
104
|
+
Icon.iconRemoved = Signal.new()
|
|
105
|
+
Icon.iconChanged = Signal.new()
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
-- PUBLIC FUNCTIONS
|
|
110
|
+
function Icon.getIcons()
|
|
111
|
+
return Icon.iconsDictionary
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
function Icon.getIconByUID(UID)
|
|
115
|
+
local match = Icon.iconsDictionary[UID]
|
|
116
|
+
if match then
|
|
117
|
+
return match
|
|
118
|
+
end
|
|
119
|
+
return nil
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
function Icon.getIcon(nameOrUID)
|
|
123
|
+
local match = Icon.getIconByUID(nameOrUID)
|
|
124
|
+
if match then
|
|
125
|
+
return match
|
|
126
|
+
end
|
|
127
|
+
for _, icon in pairs(iconsDict) do
|
|
128
|
+
if icon.name == nameOrUID then
|
|
129
|
+
return icon
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
return nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
function Icon.setTopbarEnabled(bool, isInternal)
|
|
136
|
+
if typeof(bool) ~= "boolean" then
|
|
137
|
+
bool = Icon.topbarEnabled
|
|
138
|
+
end
|
|
139
|
+
if not isInternal then
|
|
140
|
+
Icon.topbarEnabled = bool
|
|
141
|
+
end
|
|
142
|
+
for _, screenGui in pairs(Icon.container) do
|
|
143
|
+
screenGui.Enabled = bool
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
function Icon.modifyBaseTheme(modifications)
|
|
148
|
+
modifications = Themes.getModifications(modifications)
|
|
149
|
+
for _, modification in pairs(modifications) do
|
|
150
|
+
for _, detail in pairs(Icon.baseTheme) do
|
|
151
|
+
Themes.merge(detail, modification)
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
for _, icon in pairs(iconsDict) do
|
|
155
|
+
icon:setTheme(Icon.baseTheme)
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
function Icon.setDisplayOrder(int)
|
|
160
|
+
Icon.baseDisplayOrder = int
|
|
161
|
+
Icon.baseDisplayOrderChanged:Fire(int)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
-- SETUP
|
|
167
|
+
task.defer(Gamepad.start, Icon)
|
|
168
|
+
task.defer(Overflow.start, Icon)
|
|
169
|
+
task.defer(function()
|
|
170
|
+
local playerGui = localPlayer:WaitForChild("PlayerGui")
|
|
171
|
+
for _, screenGui in pairs(Icon.container) do
|
|
172
|
+
screenGui.Parent = playerGui
|
|
173
|
+
end
|
|
174
|
+
require(iconModule.Attribute)
|
|
175
|
+
end)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
-- CONSTRUCTOR
|
|
180
|
+
function Icon.new()
|
|
181
|
+
local self = {}
|
|
182
|
+
setmetatable(self, Icon)
|
|
183
|
+
|
|
184
|
+
--- Janitors (for cleanup)
|
|
185
|
+
local janitor = Janitor.new()
|
|
186
|
+
self.janitor = janitor
|
|
187
|
+
self.themesJanitor = janitor:add(Janitor.new())
|
|
188
|
+
self.singleClickJanitor = janitor:add(Janitor.new())
|
|
189
|
+
self.captionJanitor = janitor:add(Janitor.new())
|
|
190
|
+
self.joinJanitor = janitor:add(Janitor.new())
|
|
191
|
+
self.menuJanitor = janitor:add(Janitor.new())
|
|
192
|
+
self.dropdownJanitor = janitor:add(Janitor.new())
|
|
193
|
+
|
|
194
|
+
-- Register
|
|
195
|
+
local iconUID = Utility.generateUID()
|
|
196
|
+
iconsDict[iconUID] = self
|
|
197
|
+
janitor:add(function()
|
|
198
|
+
iconsDict[iconUID] = nil
|
|
199
|
+
end)
|
|
200
|
+
|
|
201
|
+
-- Signals (events)
|
|
202
|
+
self.selected = janitor:add(Signal.new())
|
|
203
|
+
self.deselected = janitor:add(Signal.new())
|
|
204
|
+
self.toggled = janitor:add(Signal.new())
|
|
205
|
+
self.viewingStarted = janitor:add(Signal.new())
|
|
206
|
+
self.viewingEnded = janitor:add(Signal.new())
|
|
207
|
+
self.stateChanged = janitor:add(Signal.new())
|
|
208
|
+
self.notified = janitor:add(Signal.new())
|
|
209
|
+
self.noticeStarted = janitor:add(Signal.new())
|
|
210
|
+
self.noticeChanged = janitor:add(Signal.new())
|
|
211
|
+
self.endNotices = janitor:add(Signal.new())
|
|
212
|
+
self.toggleKeyAdded = janitor:add(Signal.new())
|
|
213
|
+
self.fakeToggleKeyChanged = janitor:add(Signal.new())
|
|
214
|
+
self.alignmentChanged = janitor:add(Signal.new())
|
|
215
|
+
self.updateSize = janitor:add(Signal.new())
|
|
216
|
+
self.resizingComplete = janitor:add(Signal.new())
|
|
217
|
+
self.joinedParent = janitor:add(Signal.new())
|
|
218
|
+
self.menuSet = janitor:add(Signal.new())
|
|
219
|
+
self.dropdownSet = janitor:add(Signal.new())
|
|
220
|
+
self.updateMenu = janitor:add(Signal.new())
|
|
221
|
+
self.startMenuUpdate = janitor:add(Signal.new())
|
|
222
|
+
self.childThemeModified = janitor:add(Signal.new())
|
|
223
|
+
self.indicatorSet = janitor:add(Signal.new())
|
|
224
|
+
self.dropdownChildAdded = janitor:add(Signal.new())
|
|
225
|
+
self.menuChildAdded = janitor:add(Signal.new())
|
|
226
|
+
|
|
227
|
+
-- Properties
|
|
228
|
+
self.iconModule = iconModule
|
|
229
|
+
self.UID = iconUID
|
|
230
|
+
self.isEnabled = true
|
|
231
|
+
self.enabled = self.isEnabled -- Backwards compatability
|
|
232
|
+
self.isSelected = false
|
|
233
|
+
self.isViewing = false
|
|
234
|
+
self.joinedFrame = false
|
|
235
|
+
self.parentIconUID = false
|
|
236
|
+
self.deselectWhenOtherIconSelected = true
|
|
237
|
+
self.totalNotices = 0
|
|
238
|
+
self.activeState = "Deselected"
|
|
239
|
+
self.alignment = ""
|
|
240
|
+
self.originalAlignment = ""
|
|
241
|
+
self.appliedTheme = {}
|
|
242
|
+
self.appearance = {}
|
|
243
|
+
self.cachedInstances = {}
|
|
244
|
+
self.cachedNamesToInstances = {}
|
|
245
|
+
self.cachedCollectives = {}
|
|
246
|
+
self.bindedToggleKeys = {}
|
|
247
|
+
self.customBehaviours = {}
|
|
248
|
+
self.toggleItems = {}
|
|
249
|
+
self.bindedEvents = {}
|
|
250
|
+
self.notices = {}
|
|
251
|
+
self.menuIcons = {}
|
|
252
|
+
self.dropdownIcons = {}
|
|
253
|
+
self.childIconsDict = {}
|
|
254
|
+
self.creationTime = os.clock()
|
|
255
|
+
|
|
256
|
+
-- Widget is the new name for an icon
|
|
257
|
+
local widget = janitor:add(require(elements.Widget)(self, Icon))
|
|
258
|
+
self.widget = widget
|
|
259
|
+
self:setAlignment()
|
|
260
|
+
|
|
261
|
+
-- It's important we set an order otherwise icons will not align
|
|
262
|
+
-- correctly within menus
|
|
263
|
+
totalCreatedIcons += 1
|
|
264
|
+
local ourOrder = 1+(totalCreatedIcons*0.01)
|
|
265
|
+
self:setOrder(ourOrder, "deselected")
|
|
266
|
+
self:setOrder(ourOrder, "selected")
|
|
267
|
+
|
|
268
|
+
-- This applies the default them
|
|
269
|
+
self:setTheme(Icon.baseTheme)
|
|
270
|
+
|
|
271
|
+
-- Button Clicked (for states "Selected" and "Deselected")
|
|
272
|
+
local clickRegion = self:getInstance("ClickRegion")
|
|
273
|
+
local hasUsedMouseButton1Click = false
|
|
274
|
+
local lastToggleTime = 0
|
|
275
|
+
local DEBOUNCE_TIME = 0.1 -- 100ms debounce to prevent rapid toggles
|
|
276
|
+
|
|
277
|
+
local function handleToggle()
|
|
278
|
+
if self.locked then
|
|
279
|
+
return
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
-- Debounce logic to prevent rapid toggling
|
|
283
|
+
local currentTime = tick()
|
|
284
|
+
if currentTime - lastToggleTime < DEBOUNCE_TIME then
|
|
285
|
+
return
|
|
286
|
+
end
|
|
287
|
+
lastToggleTime = currentTime
|
|
288
|
+
|
|
289
|
+
if self.isSelected then
|
|
290
|
+
self:deselect("User", self)
|
|
291
|
+
else
|
|
292
|
+
self:select("User", self)
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
clickRegion.MouseButton1Click:Connect(function()
|
|
297
|
+
hasUsedMouseButton1Click = true
|
|
298
|
+
handleToggle()
|
|
299
|
+
end)
|
|
300
|
+
|
|
301
|
+
clickRegion.TouchTap:Connect(function()
|
|
302
|
+
-- This resolves the bug report by @28Pixels:
|
|
303
|
+
-- https://devforum.roblox.com/t/topbarplus/1017485/1104
|
|
304
|
+
-- Only use TouchTap if MouseButton1Click has never fired
|
|
305
|
+
-- This handles edge cases where ONLY TouchTap works
|
|
306
|
+
-- Also prevents double-toggle bug with multi-touch on mobile
|
|
307
|
+
-- Credit to @sayer80 for this fix
|
|
308
|
+
if not hasUsedMouseButton1Click then
|
|
309
|
+
handleToggle()
|
|
310
|
+
end
|
|
311
|
+
end)
|
|
312
|
+
|
|
313
|
+
-- Keys can be bound to toggle between Selected and Deselected
|
|
314
|
+
janitor:add(UserInputService.InputBegan:Connect(function(input, touchingAnObject)
|
|
315
|
+
if self.locked then
|
|
316
|
+
return
|
|
317
|
+
end
|
|
318
|
+
if self.bindedToggleKeys[input.KeyCode] and not touchingAnObject then
|
|
319
|
+
handleToggle()
|
|
320
|
+
end
|
|
321
|
+
end))
|
|
322
|
+
|
|
323
|
+
-- Button Hovering (for state "Viewing")
|
|
324
|
+
-- Hovering is a state only for devices with keyboards
|
|
325
|
+
-- and controllers (not touchpads)
|
|
326
|
+
local function viewingStarted(dontSetState)
|
|
327
|
+
if self.locked then
|
|
328
|
+
return
|
|
329
|
+
end
|
|
330
|
+
self.isViewing = true
|
|
331
|
+
self.viewingStarted:Fire(true)
|
|
332
|
+
if not dontSetState then
|
|
333
|
+
self:setState("Viewing", "User", self)
|
|
334
|
+
end
|
|
335
|
+
end
|
|
336
|
+
local function viewingEnded()
|
|
337
|
+
if self.locked then
|
|
338
|
+
return
|
|
339
|
+
end
|
|
340
|
+
self.isViewing = false
|
|
341
|
+
self.viewingEnded:Fire(true)
|
|
342
|
+
self:setState(nil, "User", self)
|
|
343
|
+
end
|
|
344
|
+
self.joinedParent:Connect(function()
|
|
345
|
+
if self.isViewing then
|
|
346
|
+
viewingEnded()
|
|
347
|
+
end
|
|
348
|
+
end)
|
|
349
|
+
clickRegion.MouseEnter:Connect(function()
|
|
350
|
+
local dontSetState = UserInputService.PreferredInput ~= preferredInput.desktop
|
|
351
|
+
viewingStarted(dontSetState)
|
|
352
|
+
end)
|
|
353
|
+
local touchCount = 0
|
|
354
|
+
janitor:add(UserInputService.TouchEnded:Connect(viewingEnded))
|
|
355
|
+
clickRegion.MouseLeave:Connect(viewingEnded)
|
|
356
|
+
clickRegion.SelectionGained:Connect(viewingStarted)
|
|
357
|
+
clickRegion.SelectionLost:Connect(viewingEnded)
|
|
358
|
+
clickRegion.MouseButton1Down:Connect(function()
|
|
359
|
+
if not self.locked and UserInputService.PreferredInput == preferredInput.mobile then
|
|
360
|
+
touchCount += 1
|
|
361
|
+
local myTouchCount = touchCount
|
|
362
|
+
task.delay(0.2, function()
|
|
363
|
+
if myTouchCount == touchCount then
|
|
364
|
+
viewingStarted()
|
|
365
|
+
end
|
|
366
|
+
end)
|
|
367
|
+
end
|
|
368
|
+
end)
|
|
369
|
+
clickRegion.MouseButton1Up:Connect(function()
|
|
370
|
+
touchCount += 1
|
|
371
|
+
end)
|
|
372
|
+
|
|
373
|
+
-- Handle overlay on viewing
|
|
374
|
+
local iconOverlay = self:getInstance("IconOverlay")
|
|
375
|
+
self.viewingStarted:Connect(function()
|
|
376
|
+
iconOverlay.Visible = not self.overlayDisabled
|
|
377
|
+
end)
|
|
378
|
+
self.viewingEnded:Connect(function()
|
|
379
|
+
iconOverlay.Visible = false
|
|
380
|
+
end)
|
|
381
|
+
|
|
382
|
+
-- Deselect when another icon is selected
|
|
383
|
+
janitor:add(anyIconSelected:Connect(function(incomingIcon)
|
|
384
|
+
if incomingIcon ~= self and self.deselectWhenOtherIconSelected and incomingIcon.deselectWhenOtherIconSelected then
|
|
385
|
+
self:deselect("AutoDeselect", incomingIcon)
|
|
386
|
+
end
|
|
387
|
+
end))
|
|
388
|
+
|
|
389
|
+
-- This checks if the script calling this module is a descendant of a ScreenGui
|
|
390
|
+
-- with 'ResetOnSpawn' set to true. If it is, then we destroy the icon the
|
|
391
|
+
-- client respawns. This solves one of the most asked about questions on the post
|
|
392
|
+
-- The only caveat this may not work if the player doesn't uniquely name their ScreenGui and the frames
|
|
393
|
+
-- the LocalScript rests within
|
|
394
|
+
local source = debug.info(2, "s")
|
|
395
|
+
local sourcePath = string.split(source, ".")
|
|
396
|
+
local origin = game
|
|
397
|
+
local originsScreenGui
|
|
398
|
+
for i, sourceName in pairs(sourcePath) do
|
|
399
|
+
origin = origin:FindFirstChild(sourceName)
|
|
400
|
+
if not origin then
|
|
401
|
+
break
|
|
402
|
+
end
|
|
403
|
+
if origin:IsA("ScreenGui") then
|
|
404
|
+
originsScreenGui = origin
|
|
405
|
+
end
|
|
406
|
+
end
|
|
407
|
+
if origin and originsScreenGui and originsScreenGui.ResetOnSpawn == true then
|
|
408
|
+
self.originsScreenGui = originsScreenGui
|
|
409
|
+
Utility.localPlayerRespawned(function()
|
|
410
|
+
self:destroy()
|
|
411
|
+
end)
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
-- Additional children behaviour when toggled (mostly notices)
|
|
415
|
+
self.toggled:Connect(function(isSelected)
|
|
416
|
+
self.noticeChanged:Fire(self.totalNotices)
|
|
417
|
+
for childIconUID, _ in pairs(self.childIconsDict) do
|
|
418
|
+
local childIcon = Icon.getIconByUID(childIconUID)
|
|
419
|
+
childIcon.noticeChanged:Fire(childIcon.totalNotices)
|
|
420
|
+
if not isSelected and childIcon.isSelected then
|
|
421
|
+
-- If an icon within a menu or dropdown is also
|
|
422
|
+
-- a dropdown or menu, then close it
|
|
423
|
+
for _, _ in pairs(childIcon.childIconsDict) do
|
|
424
|
+
childIcon:deselect("HideParentFeature", self)
|
|
425
|
+
end
|
|
426
|
+
end
|
|
427
|
+
end
|
|
428
|
+
end)
|
|
429
|
+
|
|
430
|
+
-- This closes/reopens the chat or playerlist if the icon is a dropdown
|
|
431
|
+
-- In the future I'd prefer to use the position+size of the chat
|
|
432
|
+
-- to determine whether to close dropdown (instead of non-right-set)
|
|
433
|
+
-- but for reasons mentioned here it's unreliable at the time of
|
|
434
|
+
-- writing this: https://devforum.roblox.com/t/here/2794915
|
|
435
|
+
-- I could also make this better by accounting for multiple
|
|
436
|
+
-- dropdowns being open (not just this one) but this will work
|
|
437
|
+
-- fine for almost every use case for now.
|
|
438
|
+
self.selected:Connect(function()
|
|
439
|
+
local isDropdown = #self.dropdownIcons > 0
|
|
440
|
+
if isDropdown then
|
|
441
|
+
if StarterGui:GetCore("ChatActive") and self.alignment ~= "Right" then
|
|
442
|
+
self.chatWasPreviouslyActive = true
|
|
443
|
+
StarterGui:SetCore("ChatActive", false)
|
|
444
|
+
end
|
|
445
|
+
if StarterGui:GetCoreGuiEnabled("PlayerList") and self.alignment ~= "Left" then
|
|
446
|
+
self.playerlistWasPreviouslyActive = true
|
|
447
|
+
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
|
|
448
|
+
end
|
|
449
|
+
end
|
|
450
|
+
end)
|
|
451
|
+
self.deselected:Connect(function()
|
|
452
|
+
if self.chatWasPreviouslyActive then
|
|
453
|
+
self.chatWasPreviouslyActive = nil
|
|
454
|
+
StarterGui:SetCore("ChatActive", true)
|
|
455
|
+
end
|
|
456
|
+
if self.playerlistWasPreviouslyActive then
|
|
457
|
+
self.playerlistWasPreviouslyActive = nil
|
|
458
|
+
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
|
|
459
|
+
end
|
|
460
|
+
end)
|
|
461
|
+
|
|
462
|
+
-- There's a rare occassion where the appearance is not
|
|
463
|
+
-- fully set to deselected so this ensures the icons
|
|
464
|
+
-- appearance is fully as it should be
|
|
465
|
+
task.delay(0.1, function()
|
|
466
|
+
if self.activeState == "Deselected" then
|
|
467
|
+
self.stateChanged:Fire("Deselected")
|
|
468
|
+
self:refresh()
|
|
469
|
+
end
|
|
470
|
+
end)
|
|
471
|
+
|
|
472
|
+
-- Call icon added
|
|
473
|
+
Icon.iconAdded:Fire(self)
|
|
474
|
+
|
|
475
|
+
return self
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
-- METHODS
|
|
481
|
+
function Icon:setName(name)
|
|
482
|
+
self.widget.Name = name
|
|
483
|
+
self.name = name
|
|
484
|
+
return self
|
|
485
|
+
end
|
|
486
|
+
|
|
487
|
+
function Icon:setState(incomingStateName, fromSource, sourceIcon)
|
|
488
|
+
-- This is responsible for acknowleding a change in stage (such as from "Deselected" to "Viewing" when
|
|
489
|
+
-- a users mouse enters the widget), then informing other systems of this state change to then act upon
|
|
490
|
+
-- (such as the theme handler applying the theme which corresponds to that state).
|
|
491
|
+
if not incomingStateName then
|
|
492
|
+
incomingStateName = (self.isSelected and "Selected") or "Deselected"
|
|
493
|
+
end
|
|
494
|
+
local stateName = Utility.formatStateName(incomingStateName)
|
|
495
|
+
local previousStateName = self.activeState
|
|
496
|
+
if previousStateName == stateName then
|
|
497
|
+
return
|
|
498
|
+
end
|
|
499
|
+
local currentIsSelected = self.isSelected
|
|
500
|
+
self.activeState = stateName
|
|
501
|
+
if stateName == "Deselected" then
|
|
502
|
+
self.isSelected = false
|
|
503
|
+
if currentIsSelected then
|
|
504
|
+
self.toggled:Fire(false, fromSource, sourceIcon)
|
|
505
|
+
self.deselected:Fire(fromSource, sourceIcon)
|
|
506
|
+
end
|
|
507
|
+
self:_setToggleItemsVisible(false, fromSource, sourceIcon)
|
|
508
|
+
elseif stateName == "Selected" then
|
|
509
|
+
self.isSelected = true
|
|
510
|
+
if not currentIsSelected then
|
|
511
|
+
self.toggled:Fire(true, fromSource, sourceIcon)
|
|
512
|
+
self.selected:Fire(fromSource, sourceIcon)
|
|
513
|
+
anyIconSelected:Fire(self, fromSource, sourceIcon)
|
|
514
|
+
end
|
|
515
|
+
self:_setToggleItemsVisible(true, fromSource, sourceIcon)
|
|
516
|
+
end
|
|
517
|
+
self.stateChanged:Fire(stateName, fromSource, sourceIcon)
|
|
518
|
+
end
|
|
519
|
+
|
|
520
|
+
function Icon:getInstance(name)
|
|
521
|
+
-- This enables us to easily retrieve instances located within the icon simply by passing its name.
|
|
522
|
+
-- Every important/significant instance is named uniquely therefore this is no worry of overlap.
|
|
523
|
+
-- We cache the result for more performant retrieval in the future.
|
|
524
|
+
local instance = self.cachedNamesToInstances[name]
|
|
525
|
+
if instance then
|
|
526
|
+
return instance
|
|
527
|
+
end
|
|
528
|
+
local function cacheInstance(childName, child)
|
|
529
|
+
local currentCache = self.cachedInstances[child]
|
|
530
|
+
if not currentCache then
|
|
531
|
+
local collectiveName = child:GetAttribute("Collective")
|
|
532
|
+
local cachedCollective = collectiveName and self.cachedCollectives[collectiveName]
|
|
533
|
+
if cachedCollective then
|
|
534
|
+
table.insert(cachedCollective, child)
|
|
535
|
+
end
|
|
536
|
+
self.cachedNamesToInstances[childName] = child
|
|
537
|
+
self.cachedInstances[child] = true
|
|
538
|
+
child.Destroying:Once(function()
|
|
539
|
+
self.cachedNamesToInstances[childName] = nil
|
|
540
|
+
self.cachedInstances[child] = nil
|
|
541
|
+
end)
|
|
542
|
+
end
|
|
543
|
+
end
|
|
544
|
+
local widget = self.widget
|
|
545
|
+
cacheInstance("Widget", widget)
|
|
546
|
+
if name == "Widget" then
|
|
547
|
+
return widget
|
|
548
|
+
end
|
|
549
|
+
|
|
550
|
+
local returnChild
|
|
551
|
+
local function scanChildren(parentInstance)
|
|
552
|
+
for _, child in pairs(parentInstance:GetChildren()) do
|
|
553
|
+
local widgetUID = child:GetAttribute("WidgetUID")
|
|
554
|
+
if widgetUID and widgetUID ~= self.UID then
|
|
555
|
+
-- This prevents instances within other icons from being recorded
|
|
556
|
+
-- (for instance when other icons are added to this icons menu)
|
|
557
|
+
continue
|
|
558
|
+
end
|
|
559
|
+
-- If the child is a fake placeholder instance (such as dropdowns, notices, etc)
|
|
560
|
+
-- then its important we scan the real original instance instead of this clone
|
|
561
|
+
local realChild = Themes.getRealInstance(child)
|
|
562
|
+
if realChild then
|
|
563
|
+
child = realChild
|
|
564
|
+
end
|
|
565
|
+
-- Finally scan its children
|
|
566
|
+
scanChildren(child)
|
|
567
|
+
if child:IsA("GuiBase") or child:IsA("UIBase") or child:IsA("ValueBase") then
|
|
568
|
+
local childName = child.Name
|
|
569
|
+
cacheInstance(childName, child)
|
|
570
|
+
if childName == name then
|
|
571
|
+
returnChild = child
|
|
572
|
+
end
|
|
573
|
+
end
|
|
574
|
+
end
|
|
575
|
+
end
|
|
576
|
+
scanChildren(widget)
|
|
577
|
+
return returnChild
|
|
578
|
+
end
|
|
579
|
+
|
|
580
|
+
function Icon:getCollective(name)
|
|
581
|
+
-- A collective is an array of instances within the Widget that have been
|
|
582
|
+
-- grouped together based on a given name. This just makes it easy
|
|
583
|
+
-- to act on multiple instances at once which share similar behaviours.
|
|
584
|
+
-- For instance, if we want to change the icons corner size, all corner instances
|
|
585
|
+
-- with the attribute "Collective" and value "WidgetCorner" could be updated
|
|
586
|
+
-- instantly by doing Themes.apply(icon, "WidgetCorner", newSize)
|
|
587
|
+
local collective = self.cachedCollectives[name]
|
|
588
|
+
if collective then
|
|
589
|
+
return collective
|
|
590
|
+
end
|
|
591
|
+
collective = {}
|
|
592
|
+
for instance, _ in pairs(self.cachedInstances) do
|
|
593
|
+
if instance:GetAttribute("Collective") == name then
|
|
594
|
+
table.insert(collective, instance)
|
|
595
|
+
end
|
|
596
|
+
end
|
|
597
|
+
self.cachedCollectives[name] = collective
|
|
598
|
+
return collective
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
function Icon:getInstanceOrCollective(collectiveOrInstanceName)
|
|
602
|
+
-- Similar to :getInstance but also accounts for 'Collectives', such as UICorners and returns
|
|
603
|
+
-- an array of instances instead of a single instance
|
|
604
|
+
local instances = {}
|
|
605
|
+
local instance = self:getInstance(collectiveOrInstanceName)
|
|
606
|
+
if instance then
|
|
607
|
+
table.insert(instances, instance)
|
|
608
|
+
end
|
|
609
|
+
if #instances == 0 then
|
|
610
|
+
instances = self:getCollective(collectiveOrInstanceName)
|
|
611
|
+
end
|
|
612
|
+
return instances
|
|
613
|
+
end
|
|
614
|
+
|
|
615
|
+
function Icon:getStateGroup(iconState)
|
|
616
|
+
local chosenState = iconState or self.activeState
|
|
617
|
+
local stateGroup = self.appearance[chosenState]
|
|
618
|
+
if not stateGroup then
|
|
619
|
+
stateGroup = {}
|
|
620
|
+
self.appearance[chosenState] = stateGroup
|
|
621
|
+
end
|
|
622
|
+
return stateGroup
|
|
623
|
+
end
|
|
624
|
+
|
|
625
|
+
function Icon:refreshAppearance(instance, specificProperty)
|
|
626
|
+
Themes.refresh(self, instance, specificProperty)
|
|
627
|
+
return self
|
|
628
|
+
end
|
|
629
|
+
|
|
630
|
+
function Icon:refresh()
|
|
631
|
+
self:refreshAppearance(self.widget)
|
|
632
|
+
self.updateSize:Fire()
|
|
633
|
+
return self
|
|
634
|
+
end
|
|
635
|
+
|
|
636
|
+
function Icon:updateParent()
|
|
637
|
+
local parentIcon = Icon.getIconByUID(self.parentIconUID)
|
|
638
|
+
if parentIcon then
|
|
639
|
+
parentIcon.updateSize:Fire()
|
|
640
|
+
end
|
|
641
|
+
end
|
|
642
|
+
|
|
643
|
+
function Icon:setBehaviour(collectiveOrInstanceName, property, callback, refreshAppearance)
|
|
644
|
+
-- You can specify your own custom callback to handle custom logic just before
|
|
645
|
+
-- an instances property is changed by using :setBehaviour()
|
|
646
|
+
local key = collectiveOrInstanceName.."-"..property
|
|
647
|
+
self.customBehaviours[key] = callback
|
|
648
|
+
if refreshAppearance then
|
|
649
|
+
local instances = self:getInstanceOrCollective(collectiveOrInstanceName)
|
|
650
|
+
for _, instance in pairs(instances) do
|
|
651
|
+
self:refreshAppearance(instance, property)
|
|
652
|
+
end
|
|
653
|
+
end
|
|
654
|
+
end
|
|
655
|
+
|
|
656
|
+
function Icon:modifyTheme(modifications, customModificationUID)
|
|
657
|
+
local modificationUID = Themes.modify(self, modifications, customModificationUID)
|
|
658
|
+
return self, modificationUID
|
|
659
|
+
end
|
|
660
|
+
|
|
661
|
+
function Icon:modifyChildTheme(modifications, modificationUID)
|
|
662
|
+
-- Same as modifyTheme except for its children (i.e. icons
|
|
663
|
+
-- within its dropdown or menu)
|
|
664
|
+
self.childModifications = modifications
|
|
665
|
+
self.childModificationsUID = modificationUID
|
|
666
|
+
for childIconUID, _ in pairs(self.childIconsDict) do
|
|
667
|
+
local childIcon = Icon.getIconByUID(childIconUID)
|
|
668
|
+
childIcon:modifyTheme(modifications, modificationUID)
|
|
669
|
+
end
|
|
670
|
+
self.childThemeModified:Fire()
|
|
671
|
+
return self
|
|
672
|
+
end
|
|
673
|
+
|
|
674
|
+
function Icon:removeModification(modificationUID)
|
|
675
|
+
Themes.remove(self, modificationUID)
|
|
676
|
+
return self
|
|
677
|
+
end
|
|
678
|
+
|
|
679
|
+
function Icon:removeModificationWith(instanceName, property, state)
|
|
680
|
+
Themes.removeWith(self, instanceName, property, state)
|
|
681
|
+
return self
|
|
682
|
+
end
|
|
683
|
+
|
|
684
|
+
function Icon:setTheme(theme)
|
|
685
|
+
Themes.set(self, theme)
|
|
686
|
+
return self
|
|
687
|
+
end
|
|
688
|
+
|
|
689
|
+
function Icon:setEnabled(bool)
|
|
690
|
+
self.isEnabled = bool
|
|
691
|
+
self.enabled = self.isEnabled
|
|
692
|
+
self.widget.Visible = bool
|
|
693
|
+
self:updateParent()
|
|
694
|
+
return self
|
|
695
|
+
end
|
|
696
|
+
|
|
697
|
+
function Icon:select(fromSource, sourceIcon)
|
|
698
|
+
self:setState("Selected", fromSource, sourceIcon)
|
|
699
|
+
return self
|
|
700
|
+
end
|
|
701
|
+
|
|
702
|
+
function Icon:deselect(fromSource, sourceIcon)
|
|
703
|
+
self:setState("Deselected", fromSource, sourceIcon)
|
|
704
|
+
return self
|
|
705
|
+
end
|
|
706
|
+
|
|
707
|
+
function Icon:notify(customClearSignal, noticeId)
|
|
708
|
+
-- Generates a notification which appears in the top right of the icon. Useful for example for prompting
|
|
709
|
+
-- users of changes/updates within your UI such as a Catalog
|
|
710
|
+
-- 'customClearSignal' is a signal object (e.g. icon.deselected) or
|
|
711
|
+
-- Roblox event (e.g. Instance.new("BindableEvent").Event)
|
|
712
|
+
local notice = self.notice
|
|
713
|
+
if not notice then
|
|
714
|
+
notice = require(elements.Notice)(self, Icon)
|
|
715
|
+
self.notice = notice
|
|
716
|
+
end
|
|
717
|
+
self.noticeStarted:Fire(customClearSignal, noticeId)
|
|
718
|
+
return self
|
|
719
|
+
end
|
|
720
|
+
|
|
721
|
+
function Icon:clearNotices()
|
|
722
|
+
self.endNotices:Fire()
|
|
723
|
+
return self
|
|
724
|
+
end
|
|
725
|
+
|
|
726
|
+
function Icon:disableOverlay(bool)
|
|
727
|
+
self.overlayDisabled = bool
|
|
728
|
+
return self
|
|
729
|
+
end
|
|
730
|
+
Icon.disableStateOverlay = Icon.disableOverlay
|
|
731
|
+
|
|
732
|
+
function Icon:setImage(imageId, iconState)
|
|
733
|
+
self:modifyTheme({"IconImage", "Image", imageId, iconState})
|
|
734
|
+
|
|
735
|
+
-- This code ensures icon images are preloaded if they haven't been fetched yet
|
|
736
|
+
task.spawn(function()
|
|
737
|
+
local newIdContent = if tonumber(imageId) then `rbxassetid://{imageId}` else imageId
|
|
738
|
+
local initialAssetFetchStatus = ContentProvider:GetAssetFetchStatus(newIdContent)
|
|
739
|
+
|
|
740
|
+
if initialAssetFetchStatus ~= Enum.AssetFetchStatus.Success then
|
|
741
|
+
pcall(ContentProvider.PreloadAsync, ContentProvider, { newIdContent })
|
|
742
|
+
end
|
|
743
|
+
end)
|
|
744
|
+
|
|
745
|
+
return self
|
|
746
|
+
end
|
|
747
|
+
|
|
748
|
+
function Icon:setLabel(text, iconState)
|
|
749
|
+
self:modifyTheme({"IconLabel", "Text", text, iconState})
|
|
750
|
+
return self
|
|
751
|
+
end
|
|
752
|
+
|
|
753
|
+
function Icon:setOrder(int, iconState)
|
|
754
|
+
-- We multiply by 100 to allow for custom increments inbetween
|
|
755
|
+
-- (.01, .02, etc) as LayoutOrders only support integers
|
|
756
|
+
local newInt = int*100
|
|
757
|
+
self:modifyTheme({"IconSpot", "LayoutOrder", newInt, iconState})
|
|
758
|
+
self:modifyTheme({"Widget", "LayoutOrder", newInt, iconState})
|
|
759
|
+
return self
|
|
760
|
+
end
|
|
761
|
+
|
|
762
|
+
function Icon:setCornerRadius(udim, iconState)
|
|
763
|
+
self:modifyTheme({"IconCorners", "CornerRadius", udim, iconState})
|
|
764
|
+
return self
|
|
765
|
+
end
|
|
766
|
+
|
|
767
|
+
function Icon:align(leftCenterOrRight, isFromParentIcon)
|
|
768
|
+
-- Determines the side of the screen the icon will be ordered
|
|
769
|
+
local direction = tostring(leftCenterOrRight):lower()
|
|
770
|
+
if direction == "mid" or direction == "centre" then
|
|
771
|
+
direction = "center"
|
|
772
|
+
end
|
|
773
|
+
if direction ~= "left" and direction ~= "center" and direction ~= "right" then
|
|
774
|
+
direction = "left"
|
|
775
|
+
end
|
|
776
|
+
local screenGui = (direction == "center" and Icon.container.TopbarCentered) or Icon.container.TopbarStandard
|
|
777
|
+
local holders = screenGui.Holders
|
|
778
|
+
local finalDirection = string.upper(string.sub(direction, 1, 1))..string.sub(direction, 2)
|
|
779
|
+
if not isFromParentIcon then
|
|
780
|
+
self.originalAlignment = finalDirection
|
|
781
|
+
end
|
|
782
|
+
local joinedFrame = self.joinedFrame
|
|
783
|
+
local alignmentHolder = holders[finalDirection]
|
|
784
|
+
self.screenGui = screenGui
|
|
785
|
+
self.alignmentHolder = alignmentHolder
|
|
786
|
+
if not self.isDestroyed then
|
|
787
|
+
self.widget.Parent = joinedFrame or alignmentHolder
|
|
788
|
+
end
|
|
789
|
+
self.alignment = finalDirection
|
|
790
|
+
self.alignmentChanged:Fire(finalDirection)
|
|
791
|
+
Icon.iconChanged:Fire(self)
|
|
792
|
+
return self
|
|
793
|
+
end
|
|
794
|
+
Icon.setAlignment = Icon.align
|
|
795
|
+
|
|
796
|
+
function Icon:setLeft()
|
|
797
|
+
self:setAlignment("Left")
|
|
798
|
+
return self
|
|
799
|
+
end
|
|
800
|
+
|
|
801
|
+
function Icon:setMid()
|
|
802
|
+
self:setAlignment("Center")
|
|
803
|
+
return self
|
|
804
|
+
end
|
|
805
|
+
|
|
806
|
+
function Icon:setRight()
|
|
807
|
+
self:setAlignment("Right")
|
|
808
|
+
return self
|
|
809
|
+
end
|
|
810
|
+
|
|
811
|
+
function Icon:setWidth(offsetMinimum, iconState)
|
|
812
|
+
-- This sets a minimum X offset size for the widget, useful
|
|
813
|
+
-- for example if you're constantly changing the label
|
|
814
|
+
-- but don't want the icon to resize every time
|
|
815
|
+
self:modifyTheme({"Widget", "DesiredWidth", offsetMinimum, iconState})
|
|
816
|
+
return self
|
|
817
|
+
end
|
|
818
|
+
|
|
819
|
+
function Icon:setImageScale(number, iconState)
|
|
820
|
+
self:modifyTheme({"IconImageScale", "Value", number, iconState})
|
|
821
|
+
return self
|
|
822
|
+
end
|
|
823
|
+
|
|
824
|
+
function Icon:setImageRatio(number, iconState)
|
|
825
|
+
self:modifyTheme({"IconImageRatio", "AspectRatio", number, iconState})
|
|
826
|
+
return self
|
|
827
|
+
end
|
|
828
|
+
|
|
829
|
+
function Icon:setTextSize(number, iconState)
|
|
830
|
+
self:modifyTheme({"IconLabel", "TextSize", number, iconState})
|
|
831
|
+
return self
|
|
832
|
+
end
|
|
833
|
+
|
|
834
|
+
function Icon:setTextFont(font, fontWeight, fontStyle, iconState)
|
|
835
|
+
fontWeight = fontWeight or Enum.FontWeight.Regular
|
|
836
|
+
fontStyle = fontStyle or Enum.FontStyle.Normal
|
|
837
|
+
local fontFace
|
|
838
|
+
local fontType = typeof(font)
|
|
839
|
+
if fontType == "number" then
|
|
840
|
+
fontFace = Font.fromId(font, fontWeight, fontStyle)
|
|
841
|
+
elseif fontType == "EnumItem" then
|
|
842
|
+
fontFace = Font.fromEnum(font)
|
|
843
|
+
elseif fontType == "string" then
|
|
844
|
+
if not font:match("rbxasset") then
|
|
845
|
+
fontFace = Font.fromName(font, fontWeight, fontStyle)
|
|
846
|
+
end
|
|
847
|
+
end
|
|
848
|
+
if not fontFace then
|
|
849
|
+
fontFace = Font.new(font, fontWeight, fontStyle)
|
|
850
|
+
end
|
|
851
|
+
self:modifyTheme({"IconLabel", "FontFace", fontFace, iconState})
|
|
852
|
+
return self
|
|
853
|
+
end
|
|
854
|
+
|
|
855
|
+
function Icon:setTextColor(Color, iconState)
|
|
856
|
+
if Color == nil or Color == "" or (type(Color) ~= "userdata" or typeof(Color) ~= "Color3") then
|
|
857
|
+
if Color ~= nil and Color ~= "" then
|
|
858
|
+
warn("setTextColor item must be a Color3 value! Changed the color to white.")
|
|
859
|
+
end
|
|
860
|
+
Color = Color3.fromRGB(255, 255, 255)
|
|
861
|
+
end
|
|
862
|
+
|
|
863
|
+
self:modifyTheme({"IconLabel", "TextColor3", Color, iconState})
|
|
864
|
+
return self
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
function Icon:bindToggleItem(guiObjectOrLayerCollector)
|
|
868
|
+
if not guiObjectOrLayerCollector:IsA("GuiObject") and not guiObjectOrLayerCollector:IsA("LayerCollector") then
|
|
869
|
+
error("Toggle item must be a GuiObject or LayerCollector!")
|
|
870
|
+
end
|
|
871
|
+
self.toggleItems[guiObjectOrLayerCollector] = true
|
|
872
|
+
self:_updateSelectionInstances()
|
|
873
|
+
return self
|
|
874
|
+
end
|
|
875
|
+
|
|
876
|
+
function Icon:unbindToggleItem(guiObjectOrLayerCollector)
|
|
877
|
+
self.toggleItems[guiObjectOrLayerCollector] = nil
|
|
878
|
+
self:_updateSelectionInstances()
|
|
879
|
+
return self
|
|
880
|
+
end
|
|
881
|
+
|
|
882
|
+
function Icon:_updateSelectionInstances()
|
|
883
|
+
-- This is to assist with controller navigation and selection
|
|
884
|
+
-- It converts the value true to an array
|
|
885
|
+
for guiObjectOrLayerCollector, _ in pairs(self.toggleItems) do
|
|
886
|
+
local buttonInstancesArray = {}
|
|
887
|
+
for _, instance in pairs(guiObjectOrLayerCollector:GetDescendants()) do
|
|
888
|
+
if (instance:IsA("TextButton") or instance:IsA("ImageButton")) and instance.Active then
|
|
889
|
+
table.insert(buttonInstancesArray, instance)
|
|
890
|
+
end
|
|
891
|
+
end
|
|
892
|
+
self.toggleItems[guiObjectOrLayerCollector] = buttonInstancesArray
|
|
893
|
+
end
|
|
894
|
+
end
|
|
895
|
+
|
|
896
|
+
function Icon:_setToggleItemsVisible(bool, fromSource, sourceIcon)
|
|
897
|
+
for toggleItem, _ in pairs(self.toggleItems) do
|
|
898
|
+
if not sourceIcon or sourceIcon == self or sourceIcon.toggleItems[toggleItem] == nil then
|
|
899
|
+
local property = "Visible"
|
|
900
|
+
if toggleItem:IsA("LayerCollector") then
|
|
901
|
+
property = "Enabled"
|
|
902
|
+
end
|
|
903
|
+
toggleItem[property] = bool
|
|
904
|
+
end
|
|
905
|
+
end
|
|
906
|
+
end
|
|
907
|
+
|
|
908
|
+
function Icon:bindEvent(iconEventName, eventFunction)
|
|
909
|
+
local event = self[iconEventName]
|
|
910
|
+
assert(event and typeof(event) == "table" and event.Connect, "argument[1] must be a valid topbarplus icon event name!")
|
|
911
|
+
assert(typeof(eventFunction) == "function", "argument[2] must be a function!")
|
|
912
|
+
self.bindedEvents[iconEventName] = event:Connect(function(...)
|
|
913
|
+
eventFunction(self, ...)
|
|
914
|
+
end)
|
|
915
|
+
return self
|
|
916
|
+
end
|
|
917
|
+
|
|
918
|
+
function Icon:unbindEvent(iconEventName)
|
|
919
|
+
local eventConnection = self.bindedEvents[iconEventName]
|
|
920
|
+
if eventConnection then
|
|
921
|
+
eventConnection:Disconnect()
|
|
922
|
+
self.bindedEvents[iconEventName] = nil
|
|
923
|
+
end
|
|
924
|
+
return self
|
|
925
|
+
end
|
|
926
|
+
|
|
927
|
+
function Icon:bindToggleKey(keyCodeEnum)
|
|
928
|
+
assert(typeof(keyCodeEnum) == "EnumItem", "argument[1] must be a KeyCode EnumItem!")
|
|
929
|
+
self.bindedToggleKeys[keyCodeEnum] = true
|
|
930
|
+
self.toggleKeyAdded:Fire(keyCodeEnum)
|
|
931
|
+
self:setCaption("_hotkey_")
|
|
932
|
+
return self
|
|
933
|
+
end
|
|
934
|
+
|
|
935
|
+
function Icon:unbindToggleKey(keyCodeEnum)
|
|
936
|
+
assert(typeof(keyCodeEnum) == "EnumItem", "argument[1] must be a KeyCode EnumItem!")
|
|
937
|
+
self.bindedToggleKeys[keyCodeEnum] = nil
|
|
938
|
+
return self
|
|
939
|
+
end
|
|
940
|
+
|
|
941
|
+
function Icon:call(callback, ...)
|
|
942
|
+
local packedArgs = table.pack(...)
|
|
943
|
+
task.spawn(function()
|
|
944
|
+
callback(self, table.unpack(packedArgs))
|
|
945
|
+
end)
|
|
946
|
+
return self
|
|
947
|
+
end
|
|
948
|
+
|
|
949
|
+
function Icon:addToJanitor(callback, methodName, index)
|
|
950
|
+
self.janitor:add(callback, methodName, index)
|
|
951
|
+
return self
|
|
952
|
+
end
|
|
953
|
+
|
|
954
|
+
function Icon:lock()
|
|
955
|
+
-- This disables all user inputs related to the icon (such as clicking buttons, pressing keys, etc)
|
|
956
|
+
local clickRegion = self:getInstance("ClickRegion")
|
|
957
|
+
clickRegion.Visible = false
|
|
958
|
+
self.locked = true
|
|
959
|
+
return self
|
|
960
|
+
end
|
|
961
|
+
|
|
962
|
+
function Icon:unlock()
|
|
963
|
+
local clickRegion = self:getInstance("ClickRegion")
|
|
964
|
+
clickRegion.Visible = true
|
|
965
|
+
self.locked = false
|
|
966
|
+
return self
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
function Icon:debounce(seconds)
|
|
970
|
+
self:lock()
|
|
971
|
+
task.wait(seconds)
|
|
972
|
+
self:unlock()
|
|
973
|
+
return self
|
|
974
|
+
end
|
|
975
|
+
|
|
976
|
+
function Icon:autoDeselect(bool)
|
|
977
|
+
-- When set to true the icon will deselect itself automatically whenever
|
|
978
|
+
-- another icon is selected
|
|
979
|
+
if bool == nil then
|
|
980
|
+
bool = true
|
|
981
|
+
end
|
|
982
|
+
self.deselectWhenOtherIconSelected = bool
|
|
983
|
+
return self
|
|
984
|
+
end
|
|
985
|
+
|
|
986
|
+
function Icon:oneClick(bool)
|
|
987
|
+
-- When set to true the icon will automatically deselect when selected, this creates
|
|
988
|
+
-- the effect of a single click button
|
|
989
|
+
local singleClickJanitor = self.singleClickJanitor
|
|
990
|
+
singleClickJanitor:clean()
|
|
991
|
+
if bool or bool == nil then
|
|
992
|
+
singleClickJanitor:add(self.selected:Connect(function()
|
|
993
|
+
self:deselect("OneClick", self)
|
|
994
|
+
end))
|
|
995
|
+
end
|
|
996
|
+
self.oneClickEnabled = true
|
|
997
|
+
return self
|
|
998
|
+
end
|
|
999
|
+
|
|
1000
|
+
function Icon:setCaption(text)
|
|
1001
|
+
if text == "_hotkey_" and (self.captionText) then
|
|
1002
|
+
return self
|
|
1003
|
+
end
|
|
1004
|
+
local captionJanitor = self.captionJanitor
|
|
1005
|
+
self.captionJanitor:clean()
|
|
1006
|
+
if not text or text == "" then
|
|
1007
|
+
self.caption = nil
|
|
1008
|
+
self.captionText = nil
|
|
1009
|
+
return self
|
|
1010
|
+
end
|
|
1011
|
+
local caption = captionJanitor:add(require(elements.Caption)(self))
|
|
1012
|
+
caption:SetAttribute("CaptionText", text)
|
|
1013
|
+
self.caption = caption
|
|
1014
|
+
self.captionText = text
|
|
1015
|
+
return self
|
|
1016
|
+
end
|
|
1017
|
+
|
|
1018
|
+
function Icon:setCaptionHint(keyCodeEnum)
|
|
1019
|
+
assert(typeof(keyCodeEnum) == "EnumItem", "argument[1] must be a KeyCode EnumItem!")
|
|
1020
|
+
self.fakeToggleKey = keyCodeEnum
|
|
1021
|
+
self.fakeToggleKeyChanged:Fire(keyCodeEnum)
|
|
1022
|
+
self:setCaption("_hotkey_")
|
|
1023
|
+
return self
|
|
1024
|
+
end
|
|
1025
|
+
|
|
1026
|
+
function Icon:leave()
|
|
1027
|
+
local joinJanitor = self.joinJanitor
|
|
1028
|
+
joinJanitor:clean()
|
|
1029
|
+
return self
|
|
1030
|
+
end
|
|
1031
|
+
|
|
1032
|
+
function Icon:joinMenu(parentIcon)
|
|
1033
|
+
Utility.joinFeature(self, parentIcon, parentIcon.menuIcons, parentIcon:getInstance("Menu"))
|
|
1034
|
+
parentIcon.menuChildAdded:Fire(self)
|
|
1035
|
+
return self
|
|
1036
|
+
end
|
|
1037
|
+
|
|
1038
|
+
function Icon:setMenu(arrayOfIcons)
|
|
1039
|
+
self.menuSet:Fire(arrayOfIcons)
|
|
1040
|
+
return self
|
|
1041
|
+
end
|
|
1042
|
+
|
|
1043
|
+
function Icon:setFixedMenu(arrayOfIcons)
|
|
1044
|
+
self:freezeMenu(arrayOfIcons)
|
|
1045
|
+
self:setMenu(arrayOfIcons)
|
|
1046
|
+
end
|
|
1047
|
+
Icon.setFrozenMenu = Icon.setFixedMenu
|
|
1048
|
+
|
|
1049
|
+
function Icon:freezeMenu()
|
|
1050
|
+
-- A frozen menu is a menu which is permanently locked in the
|
|
1051
|
+
-- the selected state (with its toggle hidden)
|
|
1052
|
+
self:select("FrozenMenu", self)
|
|
1053
|
+
self:bindEvent("deselected", function(icon)
|
|
1054
|
+
icon:select("FrozenMenu", self)
|
|
1055
|
+
end)
|
|
1056
|
+
self:modifyTheme({"IconSpot", "Visible", false})
|
|
1057
|
+
end
|
|
1058
|
+
|
|
1059
|
+
function Icon:joinDropdown(parentIcon)
|
|
1060
|
+
parentIcon:getDropdown()
|
|
1061
|
+
Utility.joinFeature(self, parentIcon, parentIcon.dropdownIcons, parentIcon:getInstance("DropdownScroller"))
|
|
1062
|
+
parentIcon.dropdownChildAdded:Fire(self)
|
|
1063
|
+
return self
|
|
1064
|
+
end
|
|
1065
|
+
|
|
1066
|
+
function Icon:getDropdown()
|
|
1067
|
+
local dropdown = self.dropdown
|
|
1068
|
+
if not dropdown then
|
|
1069
|
+
dropdown = require(elements.Dropdown)(self)
|
|
1070
|
+
self.dropdown = dropdown
|
|
1071
|
+
self:clipOutside(dropdown)
|
|
1072
|
+
end
|
|
1073
|
+
return dropdown
|
|
1074
|
+
end
|
|
1075
|
+
|
|
1076
|
+
function Icon:setDropdown(arrayOfIcons)
|
|
1077
|
+
self:getDropdown()
|
|
1078
|
+
self.dropdownSet:Fire(arrayOfIcons)
|
|
1079
|
+
return self
|
|
1080
|
+
end
|
|
1081
|
+
|
|
1082
|
+
function Icon:clipOutside(instance)
|
|
1083
|
+
-- This is essential for items such as notices and dropdowns which will exceed the bounds of the widget. This is an issue
|
|
1084
|
+
-- because the widget must have ClipsDescendents enabled to hide items for instance when the menu is closing or opening.
|
|
1085
|
+
-- This creates an invisible frame which matches the size and position of the instance, then the instance is parented outside of
|
|
1086
|
+
-- the widget and tracks the clone to match its size and position. In order for themes, etc to work the applying system checks
|
|
1087
|
+
-- to see if an instance is a clone, then if it is, it applies it to the original instance instead of the clone.
|
|
1088
|
+
local instanceClone = Utility.clipOutside(self, instance)
|
|
1089
|
+
self:refreshAppearance(instance)
|
|
1090
|
+
return self, instanceClone
|
|
1091
|
+
end
|
|
1092
|
+
|
|
1093
|
+
function Icon:setIndicator(keyCode)
|
|
1094
|
+
-- An indicator is a direction button prompt with an image of the given keycode. This is useful for instance
|
|
1095
|
+
-- with controllers to show the user what button to press to highlight the topbar. You don't need
|
|
1096
|
+
-- to set an indicator for controllers as this is handled internally within the Gamepad module
|
|
1097
|
+
local indicator = self.indicator
|
|
1098
|
+
if not indicator then
|
|
1099
|
+
indicator = self.janitor:add(require(elements.Indicator)(self, Icon))
|
|
1100
|
+
self.indicator = indicator
|
|
1101
|
+
end
|
|
1102
|
+
self.indicatorSet:Fire(keyCode)
|
|
1103
|
+
end
|
|
1104
|
+
|
|
1105
|
+
function Icon:convertLabelToNumberSpinner(numberSpinner, callback)
|
|
1106
|
+
task.defer(function()
|
|
1107
|
+
|
|
1108
|
+
local label = self:getInstance("IconLabel")
|
|
1109
|
+
label.Transparency = 1
|
|
1110
|
+
numberSpinner.Parent = label.Parent
|
|
1111
|
+
numberSpinner.Size = UDim2.fromScale(1, 1)
|
|
1112
|
+
numberSpinner.AnchorPoint = Vector2.new(0.5, 0.5)
|
|
1113
|
+
numberSpinner.Position = UDim2.new(0.5, 0, 0.5, 0)
|
|
1114
|
+
numberSpinner.TextXAlignment = Enum.TextXAlignment.Center
|
|
1115
|
+
numberSpinner.ClipsDescendants = false
|
|
1116
|
+
|
|
1117
|
+
local propertiesToChangeLabel = {
|
|
1118
|
+
"FontFace",
|
|
1119
|
+
"BorderSizePixel",
|
|
1120
|
+
"BorderColor3",
|
|
1121
|
+
"Rotation",
|
|
1122
|
+
"TextStrokeTransparency",
|
|
1123
|
+
"TextStrokeColor3",
|
|
1124
|
+
"TextStrokeTransparency",
|
|
1125
|
+
"TextColor3",
|
|
1126
|
+
}
|
|
1127
|
+
for _, property in ipairs(propertiesToChangeLabel) do
|
|
1128
|
+
numberSpinner[property] = label[property]
|
|
1129
|
+
self:addToJanitor(label:GetPropertyChangedSignal(property):Connect(function()
|
|
1130
|
+
numberSpinner[property] = label[property]
|
|
1131
|
+
end))
|
|
1132
|
+
end
|
|
1133
|
+
|
|
1134
|
+
local minDigits = 0
|
|
1135
|
+
local maxDigits = 8
|
|
1136
|
+
local function getSpinnerSizeAndDigitCount()
|
|
1137
|
+
local TotalSize = 0
|
|
1138
|
+
local numOfDigits = 0
|
|
1139
|
+
for i, child in numberSpinner.Frame:GetChildren() do
|
|
1140
|
+
local name = string.lower(child.Name)
|
|
1141
|
+
if name == "digit" then
|
|
1142
|
+
TotalSize += child.AbsoluteSize.X
|
|
1143
|
+
numOfDigits += 1
|
|
1144
|
+
elseif name == "prefix" or name == "suffix" or name == "comma" then
|
|
1145
|
+
if child.Text ~= "" then
|
|
1146
|
+
TotalSize += child.AbsoluteSize.X
|
|
1147
|
+
numOfDigits += 1
|
|
1148
|
+
end
|
|
1149
|
+
end
|
|
1150
|
+
end
|
|
1151
|
+
return TotalSize, numOfDigits
|
|
1152
|
+
end
|
|
1153
|
+
|
|
1154
|
+
local function getLabelParentContainerXSize()
|
|
1155
|
+
local firstParent = label.Parent
|
|
1156
|
+
local nextParent = firstParent and firstParent.Parent
|
|
1157
|
+
if nextParent == nil then
|
|
1158
|
+
return 0
|
|
1159
|
+
end
|
|
1160
|
+
if nextParent.IconImage.Visible == true then
|
|
1161
|
+
return numberSpinner.Frame.AbsoluteSize.X + label.Parent.Parent.IconImage.AbsoluteSize.X
|
|
1162
|
+
else
|
|
1163
|
+
return nextParent.AbsoluteSize.X
|
|
1164
|
+
end
|
|
1165
|
+
end
|
|
1166
|
+
local function getNumberSpinnerXSize()
|
|
1167
|
+
return numberSpinner.Frame.AbsoluteSize.X
|
|
1168
|
+
end
|
|
1169
|
+
|
|
1170
|
+
local function adjustSize()
|
|
1171
|
+
local totalDigitXSize, numOfDigits = getSpinnerSizeAndDigitCount()
|
|
1172
|
+
if numOfDigits < 18 then
|
|
1173
|
+
self:setLabel(numberSpinner.Value)
|
|
1174
|
+
end
|
|
1175
|
+
|
|
1176
|
+
local NumberSpinnerXSize = getNumberSpinnerXSize()
|
|
1177
|
+
|
|
1178
|
+
while totalDigitXSize < NumberSpinnerXSize and self.isDestroyed ~= true do
|
|
1179
|
+
task.wait(0.05)
|
|
1180
|
+
if numOfDigits > minDigits and numOfDigits < maxDigits then
|
|
1181
|
+
numberSpinner.TextSize = label.TextSize
|
|
1182
|
+
break
|
|
1183
|
+
else
|
|
1184
|
+
numberSpinner.TextSize += 1
|
|
1185
|
+
end
|
|
1186
|
+
|
|
1187
|
+
NumberSpinnerXSize = getNumberSpinnerXSize()
|
|
1188
|
+
totalDigitXSize, numOfDigits = getSpinnerSizeAndDigitCount()
|
|
1189
|
+
end
|
|
1190
|
+
|
|
1191
|
+
local labelParentContainerXSize = getLabelParentContainerXSize()
|
|
1192
|
+
while totalDigitXSize > labelParentContainerXSize and self.isDestroyed ~= true do
|
|
1193
|
+
task.wait(0.05)
|
|
1194
|
+
if numOfDigits < maxDigits and numOfDigits > minDigits then
|
|
1195
|
+
numberSpinner.TextSize = label.TextSize
|
|
1196
|
+
break
|
|
1197
|
+
else
|
|
1198
|
+
numberSpinner.TextSize -= 1
|
|
1199
|
+
end
|
|
1200
|
+
|
|
1201
|
+
labelParentContainerXSize = getLabelParentContainerXSize()
|
|
1202
|
+
totalDigitXSize, numOfDigits = getSpinnerSizeAndDigitCount()
|
|
1203
|
+
end
|
|
1204
|
+
end
|
|
1205
|
+
|
|
1206
|
+
self:addToJanitor(numberSpinner.Frame.ChildAdded:Connect(adjustSize))
|
|
1207
|
+
self:addToJanitor(numberSpinner.Frame.ChildRemoved:Connect(adjustSize))
|
|
1208
|
+
self:addToJanitor(self.iconAdded:Connect(function()
|
|
1209
|
+
task.wait(1)
|
|
1210
|
+
adjustSize()
|
|
1211
|
+
end))
|
|
1212
|
+
|
|
1213
|
+
self:updateParent()
|
|
1214
|
+
|
|
1215
|
+
-- This corrects text to the size of a normal label
|
|
1216
|
+
numberSpinner.Name = "LabelSpinner"
|
|
1217
|
+
numberSpinner.Prefix = "$"
|
|
1218
|
+
numberSpinner.Commas = true
|
|
1219
|
+
numberSpinner.Decimals = 0
|
|
1220
|
+
numberSpinner.Duration = 0.25
|
|
1221
|
+
numberSpinner.Value = 10
|
|
1222
|
+
task.wait(0.2)
|
|
1223
|
+
|
|
1224
|
+
if typeof(callback) == "function" then
|
|
1225
|
+
callback()
|
|
1226
|
+
end
|
|
1227
|
+
|
|
1228
|
+
end)
|
|
1229
|
+
return self
|
|
1230
|
+
end
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
|
|
1234
|
+
-- DESTROY/CLEANUP
|
|
1235
|
+
function Icon:destroy()
|
|
1236
|
+
if self.isDestroyed then
|
|
1237
|
+
return
|
|
1238
|
+
end
|
|
1239
|
+
self:clearNotices()
|
|
1240
|
+
if self.parentIconUID then
|
|
1241
|
+
self:leave()
|
|
1242
|
+
end
|
|
1243
|
+
self.isDestroyed = true
|
|
1244
|
+
self.janitor:clean()
|
|
1245
|
+
Icon.iconRemoved:Fire(self)
|
|
1246
|
+
end
|
|
1247
|
+
Icon.Destroy = Icon.destroy
|
|
1248
|
+
|
|
1249
|
+
return Icon :: Types.StaticIcon
|