• Quick Connect Menu Addon
    18 replies, posted
[b]Quick Connect[/b] This addon essentially adds a panel to your startup menu so you can quickly connect to servers you play on often without opening the server browser. You can add, remove, and edit servers on the list, and then connect to them by clicking on the arrow. [b]Features[/b] - Server favorites panel for quickly connecting to servers. - openserverbrowser | Opens the legacy server browser. - menu_quickconnect | Reopens the servers panel - lua_run_menu <code> | Runs lua code in the menu - lua_openscript_menu <file> | Runs a lua script file in the menu [b]Notes[/b] Unfortunately I don't know how - if it's even possible - to query a single server through GLua. I have uncovered a serverlist.Query function used in lua/menu/mainmenu.lua which is used to get a list of servers, but the function takes a table argument and I don't know if it can be used to query a single server. If anyone knows more let me know please. Luckily, because of Gametracker, quickconnect can still get info on servers that have Gametracker profiles. Since not all servers have Gametracker profiles though this addon also allows you to add servers with a custom name option and connect to them. And, thanks to another function I found while digging around in Garry's menu, serverlist.PlayerList, quickconnect is able to get a count of players that are in the server. Red arrows are servers with a GameTracker profile whose status is not Alive (aka it's down). The arrow will remain white for servers that don't have a gametracker profile even if they are down since I don't know how to check if they are active. [b]Installation[/b] Unfortunately I can't put this on workshop because there's no actual support for menu addons. To install this you will have to do it manually. [url=https://github.com/Ronny95/gmod-menuplus/archive/master.zip]Download[/url] To install just extract the zip. Then copy the contents inside the gmod-menu-master to your garrysmod folder (NOT addons). If there are any popup messages about overwriting folders or files, choose replace. Everything should be folder merges except for one file, menu.lua, in which I've only added one additional line to: include( "quickconnect/init.lua" ) [b]Credits[/b] Thanks to Banhfunbags and vigi8 for improvements and suggestions. [b]Images[/b] [img]http://i.imgur.com/vt0W1ww.png[/img] [img]http://i.imgur.com/nfm6pdu.png[/img] [img]http://i.imgur.com/so3aBIG.png[/img] [img]http://i.imgur.com/HGN9Yh5.png[/img] [img]http://i.imgur.com/6cvKLQQ.png[/img] [img]http://i.imgur.com/AdXajUm.png[/img] [b]How to Install Step By Step with Pictures[/b] This was done in Windows 8 but should be roughly the same for Windows 7. 1. [url=https://github.com/Ronny95/gmod-menuplus/archive/master.zip]Download the addon by clicking here.[/url] 2. Navigate to the downloaded file (most likely inside your Downloads folder). [img]http://i.imgur.com/Sm7HYJ1.png[/img] 3. Open gmod-menuplus-master.zip. [img]http://i.imgur.com/ts2DqOQ.png[/img] 4. Open the gmod-menuplus-master folder. [img]http://i.imgur.com/0JJh8DB.png[/img] 5. In a [b]new[/b] window, navigate to your Garrysmod folder. (most likely C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod\garrysmod) [img]http://i.imgur.com/Lx92qpV.png[/img] 6. Select both folders from the gmod-menuplus-master folder. [img]http://i.imgur.com/n4221hK.png[/img] 7. Drag and drop the two folders over the title for the Garrysmod folder window. (notice it says "+Copy to garrysmod" in the tooltip, it should say that when you do it as well.) [img]http://i.imgur.com/o5DS11U.png[/img] 8. If prompted about file overwriting / replacing, choose to replace. [img]http://i.imgur.com/iHDiLM2.png[/img]
How would I use this with password protected servers?
[QUOTE=Banhfunbags;43455830]How would I use this with password protected servers?[/QUOTE] Oh true, I didn't think about that. I'll add a password feature. Edit: Updated, has password feature now. Let me know if it works though, it should but I can't test it myself since I don't have a server to test with.
It doesn't work. It attempts to connect to the server but gives the "Failed after 4 tries" error. EDIT: Actually nevermind. It works, but it didn't work earlier because I was trying to connect to a localhost server. Also this gets spammed into console: [code]MENU ERROR: lua/menu/quickconnect/init.lua:615: attempt to index local 'text' (a nil value) lua/menu/quickconnect/init.lua:615 [parse_html_text] lua/menu/quickconnect/init.lua:633 [onsuccess] lua/includes/modules/http.lua:34 [][/code] I think the error happens when I add a server that isn't on Gametracker.
[QUOTE=Banhfunbags;43456327]It doesn't work. It attempts to connect to the server but gives the "Failed after 4 tries" error. EDIT: Actually nevermind. It works, but it didn't work earlier because I was trying to connect to a localhost server. Also this gets spammed into console: [code]MENU ERROR: lua/menu/quickconnect/init.lua:615: attempt to index local 'text' (a nil value) lua/menu/quickconnect/init.lua:615 [parse_html_text] lua/menu/quickconnect/init.lua:633 [onsuccess] lua/includes/modules/http.lua:34 [][/code] I think the error happens when I add a server that isn't on Gametracker.[/QUOTE] Woops, you're right, fixed.
Would it be possible to make it not draw on top all the time? It can block some of the menus like the mounting games list.
Unfortunately Garry's entire menu is on one html panel, so the best I can do is add a way to minimize the panel. Edit: I should also make it drag-able and sizable and persist it. Edit: Added minimize button in the top right and a console command menu_quickconnect to bring it back up.
You can use 4th argument for lua_run: [CODE]concommand.Add("lua_run_menu", function(_, _, _, raw) RunStringEx(raw, "lua_run_menu") end)[/CODE]
[QUOTE=vigi8;43457408]You can use 4th argument for lua_run: [CODE]concommand.Add("lua_run_menu", function(_, _, _, raw) RunStringEx(raw, "lua_run_menu") end)[/CODE][/QUOTE] Thanks for this tip, also went ahead and added lua_openscript_menu.
Damn, nice job. The code is nice and clean!
-snip-
You shouldn't remove the connect button for servers that aren't on Gametracker. That's just my opinion though
The addon is great but it says servers with hostname* instead of IP don't have Gametracker while they actually do. *("Custom hostname", a hosts file alias)
This is great. Cheers
Thanks for the input guys. Pushed out an update. Should be more friendly with servers that do not have gametracker profiles. Also, I added some notes about server querying in the first post. If anyone knows how to query a single server in glua without going through gametracker please let me know. Added features: - Custom server names (optional, leave blank if you'd rather it grabs the server name through gametracker) - Connect button is never disabled but it will go red if the server's gametracker profile status is anything but "Alive".
-snip-
[QUOTE=Tenrys;43513894] You should make the window movable. I can't do anything in my bottom right corner.[/QUOTE] You do realize you can minimize it by pressing the little button in upper right corner?
Oh shit, I didn't. Well, it isn't noticeable. I tried everything but this, it more looks like a visual thing. :s Thanks.
Thanks for making my life easier...
Sorry, you need to Log In to post a reply to this thread.