Initial commit
29
Torque/SDK/example/demo/client/config.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
// Torque Input Map File
|
||||
moveMap.delete();
|
||||
new ActionMap(moveMap);
|
||||
moveMap.bindCmd(keyboard, "escape", "", "escapeFromGame();");
|
||||
moveMap.bind(keyboard, "f2", showPlayerList);
|
||||
moveMap.bind(keyboard, "a", moveleft);
|
||||
moveMap.bind(keyboard, "d", moveright);
|
||||
moveMap.bind(keyboard, "w", moveforward);
|
||||
moveMap.bind(keyboard, "s", movebackward);
|
||||
moveMap.bind(keyboard, "space", jump);
|
||||
moveMap.bind(keyboard, "r", setZoomFOV);
|
||||
moveMap.bind(keyboard, "e", toggleZoom);
|
||||
moveMap.bind(keyboard, "z", toggleFreeLook);
|
||||
moveMap.bind(keyboard, "tab", toggleFirstPerson);
|
||||
moveMap.bind(keyboard, "alt c", toggleCamera);
|
||||
moveMap.bind(keyboard, "ctrl w", celebrationWave);
|
||||
moveMap.bind(keyboard, "ctrl s", celebrationSalute);
|
||||
moveMap.bind(keyboard, "ctrl k", suicide);
|
||||
moveMap.bindCmd(keyboard, "1", "commandToServer(\'use\',\"Crossbow\");", "");
|
||||
moveMap.bind(keyboard, "u", toggleMessageHud);
|
||||
moveMap.bind(keyboard, "pageup", pageMessageHudUp);
|
||||
moveMap.bind(keyboard, "pagedown", pageMessageHudDown);
|
||||
moveMap.bind(keyboard, "p", resizeMessageHud);
|
||||
moveMap.bind(keyboard, "f8", dropCameraAtPlayer);
|
||||
moveMap.bind(keyboard, "f7", dropPlayerAtCamera);
|
||||
moveMap.bind(keyboard, "ctrl o", bringUpOptions);
|
||||
moveMap.bind(mouse0, "xaxis", yaw);
|
||||
moveMap.bind(mouse0, "yaxis", pitch);
|
||||
moveMap.bind(mouse0, "button0", mouseFire);
|
||||
69
Torque/SDK/example/demo/client/defaults.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// The master server is declared with the server defaults, which is
|
||||
// loaded on both clients & dedicated servers. If the server mod
|
||||
// is not loaded on a client, then the master must be defined.
|
||||
// $pref::Master[0] = "2:master.garagegames.com:28002";
|
||||
|
||||
$pref::Player::Name = "Visitor";
|
||||
$pref::Player::defaultFov = 90;
|
||||
$pref::Player::zoomSpeed = 0;
|
||||
|
||||
$pref::Net::LagThreshold = 400;
|
||||
$pref::Net::Port = 28000;
|
||||
|
||||
$pref::shadows = "2";
|
||||
$pref::HudMessageLogSize = 40;
|
||||
$pref::ChatHudLength = 1;
|
||||
|
||||
|
||||
$pref::Input::LinkMouseSensitivity = 1;
|
||||
$pref::Input::MouseEnabled = 0;
|
||||
$pref::Input::JoystickEnabled = 0;
|
||||
$pref::Input::KeyboardTurnSpeed = 0.1;
|
||||
|
||||
$pref::sceneLighting::cacheSize = 20000;
|
||||
$pref::sceneLighting::purgeMethod = "lastCreated";
|
||||
$pref::sceneLighting::cacheLighting = 1;
|
||||
$pref::sceneLighting::terrainGenerateLevel = 1;
|
||||
|
||||
$pref::ts::detailAdjust = 0.45;
|
||||
|
||||
$pref::Terrain::DynamicLights = 1;
|
||||
$pref::Interior::TexturedFog = 0;
|
||||
|
||||
$pref::Video::displayDevice = "OpenGL";
|
||||
$pref::Video::allowOpenGL = 1;
|
||||
$pref::Video::allowD3D = 1;
|
||||
$pref::Video::preferOpenGL = 1;
|
||||
$pref::Video::appliedPref = 0;
|
||||
$pref::Video::disableVerticalSync = 1;
|
||||
$pref::Video::monitorNum = 0;
|
||||
$pref::Video::windowedRes = "800 600";
|
||||
$pref::Video::fullScreen = "0";
|
||||
$Pref::Video::Resolution = "800 600 32";
|
||||
|
||||
$pref::Video::screenShotSession = 0;
|
||||
$pref::Video::screenShotFormat = "PNG";
|
||||
|
||||
$pref::OpenGL::force16BitTexture = "0";
|
||||
$pref::OpenGL::forcePalettedTexture = "0";
|
||||
$pref::OpenGL::maxHardwareLights = 3;
|
||||
$pref::VisibleDistanceMod = 1.0;
|
||||
|
||||
$pref::Audio::driver = "OpenAL";
|
||||
$pref::Audio::forceMaxDistanceUpdate = 0;
|
||||
$pref::Audio::environmentEnabled = 0;
|
||||
$pref::Audio::masterVolume = 0.8;
|
||||
$pref::Audio::channelVolume1 = 0.8;
|
||||
$pref::Audio::channelVolume2 = 0.8;
|
||||
$pref::Audio::channelVolume3 = 0.8;
|
||||
$pref::Audio::channelVolume4 = 0.8;
|
||||
$pref::Audio::channelVolume5 = 0.8;
|
||||
$pref::Audio::channelVolume6 = 0.8;
|
||||
$pref::Audio::channelVolume7 = 0.8;
|
||||
$pref::Audio::channelVolume8 = 0.8;
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/defaults.cs.dso
Normal file
244
Torque/SDK/example/demo/client/init.cs
Normal file
@@ -0,0 +1,244 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Variables used by client scripts & code. The ones marked with (c)
|
||||
// are accessed from code. Variables preceeded by Pref:: are client
|
||||
// preferences and stored automatically in the ~/client/prefs.cs file
|
||||
// in between sessions.
|
||||
//
|
||||
// (c) Client::MissionFile Mission file name
|
||||
// ( ) Client::Password Password for server join
|
||||
|
||||
// (?) Pref::Player::CurrentFOV
|
||||
// (?) Pref::Player::DefaultFov
|
||||
// ( ) Pref::Input::KeyboardTurnSpeed
|
||||
|
||||
// (c) pref::Master[n] List of master servers
|
||||
// (c) pref::Net::RegionMask
|
||||
// (c) pref::Client::ServerFavoriteCount
|
||||
// (c) pref::Client::ServerFavorite[FavoriteCount]
|
||||
// .. Many more prefs... need to finish this off
|
||||
|
||||
// Moves, not finished with this either...
|
||||
// (c) firstPerson
|
||||
// $mv*Action...
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function initClient()
|
||||
{
|
||||
echo("\n--------- Initializing MOD: Torque Demo Client ---------");
|
||||
|
||||
// Make sure this variable reflects the correct state.
|
||||
$Server::Dedicated = false;
|
||||
|
||||
// Game information used to query the master server
|
||||
$CLient::GameType = "";
|
||||
$Client::GameTypeQuery = "";
|
||||
$Client::MissionTypeQuery = "Any";
|
||||
|
||||
//
|
||||
exec("./ui/customProfiles.cs"); // override the base profiles if necessary
|
||||
|
||||
// The common module provides basic client functionality
|
||||
initBaseClient();
|
||||
|
||||
// Always start up the shell in 800x600. If the pref is not set, then it
|
||||
// will defaul to 800x600 in the platform code.
|
||||
if ($Pref::Video::Resolution !$= "") {
|
||||
$width = getWord($pref::Video::resolution,0);
|
||||
if ($width < 800) {
|
||||
$pref::Video::resolution = "800 600" SPC getWord($pref::Video::resolution,2);
|
||||
echo("Forcing resolution to 800 x 600");
|
||||
}
|
||||
}
|
||||
|
||||
// InitCanvas starts up the graphics system.
|
||||
// The canvas needs to be constructed before the gui scripts are
|
||||
// run because many of the controls assume the canvas exists at
|
||||
// load time.
|
||||
initCanvas("Torque Game Engine");
|
||||
|
||||
/// Load client-side Audio Profiles/Descriptions
|
||||
exec("./scripts/audioProfiles.cs");
|
||||
|
||||
// Load up the Game GUIs
|
||||
exec("./ui/defaultGameProfiles.cs");
|
||||
exec("./ui/PlayGui.gui");
|
||||
exec("./ui/FpsGui.gui");
|
||||
exec("./ui/RacingGui.gui");
|
||||
exec("./ui/SceneGui.gui");
|
||||
exec("./ui/PageGui.gui");
|
||||
exec("./ui/ChatHud.gui");
|
||||
exec("./ui/playerList.gui");
|
||||
|
||||
// Load up the shell GUIs
|
||||
exec("./ui/overlayDlg.gui");
|
||||
exec("./ui/mainMenuGui.gui");
|
||||
exec("./ui/aboutDlg.gui");
|
||||
exec("./ui/startMissionGui.gui");
|
||||
exec("./ui/joinServerGui.gui");
|
||||
exec("./ui/loadingGui.gui");
|
||||
exec("./ui/endGameGui.gui");
|
||||
exec("./ui/optionsDlg.gui");
|
||||
exec("./ui/remapDlg.gui");
|
||||
exec("./ui/StartupGui.gui");
|
||||
exec("./ui/ProductGui.gui");
|
||||
|
||||
// Demo page & scene gui
|
||||
exec("./ui/MainMenuDlg.gui");
|
||||
exec("./ui/overview_main.gui");
|
||||
|
||||
exec("./ui/features/features_main.gui");
|
||||
exec("./ui/features/features_script.gui");
|
||||
exec("./ui/features/features_gui.gui");
|
||||
exec("./ui/features/features_net.gui");
|
||||
exec("./ui/features/features_render.gui");
|
||||
exec("./ui/features/features_terrain.gui");
|
||||
exec("./ui/features/features_interior.gui");
|
||||
exec("./ui/features/features_mesh.gui");
|
||||
exec("./ui/features/features_water.gui");
|
||||
exec("./ui/features/features_sound.gui");
|
||||
|
||||
exec("./ui/platform/platform_T2D.gui");
|
||||
exec("./ui/platform/platform_TSE.gui");
|
||||
exec("./ui/platform/platform_console.gui");
|
||||
exec("./ui/platform/platform_TNL.gui");
|
||||
|
||||
exec("./ui/tools/tools_main.gui");
|
||||
exec("./ui/tools/tools_gui.gui");
|
||||
exec("./ui/tools/tools_world.gui");
|
||||
exec("./ui/tools/tools_terrain.gui");
|
||||
exec("./ui/tools/tools_texture.gui");
|
||||
exec("./ui/tools/tools_heightfield.gui");
|
||||
exec("./ui/tools/tools_showtool_pro.gui");
|
||||
exec("./ui/tools/tools_rts_kit.gui");
|
||||
exec("./ui/tools/tools_lighting_kit.gui");
|
||||
exec("./ui/tools/tools_content_packs.gui");
|
||||
exec("./ui/tools/tools_books_docs.gui");
|
||||
|
||||
|
||||
exec("./ui/products/product_main.gui");
|
||||
exec("./ui/products/product_tribes2.gui");
|
||||
exec("./ui/products/product_hunting.gui");
|
||||
exec("./ui/products/product_marbleblast.gui");
|
||||
exec("./ui/products/product_thinktanks.gui");
|
||||
exec("./ui/products/product_tenniscritters.gui");
|
||||
exec("./ui/products/product_orbz.gui");
|
||||
exec("./ui/products/product_marbleblastultra.gui");
|
||||
|
||||
exec("./ui/testimonials/community.gui");
|
||||
exec("./ui/testimonials/testimonials_main.gui");
|
||||
|
||||
exec("./ui/license/publishing.gui");
|
||||
exec("./ui/license/license_main.gui");
|
||||
exec("./ui/license/license_indie.gui");
|
||||
exec("./ui/license/license_corp.gui");
|
||||
exec("./ui/license/license_other.gui");
|
||||
|
||||
exec("./ui/garagegames/garagegames_main.gui");
|
||||
|
||||
exec("./ui/theora/theora_main.gui");
|
||||
|
||||
exec("./ui/AnimationSceneGui.gui");
|
||||
exec("./ui/DetailSceneGui.gui");
|
||||
exec("./ui/MountingSceneGui.gui");
|
||||
|
||||
exec("./ui/DemoEditorAlert.gui");
|
||||
|
||||
|
||||
// Client scripts
|
||||
exec("./scripts/client.cs");
|
||||
exec("./scripts/game.cs");
|
||||
exec("./scripts/missionDownload.cs");
|
||||
exec("./scripts/serverConnection.cs");
|
||||
exec("./scripts/playerList.cs");
|
||||
exec("./scripts/loadingGui.cs");
|
||||
exec("./scripts/optionsDlg.cs");
|
||||
exec("./scripts/chatHud.cs");
|
||||
exec("./scripts/messageHud.cs");
|
||||
exec("./scripts/mainMenuGui.cs");
|
||||
exec("./scripts/playGui.cs");
|
||||
exec("./scripts/fpsGui.cs");
|
||||
exec("./scripts/racingGui.cs");
|
||||
exec("./scripts/sceneGui.cs");
|
||||
exec("./scripts/joinServerGui.cs");
|
||||
exec("./scripts/startMissionGui.cs");
|
||||
exec("./scripts/centerPrint.cs");
|
||||
exec("./scripts/DemoEditorAlert.cs");
|
||||
|
||||
|
||||
// load menu thread data
|
||||
exec("./menu_threads.cs");
|
||||
|
||||
// Default player key bindings
|
||||
exec("./scripts/default.bind.cs");
|
||||
exec("./config.cs");
|
||||
|
||||
// Really shouldn't be starting the networking unless we are
|
||||
// going to connect to a remote server, or host a multi-player
|
||||
// game.
|
||||
setNetPort(0);
|
||||
|
||||
// Copy saved script prefs into C++ code.
|
||||
setShadowDetailLevel( $pref::shadows );
|
||||
setDefaultFov( $pref::Player::defaultFov );
|
||||
setZoomSpeed( $pref::Player::zoomSpeed );
|
||||
|
||||
// Start up the main menu... this is separated out into a
|
||||
// method for easier mod override.
|
||||
|
||||
if ($JoinGameAddress !$= "") {
|
||||
// If we are instantly connecting to an address, load the
|
||||
// main menu then attempt the connect.
|
||||
loadMainMenu();
|
||||
connect($JoinGameAddress, "", $Pref::Player::Name);
|
||||
}
|
||||
else {
|
||||
// Otherwise go to the splash screen.
|
||||
Canvas.setCursor("DefaultCursor");
|
||||
loadStartup();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function loadMainMenu()
|
||||
{
|
||||
// Startup the client with the Main menu...
|
||||
Canvas.setContent( MainMenuGui );
|
||||
checkAudioInit();
|
||||
|
||||
Canvas.setCursor("DefaultCursor");
|
||||
}
|
||||
|
||||
function loadFeatureMission()
|
||||
{
|
||||
// Display the loading GUI
|
||||
Canvas.setContent(LoadingGui);
|
||||
LOAD_MapName.setText( "Creating Feature Game" );
|
||||
LOAD_MapDescription.setText( "<font:Arial:16>Please wait while the feature game is started...");
|
||||
Canvas.repaint();
|
||||
|
||||
// Start up the server..
|
||||
createServer("SinglePlayer", "demo/data/missions/features.mis");
|
||||
%conn = new GameConnection(ServerConnection);
|
||||
RootGroup.add(ServerConnection);
|
||||
%conn.setConnectArgs($pref::Player::Name);
|
||||
%conn.setJoinPassword($Client::Password);
|
||||
%conn.connectLocal();
|
||||
}
|
||||
|
||||
function checkAudioInit()
|
||||
{
|
||||
if($Audio::initFailed)
|
||||
{
|
||||
MessageBoxOK("Audio Initialization Failed",
|
||||
"The OpenAL audio system failed to initialize. " @
|
||||
"You can get the most recent OpenAL drivers <a:www.garagegames.com/docs/torque/gstarted/openal.html>here</a>.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/init.cs.dso
Normal file
109
Torque/SDK/example/demo/client/menu_threads.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
|
||||
// Stack used to track what gui thread we are viewing
|
||||
new SimSet(menu_thread_stack);
|
||||
|
||||
// Define various topic threads
|
||||
|
||||
new SimSet(main_menu_thread);
|
||||
main_menu_thread.add(MainMenuDlg);
|
||||
|
||||
new SimSet(overview_thread);
|
||||
overview_thread.add(overview_main);
|
||||
|
||||
new SimSet(features_thread);
|
||||
features_thread.add(features_main);
|
||||
features_thread.add(features_script);
|
||||
features_thread.add(features_gui);
|
||||
features_thread.add(features_net);
|
||||
features_thread.add(features_render);
|
||||
features_thread.add(features_terrain);
|
||||
features_thread.add(features_interior);
|
||||
features_thread.add(features_mesh);
|
||||
features_thread.add(features_water);
|
||||
features_thread.add(features_sound);
|
||||
|
||||
new SimSet(platform_thread);
|
||||
platform_thread.add(platform_T2D);
|
||||
platform_thread.add(platform_TSE);
|
||||
|
||||
new SimSet(tools_thread);
|
||||
tools_thread.add(tools_main);
|
||||
tools_thread.add(tools_gui);
|
||||
tools_thread.add(tools_world);
|
||||
tools_thread.add(tools_heightfield);
|
||||
tools_thread.add(tools_texture);
|
||||
tools_thread.add(tools_terrain);
|
||||
tools_thread.add(tools_showtool_pro);
|
||||
tools_thread.add(tools_rts_kit);
|
||||
tools_thread.add(tools_lighting_kit);
|
||||
tools_thread.add(tools_content_packs);
|
||||
tools_thread.add(tools_books_docs);
|
||||
|
||||
new SimSet(products_thread);
|
||||
products_thread.add(product_main);
|
||||
products_thread.add(product_tribes2);
|
||||
products_thread.add(product_hunting);
|
||||
products_thread.add(product_marbleblast);
|
||||
products_thread.add(product_thinktanks);
|
||||
products_thread.add(product_tenniscritters);
|
||||
products_thread.add(product_orbz);
|
||||
|
||||
new SimSet(testimonials_thread);
|
||||
testimonials_thread.add(community);
|
||||
testimonials_thread.add(testimonials_main);
|
||||
|
||||
new SimSet(license_thread);
|
||||
license_thread.add(publishing);
|
||||
license_thread.add(license_main);
|
||||
license_thread.add(license_indie);
|
||||
license_thread.add(license_corp);
|
||||
|
||||
new SimSet(play_game_thread);
|
||||
play_game_thread.add(StartMissionGui);
|
||||
play_game_thread.add(JoinServerGui);
|
||||
|
||||
new SimSet(garagegames_thread);
|
||||
garagegames_thread.add(garageGames_main);
|
||||
|
||||
new SimSet(theora_thread);
|
||||
theora_thread.add(theora_main);
|
||||
|
||||
|
||||
|
||||
package AutoLoad_GuiMLTextCtrl_Contents
|
||||
{
|
||||
function GuiMLTextCtrl::onWake(%this)
|
||||
{
|
||||
if (%this.filename !$= "")
|
||||
{
|
||||
%fo = new FileObject();
|
||||
%fo.openForRead(%this.filename);
|
||||
%text = "";
|
||||
while(!%fo.isEOF())
|
||||
%text = %text @ %fo.readLine() @ "\n";
|
||||
|
||||
%fo.delete();
|
||||
%this.setText(%text);
|
||||
}
|
||||
//parent::onWake(%this);
|
||||
}
|
||||
|
||||
function gotoWebPage(%url)
|
||||
{
|
||||
if(isFullScreen())
|
||||
toggleFullScreen();
|
||||
Parent::gotoWebPage(%url);
|
||||
}
|
||||
|
||||
function GuiMLTextCtrl::onURL(%this, %url)
|
||||
{
|
||||
if (getSubStr(%url, 0, 9) $= "gamelink ")
|
||||
eval( getSubStr(%url, 9, 1024) );
|
||||
else
|
||||
gotoWebPage( %url );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
activatePackage(AutoLoad_GuiMLTextCtrl_Contents);
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/menu_threads.cs.dso
Normal file
120
Torque/SDK/example/demo/client/prefs.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
$pref::Audio::channelVolume1 = 0.8;
|
||||
$pref::Audio::channelVolume2 = 0.8;
|
||||
$pref::Audio::channelVolume3 = 0.8;
|
||||
$pref::Audio::channelVolume4 = 0.8;
|
||||
$pref::Audio::channelVolume5 = 0.8;
|
||||
$pref::Audio::channelVolume6 = 0.8;
|
||||
$pref::Audio::channelVolume7 = 0.8;
|
||||
$pref::Audio::channelVolume8 = 0.8;
|
||||
$pref::Audio::driver = "OpenAL";
|
||||
$pref::Audio::environmentEnabled = 0;
|
||||
$pref::Audio::forceMaxDistanceUpdate = 0;
|
||||
$pref::Audio::masterVolume = 0.8;
|
||||
$Pref::backgroundSleepTime = "25";
|
||||
$pref::ChatHudLength = 1;
|
||||
$pref::CloudsOn = "1";
|
||||
$pref::Decal::decalTimeout = "5000";
|
||||
$pref::Decal::maxNumDecals = "256";
|
||||
$pref::decalsOn = "1";
|
||||
$pref::Editor::visibleDistance = "2100";
|
||||
$pref::enableBadWordFilter = "1";
|
||||
$pref::environmentMaps = "1";
|
||||
$pref::HudMessageLogSize = 40;
|
||||
$pref::Input::JoystickEnabled = "0";
|
||||
$pref::Input::KeyboardEnabled = "1";
|
||||
$pref::Input::KeyboardTurnSpeed = 0.1;
|
||||
$pref::Input::LinkMouseSensitivity = 1;
|
||||
$pref::Input::MouseEnabled = "0";
|
||||
$pref::Interior::detailAdjust = "1";
|
||||
$pref::Interior::DynamicLights = "1";
|
||||
$pref::Interior::LightUpdatePeriod = "66";
|
||||
$pref::Interior::lockArrays = "1";
|
||||
$pref::Interior::ShowEnvironmentMaps = "1";
|
||||
$pref::Interior::TexturedFog = "0";
|
||||
$pref::Interior::VertexLighting = "0";
|
||||
$pref::Master0 = "2:master.garagegames.com:28002";
|
||||
$Pref::Net::LagThreshold = "400";
|
||||
$pref::Net::PacketRateToClient = "10";
|
||||
$pref::Net::PacketRateToServer = "32";
|
||||
$pref::Net::PacketSize = "200";
|
||||
$pref::Net::Port = 28000;
|
||||
$pref::NumCloudLayers = "3";
|
||||
$pref::OpenGL::allowCompression = "0";
|
||||
$pref::OpenGL::allowTexGen = "1";
|
||||
$pref::OpenGL::disableARBMultitexture = "0";
|
||||
$pref::OpenGL::disableARBTextureCompression = "0";
|
||||
$pref::OpenGL::disableEXTCompiledVertexArray = "0";
|
||||
$pref::OpenGL::disableEXTFogCoord = "0";
|
||||
$pref::OpenGL::disableEXTPalettedTexture = "0";
|
||||
$pref::OpenGL::disableEXTTexEnvCombine = "0";
|
||||
$pref::OpenGL::disableSubImage = "0";
|
||||
$pref::OpenGL::force16BitTexture = "0";
|
||||
$pref::OpenGL::forcePalettedTexture = "0";
|
||||
$pref::OpenGL::gammaCorrection = "0.5";
|
||||
$pref::OpenGL::maxHardwareLights = "3";
|
||||
$pref::OpenGL::noDrawArraysAlpha = "0";
|
||||
$pref::OpenGL::noEnvColor = "0";
|
||||
$pref::OpenGL::textureAnisotropy = "0";
|
||||
$pref::OpenGL::textureTrilinear = "0";
|
||||
$Pref::player::CurrentFOV = 45;
|
||||
$pref::Player::defaultFov = 90;
|
||||
$pref::Player::Name = "";
|
||||
$pref::Player::renderMyItems = "1";
|
||||
$pref::Player::renderMyPlayer = "1";
|
||||
$pref::Player::zoomSpeed = 0;
|
||||
$Pref::ResourceManager::excludedDirectories = ".svn;CVS";
|
||||
$pref::sceneLighting::cacheLighting = 1;
|
||||
$pref::sceneLighting::cacheSize = 20000;
|
||||
$pref::sceneLighting::purgeMethod = "lastCreated";
|
||||
$pref::sceneLighting::terrainGenerateLevel = 1;
|
||||
$Pref::Server::AdminPassword = "";
|
||||
$Pref::Server::BanTime = 1800;
|
||||
$Pref::Server::ConnectionError = "You do not have the correct version of Torque demo or the resources needed to play on this server, please contact the server operator or visit the <a:www.garagegames.com/mg/projects/torque1>Torque</a> project web site for more information.";
|
||||
$Pref::Server::FloodProtectionEnabled = 1;
|
||||
$Pref::Server::Info = "This is a Torque Demo server.";
|
||||
$Pref::Server::KickBanTime = 300;
|
||||
$Pref::Server::MaxChatLen = 120;
|
||||
$Pref::Server::MaxPlayers = 64;
|
||||
$Pref::Server::Name = "Torque Demo Server";
|
||||
$Pref::Server::Password = "";
|
||||
$Pref::Server::Port = 28000;
|
||||
$Pref::Server::RegionMask = 2;
|
||||
$Pref::Server::TimeLimit = 20;
|
||||
$pref::shadows = "2";
|
||||
$pref::SkyOn = "1";
|
||||
$pref::Terrain::dynamicLights = "1";
|
||||
$pref::Terrain::enableDetails = "1";
|
||||
$pref::Terrain::enableEmbossBumps = "1";
|
||||
$pref::Terrain::screenError = "4";
|
||||
$pref::Terrain::texDetail = "0";
|
||||
$pref::Terrain::textureCacheSize = "220";
|
||||
$Pref::timeManagerProcessInterval = "0";
|
||||
$pref::TS::autoDetail = "1";
|
||||
$pref::TS::detailAdjust = "1";
|
||||
$pref::TS::fogTexture = "0";
|
||||
$pref::TS::screenError = "1";
|
||||
$pref::TS::skipFirstFog = "0";
|
||||
$pref::TS::skipLoadDLs = "0";
|
||||
$pref::TS::skipRenderDLs = "0";
|
||||
$pref::TS::UseTriangles = "0";
|
||||
$pref::Video::allowD3D = "1";
|
||||
$pref::Video::allowOpenGL = "1";
|
||||
$pref::Video::appliedPref = "1";
|
||||
$pref::Video::clipHigh = "0";
|
||||
$pref::Video::defaultsRenderer = "GeForce4 Ti 4200/AGP/SSE2";
|
||||
$pref::Video::defaultsVendor = "NVIDIA Corporation";
|
||||
$pref::Video::deleteContext = "1";
|
||||
$pref::Video::disableVerticalSync = 1;
|
||||
$pref::Video::displayDevice = "OpenGL";
|
||||
$pref::Video::fullScreen = "0";
|
||||
$pref::Video::monitorNum = 0;
|
||||
$pref::Video::only16 = "0";
|
||||
$pref::Video::preferOpenGL = "1";
|
||||
$pref::Video::profiledRenderer = "GeForce4 Ti 4200/AGP/SSE2";
|
||||
$pref::Video::profiledVendor = "NVIDIA Corporation";
|
||||
$Pref::Video::Resolution = "800 600 32";
|
||||
$pref::Video::safeModeOn = "1";
|
||||
$pref::Video::screenShotFormat = "PNG";
|
||||
$pref::Video::screenShotSession = 0;
|
||||
$pref::Video::windowedRes = "800 600";
|
||||
$pref::visibleDistanceMod = "1";
|
||||
18
Torque/SDK/example/demo/client/scripts/DemoEditorAlert.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Engine
|
||||
//
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function DemoEditorAlert::onWake(%this)
|
||||
{
|
||||
|
||||
|
||||
%text = "Welcome to the mission editor!\n\n";
|
||||
%text = %text @ "You can move objects by clicking on them and dragging with the mouse.\n\n";
|
||||
%text = %text @ "Right click and drag anywhere on the scene to change your view angle.\n\n";
|
||||
%text = %text @ "Use the w,s,a,d keys to fly around!\n\n";
|
||||
%text = %text @ "Hit F11 again to return to the demo.\n\n Have fun!";
|
||||
EditorAlertText.setText(%text);
|
||||
DemoEditorAlert.helpTag = DemoEditorAlert.helpTag + 1;
|
||||
}
|
||||
BIN
Torque/SDK/example/demo/client/scripts/DemoEditorAlert.cs.dso
Normal file
40
Torque/SDK/example/demo/client/scripts/audioProfiles.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Channel assignments (channel 0 is unused in-game).
|
||||
|
||||
$GuiAudioType = 1;
|
||||
$SimAudioType = 2;
|
||||
$MessageAudioType = 3;
|
||||
|
||||
new AudioDescription(AudioGui)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = $GuiAudioType;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioMessage)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = $MessageAudioType;
|
||||
};
|
||||
|
||||
new AudioProfile(AudioButtonOver)
|
||||
{
|
||||
filename = "~/data/sound/gui/buttonOver.ogg";
|
||||
description = "AudioGui";
|
||||
preload = true;
|
||||
};
|
||||
|
||||
new AudioProfile(AudioStartup)
|
||||
{
|
||||
filename = "~/data/sound/gui/startup.ogg";
|
||||
description = "AudioGui";
|
||||
preload = true;
|
||||
};
|
||||
BIN
Torque/SDK/example/demo/client/scripts/audioProfiles.cs.dso
Normal file
78
Torque/SDK/example/demo/client/scripts/centerPrint.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$centerPrintActive = 0;
|
||||
$bottomPrintActive = 0;
|
||||
|
||||
// Selectable window sizes
|
||||
$CenterPrintSizes[1] = 20;
|
||||
$CenterPrintSizes[2] = 36;
|
||||
$CenterPrintSizes[3] = 56;
|
||||
|
||||
// time is specified in seconds
|
||||
function clientCmdCenterPrint( %message, %time, %size )
|
||||
{
|
||||
// if centerprint already visible, reset text and time.
|
||||
if ($centerPrintActive) {
|
||||
if (centerPrintDlg.removePrint !$= "")
|
||||
cancel(centerPrintDlg.removePrint);
|
||||
}
|
||||
else {
|
||||
CenterPrintDlg.visible = 1;
|
||||
$centerPrintActive = 1;
|
||||
}
|
||||
|
||||
CenterPrintText.setText( "<just:center>" @ %message );
|
||||
CenterPrintDlg.extent = firstWord(CenterPrintDlg.extent) @ " " @ $CenterPrintSizes[%size];
|
||||
|
||||
if (%time > 0)
|
||||
centerPrintDlg.removePrint = schedule( ( %time * 1000 ), 0, "clientCmdClearCenterPrint" );
|
||||
}
|
||||
|
||||
// time is specified in seconds
|
||||
function clientCmdBottomPrint( %message, %time, %size )
|
||||
{
|
||||
// if bottomprint already visible, reset text and time.
|
||||
if ($bottomPrintActive) {
|
||||
if( bottomPrintDlg.removePrint !$= "")
|
||||
cancel(bottomPrintDlg.removePrint);
|
||||
}
|
||||
else {
|
||||
bottomPrintDlg.setVisible(true);
|
||||
$bottomPrintActive = 1;
|
||||
}
|
||||
|
||||
bottomPrintText.setText( "<just:center>" @ %message );
|
||||
bottomPrintDlg.extent = firstWord(bottomPrintDlg.extent) @ " " @ $CenterPrintSizes[%size];
|
||||
|
||||
if (%time > 0)
|
||||
bottomPrintDlg.removePrint = schedule( ( %time * 1000 ), 0, "clientCmdClearbottomPrint" );
|
||||
}
|
||||
|
||||
function BottomPrintText::onResize(%this, %width, %height)
|
||||
{
|
||||
%this.position = "0 0";
|
||||
}
|
||||
|
||||
function CenterPrintText::onResize(%this, %width, %height)
|
||||
{
|
||||
%this.position = "0 0";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
|
||||
function clientCmdClearCenterPrint()
|
||||
{
|
||||
$centerPrintActive = 0;
|
||||
CenterPrintDlg.visible = 0;
|
||||
CenterPrintDlg.removePrint = "";
|
||||
}
|
||||
|
||||
function clientCmdClearBottomPrint()
|
||||
{
|
||||
$bottomPrintActive = 0;
|
||||
BottomPrintDlg.visible = 0;
|
||||
BottomPrintDlg.removePrint = "";
|
||||
}
|
||||
BIN
Torque/SDK/example/demo/client/scripts/centerPrint.cs.dso
Normal file
286
Torque/SDK/example/demo/client/scripts/chatHud.cs
Normal file
@@ -0,0 +1,286 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Message Hud
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// chat hud sizes
|
||||
$outerChatLenY[1] = 72;
|
||||
$outerChatLenY[2] = 140;
|
||||
$outerChatLenY[3] = 200;
|
||||
|
||||
// Only play sound files that are <= 5000ms in length.
|
||||
$MaxMessageWavLength = 5000;
|
||||
|
||||
// Helper function to play a sound file if the message indicates.
|
||||
// Returns starting position of wave file indicator.
|
||||
function playMessageSound(%message, %voice, %pitch)
|
||||
{
|
||||
// Search for wav tag marker.
|
||||
%wavStart = strstr(%message, "~w");
|
||||
if (%wavStart == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
%wav = getSubStr(%message, %wavStart + 2, 1000);
|
||||
if (%voice !$= "") {
|
||||
%wavFile = "~/data/sound/voice/" @ %voice @ "/" @ %wav;
|
||||
}
|
||||
else {
|
||||
%wavFile = "~/data/sound/" @ %wav;
|
||||
}
|
||||
if (strstr(%wavFile, ".wav") != (strlen(%wavFile) - 4)) {
|
||||
%wavFile = %wavFile @ ".wav";
|
||||
}
|
||||
// XXX This only expands to a single filepath, of course; it
|
||||
// would be nice to support checking in each mod path if we
|
||||
// have multiple mods active.
|
||||
%wavFile = ExpandFilename(%wavFile);
|
||||
|
||||
if ((%pitch < 0.5) || (%pitch > 2.0)) {
|
||||
%pitch = 1.0;
|
||||
}
|
||||
|
||||
%wavLengthMS = alxGetWaveLen(%wavFile) * %pitch;
|
||||
if (%wavLengthMS == 0) {
|
||||
error("** WAV file \"" @ %wavFile @ "\" is nonexistent or sound is zero-length **");
|
||||
}
|
||||
else if (%wavLengthMS <= $MaxMessageWavLength) {
|
||||
if ($ClientChatHandle[%sender] != 0) {
|
||||
alxStop($ClientChatHandle[%sender]);
|
||||
}
|
||||
$ClientChatHandle[%sender] = alxCreateSource(AudioMessage, %wavFile);
|
||||
if (%pitch != 1.0) {
|
||||
alxSourcef($ClientChatHandle[%sender], "AL_PITCH", %pitch);
|
||||
}
|
||||
alxPlay($ClientChatHandle[%sender]);
|
||||
}
|
||||
else {
|
||||
error("** WAV file \"" @ %wavFile @ "\" is too long **");
|
||||
}
|
||||
|
||||
return %wavStart;
|
||||
}
|
||||
|
||||
|
||||
// All messages are stored in this HudMessageVector, the actual
|
||||
// MainChatHud only displays the contents of this vector.
|
||||
|
||||
new MessageVector(HudMessageVector);
|
||||
$LastHudTarget = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
function onChatMessage(%message, %voice, %pitch)
|
||||
{
|
||||
// XXX Client objects on the server must have voiceTag and voicePitch
|
||||
// fields for values to be passed in for %voice and %pitch... in
|
||||
// this example mod, they don't have those fields.
|
||||
|
||||
// Clients are not allowed to trigger general game sounds with their
|
||||
// chat messages... a voice directory MUST be specified.
|
||||
if (%voice $= "") {
|
||||
%voice = "default";
|
||||
}
|
||||
|
||||
// See if there's a sound at the end of the message, and play it.
|
||||
if ((%wavStart = playMessageSound(%message, %voice, %pitch)) != -1) {
|
||||
// Remove the sound marker from the end of the message.
|
||||
%message = getSubStr(%message, 0, %wavStart);
|
||||
}
|
||||
|
||||
// Chat goes to the chat HUD.
|
||||
if (getWordCount(%message)) {
|
||||
ChatHud.addLine(%message);
|
||||
}
|
||||
}
|
||||
|
||||
function onServerMessage(%message)
|
||||
{
|
||||
// See if there's a sound at the end of the message, and play it.
|
||||
if ((%wavStart = playMessageSound(%message)) != -1) {
|
||||
// Remove the sound marker from the end of the message.
|
||||
%message = getSubStr(%message, 0, %wavStart);
|
||||
}
|
||||
|
||||
// Server messages go to the chat HUD too.
|
||||
if (getWordCount(%message)) {
|
||||
ChatHud.addLine(%message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// MainChatHud methods
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function MainChatHud::onWake( %this )
|
||||
{
|
||||
// set the chat hud to the users pref
|
||||
%this.setChatHudLength( $Pref::ChatHudLength );
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function MainChatHud::setChatHudLength( %this, %length )
|
||||
{
|
||||
OuterChatHud.resize(firstWord(OuterChatHud.position), getWord(OuterChatHud.position, 1),
|
||||
firstWord(OuterChatHud.extent), $outerChatLenY[%length]);
|
||||
ChatScrollHud.scrollToBottom();
|
||||
ChatPageDown.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function MainChatHud::nextChatHudLen( %this )
|
||||
{
|
||||
%len = $pref::ChatHudLength++;
|
||||
if ($pref::ChatHudLength == 4)
|
||||
$pref::ChatHudLength = 1;
|
||||
%this.setChatHudLength($pref::ChatHudLength);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ChatHud methods
|
||||
// This is the actual message vector/text control which is part of
|
||||
// the MainChatHud dialog
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function ChatHud::addLine(%this,%text)
|
||||
{
|
||||
//first, see if we're "scrolled up"...
|
||||
%textHeight = %this.profile.fontSize;
|
||||
if (%textHeight <= 0)
|
||||
%textHeight = 12;
|
||||
%chatScrollHeight = getWord(%this.getGroup().getGroup().extent, 1);
|
||||
%chatPosition = getWord(%this.extent, 1) - %chatScrollHeight + getWord(%this.position, 1);
|
||||
%linesToScroll = mFloor((%chatPosition / %textHeight) + 0.5);
|
||||
if (%linesToScroll > 0)
|
||||
%origPosition = %this.position;
|
||||
|
||||
//add the message...
|
||||
while( !chatPageDown.isVisible() && HudMessageVector.getNumLines() && (HudMessageVector.getNumLines() >= $pref::HudMessageLogSize))
|
||||
{
|
||||
%tag = HudMessageVector.getLineTag(0);
|
||||
if(%tag != 0)
|
||||
%tag.delete();
|
||||
HudMessageVector.popFrontLine();
|
||||
}
|
||||
HudMessageVector.pushBackLine(%text, $LastHudTarget);
|
||||
$LastHudTarget = 0;
|
||||
|
||||
//now that we've added the message, see if we need to reset the position
|
||||
if (%linesToScroll > 0)
|
||||
{
|
||||
chatPageDown.setVisible(true);
|
||||
%this.position = %origPosition;
|
||||
}
|
||||
else
|
||||
chatPageDown.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function ChatHud::pageUp(%this)
|
||||
{
|
||||
// Find out the text line height
|
||||
%textHeight = %this.profile.fontSize;
|
||||
if (%textHeight <= 0)
|
||||
%textHeight = 12;
|
||||
|
||||
// Find out how many lines per page are visible
|
||||
%chatScrollHeight = getWord(%this.getGroup().getGroup().extent, 1);
|
||||
if (%chatScrollHeight <= 0)
|
||||
return;
|
||||
|
||||
%pageLines = mFloor(%chatScrollHeight / %textHeight) - 1;
|
||||
if (%pageLines <= 0)
|
||||
%pageLines = 1;
|
||||
|
||||
// See how many lines we actually can scroll up:
|
||||
%chatPosition = -1 * getWord(%this.position, 1);
|
||||
%linesToScroll = mFloor((%chatPosition / %textHeight) + 0.5);
|
||||
if (%linesToScroll <= 0)
|
||||
return;
|
||||
|
||||
if (%linesToScroll > %pageLines)
|
||||
%scrollLines = %pageLines;
|
||||
else
|
||||
%scrollLines = %linesToScroll;
|
||||
|
||||
// Now set the position
|
||||
%this.position = firstWord(%this.position) SPC (getWord(%this.position, 1) + (%scrollLines * %textHeight));
|
||||
|
||||
// Display the pageup icon
|
||||
chatPageDown.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function ChatHud::pageDown(%this)
|
||||
{
|
||||
// Find out the text line height
|
||||
%textHeight = %this.profile.fontSize;
|
||||
if (%textHeight <= 0)
|
||||
%textHeight = 12;
|
||||
|
||||
// Find out how many lines per page are visible
|
||||
%chatScrollHeight = getWord(%this.getGroup().getGroup().extent, 1);
|
||||
if (%chatScrollHeight <= 0)
|
||||
return;
|
||||
|
||||
%pageLines = mFloor(%chatScrollHeight / %textHeight) - 1;
|
||||
if (%pageLines <= 0)
|
||||
%pageLines = 1;
|
||||
|
||||
// See how many lines we actually can scroll down:
|
||||
%chatPosition = getWord(%this.extent, 1) - %chatScrollHeight + getWord(%this.position, 1);
|
||||
%linesToScroll = mFloor((%chatPosition / %textHeight) + 0.5);
|
||||
if (%linesToScroll <= 0)
|
||||
return;
|
||||
|
||||
if (%linesToScroll > %pageLines)
|
||||
%scrollLines = %pageLines;
|
||||
else
|
||||
%scrollLines = %linesToScroll;
|
||||
|
||||
// Now set the position
|
||||
%this.position = firstWord(%this.position) SPC (getWord(%this.position, 1) - (%scrollLines * %textHeight));
|
||||
|
||||
// See if we have should (still) display the pagedown icon
|
||||
if (%scrollLines < %linesToScroll)
|
||||
chatPageDown.setVisible(true);
|
||||
else
|
||||
chatPageDown.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Support functions
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function pageUpMessageHud()
|
||||
{
|
||||
ChatHud.pageUp();
|
||||
}
|
||||
|
||||
function pageDownMessageHud()
|
||||
{
|
||||
ChatHud.pageDown();
|
||||
}
|
||||
|
||||
function cycleMessageHudSize()
|
||||
{
|
||||
MainChatHud.nextChatHudLen();
|
||||
}
|
||||
BIN
Torque/SDK/example/demo/client/scripts/chatHud.cs.dso
Normal file
32
Torque/SDK/example/demo/client/scripts/client.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Server Admin Commands
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function SAD(%password)
|
||||
{
|
||||
if (%password !$= "")
|
||||
commandToServer('SAD', %password);
|
||||
}
|
||||
|
||||
function SADSetPassword(%password)
|
||||
{
|
||||
commandToServer('SADSetPassword', %password);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Misc server commands
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function clientCmdSyncClock(%time)
|
||||
{
|
||||
// Store the base time in the hud control it will automatically increment.
|
||||
if (isObject(HudClock))
|
||||
HudClock.setTime(%time);
|
||||
}
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/client.cs.dso
Normal file
369
Torque/SDK/example/demo/client/scripts/default.bind.cs
Normal file
@@ -0,0 +1,369 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
if ( isObject( moveMap ) )
|
||||
moveMap.delete();
|
||||
new ActionMap(moveMap);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Non-remapable binds
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function escapeFromGame()
|
||||
{
|
||||
if ( $Server::ServerType $= "SinglePlayer" )
|
||||
MessageBoxYesNo( "Quit Demo", "Exit from the demo?", "disconnect();", "");
|
||||
else
|
||||
MessageBoxYesNo( "Disconnect", "Disconnect from the server?", "disconnect();", "");
|
||||
}
|
||||
|
||||
moveMap.bindCmd(keyboard, "escape", "", "escapeFromGame();");
|
||||
|
||||
function showPlayerList(%val)
|
||||
{
|
||||
if(%val)
|
||||
PlayerListGui.toggle();
|
||||
}
|
||||
|
||||
moveMap.bind( keyboard, F2, showPlayerList );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Movement Keys
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
$movementSpeed = 1; // m/s
|
||||
|
||||
function setSpeed(%speed)
|
||||
{
|
||||
if(%speed)
|
||||
$movementSpeed = %speed;
|
||||
}
|
||||
|
||||
function moveleft(%val)
|
||||
{
|
||||
$mvLeftAction = %val;
|
||||
}
|
||||
|
||||
function moveright(%val)
|
||||
{
|
||||
$mvRightAction = %val;
|
||||
}
|
||||
|
||||
function moveforward(%val)
|
||||
{
|
||||
$mvForwardAction = %val;
|
||||
}
|
||||
|
||||
function movebackward(%val)
|
||||
{
|
||||
$mvBackwardAction = %val;
|
||||
}
|
||||
|
||||
function moveup(%val)
|
||||
{
|
||||
$mvUpAction = %val;
|
||||
}
|
||||
|
||||
function movedown(%val)
|
||||
{
|
||||
$mvDownAction = %val;
|
||||
}
|
||||
|
||||
function turnLeft( %val )
|
||||
{
|
||||
$mvYawRightSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
|
||||
}
|
||||
|
||||
function turnRight( %val )
|
||||
{
|
||||
$mvYawLeftSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
|
||||
}
|
||||
|
||||
function panUp( %val )
|
||||
{
|
||||
$mvPitchDownSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
|
||||
}
|
||||
|
||||
function panDown( %val )
|
||||
{
|
||||
$mvPitchUpSpeed = %val ? $Pref::Input::KeyboardTurnSpeed : 0;
|
||||
}
|
||||
|
||||
function getMouseAdjustAmount(%val)
|
||||
{
|
||||
// based on a default camera fov of 90'
|
||||
return(%val * ($cameraFov / 90) * 0.01);
|
||||
}
|
||||
|
||||
function yaw(%val)
|
||||
{
|
||||
$mvYaw += getMouseAdjustAmount(%val);
|
||||
}
|
||||
|
||||
function pitch(%val)
|
||||
{
|
||||
$mvPitch += getMouseAdjustAmount(%val);
|
||||
}
|
||||
|
||||
function jump(%val)
|
||||
{
|
||||
$mvTriggerCount2++;
|
||||
}
|
||||
|
||||
moveMap.bind( keyboard, a, moveleft );
|
||||
moveMap.bind( keyboard, d, moveright );
|
||||
moveMap.bind( keyboard, w, moveforward );
|
||||
moveMap.bind( keyboard, s, movebackward );
|
||||
moveMap.bind( keyboard, space, jump );
|
||||
moveMap.bind( mouse, xaxis, yaw );
|
||||
moveMap.bind( mouse, yaxis, pitch );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Mouse Trigger
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function mouseFire(%val)
|
||||
{
|
||||
$mvTriggerCount0++;
|
||||
}
|
||||
|
||||
function altTrigger(%val)
|
||||
{
|
||||
$mvTriggerCount1++;
|
||||
}
|
||||
|
||||
moveMap.bind( mouse, button0, mouseFire );
|
||||
//moveMap.bind( mouse, button1, altTrigger );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Zoom and FOV functions
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
if($Pref::player::CurrentFOV $= "")
|
||||
$Pref::player::CurrentFOV = 45;
|
||||
|
||||
function setZoomFOV(%val)
|
||||
{
|
||||
if(%val)
|
||||
toggleZoomFOV();
|
||||
}
|
||||
|
||||
function toggleZoom( %val )
|
||||
{
|
||||
if ( %val )
|
||||
{
|
||||
$ZoomOn = true;
|
||||
setFov( $Pref::player::CurrentFOV );
|
||||
}
|
||||
else
|
||||
{
|
||||
$ZoomOn = false;
|
||||
setFov( $Pref::player::DefaultFov );
|
||||
}
|
||||
}
|
||||
|
||||
moveMap.bind(keyboard, r, setZoomFOV);
|
||||
moveMap.bind(keyboard, e, toggleZoom);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Camera & View functions
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function toggleFreeLook( %val )
|
||||
{
|
||||
if ( %val )
|
||||
$mvFreeLook = true;
|
||||
else
|
||||
$mvFreeLook = false;
|
||||
}
|
||||
|
||||
$firstPerson = true;
|
||||
function toggleFirstPerson(%val)
|
||||
{
|
||||
if (%val)
|
||||
{
|
||||
$firstPerson = !$firstPerson;
|
||||
ServerConnection.setFirstPerson($firstPerson);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleCamera(%val)
|
||||
{
|
||||
if (%val)
|
||||
commandToServer('ToggleCamera');
|
||||
}
|
||||
|
||||
moveMap.bind( keyboard, z, toggleFreeLook );
|
||||
moveMap.bind(keyboard, tab, toggleFirstPerson );
|
||||
moveMap.bind(keyboard, "alt c", toggleCamera);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Misc. Player stuff
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function celebrationWave(%val)
|
||||
{
|
||||
if(%val)
|
||||
commandToServer('playCel', "wave");
|
||||
}
|
||||
|
||||
function celebrationSalute(%val)
|
||||
{
|
||||
if(%val)
|
||||
commandToServer('playCel', "salute");
|
||||
}
|
||||
|
||||
function suicide(%val)
|
||||
{
|
||||
if(%val)
|
||||
commandToServer('suicide');
|
||||
}
|
||||
|
||||
moveMap.bind(keyboard, "ctrl w", celebrationWave);
|
||||
moveMap.bind(keyboard, "ctrl s", celebrationSalute);
|
||||
moveMap.bind(keyboard, "ctrl k", suicide);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Item manipulation
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"Crossbow\");", "");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Message HUD functions
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function pageMessageHudUp( %val )
|
||||
{
|
||||
if ( %val )
|
||||
pageUpMessageHud();
|
||||
}
|
||||
|
||||
function pageMessageHudDown( %val )
|
||||
{
|
||||
if ( %val )
|
||||
pageDownMessageHud();
|
||||
}
|
||||
|
||||
function resizeMessageHud( %val )
|
||||
{
|
||||
if ( %val )
|
||||
cycleMessageHudSize();
|
||||
}
|
||||
|
||||
moveMap.bind(keyboard, u, toggleMessageHud );
|
||||
//moveMap.bind(keyboard, y, teamMessageHud );
|
||||
moveMap.bind(keyboard, "pageUp", pageMessageHudUp );
|
||||
moveMap.bind(keyboard, "pageDown", pageMessageHudDown );
|
||||
moveMap.bind(keyboard, "p", resizeMessageHud );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Demo recording functions
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function startRecordingDemo( %val )
|
||||
{
|
||||
// if ( %val )
|
||||
// beginDemoRecord();
|
||||
error( "** This function has temporarily been disabled! **" );
|
||||
}
|
||||
|
||||
function stopRecordingDemo( %val )
|
||||
{
|
||||
// if ( %val )
|
||||
// stopRecord();
|
||||
error( "** This function has temporarily been disabled! **" );
|
||||
}
|
||||
|
||||
//moveMap.bind( keyboard, F3, startRecordingDemo );
|
||||
//moveMap.bind( keyboard, F4, stopRecordingDemo );
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helper Functions
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function dropCameraAtPlayer(%val)
|
||||
{
|
||||
if (%val)
|
||||
commandToServer('dropCameraAtPlayer');
|
||||
|
||||
}
|
||||
|
||||
function dropPlayerAtCamera(%val)
|
||||
{
|
||||
if (%val)
|
||||
commandToServer('DropPlayerAtCamera');
|
||||
}
|
||||
|
||||
moveMap.bind(keyboard, "F8", dropCameraAtPlayer);
|
||||
moveMap.bind(keyboard, "F7", dropPlayerAtCamera);
|
||||
|
||||
|
||||
function bringUpOptions(%val)
|
||||
{
|
||||
if(%val)
|
||||
Canvas.pushDialog(OptionsDlg);
|
||||
}
|
||||
|
||||
moveMap.bind(keyboard, "ctrl o", bringUpOptions);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Dubuging Functions
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
$MFDebugRenderMode = 0;
|
||||
function cycleDebugRenderMode(%val)
|
||||
{
|
||||
if (!%val)
|
||||
return;
|
||||
|
||||
if (getBuildString() $= "Debug")
|
||||
{
|
||||
if($MFDebugRenderMode == 0)
|
||||
{
|
||||
// Outline mode, including fonts so no stats
|
||||
$MFDebugRenderMode = 1;
|
||||
GLEnableOutline(true);
|
||||
}
|
||||
else if ($MFDebugRenderMode == 1)
|
||||
{
|
||||
// Interior debug mode
|
||||
$MFDebugRenderMode = 2;
|
||||
GLEnableOutline(false);
|
||||
setInteriorRenderMode(7);
|
||||
showInterior();
|
||||
}
|
||||
else if ($MFDebugRenderMode == 2)
|
||||
{
|
||||
// Back to normal
|
||||
$MFDebugRenderMode = 0;
|
||||
setInteriorRenderMode(0);
|
||||
GLEnableOutline(false);
|
||||
show();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo("Debug render modes only available when running a Debug build.");
|
||||
}
|
||||
}
|
||||
|
||||
GlobalActionMap.bind(keyboard, "F9", cycleDebugRenderMode);
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Misc.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
|
||||
GlobalActionMap.bindCmd(keyboard, "alt enter", "", "toggleFullScreen();");
|
||||
GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();");
|
||||
BIN
Torque/SDK/example/demo/client/scripts/default.bind.cs.dso
Normal file
35
Torque/SDK/example/demo/client/scripts/fpsGui.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// FpsGui is the main TSControl through which the racing game is viewed.
|
||||
// The FpsGui also contains the hud controls.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function FpsGui::onWake(%this)
|
||||
{
|
||||
// Turn off any shell sounds...
|
||||
// alxStop( ... );
|
||||
|
||||
$enableDirectInput = "1";
|
||||
activateDirectInput();
|
||||
|
||||
// Message hud dialog
|
||||
Canvas.pushDialog(MainChatHud);
|
||||
chatHud.attach(HudMessageVector);
|
||||
|
||||
// Push the game's action key mapings
|
||||
moveMap.push();
|
||||
}
|
||||
|
||||
function FpsGui::onSleep(%this)
|
||||
{
|
||||
Canvas.popDialog(MainChatHud);
|
||||
|
||||
// Pop the keymaps
|
||||
moveMap.pop();
|
||||
}
|
||||
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/fpsGui.cs.dso
Normal file
53
Torque/SDK/example/demo/client/scripts/game.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Game start / end events sent from the server
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function clientCmdGameStart(%seq)
|
||||
{
|
||||
PlayerListGui.zeroScores();
|
||||
}
|
||||
|
||||
function clientCmdGameEnd(%seq)
|
||||
{
|
||||
// Stop local activity... the game will be destroyed on the server
|
||||
alxStopAll();
|
||||
|
||||
// Copy the current scores from the player list into the
|
||||
// end game gui (bit of a hack for now).
|
||||
EndGameGuiList.clear();
|
||||
for (%i = 0; %i < PlayerListGuiList.rowCount(); %i++) {
|
||||
%text = PlayerListGuiList.getRowText(%i);
|
||||
%id = PlayerListGuiList.getRowId(%i);
|
||||
EndGameGuiList.addRow(%id,%text);
|
||||
}
|
||||
EndGameGuiList.sortNumerical(1,false);
|
||||
|
||||
// Display the end-game screen
|
||||
Canvas.setContent(EndGameGui);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Game gui
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// Initialize GameGUI to the default gui screen.
|
||||
$Client::GameGUI = "PlayGUI";
|
||||
|
||||
function clientCmdSetGameGui(%gui)
|
||||
{
|
||||
// The GameGUI isn't loaded here directly. Game gui is normally loaded
|
||||
// when the client first recieves a control object from the server. (This is
|
||||
// handled by the GameConnection scripts, located in serverConnection.cs)
|
||||
// But if we aren't in the editor and the game is currently in progress,
|
||||
// then we probably should load the gui...
|
||||
$Client::GameGUI = %gui;
|
||||
}
|
||||
|
||||
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/game.cs.dso
Normal file
145
Torque/SDK/example/demo/client/scripts/joinServerGui.cs
Normal file
@@ -0,0 +1,145 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------
|
||||
function JoinServerGui::onWake()
|
||||
{
|
||||
// Double check the status. Tried setting this the control
|
||||
// inactive to start with, but that didn't seem to work.
|
||||
//JS_joinServer.setActive(JS_serverList.rowCount() > 0);
|
||||
|
||||
|
||||
// Override the next page command...
|
||||
OverlayNextPage.setVisible(true);
|
||||
OverlayNextPage.command = "JoinServerGui.join();";
|
||||
|
||||
// Set our query and mission types to the demo game type
|
||||
$Client::GameTypeQuery = $Client::GameType;
|
||||
$Client::MissionTypeQuery = "any";
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
function JoinServerGui::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 JoinServerGui::queryLan(%this)
|
||||
{
|
||||
queryLANServers(
|
||||
28000, // 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 JoinServerGui::cancel(%this)
|
||||
{
|
||||
cancelServerQuery();
|
||||
JS_queryStatus.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------
|
||||
function JoinServerGui::join(%this)
|
||||
{
|
||||
cancelServerQuery();
|
||||
%id = JS_serverList.getSelectedId();
|
||||
|
||||
// The server info index is stored in the row along with the
|
||||
// rest of displayed info.
|
||||
%index = getField(JS_serverList.getRowTextById(%id),6);
|
||||
if (setServerInfo(%index)) {
|
||||
%conn = new GameConnection(ServerConnection);
|
||||
%conn.setConnectArgs($pref::Player::Name);
|
||||
%conn.setJoinPassword($Client::Password);
|
||||
%conn.connect($ServerInfo::Address);
|
||||
}
|
||||
else
|
||||
MessageBoxOk("No Server Selected","You need to select a server. Press either of the Query buttons to list available servers or go back to the previous page to create your own.");
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
function JoinServerGui::exit(%this)
|
||||
{
|
||||
cancelServerQuery();
|
||||
Canvas.setContent(StartMissionGui);
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
function JoinServerGui::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
|
||||
%i); // ServerInfo index stored also
|
||||
}
|
||||
JS_serverList.sort(0);
|
||||
JS_serverList.setSelectedRow(0);
|
||||
JS_serverList.scrollVisible(0);
|
||||
|
||||
//JS_joinServer.setActive(JS_serverList.rowCount() > 0);
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
function onServerQueryStatus(%status, %msg, %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":
|
||||
//JS_joinServer.setActive(false);
|
||||
JS_queryMaster.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":
|
||||
JS_queryMaster.setActive(true);
|
||||
JS_queryStatus.setVisible(false);
|
||||
JoinServerGui.update();
|
||||
}
|
||||
}
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/joinServerGui.cs.dso
Normal file
47
Torque/SDK/example/demo/client/scripts/loadingGui.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LoadingGui::onAdd(%this)
|
||||
{
|
||||
%this.qLineCount = 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LoadingGui::onWake(%this)
|
||||
{
|
||||
// Play sound...
|
||||
CloseMessagePopup();
|
||||
|
||||
// Push the menu system
|
||||
Canvas.pushdialog(OverlayDlg);
|
||||
|
||||
// Initialize overlay buttons
|
||||
OverlayQuitPage.setVisible(false);
|
||||
OverlayNextPage.setVisible(false);
|
||||
OverlayPrevPage.setVisible(true);
|
||||
OverlayPrevPage.command = "disconnect();";
|
||||
|
||||
//
|
||||
LoadingProgressTxt.setValue("WAITING FOR SERVER");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function LoadingGui::onSleep(%this)
|
||||
{
|
||||
// Clear the load info:
|
||||
if ( %this.qLineCount !$= "" )
|
||||
{
|
||||
for ( %line = 0; %line < %this.qLineCount; %line++ )
|
||||
%this.qLine[%line] = "";
|
||||
}
|
||||
%this.qLineCount = 0;
|
||||
|
||||
LOAD_MapName.setText( "" );
|
||||
LOAD_MapDescription.setText( "" );
|
||||
LoadingProgress.setValue( 0 );
|
||||
|
||||
// Stop sound...
|
||||
}
|
||||
BIN
Torque/SDK/example/demo/client/scripts/loadingGui.cs.dso
Normal file
186
Torque/SDK/example/demo/client/scripts/mainMenuGui.cs
Normal file
@@ -0,0 +1,186 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// MainMenuGui is the main Control through which the game shell is viewed.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function MainMenuGui::onWake(%this)
|
||||
{
|
||||
%this.pushThread(main_menu_thread);
|
||||
OverlayBuyNow.setVisible(true);
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::getThread(%this)
|
||||
{
|
||||
%top = menu_thread_stack.getCount();
|
||||
if (%top > 0)
|
||||
return menu_thread_stack.getObject(%top-1);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::popCurrent(%this)
|
||||
{
|
||||
if (%thread = %this.getThread())
|
||||
{
|
||||
Canvas.popDialog(%thread.getObject(%thread.page));
|
||||
echo ("POP Current: " @ %thread.getName() @ " page: " @ %thread.page);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::pushThread(%this, %thread)
|
||||
{
|
||||
echo ("PushThread: " @ %thread.getname());
|
||||
|
||||
%this.popCurrent();
|
||||
%thread.page = 0;
|
||||
menu_thread_stack.add(%thread);
|
||||
%this.update();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::popThread(%this)
|
||||
{
|
||||
if (%thread = %this.getThread())
|
||||
{
|
||||
echo ("PopThread: " @ %thread.getname());
|
||||
|
||||
%this.popCurrent();
|
||||
menu_thread_stack.remove(%thread);
|
||||
%this.update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::isNextPage(%this)
|
||||
{
|
||||
if ( !(%thread = %this.getThread()) )
|
||||
return false;
|
||||
echo ("isNext: " @ %thread.page @ " - " @ %thread.getCount());
|
||||
return %thread.page < (%thread.getCount() - 1);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::isPrevPage(%this)
|
||||
{
|
||||
if ( !(%thread = %this.getThread()) )
|
||||
return false;
|
||||
return %thread.page > 0;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::isPrevThread(%this)
|
||||
{
|
||||
return menu_thread_stack.getCount() > 1;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::nextPage(%this)
|
||||
{
|
||||
if (%this.isNextPage())
|
||||
{
|
||||
%this.popCurrent();
|
||||
%thread = %this.getThread();
|
||||
%thread.page = (%thread.page+1);
|
||||
%this.update();
|
||||
}
|
||||
else
|
||||
%this.popThread();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::prevPage(%this)
|
||||
{
|
||||
if (%this.isPrevPage())
|
||||
{
|
||||
%this.popCurrent();
|
||||
%thread = %this.getThread();
|
||||
%thread.page = (%thread.page-1);
|
||||
%this.update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::update(%this)
|
||||
{
|
||||
if (Canvas.getContent().getName() $= "GuiEditorGui")
|
||||
{
|
||||
%this.popCurrent();
|
||||
Canvas.popdialog(OverlayDlg);
|
||||
return;
|
||||
}
|
||||
|
||||
if (%thread = %this.getThread())
|
||||
{
|
||||
echo ("Update: " @ %thread.getName() @ " page: " @ %thread.page);
|
||||
%page = %thread.getObject(%thread.page);
|
||||
|
||||
// Setup default overlay buttons
|
||||
OverlayTitle.setText("<just:center><shadowcolor:000000><shadow:1:1>" @ %page.title);
|
||||
OverlayDesc.setText("");
|
||||
|
||||
// OverlayNextPage.setVisible(%this.isNextPage());
|
||||
OverlayNextPage.setVisible(%this.isNextPage() || (%this.isPrevPage() && %this.isPrevThread()));
|
||||
OverlayNextPage.command = "MainMenuGui.nextPage();";
|
||||
|
||||
OverlayPrevPage.setVisible(%this.isPrevPage());
|
||||
OverlayPrevPage.command = "MainMenuGui.prevPage();";
|
||||
|
||||
OverlayQuitPage.setVisible(false);
|
||||
OverlayQuitPage.command = "quit();";
|
||||
|
||||
if (!%this.isPrevPage())
|
||||
{
|
||||
if (%this.isPrevThread())
|
||||
{
|
||||
OverlayPrevPage.setVisible(true);
|
||||
OverlayPrevPage.command = "MainMenuGui.popThread();";
|
||||
}
|
||||
else
|
||||
OverlayQuitPage.setVisible(true);
|
||||
}
|
||||
|
||||
// Push the current page
|
||||
Canvas.pushDialog(%page);
|
||||
|
||||
// make sure The Overlay is on top
|
||||
Canvas.popdialog(OverlayDlg);
|
||||
Canvas.pushdialog(OverlayDlg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::onSleep(%this)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
function MainMenuGui::goHome(%this)
|
||||
{
|
||||
disconnect();
|
||||
if (Canvas.getContent() != %this.getId())
|
||||
Canvas.pushDialog(%this);
|
||||
else {
|
||||
while (%this.isPrevThread())
|
||||
%this.popThread();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/mainMenuGui.cs.dso
Normal file
112
Torque/SDK/example/demo/client/scripts/messageHud.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Enter Chat Message Hud
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function MessageHud::open(%this)
|
||||
{
|
||||
%offset = 6;
|
||||
|
||||
if(%this.isVisible())
|
||||
return;
|
||||
|
||||
if(%this.isTeamMsg)
|
||||
%text = "TEAM:";
|
||||
else
|
||||
%text = "GLOBAL:";
|
||||
|
||||
MessageHud_Text.setValue(%text);
|
||||
|
||||
%windowPos = "0 " @ ( getWord( outerChatHud.position, 1 ) + getWord( outerChatHud.extent, 1 ) + 1 );
|
||||
%windowExt = getWord( OuterChatHud.extent, 0 ) @ " " @ getWord( MessageHud_Frame.extent, 1 );
|
||||
|
||||
%textExtent = getWord(MessageHud_Text.extent, 0) + 14;
|
||||
%ctrlExtent = getWord(MessageHud_Frame.extent, 0);
|
||||
|
||||
Canvas.pushDialog(%this);
|
||||
|
||||
messageHud_Frame.position = %windowPos;
|
||||
messageHud_Frame.extent = %windowExt;
|
||||
MessageHud_Edit.position = setWord(MessageHud_Edit.position, 0, %textExtent + %offset);
|
||||
MessageHud_Edit.extent = setWord(MessageHud_Edit.extent, 0, %ctrlExtent - %textExtent - (2 * %offset));
|
||||
|
||||
%this.setVisible(true);
|
||||
deactivateKeyboard();
|
||||
MessageHud_Edit.makeFirstResponder(true);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function MessageHud::close(%this)
|
||||
{
|
||||
if(!%this.isVisible())
|
||||
return;
|
||||
|
||||
Canvas.popDialog(%this);
|
||||
%this.setVisible(false);
|
||||
if ( $enableDirectInput )
|
||||
activateKeyboard();
|
||||
MessageHud_Edit.setValue("");
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function MessageHud::toggleState(%this)
|
||||
{
|
||||
if(%this.isVisible())
|
||||
%this.close();
|
||||
else
|
||||
%this.open();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function MessageHud_Edit::onEscape(%this)
|
||||
{
|
||||
MessageHud.close();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function MessageHud_Edit::eval(%this)
|
||||
{
|
||||
%text = trim(%this.getValue());
|
||||
if(%text !$= "")
|
||||
{
|
||||
if(MessageHud.isTeamMsg)
|
||||
commandToServer('teamMessageSent', %text);
|
||||
else
|
||||
commandToServer('messageSent', %text);
|
||||
}
|
||||
|
||||
MessageHud.close();
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// MessageHud key handlers
|
||||
|
||||
function toggleMessageHud(%make)
|
||||
{
|
||||
if(%make)
|
||||
{
|
||||
MessageHud.isTeamMsg = false;
|
||||
MessageHud.toggleState();
|
||||
}
|
||||
}
|
||||
|
||||
function teamMessageHud(%make)
|
||||
{
|
||||
if(%make)
|
||||
{
|
||||
MessageHud.isTeamMsg = true;
|
||||
MessageHud.toggleState();
|
||||
}
|
||||
}
|
||||
BIN
Torque/SDK/example/demo/client/scripts/messageHud.cs.dso
Normal file
154
Torque/SDK/example/demo/client/scripts/missionDownload.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Mission Loading & Mission Info
|
||||
// The mission loading server handshaking is handled by the
|
||||
// common/client/missingLoading.cs. This portion handles the interface
|
||||
// with the game GUI.
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Loading Phases:
|
||||
// Phase 1: Download Datablocks
|
||||
// Phase 2: Download Ghost Objects
|
||||
// Phase 3: Scene Lighting
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Phase 1
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function onMissionDownloadPhase1(%missionName, %musicTrack)
|
||||
{
|
||||
// Close and clear the message hud (in case it's open)
|
||||
MessageHud.close();
|
||||
//cls();
|
||||
|
||||
// Reset the loading progress controls:
|
||||
LoadingProgress.setValue(0);
|
||||
LoadingProgressTxt.setValue("LOADING DATABLOCKS");
|
||||
}
|
||||
|
||||
function onPhase1Progress(%progress)
|
||||
{
|
||||
LoadingProgress.setValue(%progress);
|
||||
Canvas.repaint();
|
||||
}
|
||||
|
||||
function onPhase1Complete()
|
||||
{
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Phase 2
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function onMissionDownloadPhase2()
|
||||
{
|
||||
// Reset the loading progress controls:
|
||||
LoadingProgress.setValue(0);
|
||||
LoadingProgressTxt.setValue("LOADING OBJECTS");
|
||||
Canvas.repaint();
|
||||
}
|
||||
|
||||
function onPhase2Progress(%progress)
|
||||
{
|
||||
LoadingProgress.setValue(%progress);
|
||||
Canvas.repaint();
|
||||
}
|
||||
|
||||
function onPhase2Complete()
|
||||
{
|
||||
}
|
||||
|
||||
function onFileChunkReceived(%fileName, %ofs, %size)
|
||||
{
|
||||
LoadingProgress.setValue(%ofs / %size);
|
||||
LoadingProgressTxt.setValue("Downloading " @ %fileName @ "...");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Phase 3
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function onMissionDownloadPhase3()
|
||||
{
|
||||
LoadingProgress.setValue(0);
|
||||
LoadingProgressTxt.setValue("LIGHTING MISSION");
|
||||
Canvas.repaint();
|
||||
}
|
||||
|
||||
function onPhase3Progress(%progress)
|
||||
{
|
||||
LoadingProgress.setValue(%progress);
|
||||
}
|
||||
|
||||
function onPhase3Complete()
|
||||
{
|
||||
LoadingProgress.setValue( 1 );
|
||||
$lightingMission = false;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Mission loading done!
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function onMissionDownloadComplete()
|
||||
{
|
||||
// Client will shortly be dropped into the game, so this is
|
||||
// good place for any last minute gui cleanup.
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Before downloading a mission, the server transmits the mission
|
||||
// information through these messages.
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
addMessageCallback( 'MsgLoadInfo', handleLoadInfoMessage );
|
||||
addMessageCallback( 'MsgLoadDescripition', handleLoadDescriptionMessage );
|
||||
addMessageCallback( 'MsgLoadInfoDone', handleLoadInfoDoneMessage );
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function handleLoadInfoMessage( %msgType, %msgString, %mapName ) {
|
||||
|
||||
// Need to pop up the loading gui to display this stuff.
|
||||
if (!LoadingGui.isAwake())
|
||||
Canvas.setContent("LoadingGui");
|
||||
|
||||
// Clear all of the loading info lines:
|
||||
for( %line = 0; %line < LoadingGui.qLineCount; %line++ )
|
||||
LoadingGui.qLine[%line] = "";
|
||||
LoadingGui.qLineCount = 0;
|
||||
|
||||
//
|
||||
LOAD_MapName.setText( %mapName );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function handleLoadDescriptionMessage( %msgType, %msgString, %line )
|
||||
{
|
||||
LoadingGui.qLine[LoadingGui.qLineCount] = %line;
|
||||
LoadingGui.qLineCount++;
|
||||
|
||||
// Gather up all the previous lines, append the current one
|
||||
// and stuff it into the control
|
||||
%text = "<spush><font:Arial:16>";
|
||||
|
||||
for( %line = 0; %line < LoadingGui.qLineCount - 1; %line++ )
|
||||
%text = %text @ LoadingGui.qLine[%line] @ " ";
|
||||
%text = %text @ LoadingGui.qLine[%line] @ "<spop>";
|
||||
|
||||
LOAD_MapDescription.setText( %text );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
function handleLoadInfoDoneMessage( %msgType, %msgString )
|
||||
{
|
||||
// This will get called after the last description line is sent.
|
||||
}
|
||||
BIN
Torque/SDK/example/demo/client/scripts/missionDownload.cs.dso
Normal file
566
Torque/SDK/example/demo/client/scripts/optionsDlg.cs
Normal file
@@ -0,0 +1,566 @@
|
||||
|
||||
function OptionsDlg::onWake(%this)
|
||||
{
|
||||
OptGraphicsButton.performClick();
|
||||
%buffer = getDisplayDeviceList();
|
||||
%count = getFieldCount( %buffer );
|
||||
OptGraphicsDriverMenu.clear();
|
||||
OptScreenshotMenu.init();
|
||||
OptScreenshotMenu.setValue($pref::Video::screenShotFormat);
|
||||
for(%i = 0; %i < %count; %i++)
|
||||
OptGraphicsDriverMenu.add(getField(%buffer, %i), %i);
|
||||
%selId = OptGraphicsDriverMenu.findText( $pref::Video::displayDevice );
|
||||
if ( %selId == -1 )
|
||||
%selId = 0; // How did THAT happen?
|
||||
OptGraphicsDriverMenu.setSelected( %selId );
|
||||
OptGraphicsDriverMenu.onSelect( %selId, "" );
|
||||
|
||||
// Audio
|
||||
OptAudioUpdate();
|
||||
OptAudioVolumeMaster.setValue($pref::Audio::masterVolume);
|
||||
OptAudioVolumeShell.setValue( $pref::Audio::channelVolume[$GuiAudioType]);
|
||||
OptAudioVolumeSim.setValue( $pref::Audio::channelVolume[$SimAudioType]);
|
||||
OptAudioDriverList.clear();
|
||||
OptAudioDriverList.add("OpenAL", 1);
|
||||
OptAudioDriverList.add("none", 2);
|
||||
%selId = OptAudioDriverList.findText($pref::Audio::driver);
|
||||
if ( %selId == -1 )
|
||||
%selId = 0; // How did THAT happen?
|
||||
OptAudioDriverList.setSelected( %selId );
|
||||
OptAudioDriverList.onSelect( %selId, "" );
|
||||
|
||||
OptRemapList.fillList();
|
||||
}
|
||||
|
||||
function OptionsDlg::onSleep(%this)
|
||||
{
|
||||
// write out the control config into the demo/client/config.cs file
|
||||
moveMap.save( "demo/client/config.cs" );
|
||||
|
||||
}
|
||||
|
||||
function OptGraphicsDriverMenu::onSelect( %this, %id, %text )
|
||||
{
|
||||
// Attempt to keep the same res and bpp settings:
|
||||
if ( OptGraphicsResolutionMenu.size() > 0 )
|
||||
%prevRes = OptGraphicsResolutionMenu.getText();
|
||||
else
|
||||
%prevRes = getWords( $pref::Video::resolution, 0, 1 );
|
||||
|
||||
// Check if this device is full-screen only:
|
||||
if ( isDeviceFullScreenOnly( %this.getText() ) )
|
||||
{
|
||||
OptGraphicsFullscreenToggle.setValue( true );
|
||||
OptGraphicsFullscreenToggle.setActive( false );
|
||||
OptGraphicsFullscreenToggle.onAction();
|
||||
}
|
||||
else
|
||||
OptGraphicsFullscreenToggle.setActive( true );
|
||||
|
||||
if ( OptGraphicsFullscreenToggle.getValue() )
|
||||
{
|
||||
if ( OptGraphicsBPPMenu.size() > 0 )
|
||||
%prevBPP = OptGraphicsBPPMenu.getText();
|
||||
else
|
||||
%prevBPP = getWord( $pref::Video::resolution, 2 );
|
||||
}
|
||||
|
||||
// Fill the resolution and bit depth lists:
|
||||
OptGraphicsResolutionMenu.init( %this.getText(), OptGraphicsFullscreenToggle.getValue() );
|
||||
OptGraphicsBPPMenu.init( %this.getText() );
|
||||
|
||||
// Try to select the previous settings:
|
||||
%selId = OptGraphicsResolutionMenu.findText( %prevRes );
|
||||
if ( %selId == -1 )
|
||||
%selId = 0;
|
||||
OptGraphicsResolutionMenu.setSelected( %selId );
|
||||
|
||||
if ( OptGraphicsFullscreenToggle.getValue() )
|
||||
{
|
||||
%selId = OptGraphicsBPPMenu.findText( %prevBPP );
|
||||
if ( %selId == -1 )
|
||||
%selId = 0;
|
||||
OptGraphicsBPPMenu.setSelected( %selId );
|
||||
OptGraphicsBPPMenu.setText( OptGraphicsBPPMenu.getTextById( %selId ) );
|
||||
}
|
||||
else
|
||||
OptGraphicsBPPMenu.setText( "Default" );
|
||||
|
||||
}
|
||||
|
||||
function OptGraphicsResolutionMenu::init( %this, %device, %fullScreen )
|
||||
{
|
||||
%this.clear();
|
||||
%resList = getResolutionList( %device );
|
||||
%resCount = getFieldCount( %resList );
|
||||
%deskRes = getDesktopResolution();
|
||||
|
||||
%count = 0;
|
||||
for ( %i = 0; %i < %resCount; %i++ )
|
||||
{
|
||||
%res = getWords( getField( %resList, %i ), 0, 1 );
|
||||
|
||||
if ( !%fullScreen )
|
||||
{
|
||||
if ( firstWord( %res ) >= firstWord( %deskRes ) )
|
||||
continue;
|
||||
if ( getWord( %res, 1 ) >= getWord( %deskRes, 1 ) )
|
||||
continue;
|
||||
}
|
||||
|
||||
// Only add to list if it isn't there already:
|
||||
if ( %this.findText( %res ) == -1 )
|
||||
{
|
||||
%this.add( %res, %count );
|
||||
%count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function OptGraphicsFullscreenToggle::onAction(%this)
|
||||
{
|
||||
Parent::onAction();
|
||||
%prevRes = OptGraphicsResolutionMenu.getText();
|
||||
|
||||
// Update the resolution menu with the new options
|
||||
OptGraphicsResolutionMenu.init( OptGraphicsDriverMenu.getText(), %this.getValue() );
|
||||
|
||||
// Set it back to the previous resolution if the new mode supports it.
|
||||
%selId = OptGraphicsResolutionMenu.findText( %prevRes );
|
||||
if ( %selId == -1 )
|
||||
%selId = 0;
|
||||
OptGraphicsResolutionMenu.setSelected( %selId );
|
||||
}
|
||||
|
||||
|
||||
function OptGraphicsBPPMenu::init( %this, %device )
|
||||
{
|
||||
%this.clear();
|
||||
|
||||
if ( %device $= "Voodoo2" )
|
||||
%this.add( "16", 0 );
|
||||
else
|
||||
{
|
||||
%resList = getResolutionList( %device );
|
||||
%resCount = getFieldCount( %resList );
|
||||
%count = 0;
|
||||
for ( %i = 0; %i < %resCount; %i++ )
|
||||
{
|
||||
%bpp = getWord( getField( %resList, %i ), 2 );
|
||||
|
||||
// Only add to list if it isn't there already:
|
||||
if ( %this.findText( %bpp ) == -1 )
|
||||
{
|
||||
%this.add( %bpp, %count );
|
||||
%count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function OptScreenshotMenu::init( %this )
|
||||
{
|
||||
if( %this.findText("PNG") == -1 )
|
||||
%this.add("PNG", 0);
|
||||
if( %this.findText("JPEG") == - 1 )
|
||||
%this.add("JPEG", 1);
|
||||
}
|
||||
|
||||
function optionsDlg::applyGraphics( %this )
|
||||
{
|
||||
%newDriver = OptGraphicsDriverMenu.getText();
|
||||
%newRes = OptGraphicsResolutionMenu.getText();
|
||||
%newBpp = OptGraphicsBPPMenu.getText();
|
||||
%newFullScreen = OptGraphicsFullscreenToggle.getValue();
|
||||
$pref::Video::screenShotFormat = OptScreenshotMenu.getText();
|
||||
|
||||
if ( %newDriver !$= $pref::Video::displayDevice )
|
||||
{
|
||||
setDisplayDevice( %newDriver, firstWord( %newRes ), getWord( %newRes, 1 ), %newBpp, %newFullScreen );
|
||||
//OptionsDlg::deviceDependent( %this );
|
||||
}
|
||||
else
|
||||
setScreenMode( firstWord( %newRes ), getWord( %newRes, 1 ), %newBpp, %newFullScreen );
|
||||
}
|
||||
|
||||
|
||||
|
||||
$RemapCount = 0;
|
||||
$RemapName[$RemapCount] = "Forward";
|
||||
$RemapCmd[$RemapCount] = "moveforward";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Backward";
|
||||
$RemapCmd[$RemapCount] = "movebackward";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Strafe Left";
|
||||
$RemapCmd[$RemapCount] = "moveleft";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Strafe Right";
|
||||
$RemapCmd[$RemapCount] = "moveright";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Turn Left";
|
||||
$RemapCmd[$RemapCount] = "turnLeft";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Turn Right";
|
||||
$RemapCmd[$RemapCount] = "turnRight";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Look Up";
|
||||
$RemapCmd[$RemapCount] = "panUp";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Look Down";
|
||||
$RemapCmd[$RemapCount] = "panDown";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Jump";
|
||||
$RemapCmd[$RemapCount] = "jump";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Fire Weapon";
|
||||
$RemapCmd[$RemapCount] = "mouseFire";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Adjust Zoom";
|
||||
$RemapCmd[$RemapCount] = "setZoomFov";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Toggle Zoom";
|
||||
$RemapCmd[$RemapCount] = "toggleZoom";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Free Look";
|
||||
$RemapCmd[$RemapCount] = "toggleFreeLook";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Switch 1st/3rd";
|
||||
$RemapCmd[$RemapCount] = "toggleFirstPerson";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Chat to Everyone";
|
||||
$RemapCmd[$RemapCount] = "toggleMessageHud";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Message Hud PageUp";
|
||||
$RemapCmd[$RemapCount] = "pageMessageHudUp";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Message Hud PageDown";
|
||||
$RemapCmd[$RemapCount] = "pageMessageHudDown";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Resize Message Hud";
|
||||
$RemapCmd[$RemapCount] = "resizeMessageHud";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Show Scores";
|
||||
$RemapCmd[$RemapCount] = "showPlayerList";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Animation - Wave";
|
||||
$RemapCmd[$RemapCount] = "celebrationWave";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Animation - Salute";
|
||||
$RemapCmd[$RemapCount] = "celebrationSalute";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Suicide";
|
||||
$RemapCmd[$RemapCount] = "suicide";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Toggle Camera";
|
||||
$RemapCmd[$RemapCount] = "toggleCamera";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Drop Camera at Player";
|
||||
$RemapCmd[$RemapCount] = "dropCameraAtPlayer";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Drop Player at Camera";
|
||||
$RemapCmd[$RemapCount] = "dropPlayerAtCamera";
|
||||
$RemapCount++;
|
||||
$RemapName[$RemapCount] = "Bring up Options Dialog";
|
||||
$RemapCmd[$RemapCount] = "bringUpOptions";
|
||||
$RemapCount++;
|
||||
|
||||
|
||||
function restoreDefaultMappings()
|
||||
{
|
||||
moveMap.delete();
|
||||
exec( "~/scripts/default.bind.cs" );
|
||||
OptRemapList.fillList();
|
||||
}
|
||||
|
||||
function getMapDisplayName( %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 buildFullMapString( %index )
|
||||
{
|
||||
%name = $RemapName[%index];
|
||||
%cmd = $RemapCmd[%index];
|
||||
|
||||
%temp = moveMap.getBinding( %cmd );
|
||||
%device = getField( %temp, 0 );
|
||||
%object = getField( %temp, 1 );
|
||||
if ( %device !$= "" && %object !$= "" )
|
||||
%mapString = getMapDisplayName( %device, %object );
|
||||
else
|
||||
%mapString = "";
|
||||
|
||||
return( %name TAB %mapString );
|
||||
}
|
||||
|
||||
function OptRemapList::fillList( %this )
|
||||
{
|
||||
%this.clear();
|
||||
for ( %i = 0; %i < $RemapCount; %i++ )
|
||||
%this.addRow( %i, buildFullMapString( %i ) );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function OptRemapList::doRemap( %this )
|
||||
{
|
||||
%selId = %this.getSelectedId();
|
||||
%name = $RemapName[%selId];
|
||||
|
||||
OptRemapText.setValue( "REMAP \"" @ %name @ "\"" );
|
||||
OptRemapInputCtrl.index = %selId;
|
||||
Canvas.pushDialog( RemapDlg );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function redoMapping( %device, %action, %cmd, %oldIndex, %newIndex )
|
||||
{
|
||||
//%actionMap.bind( %device, %action, $RemapCmd[%newIndex] );
|
||||
moveMap.bind( %device, %action, %cmd );
|
||||
OptRemapList.setRowById( %oldIndex, buildFullMapString( %oldIndex ) );
|
||||
OptRemapList.setRowById( %newIndex, buildFullMapString( %newIndex ) );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function findRemapCmdIndex( %command )
|
||||
{
|
||||
for ( %i = 0; %i < $RemapCount; %i++ )
|
||||
{
|
||||
if ( %command $= $RemapCmd[%i] )
|
||||
return( %i );
|
||||
}
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
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];
|
||||
|
||||
// First check to see if the given action is already mapped:
|
||||
%prevMap = moveMap.getCommand( %device, %action );
|
||||
if ( %prevMap !$= %cmd )
|
||||
{
|
||||
if ( %prevMap $= "" )
|
||||
{
|
||||
moveMap.bind( %device, %action, %cmd );
|
||||
OptRemapList.setRowById( %this.index, buildFullMapString( %this.index ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
%mapName = getMapDisplayName( %device, %action );
|
||||
%prevMapIndex = findRemapCmdIndex( %prevMap );
|
||||
if ( %prevMapIndex == -1 )
|
||||
MessageBoxOK( "REMAP FAILED", "\"" @ %mapName @ "\" is already bound to a non-remappable command!" );
|
||||
else
|
||||
{
|
||||
%prevCmdName = $RemapName[%prevMapIndex];
|
||||
MessageBoxYesNo( "WARNING",
|
||||
"\"" @ %mapName @ "\" is already bound to \""
|
||||
@ %prevCmdName @ "\"!\nDo you want to undo this mapping?",
|
||||
"redoMapping(" @ %device @ ", \"" @ %action @ "\", \"" @ %cmd @ "\", " @ %prevMapIndex @ ", " @ %this.index @ ");", "" );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Audio
|
||||
function OptAudioUpdate()
|
||||
{
|
||||
// set the driver text
|
||||
%text = "Vendor: " @ alGetString("AL_VENDOR") @
|
||||
"\nVersion: " @ alGetString("AL_VERSION") @
|
||||
"\nRenderer: " @ alGetString("AL_RENDERER") @
|
||||
"\nExtensions: " @ alGetString("AL_EXTENSIONS");
|
||||
OptAudioInfo.setText(%text);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Channel 0 is unused in-game, but is used here to test master volume.
|
||||
|
||||
new AudioDescription(AudioChannel0)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 0;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioChannel1)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 1;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioChannel2)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 2;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioChannel3)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 3;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioChannel4)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 4;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioChannel5)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 5;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioChannel6)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 6;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioChannel7)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 7;
|
||||
};
|
||||
|
||||
new AudioDescription(AudioChannel8)
|
||||
{
|
||||
volume = 1.0;
|
||||
isLooping= false;
|
||||
is3D = false;
|
||||
type = 8;
|
||||
};
|
||||
|
||||
$AudioTestHandle = 0;
|
||||
|
||||
function OptAudioUpdateMasterVolume(%volume)
|
||||
{
|
||||
if (%volume == $pref::Audio::masterVolume)
|
||||
return;
|
||||
alxListenerf(AL_GAIN_LINEAR, %volume);
|
||||
$pref::Audio::masterVolume = %volume;
|
||||
if (!alxIsPlaying($AudioTestHandle))
|
||||
{
|
||||
$AudioTestHandle = alxCreateSource("AudioChannel0", expandFilename("~/data/sound/testing.ogg"));
|
||||
alxPlay($AudioTestHandle);
|
||||
}
|
||||
}
|
||||
|
||||
function OptAudioUpdateChannelVolume(%channel, %volume)
|
||||
{
|
||||
if (%channel < 1 || %channel > 8)
|
||||
return;
|
||||
|
||||
if (%volume == $pref::Audio::channelVolume[%channel])
|
||||
return;
|
||||
|
||||
alxSetChannelVolume(%channel, %volume);
|
||||
$pref::Audio::channelVolume[%channel] = %volume;
|
||||
if (!alxIsPlaying($AudioTestHandle))
|
||||
{
|
||||
$AudioTestHandle = alxCreateSource("AudioChannel"@%channel, expandFilename("~/data/sound/testing.ogg"));
|
||||
alxPlay($AudioTestHandle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function OptAudioDriverList::onSelect( %this, %id, %text )
|
||||
{
|
||||
if (%text $= "")
|
||||
return;
|
||||
|
||||
if ($pref::Audio::driver $= %text)
|
||||
return;
|
||||
|
||||
$pref::Audio::driver = %text;
|
||||
OpenALInit();
|
||||
}
|
||||
BIN
Torque/SDK/example/demo/client/scripts/optionsDlg.cs.dso
Normal file
134
Torque/SDK/example/demo/client/scripts/pageGui.cs
Normal file
@@ -0,0 +1,134 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PageGui is the main TSControl through which the game is viewed.
|
||||
// The PageGui also contains the hud controls.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function PageGui::onWake(%this)
|
||||
{
|
||||
%this.pageNumber = 0;
|
||||
}
|
||||
|
||||
function PageGui::onSleep(%this)
|
||||
{
|
||||
}
|
||||
|
||||
function PageGui::pageName(%this, %index)
|
||||
{
|
||||
if (%index $= "")
|
||||
{
|
||||
%index = %this.pageNumber;
|
||||
echo ("PAGE: " @ %this.pageNumber);
|
||||
}
|
||||
return %this.thread @ "_page" @ %index;
|
||||
}
|
||||
|
||||
function PageGui::isNextPage(%this)
|
||||
{
|
||||
for (%num = %this.pageNumber + 1; !isObject(%this.pageName(%num)); %num += 1)
|
||||
if (%num > 100)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function PageGui::isPrevPage(%this)
|
||||
{
|
||||
for (%num = %this.pageNumber - 1; !isObject(%this.pageName(%num)); %num -= 1)
|
||||
if (%num < 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function PageGui::pushThread(%this, %thread)
|
||||
{
|
||||
if (%this.thread !$= "" )
|
||||
%this.threadStack = %this.thread @ " " @ %this.pageNUmber @ " " @ %this.threadStack;
|
||||
%this.popPage();
|
||||
%this.thread = %thread;
|
||||
%this.pushPage(1);
|
||||
%this.status();
|
||||
}
|
||||
|
||||
function PageGui::popThread(%this)
|
||||
{
|
||||
if (%this.threadStack !$= "" )
|
||||
{
|
||||
%this.popPage();
|
||||
%this.thread = firstWord(%this.threadStack);
|
||||
%this.threadStack = removeWord(%this.threadStack, 0);
|
||||
|
||||
%this.pageNumber = firstWord(%this.threadStack);
|
||||
%this.threadStack = removeWord(%this.threadStack, 0);
|
||||
}
|
||||
else
|
||||
%this.thread = "";
|
||||
%this.status();
|
||||
}
|
||||
|
||||
function PageGui::status(%this)
|
||||
{
|
||||
echo ("----------------------");
|
||||
echo ("THREADSTACK: " @ %this.threadStack);
|
||||
echo ("THREAD: " @ %this.thread);
|
||||
echo ("PAGE: " @ %this.pageNumber);
|
||||
}
|
||||
|
||||
function PageGui::popPage(%this)
|
||||
{
|
||||
echo ("POP: " @ %this.pageName());
|
||||
if (%this.pageNumber > 0)
|
||||
Canvas.popDialog(%this.pageName());
|
||||
}
|
||||
|
||||
function PageGui::pushPage(%this, %pageNumber)
|
||||
{
|
||||
// Load up the new page
|
||||
%this.pageNumber = %pageNumber;
|
||||
%page = %this.pageName();
|
||||
Canvas.pushDialog(%page);
|
||||
|
||||
// Update the arrows to reflect next/prev page availabilty
|
||||
PageGuiNextPage.setVisible(%this.isNextPage());
|
||||
//PageGuiPrevPage.setVisible(%this.isPrevPage());
|
||||
|
||||
// Extract demo text from page object
|
||||
PageGuiTitle.setText(
|
||||
"<font:Arial Bold:32><color:ffffff><just:right>" @
|
||||
%page.title);
|
||||
%this.status();
|
||||
}
|
||||
|
||||
function PageGui::setPageNumber(%this,%pageNumber)
|
||||
{
|
||||
// Pop off any current page...
|
||||
%this.popPage();
|
||||
|
||||
// Load up the new page
|
||||
%this.pushPage(%pageNumber);
|
||||
}
|
||||
|
||||
function PageGui::nextPage(%this)
|
||||
{
|
||||
if (%this.isNextPage())
|
||||
%this.setPageNumber(%this.pageNumber + 1);
|
||||
}
|
||||
|
||||
function PageGui::prevPage(%this)
|
||||
{
|
||||
if (%this.isPrevPage())
|
||||
%this.setPageNumber(%this.pageNumber - 1);
|
||||
else
|
||||
{
|
||||
%this.popThread();
|
||||
if (%this.thread !$= "")
|
||||
%this.pushPage(%this.pageNumber);
|
||||
else
|
||||
Canvas.setContent(mainMenuGui);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
52
Torque/SDK/example/demo/client/scripts/playGui.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// PlayGui is the main TSControl through which the game is viewed.
|
||||
// The PlayGui also contains the hud controls.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function PlayGui::onWake(%this)
|
||||
{
|
||||
// Turn off any shell sounds...
|
||||
// alxStop( ... );
|
||||
|
||||
$enableDirectInput = "1";
|
||||
activateDirectInput();
|
||||
|
||||
// Message hud dialog
|
||||
Canvas.pushDialog( MainChatHud );
|
||||
chatHud.attach(HudMessageVector);
|
||||
|
||||
// just update the action map here
|
||||
moveMap.push();
|
||||
|
||||
// hack city - these controls are floating around and need to be clamped
|
||||
schedule(0, 0, "refreshCenterTextCtrl");
|
||||
schedule(0, 0, "refreshBottomTextCtrl");
|
||||
}
|
||||
|
||||
function PlayGui::onSleep(%this)
|
||||
{
|
||||
Canvas.popDialog( MainChatHud );
|
||||
|
||||
// pop the keymaps
|
||||
moveMap.pop();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function refreshBottomTextCtrl()
|
||||
{
|
||||
BottomPrintText.position = "0 0";
|
||||
}
|
||||
|
||||
function refreshCenterTextCtrl()
|
||||
{
|
||||
CenterPrintText.position = "0 0";
|
||||
}
|
||||
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/playGui.cs.dso
Normal file
32
Torque/SDK/example/demo/client/scripts/playerList.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Hook into the client update messages to maintain our player list
|
||||
// and scoreboard.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
addMessageCallback('MsgClientJoin', handleClientJoin);
|
||||
addMessageCallback('MsgClientDrop', handleClientDrop);
|
||||
addMessageCallback('MsgClientScoreChanged', handleClientScoreChanged);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function handleClientJoin(%msgType, %msgString, %clientName, %clientId,
|
||||
%guid, %score, %isAI, %isAdmin, %isSuperAdmin )
|
||||
{
|
||||
PlayerListGui.update(%clientId,detag(%clientName),%isSuperAdmin,
|
||||
%isAdmin,%isAI,%score);
|
||||
}
|
||||
|
||||
function handleClientDrop(%msgType, %msgString, %clientName, %clientId)
|
||||
{
|
||||
PlayerListGui.remove(%clientId);
|
||||
}
|
||||
|
||||
function handleClientScoreChanged(%msgType, %msgString, %score, %clientId)
|
||||
{
|
||||
PlayerListGui.updateScore(%clientId,%score);
|
||||
}
|
||||
BIN
Torque/SDK/example/demo/client/scripts/playerList.cs.dso
Normal file
38
Torque/SDK/example/demo/client/scripts/racingGui.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// RacingGui is the main TSControl through which the racing game is viewed.
|
||||
// The RacingGui also contains the hud controls.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function RacingGui::onWake(%this)
|
||||
{
|
||||
// Turn off any shell sounds...
|
||||
// alxStop( ... );
|
||||
|
||||
$enableDirectInput = "1";
|
||||
activateDirectInput();
|
||||
|
||||
// Message hud dialog
|
||||
Canvas.pushDialog(MainChatHud);
|
||||
chatHud.attach(HudMessageVector);
|
||||
|
||||
// Push the game's action key mapings
|
||||
moveMap.push();
|
||||
|
||||
// Force third person view as the default.
|
||||
$firstPerson = false;
|
||||
}
|
||||
|
||||
function RacingGui::onSleep(%this)
|
||||
{
|
||||
Canvas.popDialog(MainChatHud);
|
||||
|
||||
// Pop the keymaps
|
||||
moveMap.pop();
|
||||
}
|
||||
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/racingGui.cs.dso
Normal file
82
Torque/SDK/example/demo/client/scripts/sceneGui.cs
Normal file
@@ -0,0 +1,82 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// SceneGui is the main TSControl through which the demo is viewed.
|
||||
// The SceneGui also contains the hud controls.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function SceneGui::onWake(%this)
|
||||
{
|
||||
// Turn off any shell sounds...
|
||||
// alxStop( ... );
|
||||
|
||||
$enableDirectInput = "1";
|
||||
activateDirectInput();
|
||||
|
||||
// Update the action map
|
||||
moveMap.push();
|
||||
|
||||
// Push the menu system
|
||||
OverlayBuyNow.setVisible(false);
|
||||
Canvas.pushdialog(OverlayDlg);
|
||||
}
|
||||
|
||||
function SceneGui::onSleep(%this)
|
||||
{
|
||||
// pop the keymaps
|
||||
moveMap.pop();
|
||||
}
|
||||
|
||||
function SceneGui::isNextScene(%this)
|
||||
{
|
||||
return %this.sceneNumber < ("MissionGroup/Scenes".getCount() - 1);
|
||||
}
|
||||
|
||||
function SceneGui::isPrevScene(%this)
|
||||
{
|
||||
return %this.sceneNumber > 0;
|
||||
}
|
||||
|
||||
function SceneGui::setSceneNumber(%this,%sceneNumber)
|
||||
{
|
||||
// Set the current room # and update the arrows
|
||||
%this.sceneNumber = %sceneNumber;
|
||||
|
||||
// Update the navigation buttons
|
||||
OverlayNextPage.setVisible(true);
|
||||
OverlayNextPage.command = %this.isNextScene()? "SceneGui.nextScene();" : "escapeFromGame();";
|
||||
OverlayPrevPage.setVisible(true); //%this.isPrevScene());
|
||||
OverlayPrevPage.command = "SceneGui.prevScene();";
|
||||
OverlayQuitPage.setVisible(false);
|
||||
|
||||
// Activate the scene object
|
||||
%room = Scene::activateScene(%this.sceneNumber);
|
||||
|
||||
// Extract demo text from room object
|
||||
OverlayTitle.setText(
|
||||
"<just:center><shadowcolor:000000><shadow:1:1>" @
|
||||
%room.title);
|
||||
OverlayDesc.setText(
|
||||
"<font:Arial Bold:18><color:ffffff>" @
|
||||
%room.description);
|
||||
}
|
||||
|
||||
function SceneGui::nextScene(%this)
|
||||
{
|
||||
if (%this.isNextScene())
|
||||
%this.setSceneNumber(%this.sceneNumber + 1);
|
||||
}
|
||||
|
||||
function SceneGui::prevScene(%this)
|
||||
{
|
||||
if (%this.isPrevScene())
|
||||
%this.setSceneNumber(%this.sceneNumber - 1);
|
||||
else
|
||||
escapeFromGame();
|
||||
}
|
||||
|
||||
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/sceneGui.cs.dso
Normal file
168
Torque/SDK/example/demo/client/scripts/serverConnection.cs
Normal file
@@ -0,0 +1,168 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Functions dealing with connecting to a server
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Server connection error
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
addMessageCallback( 'MsgConnectionError', handleConnectionErrorMessage );
|
||||
|
||||
function handleConnectionErrorMessage(%msgType, %msgString, %msgError)
|
||||
{
|
||||
// On connect the server transmits a message to display if there
|
||||
// are any problems with the connection. Most connection errors
|
||||
// are game version differences, so hopefully the server message
|
||||
// will tell us where to get the latest version of the game.
|
||||
$ServerConnectionErrorMessage = %msgError;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// GameConnection client callbacks
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function GameConnection::initialControlSet(%this)
|
||||
{
|
||||
echo ("*** Initial Control Object");
|
||||
|
||||
// The first control object has been set by the server
|
||||
// and we are now ready to go.
|
||||
|
||||
// first check if the editor is active
|
||||
if (!Editor::checkActiveLoadDone())
|
||||
{
|
||||
// Activate if not already set...
|
||||
if (Canvas.getContent() != $Client::GameGUI.getId())
|
||||
Canvas.setContent($Client::GameGUI);
|
||||
}
|
||||
}
|
||||
|
||||
function GameConnection::setLagIcon(%this, %state)
|
||||
{
|
||||
if (%this.getAddress() $= "local")
|
||||
return;
|
||||
LagIcon.setVisible(%state $= "true");
|
||||
}
|
||||
|
||||
function GameConnection::onConnectionAccepted(%this)
|
||||
{
|
||||
// Called on the new connection object after connect() succeeds.
|
||||
LagIcon.setVisible(false);
|
||||
}
|
||||
|
||||
function GameConnection::onConnectionTimedOut(%this)
|
||||
{
|
||||
// Called when an established connection times out
|
||||
disconnectedCleanup();
|
||||
MessageBoxOK( "TIMED OUT", "The server connection has timed out.");
|
||||
}
|
||||
|
||||
function GameConnection::onConnectionDropped(%this, %msg)
|
||||
{
|
||||
// Established connection was dropped by the server
|
||||
disconnectedCleanup();
|
||||
MessageBoxOK( "DISCONNECT", "The server has dropped the connection: " @ %msg);
|
||||
}
|
||||
|
||||
function GameConnection::onConnectionError(%this, %msg)
|
||||
{
|
||||
// General connection error, usually raised by ghosted objects
|
||||
// initialization problems, such as missing files. We'll display
|
||||
// the server's connection error message.
|
||||
disconnectedCleanup();
|
||||
MessageBoxOK( "DISCONNECT", $ServerConnectionErrorMessage @ " (" @ %msg @ ")" );
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Connection Failed Events
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function GameConnection::onConnectRequestRejected( %this, %msg )
|
||||
{
|
||||
switch$(%msg)
|
||||
{
|
||||
case "CR_INVALID_PROTOCOL_VERSION":
|
||||
%error = "Incompatible protocol version: Your game version is not compatible with this server.";
|
||||
case "CR_INVALID_CONNECT_PACKET":
|
||||
%error = "Internal Error: badly formed network packet";
|
||||
case "CR_YOUAREBANNED":
|
||||
%error = "You are not allowed to play on this server.";
|
||||
case "CR_SERVERFULL":
|
||||
%error = "This server is full.";
|
||||
case "CHR_PASSWORD":
|
||||
// XXX Should put up a password-entry dialog.
|
||||
if ($Client::Password $= "")
|
||||
MessageBoxOK( "REJECTED", "That server requires a password.");
|
||||
else {
|
||||
$Client::Password = "";
|
||||
MessageBoxOK( "REJECTED", "That password is incorrect.");
|
||||
}
|
||||
return;
|
||||
case "CHR_PROTOCOL":
|
||||
%error = "Incompatible protocol version: Your game version is not compatible with this server.";
|
||||
case "CHR_CLASSCRC":
|
||||
%error = "Incompatible game classes: Your game version is not compatible with this server.";
|
||||
case "CHR_INVALID_CHALLENGE_PACKET":
|
||||
%error = "Internal Error: Invalid server response packet";
|
||||
default:
|
||||
%error = "Connection error. Please try another server. Error code: (" @ %msg @ ")";
|
||||
}
|
||||
disconnectedCleanup();
|
||||
MessageBoxOK( "REJECTED", %error);
|
||||
}
|
||||
|
||||
function GameConnection::onConnectRequestTimedOut(%this)
|
||||
{
|
||||
disconnectedCleanup();
|
||||
MessageBoxOK( "TIMED OUT", "Your connection to the server timed out." );
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Disconnect
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
function disconnect()
|
||||
{
|
||||
// Delete the connection if it's still there.
|
||||
if (isObject(ServerConnection))
|
||||
ServerConnection.delete();
|
||||
disconnectedCleanup();
|
||||
|
||||
// Call destroyServer in case we're hosting
|
||||
destroyServer();
|
||||
}
|
||||
|
||||
function disconnectedCleanup()
|
||||
{
|
||||
// Clear misc script stuff
|
||||
HudMessageVector.clear();
|
||||
|
||||
// Terminate all playing sounds
|
||||
alxStopAll();
|
||||
if (isObject(MusicPlayer))
|
||||
MusicPlayer.stop();
|
||||
|
||||
//
|
||||
LagIcon.setVisible(false);
|
||||
PlayerListGui.clear();
|
||||
|
||||
// Clear all print messages
|
||||
clientCmdclearBottomPrint();
|
||||
clientCmdClearCenterPrint();
|
||||
|
||||
// Back to the launch screen
|
||||
if (Canvas.getContent() != MainMenuGui.getId())
|
||||
Canvas.setContent(MainMenuGui);
|
||||
|
||||
// Dump anything we're not using
|
||||
clearTextureHolds();
|
||||
purgeResources();
|
||||
}
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/serverConnection.cs.dso
Normal file
96
Torque/SDK/example/demo/client/scripts/startMissionGui.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//----------------------------------------
|
||||
function StartMissionGui::onWake(%this)
|
||||
{
|
||||
SM_missionList.clear();
|
||||
%i = 0;
|
||||
for(%file = findFirstFile($Server::MissionFileSpec); %file !$= ""; %file = findNextFile($Server::MissionFileSpec))
|
||||
if (strStr(%file, "/CVS/") == -1)
|
||||
SM_missionList.addRow(%i++, getMissionDisplayName(%file) @ "\t" @ %file );
|
||||
SM_missionList.sort(0);
|
||||
SM_missionList.setSelectedRow(0);
|
||||
SM_missionList.scrollVisible(0);
|
||||
|
||||
// Override the next page command...
|
||||
OverlayNextPage.command = "StartMissionGui.nextPage();";
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------
|
||||
function StartMissionGui::nextPage(%this)
|
||||
{
|
||||
if (StartMissionGuiCheck.getValue()) {
|
||||
Canvas.setContent(LoadingGui);
|
||||
LOAD_MapName.setText( "Creating Server" );
|
||||
LOAD_MapDescription.setText( "<font:Arial:16>Please wait while the local server is started... this server will be open to local lan and internet connections.");
|
||||
Canvas.repaint();
|
||||
%this.startServer();
|
||||
}
|
||||
else
|
||||
MainMenuGui.nextPage();
|
||||
}
|
||||
|
||||
function StartMissionGui::startServer(%this)
|
||||
{
|
||||
createServer("MultiPlayer", "demo/data/missions/"@$Client::GameType@".mis");
|
||||
%conn = new GameConnection(ServerConnection);
|
||||
RootGroup.add(ServerConnection);
|
||||
%conn.setConnectArgs($pref::Player::Name);
|
||||
%conn.setJoinPassword($Client::Password);
|
||||
%conn.connectLocal();
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------
|
||||
function StartMissionGuiText::onWake(%this)
|
||||
{
|
||||
// Indicate which text is to be displayed in the ML text control...
|
||||
%this.fileName = "demo/client/ui/missions/start_" @ $Client::GameType @ ".txt";
|
||||
echo("FileName: " @ %this.fileName);
|
||||
Parent::onWake(%this);
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------
|
||||
function getMissionDisplayName( %missionFile )
|
||||
{
|
||||
%file = new FileObject();
|
||||
|
||||
%MissionInfoObject = "";
|
||||
|
||||
if ( %file.openForRead( %missionFile ) ) {
|
||||
%inInfoBlock = false;
|
||||
|
||||
while ( !%file.isEOF() ) {
|
||||
%line = %file.readLine();
|
||||
%line = trim( %line );
|
||||
|
||||
if( %line $= "new ScriptObject(MissionInfo) {" )
|
||||
%inInfoBlock = true;
|
||||
else if( %inInfoBlock && %line $= "};" ) {
|
||||
%inInfoBlock = false;
|
||||
%MissionInfoObject = %MissionInfoObject @ %line;
|
||||
break;
|
||||
}
|
||||
|
||||
if( %inInfoBlock )
|
||||
%MissionInfoObject = %MissionInfoObject @ %line @ " ";
|
||||
}
|
||||
|
||||
%file.close();
|
||||
}
|
||||
%MissionInfoObject = "%MissionInfoObject = " @ %MissionInfoObject;
|
||||
eval( %MissionInfoObject );
|
||||
|
||||
%file.delete();
|
||||
|
||||
if( %MissionInfoObject.name !$= "" )
|
||||
return %MissionInfoObject.name;
|
||||
else
|
||||
return fileBase(%missionFile);
|
||||
}
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/scripts/startMissionGui.cs.dso
Normal file
7
Torque/SDK/example/demo/client/ui/0. About.hfl
Normal file
@@ -0,0 +1,7 @@
|
||||
<lmargin%:5><rmargin%:95><font:Arial:16>Thank you for checking out the Torque Game Engine Demo.
|
||||
|
||||
Visit <a:www.garagegames.com/makegames/>GarageGames Torque Store</a> to learn about other products that will help you make your game as well as the other engines and tools that round out the Torque Development Platform.
|
||||
|
||||
<font:Arial Bold:16>About GarageGames.com:<font:Arial:16> <a:www.garagegames.com>GarageGames</a> mission is to change the way games are made and played. GarageGames provides the technology, community and market to empower game makers to build commercial quality multiplatform games. Known for bringing the Torque Game Engine to independent developers for $100, GarageGames is located in Eugene, Oregon and on the web at <a:www.garagegames.com>GarageGames.com</a> and is the annual presenter of IndieGamesCon (Oct. 7-9,2005).
|
||||
|
||||
<font:Arial Bold:16>About the Torque Game Engine:<font:Arial:16> The <a:www.garagegames.com/products/1>Torque Game Engine</a> is a cross platform commercial quality AAA game engine with seamless indoor/outdoor rendering engine, state of the art skeletal animation, drag and drop GUI creation and a built-in world editor. TGE also features the latest in scripting, geometry, particle effects, and award winning multi-player networking code. TGE started life as the technology behind Tribes, Starsiege, and Tribes 2 and is currently being used by thousands of developers around the world to make innovative games such as <a:www.garagegames.com/products/15>MarbleBlast Gold</a>, <a:www.garagegames.com/products/5>Orbz</a>, <a:www.garagegames.com/products/12>ThinkTanks</a>, <a:www.garagegames.com/products/58>RocketBowl Plus</a>, <a:www.garagegames.com/products/29>DH: Lore Invasion</a>, and more.
|
||||
46
Torque/SDK/example/demo/client/ui/1. Credits.hfl
Normal file
@@ -0,0 +1,46 @@
|
||||
<just:center><lmargin%:5><rmargin%:95><font:Arial Bold:20>Torque Game Engine Demo Credits...
|
||||
<bitmap:demo/client/ui/seperator>
|
||||
<font:Arial Bold:20>GarageGames.com Staff<font:Arial:16>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=3>Jeff "MotoMan" Tunnell</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=1>Tim "Slacker" Gift</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=2>Rick "Entropy" Overman</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=55>Mark "Got Milk?" Frohnmayer</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=32699>Timothy Aste</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=4517>Robert Blanchet Jr.</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=33863>Benjamin Bradley</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=34011>Adam deGrandis</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=5249>Justin DuJardin</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=6452>Clark Fagot</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=985>Matt Fairfax</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=8863>Ben Garney</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=54612>Davey Jackson</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=1449>Joe Maruschak</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=22782>Mark McCoy</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=10185>Jay Moore</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=6645>John Quigley</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=5030>Brian "Twitch" Ramage</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=10513>Paul Scott</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=5263>Alex Swanson</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=20592>Josh Williams</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=370>Pat "Killer Bunny" Wilson</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=37827>Zachary Zadell</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=34977>Stephen Zepp</a>
|
||||
|
||||
<bitmap:demo/client/ui/seperator>
|
||||
<font:Arial Bold:20>Torque Community Contributors
|
||||
<a:www.garagegames.com/company/associates/>Special Thanks GarageGames Associates</a>
|
||||
|
||||
<bitmap:demo/client/ui/seperator>
|
||||
<font:Arial Bold:20>Special Thanks<font:Arial:16>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=21036>John Kabus</a> for use of the Torque Lighting Kit in this demo.
|
||||
|
||||
<bitmap:demo/client/ui/seperator>
|
||||
<font:Arial Bold:20>Torque Engine Original Programmers<font:Arial:16>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=438>Dave "Symlink" Moore</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=572>John "Uberbob" Folliard</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=4872>Greg "Jett" Lancaster</a>
|
||||
<a:www.garagegames.com/my/home/view.profile.php?qid=6019>Tim "Kidney Thief" Anderson</a>
|
||||
John "Sne/\ker" Alden
|
||||
Lincoln "Missing" Hutton
|
||||
Brad "BigDevDawg" Heinz
|
||||
Shawn Eastley
|
||||
25
Torque/SDK/example/demo/client/ui/1.1 Game Controls.hfl
Normal file
@@ -0,0 +1,25 @@
|
||||
<lmargin%:5><rmargin%:95><font:Arial Bold:20>Default Game Control Setup...<font:Arial:16>
|
||||
<tab:105,200>
|
||||
<font:Arial Bold:16>Movement<font:Arial:16>
|
||||
W Forward
|
||||
S Backward
|
||||
A Step left
|
||||
D Step right
|
||||
Space Jump
|
||||
Mouse Button Fire
|
||||
|
||||
<font:Arial Bold:16>View Control<font:Arial:16>
|
||||
E Zoom
|
||||
R Set zoom FOV
|
||||
TAB First/Third person camera
|
||||
Alt-C Toggle between camera/player
|
||||
|
||||
<font:Arial Bold:16>Chat<font:Arial:16>
|
||||
U Send public chat message
|
||||
|
||||
<font:Arial Bold:16>Misc Functions<font:Arial:16>
|
||||
Ctrl-O Open in-game options dialog
|
||||
F7 Drop the player at the camera
|
||||
F8 Drop the camera at the player
|
||||
F10 Open GUI editor
|
||||
F11 Open Mission/World editor
|
||||
55
Torque/SDK/example/demo/client/ui/AnimationSceneGUI.gui
Normal file
@@ -0,0 +1,55 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(AnimationSceneGUI) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
position = "466 191";
|
||||
extent = "140 30";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "AnimationOrcPlay(\"celwave\");";
|
||||
helpTag = "0";
|
||||
text = "Wave";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
position = "467 231";
|
||||
extent = "140 30";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "AnimationOrcPlay(\"celsalute\");";
|
||||
helpTag = "0";
|
||||
text = "Salute";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
position = "467 276";
|
||||
extent = "138 30";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "AnimationOrcPlay(\"range\");";
|
||||
helpTag = "0";
|
||||
text = "Range Test";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/AnimationSceneGui.gui.dso
Normal file
BIN
Torque/SDK/example/demo/client/ui/ChatHud.gui.dso
Normal file
61
Torque/SDK/example/demo/client/ui/DemoEditorAlert.gui
Normal file
@@ -0,0 +1,61 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(DemoEditorAlert) {
|
||||
Profile = "GuiDefaultProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
position = "0 0";
|
||||
Extent = "800 600";
|
||||
MinExtent = "8 8";
|
||||
Visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiWindowCtrl() {
|
||||
Profile = "GuiWindowProfile";
|
||||
HorizSizing = "center";
|
||||
VertSizing = "center";
|
||||
position = "200 80";
|
||||
Extent = "400 440";
|
||||
MinExtent = "300 200";
|
||||
Visible = "1";
|
||||
text = "Mission Editor";
|
||||
maxLength = "255";
|
||||
resizeWidth = "1";
|
||||
resizeHeight = "1";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "1";
|
||||
canMaximize = "1";
|
||||
MinSize = "50 50";
|
||||
closeCommand = "Canvas.popDialog(DemoEditorAlert);";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl(EditorAlertText) {
|
||||
Profile = "GuiMediumTextProfile";
|
||||
HorizSizing = "width";
|
||||
VertSizing = "bottom";
|
||||
position = "20 40";
|
||||
Extent = "380 264";
|
||||
MinExtent = "8 8";
|
||||
Visible = "1";
|
||||
lineSpacing = "12";
|
||||
allowColorChars = "1";
|
||||
maxChars = "-1";
|
||||
helpTag = "0";
|
||||
};
|
||||
new GuiButtonCtrl(OkayButton) {
|
||||
Profile = "GuiOkayButtonProfile";
|
||||
HorizSizing = "right";
|
||||
VertSizing = "bottom";
|
||||
position = "130 370";
|
||||
Extent = "140 30";
|
||||
MinExtent = "8 2";
|
||||
Visible = "1";
|
||||
text = "Okay";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
command = "Canvas.popDialog(DemoEditorAlert);";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/DemoEditorAlert.gui.dso
Normal file
39
Torque/SDK/example/demo/client/ui/DetailSceneGui.gui
Normal file
@@ -0,0 +1,39 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(DetailSceneGui) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "800 600";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiControl() {
|
||||
profile = "GuiWindowProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
position = "587 464";
|
||||
extent = "190 30";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiSliderCtrl(DetailSceneSlider) {
|
||||
profile = "GuiSliderProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "6 5";
|
||||
extent = "178 21";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
variable = "value";
|
||||
altCommand = "OrcDetailScene.slider();";
|
||||
range = "0.000000 1.000000";
|
||||
ticks = "10";
|
||||
value = "1";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/DetailSceneGui.gui.dso
Normal file
149
Torque/SDK/example/demo/client/ui/FpsGui.gui
Normal file
@@ -0,0 +1,149 @@
|
||||
|
||||
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GameTSCtrl(FpsGui) {
|
||||
profile = "GuiContentProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
cameraZRot = "0";
|
||||
forceFOV = "0";
|
||||
helpTag = "0";
|
||||
noCursor = "1";
|
||||
|
||||
new GuiBitmapCtrl(CenterPrintDlg) {
|
||||
profile = "CenterPrintProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "45 230";
|
||||
extent = "550 20";
|
||||
minExtent = "8 8";
|
||||
visible = "0";
|
||||
bitmap = "./hudfill";
|
||||
wrap = "0";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl(CenterPrintText) {
|
||||
profile = "CenterPrintTextProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "0 0";
|
||||
extent = "546 12";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
new GuiBitmapCtrl(BottomPrintDlg) {
|
||||
profile = "CenterPrintProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "top";
|
||||
position = "45 375";
|
||||
extent = "550 20";
|
||||
minExtent = "8 8";
|
||||
visible = "0";
|
||||
bitmap = "./hudfill";
|
||||
wrap = "0";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl(BottomPrintText) {
|
||||
profile = "CenterPrintTextProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "0 0";
|
||||
extent = "546 12";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
new GuiBitmapCtrl(LagIcon) {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "572 3";
|
||||
extent = "32 32";
|
||||
minExtent = "8 8";
|
||||
visible = "0";
|
||||
bitmap = "./lagIcon";
|
||||
wrap = "0";
|
||||
helpTag = "0";
|
||||
};
|
||||
new GuiShapeNameHud() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "653 485";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
fillColor = "0.000000 0.000000 0.000000 0.250000";
|
||||
frameColor = "0.000000 1.000000 0.000000 1.000000";
|
||||
textColor = "0.000000 1.000000 0.000000 1.000000";
|
||||
showFill = "0";
|
||||
showFrame = "0";
|
||||
verticalOffset = "0.2";
|
||||
distanceFade = "0.1";
|
||||
damageFrameColor = "1.000000 0.600000 0.000000 1.000000";
|
||||
helpTag = "0";
|
||||
damageFillColor = "0.000000 1.000000 0.000000 1.000000";
|
||||
damageRect = "30 4";
|
||||
};
|
||||
new GuiCrossHairHud() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "304 224";
|
||||
extent = "32 32";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
bitmap = "./crossHair";
|
||||
wrap = "0";
|
||||
damageFillColor = "0.000000 1.000000 0.000000 1.000000";
|
||||
damageFrameColor = "1.000000 0.600000 0.000000 1.000000";
|
||||
damageRect = "50 4";
|
||||
damageOffset = "0 10";
|
||||
helpTag = "0";
|
||||
};
|
||||
new GuiHealthBarHud() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "top";
|
||||
position = "14 315";
|
||||
extent = "26 138";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
fillColor = "0.000000 0.000000 0.000000 0.500000";
|
||||
frameColor = "0.000000 1.000000 0.000000 0.000000";
|
||||
damageFillColor = "0.800000 0.000000 0.000000 1.000000";
|
||||
pulseRate = "1000";
|
||||
pulseThreshold = "0.5";
|
||||
showFill = "1";
|
||||
showFrame = "1";
|
||||
displayEnergy = "0";
|
||||
helpTag = "0";
|
||||
value = "1";
|
||||
};
|
||||
new GuiBitmapCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "top";
|
||||
position = "11 299";
|
||||
extent = "32 172";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
bitmap = "./healthBar";
|
||||
wrap = "0";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/FpsGui.gui.dso
Normal file
BIN
Torque/SDK/example/demo/client/ui/GarageGames.jpg
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
Torque/SDK/example/demo/client/ui/MainMenuDlg.gui.dso
Normal file
41
Torque/SDK/example/demo/client/ui/MountingSceneGui.gui
Normal file
@@ -0,0 +1,41 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(MountingSceneGui) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
position = "466 191";
|
||||
extent = "140 30";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "mountDetailOrc(CrossbowImage,0);";
|
||||
helpTag = "0";
|
||||
text = "Crossbow";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "bottom";
|
||||
position = "467 231";
|
||||
extent = "140 30";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "mountDetailOrc(FlagPoleImage,1);";
|
||||
helpTag = "0";
|
||||
text = "Flag";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/MountingSceneGui.gui.dso
Normal file
BIN
Torque/SDK/example/demo/client/ui/PlayGui.gui.dso
Normal file
114
Torque/SDK/example/demo/client/ui/ProductGui.gui
Normal file
@@ -0,0 +1,114 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiChunkedBitmapCtrl(ProductGui) {
|
||||
profile = "GuiContentProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./background";
|
||||
useVariable = "0";
|
||||
tile = "0";
|
||||
|
||||
new GuiControl() {
|
||||
profile = "GuiWindowProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "relative";
|
||||
position = "0 80";
|
||||
extent = "640 320";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiBitmapCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "22 43";
|
||||
extent = "120 150";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./box120_mbgold";
|
||||
wrap = "0";
|
||||
};
|
||||
new GuiBitmapCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "160 42";
|
||||
extent = "120 150";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./box120_orbz2";
|
||||
wrap = "0";
|
||||
};
|
||||
new GuiBitmapCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "300 40";
|
||||
extent = "120 150";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./box120_tt";
|
||||
wrap = "0";
|
||||
};
|
||||
new GuiBitmapCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "445 41";
|
||||
extent = "120 150";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./box120_tennis_critters";
|
||||
wrap = "0";
|
||||
};
|
||||
new GuiBitmapCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "25 205";
|
||||
extent = "291 92";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./tribes2";
|
||||
wrap = "0";
|
||||
};
|
||||
new GuiTextCtrl() {
|
||||
profile = "GuiTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "25 298";
|
||||
extent = "120 18";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
text = "Tribes 2 Copyright Sierra";
|
||||
maxLength = "255";
|
||||
};
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "top";
|
||||
position = "23 393";
|
||||
extent = "80 80";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "Canvas.setContent(mainMenuGui);";
|
||||
helpTag = "0";
|
||||
text = "Button";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
bitmap = "./arrows/arrow_left";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/ProductGui.gui.dso
Normal file
121
Torque/SDK/example/demo/client/ui/RacingGui.gui
Normal file
@@ -0,0 +1,121 @@
|
||||
|
||||
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GameTSCtrl(RacingGui) {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
cameraZRot = "0";
|
||||
forceFOV = "0";
|
||||
noCursor = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiShapeNameHud() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "-2 1";
|
||||
extent = "653 485";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
fillColor = "0.000000 0.000000 0.000000 0.250000";
|
||||
frameColor = "0.000000 1.000000 0.000000 1.000000";
|
||||
textColor = "0.000000 1.000000 0.000000 1.000000";
|
||||
showFill = "0";
|
||||
showFrame = "0";
|
||||
verticalOffset = "0.2";
|
||||
distanceFade = "0.1";
|
||||
damageFrameColor = "1.000000 0.600000 0.000000 1.000000";
|
||||
helpTag = "0";
|
||||
damageFillColor = "0.000000 1.000000 0.000000 1.000000";
|
||||
damageRect = "30 4";
|
||||
};
|
||||
new GuiBitmapCtrl(CenterPrintDlg) {
|
||||
profile = "CenterPrintProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "45 230";
|
||||
extent = "550 20";
|
||||
minExtent = "8 8";
|
||||
visible = "0";
|
||||
bitmap = "./hudfill";
|
||||
wrap = "0";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl(CenterPrintText) {
|
||||
profile = "CenterPrintTextProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "0 0";
|
||||
extent = "546 12";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
new GuiBitmapCtrl(BottomPrintDlg) {
|
||||
profile = "CenterPrintProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "top";
|
||||
position = "45 375";
|
||||
extent = "550 20";
|
||||
minExtent = "8 8";
|
||||
visible = "0";
|
||||
bitmap = "./hudfill";
|
||||
wrap = "0";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl(BottomPrintText) {
|
||||
profile = "CenterPrintTextProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "0 0";
|
||||
extent = "546 12";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
new GuiBitmapCtrl(LagIcon) {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "572 3";
|
||||
extent = "32 32";
|
||||
minExtent = "8 8";
|
||||
visible = "0";
|
||||
bitmap = "./lagIcon";
|
||||
wrap = "0";
|
||||
helpTag = "0";
|
||||
};
|
||||
new GuiSpeedometerHud() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
position = "456 284";
|
||||
extent = "184 196";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
bitmap = "./speedometer";
|
||||
wrap = "0";
|
||||
maxSpeed = "30";
|
||||
minAngle = "220";
|
||||
maxAngle = "70";
|
||||
color = "1.000000 1.000000 0.000000 1.000000";
|
||||
center = "122.000000 122.000000";
|
||||
length = "95";
|
||||
width = "2";
|
||||
tail = "20";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/RacingGui.gui.dso
Normal file
17
Torque/SDK/example/demo/client/ui/SceneGui.gui
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GameTSCtrl(SceneGui) {
|
||||
profile = "GuiContentProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0 ";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
cameraZRot = "0";
|
||||
forceFOV = "0";
|
||||
helpTag = "0";
|
||||
roomNumber = "1";
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/SceneGui.gui.dso
Normal file
BIN
Torque/SDK/example/demo/client/ui/Splash.jpg
Normal file
|
After Width: | Height: | Size: 138 KiB |
43
Torque/SDK/example/demo/client/ui/StartupGui.gui
Normal file
@@ -0,0 +1,43 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiFadeinBitmapCtrl(StartupGui) {
|
||||
profile = "GuiInputCtrlProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./GarageGames";
|
||||
wrap = "0";
|
||||
fadeinTime = "125";
|
||||
waitTime = "3000";
|
||||
fadeoutTime = "125";
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
||||
function loadStartup()
|
||||
{
|
||||
StartupGui.done = false;
|
||||
Canvas.setContent( StartupGui );
|
||||
schedule(100, 0, checkStartupDone );
|
||||
alxPlay(AudioStartup);
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function StartupGui::click()
|
||||
{
|
||||
StartupGui.done = true;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------
|
||||
function checkStartupDone()
|
||||
{
|
||||
if (StartupGui.done)
|
||||
loadMainMenu();
|
||||
else
|
||||
schedule(100, 0, checkStartupDone );
|
||||
}
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/ui/StartupGui.gui.dso
Normal file
162
Torque/SDK/example/demo/client/ui/TheoraGui.gui
Normal file
@@ -0,0 +1,162 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiChunkedBitmapCtrl(TheoraGui) {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "800 600";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
bitmap = "./background";
|
||||
useVariable = "0";
|
||||
tile = "0";
|
||||
|
||||
new GuiTheoraCtrl(theo) {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "relative";
|
||||
position = "120 25";
|
||||
extent = "560 420";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
done = "0";
|
||||
stopOnSleep = "0";
|
||||
backgroundColor = "0 0 0 255";
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "relative";
|
||||
position = "30 475";
|
||||
extent = "220 40";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "Theo.setFile(\"demo/data/video/320x240.ogg\");";
|
||||
text = "Button";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
bitmap = "./button";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextNoSelectProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "9 7";
|
||||
extent = "260 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "<color:ffffff><font:Arial Bold:14>Simple test pattern, no sound.";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "relative";
|
||||
position = "30 535";
|
||||
extent = "220 40";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "Theo.setFile(\"demo/data/video/videotestsrc.ogg\");";
|
||||
text = "Button";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
bitmap = "./button";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextNoSelectProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "9 7";
|
||||
extent = "260 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "<color:ffffff><font:Arial Bold:14>The test pattern, at high resolution.";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "relative";
|
||||
position = "550 535";
|
||||
extent = "220 40";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "Theo.setFile(\"demo/data/video/demovid.ogg\");";
|
||||
text = "Button";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
bitmap = "./button";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextNoSelectProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "9 7";
|
||||
extent = "176 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "<color:ffffff><font:Arial Bold:14>A demo of some of Torque's lovely goodness.";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
new GuiBitmapButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "relative";
|
||||
position = "550 475";
|
||||
extent = "220 40";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "Theo.setFile(\"demo/data/video/soundtest.ogg\");";
|
||||
text = "Button";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
bitmap = "./button";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextNoSelectProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "9 7";
|
||||
extent = "260 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "<color:ffffff><font:Arial Bold:14>A tone and sound synch test.";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
new GuiBitmapButtonCtrl(LeaveTheoraButton) {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "relative";
|
||||
position = "384 555";
|
||||
extent = "32 32";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
command = "Canvas.setContent(mainMenuGui);";
|
||||
text = "Button";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
bitmap = "./arrows/arrow_left";
|
||||
helpTag = "0";
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
BIN
Torque/SDK/example/demo/client/ui/Thumbs.db
Normal file
96
Torque/SDK/example/demo/client/ui/aboutDlg.gui
Normal file
@@ -0,0 +1,96 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
//
|
||||
// Copyright (c) 2001 GarageGames.Com
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(aboutDlg) {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiWindowCtrl() {
|
||||
profile = "GuiWindowProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "132 88";
|
||||
extent = "376 303";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
text = "About...";
|
||||
maxLength = "255";
|
||||
resizeWidth = "0";
|
||||
resizeHeight = "0";
|
||||
canMove = "1";
|
||||
canClose = "1";
|
||||
canMinimize = "0";
|
||||
canMaximize = "0";
|
||||
minSize = "50 50";
|
||||
closeCommand = "Canvas.popDialog(aboutDlg);";
|
||||
|
||||
new GuiMLTextCtrl(aboutText) {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "relative";
|
||||
position = "19 36";
|
||||
extent = "336 241";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "This is a test";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "303 268";
|
||||
extent = "60 23";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
command = "Canvas.popDialog(aboutDlg);";
|
||||
helpTag = "0";
|
||||
text = "OK";
|
||||
};
|
||||
new GuiButtonCtrl() {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "12 268";
|
||||
extent = "76 23";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
command = "getHelp(\"2. License\");";
|
||||
helpTag = "0";
|
||||
text = "License...";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
||||
|
||||
function aboutDlg::onWake(%this)
|
||||
{
|
||||
%text="<just:center><font:Arial Bold:20>Torque 1.4 Demo\n"@
|
||||
"<font:Arial:12>"@ getCompileTimeString() @", "@ getBuildString() @"Build\n\n"@
|
||||
"<font:Arial:16>Copyright (c) 2001 <a:www.garagegames.com>GarageGames.Com</a>\n"@
|
||||
"<bitmap:demo/client/ui/gglogo150>";
|
||||
aboutText.setText(%text);
|
||||
}
|
||||
|
||||
function aboutText::onURL(%this, %url)
|
||||
{
|
||||
echo(%this);
|
||||
echo(%url);
|
||||
gotoWebPage( %url );
|
||||
}
|
||||
|
||||
BIN
Torque/SDK/example/demo/client/ui/aboutDlg.gui.dso
Normal file
BIN
Torque/SDK/example/demo/client/ui/arrows/Thumbs.db
Normal file
BIN
Torque/SDK/example/demo/client/ui/arrows/arrow_left_h.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
Torque/SDK/example/demo/client/ui/arrows/arrow_left_n.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
Torque/SDK/example/demo/client/ui/arrows/arrow_right_h.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
Torque/SDK/example/demo/client/ui/arrows/arrow_right_n.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
Torque/SDK/example/demo/client/ui/arrows/exit_h.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
Torque/SDK/example/demo/client/ui/arrows/exit_n.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
Torque/SDK/example/demo/client/ui/background.jpg
Normal file
|
After Width: | Height: | Size: 86 KiB |
BIN
Torque/SDK/example/demo/client/ui/btm_border.png
Normal file
|
After Width: | Height: | Size: 580 B |
BIN
Torque/SDK/example/demo/client/ui/btm_corner.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
Torque/SDK/example/demo/client/ui/button_h.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
Torque/SDK/example/demo/client/ui/button_n.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
Torque/SDK/example/demo/client/ui/buttons/Thumbs.db
Normal file
BIN
Torque/SDK/example/demo/client/ui/buttons/buy_now_h.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Torque/SDK/example/demo/client/ui/buttons/buy_now_n.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Torque/SDK/example/demo/client/ui/buttons/credits_h.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Torque/SDK/example/demo/client/ui/buttons/credits_n.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
Torque/SDK/example/demo/client/ui/buttons/exit_h.png
Normal file
|
After Width: | Height: | Size: 899 B |
BIN
Torque/SDK/example/demo/client/ui/buttons/exit_n.png
Normal file
|
After Width: | Height: | Size: 931 B |
BIN
Torque/SDK/example/demo/client/ui/buttons/home_h.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Torque/SDK/example/demo/client/ui/buttons/home_n.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |