diff --git a/autogen/mdgen.js b/autogen/mdgen.js index 783a004..2f33924 100644 --- a/autogen/mdgen.js +++ b/autogen/mdgen.js @@ -8,6 +8,28 @@ const iconDataPath = path.join(__dirname, "../", "docs/theme/.icons", "polytoria const yamlEnumPath = path.join(__dirname, "../", "yaml", "enums") const mdEnumPath = path.join(__dirname, "../", "docs/api", "enums") +// Cleanup md (excluding index.md files) +if (fs.existsSync(mdAPIPath)) { + const files = fs.readdirSync(mdAPIPath) + for (const file of files) { + if (file !== 'index.md') { + const filePath = path.join(mdAPIPath, file) + fs.rmSync(filePath, { recursive: true, force: true }) + } + } +} + +if (fs.existsSync(mdEnumPath)) { + const files = fs.readdirSync(mdEnumPath) + for (const file of files) { + if (file !== 'index.md') { + const filePath = path.join(mdEnumPath, file) + fs.rmSync(filePath, { recursive: true, force: true }) + } + } +} + +// Create directories if (!fs.existsSync(mdAPIPath)) { fs.mkdirSync(mdAPIPath, { recursive: true }) } diff --git a/autogen/yamlgen.js b/autogen/yamlgen.js index c9ba423..dc1f12a 100644 --- a/autogen/yamlgen.js +++ b/autogen/yamlgen.js @@ -15,6 +15,40 @@ if (!fs.existsSync(yamlEnumPath)) { const data = JSON.parse(fs.readFileSync("def.json", "utf-8")) +// Track current classes and enums +const currentClasses = new Set(data.Classes.map(c => c.Name)) +const currentEnums = new Set(data.Enums.map(e => e.Name)) + +// Clean up removed classes +if (fs.existsSync(yamlAPIPath)) { + const existingFiles = fs.readdirSync(yamlAPIPath) + for (const file of existingFiles) { + if (file.endsWith('.yaml')) { + const className = path.basename(file, '.yaml') + if (!currentClasses.has(className)) { + const filePath = path.join(yamlAPIPath, file) + fs.unlinkSync(filePath) + console.log(`Removed obsolete class: ${className}`) + } + } + } +} + +// Clean up removed enums +if (fs.existsSync(yamlEnumPath)) { + const existingFiles = fs.readdirSync(yamlEnumPath) + for (const file of existingFiles) { + if (file.endsWith('.yaml')) { + const enumName = path.basename(file, '.yaml') + if (!currentEnums.has(enumName)) { + const filePath = path.join(yamlEnumPath, file) + fs.unlinkSync(filePath) + console.log(`Removed obsolete enum: ${enumName}`) + } + } + } +} + // Process Classes for (const c of data.Classes) { let yamlPath = path.join(yamlAPIPath, c.Name + ".yaml") diff --git a/yaml/enums/GradientImageFill.yaml b/yaml/enums/GradientImageFill.yaml new file mode 100644 index 0000000..9428dca --- /dev/null +++ b/yaml/enums/GradientImageFill.yaml @@ -0,0 +1,10 @@ +Name: GradientImageFill +InternalName: GradientImageFillEnum +Options: + - Name: Linear + Description: "" + - Name: Radial + Description: "" + - Name: Square + Description: "" +Description: "" diff --git a/yaml/types/AchievementsService.yaml b/yaml/types/AchievementsService.yaml index 598a612..4938e87 100644 --- a/yaml/types/AchievementsService.yaml +++ b/yaml/types/AchievementsService.yaml @@ -44,7 +44,7 @@ Methods: Type: number IsOptional: false DefaultValue: "" - IsAsync: false + IsAsync: true IsObsolete: false IsStatic: false Description: Check if player of ID has the achievement, asynchronously. diff --git a/yaml/types/AddonObject.yaml b/yaml/types/AddonObject.yaml index 8b472fa..76ab981 100644 --- a/yaml/types/AddonObject.yaml +++ b/yaml/types/AddonObject.yaml @@ -34,7 +34,10 @@ Methods: IsObsolete: false IsStatic: false Description: Missing Documentation -Events: [] +Events: + - Name: CleanupReceived + Arguments: "" + Description: Missing Documentation IsStatic: false IsAbstract: false IsInstantiatable: false diff --git a/yaml/types/AssetsService.yaml b/yaml/types/AssetsService.yaml index 6f23648..1638383 100644 --- a/yaml/types/AssetsService.yaml +++ b/yaml/types/AssetsService.yaml @@ -46,6 +46,28 @@ Methods: IsObsolete: false IsStatic: false Description: Create new mesh from Polytoria with the target ID + - Name: GetFileLinkByPath + ReturnType: FileLinkAsset + Parameters: + - Name: path + Type: string + IsOptional: false + DefaultValue: "" + IsAsync: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation + - Name: GetFileLinkByID + ReturnType: FileLinkAsset + Parameters: + - Name: id + Type: string + IsOptional: false + DefaultValue: "" + IsAsync: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation Events: [] IsStatic: true IsAbstract: false diff --git a/yaml/types/Camera.yaml b/yaml/types/Camera.yaml index 68e528b..d9872e0 100644 --- a/yaml/types/Camera.yaml +++ b/yaml/types/Camera.yaml @@ -173,7 +173,7 @@ Methods: IsOptional: false DefaultValue: "" - Name: ignoreList - Type: table + Type: "{ Instance }" IsOptional: true DefaultValue: null - Name: maxDistance @@ -194,7 +194,7 @@ Methods: IsOptional: false DefaultValue: "" - Name: ignoreList - Type: table + Type: "{ Instance }" IsOptional: true DefaultValue: null - Name: maxDistance diff --git a/yaml/types/ColorSeries.yaml b/yaml/types/ColorSeries.yaml index d901074..faff7a0 100644 --- a/yaml/types/ColorSeries.yaml +++ b/yaml/types/ColorSeries.yaml @@ -65,14 +65,14 @@ Methods: IsStatic: false Description: Removes the point at the specified index from the color series. - Name: GetOffsets - ReturnType: table + ReturnType: "{ number }" Parameters: [] IsAsync: false IsObsolete: false IsStatic: false Description: Missing Documentation - Name: GetColors - ReturnType: table + ReturnType: "{ Color }" Parameters: [] IsAsync: false IsObsolete: false diff --git a/yaml/types/CreatorSelections.yaml b/yaml/types/CreatorSelections.yaml index f304042..996f4cc 100644 --- a/yaml/types/CreatorSelections.yaml +++ b/yaml/types/CreatorSelections.yaml @@ -24,6 +24,13 @@ Methods: IsObsolete: false IsStatic: false Description: Select all children of the instance + - Name: GetSelected + ReturnType: "{ Instance }" + Parameters: [] + IsAsync: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation - Name: Deselect ReturnType: nil Parameters: diff --git a/yaml/types/Datastore.yaml b/yaml/types/Datastore.yaml index 63d898c..1b59c22 100644 --- a/yaml/types/Datastore.yaml +++ b/yaml/types/Datastore.yaml @@ -16,7 +16,7 @@ Methods: Type: string IsOptional: false DefaultValue: "" - IsAsync: false + IsAsync: true IsObsolete: false IsStatic: false Description: Retrieves a value from the datastore asynchronously using the @@ -32,7 +32,7 @@ Methods: Type: any IsOptional: false DefaultValue: "" - IsAsync: false + IsAsync: true IsObsolete: false IsStatic: false Description: Stores a value in the datastore asynchronously using the specified key. @@ -43,14 +43,18 @@ Methods: Type: string IsOptional: false DefaultValue: "" - IsAsync: false + IsAsync: true IsObsolete: false IsStatic: false Description: Removes a value from the datastore asynchronously using the specified key. -Events: - - Name: Loaded - Arguments: "" - Description: Fires when this datastore has been loaded + - Name: Disconnect + ReturnType: nil + Parameters: [] + IsAsync: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation +Events: [] IsStatic: false IsAbstract: false IsInstantiatable: false diff --git a/yaml/types/Environment.yaml b/yaml/types/Environment.yaml index 8a08b6d..af603a0 100644 --- a/yaml/types/Environment.yaml +++ b/yaml/types/Environment.yaml @@ -48,7 +48,7 @@ Methods: IsOptional: true DefaultValue: "10000" - Name: ignoreList - Type: table + Type: "{ Instance }" IsOptional: true DefaultValue: null IsAsync: false @@ -57,7 +57,7 @@ Methods: Description: Casts a ray from origin with a specified direction and returns a RayResult for the first hit object. - Name: RaycastAll - ReturnType: table + ReturnType: "{ RayResult }" Parameters: - Name: origin Type: Vector3 @@ -72,7 +72,7 @@ Methods: IsOptional: true DefaultValue: "1000" - Name: ignoreList - Type: table + Type: "{ Instance }" IsOptional: true DefaultValue: null IsAsync: false @@ -81,7 +81,7 @@ Methods: Description: Casts a ray from origin with a specified direction and returns a RayResult array for all hit objects. - Name: OverlapSphere - ReturnType: table + ReturnType: "{ Instance }" Parameters: - Name: origin Type: Vector3 @@ -92,7 +92,7 @@ Methods: IsOptional: false DefaultValue: "" - Name: ignoreList - Type: table + Type: "{ Instance }" IsOptional: true DefaultValue: null IsAsync: false @@ -101,7 +101,7 @@ Methods: Description: Returns a list of instances intersecting with the sphere in the given position and radius. - Name: OverlapBox - ReturnType: table + ReturnType: "{ Instance }" Parameters: - Name: pos Type: Vector3 @@ -116,7 +116,7 @@ Methods: IsOptional: false DefaultValue: "" - Name: ignoreList - Type: table + Type: "{ Instance }" IsOptional: true DefaultValue: null IsAsync: false diff --git a/yaml/types/GradientImageAsset.yaml b/yaml/types/GradientImageAsset.yaml new file mode 100644 index 0000000..6836acf --- /dev/null +++ b/yaml/types/GradientImageAsset.yaml @@ -0,0 +1,52 @@ +Name: GradientImageAsset +BaseType: ImageAsset +Properties: + - Name: Series + Type: ColorSeries + IsAccessibleByScripts: true + IsReadOnly: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation + - Name: Width + Type: number + IsAccessibleByScripts: true + IsReadOnly: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation + - Name: Height + Type: number + IsAccessibleByScripts: true + IsReadOnly: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation + - Name: Fill + Type: GradientImageFillEnum + IsAccessibleByScripts: true + IsReadOnly: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation + - Name: FillFrom + Type: Vector2 + IsAccessibleByScripts: true + IsReadOnly: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation + - Name: FillTo + Type: Vector2 + IsAccessibleByScripts: true + IsReadOnly: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation +Methods: [] +Events: [] +IsStatic: false +IsAbstract: false +IsInstantiatable: true +StaticAlias: null +Description: Missing Documentation diff --git a/yaml/types/Hidden.yaml b/yaml/types/Hidden.yaml index 134673e..e224061 100644 --- a/yaml/types/Hidden.yaml +++ b/yaml/types/Hidden.yaml @@ -1,10 +1,10 @@ Name: Hidden -BaseType: Instance +BaseType: HiddenBase Properties: [] Methods: [] Events: [] -IsStatic: false +IsStatic: true IsAbstract: false IsInstantiatable: false -StaticAlias: null +StaticAlias: Hidden Description: Hidden is a object used for hiding instances. diff --git a/yaml/types/HiddenBase.yaml b/yaml/types/HiddenBase.yaml new file mode 100644 index 0000000..c973970 --- /dev/null +++ b/yaml/types/HiddenBase.yaml @@ -0,0 +1,10 @@ +Name: HiddenBase +BaseType: Instance +Properties: [] +Methods: [] +Events: [] +IsStatic: false +IsAbstract: true +IsInstantiatable: false +StaticAlias: null +Description: Missing Documentation diff --git a/yaml/types/IOService.yaml b/yaml/types/IOService.yaml index e61cb34..4c6c25f 100644 --- a/yaml/types/IOService.yaml +++ b/yaml/types/IOService.yaml @@ -13,6 +13,17 @@ Methods: IsObsolete: false IsStatic: false Description: Read the file data from path + - Name: ReadTextFromPath + ReturnType: string + Parameters: + - Name: path + Type: string + IsOptional: false + DefaultValue: "" + IsAsync: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation - Name: WriteBytesToPath ReturnType: nil Parameters: @@ -24,12 +35,27 @@ Methods: Type: buffer IsOptional: false DefaultValue: "" - IsAsync: true + IsAsync: false IsObsolete: false IsStatic: false Description: Write data to file in the project + - Name: WriteTextToPath + ReturnType: nil + Parameters: + - Name: path + Type: string + IsOptional: false + DefaultValue: "" + - Name: txt + Type: string + IsOptional: false + DefaultValue: "" + IsAsync: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation - Name: ListProjectFiles - ReturnType: table + ReturnType: "{ string }" Parameters: [] IsAsync: false IsObsolete: false diff --git a/yaml/types/InputService.yaml b/yaml/types/InputService.yaml index c0a8a5d..ab75840 100644 --- a/yaml/types/InputService.yaml +++ b/yaml/types/InputService.yaml @@ -83,7 +83,7 @@ Methods: ReturnType: Vector3 Parameters: - Name: ignoreList - Type: table + Type: "{ Instance }" IsOptional: true DefaultValue: null IsAsync: false @@ -172,13 +172,17 @@ Events: Description: Fires when gamepad has been disconnected - Name: KeyDown Arguments: - Name: keycode - Type: KeyCodeEnum + - Name: keycode + Type: KeyCodeEnum + - Name: gameFocused + Type: boolean Description: Fires when key has been pressed - Name: KeyUp Arguments: - Name: keycode - Type: KeyCodeEnum + - Name: keycode + Type: KeyCodeEnum + - Name: gameFocused + Type: boolean Description: Fires when key has been released - Name: AxisValueChanged Arguments: diff --git a/yaml/types/Instance.yaml b/yaml/types/Instance.yaml index 6242d95..ceb55ad 100644 --- a/yaml/types/Instance.yaml +++ b/yaml/types/Instance.yaml @@ -17,15 +17,22 @@ Properties: Description: Determine if children is editable, this is to be used if this instance is a Linked model. Only used in creator. - Name: Tags - Type: table + Type: "{ string }" IsAccessibleByScripts: true IsReadOnly: false IsObsolete: false IsStatic: false Description: Tags associated with this instance. + - Name: Archivable + Type: boolean + IsAccessibleByScripts: true + IsReadOnly: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation Methods: - Name: GetDescendants - ReturnType: table + ReturnType: "{ Instance }" Parameters: [] IsAsync: false IsObsolete: false @@ -80,7 +87,7 @@ Methods: IsStatic: false Description: Missing Documentation - Name: GetChildrenWithTag - ReturnType: table + ReturnType: "{ Instance }" Parameters: - Name: tag Type: string @@ -128,14 +135,14 @@ Methods: IsStatic: false Description: Move children to specified index - Name: GetChildren - ReturnType: table + ReturnType: "{ Instance }" Parameters: [] IsAsync: false IsObsolete: false IsStatic: false Description: Gets all children of this instance. - Name: GetChildrenOfClass - ReturnType: table + ReturnType: "{ Instance }" Parameters: - Name: className Type: string diff --git a/yaml/types/Inventory.yaml b/yaml/types/Inventory.yaml index 1f0a9b2..7127be6 100644 --- a/yaml/types/Inventory.yaml +++ b/yaml/types/Inventory.yaml @@ -1,5 +1,5 @@ Name: Inventory -BaseType: Hidden +BaseType: HiddenBase Properties: [] Methods: [] Events: [] diff --git a/yaml/types/Mesh.yaml b/yaml/types/Mesh.yaml index a74fae4..f5aca0c 100644 --- a/yaml/types/Mesh.yaml +++ b/yaml/types/Mesh.yaml @@ -64,6 +64,13 @@ Properties: IsObsolete: false IsStatic: false Description: Indicates whether an animation is currently playing on the mesh. + - Name: Loading + Type: boolean + IsAccessibleByScripts: true + IsReadOnly: true + IsObsolete: false + IsStatic: false + Description: Missing Documentation Methods: - Name: PlayAnimation ReturnType: nil @@ -96,20 +103,23 @@ Methods: IsStatic: false Description: Stops the specified animation on the mesh. - Name: GetAnimations - ReturnType: table + ReturnType: "{ string }" Parameters: [] IsAsync: false IsObsolete: false IsStatic: false Description: Gets a list of all animations available on the mesh. - Name: GetAnimationInfo - ReturnType: table + ReturnType: "{ MeshAnimationInfo }" Parameters: [] IsAsync: false IsObsolete: false IsStatic: false Description: Missing Documentation -Events: [] +Events: + - Name: Loaded + Arguments: "" + Description: Missing Documentation IsStatic: false IsAbstract: false IsInstantiatable: true diff --git a/yaml/types/PTSignal.yaml b/yaml/types/PTSignal.yaml index 6728e97..e520c22 100644 --- a/yaml/types/PTSignal.yaml +++ b/yaml/types/PTSignal.yaml @@ -27,7 +27,7 @@ Methods: - Name: __tostring ReturnType: string Parameters: - - Name: signal + - Name: _ Type: PTSignal IsOptional: false DefaultValue: "" diff --git a/yaml/types/Physical.yaml b/yaml/types/Physical.yaml index ed9cc12..bb57cde 100644 --- a/yaml/types/Physical.yaml +++ b/yaml/types/Physical.yaml @@ -42,7 +42,7 @@ Methods: IsStatic: false Description: Sets the network authority of this object to the specified player. - Name: GetTouching - ReturnType: table + ReturnType: "{ Physical }" Parameters: [] IsAsync: false IsObsolete: false diff --git a/yaml/types/PlacesService.yaml b/yaml/types/PlacesService.yaml index 1077da1..0b6bf29 100644 --- a/yaml/types/PlacesService.yaml +++ b/yaml/types/PlacesService.yaml @@ -43,7 +43,7 @@ Methods: ReturnType: nil Parameters: - Name: plrs - Type: table + Type: "{ Player }" IsOptional: false DefaultValue: "" - Name: to @@ -73,7 +73,7 @@ Methods: ReturnType: nil Parameters: - Name: players - Type: table + Type: "{ Player }" IsOptional: false DefaultValue: "" - Name: accessID diff --git a/yaml/types/PlayerDefaults.yaml b/yaml/types/PlayerDefaults.yaml index 3512f4b..ede93db 100644 --- a/yaml/types/PlayerDefaults.yaml +++ b/yaml/types/PlayerDefaults.yaml @@ -1,5 +1,5 @@ Name: PlayerDefaults -BaseType: Hidden +BaseType: HiddenBase Properties: - Name: MaxHealth Type: number diff --git a/yaml/types/Players.yaml b/yaml/types/Players.yaml index 35a96f0..beff99a 100644 --- a/yaml/types/Players.yaml +++ b/yaml/types/Players.yaml @@ -24,7 +24,7 @@ Properties: Description: The number of players currently in the game. Methods: - Name: GetPlayers - ReturnType: table + ReturnType: "{ Player }" Parameters: [] IsAsync: false IsObsolete: false diff --git a/yaml/types/PolytorianModel.yaml b/yaml/types/PolytorianModel.yaml index 9264510..182f222 100644 --- a/yaml/types/PolytorianModel.yaml +++ b/yaml/types/PolytorianModel.yaml @@ -161,6 +161,17 @@ Methods: IsObsolete: false IsStatic: false Description: Missing Documentation + - Name: SetAnimationOverrideTo + ReturnType: nil + Parameters: + - Name: to + Type: boolean + IsOptional: false + DefaultValue: "" + IsAsync: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation - Name: SetBoneOverridePosition ReturnType: nil Parameters: diff --git a/yaml/types/Script.yaml b/yaml/types/Script.yaml index e8986eb..715cfd4 100644 --- a/yaml/types/Script.yaml +++ b/yaml/types/Script.yaml @@ -60,6 +60,17 @@ Methods: IsObsolete: false IsStatic: false Description: Calls a function in the script asynchronously with the given arguments. + - Name: LinkWithScriptFile + ReturnType: nil + Parameters: + - Name: scriptPath + Type: string + IsOptional: false + DefaultValue: "" + IsAsync: false + IsObsolete: false + IsStatic: false + Description: Missing Documentation Events: [] IsStatic: false IsAbstract: true diff --git a/yaml/types/ServerHidden.yaml b/yaml/types/ServerHidden.yaml index c3c3da3..5c319ad 100644 --- a/yaml/types/ServerHidden.yaml +++ b/yaml/types/ServerHidden.yaml @@ -1,5 +1,5 @@ Name: ServerHidden -BaseType: Hidden +BaseType: HiddenBase Properties: [] Methods: [] Events: [] diff --git a/yaml/types/Temporary.yaml b/yaml/types/Temporary.yaml index ffb71d3..a4a3d13 100644 --- a/yaml/types/Temporary.yaml +++ b/yaml/types/Temporary.yaml @@ -1,5 +1,5 @@ Name: Temporary -BaseType: Hidden +BaseType: ServerHidden Properties: [] Methods: [] Events: []