RegisterProcessConsoleExecPreHook

This registers a callback that will get called before UObject::ProcessConsoleExec is called.

Parameters (except strings & bools & FOutputDevice) must be retrieved via Param:Get() and set via Param:Set().

If the callback returns nothing (or nil), the original return value of ProcessConsoleExec will be used.

If the callback returns true or false, the supplied value will override the original return value of ProcessConsoleExec.

Parameters

#TypeInformation
1functionThe callback to register

Callback Parameters

#TypeInformation
1UObjectThe object context
2stringThe command
3stringThe rest of the command
4FOutputDeviceThe AR
5UObjectThe executor

Callback Return Value

#TypeInformation
1boolWhether to override the original return value of ProcessConsoleExec

Example

local function MyCallback(Context, Command, CommandParts, Ar, Executor)
    -- Do something with the parameters
    -- Return nil to use the original return value of ProcessConsoleExec
    -- Return true or false to override the original return value of ProcessConsoleExec

    return nil
end

RegisterProcessConsoleExecPreHook(MyCallback)