• gmod_src: Added RichText:InsertClickableTextStart( const cha..
    4 replies, posted
[B]Revision 999[/B] [INDENT]Added RichText:InsertClickableTextStart( const char* strCommand ) Added RichText:InsertClickableTextEnd() Added RichText:InsertFade( float, float ) Added RichText:ResetAllFades( bool, bool, float ) Added RichText:SetToFullHeight() Added RichText:GetNumLines() Added RichText:GotoTextStart() Added RichText:GotoTextEnd() Added RichText:SetFont( string )[/INDENT][B]Changed Files:[/B] [LIST] [*]trunk/src_garrysmod/garrysmod/Objects/cl_lua_panel.cpp [/LIST] Committed By [B]Garry Newman[/B]
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.