usc lua skin api update

This commit is contained in:
Hersi 2024-02-02 02:43:06 +01:00
parent bce246e5e1
commit 8be5205e90
15 changed files with 828 additions and 945 deletions

View File

@ -1,60 +1,53 @@
-- bg 'background' table
---bg `background` table
---@class background
background = {
}
-- Draws the background shader and invokes `gfx.ForceRender`
DrawShader = function() end
background.DrawShader = function() end
-- Gets the clear state value, `0` for fail state, `1` for clear state
---@return integer
GetClearTransition = function() end
background.GetClearTransition = function() end
-- Retrieves the path to the background folder
GetPath = function() end
background.GetPath = function() end
-- Gets the pixel coordinates for a point just above the end of the track
---@return number x
---@return number y
GetScreenCenter = function() end
background.GetScreenCenter = function() end
-- Gets tilt values, `< 0` for clockwise, `> 0` for counter-clockwise
---@return number laserTilt # Tilt induced by lasers
---@return number spinTilt # Tilt induced by spinEvents
GetTilt = function() end
background.GetTilt = function() end
-- Gets timing data of the chart
---@return number bartime # Value that goes from `0` to `1` over the duration of each beat
---@return number offsync # Value that goes from `0` to `1` over the duration `BPM * multiplier`
---@return number time # Current time in the chart
GetTiming = function() end
background.GetTiming = function() end
-- Loads a texture which will be available in the fragment shader under the given `shaderName`
---@param shaderName string
---@param fileName string
LoadTexture = function(shaderName, fileName) end
background.LoadTexture = function(shaderName, fileName) end
-- Set a float value to a uniform variable in the shader
---@param uniformName string
---@param val number
SetParamf = function(uniformName, val) end
background.SetParamf = function(uniformName, val) end
-- Set an integer value to a uniform variable in the shader
---@param uniformName string
---@param val integer
SetParami = function(uniformName, val) end
background.SetParami = function(uniformName, val) end
-- Sets the speed multiplier for the `offsync` timer returned by `GetTiming`
---@param speed number
SetSpeedMulti = function(speed) end
background.SetSpeedMulti = function(speed) end
---@class background
background = {
DrawShader = DrawShader,
GetClearTransition = GetClearTransition,
GetPath = GetPath,
GetScreenCenter = GetScreenCenter,
GetTilt = GetTilt,
GetTiming = GetTiming,
LoadTexture = LoadTexture,
SetParamf = SetParamf,
SetParami = SetParami,
SetSpeedMulti = SetSpeedMulti,
};
---Render background
---@param deltaTime number
function render_bg(deltaTime) end

View File

@ -1,28 +1,23 @@
-- downloadscreen `dlScreen` table
-- Global downloadscreen `dlScreen` table
---@class dlScreen
dlScreen = {
}
-- Download the selected song
---@param uri string # Encoded URI
---@param header table
---@param id string # Song ID
---@param cb function # Archive callback
DownloadArchive = function(uri, header, id, cb) end
dlScreen.DownloadArchive = function(uri, header, id, cb) end
-- Exit the download screen
Exit = function() end
dlScreen.Exit = function() end
-- Gets the path to the song folder
GetSongsPath = function() end
dlScreen.GetSongsPath = function() end
-- Play the chart preview
---@param uri string # Encoded URI
---@param header table
---@param id string # Song ID
PlayPreview = function(uri, header, id) end
---@class dlScreen
dlScreen = {
DownloadArchive = DownloadArchive,
Exit = Exit,
GetSongsPath = GetSongsPath,
PlayPreview = PlayPreview,
};
dlScreen.PlayPreview = function(uri, header, id) end

View File

