Garry's Mod Wiki

Derma_Query

  Panel Derma_Query( string text = "Message Text (Second Parameter)", string title = "Message Title (First Parameter)", string btn1text, function btn1func = nil, string btn2text = nil, function btn2func = nil, string btn3text = nil, function btn3func = nil, string btn4text = nil, function btn4func = nil )

Description

Shows a message box in the middle of the screen, with up to 4 buttons they can press.

Arguments

1 string text = "Message Text (Second Parameter)"
The message to display.
2 string title = "Message Title (First Parameter)"
The title to give the message box.
3 string btn1text
The text to display on the first button.
4 function btn1func = nil
The function to run if the user clicks the first button.
5 string btn2text = nil
The text to display on the second button.
6 function btn2func = nil
The function to run if the user clicks the second button.
7 string btn3text = nil
The text to display on the third button
8 function btn3func = nil
The function to run if the user clicks the third button.
9 string btn4text = nil
The text to display on the fourth button
10 function btn4func = nil
The function to run if the user clicks the fourth button.

Returns

1 Panel
The Panel object of the created window.

Example

Creates a popup box with buttons that print messages to the console when clicked.

Derma_Query( "Are you sure about that?", "Confirmation:", "Yes", function() print("They clicked the yes button.") end, "No", function() print("They clicked the no button.") end )