chore(intellisense): improve parameter annotations and add missing comments

Touched up incorrect or missing Intellisense parameter annotations across several functions. Added some missing descriptions to improve editor support. Still more to do, but this is a small step forward for overall developer workflow. Also small fix in picklexp
This commit is contained in:
MrNewb committed 2025-06-07 22:50:13 -04:00
1 parent 866283162b
commit c71a261115
88 files changed
+339 -286

No files matched your search

+9 -3
View File
@@ -1,17 +1,23 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local function warnUser()
print("Currently only a few skill systems are supported by Community Bridge, you are using a resource that requires the skills module to be used.")
end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being being used.
---@return string
Skills.GetResourceName = function()
return "none"
end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the skill level of the passed skill name.
---@param skillName string
---@return number
---@return nil
Skills.GetSkillLevel = function(skillName)
return 0, warnUser()
warnUser()
return 0
end
return Skills
+23 -7
View File
@@ -1,27 +1,43 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local function warnUser()
print("Currently only a few skill systems are supported by Community Bridge, you are using a resource that requires the skills module to be used.")
end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being being used.
---@return string
Skills.GetResourceName = function()
return "none"
end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the skill level of the passed skill name.
---@param src number
---@param skillName string
---@return number
Skills.GetSkillLevel = function(src, skillName)
return 0, warnUser()
warnUser()
return 0
end
---@diagnostic disable-next-line: duplicate-set-field
---This will add xp to the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.AddXp = function(src, skillName, amount)
return false, warnUser()
warnUser()
return false
end
---@diagnostic disable-next-line: duplicate-set-field
---This will remove xp from the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.RemoveXp = function(src, skillName, amount)
return false, warnUser()
warnUser()
return false
end
return Skills
+6 -2
View File
@@ -1,14 +1,18 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "evolent_skills"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param skillName string
---@return number
Skills.GetSkillLevel = function(skillName)
local skillData = exports.evolent_skills:getSkillLevel(skillName)
return skillData or 0
+18 -4
View File
@@ -1,20 +1,30 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "evolent_skills"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param src number
---@param skillName string
---@return number
Skills.GetSkillLevel = function(src, skillName)
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
return skillData or 0
end
---@diagnostic disable-next-line: duplicate-set-field
---This will add xp to the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.AddXp = function(src, skillName, amount)
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
if not skillData then return false, print("Skill not found") end
@@ -22,7 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
return true
end
---@diagnostic disable-next-line: duplicate-set-field
---This will remove xp from the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.RemoveXp = function(src, skillName, amount)
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
if not skillData then return false, print("Skill not found") end
+7 -2
View File
@@ -1,14 +1,19 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "OT_skills"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param skillName string
---@return number
Skills.GetSkillLevel = function(skillName)
local skillData = exports.OT_skills:getSkill(skillName)
return skillData.level or 0
+18 -2
View File
@@ -1,19 +1,30 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "OT_skills"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param src number
---@param skillName string
---@return number
Skills.GetSkillLevel = function(src, skillName)
local skillData = exports.OT_skills:getSkill(src, skillName)
return skillData.level or 0
end
---This will add xp to the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.AddXp = function(src, skillName, amount)
local skillData = exports.OT_skills:getSkill(src, skillName)
if not skillData then return false, print("Skill not found") end
@@ -21,6 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
return true
end
---This will remove xp from the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.RemoveXp = function(src, skillName, amount)
local skillData = exports.OT_skills:getSkill(src, skillName)
if not skillData then return false, print("Skill not found") end
+7 -3
View File
@@ -1,16 +1,20 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "pickle_xp"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param skillName string
---@return number
Skills.GetSkillLevel = function(skillName)
local skillData = exports.OT_skills:GetLevel(skillName)
local skillData = exports.pickle_xp:GetLevel(skillName)
return skillData or 0
end
+18 -2
View File
@@ -1,19 +1,30 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "pickle_xp"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param src number
---@param skillName string
---@return number
Skills.GetSkillLevel = function(src, skillName)
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
return skillData or 0
end
---This will add xp to the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.AddXp = function(src, skillName, amount)
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
if not skillData then return false, print("Skill not found") end
@@ -21,6 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
return true
end
---This will remove xp from the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.RemoveXp = function(src, skillName, amount)
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
if not skillData then return false, print("Skill not found") end