So, the couple topics I've put here have mostly been about some code I'm trying to get to work, and then I hit one problem I can't fix at all. So, when I run my command, other than my bad positioning of the derma, it works. Except, the button I added to make it close doesn't work, it just doesn't do it's job. No errors, it just doesn't work.
My code:
function WarnDerma( sv_reason ) --Creating the derma function to be recieved by clientRPC
local DFrame = vgui.Create( "DFrame" ) --Create the Derma frame
DFrame:Center()
DFrame:SetSize( 700, 400 )
DFrame:SetTitle( "Warning: #A", sv_reason )
DFrame:SetVisible( true )
DFrame:SetDraggable( false )
DFrame:ShowCloseButton( false ) --So a clever person doesn't just click it away immediately
DFrame:MakePopup()
local richtext = vgui.Create( "RichText", DFrame )
richtext:Dock( FILL ) --No idea what this does, but Garry uses it in the documentation, so better use it
richtext:InsertColorChange( 192, 192, 192, 255 )
richtext:AppendText( sv_reason ) --Displays the warning reason
local DButton = vgui.Create( "DButton", DFrame )
DButton:SetText( "OK" )
DButton:SetTextColor( Color( 255, 255, 255 ) )
DButton:Center()
DButton:SetSize( 100, 30 )
DButton:SetEnabled( true )
if DButton:IsDown() then DFrame:Close() end
end
Anyone know why this wouldn't work?