-
Notifications
You must be signed in to change notification settings - Fork 4
/
ac_joypad_assist.lua
58 lines (44 loc) · 1.82 KB
/
ac_joypad_assist.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
__source 'extensions/gamepad_fx/ac_ext_gamepad_fx.cpp'
__states 'extensions/gamepad_fx/ac_ext_gamepad_fx.cpp'
__allow 'joypadassist'
require './common/internal_import'
require './common/ac_car_control'
require './common/ac_joypad_assist_enums'
-- automatically generated entries go here:
__definitions()
-- script format:
---Note: joypad assist script runs from physics thread, so update rate is much higher. Please keep it in mind and keep
---code as fast as possible.
---@class ScriptData
---@single-instance
script = {}
---Reference to information about state of associated car.
---@type ac.StateCar
car = nil
---Reference to information about state of simulation.
---@type ac.StateSim
sim = nil
function __script.__init__()
car = ac.getCar(__carIndex)
sim = ac.getSim()
end
--[[? if (ctx.ldoc) out(]]
---Index of connected car.
---@type number
__carIndex = nil
---Index of connected gamepad.
---@type number
__gamepadIndex = nil
---Called each physics frame.
---@param dt number @Time passed since last `update()` call, in seconds. Usually would be around 0.003.
function script.update(dt) end
---Loads a separate Lua module running in render thread (for showing bits of UI or updating some other in-game elements).
---@param name string @File name (without extension) of a module to load to run in render thread.
function ac.loadRenderThreadModule(name) end
---Loads a separate Lua module running in gamepad thread (for overriding gamepad buttons directly even when sim is paused).
---@param name string @File name (without extension) of a module to load to run in render thread.
function ac.loadGamepadThreadModule(name) end
---Forces state of a gamepad button to pressed for the next frame. Only available from physics thread module.
---@param gamepadButtonID ac.GamepadButton
function ac.setButtonPressed(gamepadButtonID) end
--[[) ?]]