Skip to content

Commit

Permalink
refactor: remove hardcoded support of TFNRP framework
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGriefs committed Oct 29, 2021
1 parent 3955c92 commit 31953e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions client.lua
Expand Up @@ -3,6 +3,14 @@ local hudForceHide = false
local hudPresence
local activated = false

-- compatibility with frameworks

if GetConvar('tfnrp_framework_init') == 'true' then
Config.CommandAccessHandling = function ()
return exports.framework:GetLocalClientDuty() > 0
end
end

----------------------------------------------------------
-------------------- Commands
----------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion config.lua
@@ -1,9 +1,12 @@
--- client-side config
--- @type table
Config = {
--- handling used to verify if the client should be able to enable AB3
--- @type function
--- @return boolean
CommandAccessHandling = function ()
return exports.framework:GetLocalClientDuty() > 0
-- if you don't use TFNRP framework, place custom framework access handling here
return true
end,
--- keybind to use for on/off command. can be nil for no keybind
--- @type string
Expand Down

0 comments on commit 31953e8

Please sign in to comment.