@ -1,60 +1,53 @@
-- fg 'foreground' table
---@class foreground
foreground = {
}
-- Draws the foreground shader and invokes `gfx.ForceRender`
DrawShader = function() end
foreground.DrawShader = function() end
-- Gets the clear state value, `0` for fail state, `1` for clear state
---@return integer
GetClearTransition = function() end
foreground.GetClearTransition = function() end
-- Retrieves the path to the background folder
GetPath = function() end
foreground.GetPath = function() end
-- Gets the pixel coordinates for a point just above the end of the track
---@return number x
---@return number y
GetScreenCenter = function() end
foreground.GetScreenCenter = function() end
-- Gets tilt values, `< 0` for clockwise, `> 0` for counter-clockwise
---@return number laserTilt # Tilt induced by lasers
---@return number spinTilt # Tilt induced by spinEvents
GetTilt = function() end
foreground.GetTilt = function() end
-- Gets timing data of the chart
---@return number bartime # Value that goes from `0` to `1` over the duration of each beat
---@return number offsync # Value that goes from `0` to `1` over the duration `BPM * multiplier`
---@return number time # Current time in the chart
GetTiming = function() end
foreground.GetTiming = function() end
-- Loads a texture which will be available in the fragment shader under the given `shaderName`
---@param shaderName string
---@param fileName string
LoadTexture = function(shaderName, fileName) end
foreground.LoadTexture = function(shaderName, fileName) end
-- Set a float value to a uniform variable in the shader
---@param uniformName string
---@param val number
SetParamf = function(uniformName, val) end
foreground.SetParamf = function(uniformName, val) end
-- Set an integer value to a uniform variable in the shader
---@param uniformName string
---@param val integer
SetParami = function(uniformName, val) end
foreground.SetParami = function(uniformName, val) end
-- Sets the speed multiplier for the `offsync` timer returned by `GetTiming`
---@param speed number
SetSpeedMulti = function(speed) end
foreground.SetSpeedMulti = function(speed) end
---@class foreground
foreground = {
DrawShader = DrawShader,
GetClearTransition = GetClearTransition,
GetPath = GetPath,
GetScreenCenter = GetScreenCenter,
GetTilt = GetTilt,
GetTiming = GetTiming,
LoadTexture = LoadTexture,
SetParamf = SetParamf,
SetParami = SetParami,
SetSpeedMulti = SetSpeedMulti,
};
---Render foreground
---@param deltaTime number
function render_fg(deltaTime) end

View File

@ -1,6 +1,5 @@
-- filterwheel `filters` table
---@class filters
---@field folder string[] # Array of song folders and collections
---@field level string[] # Array of song levels
filters = {};
filters = {};

View File

