Initial implementation of the new Base Game Template and some starting modules.

This makes some tweaks to the engine to support this, specifically, it tweaks the hardcoded shaderpaths to defer to a pref variable, so none of the shader paths are hardcoded.

Also tweaks how post effects read in texture files, removing a bizzare filepath interpretation choice, where if the file path didn't start with "/" it forcefully appended the script's file path. This made it impossible to have images not in the same dir as the script file defining the post effect.

This was changed and the existing template's post effects tweaked for now to just add "./" to those few paths impacted, as well as the perf vars to support the non-hardcoded shader paths in the engine.
This commit is contained in:
Areloch 2017-02-24 02:40:56 -06:00
parent 5c8a82180b
commit 1ed8b05169
1572 changed files with 146699 additions and 85 deletions

View file

@ -0,0 +1,63 @@
// The general flow of a gane - server's creation, loading and hosting clients, and then destruction is as follows:
// First, a client will always create a server in the event that they want to host a single player
// game. Torque3D treats even single player connections as a soft multiplayer game, with some stuff
// in the networking short-circuited to sidestep around lag and packet transmission times.
// initServer() is called, loading the default server scripts.
// After that, if this is a dedicated server session, initDedicated() is called, otherwise initClient is called
// to prep a playable client session.
// When a local game is started - a listen server - via calling StartGame() a server is created and then the client is
// connected to it via createAndConnectToLocalServer().
function UI::create( %this )
{
if ($Server::Dedicated)
return;
// Use our prefs to configure our Canvas/Window
configureCanvas();
//Load UI stuff
//we need to load this because some of the menu profiles use the sounds here
exec("./scripts/datablocks/guiSounds.cs");
//Profiles
exec("./scripts/profiles.cs");
//Now gui files
exec("./scripts/guis/mainMenu.gui");
exec("./scripts/guis/chooseLevelDlg.gui");
exec("./scripts/guis/joinServerMenu.gui");
exec("./scripts/guis/loadingGui.gui");
exec("./scripts/guis/optionsMenu.gui");
exec("./scripts/guis/pauseMenu.gui");
exec("./scripts/guis/remapDlg.gui");
exec("./scripts/guis/remapConfirmDlg.gui");
exec("./scripts/guis/profiler.gui");
exec("./scripts/guis/netGraphGui.gui");
//Load gui companion scripts
exec("./scripts/chooseLevelDlg.cs");
exec("./scripts/optionsList.cs");
exec("./scripts/optionsMenu.cs");
exec("./scripts/graphicsMenu.cs");
exec("./scripts/controlsMenu.cs");
exec("./scripts/chooseLevelDlg.cs");
exec("./scripts/mainMenu.cs");
exec("./scripts/joinServerMenu.cs");
exec("./scripts/pauseMenu.cs");
exec("./scripts/messageBoxes.cs");
%dbList = new ArrayObject(LevelFilesList);
Canvas.pushDialog(MainMenuGui);
}
function Game::destroy( %this )
{
}

View file

@ -0,0 +1,9 @@
<ModuleDefinition
ModuleId="UI"
VersionId="1"
Description="Module that implements the menus for the game."
ScriptFile="UI.cs"
CreateFunction="create"
DestroyFunction="destroy"
Group="Game">
</ModuleDefinition>

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 993 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1,301 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//----------------------------------------
function ChooseLevelDlg::onWake( %this )
{
CL_levelList.clear();
ChooseLevelWindow->SmallPreviews.clear();
%count = LevelFilesList.count();
for ( %i=0; %i < %count; %i++ )
{
%file = LevelFilesList.getKey( %i );
if ( !isFile(%file @ ".mis") && !isFile(%file) )
continue;
// Skip our new level/mission if we arent choosing a level
// to launch in the editor.
if ( !%this.launchInEditor )
{
%fileName = fileName(%file);
if (strstr(%fileName, "newMission.mis") > -1 || strstr(%fileName, "newLevel.mis") > -1)
continue;
}
%this.addMissionFile( %file );
}
// Also add the new level mission as defined in the world editor settings
// if we are choosing a level to launch in the editor.
if ( %this.launchInEditor )
{
%file = EditorSettings.value( "WorldEditor/newLevelFile" );
if ( %file !$= "" )
%this.addMissionFile( %file );
}
// Sort our list
CL_levelList.sort(0);
// Set the first row as the selected row
CL_levelList.setSelectedRow(0);
for (%i = 0; %i < CL_levelList.rowCount(); %i++)
{
%preview = new GuiButtonCtrl() {
profile = "GuiMenuButtonProfile";
internalName = "SmallPreview" @ %i;
Extent = "368 35";
text = getField(CL_levelList.getRowText(%i), 0);
command = "ChooseLevelWindow.previewSelected(ChooseLevelWindow->SmallPreviews->SmallPreview" @ %i @ ");";
buttonType = "RadioButton";
};
ChooseLevelWindow->SmallPreviews.add(%preview);
%rowText = CL_levelList.getRowText(%i);
// Set the level index
%preview.levelIndex = %i;
// Get the name
%name = getField(CL_levelList.getRowText(%i), 0);
%preview.levelName = %name;
%file = getField(CL_levelList.getRowText(%i), 1);
// Find the preview image
%levelPreview = getField(CL_levelList.getRowText(%i), 3);
// Test against all of the different image formats
// This should probably be moved into an engine function
if (isFile(%levelPreview @ ".png") ||
isFile(%levelPreview @ ".jpg") ||
isFile(%levelPreview @ ".bmp") ||
isFile(%levelPreview @ ".gif") ||
isFile(%levelPreview @ ".jng") ||
isFile(%levelPreview @ ".mng") ||
isFile(%levelPreview @ ".tga"))
{
%preview.bitmap = %levelPreview;
}
// Get the description
%desc = getField(CL_levelList.getRowText(%i), 2);
%preview.levelDesc = %desc;
}
ChooseLevelWindow->SmallPreviews.firstVisible = -1;
ChooseLevelWindow->SmallPreviews.lastVisible = -1;
if (ChooseLevelWindow->SmallPreviews.getCount() > 0)
{
ChooseLevelWindow->SmallPreviews.firstVisible = 0;
if (ChooseLevelWindow->SmallPreviews.getCount() < 6)
ChooseLevelWindow->SmallPreviews.lastVisible = ChooseLevelWindow->SmallPreviews.getCount() - 1;
else
ChooseLevelWindow->SmallPreviews.lastVisible = 4;
}
if (ChooseLevelWindow->SmallPreviews.getCount() > 0)
ChooseLevelWindow.previewSelected(ChooseLevelWindow->SmallPreviews.getObject(0));
// If we have 5 or less previews then hide our next/previous buttons
// and resize to fill their positions
if (ChooseLevelWindow->SmallPreviews.getCount() < 6)
{
ChooseLevelWindow->PreviousSmallPreviews.setVisible(false);
ChooseLevelWindow->NextSmallPreviews.setVisible(false);
%previewPos = ChooseLevelWindow->SmallPreviews.getPosition();
%previousPos = ChooseLevelWindow->PreviousSmallPreviews.getPosition();
%previewPosX = getWord(%previousPos, 0);
%previewPosY = getWord(%previewPos, 1);
ChooseLevelWindow->SmallPreviews.setPosition(%previewPosX, %previewPosY);
ChooseLevelWindow->SmallPreviews.colSpacing = 10;//((getWord(NextSmallPreviews.getPosition(), 0)+11)-getWord(PreviousSmallPreviews.getPosition(), 0))/4;
ChooseLevelWindow->SmallPreviews.refresh();
}
/*if (ChooseLevelWindow->SmallPreviews.getCount() <= 1)
{
// Hide the small previews
ChooseLevelWindow->SmallPreviews.setVisible(false);
// Shrink the ChooseLevelWindow so that we don't have a large blank space
%extentX = getWord(ChooseLevelWindow.getExtent(), 0);
%extentY = getWord(ChooseLevelWindow->SmallPreviews.getPosition(), 1);
ChooseLevelWIndow.setExtent(%extentX, %extentY);
}
else
{
// Make sure the small previews are visible
ChooseLevelWindow->SmallPreviews.setVisible(true);
%extentX = getWord(ChooseLevelWindow.getExtent(), 0);
%extentY = getWord(ChooseLevelWindow->SmallPreviews.getPosition(), 1);
%extentY = %extentY + getWord(ChooseLevelWindow->SmallPreviews.getExtent(), 1);
%extentY = %extentY + 9;
//ChooseLevelWIndow.setExtent(%extentX, %extentY);
//}*/
}
function ChooseLevelDlg::addMissionFile( %this, %file )
{
%levelName = fileBase(%file);
%levelDesc = "A Torque level";
%LevelInfoObject = getLevelInfo(%file);
if (%LevelInfoObject != 0)
{
if(%LevelInfoObject.levelName !$= "")
%levelName = %LevelInfoObject.levelName;
else if(%LevelInfoObject.name !$= "")
%levelName = %LevelInfoObject.name;
if (%LevelInfoObject.desc0 !$= "")
%levelDesc = %LevelInfoObject.desc0;
if (%LevelInfoObject.preview !$= "")
%levelPreview = %LevelInfoObject.preview;
%LevelInfoObject.delete();
}
CL_levelList.addRow( CL_levelList.rowCount(), %levelName TAB %file TAB %levelDesc TAB %levelPreview );
}
function ChooseLevelDlg::onSleep( %this )
{
// This is set from the outside, only stays true for a single wake/sleep
// cycle.
%this.launchInEditor = false;
}
function ChooseLevelWindow::previewSelected(%this, %preview)
{
// Set the selected level
if (isObject(%preview) && %preview.levelIndex !$= "")
CL_levelList.setSelectedRow(%preview.levelIndex);
else
CL_levelList.setSelectedRow(-1);
// Set the large preview image
if (isObject(%preview) && %preview.bitmap !$= "")
%this->CurrentPreview.setBitmap(%preview.bitmap);
else
%this->CurrentPreview.setBitmap("data/ui/art/no-preview");
// Set the current level name
if (isObject(%preview) && %preview.levelName !$= "")
%this->LevelName.setText(%preview.levelName);
else
%this->LevelName.setText("Level");
// Set the current level description
if (isObject(%preview) && %preview.levelDesc !$= "")
%this->LevelDescription.setText(%preview.levelDesc);
else
%this->LevelDescription.setText("A Torque Level");
}
function ChooseLevelWindow::previousPreviews(%this)
{
%prevHiddenIdx = %this->SmallPreviews.firstVisible - 1;
if (%prevHiddenIdx < 0)
return;
%lastVisibleIdx = %this->SmallPreviews.lastVisible;
if (%lastVisibleIdx >= %this->SmallPreviews.getCount())
return;
%prevHiddenObj = %this->SmallPreviews.getObject(%prevHiddenIdx);
%lastVisibleObj = %this->SmallPreviews.getObject(%lastVisibleIdx);
if (isObject(%prevHiddenObj) && isObject(%lastVisibleObj))
{
%this->SmallPreviews.firstVisible--;
%this->SmallPreviews.lastVisible--;
%prevHiddenObj.setVisible(true);
%lastVisibleObj.setVisible(false);
}
}
function ChooseLevelWindow::nextPreviews(%this)
{
%firstVisibleIdx = %this->SmallPreviews.firstVisible;
if (%firstVisibleIdx < 0)
return;
%firstHiddenIdx = %this->SmallPreviews.lastVisible + 1;
if (%firstHiddenIdx >= %this->SmallPreviews.getCount())
return;
%firstVisibleObj = %this->SmallPreviews.getObject(%firstVisibleIdx);
%firstHiddenObj = %this->SmallPreviews.getObject(%firstHiddenIdx);
if (isObject(%firstVisibleObj) && isObject(%firstHiddenObj))
{
%this->SmallPreviews.firstVisible++;
%this->SmallPreviews.lastVisible++;
%firstVisibleObj.setVisible(false);
%firstHiddenObj.setVisible(true);
}
}
// Do this onMouseUp not via Command which occurs onMouseDown so we do
// not have a lingering mouseUp event lingering in the ether.
function ChooseLevelDlgGoBtn::onMouseUp( %this )
{
// So we can't fire the button when loading is in progress.
if ( isObject( ServerGroup ) )
return;
// Launch the chosen level with the editor open?
if ( ChooseLevelDlg.launchInEditor )
{
activatePackage( "BootEditor" );
ChooseLevelDlg.launchInEditor = false;
StartGame("", "SinglePlayer");
}
else
{
StartGame();
}
}

View file

@ -0,0 +1,417 @@
// =============================================================================
// KEYBINDS MENU
// =============================================================================
$RemapCount = 0;
$RemapName[$RemapCount] = "Forward";
$RemapCmd[$RemapCount] = "moveforward";
$RemapGroup[$RemapCount] = "Movement";
$RemapCount++;
$RemapName[$RemapCount] = "Backward";
$RemapCmd[$RemapCount] = "movebackward";
$RemapGroup[$RemapCount] = "Movement";
$RemapCount++;
$RemapName[$RemapCount] = "Strafe Left";
$RemapCmd[$RemapCount] = "moveleft";
$RemapGroup[$RemapCount] = "Movement";
$RemapCount++;
$RemapName[$RemapCount] = "Strafe Right";
$RemapCmd[$RemapCount] = "moveright";
$RemapGroup[$RemapCount] = "Movement";
$RemapCount++;
$RemapName[$RemapCount] = "Jump";
$RemapCmd[$RemapCount] = "jump";
$RemapGroup[$RemapCount] = "Movement";
$RemapCount++;
$RemapName[$RemapCount] = "Fire Weapon";
$RemapCmd[$RemapCount] = "mouseFire";
$RemapGroup[$RemapCount] = "Combat";
$RemapCount++;
$RemapName[$RemapCount] = "Adjust Zoom";
$RemapCmd[$RemapCount] = "setZoomFov";
$RemapGroup[$RemapCount] = "Combat";
$RemapCount++;
$RemapName[$RemapCount] = "Toggle Zoom";
$RemapCmd[$RemapCount] = "toggleZoom";
$RemapGroup[$RemapCount] = "Combat";
$RemapCount++;
$RemapName[$RemapCount] = "Free Look";
$RemapCmd[$RemapCount] = "toggleFreeLook";
$RemapGroup[$RemapCount] = "Miscellaneous";
$RemapCount++;
$RemapName[$RemapCount] = "Switch 1st/3rd";
$RemapCmd[$RemapCount] = "toggleFirstPerson";
$RemapGroup[$RemapCount] = "Miscellaneous";
$RemapCount++;
$RemapName[$RemapCount] = "Toggle Camera";
$RemapCmd[$RemapCount] = "toggleCamera";
$RemapGroup[$RemapCount] = "Miscellaneous";
$RemapCount++;
function ControlsMenu::onWake(%this)
{
ControlSetList.clear();
ControlSetList.add( "Movement", "Movement" );
ControlSetList.add( "Combat", "Combat" );
ControlSetList.add( "Miscellaneous", "Miscellaneous" );
ControlSetList.setSelected( "Movement", false );
ControlsMenuOptionsArray.clear();
ControlsMenu.loadGroupKeybinds("Movement");
ControlsMenuOptionsArray.refresh();
}
function ControlSetList::onSelect( %this, %id, %text )
{
ControlsMenuOptionsArray.clear();
if(%text $= "Movement")
ControlsMenu.loadGroupKeybinds("Movement");
else if(%text $= "Combat")
ControlsMenu.loadGroupKeybinds("Combat");
else if(%text $= "Miscellaneous")
ControlsMenu.loadGroupKeybinds("Miscellaneous");
ControlsMenuOptionsArray.refresh();
}
function ControlsMenuOKButton::onClick(%this)
{
// write out the control config into the keybinds.cs file
%prefPath = getPrefpath();
moveMap.save( %prefPath @ "/keybinds.cs" );
OptionsMenu.backOut();
}
function ControlsMenuDefaultsButton::onClick(%this)
{
//For this to work with module-style, we have to figure that somewhere, we'll set where our default keybind script is at.
//This can be hardcoded in your actual project.
exec($KeybindPath);
ControlsMenu.reload();
}
function ControlsMenu::loadGroupKeybinds(%this, %keybindGroup)
{
%optionIndex = 0;
for(%i=0; %i < $RemapCount; %i++)
{
//find and add all the keybinds for the particular group we're looking at
if($RemapGroup[%i] $= %keybindGroup)
{
%temp = %this.getKeybindString(%i);
%option = %this.addKeybindOption();
%option-->nameText.setText($RemapName[%i]);
%option-->rebindButton.setText(%temp);
%option-->rebindButton.keybindIndex = %i;
%option-->rebindButton.optionIndex = %optionIndex;
%optionIndex++;
}
}
}
function ControlsMenu::addKeybindOption(%this)
{
%tamlReader = new Taml();
%graphicsOption = %tamlReader.read("data/ui/scripts/guis/controlsMenuSetting.taml");
ControlsMenuOptionsArray.add(%graphicsOption);
return %graphicsOption;
}
function ControlsMenu::getKeybindString(%this, %index )
{
%name = $RemapName[%index];
%cmd = $RemapCmd[%index];
%temp = moveMap.getBinding( %cmd );
if ( %temp $= "" )
return %name TAB "";
%mapString = "";
%count = getFieldCount( %temp );
for ( %i = 0; %i < %count; %i += 2 )
{
%device = getField( %temp, %i + 0 );
%object = getField( %temp, %i + 1 );
%displayName = %this.getMapDisplayName( %device, %object );
if(%displayName !$= "")
{
%tmpMapString = %this.getMapDisplayName( %device, %object );
if(%mapString $= "")
{
%mapString = %tmpMapString;
}
else
{
if ( %tmpMapString !$= "")
{
%mapString = %mapString @ ", " @ %tmpMapString;
}
}
}
}
return %mapString;
}
function ControlsMenu::redoMapping( %device, %action, %cmd, %oldIndex, %newIndex )
{
//%actionMap.bind( %device, %action, $RemapCmd[%newIndex] );
moveMap.bind( %device, %action, %cmd );
%remapList = %this-->OptRemapList;
%remapList.setRowById( %oldIndex, buildFullMapString( %oldIndex ) );
%remapList.setRowById( %newIndex, buildFullMapString( %newIndex ) );
}
function ControlsMenu::getMapDisplayName( %this, %device, %action )
{
if ( %device $= "keyboard" )
return( %action );
else if ( strstr( %device, "mouse" ) != -1 )
{
// Substitute "mouse" for "button" in the action string:
%pos = strstr( %action, "button" );
if ( %pos != -1 )
{
%mods = getSubStr( %action, 0, %pos );
%object = getSubStr( %action, %pos, 1000 );
%instance = getSubStr( %object, strlen( "button" ), 1000 );
return( %mods @ "mouse" @ ( %instance + 1 ) );
}
else
error( "Mouse input object other than button passed to getDisplayMapName!" );
}
else if ( strstr( %device, "joystick" ) != -1 )
{
// Substitute "joystick" for "button" in the action string:
%pos = strstr( %action, "button" );
if ( %pos != -1 )
{
%mods = getSubStr( %action, 0, %pos );
%object = getSubStr( %action, %pos, 1000 );
%instance = getSubStr( %object, strlen( "button" ), 1000 );
return( %mods @ "joystick" @ ( %instance + 1 ) );
}
else
{
%pos = strstr( %action, "pov" );
if ( %pos != -1 )
{
%wordCount = getWordCount( %action );
%mods = %wordCount > 1 ? getWords( %action, 0, %wordCount - 2 ) @ " " : "";
%object = getWord( %action, %wordCount - 1 );
switch$ ( %object )
{
case "upov": %object = "POV1 up";
case "dpov": %object = "POV1 down";
case "lpov": %object = "POV1 left";
case "rpov": %object = "POV1 right";
case "upov2": %object = "POV2 up";
case "dpov2": %object = "POV2 down";
case "lpov2": %object = "POV2 left";
case "rpov2": %object = "POV2 right";
default: %object = "";
}
return( %mods @ %object );
}
else
error( "Unsupported Joystick input object passed to getDisplayMapName!" );
}
}
return( "" );
}
function ControlsMenu::buildFullMapString( %this, %index )
{
%name = $RemapName[%index];
%cmd = $RemapCmd[%index];
%temp = moveMap.getBinding( %cmd );
if ( %temp $= "" )
return %name TAB "";
%mapString = "";
%count = getFieldCount( %temp );
for ( %i = 0; %i < %count; %i += 2 )
{
if ( %mapString !$= "" )
%mapString = %mapString @ ", ";
%device = getField( %temp, %i + 0 );
%object = getField( %temp, %i + 1 );
%mapString = %mapString @ %this.getMapDisplayName( %device, %object );
}
return %name TAB %mapString;
}
function ControlsMenu::fillRemapList( %this )
{
%remapList = %this-->OptRemapList;
%remapList.clear();
for ( %i = 0; %i < $RemapCount; %i++ )
%remapList.addRow( %i, %this.buildFullMapString( %i ) );
}
function ControlsMenu::doRemap( %this )
{
%remapList = %this-->OptRemapList;
%selId = %remapList.getSelectedId();
%name = $RemapName[%selId];
RemapDlg-->OptRemapText.setValue( "Re-bind \"" @ %name @ "\" to..." );
OptRemapInputCtrl.index = %selId;
Canvas.pushDialog( RemapDlg );
}
function ControlsMenuRebindButton::onClick(%this)
{
%name = $RemapName[%this.keybindIndex];
RemapDlg-->OptRemapText.setValue( "Re-bind \"" @ %name @ "\" to..." );
OptRemapInputCtrl.index = %this.keybindIndex;
OptRemapInputCtrl.optionIndex = %this.optionIndex;
Canvas.pushDialog( RemapDlg );
}
function OptRemapInputCtrl::onInputEvent( %this, %device, %action )
{
//error( "** onInputEvent called - device = " @ %device @ ", action = " @ %action @ " **" );
Canvas.popDialog( RemapDlg );
// Test for the reserved keystrokes:
if ( %device $= "keyboard" )
{
// Cancel...
if ( %action $= "escape" )
{
// Do nothing...
return;
}
}
%cmd = $RemapCmd[%this.index];
%name = $RemapName[%this.index];
// Grab the friendly display name for this action
// which we'll use when prompting the user below.
%mapName = ControlsMenu.getMapDisplayName( %device, %action );
// Get the current command this action is mapped to.
%prevMap = moveMap.getCommand( %device, %action );
// If nothing was mapped to the previous command
// mapping then it's easy... just bind it.
if ( %prevMap $= "" )
{
ControlsMenu.unbindExtraActions( %cmd, 1 );
moveMap.bind( %device, %action, %cmd );
//ControlsMenu.reload();
%newCommands = getField(ControlsMenu.buildFullMapString( %this.index ), 1);
ControlsMenuOptionsArray.getObject(%this.optionIndex)-->rebindButton.setText(%newCommands);
return;
}
// If the previous command is the same as the
// current then they hit the same input as what
// was already assigned.
if ( %prevMap $= %cmd )
{
ControlsMenu.unbindExtraActions( %cmd, 0 );
moveMap.bind( %device, %action, %cmd );
//ControlsMenu.reload();
%newCommands = getField(ControlsMenu.buildFullMapString( %this.index ), 1);
ControlsMenuOptionsArray.getObject(%this.optionIndex)-->rebindButton.setText(%newCommands);
return;
}
// Look for the index of the previous mapping.
%prevMapIndex = ControlsMenu.findRemapCmdIndex( %prevMap );
// If we get a negative index then the previous
// mapping was to an item that isn't included in
// the mapping list... so we cannot unmap it.
if ( %prevMapIndex == -1 )
{
MessageBoxOK( "Remap Failed", "\"" @ %mapName @ "\" is already bound to a non-remappable command!" );
return;
}
// Setup the forced remapping callback command.
%callback = "redoMapping(" @ %device @ ", \"" @ %action @ "\", \"" @
%cmd @ "\", " @ %prevMapIndex @ ", " @ %this.index @ ");";
// Warn that we're about to remove the old mapping and
// replace it with another.
%prevCmdName = $RemapName[%prevMapIndex];
Canvas.pushDialog( RemapConfirmDlg );
RemapConfirmationText.setText("\"" @ %mapName @ "\" is already bound to \""
@ %prevCmdName @ "\"! Do you wish to replace this mapping?");
RemapConfirmationYesButton.command = "ControlsMenu.redoMapping(" @ %device @ ", \"" @ %action @ "\", \"" @
%cmd @ "\", " @ %prevMapIndex @ ", " @ %this.index @ "); Canvas.popDialog();";
RemapConfirmationNoButton.command = "Canvas.popDialog();";
/*MessageBoxYesNo( "Warning",
"\"" @ %mapName @ "\" is already bound to \""
@ %prevCmdName @ "\"!\nDo you wish to replace this mapping?",
%callback, "" );*/
}
function ControlsMenu::findRemapCmdIndex( %this, %command )
{
for ( %i = 0; %i < $RemapCount; %i++ )
{
if ( %command $= $RemapCmd[%i] )
return( %i );
}
return( -1 );
}
/// This unbinds actions beyond %count associated to the
/// particular moveMap %commmand.
function ControlsMenu::unbindExtraActions( %this, %command, %count )
{
%temp = moveMap.getBinding( %command );
if ( %temp $= "" )
return;
%count = getFieldCount( %temp ) - ( %count * 2 );
for ( %i = 0; %i < %count; %i += 2 )
{
%device = getField( %temp, %i + 0 );
%action = getField( %temp, %i + 1 );
moveMap.unbind( %device, %action );
}
}
function ControlsMenu::redoMapping( %this, %device, %action, %cmd, %oldIndex, %newIndex )
{
//%actionMap.bind( %device, %action, $RemapCmd[%newIndex] );
moveMap.bind( %device, %action, %cmd );
%remapList = %this-->OptRemapList;
%remapList.setRowById( %oldIndex, %this.buildFullMapString( %oldIndex ) );
%remapList.setRowById( %newIndex, %this.buildFullMapString( %newIndex ) );
%this.changeSettingsPage();
}

View file

@ -0,0 +1,34 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
singleton SFXProfile(menuButtonPressed)
{
preload = true;
description = AudioGui;
fileName = "data/ui/sound/buttonClick";
};
singleton SFXProfile(menuButtonHover)
{
preload = true;
description = AudioGui;
fileName = "data/ui/sound/buttonHover";
};

View file

