Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions AutoComplete/library/fs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,21 @@ declare const fs: {
* @return {BinaryFile | void} The (hopefully) opened file
*/
open(path: string, openmode: "w" | "r" | "a"): BinaryFile | void;

/**
* Opens a file to read/write data that can also be compressed
* If you dont skip the header putting anything that isn't 'store' or 'none' will ignore what you supply and read the header, otherwise it will trust you
* @param {string} path The path from Scripts/Data
* @param {"w" | "r" | "a" | nil} openmode how to open the file, w is write mode, r is read mode, a is append(and it will add to an existing file or start), nil to open a memory stream
* @param {"lzma" | "deflate" | "gzip2" | "store" | "none"} compressionType The compression type to use, anything that isn't store or none will have compression enabled
* @param {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9} compressionLevel The compression level to use, 0 is terrible compression, 1 is fastest, 6 is balanced, 9 is best compression
* @param {boolean} compressionHeader If you want to skip the header, if you do you can't read the file without knowing the compression type
*/
open(path: string,
openmode: "w" | "r" | "a",
compressionType: "lzma" | "deflate" | "gzip2" | "store" | "none",
compressionLevel: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9,
compressionHeader: boolean): void
}

declare interface Stats {
Expand Down
98 changes: 86 additions & 12 deletions AutoComplete/library/gfx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ declare namespace gfx {
* @param {number} r red
* @param {number} g green
* @param {number} b blue
* @param {number?} a opacity

*/
function color(r: number, g: number, b: number): void;
function color(r: number, g: number, b: number, a?: number): void;

/**
* Sets the texture drawing color, values range from 0 to 255
* Gfx texture drawing functions will tint using this color
* @param {number} r red
* @param {number} g green
* @param {number} b blue
* @param {number?} a opacity
*/
function tcolor(r: number, g: number, b: number): void;
function tcolor(r: number, g: number, b: number, a?: number): void;

/**
* Sets if the 3D rendering should render trough blocks
Expand All @@ -25,20 +28,30 @@ declare namespace gfx {
function renderBehind(phaseTroughBlocks: boolean): void;

/**
* Sets the drawing color, values range from 0 to 255
* Gfx drawing functions will use this color
* @param {number} r red
* @param {number} g green
* @param {number} b blue
* @param {number} a Opacity
* The render origin (the player's eyes for first person)
* @returns {LuaMultiReturn<[number, number, number]>} x, y, z
*/
function color(r: number, g: number, b: number, a: number): void;
function origin(): LuaMultiReturn<[number, number, number]>;

/**
* The render origin (the player's eyes for first person)
* @returns {LuaMultiReturn<[number, number, number]>}
* Gets screen position from world position
* Getting nil means that the position is not on screen
* @param {number} x The world position X
* @param {number} y The world position Y
* @param {number} z The world position Z
* @returns {LuaMultiReturn<[number|null, number|null]>} The screen position X, The screen position Y
*/
function origin(): LuaMultiReturn<[number, number, number]>;
function worldToScreen(x: number, y: number, z: number): LuaMultiReturn<[number|null, number|null]>


/**
* Gets screen position from world position and gives you a table of number with a size of 2
* @param {number} x The world position X
* @param {number} y The world position Y
* @param {number} z The world position Z
* @return {number[]|null} x The screen position X
*/
function worldToScreen2(x: number, y: number, z: number): number[]|null

/**
* Renders a rectangle
Expand Down Expand Up @@ -501,6 +514,65 @@ declare namespace gfx {
bothSides?: boolean
): void;

/**
* Renders a lot of textured quads
* This allows it to do it much quicker as it batches it instead of having one draw call per texture quad like tquad
* You can use parts of a texture with uv to have more textures in one draw
* You should sort the quads by color and texture to call this function less times, but with as much data as possible each time.
* quads is a table of table containing 20 numbers
* you have 4 corners, each corner has 5 numbers (x, y, z, uvx, uvy)
* exemple order: top left, bottom left, bottom right, top right
* @param {number[][]} quads The quads to render
* @param {string} texturePath the texture file (starting with "textures" will be taken from the resource pack otherwise data folder)
* @param {boolean|null} bothSides Should render both sides (would be visible from only one side if set to false/nil)
*/
function tquadbatch(quads: number[][], texturePath: string, bothSides: boolean|null): void

/**
* Changes the lighting parameters for future gfx calls (3d only)
* @param {number} AreaStartX The starting X position of the area
* @param {number} AreaStartY The starting Y position of the area
* @param {number} AreaStartZ The starting Z position of the area
* @param {number} AreaEndX The ending X position of the area
* @param {number} AreaEndY The ending Y position of the area
* @param {number} AreaEndZ The ending Z position of the area
* @param {number?} minimumBrightness The minimum brightness (Must be an integer)
*/
function setupLights(
AreaStartX: number,
AreaStartY: number,
AreaStartZ: number,
AreaEndX: number,
AreaEndY: number,
AreaEndZ: number,
minimumBrightness?: number): void

/**
* Changes the lighting parameters for future gfx calls (3d only)
* @param {number} AreaStartX The starting X position of the area
* @param {number} AreaStartY The starting Y position of the area
* @param {number} AreaStartZ The starting Z position of the area
* @param {number} AreaEndX The ending X position of the area
* @param {number} AreaEndY The ending Y position of the area
* @param {number} AreaEndZ The ending Z position of the area
* @param {number} CenterX The center X of the area, you can uncenter it if it gives an effect you prefer
* @param {number} CenterY The center Y of the area, you can uncenter it if it gives an effect you prefer
* @param {number} CenterZ The center Z of the area, you can uncenter it if it gives an effect you prefer
* @param {number?} minimumBrightness The minimum brightness (Must be an integer)
*/
function setupLights(
AreaStartX: number,
AreaStartY: number,
AreaStartZ: number,
AreaEndX: number,
AreaEndY: number,
AreaEndZ: number,
CenterX: number,
CenterY: number,
CenterZ: number,
minimumBrightness?: number): void


/**
* @param {string} content Filepath to the .obj file
* @param {boolean?} isFilepath use 'content' as filepath or obj file content
Expand All @@ -515,6 +587,8 @@ declare namespace gfx {
*/
function objRender(mesh: any, texture?: string): void;



/**
* Pushes transformation(s)
* @param transformations
Expand Down
49 changes: 35 additions & 14 deletions AutoComplete/library/gfx2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,10 @@ declare interface Gfx2Texture {
* @param {number} r new red color value (0-255)
* @param {number} g new green color value (0-255)
* @param {number} b new blue color value (0-255)
* @param {number?} a new alpha value (0-255)
* @diagnostic disable-next-line: duplicate-set-field
*/
setPixel(x: number, y: number, r: number, g: number, b: number): void;

/**
* Sets the color of a pixel in the texture, you must unload if you used it for changes to apply
* @param {number} x X position of the pixel to get
* @param {number} y Y position of the pixel to get
* @param {number} r new red color value (0-255)
* @param {number} g new green color value (0-255)
* @param {number} b new blue color value (0-255)
* @param {number} a new alpha value (0-255)
* @diagnostic disable-next-line: duplicate-set-field
*/
setPixel(x: number, y: number, r: number, g: number, b: number, a: number): void;
setPixel(x: number, y: number, r: number, g: number, b: number, a?: number): void;

/**
* Saves the texture to a png file (for if you wana draw to it using setPixel)
Expand Down Expand Up @@ -92,10 +81,25 @@ declare namespace gfx2 {
* @param {number} r 0-255 color code
* @param {number} g 0-255 color code
* @param {number} b 0-255 color code
* @param {number?} a 0-255 color code
* @param {number?} a opacity 0-255 color code
*/
function color(r: number, g: number, b: number, a?: number): void;

/**
* Changes the tint color of images that will be rendered
* @param setting Setting client color(pls or u crash) setting
*/
function tcolor(setting: ColorSetting | ColorProperties): void;

/**
* Changes the tint color of images that will be rendered
* @param {number} r 0-255 color code
* @param {number} g 0-255 color code
* @param {number} b 0-255 color code
* @param {number?} a opacity 0-255 color code
*/
function tcolor(r: number, g: number, b: number, a?: number): void;

/**
* Gives you the size of the current render target
* @returns {number} width
Expand Down Expand Up @@ -161,6 +165,23 @@ declare namespace gfx2 {
*/
function drawRoundRect(x: number, y: number, width: number, height: number, radius: number, lineWidth: number): void;

/**
* Fills an elipse (circle but possibly wider)
* @param {number} centerX The X axis center position of the elipse
* @param {number} centerY The Y axis center position of the elipse
* @param {number} radius How big is the circle
*/
function fillElipse(centerX: number, centerY: number, radius: number): void;

/**
* Fills an elipse (circle but possibly wider)
* @param {number} centerX The X axis center position of the elipse
* @param {number} centerY The Y axis center position of the elipse
* @param {number} radiusX How Wide is the elipse
* @param {number} radiusY how High is the elipse
*/
function fillElipse(centerX: number, centerY: number, radiusX: number, radiusY: number): void;

/**
* Draws an elipse (circle but possibly wider)
* @param {number} centerX The X axis center position of the elipse
Expand Down