@ -1,69 +1,5 @@
-- Global `game` table
-- Gets the state of the specified button
---@param button integer # options are under the `game` table prefixed with `BUTTON`
---@return boolean # `true` if it is being pressed
GetButton = function(button) end
-- Gets the absolute rotation of the specified knob
---@param knob integer # `0 = left`, `1 = right`
---@return number angle # in radians, `-2*pi` to `0` (turning CCW) and `0` to `2*pi` (turning CW)
GetKnob = function(knob) end
-- Gets the color of the specified laser
---@param laser integer # `0 = left`, `1 = right`
---@return integer r, integer g, integer b
GetLaserColor = function(laser) end
-- Gets the mouse's position on the game window in pixel coordinates
---@return number, number
GetMousePos = function() end
-- Gets the game window's resolution in pixels
---@return number, number
GetResolution = function() end
-- Gets the name of the current skin
---@return string
GetSkin = function() end
-- Gets the value of the skin setting with the specified key
---@param key string
---@return any
GetSkinSetting = function(key) end
-- Checks whether the named sample is currently playing
---@param name string # name of the loaded sample
---@return boolean|nil # `nil` if the sample is not loaded
IsSamplePlaying = function(name) end
-- Loads an audio sample from the `audio` directory of the current skin folder
---@param name string # `.wav` extension assumed if not provided
LoadSkinSample = function(name) end
-- Logs a message to the game's log file
---@param message string
---@param severity integer # options are under the `game` table prefixed with `LOGGER`
Log = function(message, severity) end
-- Plays a loaded sample
---@param name string # name of the loaded sample
---@param loop? boolean
PlaySample = function(name, loop) end
-- Sets the value of the skin setting with the specified key
---@param key string
---@param value any # type must match the type of the defined skin setting
SetSkinSetting = function(key, value) end
-- Stops a playing sample
---@param name string # name of the loaded sample
StopSample = function(name) end
-- Checks if an update is available
---@return string url, string version # `nil` if there is no update available
UpdateAvailable = function() end
---@class game
game = {
LOGGER_INFO = 1,
LOGGER_NORMAL = 2,
@ -78,19 +14,68 @@ game = {
BUTTON_FXR = 5,
BUTTON_STA = 6,
BUTTON_BCK = 11,
}
GetButton = GetButton,
GetKnob = GetKnob,
GetLaserColor = GetLaserColor,
GetMousePos = GetMousePos,
GetResolution = GetResolution,
GetSkin = GetSkin,
GetSkinSetting = GetSkinSetting,
IsSamplePlaying = IsSamplePlaying,
LoadSkinSample = LoadSkinSample,
Log = Log,
PlaySample = PlaySample,
SetSkinSetting = SetSkinSetting,
StopSample = StopSample,
UpdateAvailable = UpdateAvailable,
};
-- Gets the state of the specified button
---@param button integer # options are under the `game` table prefixed with `BUTTON`
---@return boolean # `true` if it is being pressed
game.GetButton = function(button) end
-- Gets the absolute rotation of the specified knob
---@param knob integer # `0 = left`, `1 = right`
---@return number angle # in radians, `-2*pi` to `0` (turning CCW) and `0` to `2*pi` (turning CW)
game.GetKnob = function(knob) end
-- Gets the color of the specified laser
---@param laser integer # `0 = left`, `1 = right`
---@return integer r, integer g, integer b
game.GetLaserColor = function(laser) end
-- Gets the mouse's position on the game window in pixel coordinates
---@return number, number
game.GetMousePos = function() end
-- Gets the game window's resolution in pixels
---@return number, number
game.GetResolution = function() end
-- Gets the name of the current skin
---@return string
game.GetSkin = function() end
-- Gets the value of the skin setting with the specified key
---@param key string
---@return any
game.GetSkinSetting = function(key) end
-- Checks whether the named sample is currently playing
---@param name string # name of the loaded sample
---@return boolean|nil # `nil` if the sample is not loaded
game.IsSamplePlaying = function(name) end
-- Loads an audio sample from the `audio` directory of the current skin folder
---@param name string # `.wav` extension assumed if not provided
game.LoadSkinSample = function(name) end
-- Logs a message to the game's log file
---@param message string
---@param severity integer # options are under the `game` table prefixed with `LOGGER`
game.Log = function(message, severity) end
-- Plays a loaded sample
---@param name string # name of the loaded sample
---@param loop? boolean
game.PlaySample = function(name, loop) end
-- Sets the value of the skin setting with the specified key
---@param key string
---@param value any # type must match the type of the defined skin setting
game.SetSkinSetting = function(key, value) end
-- Stops a playing sample
---@param name string # name of the loaded sample
game.StopSample = function(name) end
-- Checks if an update is available
---@return string url, string version # `nil` if there is no update available
game.UpdateAvailable = function() end

View File

@ -1,36 +1,35 @@
-- gameplay `gameplay` table
---@class CritLine
---@field cursors LaserCursor[] #
---@field line Line # Line from the left corner of the track to the right corner
---@field rotation number # The rotation of the crit line, in radians
---@field x integer # Screen x-coordinate of the center of the crit line
---@field y integer # Screen y-coordinate of the center of the crit line
CritLine = {};
CritLine = {}
---@class LaserCursor
---@field alpha number # Alpha channel value, `0.0` to `1.0`
---@field pos number # The x-position relative to the center of the crit line
---@field skew number # The x-skew of the cursor
LaserCursor = {};
LaserCursor = {}
---@class Gauge
---@field type integer # `0` = Effective, `1` = Excessive, `2` = Permissive, `3` = Blastive
---@field value number # Current gauge percentage, `0.0` to `1.0`
Gauge = {};
Gauge = {}
---@class Line
---@field x1 number # Starting x-coordinate
---@field y1 number # Starting y-coordinate
---@field x2 number # Ending x-coordinate
---@field y2 number # Ending y-coordinate
Line = {};
Line = {}
---@class ScoreReplay
---@field currentScore integer # Current score of the replay
---@field maxScore integer # Ending score of the replay
ScoreReplay = {};
ScoreReplay = {}
-- gameplay `gameplay` table
---@class gameplay
---@field artist string # Chart artist
---@field bpm number # Chart BPM
@ -54,4 +53,4 @@ ScoreReplay = {};
---@field suddenFade number # Sudden fade value, `0.0` to `1.0`
---@field title string # Chart title
---@field user_id nil|string # Only for multiplayer
gameplay = {};
gameplay = {}

