Skip to content

Commit f7b9df2

Browse files
committed
Updated documentation (Beta 5)
1 parent a89f467 commit f7b9df2

162 files changed

Lines changed: 5577 additions & 2391 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

definitions/feature/command.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ interface CommandEvents {
33
* Called on any command being used.
44
* @param label The beginning of the command line (for example, `'test'` in '.test 123')
55
* @param args The list of arguments of the command line (for example, `['123']` in '.test 123')
6+
* @param commandLine The command line (for example, `'.test 123 test'` in '.test 123 test')
67
* @returns Whether the command usage is successful or not (return `false` if the user misused the command)
78
*/
8-
"execute" : (label: string, args: string[]) => boolean;
9+
"execute" : (label: string, args: string[], commandLine: string) => boolean;
910
}
1011

1112
// A class representing a Latite Client command.

definitions/feature/module.d.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ declare class Module {
8787
* @param name The internal name
8888
* @param displayName The name that shows in the menu
8989
* @param description A short description of what the setting does
90+
* @param defVal The default value
9091
*/
91-
addBoolSetting(name: string, displayName: string, description: string): Setting;
92+
addBoolSetting(name: string, displayName: string, description: string, defVal: boolean): Setting;
9293

9394
/**
9495
* Adds a setting.
@@ -98,6 +99,25 @@ declare class Module {
9899
* @param min The minimum value
99100
* @param max The maximum value
100101
* @param interval The precision of the setting
102+
* @param defVal The default value
101103
*/
102-
addNumberSetting(name: string, displayName: string, description: string, min: number, max: number, interval: number): Setting;
104+
addNumberSetting(name: string, displayName: string, description: string, min: number, max: number, interval: number, defVal: number): Setting;
105+
106+
/**
107+
Adds a setting.
108+
* @param name The internal name
109+
* @param displayName The name that shows in the menu
110+
* @param description A short description of what the setting does
111+
* @param defVal The default value
112+
*/
113+
addKeySetting(name: string, displayName: string, description: string, defVal: KeyCode): Setting;
114+
115+
/**
116+
Adds a setting.
117+
* @param name The internal name
118+
* @param displayName The name that shows in the menu
119+
* @param description A short description of what the setting does
120+
* @param defVal The default value
121+
*/
122+
addTextSetting(name: string, displayName: string, description: string, defVal: string): Setting;
103123
}

definitions/feature/setting.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ declare class Setting {
1717
* Gets the value of the setting. Could be null.
1818
*/
1919
getValue(): any;
20+
21+
/**
22+
* Set that this setting will only show when another setting is on or off.
23+
* @param settingName The setting that this setting will depend on (internal name).
24+
* @param value The value the other setting needs to be for this setting to show
25+
*/
26+
setCondition(settingName: string, value?: boolean): void;
2027
}

definitions/gfx/graphics.d.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,40 @@ declare const enum VerticalAlignment {
103103
Center
104104
}
105105

106-
declare interface DXGraphics {
106+
type BackendType
107+
=
108+
/**
109+
* */
110+
"dx";
111+
112+
declare interface Graphics {
113+
/**
114+
*
115+
* @param renderer `"dx"`: uses Direct2D/DirectWrite, `"minecraft":` use the Minecraft renderer
116+
*/
117+
use(renderer: "dx" | "minecraft"): void;
107118
drawRect(rect: Rect, color: Color, thickness: number): void;
108119
fillRect(rect: Rect, color: Color): void;
120+
121+
/**
122+
* Draws text on the position specified
123+
* @param pos The position to draw the text
124+
* @param text The text to draw
125+
* @param size The size of the text in pixels
126+
* @param color The color of the text
127+
*/
128+
drawText(pos: Vector2, text: string, size: number, color: Color): void;
129+
130+
/**
131+
* A full verison of drawText, where you can specify the bounds of the text and the alignment
132+
* @param area The place to render the text
133+
* @param text The text to render
134+
* @param size The size of the text
135+
* @param color The color of the text
136+
* @param alignment The horizontal alignment
137+
* @param verticalAlignment The vertical alignment
138+
*/
139+
drawTextFull(area: Rect, text: string, size: number, color: Color, alignment: TextAlignment, verticalAlignment: VerticalAlignment): void;
109140
}
110141

111-
declare const dx: DXGraphics;
142+
declare const graphics: Graphics;

definitions/index.d.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/// <reference path="./script.d.ts" />
2+
/// <reference path="./game.d.ts" />
3+
/// <reference path="./latite.d.ts" />
4+
5+
/// <reference path="./world/world.d.ts" />
6+
/// <reference path="./world/item.d.ts" />
7+
/// <reference path="./world/entity.d.ts" />
8+
9+
/// <reference path="./util/util.d.ts" />
10+
/// <reference path="./util/buffer.d.ts" />
11+
12+
/// <reference path="./lib/clipboard.d.ts" />
13+
/// <reference path="./lib/filesystem.d.ts" />
14+
/// <reference path="./lib/network.d.ts" />
15+
16+
/// <reference path="./gfx/graphics.d.ts" />
17+
/// <reference path="./gfx/graphics3.d.ts" />
18+
19+
20+
/// <reference path="./feature/command.d.ts" />
21+
/// <reference path="./feature/module.d.ts" />
22+
/// <reference path="./feature/setting.d.ts" />
23+
/// <reference path="./feature/hudmodule.d.ts" />
24+
/// <reference path="./feature/manager/mmgr.d.ts" />
25+
/// <reference path="./feature/manager/commandmgr.d.ts" />
26+
27+
/// <reference path="./api/TextColor.d.ts" />

definitions/lib/clipboard.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
declare namespace include {
2+
export interface Clipboard {
3+
/**
4+
* Gets the current clipboard text
5+
*/
6+
get(): string;
7+
8+
/**
9+
* Sets the clipboard text
10+
* @param str The text to set the clipboard to
11+
*/
12+
set(str: string): void;
13+
14+
15+
/**
16+
* Gets the copied bitmap. If the clipboard is unable to be opened, it will return null
17+
*/
18+
getBitmap(): Buffer | null;
19+
}
20+
}

definitions/script.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ declare var script: Script;
1515
interface EngineLibraries {
1616
"filesystem": include.Filesystem
1717
"network": include.Network
18+
"clipboard": include.Clipboard
1819
}
1920

2021
/**

definitions/util/buffer.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
declare interface Uint8Array {
2+
readInt16(idx: number): number;
23
readInt32(idx: number): number;
34
readInt64AsFloat(idx: number): number;
45

docs-markdown/exports.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
- [game](module.game/index.md)
1919
- [gfx/graphics](module.gfx_graphics/index.md)
2020
- [gfx/graphics3](module.gfx_graphics3/index.md)
21+
- [index](module.index/index.md)
2122
- [key](module.key/index.md)
2223
- [latite](module.latite/index.md)
24+
- [lib/clipboard](module.lib_clipboard/index.md)
2325
- [lib/filesystem](module.lib_filesystem/index.md)
2426
- [lib/network](module.lib_network/index.md)
2527
- [script](module.script/index.md)

0 commit comments

Comments
 (0)