This commit is contained in:
2021-06-23 23:24:10 -05:00
parent 128e58151b
commit 3a4dcbee61
35 changed files with 71 additions and 1850 deletions

File diff suppressed because it is too large Load Diff

18
ts-lua/dist/test.lua vendored
View File

@@ -1,23 +1,9 @@
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
menu:add_feature(
menu.add_feature(
"test",
"action",
0,
function()
do
local i = 0
while i < 120 do
scriptdraw:draw_rect(
v2(nil, 1, 1),
v2(nil, 1, 1),
4278190080
)
local ____ = (function()
local ____tmp = i
i = ____tmp + 1
return ____tmp
end)() and system:wait(0)
end
end
ui.notify_above_map("test", "test tile", 140)
end
)

View File

@@ -1,6 +1 @@
menu.add_feature('test', 'action', 0, () => {
for (let i = 0; i < 120; i++ && system.wait(0))
scriptdraw.draw_rect(v2(1, 1), v2(1, 1), 4278190080)
})
menu.add_feature('test', 'action', 0, () => ui.notify_above_map('from TypeScript', 'Hello', 140))

View File

@@ -19,6 +19,7 @@ type Feature = number;
type vector<T> = object;
type uint8_t = number;
type uint32_t = number;
type int32_t = number;
type uint64_t = number;
type integer = number;
type int = number;

View File

@@ -1,6 +1,7 @@
/**
* D3D Functions
* @public
* @noSelf
*/
declare namespace d3d {

View File

@@ -1,6 +1,7 @@
/**
* Hook Functions
* @public
* @noSelf
*/
declare namespace hook {

View File

@@ -1,6 +1,7 @@
/**
* Input Functions
* @public
* @noSelf
*/
declare namespace input {

View File

@@ -3,6 +3,7 @@
/**
* Menu Functions
* @public
* @noSelf
*/
declare namespace menu {

View File

@@ -1,6 +1,7 @@
/**
* AI Functions
* @public
* @noSelf
*/
declare namespace ai {

View File

@@ -1,6 +1,7 @@
/**
* Audio Functions
* @public
* @noSelf
*/
declare namespace audio {

View File

@@ -1,6 +1,7 @@
/**
* Cam Functions
* @public
* @noSelf
*/
declare namespace cam {

View File

@@ -1,6 +1,7 @@
/**
* Control Functions
* @public
* @noSelf
*/
declare namespace control {

View File

@@ -1,6 +1,7 @@
/**
* Cutscene Functions
* @public
* @noSelf
*/
declare namespace cutscene {

View File

@@ -1,6 +1,7 @@
/**
* Decorator Functions
* @public
* @noSelf
*/
declare namespace decorator {

View File

@@ -1,6 +1,7 @@
/**
* Entity Functions
* @public
* @noSelf
*/
declare namespace entity {

View File

@@ -1,6 +1,7 @@
/**
* Fire Functions
* @public
* @noSelf
*/
declare namespace fire {

View File

@@ -1,6 +1,7 @@
/**
* Gameplay Functions
* @public
* @noSelf
*/
declare namespace gameplay {

View File

@@ -1,6 +1,7 @@
/**
* Graphics Functions
* @public
* @noSelf
*/
declare namespace graphics {

View File

@@ -1,6 +1,7 @@
/**
* Interior Functions
* @public
* @noSelf
*/
declare namespace interior {

View File

@@ -1,6 +1,7 @@
/**
* Network Functions
* @public
* @noSelf
*/
declare namespace network {

View File

@@ -1,6 +1,7 @@
/**
* Object Functions
* @public
* @noSelf
*/
declare namespace object {

View File

@@ -1,6 +1,7 @@
/**
* Ped Functions
* @public
* @noSelf
*/
declare namespace ped {

View File

@@ -1,6 +1,7 @@
/**
* Player Functions
* @public
* @noSelf
*/
declare namespace player {

View File

@@ -1,6 +1,7 @@
/**
* Script Functions
* @public
* @noSelf
*/
declare namespace script {

View File

@@ -1,6 +1,7 @@
/**
* ScriptDraw Functions
* @public
* @noSelf
*/
declare namespace scriptdraw {

View File

@@ -1,6 +1,7 @@
/**
* Stats Functions
* @public
* @noSelf
*/
declare namespace stats {

View File

@@ -1,6 +1,7 @@
/**
* Streaming Functions
* @public
* @noSelf
*/
declare namespace streaming {

View File

@@ -1,6 +1,7 @@
/**
* System Functions
* @public
* @noSelf
*/
declare namespace system {

View File

@@ -1,6 +1,7 @@
/**
* Time Functions
* @public
* @noSelf
*/
declare namespace time {

View File

@@ -1,10 +1,46 @@
/**
* UI Functions
* @public
* @noSelf
*/
declare namespace ui {
type Blip = any;
type Pickup = any;
function notify_above_map(message: string, title: string, color: int): void
function get_entity_from_blip(blip: Blip): Entity
function get_blip_from_entity(entity: Entity): Blip
function add_blip_for_entity(entity: Entity): Blip
function set_blip_sprite(blip: Blip, spriteId: int): boolean
function set_blip_colour(blip: Blip, colour: int): boolean
function hide_hud_component_this_frame(componentId: int): void
function hide_hud_and_radar_this_frame(): void
function get_label_text(label: string): string
function draw_rect(x: float, y: float, width: float, height: float, r: int, g: int, b: int, a: int): void
function draw_line(pos1: v3, pos2: v3, r: int, g: int, b: int, a: int): void
function draw_text(pszText: string, pos: v2): void
function set_text_scale(scale: float): void
function set_text_color(r: int, g: int, b: int, a: int): void
function set_text_font(font: int): void
function set_text_wrap(start: float, end: float): void
function set_text_outline(b: boolean): void
function set_text_centre(b: boolean): void
function set_new_waypoint(coord: v2): void
function get_waypoint_coord(): v2
function is_hud_component_active(componentId: int32_t): boolean
function show_hud_component_this_frame(componentId: int32_t): void
function set_waypoint_off(): void
function set_blip_as_mission_creator_blip(blip: Blip, toggle: boolean): boolean
function is_mission_creator_blip(blip: Blip): boolean
function add_blip_for_radius(pos: v3, radius: float): Blip
function add_blip_for_pickup(pickup: Pickup): Blip
function add_blip_for_coord(pos: v3): Blip
function set_blip_coord(blip: Blip, coord: v3): void
function get_blip_coord(blip: Blip): v3
function remove_blip(blip: Blip): boolean
function set_blip_route(blip: Blip, toggle: boolean): void
function set_blip_route_color(blip: Blip, color: int32_t): void
}

View File

@@ -1,6 +1,7 @@
/**
* Utils Functions
* @public
* @noSelf
*/
declare namespace utils {

View File

@@ -1,6 +1,7 @@
/**
* Vehicle Functions
* @public
* @noSelf
*/
declare namespace vehicle {

View File

@@ -1,6 +1,7 @@
/**
* Water Functions
* @public
* @noSelf
*/
declare namespace water {

View File

@@ -1,6 +1,7 @@
/**
* Weapon Functions
* @public
* @noSelf
*/
declare namespace weapon {

View File

@@ -1,6 +1,7 @@
/**
* Worldprobe Functions
* @public
* @noSelf
*/
declare namespace worldprobe {