Files
itgmania212121/Docs/Themerdocs/ScreenTextEntry.txt
T
2011-03-17 01:47:30 -04:00

17 lines
510 B
Plaintext

-- how to connect to a server with the new ScreenTextEntry Lua bindings
-- (this is the base code; I'll come up with a full tutorial later.)
SCREENMAN:AddNewScreenToTop("ScreenTextEntry");
local serverSettings = {
Question = "Connect to server:",
MaxInputLength = 255,
OnOK = function(answer)
if IsNetConnected() then
-- close connection before connecting to new server
CloseConnection()
end
-- connect to server
ConnectToServer(answer)
end,
};
SCREENMAN:GetTopScreen():Load(serverSettings);