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 ]] --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
menu:add_feature( menu.add_feature(
"test", "test",
"action", "action",
0, 0,
function() function()
do ui.notify_above_map("test", "test tile", 140)
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
end end
) )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,10 +1,46 @@
/** /**
* UI Functions * UI Functions
* @public * @public
* @noSelf
*/ */
declare namespace ui { 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 * Utils Functions
* @public * @public
* @noSelf
*/ */
declare namespace utils { declare namespace utils {

View File

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

View File

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

View File

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

View File

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