View File

@ -7,12 +7,12 @@
---@field options? string[] # Array of setting value names, only available if setting `type` is `enum`
---@field type string # Type of the setting value: `button`, `enum`, `float`, `int`, or `toggle`
---@field value? number|boolean # Value of the setting, not available if setting `type` is `button`
SettingsDiagSetting = {};
SettingsDiagSetting = {}
---@class SettingsDiagTab
---@field name string # Tab name
---@field settings SettingsDiagSetting[] # Array of settings in the tab
SettingsDiagTab = {};
SettingsDiagTab = {}
---@class SettingsDiag
---@field currentSetting integer # Current setting index for `SettigsDiag[currentTab].settings`
@ -20,4 +20,4 @@ SettingsDiagTab = {};
---@field posX number # X-Position relative to the entire screen, from `0.0` to `1.0`
---@field posY number # Y-Position relative to the entire screen, from `0.0` to `1.0`
---@field tabs SettingsDiagTab[]
SettingsDiag = {};
SettingsDiag = {}

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +1,7 @@
-- Global `Http` table
-- Executes a blocking `GET` request
---@param url string
---@param header table<string, string>
---@return HttpResponse
Get = function(url, header) end
-- Executes a `GET` request and calls `callback` with `HttpResponse` as a parameter
---@param url string
---@param header table<string, string>
---@param callback function
GetAsync = function(url, header, callback) end
-- Executes a blocking `POST` request
---@param url string
---@param content string
---@param header table<string, string>
---@return HttpResponse
Post = function(url, content, header) end
-- Executes a `POST` request and calls `callback` with `HttpResponse` as a parameter
---@param url string
---@param header table<string, string>
---@param callback function
PostAsync = function(url, header, callback) end
---@class Http
Http = {
}
---@class HttpResponse
---@field cookies string
@ -33,12 +11,29 @@ PostAsync = function(url, header, callback) end
---@field error string
---@field text string
---@field url string
HttpResponse = {};
HttpResponse = {}
---@class Http
Http = {
Get = Get,
GetAsync = GetAsync,
Post = Post,
PostAsync = PostAsync,
};
-- Executes a blocking `GET` request
---@param url string
---@param header table<string, string>
---@return HttpResponse
Http.Get = function(url, header) end
-- Executes a `GET` request and calls `callback` with `HttpResponse` as a parameter
---@param url string
---@param header table<string, string>
---@param callback function
Http.GetAsync = function(url, header, callback) end
-- Executes a blocking `POST` request
---@param url string
---@param content string
---@param header table<string, string>
---@return HttpResponse
Http.Post = function(url, content, header) end
-- Executes a `POST` request and calls `callback` with `HttpResponse` as a parameter
---@param url string
---@param header table<string, string>
---@param callback function
Http.PostAsync = function(url, header, callback) end

View File

@ -7,7 +7,7 @@
---@field delta integer -- Delta value of the hit from 0
---@field hold integer -- `0` for chip/laser, otherwise `# Ticks` of hold
---@field rating integer -- `0 = Miss`, `1 = Near`, `2 = Crit`
HitStat = {};
HitStat = {}
---@class HitWindow
---@field good integer # Near window, default `92`
@ -16,7 +16,7 @@ HitStat = {};
---@field perfect integer -- Critical window, default `46`
---@field slam integer -- Slam window, default `84`
---@field type integer -- `1 = Normal` default, `2 = Hard` default values halved
HitWindow = {};
HitWindow = {}
---@class Score
---@field auto_flags integer # Autoplay flag
@ -34,12 +34,12 @@ HitWindow = {};
---@field score integer # Result score
---@field timestamp integer # Unix timestamp of the score
---@field uid nil|string # Only for multiplayer results, UID of the player
Score = {};
Score = {}
---@class ChartResult : result
---@field passed boolean # Whether or not challenge requirements were met for this chart
---@field failReason string # Fail reason if a challenge requirement was not met
ChartResult = {};
ChartResult = {}
---@class ServerScoreOptions
---@field gaugeType integer # An enum value representing the gauge type used. 0 = normal, 1 = hard. Further values are not currently specified.
@ -129,4 +129,4 @@ ServerScore = {}
---@field speedModValue number # Only for singleplayer, `HiSpeed` for `XMOD`, `ModSpeed` otherwise
---@field title string # Chart (with player name in multiplayer) or challenge title
---@field uid nil|string # Only for multiplayer, UID of the player
result = {};
result = {}

