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.
Files changed (760) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/LICENSE +21 -0
  3. package/README.md +119 -0
  4. package/bin/cluau.js +4 -0
  5. package/bin/cluaupp.js +4 -0
  6. package/docs/README.md +20 -0
  7. package/docs/architecture.md +110 -0
  8. package/docs/cli.md +69 -0
  9. package/docs/comparison.md +37 -0
  10. package/docs/config.md +31 -0
  11. package/docs/cpp-advanced.md +71 -0
  12. package/docs/cpp-const.md +52 -0
  13. package/docs/cpp-organization.md +61 -0
  14. package/docs/cpp-safety.md +58 -0
  15. package/docs/cpp-types.md +66 -0
  16. package/docs/getting-started.md +169 -0
  17. package/docs/intro.md +37 -0
  18. package/docs/libraries.md +77 -0
  19. package/docs/roblox-api.md +81 -0
  20. package/docs/syntax.md +131 -0
  21. package/include/cluaupp/datatypes.hpp +581 -0
  22. package/include/cluaupp/generated/enums.hpp +4920 -0
  23. package/include/cluaupp/generated/instances.hpp +12489 -0
  24. package/include/cluaupp/libs/chrono.hpp +26 -0
  25. package/include/cluaupp/libs/cmdr.hpp +16 -0
  26. package/include/cluaupp/libs/dataservice.hpp +141 -0
  27. package/include/cluaupp/libs/display.hpp +13 -0
  28. package/include/cluaupp/libs/ezvisual.hpp +18 -0
  29. package/include/cluaupp/libs/formatnumber.hpp +15 -0
  30. package/include/cluaupp/libs/fusion.hpp +41 -0
  31. package/include/cluaupp/libs/iris.hpp +40 -0
  32. package/include/cluaupp/libs/janitor.hpp +35 -0
  33. package/include/cluaupp/libs/math.hpp +14 -0
  34. package/include/cluaupp/libs/module3d.hpp +25 -0
  35. package/include/cluaupp/libs/net.hpp +42 -0
  36. package/include/cluaupp/libs/promise.hpp +30 -0
  37. package/include/cluaupp/libs/spring.hpp +18 -0
  38. package/include/cluaupp/libs/statemachine.hpp +19 -0
  39. package/include/cluaupp/libs/stickybillboard.hpp +14 -0
  40. package/include/cluaupp/libs/topbarplus.hpp +29 -0
  41. package/include/cluaupp/libs/twinkle.hpp +15 -0
  42. package/include/cluaupp/libs/vfx.hpp +13 -0
  43. package/include/cluaupp/libs.hpp +25 -0
  44. package/include/cluaupp/roblox.hpp +28 -0
  45. package/package.json +65 -0
  46. package/runtime/ArrayIndexer/init.luau +144 -0
  47. package/runtime/Chrono/Client/ClientClock.luau +202 -0
  48. package/runtime/Chrono/Client/InterpolationBuffer.luau +74 -0
  49. package/runtime/Chrono/Client/ModelResolver.luau +53 -0
  50. package/runtime/Chrono/Client/Player.luau +113 -0
  51. package/runtime/Chrono/Client/Receiver.luau +395 -0
  52. package/runtime/Chrono/Client/Replicate.luau +333 -0
  53. package/runtime/Chrono/Client/Sender.luau +205 -0
  54. package/runtime/Chrono/LICENSE +21 -0
  55. package/runtime/Chrono/Server/EntityGrid.luau +299 -0
  56. package/runtime/Chrono/Server/Player.luau +141 -0
  57. package/runtime/Chrono/Server/Receiver.luau +287 -0
  58. package/runtime/Chrono/Server/Replicate.luau +415 -0
  59. package/runtime/Chrono/Server/Sender.luau +306 -0
  60. package/runtime/Chrono/Server/ServerClock.luau +50 -0
  61. package/runtime/Chrono/Shared/ApplyMounts.luau +137 -0
  62. package/runtime/Chrono/Shared/Bin.luau +31 -0
  63. package/runtime/Chrono/Shared/ClockUnwrap.luau +70 -0
  64. package/runtime/Chrono/Shared/Config.luau +264 -0
  65. package/runtime/Chrono/Shared/Entity.luau +1016 -0
  66. package/runtime/Chrono/Shared/Events.luau +39 -0
  67. package/runtime/Chrono/Shared/Holder.luau +210 -0
  68. package/runtime/Chrono/Shared/InterpolationMath.luau +51 -0
  69. package/runtime/Chrono/Shared/ModelHelper.luau +122 -0
  70. package/runtime/Chrono/Shared/Remotes/ClientClockRelay.model.json +3 -0
  71. package/runtime/Chrono/Shared/Remotes/ClientHeartbeat.model.json +3 -0
  72. package/runtime/Chrono/Shared/Remotes/ClientLoaded.model.json +3 -0
  73. package/runtime/Chrono/Shared/Remotes/Death.model.json +3 -0
  74. package/runtime/Chrono/Shared/Remotes/Heartbeat.model.json +3 -0
  75. package/runtime/Chrono/Shared/Remotes/Replicate.model.json +3 -0
  76. package/runtime/Chrono/Shared/Remotes/ReplicateFull.model.json +3 -0
  77. package/runtime/Chrono/Shared/Remotes/SafeReplicate.model.json +3 -0
  78. package/runtime/Chrono/Shared/ReplicationRules.luau +122 -0
  79. package/runtime/Chrono/Shared/Signal.luau +219 -0
  80. package/runtime/Chrono/Shared/Snapshots.luau +218 -0
  81. package/runtime/Chrono/Shared/Stats.luau +204 -0
  82. package/runtime/Chrono/Shared/Ticker.luau +112 -0
  83. package/runtime/Chrono/Shared/Types.luau +247 -0
  84. package/runtime/Chrono/Shared/Warn.luau +33 -0
  85. package/runtime/Chrono/Shared/_CUSTOM_MODEL_REP/init.model.json +3 -0
  86. package/runtime/Chrono/_impl/Client/ClientClock.luau +202 -0
  87. package/runtime/Chrono/_impl/Client/InterpolationBuffer.luau +74 -0
  88. package/runtime/Chrono/_impl/Client/ModelResolver.luau +53 -0
  89. package/runtime/Chrono/_impl/Client/Player.luau +113 -0
  90. package/runtime/Chrono/_impl/Client/Receiver.luau +395 -0
  91. package/runtime/Chrono/_impl/Client/Replicate.luau +333 -0
  92. package/runtime/Chrono/_impl/Client/Sender.luau +205 -0
  93. package/runtime/Chrono/_impl/LICENSE +21 -0
  94. package/runtime/Chrono/_impl/Server/EntityGrid.luau +299 -0
  95. package/runtime/Chrono/_impl/Server/Player.luau +141 -0
  96. package/runtime/Chrono/_impl/Server/Receiver.luau +287 -0
  97. package/runtime/Chrono/_impl/Server/Replicate.luau +415 -0
  98. package/runtime/Chrono/_impl/Server/Sender.luau +306 -0
  99. package/runtime/Chrono/_impl/Server/ServerClock.luau +50 -0
  100. package/runtime/Chrono/_impl/Shared/ApplyMounts.luau +137 -0
  101. package/runtime/Chrono/_impl/Shared/Bin.luau +31 -0
  102. package/runtime/Chrono/_impl/Shared/ClockUnwrap.luau +70 -0
  103. package/runtime/Chrono/_impl/Shared/Config.luau +264 -0
  104. package/runtime/Chrono/_impl/Shared/Entity.luau +1016 -0
  105. package/runtime/Chrono/_impl/Shared/Events.luau +39 -0
  106. package/runtime/Chrono/_impl/Shared/Holder.luau +210 -0
  107. package/runtime/Chrono/_impl/Shared/InterpolationMath.luau +51 -0
  108. package/runtime/Chrono/_impl/Shared/ModelHelper.luau +122 -0
  109. package/runtime/Chrono/_impl/Shared/Remotes/ClientClockRelay.model.json +3 -0
  110. package/runtime/Chrono/_impl/Shared/Remotes/ClientHeartbeat.model.json +3 -0
  111. package/runtime/Chrono/_impl/Shared/Remotes/ClientLoaded.model.json +3 -0
  112. package/runtime/Chrono/_impl/Shared/Remotes/Death.model.json +3 -0
  113. package/runtime/Chrono/_impl/Shared/Remotes/Heartbeat.model.json +3 -0
  114. package/runtime/Chrono/_impl/Shared/Remotes/Replicate.model.json +3 -0
  115. package/runtime/Chrono/_impl/Shared/Remotes/ReplicateFull.model.json +3 -0
  116. package/runtime/Chrono/_impl/Shared/Remotes/SafeReplicate.model.json +3 -0
  117. package/runtime/Chrono/_impl/Shared/ReplicationRules.luau +122 -0
  118. package/runtime/Chrono/_impl/Shared/Signal.luau +219 -0
  119. package/runtime/Chrono/_impl/Shared/Snapshots.luau +218 -0
  120. package/runtime/Chrono/_impl/Shared/Stats.luau +204 -0
  121. package/runtime/Chrono/_impl/Shared/Ticker.luau +112 -0
  122. package/runtime/Chrono/_impl/Shared/Types.luau +247 -0
  123. package/runtime/Chrono/_impl/Shared/Warn.luau +33 -0
  124. package/runtime/Chrono/_impl/Shared/_CUSTOM_MODEL_REP/init.model.json +3 -0
  125. package/runtime/Chrono/_impl/init.luau +96 -0
  126. package/runtime/Chrono/init.luau +14 -0
  127. package/runtime/Cmdr/BuiltInCommands/Admin/announce.luau +21 -0
  128. package/runtime/Cmdr/BuiltInCommands/Admin/announceServer.luau +17 -0
  129. package/runtime/Cmdr/BuiltInCommands/Admin/ban.luau +59 -0
  130. package/runtime/Cmdr/BuiltInCommands/Admin/banServer.luau +30 -0
  131. package/runtime/Cmdr/BuiltInCommands/Admin/gotoPlace.luau +35 -0
  132. package/runtime/Cmdr/BuiltInCommands/Admin/gotoPlaceServer.luau +17 -0
  133. package/runtime/Cmdr/BuiltInCommands/Admin/kick.luau +19 -0
  134. package/runtime/Cmdr/BuiltInCommands/Admin/kickServer.luau +27 -0
  135. package/runtime/Cmdr/BuiltInCommands/Admin/kill.luau +13 -0
  136. package/runtime/Cmdr/BuiltInCommands/Admin/killServer.luau +13 -0
  137. package/runtime/Cmdr/BuiltInCommands/Admin/respawn.luau +15 -0
  138. package/runtime/Cmdr/BuiltInCommands/Admin/respawnServer.luau +7 -0
  139. package/runtime/Cmdr/BuiltInCommands/Admin/teleport.luau +30 -0
  140. package/runtime/Cmdr/BuiltInCommands/Admin/teleportServer.luau +26 -0
  141. package/runtime/Cmdr/BuiltInCommands/Admin/unban.luau +26 -0
  142. package/runtime/Cmdr/BuiltInCommands/Admin/unbanServer.luau +10 -0
  143. package/runtime/Cmdr/BuiltInCommands/Debug/blink.luau +35 -0
  144. package/runtime/Cmdr/BuiltInCommands/Debug/fetch.luau +12 -0
  145. package/runtime/Cmdr/BuiltInCommands/Debug/fetchServer.luau +7 -0
  146. package/runtime/Cmdr/BuiltInCommands/Debug/getPlayerPlaceInstance.luau +20 -0
  147. package/runtime/Cmdr/BuiltInCommands/Debug/getPlayerPlaceInstanceServer.luau +28 -0
  148. package/runtime/Cmdr/BuiltInCommands/Debug/position.luau +30 -0
  149. package/runtime/Cmdr/BuiltInCommands/Debug/thru.luau +50 -0
  150. package/runtime/Cmdr/BuiltInCommands/Debug/uptime.luau +6 -0
  151. package/runtime/Cmdr/BuiltInCommands/Debug/uptimeServer.luau +12 -0
  152. package/runtime/Cmdr/BuiltInCommands/Debug/version.luau +12 -0
  153. package/runtime/Cmdr/BuiltInCommands/Utility/alias.luau +22 -0
  154. package/runtime/Cmdr/BuiltInCommands/Utility/bind.luau +104 -0
  155. package/runtime/Cmdr/BuiltInCommands/Utility/clear.luau +20 -0
  156. package/runtime/Cmdr/BuiltInCommands/Utility/convertTimestamp.luau +18 -0
  157. package/runtime/Cmdr/BuiltInCommands/Utility/echo.luau +17 -0
  158. package/runtime/Cmdr/BuiltInCommands/Utility/edit.luau +75 -0
  159. package/runtime/Cmdr/BuiltInCommands/Utility/exit.luau +11 -0
  160. package/runtime/Cmdr/BuiltInCommands/Utility/history.luau +27 -0
  161. package/runtime/Cmdr/BuiltInCommands/Utility/hover.luau +21 -0
  162. package/runtime/Cmdr/BuiltInCommands/Utility/jsonArrayDecode.luau +25 -0
  163. package/runtime/Cmdr/BuiltInCommands/Utility/jsonArrayEncode.luau +18 -0
  164. package/runtime/Cmdr/BuiltInCommands/Utility/len.luau +16 -0
  165. package/runtime/Cmdr/BuiltInCommands/Utility/math.luau +36 -0
  166. package/runtime/Cmdr/BuiltInCommands/Utility/pick.luau +21 -0
  167. package/runtime/Cmdr/BuiltInCommands/Utility/rand.luau +27 -0
  168. package/runtime/Cmdr/BuiltInCommands/Utility/replace.luau +32 -0
  169. package/runtime/Cmdr/BuiltInCommands/Utility/resolve.luau +32 -0
  170. package/runtime/Cmdr/BuiltInCommands/Utility/run.luau +20 -0
  171. package/runtime/Cmdr/BuiltInCommands/Utility/runLines.luau +34 -0
  172. package/runtime/Cmdr/BuiltInCommands/Utility/runif.luau +95 -0
  173. package/runtime/Cmdr/BuiltInCommands/Utility/unbind.luau +27 -0
  174. package/runtime/Cmdr/BuiltInCommands/Utility/var.luau +29 -0
  175. package/runtime/Cmdr/BuiltInCommands/Utility/varServer.luau +37 -0
  176. package/runtime/Cmdr/BuiltInCommands/Utility/varSet.luau +30 -0
  177. package/runtime/Cmdr/BuiltInCommands/Utility/varSetServer.luau +29 -0
  178. package/runtime/Cmdr/BuiltInCommands/help.luau +96 -0
  179. package/runtime/Cmdr/BuiltInTypes/BrickColor.luau +258 -0
  180. package/runtime/Cmdr/BuiltInTypes/Color3.luau +59 -0
  181. package/runtime/Cmdr/BuiltInTypes/Command.luau +23 -0
  182. package/runtime/Cmdr/BuiltInTypes/Duration.luau +111 -0
  183. package/runtime/Cmdr/BuiltInTypes/JSON.luau +13 -0
  184. package/runtime/Cmdr/BuiltInTypes/MathOperator.luau +43 -0
  185. package/runtime/Cmdr/BuiltInTypes/Player.luau +36 -0
  186. package/runtime/Cmdr/BuiltInTypes/PlayerId.luau +66 -0
  187. package/runtime/Cmdr/BuiltInTypes/Primitives.luau +145 -0
  188. package/runtime/Cmdr/BuiltInTypes/StoredKey.luau +33 -0
  189. package/runtime/Cmdr/BuiltInTypes/Team.luau +49 -0
  190. package/runtime/Cmdr/BuiltInTypes/Type.luau +23 -0
  191. package/runtime/Cmdr/BuiltInTypes/URL.luau +18 -0
  192. package/runtime/Cmdr/BuiltInTypes/UserInput.luau +32 -0
  193. package/runtime/Cmdr/BuiltInTypes/Vector.luau +58 -0
  194. package/runtime/Cmdr/CmdrClient/CmdrInterface/AutoComplete.luau +240 -0
  195. package/runtime/Cmdr/CmdrClient/CmdrInterface/CreateGui.luau +227 -0
  196. package/runtime/Cmdr/CmdrClient/CmdrInterface/Window.luau +713 -0
  197. package/runtime/Cmdr/CmdrClient/CmdrInterface/init.luau +18 -0
  198. package/runtime/Cmdr/CmdrClient/DefaultEventHandlers.luau +18 -0
  199. package/runtime/Cmdr/CmdrClient/Shared/Argument.luau +395 -0
  200. package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/HasCharacter.luau +39 -0
  201. package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/IsDataStoreAvailable.luau +36 -0
  202. package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/MaxArrayLength.luau +10 -0
  203. package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/MaxStringLength.luau +10 -0
  204. package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/NonEmptyString.luau +10 -0
  205. package/runtime/Cmdr/CmdrClient/Shared/BuiltInGuards/NotEquals.luau +8 -0
  206. package/runtime/Cmdr/CmdrClient/Shared/Command.luau +415 -0
  207. package/runtime/Cmdr/CmdrClient/Shared/Dispatcher.luau +407 -0
  208. package/runtime/Cmdr/CmdrClient/Shared/Registry.luau +717 -0
  209. package/runtime/Cmdr/CmdrClient/Shared/Util.luau +879 -0
  210. package/runtime/Cmdr/CmdrClient/init.luau +377 -0
  211. package/runtime/Cmdr/LICENSE +21 -0
  212. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/announce.luau +21 -0
  213. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/announceServer.luau +17 -0
  214. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/ban.luau +59 -0
  215. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/banServer.luau +30 -0
  216. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/gotoPlace.luau +35 -0
  217. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/gotoPlaceServer.luau +17 -0
  218. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/kick.luau +19 -0
  219. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/kickServer.luau +27 -0
  220. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/kill.luau +13 -0
  221. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/killServer.luau +13 -0
  222. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/respawn.luau +15 -0
  223. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/respawnServer.luau +7 -0
  224. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/teleport.luau +30 -0
  225. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/teleportServer.luau +26 -0
  226. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/unban.luau +26 -0
  227. package/runtime/Cmdr/_impl/BuiltInCommands/Admin/unbanServer.luau +10 -0
  228. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/blink.luau +35 -0
  229. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/fetch.luau +12 -0
  230. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/fetchServer.luau +7 -0
  231. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/getPlayerPlaceInstance.luau +20 -0
  232. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/getPlayerPlaceInstanceServer.luau +28 -0
  233. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/position.luau +30 -0
  234. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/thru.luau +50 -0
  235. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/uptime.luau +6 -0
  236. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/uptimeServer.luau +12 -0
  237. package/runtime/Cmdr/_impl/BuiltInCommands/Debug/version.luau +12 -0
  238. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/alias.luau +22 -0
  239. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/bind.luau +104 -0
  240. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/clear.luau +20 -0
  241. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/convertTimestamp.luau +18 -0
  242. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/echo.luau +17 -0
  243. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/edit.luau +75 -0
  244. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/exit.luau +11 -0
  245. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/history.luau +27 -0
  246. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/hover.luau +21 -0
  247. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/jsonArrayDecode.luau +25 -0
  248. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/jsonArrayEncode.luau +18 -0
  249. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/len.luau +16 -0
  250. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/math.luau +36 -0
  251. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/pick.luau +21 -0
  252. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/rand.luau +27 -0
  253. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/replace.luau +32 -0
  254. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/resolve.luau +32 -0
  255. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/run.luau +20 -0
  256. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/runLines.luau +34 -0
  257. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/runif.luau +95 -0
  258. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/unbind.luau +27 -0
  259. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/var.luau +29 -0
  260. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/varServer.luau +37 -0
  261. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/varSet.luau +30 -0
  262. package/runtime/Cmdr/_impl/BuiltInCommands/Utility/varSetServer.luau +29 -0
  263. package/runtime/Cmdr/_impl/BuiltInCommands/help.luau +96 -0
  264. package/runtime/Cmdr/_impl/BuiltInTypes/BrickColor.luau +258 -0
  265. package/runtime/Cmdr/_impl/BuiltInTypes/Color3.luau +59 -0
  266. package/runtime/Cmdr/_impl/BuiltInTypes/Command.luau +23 -0
  267. package/runtime/Cmdr/_impl/BuiltInTypes/Duration.luau +111 -0
  268. package/runtime/Cmdr/_impl/BuiltInTypes/JSON.luau +13 -0
  269. package/runtime/Cmdr/_impl/BuiltInTypes/MathOperator.luau +43 -0
  270. package/runtime/Cmdr/_impl/BuiltInTypes/Player.luau +36 -0
  271. package/runtime/Cmdr/_impl/BuiltInTypes/PlayerId.luau +66 -0
  272. package/runtime/Cmdr/_impl/BuiltInTypes/Primitives.luau +145 -0
  273. package/runtime/Cmdr/_impl/BuiltInTypes/StoredKey.luau +33 -0
  274. package/runtime/Cmdr/_impl/BuiltInTypes/Team.luau +49 -0
  275. package/runtime/Cmdr/_impl/BuiltInTypes/Type.luau +23 -0
  276. package/runtime/Cmdr/_impl/BuiltInTypes/URL.luau +18 -0
  277. package/runtime/Cmdr/_impl/BuiltInTypes/UserInput.luau +32 -0
  278. package/runtime/Cmdr/_impl/BuiltInTypes/Vector.luau +58 -0
  279. package/runtime/Cmdr/_impl/CmdrClient/CmdrInterface/AutoComplete.luau +240 -0
  280. package/runtime/Cmdr/_impl/CmdrClient/CmdrInterface/CreateGui.luau +227 -0
  281. package/runtime/Cmdr/_impl/CmdrClient/CmdrInterface/Window.luau +713 -0
  282. package/runtime/Cmdr/_impl/CmdrClient/CmdrInterface/init.luau +18 -0
  283. package/runtime/Cmdr/_impl/CmdrClient/DefaultEventHandlers.luau +18 -0
  284. package/runtime/Cmdr/_impl/CmdrClient/Shared/Argument.luau +395 -0
  285. package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/HasCharacter.luau +39 -0
  286. package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/IsDataStoreAvailable.luau +36 -0
  287. package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/MaxArrayLength.luau +10 -0
  288. package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/MaxStringLength.luau +10 -0
  289. package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/NonEmptyString.luau +10 -0
  290. package/runtime/Cmdr/_impl/CmdrClient/Shared/BuiltInGuards/NotEquals.luau +8 -0
  291. package/runtime/Cmdr/_impl/CmdrClient/Shared/Command.luau +415 -0
  292. package/runtime/Cmdr/_impl/CmdrClient/Shared/Dispatcher.luau +407 -0
  293. package/runtime/Cmdr/_impl/CmdrClient/Shared/Registry.luau +717 -0
  294. package/runtime/Cmdr/_impl/CmdrClient/Shared/Util.luau +879 -0
  295. package/runtime/Cmdr/_impl/CmdrClient/init.luau +377 -0
  296. package/runtime/Cmdr/_impl/LICENSE +21 -0
  297. package/runtime/Cmdr/_impl/init.luau +178 -0
  298. package/runtime/Cmdr/init.luau +8 -0
  299. package/runtime/DataService/Client.luau +209 -0
  300. package/runtime/DataService/Data.luau +886 -0
  301. package/runtime/DataService/Enum.luau +6 -0
  302. package/runtime/DataService/Enums.luau +10 -0
  303. package/runtime/DataService/Packages/quicknet/DataTypes.luau +70 -0
  304. package/runtime/DataService/Packages/quicknet/Enums.luau +85 -0
  305. package/runtime/DataService/Packages/quicknet/EnumsToNativeTypes.luau +57 -0
  306. package/runtime/DataService/Packages/quicknet/Parser.luau +355 -0
  307. package/runtime/DataService/Packages/quicknet/QuickNet.luau +953 -0
  308. package/runtime/DataService/Packages/quicknet/Serialize.luau +2020 -0
  309. package/runtime/DataService/Packages/quicknet/Types.luau +72 -0
  310. package/runtime/DataService/Packages/quicknet/init.luau +1 -0
  311. package/runtime/DataService/Packages/signal/init.luau +433 -0
  312. package/runtime/DataService/Path.luau +236 -0
  313. package/runtime/DataService/ProfileStore.luau +2243 -0
  314. package/runtime/DataService/Replicator.luau +172 -0
  315. package/runtime/DataService/Server.luau +412 -0
  316. package/runtime/DataService/init.luau +204 -0
  317. package/runtime/Display/LICENSE +201 -0
  318. package/runtime/Display/_impl/LICENSE +201 -0
  319. package/runtime/Display/_impl/init.luau +269 -0
  320. package/runtime/Display/_impl/option.luau +237 -0
  321. package/runtime/Display/init.luau +10 -0
  322. package/runtime/Display/option.luau +237 -0
  323. package/runtime/EzVisualz/Dropshadow.luau +148 -0
  324. package/runtime/EzVisualz/Gradient.luau +452 -0
  325. package/runtime/EzVisualz/GradientTemplates/Bubblegum.luau +16 -0
  326. package/runtime/EzVisualz/GradientTemplates/Chrome.luau +16 -0
  327. package/runtime/EzVisualz/GradientTemplates/Death.luau +15 -0
  328. package/runtime/EzVisualz/GradientTemplates/Electric.luau +14 -0
  329. package/runtime/EzVisualz/GradientTemplates/Fire.luau +13 -0
  330. package/runtime/EzVisualz/GradientTemplates/Galaxy.luau +11 -0
  331. package/runtime/EzVisualz/GradientTemplates/Ghost.luau +16 -0
  332. package/runtime/EzVisualz/GradientTemplates/Gold.luau +14 -0
  333. package/runtime/EzVisualz/GradientTemplates/Green.luau +14 -0
  334. package/runtime/EzVisualz/GradientTemplates/Ice.luau +14 -0
  335. package/runtime/EzVisualz/GradientTemplates/Lava.luau +15 -0
  336. package/runtime/EzVisualz/GradientTemplates/Matrix.luau +19 -0
  337. package/runtime/EzVisualz/GradientTemplates/Neon.luau +12 -0
  338. package/runtime/EzVisualz/GradientTemplates/Oceanic.luau +15 -0
  339. package/runtime/EzVisualz/GradientTemplates/Rainbow.luau +13 -0
  340. package/runtime/EzVisualz/GradientTemplates/Silver.luau +12 -0
  341. package/runtime/EzVisualz/GradientTemplates/Sunset.luau +11 -0
  342. package/runtime/EzVisualz/GradientTemplates/Zebra.luau +18 -0
  343. package/runtime/EzVisualz/GradientTemplates/init.luau +9 -0
  344. package/runtime/EzVisualz/LICENSE.md +21 -0
  345. package/runtime/EzVisualz/Presets/Bubblegum.luau +36 -0
  346. package/runtime/EzVisualz/Presets/ChromeStroke.luau +15 -0
  347. package/runtime/EzVisualz/Presets/DeathStroke.luau +15 -0
  348. package/runtime/EzVisualz/Presets/ElectricStroke.luau +54 -0
  349. package/runtime/EzVisualz/Presets/FireStroke.luau +29 -0
  350. package/runtime/EzVisualz/Presets/GalaxyStroke.luau +31 -0
  351. package/runtime/EzVisualz/Presets/Ghost.luau +10 -0
  352. package/runtime/EzVisualz/Presets/GhostStroke.luau +15 -0
  353. package/runtime/EzVisualz/Presets/Gold.luau +10 -0
  354. package/runtime/EzVisualz/Presets/GoldStroke.luau +15 -0
  355. package/runtime/EzVisualz/Presets/GreenOutline.luau +23 -0
  356. package/runtime/EzVisualz/Presets/IceStroke.luau +15 -0
  357. package/runtime/EzVisualz/Presets/Lava.luau +9 -0
  358. package/runtime/EzVisualz/Presets/LavaStroke.luau +13 -0
  359. package/runtime/EzVisualz/Presets/Matrix.luau +21 -0
  360. package/runtime/EzVisualz/Presets/NeonStroke.luau +30 -0
  361. package/runtime/EzVisualz/Presets/OceanicStroke.luau +15 -0
  362. package/runtime/EzVisualz/Presets/Rainbow.luau +9 -0
  363. package/runtime/EzVisualz/Presets/RainbowOutline.luau +23 -0
  364. package/runtime/EzVisualz/Presets/RainbowStroke.luau +13 -0
  365. package/runtime/EzVisualz/Presets/Shine.luau +48 -0
  366. package/runtime/EzVisualz/Presets/ShineOutline.luau +66 -0
  367. package/runtime/EzVisualz/Presets/Silver.luau +10 -0
  368. package/runtime/EzVisualz/Presets/SilverStroke.luau +15 -0
  369. package/runtime/EzVisualz/Presets/SunsetStroke.luau +31 -0
  370. package/runtime/EzVisualz/Presets/WaveStroke.luau +33 -0
  371. package/runtime/EzVisualz/Presets/Zebra.luau +21 -0
  372. package/runtime/EzVisualz/Presets/init.luau +9 -0
  373. package/runtime/EzVisualz/Stroke.luau +167 -0
  374. package/runtime/EzVisualz/Util.luau +7 -0
  375. package/runtime/EzVisualz/_impl/Dropshadow.luau +148 -0
  376. package/runtime/EzVisualz/_impl/Gradient.luau +452 -0
  377. package/runtime/EzVisualz/_impl/GradientTemplates/Bubblegum.luau +16 -0
  378. package/runtime/EzVisualz/_impl/GradientTemplates/Chrome.luau +16 -0
  379. package/runtime/EzVisualz/_impl/GradientTemplates/Death.luau +15 -0
  380. package/runtime/EzVisualz/_impl/GradientTemplates/Electric.luau +14 -0
  381. package/runtime/EzVisualz/_impl/GradientTemplates/Fire.luau +13 -0
  382. package/runtime/EzVisualz/_impl/GradientTemplates/Galaxy.luau +11 -0
  383. package/runtime/EzVisualz/_impl/GradientTemplates/Ghost.luau +16 -0
  384. package/runtime/EzVisualz/_impl/GradientTemplates/Gold.luau +14 -0
  385. package/runtime/EzVisualz/_impl/GradientTemplates/Green.luau +14 -0
  386. package/runtime/EzVisualz/_impl/GradientTemplates/Ice.luau +14 -0
  387. package/runtime/EzVisualz/_impl/GradientTemplates/Lava.luau +15 -0
  388. package/runtime/EzVisualz/_impl/GradientTemplates/Matrix.luau +19 -0
  389. package/runtime/EzVisualz/_impl/GradientTemplates/Neon.luau +12 -0
  390. package/runtime/EzVisualz/_impl/GradientTemplates/Oceanic.luau +15 -0
  391. package/runtime/EzVisualz/_impl/GradientTemplates/Rainbow.luau +13 -0
  392. package/runtime/EzVisualz/_impl/GradientTemplates/Silver.luau +12 -0
  393. package/runtime/EzVisualz/_impl/GradientTemplates/Sunset.luau +11 -0
  394. package/runtime/EzVisualz/_impl/GradientTemplates/Zebra.luau +18 -0
  395. package/runtime/EzVisualz/_impl/GradientTemplates/init.luau +9 -0
  396. package/runtime/EzVisualz/_impl/LICENSE.md +21 -0
  397. package/runtime/EzVisualz/_impl/Presets/Bubblegum.luau +36 -0
  398. package/runtime/EzVisualz/_impl/Presets/ChromeStroke.luau +15 -0
  399. package/runtime/EzVisualz/_impl/Presets/DeathStroke.luau +15 -0
  400. package/runtime/EzVisualz/_impl/Presets/ElectricStroke.luau +54 -0
  401. package/runtime/EzVisualz/_impl/Presets/FireStroke.luau +29 -0
  402. package/runtime/EzVisualz/_impl/Presets/GalaxyStroke.luau +31 -0
  403. package/runtime/EzVisualz/_impl/Presets/Ghost.luau +10 -0
  404. package/runtime/EzVisualz/_impl/Presets/GhostStroke.luau +15 -0
  405. package/runtime/EzVisualz/_impl/Presets/Gold.luau +10 -0
  406. package/runtime/EzVisualz/_impl/Presets/GoldStroke.luau +15 -0
  407. package/runtime/EzVisualz/_impl/Presets/GreenOutline.luau +23 -0
  408. package/runtime/EzVisualz/_impl/Presets/IceStroke.luau +15 -0
  409. package/runtime/EzVisualz/_impl/Presets/Lava.luau +9 -0
  410. package/runtime/EzVisualz/_impl/Presets/LavaStroke.luau +13 -0
  411. package/runtime/EzVisualz/_impl/Presets/Matrix.luau +21 -0
  412. package/runtime/EzVisualz/_impl/Presets/NeonStroke.luau +30 -0
  413. package/runtime/EzVisualz/_impl/Presets/OceanicStroke.luau +15 -0
  414. package/runtime/EzVisualz/_impl/Presets/Rainbow.luau +9 -0
  415. package/runtime/EzVisualz/_impl/Presets/RainbowOutline.luau +23 -0
  416. package/runtime/EzVisualz/_impl/Presets/RainbowStroke.luau +13 -0
  417. package/runtime/EzVisualz/_impl/Presets/Shine.luau +48 -0
  418. package/runtime/EzVisualz/_impl/Presets/ShineOutline.luau +66 -0
  419. package/runtime/EzVisualz/_impl/Presets/Silver.luau +10 -0
  420. package/runtime/EzVisualz/_impl/Presets/SilverStroke.luau +15 -0
  421. package/runtime/EzVisualz/_impl/Presets/SunsetStroke.luau +31 -0
  422. package/runtime/EzVisualz/_impl/Presets/WaveStroke.luau +33 -0
  423. package/runtime/EzVisualz/_impl/Presets/Zebra.luau +21 -0
  424. package/runtime/EzVisualz/_impl/Presets/init.luau +9 -0
  425. package/runtime/EzVisualz/_impl/Stroke.luau +167 -0
  426. package/runtime/EzVisualz/_impl/Util.luau +7 -0
  427. package/runtime/EzVisualz/_impl/init.luau +319 -0
  428. package/runtime/EzVisualz/_impl/wally.lock +8 -0
  429. package/runtime/EzVisualz/_impl/wally.toml +8 -0
  430. package/runtime/EzVisualz/init.luau +9 -0
  431. package/runtime/EzVisualz/wally.lock +8 -0
  432. package/runtime/EzVisualz/wally.toml +8 -0
  433. package/runtime/FormatNumber/LICENSE.md +25 -0
  434. package/runtime/FormatNumber/Main/DecimalFormatSymbols.lua +43 -0
  435. package/runtime/FormatNumber/Main/IntegerWidth.lua +41 -0
  436. package/runtime/FormatNumber/Main/Notation.lua +116 -0
  437. package/runtime/FormatNumber/Main/Precision.lua +179 -0
  438. package/runtime/FormatNumber/Main/init.lua +199 -0
  439. package/runtime/FormatNumber/Simple/init.lua +76 -0
  440. package/runtime/FormatNumber/Version.lua +82 -0
  441. package/runtime/FormatNumber/_impl/LICENSE.md +25 -0
  442. package/runtime/FormatNumber/_impl/Main/DecimalFormatSymbols.lua +43 -0
  443. package/runtime/FormatNumber/_impl/Main/IntegerWidth.lua +41 -0
  444. package/runtime/FormatNumber/_impl/Main/Notation.lua +116 -0
  445. package/runtime/FormatNumber/_impl/Main/Precision.lua +179 -0
  446. package/runtime/FormatNumber/_impl/Main/init.lua +199 -0
  447. package/runtime/FormatNumber/_impl/Simple/init.lua +76 -0
  448. package/runtime/FormatNumber/_impl/Version.lua +82 -0
  449. package/runtime/FormatNumber/_impl/_internal/class.lua +204 -0
  450. package/runtime/FormatNumber/_impl/_internal/decimal_conversion.lua +30 -0
  451. package/runtime/FormatNumber/_impl/_internal/enums.lua +55 -0
  452. package/runtime/FormatNumber/_impl/_internal/format.lua +342 -0
  453. package/runtime/FormatNumber/_impl/_internal/formatter_settings.lua +160 -0
  454. package/runtime/FormatNumber/_impl/_internal/init.lua +8 -0
  455. package/runtime/FormatNumber/_impl/_internal/skeleton.lua +541 -0
  456. package/runtime/FormatNumber/_impl/init.lua +20 -0
  457. package/runtime/FormatNumber/_internal/class.lua +204 -0
  458. package/runtime/FormatNumber/_internal/decimal_conversion.lua +30 -0
  459. package/runtime/FormatNumber/_internal/enums.lua +55 -0
  460. package/runtime/FormatNumber/_internal/format.lua +342 -0
  461. package/runtime/FormatNumber/_internal/formatter_settings.lua +160 -0
  462. package/runtime/FormatNumber/_internal/init.lua +8 -0
  463. package/runtime/FormatNumber/_internal/skeleton.lua +541 -0
  464. package/runtime/FormatNumber/init.lua +20 -0
  465. package/runtime/FormatNumber/init.luau +20 -0
  466. package/runtime/Fusion/Animation/ExternalTime.luau +84 -0
  467. package/runtime/Fusion/Animation/Spring.luau +313 -0
  468. package/runtime/Fusion/Animation/Stopwatch.luau +128 -0
  469. package/runtime/Fusion/Animation/Tween.luau +178 -0
  470. package/runtime/Fusion/Animation/getTweenDuration.luau +27 -0
  471. package/runtime/Fusion/Animation/getTweenRatio.luau +47 -0
  472. package/runtime/Fusion/Animation/lerpType.luau +164 -0
  473. package/runtime/Fusion/Animation/packType.luau +100 -0
  474. package/runtime/Fusion/Animation/springCoefficients.luau +80 -0
  475. package/runtime/Fusion/Animation/unpackType.luau +103 -0
  476. package/runtime/Fusion/Colour/Oklab.luau +70 -0
  477. package/runtime/Fusion/Colour/sRGB.luau +47 -0
  478. package/runtime/Fusion/External.luau +156 -0
  479. package/runtime/Fusion/ExternalDebug.luau +70 -0
  480. package/runtime/Fusion/Graph/Observer.luau +111 -0
  481. package/runtime/Fusion/Graph/castToGraph.luau +29 -0
  482. package/runtime/Fusion/Graph/change.luau +81 -0
  483. package/runtime/Fusion/Graph/depend.luau +33 -0
  484. package/runtime/Fusion/Graph/evaluate.luau +56 -0
  485. package/runtime/Fusion/Instances/Attribute.luau +58 -0
  486. package/runtime/Fusion/Instances/AttributeChange.luau +47 -0
  487. package/runtime/Fusion/Instances/AttributeOut.luau +63 -0
  488. package/runtime/Fusion/Instances/Child.luau +21 -0
  489. package/runtime/Fusion/Instances/Children.luau +148 -0
  490. package/runtime/Fusion/Instances/Hydrate.luau +29 -0
  491. package/runtime/Fusion/Instances/New.luau +48 -0
  492. package/runtime/Fusion/Instances/OnChange.luau +50 -0
  493. package/runtime/Fusion/Instances/OnEvent.luau +54 -0
  494. package/runtime/Fusion/Instances/Out.luau +69 -0
  495. package/runtime/Fusion/Instances/Tag.luau +61 -0
  496. package/runtime/Fusion/Instances/applyInstanceProps.luau +149 -0
  497. package/runtime/Fusion/Instances/defaultProps.luau +194 -0
  498. package/runtime/Fusion/LICENSE +21 -0
  499. package/runtime/Fusion/Logging/formatError.luau +49 -0
  500. package/runtime/Fusion/Logging/messages.luau +46 -0
  501. package/runtime/Fusion/Logging/parseError.luau +25 -0
  502. package/runtime/Fusion/Memory/checkLifetime.luau +134 -0
  503. package/runtime/Fusion/Memory/deriveScope.luau +24 -0
  504. package/runtime/Fusion/Memory/deriveScopeImpl.luau +40 -0
  505. package/runtime/Fusion/Memory/doCleanup.luau +91 -0
  506. package/runtime/Fusion/Memory/innerScope.luau +34 -0
  507. package/runtime/Fusion/Memory/insert.luau +22 -0
  508. package/runtime/Fusion/Memory/needsDestruction.luau +17 -0
  509. package/runtime/Fusion/Memory/scoped.luau +24 -0
  510. package/runtime/Fusion/RobloxExternal.luau +98 -0
  511. package/runtime/Fusion/State/Computed.luau +122 -0
  512. package/runtime/Fusion/State/For/Disassembly.luau +207 -0
  513. package/runtime/Fusion/State/For/ForTypes.luau +30 -0
  514. package/runtime/Fusion/State/For/init.luau +101 -0
  515. package/runtime/Fusion/State/ForKeys.luau +88 -0
  516. package/runtime/Fusion/State/ForPairs.luau +91 -0
  517. package/runtime/Fusion/State/ForValues.luau +88 -0
  518. package/runtime/Fusion/State/Value.luau +76 -0
  519. package/runtime/Fusion/State/castToState.luau +26 -0
  520. package/runtime/Fusion/State/peek.luau +31 -0
  521. package/runtime/Fusion/State/updateAll.luau +1 -0
  522. package/runtime/Fusion/Types.luau +318 -0
  523. package/runtime/Fusion/Utility/Contextual.luau +91 -0
  524. package/runtime/Fusion/Utility/Safe.luau +23 -0
  525. package/runtime/Fusion/Utility/isSimilar.luau +29 -0
  526. package/runtime/Fusion/Utility/merge.luau +35 -0
  527. package/runtime/Fusion/Utility/nameOf.luau +35 -0
  528. package/runtime/Fusion/Utility/never.luau +14 -0
  529. package/runtime/Fusion/Utility/nicknames.luau +11 -0
  530. package/runtime/Fusion/Utility/xtypeof.luau +27 -0
  531. package/runtime/Fusion/_impl/Animation/ExternalTime.luau +84 -0
  532. package/runtime/Fusion/_impl/Animation/Spring.luau +313 -0
  533. package/runtime/Fusion/_impl/Animation/Stopwatch.luau +128 -0
  534. package/runtime/Fusion/_impl/Animation/Tween.luau +178 -0
  535. package/runtime/Fusion/_impl/Animation/getTweenDuration.luau +27 -0
  536. package/runtime/Fusion/_impl/Animation/getTweenRatio.luau +47 -0
  537. package/runtime/Fusion/_impl/Animation/lerpType.luau +164 -0
  538. package/runtime/Fusion/_impl/Animation/packType.luau +100 -0
  539. package/runtime/Fusion/_impl/Animation/springCoefficients.luau +80 -0
  540. package/runtime/Fusion/_impl/Animation/unpackType.luau +103 -0
  541. package/runtime/Fusion/_impl/Colour/Oklab.luau +70 -0
  542. package/runtime/Fusion/_impl/Colour/sRGB.luau +47 -0
  543. package/runtime/Fusion/_impl/External.luau +156 -0
  544. package/runtime/Fusion/_impl/ExternalDebug.luau +70 -0
  545. package/runtime/Fusion/_impl/Graph/Observer.luau +111 -0
  546. package/runtime/Fusion/_impl/Graph/castToGraph.luau +29 -0
  547. package/runtime/Fusion/_impl/Graph/change.luau +81 -0
  548. package/runtime/Fusion/_impl/Graph/depend.luau +33 -0
  549. package/runtime/Fusion/_impl/Graph/evaluate.luau +56 -0
  550. package/runtime/Fusion/_impl/Instances/Attribute.luau +58 -0
  551. package/runtime/Fusion/_impl/Instances/AttributeChange.luau +47 -0
  552. package/runtime/Fusion/_impl/Instances/AttributeOut.luau +63 -0
  553. package/runtime/Fusion/_impl/Instances/Child.luau +21 -0
  554. package/runtime/Fusion/_impl/Instances/Children.luau +148 -0
  555. package/runtime/Fusion/_impl/Instances/Hydrate.luau +29 -0
  556. package/runtime/Fusion/_impl/Instances/New.luau +48 -0
  557. package/runtime/Fusion/_impl/Instances/OnChange.luau +50 -0
  558. package/runtime/Fusion/_impl/Instances/OnEvent.luau +54 -0
  559. package/runtime/Fusion/_impl/Instances/Out.luau +69 -0
  560. package/runtime/Fusion/_impl/Instances/Tag.luau +61 -0
  561. package/runtime/Fusion/_impl/Instances/applyInstanceProps.luau +149 -0
  562. package/runtime/Fusion/_impl/Instances/defaultProps.luau +194 -0
  563. package/runtime/Fusion/_impl/LICENSE +21 -0
  564. package/runtime/Fusion/_impl/Logging/formatError.luau +49 -0
  565. package/runtime/Fusion/_impl/Logging/messages.luau +46 -0
  566. package/runtime/Fusion/_impl/Logging/parseError.luau +25 -0
  567. package/runtime/Fusion/_impl/Memory/checkLifetime.luau +134 -0
  568. package/runtime/Fusion/_impl/Memory/deriveScope.luau +24 -0
  569. package/runtime/Fusion/_impl/Memory/deriveScopeImpl.luau +40 -0
  570. package/runtime/Fusion/_impl/Memory/doCleanup.luau +91 -0
  571. package/runtime/Fusion/_impl/Memory/innerScope.luau +34 -0
  572. package/runtime/Fusion/_impl/Memory/insert.luau +22 -0
  573. package/runtime/Fusion/_impl/Memory/needsDestruction.luau +17 -0
  574. package/runtime/Fusion/_impl/Memory/scoped.luau +24 -0
  575. package/runtime/Fusion/_impl/RobloxExternal.luau +98 -0
  576. package/runtime/Fusion/_impl/State/Computed.luau +122 -0
  577. package/runtime/Fusion/_impl/State/For/Disassembly.luau +207 -0
  578. package/runtime/Fusion/_impl/State/For/ForTypes.luau +30 -0
  579. package/runtime/Fusion/_impl/State/For/init.luau +101 -0
  580. package/runtime/Fusion/_impl/State/ForKeys.luau +88 -0
  581. package/runtime/Fusion/_impl/State/ForPairs.luau +91 -0
  582. package/runtime/Fusion/_impl/State/ForValues.luau +88 -0
  583. package/runtime/Fusion/_impl/State/Value.luau +76 -0
  584. package/runtime/Fusion/_impl/State/castToState.luau +26 -0
  585. package/runtime/Fusion/_impl/State/peek.luau +31 -0
  586. package/runtime/Fusion/_impl/State/updateAll.luau +1 -0
  587. package/runtime/Fusion/_impl/Types.luau +318 -0
  588. package/runtime/Fusion/_impl/Utility/Contextual.luau +91 -0
  589. package/runtime/Fusion/_impl/Utility/Safe.luau +23 -0
  590. package/runtime/Fusion/_impl/Utility/isSimilar.luau +29 -0
  591. package/runtime/Fusion/_impl/Utility/merge.luau +35 -0
  592. package/runtime/Fusion/_impl/Utility/nameOf.luau +35 -0
  593. package/runtime/Fusion/_impl/Utility/never.luau +14 -0
  594. package/runtime/Fusion/_impl/Utility/nicknames.luau +11 -0
  595. package/runtime/Fusion/_impl/Utility/xtypeof.luau +27 -0
  596. package/runtime/Fusion/_impl/init.luau +83 -0
  597. package/runtime/Fusion/init.luau +27 -0
  598. package/runtime/Iris/API.lua +2085 -0
  599. package/runtime/Iris/Internal.lua +895 -0
  600. package/runtime/Iris/LICENSE.txt +21 -0
  601. package/runtime/Iris/PubTypes.lua +43 -0
  602. package/runtime/Iris/Types.lua +660 -0
  603. package/runtime/Iris/WidgetTypes.lua +521 -0
  604. package/runtime/Iris/_impl/API.lua +2085 -0
  605. package/runtime/Iris/_impl/Internal.lua +895 -0
  606. package/runtime/Iris/_impl/LICENSE.txt +21 -0
  607. package/runtime/Iris/_impl/PubTypes.lua +43 -0
  608. package/runtime/Iris/_impl/Types.lua +660 -0
  609. package/runtime/Iris/_impl/WidgetTypes.lua +521 -0
  610. package/runtime/Iris/_impl/config.lua +305 -0
  611. package/runtime/Iris/_impl/init.lua +696 -0
  612. package/runtime/Iris/_impl/widgets/Button.lua +90 -0
  613. package/runtime/Iris/_impl/widgets/Checkbox.lua +115 -0
  614. package/runtime/Iris/_impl/widgets/Combo.lua +492 -0
  615. package/runtime/Iris/_impl/widgets/Format.lua +140 -0
  616. package/runtime/Iris/_impl/widgets/Image.lua +155 -0
  617. package/runtime/Iris/_impl/widgets/Input.lua +1232 -0
  618. package/runtime/Iris/_impl/widgets/Menu.lua +599 -0
  619. package/runtime/Iris/_impl/widgets/Plot.lua +639 -0
  620. package/runtime/Iris/_impl/widgets/RadioButton.lua +126 -0
  621. package/runtime/Iris/_impl/widgets/Root.lua +143 -0
  622. package/runtime/Iris/_impl/widgets/Tab.lua +333 -0
  623. package/runtime/Iris/_impl/widgets/Table.lua +635 -0
  624. package/runtime/Iris/_impl/widgets/Text.lua +132 -0
  625. package/runtime/Iris/_impl/widgets/Tree.lua +287 -0
  626. package/runtime/Iris/_impl/widgets/Window.lua +1075 -0
  627. package/runtime/Iris/_impl/widgets/init.lua +447 -0
  628. package/runtime/Iris/config.lua +305 -0
  629. package/runtime/Iris/init.lua +696 -0
  630. package/runtime/Iris/init.luau +12 -0
  631. package/runtime/Iris/widgets/Button.lua +90 -0
  632. package/runtime/Iris/widgets/Checkbox.lua +115 -0
  633. package/runtime/Iris/widgets/Combo.lua +492 -0
  634. package/runtime/Iris/widgets/Format.lua +140 -0
  635. package/runtime/Iris/widgets/Image.lua +155 -0
  636. package/runtime/Iris/widgets/Input.lua +1232 -0
  637. package/runtime/Iris/widgets/Menu.lua +599 -0
  638. package/runtime/Iris/widgets/Plot.lua +639 -0
  639. package/runtime/Iris/widgets/RadioButton.lua +126 -0
  640. package/runtime/Iris/widgets/Root.lua +143 -0
  641. package/runtime/Iris/widgets/Tab.lua +333 -0
  642. package/runtime/Iris/widgets/Table.lua +635 -0
  643. package/runtime/Iris/widgets/Text.lua +132 -0
  644. package/runtime/Iris/widgets/Tree.lua +287 -0
  645. package/runtime/Iris/widgets/Window.lua +1075 -0
  646. package/runtime/Iris/widgets/init.lua +447 -0
  647. package/runtime/Janitor/FastDefer.luau +33 -0
  648. package/runtime/Janitor/LICENSE +21 -0
  649. package/runtime/Janitor/_impl/FastDefer.luau +33 -0
  650. package/runtime/Janitor/_impl/LICENSE +21 -0
  651. package/runtime/Janitor/_impl/init.luau +999 -0
  652. package/runtime/Janitor/init.luau +45 -0
  653. package/runtime/MathUtils/init.luau +100 -0
  654. package/runtime/Module3D/LICENSE +21 -0
  655. package/runtime/Module3D/_impl/LICENSE +21 -0
  656. package/runtime/Module3D/_impl/init.luau +269 -0
  657. package/runtime/Module3D/init.luau +14 -0
  658. package/runtime/Net/init.luau +125 -0
  659. package/runtime/Net/src/codec.luau +153 -0
  660. package/runtime/Occlude/init.luau +54 -0
  661. package/runtime/Promise/LICENSE +21 -0
  662. package/runtime/Promise/_impl/LICENSE +21 -0
  663. package/runtime/Promise/_impl/init.lua +1991 -0
  664. package/runtime/Promise/init.lua +1990 -0
  665. package/runtime/Promise/init.luau +13 -0
  666. package/runtime/Promise/types.luau +46 -0
  667. package/runtime/SOURCES.md +22 -0
  668. package/runtime/Spring/LICENSE +201 -0
  669. package/runtime/Spring/_impl/LICENSE +201 -0
  670. package/runtime/Spring/_impl/init.luau +111 -0
  671. package/runtime/Spring/init.luau +24 -0
  672. package/runtime/StateMachine/Classes/State.lua +375 -0
  673. package/runtime/StateMachine/Classes/Transition.lua +336 -0
  674. package/runtime/StateMachine/Functions/deepCopy.lua +19 -0
  675. package/runtime/StateMachine/Functions/mergeTables.lua +22 -0
  676. package/runtime/StateMachine/LICENSE +19 -0
  677. package/runtime/StateMachine/Vendor/Signal.lua +386 -0
  678. package/runtime/StateMachine/Vendor/Trove.lua +188 -0
  679. package/runtime/StateMachine/_impl/Classes/State.lua +375 -0
  680. package/runtime/StateMachine/_impl/Classes/Transition.lua +336 -0
  681. package/runtime/StateMachine/_impl/Functions/deepCopy.lua +19 -0
  682. package/runtime/StateMachine/_impl/Functions/mergeTables.lua +22 -0
  683. package/runtime/StateMachine/_impl/LICENSE +19 -0
  684. package/runtime/StateMachine/_impl/Vendor/Signal.lua +386 -0
  685. package/runtime/StateMachine/_impl/Vendor/Trove.lua +188 -0
  686. package/runtime/StateMachine/_impl/init.lua +595 -0
  687. package/runtime/StateMachine/init.lua +595 -0
  688. package/runtime/StateMachine/init.luau +10 -0
  689. package/runtime/StickyBillboard/init.luau +167 -0
  690. package/runtime/TopbarPlus/Attribute.lua +35 -0
  691. package/runtime/TopbarPlus/Elements/Caption.lua +316 -0
  692. package/runtime/TopbarPlus/Elements/Container.lua +215 -0
  693. package/runtime/TopbarPlus/Elements/Dropdown.lua +315 -0
  694. package/runtime/TopbarPlus/Elements/Indicator.lua +91 -0
  695. package/runtime/TopbarPlus/Elements/Menu.lua +180 -0
  696. package/runtime/TopbarPlus/Elements/Notice.lua +113 -0
  697. package/runtime/TopbarPlus/Elements/Selection.lua +49 -0
  698. package/runtime/TopbarPlus/Elements/Widget.lua +437 -0
  699. package/runtime/TopbarPlus/Features/Gamepad.lua +201 -0
  700. package/runtime/TopbarPlus/Features/Overflow.lua +360 -0
  701. package/runtime/TopbarPlus/Features/Themes/Classic.lua +27 -0
  702. package/runtime/TopbarPlus/Features/Themes/Default.lua +75 -0
  703. package/runtime/TopbarPlus/Features/Themes/init.lua +353 -0
  704. package/runtime/TopbarPlus/LICENSE +381 -0
  705. package/runtime/TopbarPlus/Packages/GoodSignal.lua +182 -0
  706. package/runtime/TopbarPlus/Packages/Janitor.lua +322 -0
  707. package/runtime/TopbarPlus/Reference.lua +30 -0
  708. package/runtime/TopbarPlus/Types.lua +477 -0
  709. package/runtime/TopbarPlus/Utility.lua +462 -0
  710. package/runtime/TopbarPlus/VERSION.lua +51 -0
  711. package/runtime/TopbarPlus/_impl/Attribute.lua +35 -0
  712. package/runtime/TopbarPlus/_impl/Elements/Caption.lua +316 -0
  713. package/runtime/TopbarPlus/_impl/Elements/Container.lua +215 -0
  714. package/runtime/TopbarPlus/_impl/Elements/Dropdown.lua +315 -0
  715. package/runtime/TopbarPlus/_impl/Elements/Indicator.lua +91 -0
  716. package/runtime/TopbarPlus/_impl/Elements/Menu.lua +180 -0
  717. package/runtime/TopbarPlus/_impl/Elements/Notice.lua +113 -0
  718. package/runtime/TopbarPlus/_impl/Elements/Selection.lua +49 -0
  719. package/runtime/TopbarPlus/_impl/Elements/Widget.lua +437 -0
  720. package/runtime/TopbarPlus/_impl/Features/Gamepad.lua +201 -0
  721. package/runtime/TopbarPlus/_impl/Features/Overflow.lua +360 -0
  722. package/runtime/TopbarPlus/_impl/Features/Themes/Classic.lua +27 -0
  723. package/runtime/TopbarPlus/_impl/Features/Themes/Default.lua +75 -0
  724. package/runtime/TopbarPlus/_impl/Features/Themes/init.lua +353 -0
  725. package/runtime/TopbarPlus/_impl/LICENSE +381 -0
  726. package/runtime/TopbarPlus/_impl/Packages/GoodSignal.lua +182 -0
  727. package/runtime/TopbarPlus/_impl/Packages/Janitor.lua +322 -0
  728. package/runtime/TopbarPlus/_impl/Reference.lua +30 -0
  729. package/runtime/TopbarPlus/_impl/Types.lua +477 -0
  730. package/runtime/TopbarPlus/_impl/Utility.lua +462 -0
  731. package/runtime/TopbarPlus/_impl/VERSION.lua +51 -0
  732. package/runtime/TopbarPlus/_impl/init.lua +1249 -0
  733. package/runtime/TopbarPlus/init.lua +1249 -0
  734. package/runtime/TopbarPlus/init.luau +8 -0
  735. package/runtime/Twinkle/init.luau +157 -0
  736. package/runtime/VfxUtil/init.luau +164 -0
  737. package/src/api.generated.js +3675 -0
  738. package/src/api.js +57 -0
  739. package/src/architecture.js +393 -0
  740. package/src/cli.js +192 -0
  741. package/src/compile.js +40 -0
  742. package/src/emit.js +213 -0
  743. package/src/lex.js +149 -0
  744. package/src/libs.js +355 -0
  745. package/src/parse.js +421 -0
  746. package/src/preprocess.js +80 -0
  747. package/src/understand.js +453 -0
  748. package/templates/game/.clangd +5 -0
  749. package/templates/game/.vscode/c_cpp_properties.json +23 -0
  750. package/templates/game/.vscode/settings.json +12 -0
  751. package/templates/game/Packages/.gitkeep +0 -0
  752. package/templates/game/cluaupp.config.json +6 -0
  753. package/templates/game/compile_flags.txt +3 -0
  754. package/templates/game/default.project.json +39 -0
  755. package/templates/game/package.json +9 -0
  756. package/templates/game/src/client/init.client.cpp +5 -0
  757. package/templates/game/src/server/leaderstats.server.cpp +28 -0
  758. package/templates/game/src/shared/config.cpp +5 -0
  759. package/templates/game/src/shared/config.h +3 -0
  760. 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