@ -0,0 +1,567 @@
// =============================================================================
// GRAPHICS MENU
// =============================================================================
//Mesh and Textures
//
function GraphicsMenu::onWake(%this)
{
DisplaySettingsMenu.hidden = false;
GeneralGraphicsSettingsMenu.hidden = true;
%this.refresh();
}
function GraphicsMenu::refresh(%this)
{
//
// Display Menu
GraphicsMenuFullScreen.setStateOn( Canvas.isFullScreen() );
GraphicsMenuVSync.setStateOn( !$pref::Video::disableVerticalSync );
%this.initResMenu();
%resSelId = GraphicsMenuResolution.findText( _makePrettyResString( $pref::Video::mode ) );
if( %resSelId != -1 )
GraphicsMenuResolution.setSelected( %resSelId );
GraphicsMenuDriver.clear();
%buffer = getDisplayDeviceList();
%count = getFieldCount( %buffer );
for(%i = 0; %i < %count; %i++)
GraphicsMenuDriver.add(getField(%buffer, %i), %i);
%selId = GraphicsMenuDriver.findText( getDisplayDeviceInformation() );
if ( %selId == -1 )
GraphicsMenuDriver.setFirstSelected();
else
GraphicsMenuDriver.setSelected( %selId );
//
//
// General Graphics menu
GraphicsMenuShadowQlty.init(ShadowQualityList);
GraphicsMenuSoftShadow.init(SoftShadowList);
GraphicsMenuModelDtl.init(MeshQualityGroup);
GraphicsMenuTextureDtl.init(TextureQualityGroup);
GraphicsMenuTerrainDtl.init(TerrainQualityGroup);
GraphicsMenuDecalLife.init(DecalLifetimeGroup);
GraphicsMenuGroundClutter.init(GroundCoverDensityGroup);
GraphicsMenuMaterialQlty.init(ShaderQualityGroup);
// Setup the anisotropic filtering menu.
%ansioCtrl = GraphicsMenuAniso;
%ansioCtrl.clear();
%ansioCtrl.add( "16X", 16 );
%ansioCtrl.add( "8X", 8 );
%ansioCtrl.add( "4X", 4 );
%ansioCtrl.add( "Off", 0 );
%ansioCtrl.setSelected( $pref::Video::defaultAnisotropy, false );
// set up the Refresh Rate menu.
%refreshMenu = GraphicsMenuRefreshRate;
%refreshMenu.clear();
// %refreshMenu.add("Auto", 60);
%refreshMenu.add("60", 60);
%refreshMenu.add("75", 75);
%refreshMenu.setSelected( $pref::Video::RefreshRate );
// Populate the Anti-aliasing popup.
%aaMenu = GraphicsMenuAA;
%aaMenu.clear();
%aaMenu.Add( "4x", 4 );
%aaMenu.Add( "2x", 2 );
%aaMenu.Add( "1x", 1 );
%aaMenu.Add( "Off", 0 );
%aaMenu.setSelected( $pref::Video::AA );
//Parallax
GraphicsMenuParallax.setStateOn(!$pref::Video::disableParallaxMapping);
//water reflections
GraphicsMenuWaterRefl.setStateOn(!$pref::Water::disableTrueReflections);
GraphicsMenuParallax.setStateOn(!$pref::Video::disableParallaxMapping);
GraphicsMenuAO.setStateOn($pref::PostFX::EnableSSAO);
GraphicsMenuHDR.setStateOn($pref::PostFX::EnableHDR);
GraphicsMenuDOF.setStateOn($pref::PostFX::EnableDOF);
GraphicsMenuVignette.setStateOn($pref::PostFX::EnableVignette);
GraphicsMenuLightRay.setStateOn($pref::PostFX::EnableLightRays);
}
function GraphicsMenuOKButton::onClick(%this)
{
//save the settings and then back out
GraphicsMenu.apply();
OptionsMenu.backOut();
}
function GraphicsMenu::initResMenu( %this )
{
// Clear out previous values
%resMenu = GraphicsMenuResolution;
%resMenu.clear();
// If we are in a browser then we can't change our resolution through
// the options dialog
if (getWebDeployment())
{
%count = 0;
%currRes = getWords(Canvas.getVideoMode(), $WORD::RES_X, $WORD::RES_Y);
%resMenu.add(%currRes, %count);
%count++;
return;
}
// Loop through all and add all valid resolutions
%count = 0;
%resCount = Canvas.getModeCount();
for (%i = 0; %i < %resCount; %i++)
{
%testResString = Canvas.getMode( %i );
%testRes = _makePrettyResString( %testResString );
// Only add to list if it isn't there already.
if (%resMenu.findText(%testRes) == -1)
{
%resMenu.add(%testRes, %i);
%count++;
}
}
%resMenu.sort();
}
function GraphicsQualityPopup::init( %this, %qualityGroup )
{
assert( isObject( %this ) );
assert( isObject( %qualityGroup ) );
%this.qualityGroup = %qualityGroup;
// Clear the existing content first.
%this.clear();
// Fill it.
%select = -1;
for ( %i=0; %i < %qualityGroup.getCount(); %i++ )
{
%level = %qualityGroup.getObject( %i );
if ( %level.isCurrent() )
%select = %i;
%this.add( %level.displayName, %i );
}
// Setup a default selection.
if ( %select == -1 )
%this.setText( "Custom" );
else
%this.setSelected( %select );
}
function GraphicsQualityPopup::apply( %this )
{
%levelName = %this.getText();
%this.qualityGroup.applySetting(%levelName);
}
//
function GraphicsMenu::Autodetect(%this)
{
$pref::Video::autoDetect = false;
%shaderVer = getPixelShaderVersion();
%intel = ( strstr( strupr( getDisplayDeviceInformation() ), "INTEL" ) != -1 ) ? true : false;
%videoMem = GFXCardProfilerAPI::getVideoMemoryMB();
return %this.Autodetect_Apply( %shaderVer, %intel, %videoMem );
}
function GraphicsMenu::Autodetect_Apply(%this, %shaderVer, %intel, %videoMem )
{
if ( %shaderVer < 2.0 )
{
return "Your video card does not meet the minimum requirment of shader model 2.0.";
}
if ( %shaderVer < 3.0 || %intel )
{
// Allow specular and normals for 2.0a and 2.0b
if ( %shaderVer > 2.0 )
{
MeshQualityGroup.applySetting("Lowest");
TextureQualityGroup.applySetting("Lowest");
GroundCoverDensityGroup.applySetting("Lowest");
DecalLifetimeGroup.applySetting("None");
TerrainQualityGroup.applySetting("Lowest");
ShaderQualityGroup.applySetting("High");
ShadowQualityList.applySetting("None");
SoftShadowList.applySetting("Off");
$pref::Shadows::useShadowCaching = true;
$pref::Water::disableTrueReflections = true;
$pref::Video::disableParallaxMapping = true;
$pref::PostFX::EnableSSAO = false;
$pref::PostFX::EnableHDR = false;
$pref::PostFX::EnableDOF = false;
$pref::PostFX::EnableLightRays = false;
$pref::PostFX::EnableVignette = false;
$pref::Video::AA = 0;
$pref::Video::disableVerticalSync = 0;
}
else
{
MeshQualityGroup.applySetting("Lowest");
TextureQualityGroup.applySetting("Lowest");
GroundCoverDensityGroup.applySetting("Lowest");
DecalLifetimeGroup.applySetting("None");
TerrainQualityGroup.applySetting("Lowest");
ShaderQualityGroup.applySetting("Low");
ShadowQualityList.applySetting("None");
SoftShadowList.applySetting("Off");
$pref::Shadows::useShadowCaching = true;
$pref::Water::disableTrueReflections = true;
$pref::Video::disableParallaxMapping = true;
$pref::PostFX::EnableSSAO = false;
$pref::PostFX::EnableHDR = false;
$pref::PostFX::EnableDOF = false;
$pref::PostFX::EnableLightRays = false;
$pref::PostFX::EnableVignette = false;
$pref::Video::AA = 0;
$pref::Video::disableVerticalSync = 0;
}
}
else
{
if ( %videoMem > 1000 )
{
MeshQualityGroup.applySetting("High");
TextureQualityGroup.applySetting("High");
GroundCoverDensityGroup.applySetting("High");
DecalLifetimeGroup.applySetting("High");
TerrainQualityGroup.applySetting("High");
ShaderQualityGroup.applySetting("High");
ShadowQualityList.applySetting("High");
SoftShadowList.applySetting("High");
//Should this default to on in ultra settings?
$pref::Shadows::useShadowCaching = true;
$pref::Water::disableTrueReflections = false;
$pref::Video::disableParallaxMapping = false;
$pref::PostFX::EnableSSAO = true;
$pref::PostFX::EnableHDR = true;
$pref::PostFX::EnableDOF = true;
$pref::PostFX::EnableLightRays = true;
$pref::PostFX::EnableVignette = true;
$pref::Video::AA = 4;
$pref::Video::disableVerticalSync = 16;
}
else if ( %videoMem > 400 || %videoMem == 0 )
{
MeshQualityGroup.applySetting("Medium");
TextureQualityGroup.applySetting("Medium");
GroundCoverDensityGroup.applySetting("Medium");
DecalLifetimeGroup.applySetting("Medium");
TerrainQualityGroup.applySetting("Medium");
ShaderQualityGroup.applySetting("High");
ShadowQualityList.applySetting("Medium");
SoftShadowList.applySetting("Low");
$pref::Shadows::useShadowCaching = true;
$pref::Water::disableTrueReflections = false;
$pref::Video::disableParallaxMapping = true;
$pref::PostFX::EnableSSAO = false;
$pref::PostFX::EnableHDR = true;
$pref::PostFX::EnableDOF = true;
$pref::PostFX::EnableLightRays = true;
$pref::PostFX::EnableVignette = true;
$pref::Video::AA = 4;
$pref::Video::disableVerticalSync = 4;
if ( %videoMem == 0 )
return "Torque was unable to detect available video memory. Applying 'Medium' quality.";
}
else
{
MeshQualityGroup.applySetting("Low");
TextureQualityGroup.applySetting("Low");
GroundCoverDensityGroup.applySetting("Low");
DecalLifetimeGroup.applySetting("Low");
TerrainQualityGroup.applySetting("Low");
ShaderQualityGroup.applySetting("Low");
ShadowQualityList.applySetting("None");
SoftShadowList.applySetting("Off");
$pref::Shadows::useShadowCaching = true;
$pref::Water::disableTrueReflections = false;
$pref::Video::disableParallaxMapping = true;
$pref::PostFX::EnableSSAO = false;
$pref::PostFX::EnableHDR = false;
$pref::PostFX::EnableDOF = false;
$pref::PostFX::EnableLightRays = false;
$pref::PostFX::EnableVignette = false;
$pref::Video::AA = 0;
$pref::Video::disableVerticalSync = 0;
}
}
%this.refresh();
%this.apply();
//force postFX updates
PostFXManager.settingsEffectSetEnabled("SSAO", $pref::PostFX::EnableSSAO);
PostFXManager.settingsEffectSetEnabled("HDR", $pref::PostFX::EnableHDR);
PostFXManager.settingsEffectSetEnabled("DOF", $pref::PostFX::EnableDOF);
PostFXManager.settingsEffectSetEnabled("LightRays", $pref::PostFX::EnableLightRays);
PostFXManager.settingsEffectSetEnabled("Vignette", $pref::PostFX::EnableVignette);
return "Graphics quality settings have been auto detected.";
}
function _makePrettyResString( %resString )
{
%width = getWord( %resString, $WORD::RES_X );
%height = getWord( %resString, $WORD::RES_Y );
%aspect = %width / %height;
%aspect = mRound( %aspect * 100 ) * 0.01;
switch$( %aspect )
{
case "1.33":
%aspect = "4:3";
case "1.78":
%aspect = "16:9";
default:
%aspect = "";
}
%outRes = %width @ " x " @ %height;
if ( %aspect !$= "" )
%outRes = %outRes @ " (" @ %aspect @ ")";
return %outRes;
}
//
function GraphicsMenuSetting::init( %this )
{
assert( isObject( %this ) );
assert( isObject( %this.qualitySettingGroup ) );
// Fill it.
%select = -1;
%selectedName = "";
for ( %i=0; %i < %this.qualitySettingGroup.getCount(); %i++ )
{
%level = %this.qualitySettingGroup.getObject( %i );
%levelName = %level.displayName;
if ( %level.isCurrent() )
{
%select = %i;
%selectedName = %level.displayName;
}
}
// Setup a default selection.
if ( %select == -1 )
{
%this-->SettingText.setText( "Custom" );
%this.selectedLevel = %this.qualitySettingGroup.getCount();
}
else
{
%this-->SettingText.setText(%selectedName);
%this.selectedLevel = %select;
}
}
function GraphicsQualityLevel::isCurrent( %this )
{
// Test each pref to see if the current value
// equals our stored value.
for ( %i=0; %i < %this.count(); %i++ )
{
%pref = %this.getKey( %i );
%value = %this.getValue( %i );
if ( getVariable( %pref ) !$= %value )
return false;
}
return true;
}
function GraphicsQualityLevel::apply( %this )
{
for ( %i=0; %i < %this.count(); %i++ )
{
%pref = %this.getKey( %i );
%value = %this.getValue( %i );
setVariable( %pref, %value );
}
// If we have an overloaded onApply method then
// call it now to finalize the changes.
if ( %this.isMethod( "onApply" ) )
%this.onApply();
else
{
%group = %this.getGroup();
if ( isObject( %group ) && %group.isMethod( "onApply" ) )
%group.onApply( %this );
}
}
function GraphicsOptionsMenuGroup::applySetting(%this, %settingName)
{
for(%i=0; %i < %this.getCount(); %i++)
{
%setting = %this.getObject(%i);
if(%setting.displayName $= %settingName)
{
for ( %s=0; %s < %setting.count(); %s++ )
{
%pref = %setting.getKey( %s );
%value = %setting.getValue( %s );
setVariable( %pref, %value );
}
}
}
}
function GraphicsMenu::apply(%this)
{
%newAdapter = GraphicsMenuDriver.getText();
%numAdapters = GFXInit::getAdapterCount();
%newDevice = $pref::Video::displayDevice;
for( %i = 0; %i < %numAdapters; %i ++ )
{
if( GFXInit::getAdapterName( %i ) $= %newAdapter )
{
%newDevice = GFXInit::getAdapterType( %i );
break;
}
}
// Change the device.
if ( %newDevice !$= $pref::Video::displayDevice )
{
if ( %testNeedApply )
return true;
$pref::Video::displayDevice = %newDevice;
if( %newAdapter !$= getDisplayDeviceInformation() )
MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." );
}
GraphicsMenuShadowQlty.apply();
GraphicsMenuSoftShadow.apply();
GraphicsMenuModelDtl.apply();
GraphicsMenuTextureDtl.apply();
GraphicsMenuTerrainDtl.apply();
GraphicsMenuDecalLife.apply();
GraphicsMenuGroundClutter.apply();
GraphicsMenuMaterialQlty.apply();
//Update Textures
reloadTextures();
//Update lighting
// Set the light manager. This should do nothing
// if its already set or if its not compatible.
setLightManager( $pref::lightManager );
PostFXManager.settingsEffectSetEnabled("SSAO", $pref::PostFX::EnableSSAO);
PostFXManager.settingsEffectSetEnabled("HDR", $pref::PostFX::EnableHDR);
PostFXManager.settingsEffectSetEnabled("DOF", $pref::PostFX::EnableDOF);
PostFXManager.settingsEffectSetEnabled("LightRays", $pref::PostFX::EnableLightRays);
PostFXManager.settingsEffectSetEnabled("Vignette", $pref::PostFX::EnableVignette);
$pref::Video::disableParallaxMapping = !GraphicsMenuParallax.isStateOn();
//water reflections
$pref::Water::disableTrueReflections = !GraphicsMenuWaterRefl.isStateOn();
//Update the display settings now
$pref::Video::Resolution = getWords( Canvas.getMode( GraphicsMenuResolution.getSelected() ), $WORD::RES_X, $WORD::RES_Y );
%newBpp = 32; // ... its not 1997 anymore.
$pref::Video::FullScreen = GraphicsMenuFullScreen.isStateOn() ? "true" : "false";
$pref::Video::RefreshRate = GraphicsMenuRefreshRate.getSelected();
$pref::Video::disableVerticalSync = !GraphicsMenuVSync.isStateOn();
$pref::Video::AA = GraphicsMenuAA.getSelected();
if ( %newFullScreen $= "false" )
{
// If we're in windowed mode switch the fullscreen check
// if the resolution is bigger than the desktop.
%deskRes = getDesktopResolution();
%deskResX = getWord(%deskRes, $WORD::RES_X);
%deskResY = getWord(%deskRes, $WORD::RES_Y);
if ( getWord( %newRes, $WORD::RES_X ) > %deskResX ||
getWord( %newRes, $WORD::RES_Y ) > %deskResY )
{
$pref::Video::FullScreen = "true";
GraphicsMenuFullScreen.setStateOn( true );
}
}
// Build the final mode string.
%newMode = $pref::Video::Resolution SPC $pref::Video::FullScreen SPC %newBpp SPC $pref::Video::RefreshRate SPC $pref::Video::AA;
// Change the video mode.
if ( %newMode !$= $pref::Video::mode ||
%newVsync != $pref::Video::disableVerticalSync )
{
if ( %testNeedApply )
return true;
$pref::Video::mode = %newMode;
$pref::Video::disableVerticalSync = %newVsync;
configureCanvas();
}
// Check the anisotropic filtering.
%level = GraphicsMenuAniso.getSelected();
if ( %level != $pref::Video::defaultAnisotropy )
{
if ( %testNeedApply )
return true;
$pref::Video::defaultAnisotropy = %level;
}
echo("Exporting client prefs");
%prefPath = getPrefpath();
export("$pref::*", %prefPath @ "/clientPrefs.cs", false);
}

View file

