Effect Radar Implementation v1 #46

Merged
hersi merged 12 commits from feature/radar into master 2023-11-23 07:41:15 +01:00
3 changed files with 25 additions and 19 deletions
Showing only changes of commit e876def36f - Show all commits

View File

@ -23,47 +23,53 @@ IRData = {}
---@field serverTime integer ---@field serverTime integer
---@field serverName string ---@field serverName string
---@field irVersion string ---@field irVersion string
IRHeartbeatResponseBody = {}
---@class IRRecordResponseBody ---@class IRRecordResponseBody
---@field record ServerScore ---@field record ServerScore
IRRecordResponseBody = {}
---@class IRLeaderboardResponseBody ---@alias IRLeaderboardResponseBody ServerScore[]
---@field scores ServerScore[]
IRLeaderboardResponseBody = {}
---@class IRResponse ---@class IRResponse
---@field statusCode integer ---@field statusCode integer
---@field description string ---@field description string
---@field body nil|IRHeartbeatResponseBody|IRRecordResponseBody|IRLeaderboardResponseBody
IRResponse = {} ---@class IRHeartbeatResponse : IRResponse
---@field body IRHeartbeatResponseBody
---@class IRChartTrackedResponse : IRResponse
---@field body {}
---@class IRRecordResponse : IRResponse
---@field body IRRecordResponseBody
---@class IRLeaderboardResponse : IRResponse
---@field body ServerScore[]
-- Performs a Heartbeat request. -- Performs a Heartbeat request.
---@param callback fun(res: IRResponse) # Callback function receives IRResponse as it's first parameter ---@param callback fun(res: IRHeartbeatResponse) # Callback function receives IRResponse as it's first parameter
local function Heartbeat(callback) end local function Heartbeat(callback) end
-- Performs a Chart Tracked request for the chart with the provided hash. -- Performs a Chart Tracked request for the chart with the provided hash.
---@param hash string # song hash ---@param hash string # song hash
---@param callback fun(res: IRResponse) # Callback function receives IRResponse as it's first parameter ---@param callback fun(res: IRChartTrackedResponse) # Callback function receives IRResponse as it's first parameter
local function ChartTracked(hash, callback) end local function ChartTracked(hash, callback) end
-- Performs a Record request for the chart with the provided hash. -- Performs a Record request for the chart with the provided hash.
---@param hash string # song hash ---@param hash string # song hash
---@param callback fun(res: IRResponse) # Callback function receives IRResponse as it's first parameter ---@param callback fun(res: IRRecordResponse) # Callback function receives IRResponse as it's first parameter
local function Record(hash, callback) end local function Record(hash, callback) end
-- Performs a Leaderboard request for the chart with the provided hash, with parameters mode and n. -- Performs a Leaderboard request for the chart with the provided hash, with parameters mode and n.
---@param hash string # song hash ---@param hash string # song hash
---@param mode "best"|"rivals" # request leaderboard mode ---@param mode "best"|"rivals" # request leaderboard mode
---@param n integer # limit the number of requested scores ---@param n integer # limit the number of requested scores
---@param callback fun(res: IRResponse) # Callback function receives IRResponse as it's first parameter ---@param callback fun(res: IRLeaderboardResponse) # Callback function receives IRResponse as it's first parameter
local function Leaderboard(hash, mode, n, callback) end local function Leaderboard(hash, mode, n, callback) end
---@type table ---@class IR
IR = { IR = {
Heartbeat = Heartbeat, Heartbeat = Heartbeat,
ChartTracked = ChartTracked, ChartTracked = ChartTracked,
Record = Record, Record = Record,
Leaderboard = Leaderboard Leaderboard = Leaderboard
} }

View File

@ -267,7 +267,7 @@ LoadSharedSkinTexture = function(name, path) end
-- Loads a font fromt the specified filename -- Loads a font fromt the specified filename
-- Sets it as the current font if it is already loaded -- Sets it as the current font if it is already loaded
---@param name? string ---@param name string
---@param filename string ---@param filename string
LoadFont = function(name, filename) end LoadFont = function(name, filename) end
@ -280,11 +280,10 @@ LoadFont = function(name, filename) end
---@return any # returns `placeholder` until the image is loaded ---@return any # returns `placeholder` until the image is loaded
LoadImageJob = function(filepath, placeholder, w, h) end LoadImageJob = function(filepath, placeholder, w, h) end
-- Loads a font from `skins/<skin>/textures/<path>` -- Loads a font from `skins/<skin>/fonts/<name>`
-- Sets it as the current font if it is already loaded -- Sets it as the current font if it is already loaded
---@param name? string ---@param name string
---@param filename string LoadSkinFont = function(name) end
LoadSkinFont = function(name, filename) end
-- Loads an image outside of the main thread to prevent rendering lock-up -- Loads an image outside of the main thread to prevent rendering lock-up
-- Image will be loaded at original size unless `w` and `h` are provided -- Image will be loaded at original size unless `w` and `h` are provided

View File

@ -1,3 +1,4 @@
---@diagnostic disable: lowercase-global
-- songwheel `songwheel` table -- songwheel `songwheel` table
---@class SongWheelScore ---@class SongWheelScore
@ -35,7 +36,7 @@ SongWheelDifficulty = {}
---@class SongWheelSong ---@class SongWheelSong
---@field artist string # Chart artist ---@field artist string # Chart artist
---@field difficulties SongWheelDifficulty[] # Array of difficulties for the current song ---@field difficulties SongWheelDifficulty[] # Array of difficulties for the current song
---@field bpm number # Chart BPM ---@field bpm string # Chart BPM
---@field id integer # Song id, unique static identifier ---@field id integer # Song id, unique static identifier
---@field path string # Full filepath to the chart folder on the disk ---@field path string # Full filepath to the chart folder on the disk
---@field title string # Chart title ---@field title string # Chart title