Skip to content

Commit

Permalink
CommandHandler support
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Jan 15, 2024
1 parent 2a629dd commit 39d20fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions class_configs/rng_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ local mq = require('mq')
local RGMercUtils = require("utils.rgmercs_utils")

return {
['CommandHandlers'] = {
makeammo = function(self, ...)
RGMercsLogger.log_info("I would make ammo, if I only knew how.")
return true
end,
},
['Modes'] = {
'Tank',
'DPS',
Expand Down
2 changes: 1 addition & 1 deletion extras/version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = 'aa27dc3 2024-01-14' }
return { commitId = '2a629dd 2024-01-14' }
4 changes: 3 additions & 1 deletion modules/class.lua
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,11 @@ end
---@param ... string
---@return boolean
function Module:HandleBind(cmd, ...)
local params = ...
local handled = false
-- /rglua cmd handler
if self.ClassConfig.CommandHandlers[cmd] then
return self.ClassConfig.CommandHandlers[cmd](self, ...)
end
return handled
end

Expand Down

0 comments on commit 39d20fa

Please sign in to comment.