• How to control an interaction button tool tip that can contain usages of the tool buttons
    1 replies, posted
Well, you know like the "Weld - Smart" tool is using "TOOL.Information" table, but there is really no documentation for it or how to use it. Here is the screen ( The thing in red ) [url]https://drive.google.com/file/d/0B6vgydhudtoAVTlFZ242Y2c2STA/view?usp=sharing[/url] How can I add other button like Shift + E + Right click for example ??
You can find source code for it here: [url]https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/sandbox/entities/weapons/gmod_tool/cl_init.lua#L103-L164[/url] You cannot have more than two key combinations displayed. Here's an example: [code] TOOL.Information = { { name = "info", stage = 1 }, { name = "left" }, { name = "right" }, { name = "right_use", icon2 = "gui/e.png" }, { name = "reload" }, { name = "reload_use", icon2 = "gui/e.png" } } if ( CLIENT ) then language.Add( "tool.rb655_easy_inspector.1", "See information in the context menu" ) language.Add( "tool.rb655_easy_inspector.left", "Select an object" ) language.Add( "tool.rb655_easy_inspector.right", "Select next mode" ) language.Add( "tool.rb655_easy_inspector.right_use", "Select previous mode" ) language.Add( "tool.rb655_easy_inspector.reload", "Select yourself" ) language.Add( "tool.rb655_easy_inspector.reload_use", "Select your view model" ) end[/code] For each table inside the TOOL.Information a new line of text is added on HUD. It will display "#tool.rb655_easy_inspector.<namefromthename>" by default. icon key defines a path to the icon icon2 key defines a a second icon path certain "name"s have a default fallback icon stage key makes the text only appear for given stage ( TOOL:SetStage() ) op key makes the text only appear for given operation ( TOOL:SetOperation() ) Default name is "info", which will display tool.rb655_easy_inspector.<toolstage>, as all tools that do not use TOOL.Information do. If your name ends on "use" and you do not override the icon2, icon2 will be E key. ( gui/e.png ) If your name starts with "info" - default icon is "gui/info" If your name starts with "left" - default icon is LMB icon ( gui/lmb.png ) If your name starts with "right" - default icon is RMB icon ( gui/rmb.png ) If your name starts with "reload" - default icon is R key icon ( gui/r.png ) This should cover it all. [b]REMINDER FOR MYSELF TO PUT IT ONTO WIKI.[/b]
Sorry, you need to Log In to post a reply to this thread.