Skip to content

Instantly share code, notes, and snippets.

@oatmealine
Created April 28, 2024 10:57
Show Gist options
  • Save oatmealine/168af0540867ec89765f29a12804380c to your computer and use it in GitHub Desktop.
Save oatmealine/168af0540867ec89765f29a12804380c to your computer and use it in GitHub Desktop.
Lua type definitions for EX-XDRiVER
---@meta
xdrv = {}
-- how to get these
-- grab the list of mods from https://github.com/EX-XDRiVER/Chart-Documentation/blob/main/mods.md, then do the following:
--
-- 1: replace: -- "(\w+)"( \("(\w+)"\))?\s*\n-- - .+\n(--\s*\n)?
-- with : '$1' | '$3' |
-- 2: replace: \| '' \|
-- with : |
--
-- then remove trailing |
---@alias ModName 'speed' | 'camera_position_x' | 'camera_move_x' | 'camera_position_y' | 'camera_move_y' | 'camera_position_z' | 'camera_move_z' | 'camera_rotation_x' | 'camera_rotate_x' | 'camera_rotation_y' | 'camera_rotate_y' | 'camera_rotation_z' | 'camera_rotate_z' | 'note_move_x' | 'note_move_y' | 'note_move_z' | 'note_rotate_x' | 'note_rotate_y' | 'note_rotate_z' | 'note1_move_x' | 'note1_move_y' | 'note1_move_z' | 'note1_rotate_x' | 'note1_rotate_y' | 'note1_rotate_z' | 'note2_move_x' | 'note2_move_y' | 'note2_move_z' | 'note2_rotate_x' | 'note2_rotate_y' | 'note2_rotate_z' | 'note3_move_x' | 'note3_move_y' | 'note3_move_z' | 'note3_rotate_x' | 'note3_rotate_y' | 'note3_rotate_z' | 'note4_move_x' | 'note4_move_y' | 'note4_move_z' | 'note4_rotate_x' | 'note4_rotate_y' | 'note4_rotate_z' | 'note5_move_x' | 'note5_move_y' | 'note5_move_z' | 'note5_rotate_x' | 'note5_rotate_y' | 'note5_rotate_z' | 'note6_move_x' | 'note6_move_y' | 'note6_move_z' | 'note6_rotate_x' | 'note6_rotate_y' | 'note6_rotate_z' | 'track_move_x' | 'track_move_y' | 'track_move_z' | 'track_rotate_x' | 'track_rotate_y' | 'track_rotate_z' | 'trackleft_move_x' | 'trackleft_move_y' | 'trackleft_move_z' | 'trackleft_rotate_x' | 'trackleft_rotate_y' | 'trackleft_rotate_z' | 'trackright_move_x' | 'trackright_move_y' | 'trackright_move_z' | 'trackright_rotate_x' | 'trackright_rotate_y' | 'trackright_rotate_z' | 'gear_move_x' | 'gear_move_y' | 'gear_move_z' | 'gear_rotate_x' | 'gear_rotate_y' | 'gear_rotate_z' | 'gearleft_move_x' | 'gearleft_move_y' | 'gearleft_move_z' | 'gearleft_rotate_x' | 'gearleft_rotate_y' | 'gearleft_rotate_z' | 'gearright_move_x' | 'gearright_move_y' | 'gearright_move_z' | 'gearright_rotate_x' | 'gearright_rotate_y' | 'gearright_rotate_z' | 'black_bar_top_position' | 'black_bar_bottom_position' | 'black_bar_left_position' | 'black_bar_right_position' | 'black_bar_top_rotation' | 'black_bar_bottom_rotation' | 'black_bar_left_rotation' | 'black_bar_right_rotation' | 'lane_color_red' | 'lane_color_green' | 'lane_color_blue' | 'lane_color_alpha' | 'lane_left_color_red' | 'lane_left_color_green' | 'lane_left_color_blue' | 'lane_left_color_alpha' | 'lane_right_color_red' | 'lane_right_color_green' | 'lane_right_color_blue' | 'lane_right_color_alpha' | 'drift_move_x' | 'drift_move_y' | 'drift_move_z' | 'drift_rotate_x' | 'drift_rotate_y' | 'drift_rotate_z' | 'driftleft_move_x' | 'driftleft_move_y' | 'driftleft_move_z' | 'driftleft_rotate_x' | 'driftleft_rotate_y' | 'driftleft_rotate_z' | 'driftright_move_x' | 'driftright_move_y' | 'driftright_move_z' | 'driftright_rotate_x' | 'driftright_rotate_y' | 'driftright_rotate_z'
-- ---@alias EaseName 'Linear' | 'InQuad' | 'OutQuad' | 'InOutQuad' | 'InCubic' | 'OutCubic' | 'InOutCubic' | 'InQuart' | 'OutQuart' | 'InOutQuart' | 'InQuint' | 'OutQuint' | 'InOutQuint' | 'InSine' | 'OutSine' | 'InOutSine' | 'InExpo' | 'OutExpo' | 'InOutExpo' | 'InCirc' | 'OutCirc' | 'InOutCirc' | 'InElastic' | 'OutElastic' | 'InOutElastic' | 'InBack' | 'OutBack' | 'InOutBack' | 'InBounce' | 'OutBounce' | 'InOutBounce' | 'Bounce' | 'Tri' | 'Bell' | 'Pop' | 'Tap' | 'Pulse' | 'Spike' | 'Inverse' | 'Instant' | 'SmoothStep' | 'SmootherStep' | 'SmoothestStep'
---@alias EaseName 'linear' | 'inquad' | 'outquad' | 'inoutquad' | 'incubic' | 'outcubic' | 'inoutcubic' | 'inquart' | 'outquart' | 'inoutquart' | 'inquint' | 'outquint' | 'inoutquint' | 'insine' | 'outsine' | 'inoutsine' | 'inexpo' | 'outexpo' | 'inoutexpo' | 'incirc' | 'outcirc' | 'inoutcirc' | 'inelastic' | 'outelastic' | 'inoutelastic' | 'inback' | 'outback' | 'inoutback' | 'inbounce' | 'outbounce' | 'inoutbounce' | 'bounce' | 'tri' | 'bell' | 'pop' | 'tap' | 'pulse' | 'spike' | 'inverse' | 'instant' | 'smoothstep' | 'smootherstep' | 'smootheststep'
---@param mod ModName @ The mod name
---@param value number @ The value to set the mod to
---@param timing 'beat' | 'time' @ Whether to set the mod at a specific beat or time in seconds ('beat' or 'time')
---@param at number @ The beat or time in seconds
function xdrv.Mod(mod, value, timing, at) end
xdrv.Set = xdrv.Mod
---@param mod ModName @ The mod name
---@param from number @ The starting value
---@param to number @ The ending value
---@param timing 'beat' | 'time' @ Whether to set the mod at a specific beat or time in seconds ('beat' or 'time')
---@param at number @ The beat or time in seconds to start easing our mod
---@param lenmode 'end' | 'len' @ Whether to set the duration as length or as its ending point, in beat or time in seconds as determined by the fourth parameter ('end' or 'len')
---@param len number @ The end point of our ease as a beat or time in seconds, or length in beats or time in seconds
---@param ease EaseName @ The type of ease to use
function xdrv.Ease(mod, from, to, timing, at, lenmode, len, ease) end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment