I assume strCommand is a console command, would it be possible for you to make it a lua function instead?
nope
[QUOTE=Wizard of Ass;30278645]I assume strCommand is a console command, would it be possible for you to make it a lua function instead?[/QUOTE]
concommand.Create
There is no concommand.Create .
I found a way to do it.
[lua]
local callbacks = {};
concommand.Add("RichTextClickCallback",function(_,_,args)
local tbl = callbacks[args[1]][args[2]];
tbl[2](tbl[1]);
--Cleaning shit up
for k,v in pairs(callbacks) do
if(!v[1]) then
callbacks[k] = nil;
end
end
end);
local OldInsert = _R.Panel.InsertClickableTextStart;
function _R.Panel:InsertClickableTextStart(func)
if(!callbacks[self]) then
callbacks[self] = {};
end
local pid = string.sub(tostring(self),7)
OldInsert(self,"RichTextClickCallback "..pid.." "..tostring(table.insert(callbacks[pid],{self,func})));
end
[/lua]
Sorry, you need to Log In to post a reply to this thread.