DermaRequest Library

DermaRequest Library
=====
*A simple library that adds the ability for the server to easily request strings from the client. It can also be used to push Derma message boxes to players!*

## Usage
There are currently two simple functions in the DermaRequest.* library.
```RequestString(Player ply, String title, String question, String default, Func Callback)```
```Message(Player player, String message, String title, String buttontext)```

## Examples
The following example adds a command named FavoriteColor, which when ran will request from the player their favorite color using the DermaRequest library. Specifically, this example uses the ```RequestString```
```lua
local COMMAND = Clockwork.command:New("FavoriteColor");
COMMAND.tip = "Asks you a simple question!";
COMMAND.flags = CMD_DEFAULT;

-- Called when the command has been run.
function COMMAND:OnRun(player, entity)
	Clockwork.dermaRequest:RequestString(player, "Title of DFrame", "What is your favorite color?", "", function(text)
		Clockwork.player:Notify(player, "You told the server your favorite color is: "..text..".")
	end)
end;

COMMAND:Register();
```

The next example makes it known to a player that flashlights are disabled. This uses the ```Message``` method.
```lua
-- Called when a player switches their flashlight on or off.
function Schema:PlayerSwitchFlashlight(player, on)
	Clockwork.dermaRequest:Message(player, "Ouch! The light hurts... stop turning it on.", "No Flashlights.", "I'm Sorry")
	return false;
end;
```

## Amendment
Obviously the examples given on this page aren't to be used in production, they just show how to use the functions. There are many practical uses for these functions such as asking for input while running commands, using items and entities, and much more. Sending Derma popup messages is a more prompt method of alerting a player if the information is a "must-see". Overall, the DermaRequest library is used in Slidefuse schemas and it's saved a lot of otherwise unneeded work.