REC_NameTag
Stracture
Installation, configuration, and usage for REC_NameTag.
- Added
- Updated
The following configuration files and manifest are taken from the current source.
config/sh_config.lua
---@type REC_NameTag.Shared.Enum
local shEnum = require "@REC_NameTag.shared.sh_enum"
local actionTypes = shEnum.actionTypes
local toggleActionTypes = shEnum.toggleActionTypes
---@class REC_NameTag.Shared.Config
local config = {}
---[[
--- Debug mode
---]]
---@type boolean
config.debugMode = true
----[[
--- Draw distance for name tags
---]]
---@type number
config.drawDistance = 10.0
---[[
--- Interval for the name tag scan thread
---]]
---@type integer
config.scanInterval = 200
---[[
--- Interval for the nearby player scan
---]]
---@type integer
config.nearbyScanInterval = 600
---[[
--- Interval for the scan thread while there is nothing to track
--- (no nearby players cached, nothing being drawn)
---]]
---@type integer
config.idleScanInterval = 0
---[[
--- Always draw your own name tag above your head
--- When false, it is only drawn for ownTagPreviewDuration after an action in /nametag
---]]
---@type boolean
config.alwaysDrawOwnTag = false
---[[
--- Seconds to draw your own name tag after an action in /nametag
---]]
---@type integer
config.ownTagPreviewDuration = 2
---[[
--- Seconds to wait before the next action in /nametag is accepted
---]]
---@type integer
config.actionCooldown = 2
---[[
--- Maximum length for name tag
---]]
---@type integer
config.maxNameLength = 10
---[[
--- Emoji for beginner players
---]]
config.beginnerEmoji = "🌱 "
---[[
--- Job Emoji when no job assigned
---]]
config.noJobEmoji = "👾"
---[[
--- Job emoji settings
---]]
---@type table<string, string>
config.jobEmojiSettings = {
["police"] = "🚓 ",
["ambulance"] = "🚑",
["mechanic"] = "🔧",
}
---[[
--- Tag format functions
---]]
---@type table<string, fun(...): string>
config.tagFormats = {
---[[
--- Name only formatting
---]]
---@param firstName string
---@param lastName string
---@return string
nameOnly = function (firstName, lastName)
return ("%s %s"):format(
firstName,
lastName
)
end,
---[[
--- Name and Job and ID formatting
---]]
---@param name string
---@param job string
---@param id integer
---@return string
all = function (name, job, id)
return ("%s %s - [%d]"):format(
job,
name,
id
)
end,
---[[
--- Name and Job formatting
---]]
---@param name string
---@param job string
---@return string
nameAndJob = function (name, job)
return ("%s %s"):format(
job,
name
)
end,
---[[
--- Name and ID formatting
--- ]]
---@param name string
---@param id integer
---@return string
nameAndId = function (name, id)
return ("%s - [%d]"):format(
name,
id
)
end,
}
---[[
--- Actions icons
---]]
---@type table<REC_NameTag.Shared.Enum.ActionTypes, { icon: string, iconColor: string }>
config.actionIcons = {
[actionTypes.edit_name] = {
icon = "fa-solid fa-pen-to-square",
iconColor = "#63E6BE",
},
[actionTypes.reverse_name] = {
icon = "fa-solid fa-right-left",
iconColor = "#63E6BE",
},
[actionTypes.toggle_visible] = {
icon = "fa-solid fa-eye",
iconColor = "#63E6BE",
},
[actionTypes.toggle_visible_id] = {
icon = "fa-brands fa-ideal",
iconColor = "#63E6BE",
},
[actionTypes.toggle_visible_job] = {
icon = "fa-solid fa-user-doctor",
iconColor = "#63E6BE",
},
[actionTypes.preview_tag] = {
icon = "fa-solid fa-magnifying-glass",
iconColor = "#63E6BE",
},
}
---[[
--- Do not touch settings below unless you know what you are doing.
---]]
---@type table<REC_NameTag.Shared.Enum.ToggleActionTypes, boolean>
config.toggleSettings = {
[toggleActionTypes.toggle_visible] = true,
[toggleActionTypes.toggle_visible_job] = true,
[toggleActionTypes.toggle_visible_id] = true,
}
return config
