Skip to content

Commit 9d6f750

Browse files
Fix types (#104)
* Fix settings and UserSettings types to include subinstances * Fix raycast type * Regenerate * Regenerate
1 parent e233374 commit 9d6f750

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

scripts/dumpRobloxTypes.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"BlockMesh", # its superclass is marked as deprecated but it isn't, so its broken
4848
"Enum", # redefined explicitly
4949
"EnumItem", # redefined explicitly
50+
"GlobalSettings", # redefined explicitly
5051
]
5152

5253
# These classes are deferred to the very end of the dump, so that they have access to all the types
@@ -56,7 +57,6 @@
5657
"DataModel",
5758
"GenericSettings",
5859
"AnalysticsSettings",
59-
"GlobalSettings",
6060
"UserSettings",
6161
# Plugin is deferred after its items are declared
6262
"Plugin",
@@ -95,6 +95,7 @@
9595
],
9696
"Players": ["GetPlayers"],
9797
"ContextActionService": ["BindAction", "BindActionAtPriority"],
98+
"WorldRoot": ["Raycast"],
9899
}
99100

100101
# Extra members to add in to classes, commonly used to add in metamethods, and add corrections
@@ -144,7 +145,8 @@
144145
"function __mul(self, other: Vector3): Vector3",
145146
],
146147
"UserSettings": [
147-
'function GetService(self, service: "UserGameSettings"): UserGameSettings'
148+
"GameSettings: UserGameSettings",
149+
'function GetService(self, service: "UserGameSettings"): UserGameSettings',
148150
],
149151
"Instance": [
150152
"Parent: Instance?",
@@ -186,6 +188,9 @@
186188
"PluginToolbar": [
187189
"function CreateButton(self, id: string, toolTip: string, iconAsset: string, text: string?): PluginToolbarButton",
188190
],
191+
"WorldRoot": [
192+
"function Raycast(self, origin: Vector3, direction: Vector3, raycastParams: RaycastParams?): RaycastResult?"
193+
],
189194
}
190195

191196
# Hardcoded types
@@ -252,6 +257,18 @@
252257
# More hardcoded types, but go at the end of the file
253258
# Useful if they rely on previously defined types
254259
END_BASE = """
260+
declare class GlobalSettings extends GenericSettings
261+
Lua: LuaSettings
262+
Game: GameSettings
263+
Studio: Studio
264+
Network: NetworkSettings
265+
Physics: PhysicsSettings
266+
Rendering: RenderSettings
267+
Diagnostics: DebugSettings
268+
function GetFFlag(self, name: string): boolean
269+
function GetFVariable(self, name: string): string
270+
end
271+
255272
declare game: DataModel
256273
declare workspace: Workspace
257274
declare plugin: Plugin

scripts/globalTypes.d.lua

Lines changed: 14 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)