View File

@ -1,118 +1,5 @@
-- Adds a texture that was loaded with `gfx.LoadSharedTexture` to the material that can be used in the shader code
---@param uniformName string
---@param textureName string
AddSharedTexture = function(uniformName, textureName) end
-- Adds a texture to the material that can be used in the shader code
---@param uniformName string
---@param path string # prepended with `skins/<skin>/textures/`
AddSkinTexture = function(uniformName, path) end
-- Adds a texture to the material that can be used in the shader code
---@param uniformName string
---@param path string
AddTexture = function(uniformName, path) end
-- Gets the translation of the mesh
---@return number x, number y, number z
GetPosition = function() end
-- Gets the rotation (in degrees) of the mesh
---@return number roll, number yaw, number pitch
GetRotation = function() end
-- Gets the scale of the mesh
---@return number x, number y, number z
GetScale = function() end
-- Sets the blending mode
---@param mode integer # options also available as fields of the object prefixed with `BLEND`
-- `Normal` = 0 (default)
-- `Additive` = 1
-- `Multiply` = 2
SetBlendMode = function(mode) end
-- Sets the geometry data
---@param data table # array of vertices in clockwise order starting from the top left e.g.
-- ```
-- {
-- { { 0, 0 }, { 0, 0 } },
-- { { 50, 0 }, { 1, 0 } },
-- { { 50, 50 }, { 1, 1 } },
-- { { 0, 50 }, { 0, 1 } },
-- }
-- ```
SetData = function(data) end
-- Sets the material is opaque or non-opaque (default)
---@param opaque boolean
SetOpaque = function(opaque) end
-- Sets the value of the specified uniform
---@param uniformName string
---@param value number # `float`
SetParam = function(uniformName, value) end
-- Sets the value of the specified 2d vector uniform
---@param uniformName string
---@param x number # `float`
---@param y number # `float`
SetParamVec2 = function(uniformName, x, y) end
-- Sets the value of the specified 3d vector uniform
---@param uniformName string
---@param x number # `float`
---@param y number # `float`
---@param z number # `float`
SetParamVec3 = function(uniformName, x, y, z) end
-- Sets the value of the specified 4d vector uniform
---@param uniformName string
---@param x number # `float`
---@param y number # `float`
---@param z number # `float`
---@param w number # `float`
SetParamVec4 = function(uniformName, x, y, z, w) end
-- Sets the translation for the mesh
-- Relative to the screen for `ShadedMesh`
-- Relative to the center of the crit line for `ShadedMeshOnTrack`
---@param x number
---@param y number
---@param z? number # Default `0`
SetPosition = function(x, y, z) end
-- Sets the format for geometry data provided by `SetData`
---@param type integer # options also available as fields of the object prefixed with `PRIM`
-- `TriangleList` = 0 (default)
-- `TriangleStrip` = 1
-- `TriangleFan` = 2
-- `LineList` = 3
-- `LineStrip` = 4
-- `PointList` = 5
SetPrimitiveType = function(type) end
-- Sets the rotation (in degrees) of the mesh
-- **WARNING:** For `ShadedMesh`, pitch and yaw may clip, rendering portions or the entire mesh invisible
---@param roll number
---@param yaw? number # Default `0`
---@param pitch? number # Default `0`
SetRotation = function(roll, yaw, pitch) end
-- Sets the scale of the mesh
---@param x number
---@param y number
---@param z? number # Default `0`
SetScale = function(x, y, z) end
-- Sets the wireframe mode of the object (does not render texture)
-- Useful for debugging models or geometry shaders
---@param useWireframe boolean
SetWireframe = function(useWireframe) end
-- Renders the `ShadedMesh` object
Draw = function() end
---ShadedMesh is a lua object available that has "low-level" drawing capabilites
---that can be useful for very custom rendering goals.
---@class ShadedMesh
ShadedMesh = {
BLEND_NORM = 0,
@ -125,57 +12,148 @@ ShadedMesh = {
PRIM_LINELIST = 3,
PRIM_LINESTRIP = 4,
PRIM_POINTLIST = 5,
}
AddSharedTexture = AddSharedTexture,
AddSkinTexture = AddSkinTexture,
AddTexture = AddTexture,
Draw = Draw,
GetPosition = GetPosition,
GetRotation = GetRotation,
GetScale = GetScale,
SetBlendMode = SetBlendMode,
SetData = SetData,
SetOpaque = SetOpaque,
SetParam = SetParam,
SetParamVec2 = SetParamVec2,
SetParamVec3 = SetParamVec3,
SetParamVec4 = SetParamVec4,
SetPosition = SetPosition,
SetPrimitiveType = SetPrimitiveType,
SetRotation = SetRotation,
SetScale = SetScale,
SetWireframe = SetWireframe,
};
-- Adds a texture that was loaded with `gfx.LoadSharedTexture` to the material that can be used in the shader code
---@param uniformName string
---@param textureName string
ShadedMesh.AddSharedTexture = function(uniformName, textureName) end
-- Gets the length of the mesh
---@return number length
GetLength = function() end
-- Adds a texture to the material that can be used in the shader code
---@param uniformName string
---@param path string # prepended with `skins/<skin>/textures/`
ShadedMesh.AddSkinTexture = function(uniformName, path) end
-- Sets the y-scale of the mesh based on its length
-- Useful for creating fake buttons which may have variable length based on duration
---@param length number
ScaleToLength = function(length) end
-- Adds a texture to the material that can be used in the shader code
---@param uniformName string
---@param path string
ShadedMesh.AddTexture = function(uniformName, path) end
-- Stops meshes beyond the track from being rendered if `doClip`
---@param doClip boolean
SetClipWithTrack = function(doClip) end
-- Gets the translation of the mesh
---@return number x, number y, number z
ShadedMesh.GetPosition = function() end
-- Sets the length (in the y-direction relative to the track) of the mesh
---@param length number # Optional constants: `BUTTON_TEXTURE_LENGTH`, `FXBUTTON_TEXTURE_LENGTH`, and `TRACK_LENGTH`
SetLength = function(length) end
-- Gets the rotation (in degrees) of the mesh
---@return number roll, number yaw, number pitch
ShadedMesh.GetRotation = function() end
-- Uses an existing game mesh
---@param meshName string # Options: `'button'`, `'fxbutton'`, and `'track'`
UseGameMesh = function(meshName) end
-- Gets the scale of the mesh
---@return number x, number y, number z
ShadedMesh.GetScale = function() end
-- Sets the blending mode
---@param mode integer # options also available as fields of the object prefixed with `BLEND`
-- `Normal` = 0 (default)
-- `Additive` = 1
-- `Multiply` = 2
ShadedMesh.SetBlendMode = function(mode) end
-- Sets the geometry data
---@param data table # array of vertices in clockwise order starting from the top left e.g.
-- ```
-- {
-- { { 0, 0 }, { 0, 0 } },
-- { { 50, 0 }, { 1, 0 } },
-- { { 50, 50 }, { 1, 1 } },
-- { { 0, 50 }, { 0, 1 } },
-- }
-- ```
ShadedMesh.SetData = function(data) end
-- Sets the material is opaque or non-opaque (default)
---@param opaque boolean
ShadedMesh.SetOpaque = function(opaque) end
-- Sets the value of the specified uniform
---@param uniformName string
---@param value number # `float`
ShadedMesh.SetParam = function(uniformName, value) end
-- Sets the value of the specified 2d vector uniform
---@param uniformName string
---@param x number # `float`
---@param y number # `float`
ShadedMesh.SetParamVec2 = function(uniformName, x, y) end
-- Sets the value of the specified 3d vector uniform
---@param uniformName string
---@param x number # `float`
---@param y number # `float`
---@param z number # `float`
ShadedMesh.SetParamVec3 = function(uniformName, x, y, z) end
-- Sets the value of the specified 4d vector uniform
---@param uniformName string
---@param x number # `float`
---@param y number # `float`
---@param z number # `float`
---@param w number # `float`
ShadedMesh.SetParamVec4 = function(uniformName, x, y, z, w) end
-- Sets the translation for the mesh
-- Relative to the screen for `ShadedMesh`
-- Relative to the center of the crit line for `ShadedMeshOnTrack`
---@param x number
---@param y number
---@param z? number # Default `0`
ShadedMesh.SetPosition = function(x, y, z) end
-- Sets the format for geometry data provided by `SetData`
---@param type integer # options also available as fields of the object prefixed with `PRIM`
-- `TriangleList` = 0 (default)
-- `TriangleStrip` = 1
-- `TriangleFan` = 2
-- `LineList` = 3
-- `LineStrip` = 4
-- `PointList` = 5
ShadedMesh.SetPrimitiveType = function(type) end
-- Sets the rotation (in degrees) of the mesh
-- **WARNING:** For `ShadedMesh`, pitch and yaw may clip, rendering portions or the entire mesh invisible
---@param roll number
---@param yaw? number # Default `0`
---@param pitch? number # Default `0`
ShadedMesh.SetRotation = function(roll, yaw, pitch) end
-- Sets the scale of the mesh
---@param x number
---@param y number
---@param z? number # Default `0`
ShadedMesh.SetScale = function(x, y, z) end
-- Sets the wireframe mode of the object (does not render texture)
-- Useful for debugging models or geometry shaders
---@param useWireframe boolean
ShadedMesh.SetWireframe = function(useWireframe) end
-- Renders the `ShadedMesh` object
ShadedMesh.Draw = function() end
---ShadedMeshOnTrack is a ShadedMesh that renders with the track camera instead of the screen.
---@class ShadedMeshOnTrack : ShadedMesh
---@field BUTTON_TEXTURE_LENGTH number
---@field FXBUTTON_TEXTURE_LENGTH number
---@field TRACK_LENGTH number
ShadedMeshOnTrack = {
GetLength = GetLength,
UseGameMesh = UseGameMesh,
ScaleToLength = ScaleToLength,
SetClipWithTrack = SetClipWithTrack,
SetLength = SetLength,
};
}
-- Gets the length of the mesh
---@return number length
ShadedMeshOnTrack.GetLength = function() end
-- Sets the y-scale of the mesh based on its length
-- Useful for creating fake buttons which may have variable length based on duration
---@param length number
ShadedMeshOnTrack.ScaleToLength = function(length) end
-- Stops meshes beyond the track from being rendered if `doClip`
---@param doClip boolean
ShadedMeshOnTrack.SetClipWithTrack = function(doClip) end
-- Sets the length (in the y-direction relative to the track) of the mesh
---@param length number # Optional constants: `BUTTON_TEXTURE_LENGTH`, `FXBUTTON_TEXTURE_LENGTH`, and `TRACK_LENGTH`
ShadedMeshOnTrack.SetLength = function(length) end
-- Uses an existing game mesh
---@param meshName string # Options: `'button'`, `'fxbutton'`, and `'track'`
ShadedMeshOnTrack.UseGameMesh = function(meshName) end

View File

@ -9,7 +9,7 @@
---@field level integer # Difficulty level
---@field scores Score[] # Scores for the current difficulty
---@field topBadge integer # `0 = Never Played`, `1 = Played`, `2 = Cleared`, `3 = Hard Cleared`, `4 = Full Chain`, `5 = Perfect Chain`
Difficulty = {};
Difficulty = {}
---@class Song
---@field artist string # Chart artist
@ -18,7 +18,7 @@ Difficulty = {};
---@field id integer # Song id, unique static identifier
---@field path string # Full filepath to the chart folder on the disk
---@field title string # Chart title
Song = {};
Song = {}
---@class songwheel
---@field allSongs Song[] # Array of all available songs
@ -26,4 +26,16 @@ Song = {};
---@field searchStatus string # Current song database status
---@field searchText string # Search input text
---@field songs Song[] # Array of songs with the current filters/sorting applied
songwheel = {};
songwheel = {}
---Set difficulty index
---@param diff integer diff index
function set_diff(diff) end
---Function called by the game when ``songs`` or ``allSongs`` (if withAll == true) is changed.
---@param allSongs boolean
function songs_changed(allSongs) end
---Function called by the game to get how much to scroll when page up or page down are pressed.
---Needs to be defined for the game to work properly.
function get_page_size() end

View File

@ -1,4 +1,17 @@
-- sortwheel `sorts` table
---@type string[] # Array of song sorts
sorts = {};
sorts = {
"Title ^",
"Title v",
"Score ^",
"Score v",
"Date ^",
"Date v",
"Badge ^",
"Badge v",
"Artist ^",
"Artist v",
"Effector ^",
"Effector v",
}

View File

@ -1,27 +1,30 @@
local function Exit() end
local function Settings() end
local function Start() end
local function DLScreen() end
local function Update() end
local function Multiplayer() end
local function Challenges() end
--- Global `Menu` table
---@class Menu
Menu = {
Exit = Exit,
Settings = Settings,
Start = Start,
DLScreen = DLScreen,
Update = Update,
Multiplayer = Multiplayer,
Challenges = Challenges
}
--- Exit application
Menu.Exit = function() end
--- Open settings screen
Menu.Settings = function() end
--- Open songwheel screen
Menu.Start = function() end
--- Open nautica screen
Menu.DLScreen = function() end
--- Update the application
Menu.Update = function() end
--- Open multiplayer screen
Menu.Multiplayer = function() end
--- Open challenge course screen
Menu.Challenges = function() end
--- Render frame for titlescreen
---@param deltaTime number Elapsed frametime since last frame
function render(deltaTime) end
@ -32,4 +35,4 @@ function button_pressed(buttonCode) end
--- Mouse event handler for titlescreen
---@param button integer
function mouse_pressed(button) end
function mouse_pressed(button) end

