Migrate to modern plugins: fix errors in util/mt-ide-helper & add changes that fixes most errors in code. LG-1978

This commit is contained in:
alek13
2025-09-16 19:05:54 +03:00
parent f8c9f7d83b
commit 0ca47db2ea
26 changed files with 301 additions and 160 deletions

20
specs/Color.lua Normal file
View File

@@ -0,0 +1,20 @@
--- A ColorString is a string that represents a color. It can be one of the following:
--- * a named color, e.g. `"red"`, `"blue"`, `"green"`, etc.
--- (see [CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/#named-colors) for a full list of named colors)
--- * a named color with alpha, e.g. `"red#08"`, `"blue#FF"`, `"green#F"`, etc.
--- * an RGB or RGBA hex color code, e.g. `"#RRGGBB"` or `"#RRGGBBAA"`, where `RR`, `GG`, `BB`, and `AA` are two-digit hexadecimal numbers representing the red, green, blue, and alpha (opacity) components of the color.
--- * e.g. `"#FF0000"` for red, `"#00FF00"` for green, `"#0000FF"` for blue, etc.
--- * a shorthand hex color code, e.g. `"#RGB"` or `"#RGBA"`, where `R`, `G`, `B`, and `A` are single-digit hexadecimal numbers representing the red, green, blue, and alpha (opacity) components of the color.
--- @class ColorString: string
--- A ColorSpec specifies a 32-bit color. It can be written in any of the following forms:
--- * table form: Each element ranging from 0..255 (a, if absent, defaults to 255):
--- `colorspec = {a=255, r=0, g=255, b=0}`
--- * numerical form: The raw integer value of an ARGB8 quad:
--- `colorspec = 0xFF00FF00`
--- * string form: A ColorString (defined above):
--- `colorspec = "green"`
--- @class ColorSpec: {r:number, g:number, b:number, a:number}|ColorString|number

View File

@@ -1,15 +1,15 @@
--- @class SimpleSoundSpec
local SimpleSoundSpec = {
--- Scales the gain specified in `SimpleSoundSpec`.
--- @type number
--- @type number?
gain = 1.0,
--- Overwrites the pitch specified in `SimpleSoundSpec`.
--- @type number
--- @type number?
pitch = 1.0,
--- Overwrites the fade specified in `SimpleSoundSpec`.
--- @type number
--- @type number?
fade = 0.0,
--- Start with a time-offset into the sound.
@@ -21,16 +21,16 @@ local SimpleSoundSpec = {
---
--- Available since feature `sound_params_start_time`.
---
--- @type number
--- @type number?
start_time = 0.0,
--- If true, sound is played in a loop.
--- @type boolean
--- @type boolean?
loop = false,
--- Play sound at a position.
--- Can't be used together with `object`.
--- @type Position
--- @type Position?
pos = { x = 1, y = 2, z = 3 },
--- Attach the sound to an object.
@@ -51,19 +51,19 @@ local SimpleSoundSpec = {
--- the active object range; they should start playing again if objects
--- come back into range (but due to a known bug, they don't yet).
---
--- @type ObjectRef
--- @type ObjectRef?
object = nil,
--- Only play for this player.
--- Can't be used together with `exclude_player`.
---
--- @type string
--- @type string?
to_player = '',
--- Don't play sound for this player.
--- Can't be used together with `to_player`.
---
--- @type string
--- @type string?
exclude_player = '',
--- Only play for players that are at most this far away when the sound
@@ -71,6 +71,6 @@ local SimpleSoundSpec = {
--- Needs `pos` or `object` to be set.
--- `32` is the default.
---
--- @type number
--- @type number?
max_hear_distance = 32,
}