Garry's Mod

Garry's Mod

52 ratings
[E2] Vgui Core
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Build, Fun
File Size
Posted
Updated
355.813 KB
8 May, 2018 @ 2:02pm
12 Jun @ 7:40am
24 Change Notes ( view )

Subscribe to download
[E2] Vgui Core

In 1 collection by Linus
Linus' Favorites
9 items
Description
Addon for the Wiremod Expression2 Tool which allows the player to create vgui panels.

E2 Code Examples: https://github.com/Linus045/e2_vgui_core/wiki/Examples-for-different-types
Wiki: https://github.com/Linus045/e2_vgui_core/wiki
GitHub: https://github.com/Linus045/e2_vgui_core
Issues/Bugs: https://github.com/Linus045/e2_vgui_core/issues

Demo Video: https://drive.google.com/file/d/1MZWlPZ2Kw71UmFu7NSF8Rhu5U_8jZSMH/view

Features:
- Create vgui elements via e2 on your own client or other people's client (abuse protection is provided, see wiki)
- fully customize the vgui panel layout (similar to how they work inside lua)
- link the e2 to vehicles so the vgui elements open/close automatically when someone enters/leaves the vehicle
- simple coloring options to customize the vgui elements


If you encounter bugs please report them on github and not in the comments, thanks :)

If you have any ideas for improvements or stuff you want me to add just ask in the comments and i will see what i can do.

Any feedback is appreciated, this especially refers to lua errors or other bugs since my testing capabilities are limited.

I'm also available on the Official Wiremod Discord @Linus


Available vgui elements:
- DCombobox
- DTextentry
- DSlider
- DButton
- DPropertysheet
- DListview
- DPanel
- DSpawnicon
- DModelpanel
- DLabel
- DImagebutton
- DFrame
- DColormixer
- DCheckboxlabel
- DCheckbox

If you need more feel free to ask in the comments and I'll see what I can do.
54 Comments
Linus  [author] 4 May @ 4:03pm 
@cirro
I've never used the DHTML element myself.
I took a quick look and security might be a problem. As I understand it the website gets loaded by the client that creates the DHTML element.
Therefore it allows the e2-creator to open any URL on any other player, which is something I'm not willing to implement.

That said. It might be possible to allow only the e2-owner to use DHTML elements but block it on other players or add additional features to the buddy system to explicitly allow the usage of DHTML elements.
Aside from that, there seems to be a feature that allows Javascript to execute Lua code which also might present security problems (I took note that you can disable this specific funtionality though)
I will have to look into it a bit more.

Do you have any specific use cases in mind for DHTML which would help me understand what features you need?
cirro 31 Mar @ 8:48am 
might be outside the scope of this addon, but is there any way we can get dhtml?
Linus  [author] 26 Nov, 2023 @ 10:33pm 
Thanks for bringing this to my attention. I will try to get it fixed within the next few days, I'm currently a bit busy. The fix itself seems to be pretty simple though. Someone already made a pull request on GitHub (thanks for that).
Kerk 24 Nov, 2023 @ 12:44pm 
Adding on back to my previous comment, I think the new Wiremod update broke the addon. Not 100% sure but It seemed to have stopped working since.
Kerk 21 Nov, 2023 @ 7:48pm 
BUG:
For some reason VGUI core just stopped working entirely. None of the functions or anything show up in expression 2, and it makes errors whenever I try to spawn any of my dupes using VGUI core. The spawnmenu extensions still exist, like the buddies and blacklist menu, but the core is just non-existent in the editor.
Linus  [author] 15 Mar, 2022 @ 2:43am 
@LoganDark
That "duplicate column" error is something I can't really fix. It happens when you try to create columns which use the same index (e.g. add 2 columns without index and then add another one with index 1)

See: https://github.com/Facepunch/garrysmod/blob/master/garrysmod/lua/vgui/dlistview.lua#L71

I'm unsure what causes the second error, can you provide a simple code example to reproduce this (in a new issue on github) ?
LoganDark 10 Mar, 2022 @ 4:04pm 
Also, a couple of errors:

[[E2] Vgui Core] Attempted to insert duplicate column.
1. AddColumn - lua/vgui/dlistview.lua:71
2. unknown - lua/autorun/client/cl_vgui_lib.lua:75
3. applyAttributes - lua/autorun/client/cl_vgui_lib.lua:170
4. createFunc - vgui_elements/client/dlistview.lua:8
5. func - lua/autorun/client/cl_e2_vgui_netmessage.lua:33
6. unknown - lua/includes/extensions/net.lua:33

[[E2] Vgui Core] lua/autorun/client/cl_vgui_lib.lua:79: attempt to index local 'column' (a nil value)
1. unknown - lua/autorun/client/cl_vgui_lib.lua:79
2. applyAttributes - lua/autorun/client/cl_vgui_lib.lua:170
3. createFunc - vgui_elements/client/dlistview.lua:8
4. func - lua/autorun/client/cl_e2_vgui_netmessage.lua:33
5. unknown - lua/includes/extensions/net.lua:33
LoganDark 10 Mar, 2022 @ 3:59pm 
This addon's missing the ability to set the minimum size of a frame (https://wiki.facepunch.com/gmod/DFrame:SetMinWidth / https://wiki.facepunch.com/gmod/DFrame:SetMinHeight) , missing the ability to detect when a frame's close button is clicked (even when delete on close is set to 0), missing the ability to turn off clipping for panels (https://wiki.facepunch.com/gmod/Panel:NoClipping)

It also has some edge cases where panels created by an E2 can be stuck on-screen forever even when the E2 is deleted. There needs to be a console command to clear all E2 VGUIs
Linus  [author] 22 Jul, 2020 @ 11:59am 
I've added some examples for idividual elements such as dslider, dcombobox, dbutton on the wiki here [github.com].
I will add more example in the future but if you need help with anything specific just post a comment here or ask me on the Official Wiremod Discord @Linus
Elitedino 20 Jul, 2020 @ 3:08pm 
thanks for the quick response, i'm still quite confused on how to print out what data was collected