@ -0,0 +1,230 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(recordingsDlg) {
position = "0 0";
extent = "1024 768";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
helpTag = "0";
new GuiWindowCtrl() {
text = "Demo Recordings";
resizeWidth = "0";
resizeHeight = "0";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
canCollapse = "0";
closeCommand = "Canvas.popDialog(recordingsDlg);";
edgeSnap = "1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "247 215";
extent = "530 338";
minExtent = "48 92";
horizSizing = "center";
vertSizing = "center";
profile = "GuiWindowProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "dynamic";
vScrollBar = "alwaysOn";
lockHorizScroll = "0";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "23 60";
extent = "484 237";
minExtent = "32 32";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextListCtrl(RecordingsDlgList) {
columns = "0";
fitParentWidth = "1";
clipColumnText = "0";
position = "1 1";
extent = "469 32";
minExtent = "8 20";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextArrayProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiButtonCtrl(DR_CancelBtn) {
text = "Cancel";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "396 306";
extent = "110 20";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "top";
profile = "GuiButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog(recordingsDlg);";
accelerator = "escape";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(DR_StartDemoBtn) {
text = "Play";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "25 305";
extent = "110 20";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "top";
profile = "GuiButtonProfile";
visible = "1";
active = "1";
command = "StartSelectedDemo();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "During gameplay press the following keys:";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "23 30";
extent = "206 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Start = F3";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "253 32";
extent = "50 15";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Stop = F4";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "320 32";
extent = "49 13";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(DR_DelDemoBtn) {
text = "Delete";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "210 305";
extent = "110 20";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiButtonProfile";
visible = "1";
active = "1";
command = "deleteDemoRecord();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,287 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(ChooseLevelDlg) {
position = "0 0";
extent = "1024 768";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
launchInEditor = "0";
returnGui = "MainMenuGui";
new GuiControl(ChooseLevelWindow) {
position = "80 36";
extent = "770 616";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapCtrl() {
bitmap = "./art/no-preview";
wrap = "0";
position = "369 31";
extent = "400 300";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "CurrentPreview";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
};
new GuiTextCtrl() {
text = "Empty Room";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "370 335";
extent = "90 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "levelName";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Description:";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "370 354";
extent = "91 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
useURLMouseCursor = "0";
position = "370 380";
extent = "165 28";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMLWhiteTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "LevelDescription";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "./art/previous-button";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "2 -1";
extent = "368 33";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
command = "ChooseLevelWindow.previousPreviews();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "PreviousSmallPreviews";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
wrap = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "./art/next-button";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "-3 549";
extent = "374 33";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
command = "ChooseLevelWindow.nextPreviews();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "NextSmallPreviews";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
wrap = "0";
};
new GuiTextListCtrl(CL_levelList) {
columns = "0";
fitParentWidth = "1";
clipColumnText = "0";
position = "-7 1";
extent = "80 30";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextArrayProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiDynamicCtrlArrayControl() {
colCount = "1";
colSize = "368";
rowCount = "14";
rowSize = "35";
rowSpacing = "0";
colSpacing = "10";
frozen = "0";
autoCellSize = "1";
fillRowFirst = "0";
dynamicSize = "0";
padding = "0 0 0 0";
position = "2 33";
extent = "368 516";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "SmallPreviews";
canSave = "1";
canSaveDynamicFields = "0";
new GuiButtonCtrl() {
text = "Empty";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "0 0";
extent = "368 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "ChooseLevelWindow.previewSelected(ChooseLevelWindow->SmallPreviews->SmallPreview0);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "SmallPreview0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiButtonCtrl(ChooseLevelDlgGoBtn) {
text = "Start Level";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "371 583";
extent = "399 33";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(ChooseLevelDlgBackBtn) {
text = "Return to Menu";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "0 583";
extent = "371 33";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog(ChooseLevelDlg);\n\nif(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();";
accelerator = "escape";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,102 @@
<GuiContainer
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="0 0"
extent="700 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
class="GraphicsMenuSetting"
canSave="true"
canSaveDynamicFields="false">
<GuiBitmapCtrl
bitmap="data/ui/art/hudfill.png"
wrap="false"
position="0 0"
extent="550 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
canSave="true"
canSaveDynamicFields="false" />
<GuiTextCtrl
text="Move Forward"
maxLength="1024"
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="0 0"
extent="550 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
internalName="nameText"
canSave="true"
canSaveDynamicFields="false" />
<GuiContainer
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="550 0"
extent="150 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
canSave="true"
canSaveDynamicFields="false">
<GuiButtonCtrl
text="W"
groupNum="-1"
buttonType="PushButton"
useMouseEvents="true"
position="0 0"
extent="150 35"
minExtent="8 8"
horizSizing="relative"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
canSave="true"
canSaveDynamicFields="false"
internalName="rebindButton"
className="ControlsMenuRebindButton"/>
</GuiContainer>
</GuiContainer>

View file

@ -0,0 +1,159 @@
<GuiContainer
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="0 0"
extent="700 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
class="GraphicsMenuSetting"
canSave="true"
canSaveDynamicFields="false">
<GuiBitmapCtrl
bitmap="data/ui/art/hudfill.png"
wrap="false"
position="0 0"
extent="450 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
canSave="true"
canSaveDynamicFields="false" />
<GuiContainer
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="450 0"
extent="250 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
canSave="true"
canSaveDynamicFields="false">
<GuiBitmapCtrl
bitmap="data/ui/art/hudfill.png"
wrap="false"
position="35 0"
extent="180 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
canSave="true"
canSaveDynamicFields="false" />
<GuiTextCtrl
text="High"
maxLength="1024"
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="35 0"
extent="180 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
internalName="SettingText"
canSave="true"
canSaveDynamicFields="false" />
<GuiButtonCtrl
text="&gt;"
groupNum="-1"
buttonType="PushButton"
useMouseEvents="true"
position="215 0"
extent="35 35"
minExtent="8 8"
horizSizing="relative"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
class="OptionsMenuForwardSetting"
canSave="true"
canSaveDynamicFields="false" />
<GuiButtonCtrl
text="&lt;"
groupNum="-1"
buttonType="PushButton"
useMouseEvents="true"
position="0 0"
extent="35 35"
minExtent="8 8"
horizSizing="relative"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
class="OptionsMenuBackSetting"
canSave="true"
canSaveDynamicFields="false" />
</GuiContainer>
<GuiTextCtrl
text="Shadow Quality"
maxLength="1024"
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="0 0"
extent="450 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
internalName="nameText"
canSave="true"
canSaveDynamicFields="false" />
</GuiContainer>

View file

@ -0,0 +1,140 @@
<GuiContainer
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="0 35"
extent="700 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
canSave="true"
canSaveDynamicFields="false">
<GuiBitmapCtrl
bitmap="data/ui/art/hudfill.png"
wrap="false"
position="0 0"
extent="450 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
canSave="true"
canSaveDynamicFields="false" />
<GuiContainer
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="450 0"
extent="250 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
canSave="true"
canSaveDynamicFields="false">
<GuiBitmapCtrl
bitmap="data/ui/art/hudfill.png"
wrap="false"
position="0 0"
extent="250 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiDefaultProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
canSave="true"
canSaveDynamicFields="false" />
<GuiSliderCtrl
range="0.1 1"
ticks="9"
snap="false"
value="0.453571"
position="0 0"
extent="200 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiSliderProfile"
visible="true"
active="true"
variable="$pref::Input::VertMouseSensitivity"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="false"
internalName="slider"
canSave="true"
canSaveDynamicFields="false" />
<GuiTextCtrl
text="5"
maxLength="1024"
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="200 0"
extent="50 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
internalName="valueText"
canSave="true"
canSaveDynamicFields="false" />
</GuiContainer>
<GuiTextCtrl
text="Vertical Sensitivity"
maxLength="1024"
margin="0 0 0 0"
padding="0 0 0 0"
anchorTop="true"
anchorBottom="false"
anchorLeft="true"
anchorRight="false"
position="0 0"
extent="450 35"
minExtent="8 2"
horizSizing="right"
vertSizing="bottom"
profile="GuiMenuButtonProfile"
visible="true"
active="true"
tooltipProfile="GuiToolTipProfile"
hovertime="1000"
isContainer="true"
internalName="nameText"
canSave="true"
canSaveDynamicFields="false" />
</GuiContainer>

View file

@ -0,0 +1,455 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(JoinServerMenu) {
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
new GuiControl(JoinServerWindow) {
position = "80 36";
extent = "800 616";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextCtrl(JS_status) {
text = "No servers found.";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "277 31";
extent = "148 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiScrollCtrl() {
willFirstRespond = "1";
hScrollBar = "dynamic";
vScrollBar = "alwaysOn";
lockHorizScroll = "0";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "10 80";
extent = "780 461";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextListCtrl(JS_serverList) {
columns = "0 200 270 335 400";
fitParentWidth = "1";
clipColumnText = "0";
position = "1 1";
extent = "762 8";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextArrayProfile";
visible = "1";
active = "1";
altCommand = "JoinServerDlg.join();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiTextEditCtrl() {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "116 31";
extent = "144 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextEditProfile";
visible = "1";
active = "1";
variable = "$pref::Player::Name";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Player Name:";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "12 31";
extent = "98 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Players";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "269 59";
extent = "36 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMLWhiteTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Version";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "335 59";
extent = "38 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMLWhiteTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Game";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "412 59";
extent = "28 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMLWhiteTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Ping";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "212 59";
extent = "20 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMLWhiteTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Server Name";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "12 59";
extent = "63 18";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMLWhiteTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiControl(JS_queryStatus) {
position = "10 541";
extent = "778 35";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
hidden = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiProgressCtrl(JS_statusBar) {
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "84 0";
extent = "695 35";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiProgressProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(JS_cancelQuery) {
text = "Cancel!";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 0";
extent = "84 35";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "JoinServerDlg.cancel();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(JS_statusText) {
text = "Querying master server";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "84 0";
extent = "695 35";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiButtonCtrl(JoinServerBackBtn) {
text = "Return to Menu";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "0 583";
extent = "160 33";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog(JoinServerMenu);\n\nif(isObject(JoinServerMenu.returnGui) && JoinServerMenu.returnGui.isMethod(\"onReturnTo\")) JoinServerMenu.returnGui.onReturnTo();";
accelerator = "escape";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(JoinServerQryLanBtn) {
text = "Query Lan";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "160 583";
extent = "160 33";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "JoinServerMenu.queryLan();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(JoinServerQryInternetBtn) {
text = "Query Internet";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "320 583";
extent = "160 33";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "JoinServerMenu.query();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(JoinServerRefreshBtn) {
text = "Refresh Server";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "480 583";
extent = "160 33";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "JoinServerMenu.refresh();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(JoinServerJoinBtn) {
text = "Join Server";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "640 583";
extent = "160 33";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "0";
command = "JoinServerMenu.join();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,102 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiChunkedBitmapCtrl(LoadingGui) {
bitmap = "data/ui/art/background-dark.png";
useVariable = "0";
tile = "0";
position = "0 0";
extent = "1600 838";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
new GuiControl() {
position = "391 429";
extent = "497 166";
minExtent = "8 8";
horizSizing = "center";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
command = "disconnect();\nCanvas.setContent(MainMenuGui);";
accelerator = "escape";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapCtrl(LoadingLogo) {
bitmap = "data/ui/art/Torque-3D-logo.png";
wrap = "0";
position = "27 6";
extent = "443 139";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiProgressBitmapCtrl(LoadingProgress) {
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "17 126";
extent = "464 24";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "bottom";
profile = "GuiProgressBitmapProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(LoadingProgressTxt) {
text = "LOADING DATABLOCKS";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "28 144";
extent = "440 20";
minExtent = "8 8";
horizSizing = "center";
vertSizing = "bottom";
profile = "GuiMenuTextProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,194 @@
exec( "tools/gui/profiles.ed.cs" );
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiChunkedBitmapCtrl(MainMenuGui) {
bitmap = "data/ui/art/background-dark.png";
useVariable = "0";
tile = "0";
position = "0 0";
extent = "1024 768";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
Enabled = "1";
isDecoy = "0";
new GuiBitmapButtonCtrl(MainMenuAppLogo) {
bitmap = "data/ui/art/Torque-3D-logo-shortcut.png";
bitmapMode = "Stretched";
autoFitExtents = "0";
useModifiers = "0";
useStates = "1";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "368 30";
extent = "443 139";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
command = "gotoWebPage(\"forums.torque3d.org\");";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "1";
};
new GuiControl(MainMenuButtonContainer) {
position = "67 321";
extent = "442 381";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiDynamicCtrlArrayControl() {
colCount = "1";
colSize = "442";
rowCount = "9";
rowSize = "40";
rowSpacing = "0";
colSpacing = "0";
frozen = "0";
autoCellSize = "1";
fillRowFirst = "0";
dynamicSize = "0";
padding = "0 0 0 0";
position = "0 0";
extent = "442 381";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiButtonCtrl() {
text = "Singleplayer";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "0 0";
extent = "442 40";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiBlankMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuGui.openSinglePlayerMenu();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Create Server";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 40";
extent = "442 40";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiBlankMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuGui.openMultiPlayerMenu();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Join Server";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 80";
extent = "442 40";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiBlankMenuButtonProfile";
visible = "1";
active = "1";
command = "Canvas.pushDialog(JoinServerMenu);";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Options";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 120";
extent = "442 40";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiBlankMenuButtonProfile";
visible = "1";
active = "1";
command = "MainMenuGui.openOptionsMenu();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Exit";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "0 160";
extent = "442 40";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiBlankMenuButtonProfile";
visible = "1";
active = "1";
command = "quit();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
internalName = "ExitButton";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,60 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxOKDlg) {
profile = "GuiOverlayProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "1";
helpTag = "0";
new GuiWindowCtrl(MBOKFrame) {
profile = "GuiWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "170 175";
extent = "300 107";
minExtent = "48 95";
visible = "1";
helpTag = "0";
maxLength = "255";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
text = "";
new GuiMLTextCtrl(MBOKText) {
profile = "GuiMLTextProfile";
horizSizing = "center";
vertSizing = "bottom";
position = "9 35";
extent = "281 24";
minExtent = "8 8";
visible = "1";
helpTag = "0";
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
};
new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "top";
position = "111 75";
extent = "80 24";
minExtent = "8 8";
visible = "1";
command = "MessageCallback(MessageBoxOKDlg,MessageBoxOKDlg.callback);";
accelerator = "return";
helpTag = "0";
text = "Ok";
simpleStyle = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,126 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(MessageBoxYesNoDlg) {
position = "0 0";
extent = "1024 768";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiOverlayProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
helpTag = "0";
new GuiContainer() {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "168 352";
extent = "700 64";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiChunkedBitmapCtrl() {
bitmap = "data/ui/art/hudfill.png";
useVariable = "0";
tile = "0";
position = "0 0";
extent = "700 64";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);";
accelerator = "escape";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(MBYesNoText) {
text = "Re-bind \"\" to...";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "177 8";
extent = "384 20";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "Yes";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "270 36";
extent = "80 22";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "top";
profile = "GuiButtonProfile";
visible = "1";
active = "1";
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.yesCallback);";
accelerator = "return";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "No";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "367 36";
extent = "80 22";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "top";
profile = "GuiButtonProfile";
visible = "1";
active = "1";
command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);";
accelerator = "escape";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,557 @@
function execNetGraphGuiGUI()
{
if ( isObject( NetGraphGui ) )
NetGraphGui.delete();
if ( isObject( NetGraphProfile ) )
NetGraphProfile.delete();
if ( isObject( NetGraphGhostsActiveProfile ) )
NetGraphGhostsActiveProfile.delete();
if ( isObject( NetGraphGhostUpdatesProfile ) )
NetGraphGhostUpdatesProfile.delete();
if ( isObject( NetGraphBitsSentProfile ) )
NetGraphBitsSentProfile.delete();
if ( isObject( NetGraphBitsReceivedProfile ) )
NetGraphBitsReceivedProfile.delete();
if ( isObject( NetGraphLatencyProfile ) )
NetGraphLatencyProfile.delete();
if ( isObject( NetGraphPacketLossProfile ) )
NetGraphPacketLossProfile.delete();
exec( "./NetGraphGui.gui" );
}
// Profiles
new GuiControlProfile (NetGraphProfile)
{
modal = false;
opaque = false;
canKeyFocus = false;
};
new GuiControlProfile (NetGraphKeyContainerProfile)
{
border = true;
opaque = true;
fillColor = "100 100 100 200";
};
new GuiControlProfile (NetGraphGhostsActiveProfile)
{
border = false;
fontColor = "255 255 255";
};
new GuiControlProfile (NetGraphGhostUpdatesProfile)
{
border = false;
fontColor = "255 0 0";
};
new GuiControlProfile (NetGraphBitsSentProfile)
{
border = false;
fontColor = "0 255 0";
};
new GuiControlProfile (NetGraphBitsReceivedProfile)
{
border = false;
fontColor = "0 0 255";
};
new GuiControlProfile (NetGraphLatencyProfile)
{
border = false;
fontColor = "0 255 255";
};
new GuiControlProfile (NetGraphPacketLossProfile)
{
border = false;
fontColor = "0 0 0";
};
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(NetGraphGui) {
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
noCursor = "1";
new GuiGraphCtrl(NetGraph) {
centerY = "1";
plotColor[0] = "1 1 1 1";
plotColor[1] = "1 0 0 1";
plotColor[2] = "0 1 0 1";
plotColor[3] = "0 0 1 1";
plotColor[4] = "0 1 1 1";
plotColor[5] = "0 0 0 1";
plotType[0] = "PolyLine";
plotType[1] = "PolyLine";
plotType[2] = "PolyLine";
plotType[3] = "PolyLine";
plotType[4] = "PolyLine";
plotType[5] = "PolyLine";
plotInterval[0] = "0";
plotInterval[1] = "0";
plotInterval[2] = "0";
plotInterval[3] = "0";
plotInterval[4] = "0";
plotInterval[5] = "0";
position = "816 5";
extent = "200 200";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphKeyContainerProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiControl() {
position = "816 205";
extent = "200 104";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphKeyContainerProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiTextCtrl(GhostsActive) {
text = "Ghosts Active";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "100 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphGhostsActiveProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(GhostUpdates) {
text = "Ghost Updates";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "100 0";
extent = "100 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphGhostUpdatesProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(BitsSent) {
text = "Bytes Sent";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 18";
extent = "100 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphBitsSentProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(BitsReceived) {
text = "Bytes Received";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "100 18";
extent = "100 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphBitsReceivedProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(Latency) {
text = "Latency";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 36";
extent = "100 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphLatencyProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(PacketLoss) {
text = "Packet Loss";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "100 36";
extent = "59 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphPacketLossProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Network Simulation:";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 52";
extent = "97 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphPacketLossProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Simulated Latency:";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 68";
extent = "91 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphPacketLossProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "ms";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "179 68";
extent = "20 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphPacketLossProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl(NetGraphSimLatency) {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
text = "0";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "112 67";
extent = "64 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Simulated Packet Loss:";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 83";
extent = "111 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphPacketLossProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "%";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "179 84";
extent = "20 18";
minExtent = "8 2";
horizSizing = "left";
vertSizing = "bottom";
profile = "NetGraphPacketLossProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl(NetGraphSimPacket) {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
text = "0";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "112 85";
extent = "64 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextEditProfile";
visible = "1";
active = "1";
command = "if(NetGraphSimLatency.text $= \"\" || NetGraphSimLatency.text < 0)\n{\n NetGraphSimLatency.text = 0;\n}\n\nif(NetGraphSimPacket.text $= \"\" || NetGraphSimPacket.text < 0)\n{\n NetGraphSimLatency.text = 0;\n}\nelse if(NetGraphSimPacket.text > 100)\n{\n NetGraphSimPacket.text = 100;\n}\n\nnetSimulateLag( NetGraphSimLatency.text, NetGraphSimPacket.text );";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---
// Functions
function toggleNetGraph()
{
if(!$NetGraph::isInitialized)
{
NetGraph::updateStats();
$NetGraph::isInitialized = true;
}
if(!Canvas.isMember(NetGraphGui))
{
Canvas.add(NetGraphGui);
}
else
{
Canvas.remove(NetGraphGui);
netSimulateLag( 0, 0 );
}
}
function NetGraph::updateStats()
{
$NetGraphThread = NetGraph.schedule(32, "updateStats");
if(!$Stats::netGhostUpdates)
return;
if(isobject(NetGraph))
{
if(isobject(ServerConnection))
NetGraph.addDatum(0,ServerConnection.getGhostsActive());
GhostsActive.setText("Ghosts Active: " @ ServerConnection.getGhostsActive());
NetGraph.addDatum(1,$Stats::netGhostUpdates);
GhostUpdates.setText("Ghost Updates: " @ $Stats::netGhostUpdates);
NetGraph.addDatum(2,$Stats::netBitsSent);
BitsSent.setText("Bytes Sent: " @ $Stats::netBitsSent);
NetGraph.addDatum(3,$Stats::netBitsReceived);
BitsReceived.setText("Bytes Received: " @ $Stats::netBitsReceived);
NetGraph.matchScale(2,3);
NetGraph.addDatum(4,ServerConnection.getPing());
Latency.setText("Latency: " @ ServerConnection.getPing());
NetGraph.addDatum(5,ServerConnection.getPacketLoss());
PacketLoss.setText("Packet Loss: " @ ServerConnection.getPacketLoss());
}
}
function NetGraph::toggleKey()
{
if(!GhostsActive.visible)
{
GhostsActive.visible = 1;
GhostUpdates.visible = 1;
BitsSent.visible = 1;
BitsReceived.visible = 1;
Latency.visible = 1;
PacketLoss.visible = 1;
}
else
{
GhostsActive.visible = 0;
GhostUpdates.visible = 0;
BitsSent.visible = 0;
BitsReceived.visible = 0;
Latency.visible = 0;
PacketLoss.visible = 0;
}
}
function NetGraphSimLatency::onReturn(%this)
{
NetGraph.updateNetworkSimulation();
}
function NetGraphSimPacket::onReturn(%this)
{
NetGraph.updateNetworkSimulation();
}
function NetGraph::updateNetworkSimulation(%this)
{
%latency = NetGraphSimLatency.getText();
if(%latency $= "" || %latency < 0)
{
NetGraphSimLatency.text = 0;
%latency = 0;
}
%packetLoss = NetGraphSimPacket.getText();
if(%packetLoss $= "" || %packetLoss < 0)
{
NetGraphSimLatency.text = 0;
%packetLoss = 0;
}
else if(%packetLoss > 100)
{
NetGraphSimPacket.text = 100;
%packetLoss = 100;
}
netSimulateLag( %latency, %packetLoss );
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,153 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(PauseMenu) {
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
tamlReader = "19772";
tile = "0";
useVariable = "0";
new GuiChunkedBitmapCtrl(PauseMenuBG) {
bitmap = "data/ui/art/hudfill";
useVariable = "0";
tile = "0";
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
};
new GuiControl() {
position = "51 118";
extent = "700 518";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiControl(PauseOptionsMain) {
position = "1 1";
extent = "700 320";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiButtonCtrl(PauseMenuExitButton) {
text = "Exit Game";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "0 0";
extent = "700 35";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "escapeFromGame();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(PauseMenuOptionsButton) {
text = "Options";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "0 35";
extent = "700 35";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "PauseMenu.openOptionsMenu();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(PauseMenuControlsButton) {
text = "Controls";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "0 70";
extent = "700 35";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "PauseMenu.openControlsMenu();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(PauseMenuCancelButton) {
text = "Cancel";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "1";
position = "466 285";
extent = "233 35";
minExtent = "8 8";
horizSizing = "relative";
vertSizing = "bottom";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
class = "OptionsMenuDefaultsButton";
canSave = "1";
canSaveDynamicFields = "0";
accelerator="escape";
};
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,661 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(ProfilerGui) {
position = "0 0";
extent = "1024 768";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
new GuiWindowCtrl(ppProfilerWindow) {
text = "Profiler Manager";
resizeWidth = "0";
resizeHeight = "0";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
canCollapse = "0";
closeCommand = "Canvas.popDialog(ProfilerGui);";
edgeSnap = "0";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "306 216";
extent = "415 199";
minExtent = "8 8";
horizSizing = "center";
vertSizing = "center";
profile = "GuiWindowProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiCheckBoxCtrl(ppShowFps) {
text = "Show Fps";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "13 24";
extent = "127 30";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Enable or Disable the Fps counter";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ppShowGfx) {
text = "Show Gfx";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "13 40";
extent = "127 30";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Enable or Disable the Gfx";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ppShowShadow) {
text = "Show Shadow";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "13 56";
extent = "127 30";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Enable or Disable the Shdow";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ppShowNet) {
text = "Show Net";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "13 136";
extent = "127 30";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Enable or Disable the Network activity";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ppShowForest) {
text = "Show Forest";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "13 120";
extent = "127 30";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Enable or Disable the Forest";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ppShowGroundcover) {
text = "Show Groundcover";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "13 104";
extent = "127 30";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Enable or Disable the Groundcover";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ppShowTerrain) {
text = "Show Terrain";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "13 88";
extent = "127 30";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Enable or Disable the Terrain";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ppShowSfx) {
text = "Show Sfx";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "13 72";
extent = "127 30";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Enable or Disable the Sfx";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(ppOptionsEnableDisable) {
text = "On/Off OSD";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "309 38";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiButtonProfile";
visible = "1";
active = "1";
command = "showMetrics(true);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Apply the setting from the dialog box";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(ppOptionsUpdate) {
text = "Update";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "200 38";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiButtonProfile";
visible = "1";
active = "1";
command = "showMetrics(false);";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Update the profiler with the new parameters";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(ppOptionsDoProfiling) {
text = "DoProfiling";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "309 141";
extent = "93 23";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiButtonProfile";
visible = "1";
active = "1";
command = "doProfileFromGui();";
tooltipProfile = "GuiToolTipProfile";
tooltip = "Does the profile for the ammount of time specified ";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(DurationLabel) {
text = "Duration[ms]";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "200 144";
extent = "39 21";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextRightProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl(Duration) {
historySize = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
password = "0";
passwordMask = "*";
text = "1000";
maxLength = "1024";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "249 144";
extent = "53 18";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiTextEditProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---
$MetricsParamArray[0] = "fps ";
$MetricsParamArray[1] = "shadow ";
$MetricsParamArray[2] = "gfx ";
$MetricsParamArray[3] = "sfx ";
$MetricsParamArray[4] = "terrain ";
$MetricsParamArray[5] = "groundcover ";
$MetricsParamArray[6] = "forest ";
$MetricsParamArray[7] = "net ";
$EnableProfiler = false;
$string = ""; //string used to collet the parameters for metrics function
function showMetrics(%var)
{
$string = "";
if(ppShowFps.getValue())
{
$string = $string @ $MetricsParamArray[0];
}
if(ppShowShadow.getValue())
{
$string = $string @ $MetricsParamArray[1];
}
if(ppShowGfx.getValue())
{
$string = $string @ $MetricsParamArray[2];
}
if(ppShowSfx.getValue())
{
$string = $string @ $MetricsParamArray[3];
}
if(ppShowTerrain.getValue())
{
$string = $string @ $MetricsParamArray[4];
}
if(ppShowForest.getValue())
{
$string = $string @ $MetricsParamArray[5];
}
if(ppShowGroundcover.getValue())
{
$string = $string @ $MetricsParamArray[6];
}
if(ppShowNet.getValue())
{
$string = $string @ $MetricsParamArray[7];
}
if(%var)
{
$EnableProfiler = !($EnableProfiler);
if($EnableProfiler)
{
metrics($string);
}
else if((false == $EnableProfiler))
{
metrics();
}
}
else if($EnableProfiler) //will enter only when the enable/disable button was pressed
{
metrics($string);
}
}
function showMetics(%var)
{
if(%var)
{
metrics($string);
}
else if(true == $EnableProfiler)
{
$EnableProfiler = false;
metrics();
}
}
GlobalActionMap.bind(keyboard, "ctrl F2", showMetics);
%guiContent = new GuiControl(FrameOverlayGui) {
profile = "GuiModelessDialogProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
visible = "True";
setFirstResponder = "True";
modal = "false";
helpTag = "0";
noCursor = true;
new GuiConsoleTextCtrl(TextOverlayControl) {
profile = "GuiConsoleTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "5 5";
extent = "130 18";
minExtent = "4 4";
visible = "True";
setFirstResponder = "True";
modal = "True";
helpTag = "0";
expression = "10";
command = "Canvas.popDialog(FrameOverlayGui);";
accelerator = "escape";
};
};
// Note: To implement your own metrics overlay
// just add a function with a name in the form
// XXXXMetricsCallback which can be enabled via
// metrics( XXXX )
function fpsMetricsCallback()
{
return " | FPS |" @
" " @ $fps::real @
" max: " @ $fps::realMax @
" min: " @ $fps::realMin @
" mspf: " @ 1000 / $fps::real;
}
function gfxMetricsCallback()
{
return " | GFX |" @
" PolyCount: " @ $GFXDeviceStatistics::polyCount @
" DrawCalls: " @ $GFXDeviceStatistics::drawCalls @
" RTChanges: " @ $GFXDeviceStatistics::renderTargetChanges;
}
function terrainMetricsCallback()
{
return " | Terrain |" @
" Cells: " @ $TerrainBlock::cellsRendered @
" Override Cells: " @ $TerrainBlock::overrideCells @
" DrawCalls: " @ $TerrainBlock::drawCalls;
}
function netMetricsCallback()
{
return " | Net |" @
" BitsSent: " @ $Stats::netBitsSent @
" BitsRcvd: " @ $Stats::netBitsReceived @
" GhostUpd: " @ $Stats::netGhostUpdates;
}
function groundCoverMetricsCallback()
{
return " | GroundCover |" @
" Cells: " @ $GroundCover::renderedCells @
" Billboards: " @ $GroundCover::renderedBillboards @
" Batches: " @ $GroundCover::renderedBatches @
" Shapes: " @ $GroundCover::renderedShapes;
}
function forestMetricsCallback()
{
return " | Forest |" @
" Cells: " @ $Forest::totalCells @
" Cells Meshed: " @ $Forest::cellsRendered @
" Cells Billboarded: " @ $Forest::cellsBatched @
" Meshes: " @ $Forest::cellItemsRendered @
" Billboards: " @ $Forest::cellItemsBatched;
}
function sfxMetricsCallback()
{
return " | SFX |" @
" Sounds: " @ $SFX::numSounds @
" Lists: " @ ( $SFX::numSources - $SFX::numSounds - $SFX::Device::fmodNumEventSource ) @
" Events: " @ $SFX::fmodNumEventSources @
" Playing: " @ $SFX::numPlaying @
" Culled: " @ $SFX::numCulled @
" Voices: " @ $SFX::numVoices @
" Buffers: " @ $SFX::Device::numBuffers @
" Memory: " @ ( $SFX::Device::numBufferBytes / 1024.0 / 1024.0 ) @ " MB" @
" Time/S: " @ $SFX::sourceUpdateTime @
" Time/P: " @ $SFX::parameterUpdateTime @
" Time/A: " @ $SFX::ambientUpdateTime;
}
function sfxSourcesMetricsCallback()
{
return sfxDumpSourcesToString();
}
function sfxStatesMetricsCallback()
{
return " | SFXStates |" @ sfxGetActiveStates();
}
function timeMetricsCallback()
{
return " | Time |" @
" Sim Time: " @ getSimTime() @
" Mod: " @ getSimTime() % 32;
}
function reflectMetricsCallback()
{
return " | REFLECT |" @
" Objects: " @ $Reflect::numObjects @
" Visible: " @ $Reflect::numVisible @
" Occluded: " @ $Reflect::numOccluded @
" Updated: " @ $Reflect::numUpdated @
" Elapsed: " @ $Reflect::elapsed NL
" Allocated: " @ $Reflect::renderTargetsAllocated @
" Pooled: " @ $Reflect::poolSize NL
" " @ getWord( $Reflect::textureStats, 1 ) TAB
" " @ getWord( $Reflect::textureStats, 2 ) @ "MB" TAB
" " @ getWord( $Reflect::textureStats, 0 );
}
function decalMetricsCallback()
{
return " | DECAL |" @
" Batches: " @ $Decal::Batches @
" Buffers: " @ $Decal::Buffers @
" DecalsRendered: " @ $Decal::DecalsRendered;
}
function renderMetricsCallback()
{
return " | Render |" @
" Mesh: " @ $RenderMetrics::RIT_Mesh @
" MeshDL: " @ $RenderMetrics::RIT_MeshDynamicLighting @
" Shadow: " @ $RenderMetrics::RIT_Shadow @
" Sky: " @ $RenderMetrics::RIT_Sky @
" Obj: " @ $RenderMetrics::RIT_Object @
" ObjT: " @ $RenderMetrics::RIT_ObjectTranslucent @
" Decal: " @ $RenderMetrics::RIT_Decal @
" Water: " @ $RenderMetrics::RIT_Water @
" Foliage: " @ $RenderMetrics::RIT_Foliage @
" Trans: " @ $RenderMetris::RIT_Translucent @
" Custom: " @ $RenderMetrics::RIT_Custom;
}
function shadowMetricsCallback()
{
return " | Shadow |" @
" Active: " @ $ShadowStats::activeMaps @
" Updated: " @ $ShadowStats::updatedMaps @
" PolyCount: " @ $ShadowStats::polyCount @
" DrawCalls: " @ $ShadowStats::drawCalls @
" RTChanges: " @ $ShadowStats::rtChanges @
" PoolTexCount: " @ $ShadowStats::poolTexCount @
" PoolTexMB: " @ $ShadowStats::poolTexMemory @ "MB";
}
function basicShadowMetricsCallback()
{
return " | Shadow |" @
" Active: " @ $BasicLightManagerStats::activePlugins @
" Updated: " @ $BasicLightManagerStats::shadowsUpdated @
" Elapsed Ms: " @ $BasicLightManagerStats::elapsedUpdateMs;
}
function lightMetricsCallback()
{
return " | Deferred Lights |" @
" Active: " @ $lightMetrics::activeLights @
" Culled: " @ $lightMetrics::culledLights;
}
function particleMetricsCallback()
{
return " | Particles |" @
" # Simulated " @ $particle::numSimulated;
}
function partMetricsCallback()
{
return particleMetricsCallback();
}
// alias
function audioMetricsCallback()
{
return sfxMetricsCallback();
}
// alias
function videoMetricsCallback()
{
return gfxMetricsCallback();
}
// Add a metrics HUD. %expr can be a vector of names where each element
// must have a corresponding '<name>MetricsCallback()' function defined
// that will be called on each update of the GUI control. The results
// of each function are stringed together.
//
// Example: metrics( "fps gfx" );
function metrics( %expr )
{
%metricsExpr = "";
if( %expr !$= "" )
{
for( %i = 0;; %i ++ )
{
%name = getWord( %expr, %i );
if( %name $= "" )
break;
else
{
%cb = %name @ "MetricsCallback";
if( !isFunction( %cb ) )
error( "metrics - undefined callback: " @ %cb );
else
{
%cb = %cb @ "()";
if( %i > 0 )
%metricsExpr = %metricsExpr @ " NL ";
%metricsExpr = %metricsExpr @ %cb;
}
}
}
if( %metricsExpr !$= "" )
%metricsExpr = %metricsExpr @ " @ \" \"";
}
if( %metricsExpr !$= "" )
{
$GameCanvas.pushDialog( FrameOverlayGui, 1000 );
TextOverlayControl.setValue( %metricsExpr );
}
else
$GameCanvas.popDialog(FrameOverlayGui);
}

View file

@ -0,0 +1,125 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(RemapConfirmDlg) {
position = "0 0";
extent = "1024 768";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
helpTag = "0";
new GuiContainer(RemapConfirmationPanel) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "168 352";
extent = "700 64";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiChunkedBitmapCtrl() {
bitmap = "data/ui/art/hudfill.png";
useVariable = "0";
tile = "0";
position = "0 0";
extent = "700 64";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl(RemapConfirmationText) {
text = "\"m\" is already bound to \"Forward\"!\nDo you wish to replace this mapping?";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 8";
extent = "700 20";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
accelerator = "return";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(RemapConfirmationYesButton) {
text = "Yes";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "270 36";
extent = "80 22";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "top";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "ControlsMenu.redoMapping(keyboard, \"m\", \"jump\", 0, 4); Canvas.popDialog();";
accelerator = "return";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl(RemapConfirmationNoButton) {
text = "No";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
position = "367 36";
extent = "80 22";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "top";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
command = "Canvas.popDialog();";
accelerator = "escape";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,122 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(RemapDlg) {
position = "0 0";
extent = "1024 768";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
helpTag = "0";
new GuiContainer(RemapPanel) {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "162 352";
extent = "700 64";
minExtent = "8 2";
horizSizing = "center";
vertSizing = "center";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiInputCtrl(OptRemapInputCtrl) {
lockMouse = "0";
position = "480 0";
extent = "64 64";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiInputCtrlProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiChunkedBitmapCtrl() {
bitmap = "data/ui/art/hudfill.png";
useVariable = "0";
tile = "0";
position = "0 0";
extent = "700 64";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Press escape to cancel";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "247 34";
extent = "242 20";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Re-bind \"\" to...";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "177 8";
extent = "384 20";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiMenuButtonProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "OptRemapText";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,143 @@
function JoinServerMenu::onWake()
{
// Double check the status. Tried setting this the control
// inactive to start with, but that didn't seem to work.
JoinServerJoinBtn.setActive(JS_serverList.rowCount() > 0);
}
//----------------------------------------
function JoinServerMenu::query(%this)
{
queryMasterServer(
0, // Query flags
$Client::GameTypeQuery, // gameTypes
$Client::MissionTypeQuery, // missionType
0, // minPlayers
100, // maxPlayers
0, // maxBots
2, // regionMask
0, // maxPing
100, // minCPU
0 // filterFlags
);
}
//----------------------------------------
function JoinServerMenu::queryLan(%this)
{
queryLANServers(
$pref::Net::Port, // lanPort for local queries
0, // Query flags
$Client::GameTypeQuery, // gameTypes
$Client::MissionTypeQuery, // missionType
0, // minPlayers
100, // maxPlayers
0, // maxBots
2, // regionMask
0, // maxPing
100, // minCPU
0 // filterFlags
);
}
//----------------------------------------
function JoinServerMenu::cancel(%this)
{
cancelServerQuery();
JS_queryStatus.setVisible(false);
}
//----------------------------------------
function JoinServerMenu::join(%this)
{
cancelServerQuery();
%index = JS_serverList.getSelectedId();
JoinGame(%index);
}
//----------------------------------------
function JoinServerMenu::refresh(%this)
{
cancelServerQuery();
%index= JS_serverList.getSelectedId();
// The server info index is stored in the row along with the
// rest of displayed info.
if( setServerInfo( %index ) )
querySingleServer( $ServerInfo::Address, 0 );
}
//----------------------------------------
function JoinServerMenu::refreshSelectedServer( %this )
{
querySingleServer( $JoinGameAddress, 0 );
}
//----------------------------------------
function JoinServerMenu::exit(%this)
{
cancelServerQuery();
Canvas.popDialog(JoinServerMenu);
}
//----------------------------------------
function JoinServerMenu::update(%this)
{
// Copy the servers into the server list.
JS_queryStatus.setVisible(false);
JS_serverList.clear();
%sc = getServerCount();
for( %i = 0; %i < %sc; %i ++ ) {
setServerInfo(%i);
JS_serverList.addRow( %i,
$ServerInfo::Name TAB
$ServerInfo::Ping TAB
$ServerInfo::PlayerCount @ "/" @ $ServerInfo::MaxPlayers TAB
$ServerInfo::Version TAB
$ServerInfo::MissionName
);
}
JS_serverList.sort(0);
JS_serverList.setSelectedRow(0);
JS_serverList.scrollVisible(0);
JoinServerJoinBtn.setActive(JS_serverList.rowCount() > 0);
}
//----------------------------------------
function onServerQueryStatus(%status, %msg, %value)
{
echo("ServerQuery: " SPC %status SPC %msg SPC %value);
// Update query status
// States: start, update, ping, query, done
// value = % (0-1) done for ping and query states
if (!JS_queryStatus.isVisible())
JS_queryStatus.setVisible(true);
switch$ (%status) {
case "start":
JoinServerJoinBtn.setActive(false);
JoinServerQryInternetBtn.setActive(false);
JS_statusText.setText(%msg);
JS_statusBar.setValue(0);
JS_serverList.clear();
case "ping":
JS_statusText.setText("Ping Servers");
JS_statusBar.setValue(%value);
case "query":
JS_statusText.setText("Query Servers");
JS_statusBar.setValue(%value);
case "done":
JoinServerQryInternetBtn.setActive(true);
JS_queryStatus.setVisible(false);
JS_status.setText(%msg);
JoinServerMenu.update();
}
}

View file

@ -0,0 +1,41 @@
function MainMenuGui::onWake(%this)
{
if (isFunction("getWebDeployment") &&
getWebDeployment() &&
isObject(%this-->ExitButton))
%this-->ExitButton.setVisible(false);
MainMenuButtonContainer.hidden = false;
}
function MainMenuGui::openSinglePlayerMenu(%this)
{
$pref::HostMultiPlayer=false;
Canvas.pushDialog(ChooseLevelDlg);
ChooseLevelDlg.returnGui = %this;
MainMenuButtonContainer.hidden = true;
MainMenuAppLogo.setBitmap("data/ui/art/Torque-3D-logo");
}
function MainMenuGui::openMultiPlayerMenu(%this)
{
$pref::HostMultiPlayer=true;
Canvas.pushDialog(ChooseLevelDlg);
ChooseLevelDlg.returnGui = %this;
MainMenuButtonContainer.hidden = true;
MainMenuAppLogo.setBitmap("data/ui/art/Torque-3D-logo");
}
function MainMenuGui::openOptionsMenu(%this)
{
Canvas.pushDialog(OptionsMenu);
OptionsMenu.returnGui = %this;
MainMenuButtonContainer.hidden = true;
MainMenuAppLogo.setBitmap("data/ui/art/Torque-3D-logo");
}
function MainMenuGui::onReturnTo(%this)
{
MainMenuButtonContainer.hidden = false;
MainMenuAppLogo.setBitmap("data/ui/art/Torque-3D-logo-shortcut");
}

View file

@ -0,0 +1,301 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
// Cleanup Dialog created by 'core'
if( isObject( MessagePopupDlg ) )
MessagePopupDlg.delete();
if( isObject( MessageBoxYesNoDlg ) )
MessageBoxYesNoDlg.delete();
if( isObject( MessageBoxYesNoCancelDlg ) )
MessageBoxYesNoCancelDlg.delete();
if( isObject( MessageBoxOKCancelDetailsDlg ) )
MessageBoxOKCancelDetailsDlg.delete();
if( isObject( MessageBoxOKCancelDlg ) )
MessageBoxOKCancelDlg.delete();
if( isObject( MessageBoxOKDlg ) )
MessageBoxOKDlg.delete();
if( isObject( IODropdownDlg ) )
IODropdownDlg.delete();
// Load Editor Dialogs
exec("./guis/messageBoxOk.ed.gui");
exec("./guis/messageBoxYesNo.ed.gui");
// --------------------------------------------------------------------
// Message Sound
// --------------------------------------------------------------------
/*new SFXDescription(MessageBoxAudioDescription)
{
volume = 1.0;
isLooping = false;
is3D = false;
channel = $GuiAudioType;
};
new SFXProfile(messageBoxBeep)
{
filename = "./messageBoxSound";
description = MessageBoxAudioDescription;
preload = true;
};*/
//---------------------------------------------------------------------------------------------
// messageCallback
// Calls a callback passed to a message box.
//---------------------------------------------------------------------------------------------
function messageCallback(%dlg, %callback)
{
Canvas.popDialog(%dlg);
eval(%callback);
}
//The # in the function passed replaced with the output
//of the preset menu.
function IOCallback(%dlg, %callback)
{
%id = IODropdownMenu.getSelected();
%text = IODropdownMenu.getTextById(%id);
%callback = strreplace(%callback, "#", %text);
eval(%callback);
Canvas.popDialog(%dlg);
}
//---------------------------------------------------------------------------------------------
// MBSetText
// Sets the text of a message box and resizes it to accomodate the new string.
//---------------------------------------------------------------------------------------------
function MBSetText(%text, %frame, %msg)
{
// Get the extent of the text box.
%ext = %text.getExtent();
// Set the text in the center of the text box.
%text.setText("<just:center>" @ %msg);
// Force the textbox to resize itself vertically.
%text.forceReflow();
// Grab the new extent of the text box.
%newExtent = %text.getExtent();
// Get the vertical change in extent.
%deltaY = getWord(%newExtent, 1) - getWord(%ext, 1);
// Resize the window housing the text box.
%windowPos = %frame.getPosition();
%windowExt = %frame.getExtent();
%frame.resize(getWord(%windowPos, 0), getWord(%windowPos, 1) - (%deltaY / 2),
getWord(%windowExt, 0), getWord(%windowExt, 1) + %deltaY);
%frame.canMove = "0";
//%frame.canClose = "0";
%frame.resizeWidth = "0";
%frame.resizeHeight = "0";
%frame.canMinimize = "0";
%frame.canMaximize = "0";
//sfxPlayOnce( messageBoxBeep );
}
//---------------------------------------------------------------------------------------------
// Various message box display functions. Each one takes a window title, a message, and a
// callback for each button.
//---------------------------------------------------------------------------------------------
function MessageBoxOK(%title, %message, %callback)
{
MBOKFrame.text = %title;
Canvas.pushDialog(MessageBoxOKDlg);
MBSetText(MBOKText, MBOKFrame, %message);
MessageBoxOKDlg.callback = %callback;
}
function MessageBoxOKDlg::onSleep( %this )
{
%this.callback = "";
}
function MessageBoxOKCancel(%title, %message, %callback, %cancelCallback)
{
MBOKCancelFrame.text = %title;
Canvas.pushDialog(MessageBoxOKCancelDlg);
MBSetText(MBOKCancelText, MBOKCancelFrame, %message);
MessageBoxOKCancelDlg.callback = %callback;
MessageBoxOKCancelDlg.cancelCallback = %cancelCallback;
}
function MessageBoxOKCancelDlg::onSleep( %this )
{
%this.callback = "";
}
function MessageBoxOKCancelDetails(%title, %message, %details, %callback, %cancelCallback)
{
if(%details $= "")
{
MBOKCancelDetailsButton.setVisible(false);
}
MBOKCancelDetailsScroll.setVisible(false);
MBOKCancelDetailsFrame.setText( %title );
Canvas.pushDialog(MessageBoxOKCancelDetailsDlg);
MBSetText(MBOKCancelDetailsText, MBOKCancelDetailsFrame, %message);
MBOKCancelDetailsInfoText.setText(%details);
%textExtent = MBOKCancelDetailsText.getExtent();
%textExtentY = getWord(%textExtent, 1);
%textPos = MBOKCancelDetailsText.getPosition();
%textPosY = getWord(%textPos, 1);
%extentY = %textPosY + %textExtentY + 65;
MBOKCancelDetailsInfoText.setExtent(285, 128);
MBOKCancelDetailsFrame.setExtent(300, %extentY);
MessageBoxOKCancelDetailsDlg.callback = %callback;
MessageBoxOKCancelDetailsDlg.cancelCallback = %cancelCallback;
MBOKCancelDetailsFrame.defaultExtent = MBOKCancelDetailsFrame.getExtent();
}
function MBOKCancelDetailsToggleInfoFrame()
{
if(!MBOKCancelDetailsScroll.isVisible())
{
MBOKCancelDetailsScroll.setVisible(true);
MBOKCancelDetailsText.forceReflow();
%textExtent = MBOKCancelDetailsText.getExtent();
%textExtentY = getWord(%textExtent, 1);
%textPos = MBOKCancelDetailsText.getPosition();
%textPosY = getWord(%textPos, 1);
%verticalStretch = %textExtentY;
if((%verticalStretch > 260) || (%verticalStretch < 0))
%verticalStretch = 260;
%extent = MBOKCancelDetailsFrame.defaultExtent;
%height = getWord(%extent, 1);
%posY = %textPosY + %textExtentY + 10;
%posX = getWord(MBOKCancelDetailsScroll.getPosition(), 0);
MBOKCancelDetailsScroll.setPosition(%posX, %posY);
MBOKCancelDetailsScroll.setExtent(getWord(MBOKCancelDetailsScroll.getExtent(), 0), %verticalStretch);
MBOKCancelDetailsFrame.setExtent(300, %height + %verticalStretch + 10);
} else
{
%extent = MBOKCancelDetailsFrame.defaultExtent;
%width = getWord(%extent, 0);
%height = getWord(%extent, 1);
MBOKCancelDetailsFrame.setExtent(%width, %height);
MBOKCancelDetailsScroll.setVisible(false);
}
}
function MessageBoxOKCancelDetailsDlg::onSleep( %this )
{
%this.callback = "";
}
function MessageBoxYesNo(%title, %message, %yesCallback, %noCallback)
{
MBYesNoFrame.text = %title;
Canvas.pushDialog(MessageBoxYesNoDlg);
MBSetText(MBYesNoText, MBYesNoFrame, %message);
MessageBoxYesNoDlg.yesCallBack = %yesCallback;
MessageBoxYesNoDlg.noCallback = %noCallBack;
}
function MessageBoxYesNoCancel(%title, %message, %yesCallback, %noCallback, %cancelCallback)
{
MBYesNoCancelFrame.text = %title;
MessageBoxYesNoDlg.profile = "GuiOverlayProfile";
Canvas.pushDialog(MessageBoxYesNoCancelDlg);
MBSetText(MBYesNoCancelText, MBYesNoCancelFrame, %message);
MessageBoxYesNoCancelDlg.yesCallBack = %yesCallback;
MessageBoxYesNoCancelDlg.noCallback = %noCallBack;
MessageBoxYesNoCancelDlg.cancelCallback = %cancelCallback;
}
function MessageBoxYesNoDlg::onSleep( %this )
{
%this.yesCallback = "";
%this.noCallback = "";
}
//---------------------------------------------------------------------------------------------
// MessagePopup
// Displays a message box with no buttons. Disappears after %delay milliseconds.
//---------------------------------------------------------------------------------------------
function MessagePopup(%title, %message, %delay)
{
// Currently two lines max.
MessagePopFrame.setText(%title);
Canvas.pushDialog(MessagePopupDlg);
MBSetText(MessagePopText, MessagePopFrame, %message);
if (%delay !$= "")
schedule(%delay, 0, CloseMessagePopup);
}
//---------------------------------------------------------------------------------------------
// IODropdown
// By passing in a simgroup or simset, the user will be able to choose a child of that group
// through a guiPopupMenuCtrl
//---------------------------------------------------------------------------------------------
function IODropdown(%title, %message, %simgroup, %callback, %cancelCallback)
{
IODropdownFrame.text = %title;
Canvas.pushDialog(IODropdownDlg);
MBSetText(IODropdownText, IODropdownFrame, %message);
if(isObject(%simgroup))
{
for(%i = 0; %i < %simgroup.getCount(); %i++)
IODropdownMenu.add(%simgroup.getObject(%i).getName());
}
IODropdownMenu.sort();
IODropdownMenu.setFirstSelected(0);
IODropdownDlg.callback = %callback;
IODropdownDlg.cancelCallback = %cancelCallback;
}
function IODropdownDlg::onSleep( %this )
{
%this.callback = "";
%this.cancelCallback = "";
IODropdownMenu.clear();
}
function CloseMessagePopup()
{
Canvas.popDialog(MessagePopupDlg);
}

View file

@ -0,0 +1,437 @@
new SimGroup( MeshQualityGroup )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::TS::detailAdjust"] = 1.5;
key["$pref::TS::skipRenderDLs"] = 0;
};
new ArrayObject( )
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Medium";
key["$pref::TS::detailAdjust"] = 1.0;
key["$pref::TS::skipRenderDLs"] = 0;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::TS::detailAdjust"] = 0.75;
key["$pref::TS::skipRenderDLs"] = 0;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Lowest";
key["$pref::TS::detailAdjust"] = 0.5;
key["$pref::TS::skipRenderDLs"] = 1;
};
};
new SimGroup( TextureQualityGroup )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::Video::textureReductionLevel"] = 0;
key["$pref::Reflect::refractTexScale"] = 1.25;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Medium";
key["$pref::Video::textureReductionLevel"] = 0;
key["$pref::Reflect::refractTexScale"] = 1;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::Video::textureReductionLevel"] = 1;
key["$pref::Reflect::refractTexScale"] = 0.75;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Lowest";
key["$pref::Video::textureReductionLevel"] = 2;
key["$pref::Reflect::refractTexScale"] = 0.5;
};
};
new SimGroup( GroundCoverDensityGroup )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::GroundCover::densityScale"] = 1.0;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Medium";
key["$pref::GroundCover::densityScale"] = 0.75;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::GroundCover::densityScale"] = 0.5;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Lowest";
key["$pref::GroundCover::densityScale"] = 0.25;
};
};
new SimGroup( DecalLifetimeGroup )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::decalMgr::enabled"] = true;
key["$pref::Decals::lifeTimeScale"] = 1;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Medium";
key["$pref::decalMgr::enabled"] = true;
key["$pref::Decals::lifeTimeScale"] = 0.5;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::decalMgr::enabled"] = true;
key["$pref::Decals::lifeTimeScale"] = 0.25;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "None";
key["$pref::decalMgr::enabled"] = false;
};
};
new SimGroup( TerrainQualityGroup )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::Terrain::lodScale"] = 0.75;
key["$pref::Terrain::detailScale"] = 1.5;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Medium";
key["$pref::Terrain::lodScale"] = 1.0;
key["$pref::Terrain::detailScale"] = 1.0;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::Terrain::lodScale"] = 1.5;
key["$pref::Terrain::detailScale"] = 0.75;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Lowest";
key["$pref::Terrain::lodScale"] = 2.0;
key["$pref::Terrain::detailScale"] = 0.5;
};
};
//Shadows and Lighting
new SimGroup( ShadowQualityList )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::lightManager"] = "Advanced Lighting";
key["$pref::Shadows::disable"] = false;
key["$pref::Shadows::textureScalar"] = 1.0;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Medium";
key["$pref::lightManager"] = "Advanced Lighting";
key["$pref::Shadows::disable"] = false;
key["$pref::Shadows::textureScalar"] = 0.5;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::lightManager"] = "Advanced Lighting";
key["$pref::Shadows::disable"] = false;
key["$pref::Shadows::textureScalar"] = 0.25;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "None";
key["$pref::lightManager"] = "Advanced Lighting";
key["$pref::Shadows::disable"] = true;
key["$pref::Shadows::textureScalar"] = 0.5;
};
};
new SimGroup( ShadowDistanceList )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Highest";
key["$pref::Shadows::drawDistance"] = 2;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::Shadows::drawDistance"] = 1.5;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Medium";
key["$pref::Shadows::drawDistance"] = 1;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::Shadows::drawDistance"] = 0.5;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Lowest";
key["$pref::Shadows::drawDistance"] = 0.25;
};
};
new SimGroup( SoftShadowList )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::Shadows::filterMode"] = "SoftShadowHighQuality";
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::Shadows::filterMode"] = "SoftShadow";
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Off";
key["$pref::Shadows::filterMode"] = "None";
};
};
new SimGroup( LightDistanceList )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Highest";
key["$pref::Lights::drawDistance"] = 2;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::Lights::drawDistance"] = 1.5;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Medium";
key["$pref::Lights::drawDistance"] = 1;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::Lights::drawDistance"] = 0.5;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Lowest";
key["$pref::Lights::drawDistance"] = 0.25;
};
};
new SimGroup( ShaderQualityGroup )
{
class = "GraphicsOptionsMenuGroup";
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "High";
key["$pref::Video::disablePixSpecular"] = false;
key["$pref::Video::disableNormalmapping"] = false;
};
new ArrayObject()
{
class = "GraphicsQualityLevel";
caseSensitive = true;
displayName = "Low";
key["$pref::Video::disablePixSpecular"] = true;
key["$pref::Video::disableNormalmapping"] = true;
};
};

View file

@ -0,0 +1,473 @@
//options settings
//Screen and Display menu
//Renderer Mode
//Screen resolution
//Windowed/fullscreen(borderless?)
//VSync
//Screen brightness
//screen brightness
//screen gamma
//Lighting Menu
//Shadow Distance(Distance shadows are drawn to. Also affects shadowmap slices)
//Shadow Quality(Resolution of shadows rendered, setting to none disables dynamic shadows)
//Soft Shadows(Whether shadow softening is used)
//Shadow caching(If the lights enable it, shadow caching is activated)
//Light Draw Distance(How far away lights are still drawn. Doesn't impact vector lights like the sun)
//Mesh and Textures Menu
//Draw distance(Overall draw distance) -slider
//Object draw distance(Draw distance from small/unimportant objects) -slider
//Mesh quality
//Texture quality
//Foliage draw distance
//Terrain Quality
//Decal Quality
//Effects Menu
//Parallax
//HDR
//Light shafts
//Motion Blur
//Depth of Field
//SSAO
//AA(ModelXAmount)[defualt is FXAA]
//Anisotropic filtering
//Keybinds
//Camera
//horizontal mouse sensitivity
//vert mouse sensitivity
//invert vertical
//zoom mouse sensitivities(both horz/vert)
//headbob
//FOV
function OptionsMenu::onWake(%this)
{
OptionsMain.hidden = false;
ControlsMenu.hidden = true;
GraphicsMenu.hidden = true;
AudioMenu.hidden = true;
CameraMenu.hidden = true;
ScreenBrightnessMenu.hidden = true;
OptionsOKButton.hidden = false;
OptionsCancelButton.hidden = false;
OptionsDefaultsButton.hidden = false;
}
function OptionsMenuOKButton::onClick(%this)
{
//save the settings and then back out
OptionsMenu.backOut();
}
function OptionsMenuCancelButton::onClick(%this)
{
//we don't save, so go straight to backing out of the menu
OptionsMenu.backOut();
}
function OptionsMenuDefaultsButton::onClick(%this)
{
//we don't save, so go straight to backing out of the menu
OptionsMenu.backOut();
}
function ControlsSettingsMenuButton::onClick(%this)
{
OptionsMain.hidden = true;
ControlsMenu.hidden = false;
KeyboardControlPanel.hidden = false;
MouseControlPanel.hidden = true;
ControlsMenu.reload();
}
function GraphicsSettingsMenuButton::onClick(%this)
{
OptionsMain.hidden = true;
GraphicsMenu.hidden = false;
}
function CameraSettingsMenuButton::onClick(%this)
{
OptionsMain.hidden = true;
CameraMenu.hidden = false;
CameraMenu.loadSettings();
}
function AudioSettingsMenuButton::onClick(%this)
{
OptionsMain.hidden = true;
AudioMenu.hidden = false;
AudioMenu.loadSettings();
}
function ScreenBrSettingsMenuButton::onClick(%this)
{
OptionsMain.hidden = true;
ScreenBrightnessMenu.hidden = false;
}
function OptionsMenu::backOut(%this)
{
//save the settings and then back out
if(OptionsMain.hidden == false)
{
//we're not in a specific menu, so we're actually exiting
Canvas.popDialog(OptionsMenu);
if(isObject(OptionsMenu.returnGui) && OptionsMenu.returnGui.isMethod("onReturnTo"))
OptionsMenu.returnGui.onReturnTo();
}
else
{
OptionsMain.hidden = false;
ControlsMenu.hidden = true;
GraphicsMenu.hidden = true;
CameraMenu.hidden = true;
AudioMenu.hidden = true;
ScreenBrightnessMenu.hidden = true;
}
}
function OptionsMenu::addSettingOption(%this, %arrayTarget)
{
%graphicsOption = OptionsMenu.tamlReader.read("data/ui/scripts/guis/graphicsMenuSettingsCtrl.taml");
%arrayTarget.add(%graphicsOption);
return %graphicsOption;
}
function OptionsMenu::addSliderOption(%this, %arrayTarget, %range, %ticks, %variable, %value, %class)
{
%graphicsOption = OptionsMenu.tamlReader.read("data/ui/scripts/guis/graphicsMenuSettingsSlider.taml");
%arrayTarget.add(%graphicsOption);
if(%range !$= "")
{
%graphicsOption-->slider.range = %range;
}
if(%ticks !$= "")
{
%graphicsOption-->slider.ticks = %ticks;
}
if(%variable !$= "")
{
%graphicsOption-->slider.variable = %variable;
}
if(%value !$= "")
{
%graphicsOption-->slider.setValue(%value);
}
if(%class !$= "")
{
%graphicsOption-->slider.className = %class;
}
else
%graphicsOption-->slider.className = OptionsMenuSlider;
%graphicsOption-->slider.snap = true;
%graphicsOption-->slider.onValueSet();
return %graphicsOption;
}
function OptionsMenuSlider::onMouseDragged(%this)
{
%this.onValueSet();
}
function OptionsMenuSlider::onValueSet(%this)
{
%this.getParent().getParent()-->valueText.setText(mRound(%this.value * 10));
}
function FOVOptionSlider::onMouseDragged(%this)
{
%this.onValueSet();
}
function FOVOptionSlider::onValueSet(%this)
{
%this.getParent().getParent()-->valueText.setText(mRound(%this.value));
}
/// Returns true if the current quality settings equal
/// this graphics quality level.
function OptionsMenuSettingLevel::isCurrent( %this )
{
// Test each pref to see if the current value
// equals our stored value.
for ( %i=0; %i < %this.count(); %i++ )
{
%pref = %this.getKey( %i );
%value = %this.getValue( %i );
%prefVarValue = getVariable( %pref );
if ( getVariable( %pref ) !$= %value )
return false;
}
return true;
}
// =============================================================================
// CAMERA MENU
// =============================================================================
function CameraMenu::onWake(%this)
{
}
function CameraMenu::apply(%this)
{
setFOV($pref::Player::defaultFov);
}
function CameraMenu::loadSettings(%this)
{
CameraMenuOptionsArray.clear();
%option = OptionsMenu.addSettingOption(CameraMenuOptionsArray);
%option-->nameText.setText("Invert Vertical");
%option.qualitySettingGroup = InvertVerticalMouse;
%option.init();
%option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::VertMouseSensitivity", $pref::Input::VertMouseSensitivity);
%option-->nameText.setText("Vertical Sensitivity");
%option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::HorzMouseSensitivity", $pref::Input::HorzMouseSensitivity);
%option-->nameText.setText("Horizontal Sensitivity");
%option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::ZoomVertMouseSensitivity", $pref::Input::ZoomVertMouseSensitivity);
%option-->nameText.setText("Zoom Vertical Sensitivity");
%option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::ZoomHorzMouseSensitivity", $pref::Input::ZoomHorzMouseSensitivity);
%option-->nameText.setText("Zoom Horizontal Sensitivity");
%option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "65 90", 25, "$pref::Player::defaultFov", $pref::Player::defaultFov, FOVOptionSlider);
%option-->nameText.setText("Field of View");
CameraMenuOptionsArray.refresh();
}
function CameraMenuOKButton::onClick(%this)
{
//save the settings and then back out
CameraMenu.apply();
OptionsMenu.backOut();
}
function CameraMenuDefaultsButton::onClick(%this)
{
}
// =============================================================================
// AUDIO MENU
// =============================================================================
$AudioTestHandle = 0;
// Description to use for playing the volume test sound. This isn't
// played with the description of the channel that has its volume changed
// because we know nothing about the playback state of the channel. If it
// is paused or stopped, the test sound would not play then.
$AudioTestDescription = new SFXDescription()
{
sourceGroup = AudioChannelMaster;
};
function AudioMenu::loadSettings(%this)
{
// Audio
//OptAudioHardwareToggle.setStateOn($pref::SFX::useHardware);
//OptAudioHardwareToggle.setActive( true );
%this-->OptAudioVolumeMaster.setValue( $pref::SFX::masterVolume );
%this-->OptAudioVolumeShell.setValue( $pref::SFX::channelVolume[ $GuiAudioType] );
%this-->OptAudioVolumeSim.setValue( $pref::SFX::channelVolume[ $SimAudioType ] );
%this-->OptAudioVolumeMusic.setValue( $pref::SFX::channelVolume[ $MusicAudioType ] );
AudioMenuSoundDriver.clear();
%buffer = sfxGetAvailableDevices();
%count = getRecordCount( %buffer );
for(%i = 0; %i < %count; %i++)
{
%record = getRecord(%buffer, %i);
%provider = getField(%record, 0);
if ( AudioMenuSoundDriver.findText( %provider ) == -1 )
AudioMenuSoundDriver.add( %provider, %i );
}
AudioMenuSoundDriver.sort();
%selId = AudioMenuSoundDriver.findText($pref::SFX::provider);
if ( %selId == -1 )
AudioMenuSoundDriver.setFirstSelected();
else
AudioMenuSoundDriver.setSelected( %selId );
}
function AudioMenu::loadDevices(%this)
{
if(!isObject(SoundDeviceGroup))
{
new SimGroup( SoundDeviceGroup );
}
else
{
SoundDeviceGroup.clear();
}
%buffer = sfxGetAvailableDevices();
%count = getRecordCount( %buffer );
for (%i = 0; %i < %count; %i++)
{
%record = getRecord(%buffer, %i);
%provider = getField(%record, 0);
%device = getField(%record, 1);
if($pref::SFX::provider !$= %provider)
continue;
%setting = new ArrayObject()
{
class = "OptionsMenuSettingLevel";
caseSensitive = true;
displayName = %device;
key["$pref::SFX::Device"] = %device;
};
SoundDeviceGroup.add(%setting);
}
}
function AudioMenu::apply(%this)
{
sfxSetMasterVolume( $pref::SFX::masterVolume );
sfxSetChannelVolume( $GuiAudioType, $pref::SFX::channelVolume[ $GuiAudioType ] );
sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] );
sfxSetChannelVolume( $MusicAudioType, $pref::SFX::channelVolume[ $MusicAudioType ] );
if ( !sfxCreateDevice( $pref::SFX::provider,
$pref::SFX::device,
$pref::SFX::useHardware,
-1 ) )
error( "Unable to create SFX device: " @ $pref::SFX::provider
SPC $pref::SFX::device
SPC $pref::SFX::useHardware );
if( !isObject( $AudioTestHandle ) )
{
sfxPlay(menuButtonPressed);
}
}
function AudioMenuOKButton::onClick(%this)
{
//save the settings and then back out
AudioMenu.apply();
OptionsMenu.backOut();
}
function AudioMenuDefaultsButton::onClick(%this)
{
sfxInit();
AudioMenu.loadSettings();
}
function OptAudioUpdateMasterVolume( %volume )
{
if( %volume == $pref::SFX::masterVolume )
return;
sfxSetMasterVolume( %volume );
$pref::SFX::masterVolume = %volume;
if( !isObject( $AudioTestHandle ) )
$AudioTestHandle = sfxPlayOnce( AudioChannel, "art/sound/ui/volumeTest.wav" );
}
function OptAudioUpdateChannelVolume( %description, %volume )
{
%channel = sfxGroupToOldChannel( %description.sourceGroup );
if( %volume == $pref::SFX::channelVolume[ %channel ] )
return;
sfxSetChannelVolume( %channel, %volume );
$pref::SFX::channelVolume[ %channel ] = %volume;
if( !isObject( $AudioTestHandle ) )
{
$AudioTestDescription.volume = %volume;
$AudioTestHandle = sfxPlayOnce( $AudioTestDescription, "art/sound/ui/volumeTest.wav" );
}
}
function AudioMenuSoundDriver::onSelect( %this, %id, %text )
{
// Skip empty provider selections.
if ( %text $= "" )
return;
$pref::SFX::provider = %text;
AudioMenuSoundDevice.clear();
%buffer = sfxGetAvailableDevices();
%count = getRecordCount( %buffer );
for(%i = 0; %i < %count; %i++)
{
%record = getRecord(%buffer, %i);
%provider = getField(%record, 0);
%device = getField(%record, 1);
if (%provider !$= %text)
continue;
if ( AudioMenuSoundDevice.findText( %device ) == -1 )
AudioMenuSoundDevice.add( %device, %i );
}
// Find the previous selected device.
%selId = AudioMenuSoundDevice.findText($pref::SFX::device);
if ( %selId == -1 )
AudioMenuSoundDevice.setFirstSelected();
else
AudioMenuSoundDevice.setSelected( %selId );
}
function AudioMenuSoundDevice::onSelect( %this, %id, %text )
{
// Skip empty selections.
if ( %text $= "" )
return;
$pref::SFX::device = %text;
if ( !sfxCreateDevice( $pref::SFX::provider,
$pref::SFX::device,
$pref::SFX::useHardware,
-1 ) )
error( "Unable to create SFX device: " @ $pref::SFX::provider
SPC $pref::SFX::device
SPC $pref::SFX::useHardware );
}

View file

@ -0,0 +1,30 @@
function PauseMenu::onWake(%this)
{
$timescale = 0;
}
function PauseMenu::onSleep(%this)
{
$timescale = 1;
}
function PauseMenu::openOptionsMenu(%this)
{
Canvas.pushDialog(OptionsMenu);
OptionsMenu.returnGui = %this;
PauseOptionsMain.hidden = true;
}
function PauseMenu::openControlsMenu(%this)
{
Canvas.pushDialog(OptionsMenu);
OptionsMenu.returnGui = %this;
PauseOptionsMain.hidden = true;
OptionsMain.hidden = true;
ControlsMenu.hidden = false;
}
function PauseMenu::onReturnTo(%this)
{
PauseOptionsMain.hidden = false;
}

View file

@ -0,0 +1,429 @@
if( !isObject( GuiMenuButtonProfile ) )
new GuiControlProfile( GuiMenuButtonProfile )
{
opaque = true;
border = false;
fontSize = 18;
fontType = "Arial Bold";
fontColor = "240 240 240";
fontColorHL = "0 0 0";
fontColorNA = "125 125 125";
//fontColorSEL ="0 0 0";
fixedExtent = false;
justify = "center";
canKeyFocus = false;
bitmap = "data/ui/art/menu-button";
hasBitmapArray = false;
soundButtonDown = menuButtonPressed;
soundButtonOver = menuButtonHover;
category = "Core";
};
if( !isObject( GuiHighlightMenuButtonProfile ) )
new GuiControlProfile( GuiHighlightMenuButtonProfile )
{
opaque = true;
border = false;
fontSize = 18;
fontType = "Arial Bold";
fontColor = "240 240 240";
fontColorHL = "0 0 0";
fontColorNA = "125 125 125";
//fontColorSEL ="0 0 0";
fixedExtent = false;
justify = "center";
canKeyFocus = false;
bitmap = "data/ui/art/selector-button-highlight-only";
hasBitmapArray = false;
category = "Core";
};
if( !isObject( GuiBlankMenuButtonProfile ) )
new GuiControlProfile( GuiBlankMenuButtonProfile )
{
opaque = true;
border = false;
fontSize = 18;
fontType = "Arial Bold";
fontColor = "200 200 200";
fontColorHL = "255 255 255";
fontColorNA = "200 200 200";
//fontColorSEL ="0 0 0";
fixedExtent = false;
justify = "center";
canKeyFocus = false;
bitmap = "data/ui/art/selector-button-blank";
hasBitmapArray = false;
soundButtonDown = menuButtonPressed;
soundButtonOver = menuButtonHover;
category = "Core";
};
if( !isObject( GuiMenuTextProfile ) )
new GuiControlProfile( GuiMenuTextProfile )
{
opaque = true;
border = false;
fontSize = 18;
fontType = "Arial Bold";
fontColor = "240 240 240";
fontColorHL = "0 0 0";
fontColorNA = "125 125 125";
fixedExtent = false;
justify = "center";
category = "Core";
};
if( !isObject( GuiSolidDefaultProfile ) )
new GuiControlProfile (GuiSolidDefaultProfile)
{
opaque = true;
border = true;
category = "Core";
};
if( !isObject( GuiTransparentProfile ) )
new GuiControlProfile (GuiTransparentProfile)
{
opaque = false;
border = false;
category = "Core";
};
if( !isObject( GuiGroupBorderProfile ) )
new GuiControlProfile( GuiGroupBorderProfile )
{
border = false;
opaque = false;
hasBitmapArray = true;
bitmap = "data/ui/art/group-border";
category = "Core";
};
if( !isObject( GuiTabBorderProfile ) )
new GuiControlProfile( GuiTabBorderProfile )
{
border = false;
opaque = false;
hasBitmapArray = true;
bitmap = "data/ui/art/tab-border";
category = "Core";
};
if( !isObject( GuiModelessDialogProfile ) )
new GuiControlProfile( GuiModelessDialogProfile )
{
modal = false;
category = "Core";
};
if( !isObject( GuiFrameSetProfile ) )
new GuiControlProfile (GuiFrameSetProfile)
{
fillcolor = "255 255 255";
borderColor = "246 245 244";
border = 1;
opaque = true;
border = true;
category = "Core";
};
if( !isObject( GuiInputCtrlProfile ) )
new GuiControlProfile( GuiInputCtrlProfile )
{
tab = true;
canKeyFocus = true;
category = "Core";
};
if( !isObject( GuiTextProfile ) )
new GuiControlProfile (GuiTextProfile)
{
justify = "left";
fontColor = "20 20 20";
category = "Core";
};
if( !isObject( GuiTextRightProfile ) )
new GuiControlProfile (GuiTextRightProfile : GuiTextProfile)
{
justify = "right";
category = "Core";
};
if( !isObject( GuiAutoSizeTextProfile ) )
new GuiControlProfile (GuiAutoSizeTextProfile)
{
fontColor = "0 0 0";
autoSizeWidth = true;
autoSizeHeight = true;
category = "Core";
};
if( !isObject( GuiMediumTextProfile ) )
new GuiControlProfile( GuiMediumTextProfile : GuiTextProfile )
{
fontSize = 24;
category = "Core";
};
if( !isObject( GuiBigTextProfile ) )
new GuiControlProfile( GuiBigTextProfile : GuiTextProfile )
{
fontSize = 36;
category = "Core";
};
if( !isObject( GuiMLTextProfile ) )
new GuiControlProfile( GuiMLTextProfile )
{
fontColorLink = "100 100 100";
fontColorLinkHL = "255 255 255";
autoSizeWidth = true;
autoSizeHeight = true;
border = false;
category = "Core";
};
if( !isObject( GuiMLWhiteTextProfile ) )
new GuiControlProfile( GuiMLWhiteTextProfile )
{
fontColor = "220 220 220";
fontColorHL = "255 255 255";
autoSizeWidth = true;
autoSizeHeight = true;
border = false;
category = "Core";
};
if( !isObject( GuiTextArrayProfile ) )
new GuiControlProfile( GuiTextArrayProfile : GuiTextProfile )
{
fontColor = "250 250 250";
fontColorHL = " 0 0 0";
fontColorSEL = "0 0 0";
fillColor ="50 50 50";
fillColorHL = "125 125 125";
fillColorSEL = "180 180 180";
border = false;
category = "Core";
};
// ----------------------------------------------------------------------------
// TODO: Revisit Popupmenu
// ----------------------------------------------------------------------------
if( !isObject( GuiPopupMenuItemBorder ) )
new GuiControlProfile( GuiPopupMenuItemBorder : GuiButtonProfile )
{
opaque = true;
border = true;
fontColor = "0 0 0";
fontColorHL = "0 0 0";
fontColorNA = "255 255 255";
fixedExtent = false;
justify = "center";
canKeyFocus = false;
bitmap = "data/ui/art/button";
category = "Core";
};
if( !isObject( GuiPopUpMenuDefault ) )
new GuiControlProfile( GuiPopUpMenuDefault : GuiDefaultProfile )
{
opaque = true;
mouseOverSelected = true;
textOffset = "3 3";
border = 0;
borderThickness = 0;
fixedExtent = true;
bitmap = "data/ui/art/scrollBar";
hasBitmapArray = true;
profileForChildren = GuiPopupMenuItemBorder;
fillColor = "242 241 240 ";//"255 255 255";//100
fillColorHL = "228 228 235 ";//"204 203 202";
fillColorSEL = "98 100 137 ";//"204 203 202";
// font color is black
fontColorHL = "0 0 0 ";//"0 0 0";
fontColorSEL = "255 255 255";//"0 0 0";
borderColor = "100 100 100";
category = "Core";
};
if( !isObject( GuiPopUpMenuProfile ) )
new GuiControlProfile( GuiPopUpMenuProfile : GuiPopUpMenuDefault )
{
textOffset = "6 4";
bitmap = "data/ui/art/dropDown";
hasBitmapArray = true;
border = 1;
profileForChildren = GuiPopUpMenuDefault;
category = "Core";
};
if( !isObject( GuiTabBookProfile ) )
new GuiControlProfile( GuiTabBookProfile )
{
fillColorHL = "100 100 100";
fillColorNA = "150 150 150";
fontColor = "30 30 30";
fontColorHL = "0 0 0";
fontColorNA = "50 50 50";
fontType = "Arial";
fontSize = 14;
justify = "center";
bitmap = "data/ui/art/tab";
tabWidth = 64;
tabHeight = 24;
tabPosition = "Top";
tabRotation = "Horizontal";
textOffset = "0 -3";
tab = true;
cankeyfocus = true;
category = "Core";
};
if( !isObject( GuiTabPageProfile ) )
new GuiControlProfile( GuiTabPageProfile : GuiDefaultProfile )
{
fontType = "Arial";
fontSize = 10;
justify = "center";
bitmap = "data/ui/art/tab";
opaque = false;
fillColor = "240 239 238";
category = "Core";
};
if( !isObject( GuiConsoleProfile ) )
new GuiControlProfile( GuiConsoleProfile )
{
fontType = ($platform $= "macos") ? "Monaco" : "Lucida Console";
fontSize = ($platform $= "macos") ? 13 : 12;
fontColor = "255 255 255";
fontColorHL = "0 255 255";
fontColorNA = "255 0 0";
fontColors[6] = "100 100 100";
fontColors[7] = "100 100 0";
fontColors[8] = "0 0 100";
fontColors[9] = "0 100 0";
category = "Core";
};
if( !isObject( GuiConsoleTextProfile ) )
new GuiControlProfile( GuiConsoleTextProfile )
{
fontColor = "0 0 0";
autoSizeWidth = true;
autoSizeHeight = true;
textOffset = "2 2";
opaque = true;
fillColor = "255 255 255";
border = true;
borderThickness = 1;
borderColor = "0 0 0";
category = "Core";
};
$ConsoleDefaultFillColor = "0 0 0 175";
if( !isObject( ConsoleScrollProfile ) )
new GuiControlProfile( ConsoleScrollProfile : GuiScrollProfile )
{
opaque = true;
fillColor = $ConsoleDefaultFillColor;
border = 1;
//borderThickness = 0;
borderColor = "0 0 0";
category = "Core";
};
if( !isObject( ConsoleTextEditProfile ) )
new GuiControlProfile( ConsoleTextEditProfile : GuiTextEditProfile )
{
fillColor = "242 241 240 255";
fillColorHL = "255 255 255";
category = "Core";
};
//-----------------------------------------------------------------------------
// Center and bottom print
//-----------------------------------------------------------------------------
if( !isObject( CenterPrintProfile ) )
new GuiControlProfile ( CenterPrintProfile )
{
opaque = false;
fillColor = "128 128 128";
fontColor = "0 255 0";
border = true;
borderColor = "0 255 0";
category = "Core";
};
if( !isObject( CenterPrintTextProfile ) )
new GuiControlProfile ( CenterPrintTextProfile )
{
opaque = false;
fontType = "Arial";
fontSize = 12;
fontColor = "0 255 0";
category = "Core";
};
// ----------------------------------------------------------------------------
// Radio button control
// ----------------------------------------------------------------------------
if( !isObject( GuiRadioProfile ) )
new GuiControlProfile( GuiRadioProfile )
{
fontSize = 14;
fillColor = "232 232 232";
fontColor = "20 20 20";
fontColorHL = "80 80 80";
fixedExtent = true;
bitmap = "data/ui/art/radioButton";
hasBitmapArray = true;
category = "Core";
};
// ---------------------------------------------------------------------------
// Slider control
// ---------------------------------------------------------------------------
if( !isObject( GuiSliderProfile ) )
new GuiControlProfile( GuiSliderProfile )
{
bitmap = "data/ui/art/slider";
category = "Core";
};
//
// Scroll Profile
//
if(!isObject(GuiMenuScrollProfile))
new GuiControlProfile(GuiMenuScrollProfile)
{
opaque = true;
fillcolor = "50 50 50";
fontColor = "200 200 200";
fontColorHL = "250 250 250";
border = true;
bitmap = "data/ui/art/scrollBar";
hasBitmapArray = true;
category = "Core";
};
// Scroll
if(!isObject(GuiMenuScrollProfile))
new GuiControlProfile(GuiMenuScrollProfile)
{
opaque = true;
fillcolor = "128 128 128";
fontColor = "0 0 0";
fontColorHL = "150 150 150";
border = true;
bitmap = "./images/scrollBar";
hasBitmapArray = true;
category = "Core";
};

Binary file not shown.

Binary file not shown.