mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
48
lua/autorun/properties/editentity.lua
Normal file
48
lua/autorun/properties/editentity.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
properties.Add( "editentity", {
|
||||
MenuLabel = "#entedit",
|
||||
Order = 90001,
|
||||
PrependSpacer = true,
|
||||
MenuIcon = "icon16/pencil.png",
|
||||
|
||||
Filter = function( self, ent, ply )
|
||||
|
||||
if ( !IsValid( ent ) ) then return false end
|
||||
if ( !ent.Editable ) then return false end
|
||||
if ( !gamemode.Call( "CanProperty", ply, "editentity", ent ) ) then return false end
|
||||
|
||||
return true
|
||||
|
||||
end,
|
||||
|
||||
Action = function( self, ent )
|
||||
|
||||
local window = g_ContextMenu:Add( "DFrame" )
|
||||
window:SetSize( 320, 400 )
|
||||
window:SetTitle( tostring( ent ) )
|
||||
window:Center()
|
||||
window:SetSizable( true )
|
||||
|
||||
local control = window:Add( "DEntityProperties" )
|
||||
control:SetEntity( ent )
|
||||
control:Dock( FILL )
|
||||
|
||||
control.OnEntityLost = function()
|
||||
|
||||
window:Remove()
|
||||
|
||||
end
|
||||
end
|
||||
} )
|
||||
Reference in New Issue
Block a user