2010-07-01 22:31:47 +02:00
|
|
|
function toggleDeveloperOverlay()
|
|
|
|
{
|
2010-11-27 20:46:12 +01:00
|
|
|
var devCommands = getGUIObjectByName("devCommands");
|
2010-10-16 21:49:48 +02:00
|
|
|
var text = devCommands.hidden? "opened." : "closed.";
|
2010-11-08 15:49:40 +01:00
|
|
|
submitChatDirectly("The Developer Overlay was " + text);
|
2010-08-13 18:05:06 +02:00
|
|
|
devCommands.hidden = !devCommands.hidden;
|
|
|
|
}
|
|
|
|
|
2010-11-27 20:46:12 +01:00
|
|
|
function openMenuDialog()
|
2010-08-13 18:05:06 +02:00
|
|
|
{
|
2010-11-27 20:46:12 +01:00
|
|
|
var menu = getGUIObjectByName("menuDialogPanel");
|
2010-11-28 02:39:31 +01:00
|
|
|
g_SessionDialog.open("Menu", null, menu, 156, 224, null);
|
2010-07-01 22:31:47 +02:00
|
|
|
}
|
|
|
|
|
2010-11-27 20:46:12 +01:00
|
|
|
function openSettingsDialog()
|
2010-07-01 22:31:47 +02:00
|
|
|
{
|
2010-11-27 20:46:12 +01:00
|
|
|
var settings = getGUIObjectByName("settingsDialogPanel");
|
|
|
|
g_SessionDialog.open("Settings", null, settings, 340, 224, null);
|
|
|
|
}
|
|
|
|
|
|
|
|
function openChat()
|
|
|
|
{
|
|
|
|
getGUIObjectByName("chatInput").focus(); // Grant focus to the input area
|
|
|
|
getGUIObjectByName("chatDialogPanel").hidden = false;
|
|
|
|
g_SessionDialog.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
function closeChat()
|
|
|
|
{
|
|
|
|
getGUIObjectByName("chatInput").caption = ""; // Clear chat input
|
|
|
|
getGUIObjectByName("chatDialogPanel").hidden = true;
|
|
|
|
g_SessionDialog.close();
|
2010-08-13 18:05:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function toggleChatWindow()
|
|
|
|
{
|
2010-11-27 20:46:12 +01:00
|
|
|
var chatWindow = getGUIObjectByName("chatDialogPanel");
|
|
|
|
var chatInput = getGUIObjectByName("chatInput");
|
|
|
|
|
2010-08-13 18:05:06 +02:00
|
|
|
if (chatWindow.hidden)
|
|
|
|
chatInput.focus(); // Grant focus to the input area
|
2010-07-01 22:31:47 +02:00
|
|
|
else
|
2010-08-13 18:05:06 +02:00
|
|
|
chatInput.caption = ""; // Clear chat input
|
2010-07-01 22:31:47 +02:00
|
|
|
|
2010-08-13 18:05:06 +02:00
|
|
|
chatWindow.hidden = !chatWindow.hidden;
|
2010-11-27 20:46:12 +01:00
|
|
|
g_SessionDialog.close();
|
2010-07-01 22:31:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function togglePause()
|
|
|
|
{
|
2010-11-27 20:46:12 +01:00
|
|
|
var pauseOverlay = getGUIObjectByName("pauseOverlay");
|
|
|
|
|
2010-08-13 18:05:06 +02:00
|
|
|
if (pauseOverlay.hidden)
|
2010-11-27 20:46:12 +01:00
|
|
|
{
|
2010-07-01 22:31:47 +02:00
|
|
|
setPaused(true);
|
2010-11-27 20:46:12 +01:00
|
|
|
getGUIObjectByName("pauseButtonText").caption = "Unpause";
|
|
|
|
}
|
2010-07-01 22:31:47 +02:00
|
|
|
else
|
2010-11-27 20:46:12 +01:00
|
|
|
{
|
2010-07-01 22:31:47 +02:00
|
|
|
setPaused(false);
|
2010-11-27 20:46:12 +01:00
|
|
|
getGUIObjectByName("pauseButtonText").caption = "Pause";
|
|
|
|
}
|
2010-07-01 22:31:47 +02:00
|
|
|
|
2010-08-13 18:05:06 +02:00
|
|
|
pauseOverlay.hidden = !pauseOverlay.hidden;
|
2010-11-27 20:46:12 +01:00
|
|
|
g_SessionDialog.close();
|
2010-07-01 22:31:47 +02:00
|
|
|
}
|
2010-10-04 00:42:15 +02:00
|
|
|
|
2010-11-27 18:06:32 +01:00
|
|
|
function openExitGameDialog()
|
|
|
|
{
|
2010-11-27 22:58:19 +01:00
|
|
|
g_SessionDialog.open("Exit Game", "Do you really want to quit?", null, 320, 140, leaveGame);
|
2010-11-27 18:06:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function escapeKeyAction()
|
2010-10-04 00:42:15 +02:00
|
|
|
{
|
2010-11-27 20:46:12 +01:00
|
|
|
var sessionDialog = getGUIObjectByName("sessionDialog");
|
|
|
|
|
|
|
|
if (!sessionDialog.hidden)
|
|
|
|
g_SessionDialog.close();
|
|
|
|
else
|
|
|
|
getGUIObjectByName("chatDialogPanel").hidden = true;
|
2010-10-04 00:42:15 +02:00
|
|
|
}
|