Files
MrNewb 90c65dc55e Add GetResourceName function to all modules
Introduces a standardized GetResourceName function to banking, clothing, dispatch, doorlock, framework, fuel, helptext, housing, and other modules. This function returns the name of the in-use resource, improving resource identification and interoperability across the codebase.
2025-09-10 12:27:12 -04:00

27 lines
873 B
Lua

---@diagnostic disable: duplicate-set-field
HelpText = HelpText or {}
local resourceName = "okokTextUI"
local configValue = BridgeSharedConfig.HelpText
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---This will show a help text message at the screen position passed
---@param message string
---@param _position string
---@return nil
HelpText.ShowHelpText = function(message, _position)
return exports['okokTextUI']:Open(message, 'darkblue', _position, false)
end
---This will get the name of the in use resource.
---@return string
HelpText.GetResourceName = function()
return resourceName
end
---This will hide the help text message on the screen
---@return nil
HelpText.HideHelpText = function()
return exports['okokTextUI']:Close()
end
return HelpText