--[[
	MOD/lua/DermaHacker.lua
	Nautical | STEAM_0:1:25812285 <74.103.204.228:27005> | [19-10-13 10:45:13PM]
	===BadFile===
]]

// Derma Hacker

local function editPanel()

	local frame = vgui.Create( "DFrame" )
	frame:SetSize( 300,200 )
	frame:Center()
	frame:SetTitle( tostring( DMPANEL ) )
	frame:MakePopup()
	
	local textbox = vgui.Create( "DTextEntry" )
	textbox:SetParent( frame )
	textbox:SetPos( 5,25 )
	textbox:SetSize( 290,140 )
	textbox:SetText( "use 'DMPANEL' without quotes to refer to panel object" )
	textbox:SetMultiline( true )
	
	local run = vgui.Create( "DButton" )
	run:SetParent( frame )
	run:SetPos( 5,frame:GetTall() - 25 )
	run:SetSize( frame:GetWide() - 10,20 )
	run:SetText( "Run Code" )
	run.DoClick = function()
	
		RunString( textbox:GetValue() )
	end
end


local function selectPanel()

	DMPANEL = vgui.GetHoveredPanel()
	
	print( "selected DMPANEL: " .. tostring( DMPANEL ) )
	
	editPanel()
end

concommand.Add( "DermaHacker_SelectPanel",selectPanel )