Garry's Mod

Garry's Mod

27 ratings
[E2] VGUI Core
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Server content
Addon Tags: Build
File Size
Posted
Updated
4.086 KB
20 Feb, 2015 @ 9:59am
4 Apr, 2015 @ 9:00am
7 Change Notes ( view )

Subscribe to download
[E2] VGUI Core

Description
THIS IS AN EXTENSION FOR WIREMOD, NOT CONSOLE COMMANDS
Summary:
As of the modular update, you can now create almost any type of derma.
This extension allows you to select, manipulate and send to other players a vgui type from a template list.

Usage Logic:
Patterns are defined in the addon and cannot be created by the player using the E2
You load up a template from the list below.
You set the elements data on it with the function vguiSet*.
The text you input in those is going to be displayed on the gui in the places defined by the list. (button text, ...)
Once you're done editing the vgui, you can send it to a player with player:vguiAsk.
All the vgui functions require an ID parameter, this defines which vgui you're working on, this is arbitrary and simply allows you to define the vguis only once and not when it is sent. You choose this ID, it is arbitrary and needs to be a string.
Note that a player can block you. This means any vgui you try to send to that player will not show up on his screen. Blocked users list can be cleared with the command vguicore_clearblocked.

Available templates:
(currently: 4)
popupask : a text query window, much like the wire text entry.
title: title of the window. query: default text in the text field. Change this. ok: text that appears in the 'OK' buton. cancel: text that appears in the 'Cancel' button.

buttonlist : a grid pattern of buttons.
title: title of the window. buttons: table of buttons (key will be returned as origin and value as data) cancel: text that appears in the 'Cancel' button.

popup: A simple informational pop up window.
title : Title of the window. text : Text in the window. ok : Text on the 'OK' Button.

modular: well this is quite a bit more complicated as you can guess from the name.
title : Title of the window. width : [NUMBER] width in pixels (max 600) height : [NUMBER] height in pixels (max 600) content : Table containing the elements... See below

Elements Structure (used in the 'modular' pattern):
Root = table( .. [Element_name] = table( ['type'] = Type, one of the derma types. ['x'],['y'] = Position of the element ['params'] = table of parameters specific to 'type' ['sub'] = table similar to Root -> max table depth is 4 for sake of some simplicity. ) .. )

Server owners can add their own templates in lua/vguicoretemplates/
See the existing ones for reference on how to build them.

Function list:
vguiLoadTemplate(string currentVGUI, string templateName)
vguiSetString(string currentVGUI, string field, string data)
vguiSetTable(string currentVGUI, string field, table data)
player:vguiAsk(string currentVGUI)

vguiClk() - was the execution caused by a vgui returning? (1/0)
vguiClkOrigin() - origin of the return (determined by the template)
vguiClkData() - data coming from the return (popupask uses this to return the entered text)
vguiClkPlayer() - player who had the vgui.

Commands:
VGUICore_CanUse: Who can use this addon (1:everyone, 2:only admins) default:1
VGUICore_Cooldown: How long untill the player can send another vgui to a player (value in seconds)
VGUICore_ReloadTemplates: Does what its name says.(removed due to being useless)

Clientside:
VGUICore_ClearBlocked: Clear the blocked users list.
VGUICore_ReloadTemplates: Reload templates clientside, required for template 'developing'.
3 Comments
LoneCuriosity 24 Jul, 2018 @ 1:41am 
Does anybody have any examples one the moduler table etc.
{SD} killer124n 1 Jan, 2018 @ 6:08pm 
guys can some1 give me a example of how to use this with tables?
Orangina62 29 Mar, 2017 @ 4:43am 
mrc pour se core e2 :D