View File

@ -1,39 +1,34 @@
-- `track` table
-- Only exists in `gameplay.lua` and background/foreground scripts
---`track` table
---
---Only exists in `gameplay.lua` and background/foreground scripts
---@class track
track = {
}
-- Creates a new `ShadedMeshOnTrack` object
---@param materialName string # Default `'guiTex'`, loaded from the current skin's `shaders` folder
-- `<materialName>.fs` and `<materialName>.vs` must exist at this location
---@return ShadedMeshOnTrack
CreateShadedMeshOnTrack = function(materialName) end
track.CreateShadedMeshOnTrack = function(materialName) end
-- Gets the x-value for the left side of the given `lane`
---@param lane integer # `1` = A, `2` = B, `3` = C, `4` = D, `5` = L, `6` = R
---@return number x
GetCurrentLaneXPos = function(lane) end
track.GetCurrentLaneXPos = function(lane) end
-- Gets the y-length of a long note from `start` for `duration`, adjusted for the current track speed
---@param start integer # In miliseconds
---@param duration integer # In miliseconds
---@return number y
GetLengthForDuration = function(start, duration) end
track.GetLengthForDuration = function(start, duration) end
-- Gets the y-position for an object at the given `time`, adjusted for the current track speed
---@param time integer # In miliseconds
---@return number y
GetYPosForTime = function(time) end
track.GetYPosForTime = function(time) end
-- Hides an object in the given `lane` at the given `time`
-- If no object is found, hides the closest object after the given `time`
---@param time integer # In miliseconds
---@param lane integer # `1` = A, `2` = B, `3` = C, `4` = D, `5` = L, `6` = R
HideObject = function(time, lane) end
---@class track
track = {
CreateShadedMeshOnTrack = CreateShadedMeshOnTrack,
GetCurrentLaneXPos = GetCurrentLaneXPos,
GetLengthForDuration = GetLengthForDuration,
GetYPosForTime = GetYPosForTime,
HideObject = HideObject,
};
track.HideObject = function(time, lane) end