Initial commit
327
example/demo/ReadMe.html
Executable file
@ -0,0 +1,327 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<title>Torque Game Engine Demo Application</title>
|
||||
<html>
|
||||
|
||||
<body>
|
||||
<!-------------------------------------------------------->
|
||||
|
||||
<h1>Torque Game Engine Demo</h1>
|
||||
|
||||
<p>
|
||||
Welcome to the Torque Game Engine Demo Application.
|
||||
</p>
|
||||
<ul>
|
||||
<li><a href="#overview">Overview</a></li>
|
||||
<li><a href="#gg">GarageGames</a></li>
|
||||
<li><a href="#torque">Torque Game Engine</a></li>
|
||||
<li><a href="#requirements" >System Requirements</a></li>
|
||||
<ul>
|
||||
<li><a href="#win32">Win32</a></li>
|
||||
<li><a href="#mac">Mac OS</a></li>
|
||||
<li><a href="#unix">Linux</a></li>
|
||||
</ul>
|
||||
<li><a href="#runapp" >Running the Application</a></li>
|
||||
<ul>
|
||||
<li><a href="#synopsis">Command Line Arguments</a></li>
|
||||
<li><a href="#keys">Keybindings</a></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<hr><h3 id="overview">Overview</h3>
|
||||
<p>
|
||||
This is a demo of the features available in the Torque Game Engine, an extremely affordable, full featured game engine technology from GarageGames.com, Inc.
|
||||
</p>
|
||||
|
||||
<hr><h3 id="gg">GarageGames</h3>
|
||||
<p>
|
||||
<a href="http://www.garagegames.com">GarageGames.com</a> is a unique Internet
|
||||
publishing label for independent games and gamemakers. We are a band of
|
||||
professional gaming industry veterans committed to publishing truly
|
||||
original and exciting titles on our own terms. Our mission?
|
||||
To provide the independent developer with tools, knowledge,
|
||||
co-conspirators - whatever is needed to unleash the creative spirit and
|
||||
get great innovative independent games to market.
|
||||
</p>
|
||||
|
||||
<hr><h3 id="torque">Torque Game Engine</h3>
|
||||
<p>
|
||||
The
|
||||
<a href="http://www.garagegames.com/pg/product/view.php?id=1">Torque Game
|
||||
Engine</a> (TGE) is the game engine that powers Tribes 2 developed by
|
||||
Dynamix. TGE is a full featured AAA title engine with the latest in
|
||||
scripting, geometry, particle effects, animation and texturing, as well
|
||||
as award winning multi-player networking code. Check out the
|
||||
<a href="http://www.garagegames.com/pg/product/view.php?id=1#features">feature
|
||||
list</a> for more details. For $100 per programmer, you get the source
|
||||
to the engine of a major product from a major game publisher! Not
|
||||
possible? Check the
|
||||
<a href="http://www.garagegames.com/index.php?sec=mg&mod=resource&page=category&qid=122">FAQ</a>
|
||||
for the details.
|
||||
</p>
|
||||
|
||||
|
||||
<hr><h3 id="requirements">System Requirements</h3>
|
||||
<p>
|
||||
The application is released on both the Windows (Windows 98/SE/ME/2K/XP) and
|
||||
Mac OS X platforms. See the following OS specific sections for more information.
|
||||
</p>
|
||||
|
||||
<h4 id="win32">Windows</h4>
|
||||
<p>
|
||||
Under windows the engine will run either OpenGL or DirectX.
|
||||
OpenGL and DirectX drivers are typically bundled together by
|
||||
video card manufactureres and are constantly being updated. Make sure
|
||||
you have the latest drivers for your particular video card.
|
||||
</p>
|
||||
<p>
|
||||
<dl>
|
||||
<dt>Required Hardware:
|
||||
<dd>
|
||||
<ul>
|
||||
<li>Pentium II/400 - AMD/400 (or better), 128MB RAM, 20+GB HD</li>
|
||||
<li>Windows 98/NT4+SP3/2K/XP</li>
|
||||
<li>AGP Radeon or GeForce class w/32MB (Radeon 8500 or GeForce3 w/64MB highly recommended)</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dt>
|
||||
<dt>Required Software:</b>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>Latest drivers for Video board</li>
|
||||
<li><a href="http://www.microsoft.com/downloads/search.aspx?displaylang=en&categoryid=2">DirectX</a> version 8.0 or later.</li>
|
||||
<li><a href="http://www.openal.org">OpenAL</a> Runtime or SDK Installation</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dt>
|
||||
</dl>
|
||||
</p>
|
||||
|
||||
<h4 id="mac">Mac OS</h4>
|
||||
<p>
|
||||
<dl>
|
||||
<dt>Required Hardware:
|
||||
<dd>
|
||||
<ul>
|
||||
<li>G3/G4 400Mhz (or better), 128MB RAM, 20+GB HD</li>
|
||||
<li>MacOS 9 or X</li>
|
||||
<li>AGP Radeon or GeForce class w/32MB (Radeon 8500 or GeForce3 w/64MB highly recommended)</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dt>
|
||||
<dt>Required Software:</b>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>9: Latest DrawSprocket and InputSprocket libraries/extensions installed and active</li>
|
||||
<li>9&X: Latest drivers for Video board</li>
|
||||
<li>9&X: TCP/IP properly configured</li>
|
||||
<li>9&X: <a href="http://www.openal.org">OpenAL</a> Runtime or SDK Installation</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dt>
|
||||
</dl>
|
||||
</p>
|
||||
|
||||
<h4 id="unix">Linux</h4>
|
||||
<p>
|
||||
<dl>
|
||||
<dt>Required Hardware:
|
||||
<dd>
|
||||
<ul>
|
||||
<li>Pentium II/400 - AMD/400 (or better), 128+MB RAM</li>
|
||||
<li>NVIDIA 3D card recommended. Other cards may work but are untested.</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dt>
|
||||
<dt>Required Software:</b>
|
||||
<dd>
|
||||
<ul>
|
||||
<li>XFree86 4.0 or greater with a appropriate 3D drivers (GLX/DRI)
|
||||
for your video card.</li>
|
||||
<li>Kernel 2.4.17 is not recommended.</li>
|
||||
<li>The prebuilt binary packages require the following dynamic link libraries:</li>
|
||||
<ul>
|
||||
<li>libm.so.6</li>
|
||||
<li>libdl.so.2</li>
|
||||
<li>libpthread.so.0</li>
|
||||
<li>libc.so.6</li>
|
||||
<li>/lib/ld-linux.so.2</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</dd>
|
||||
</dt>
|
||||
</dl>
|
||||
</p>
|
||||
|
||||
<hr><h3 id="runapp">Running the Application</h3>
|
||||
|
||||
<p>The demo may be run in two modes: with or without the client interface.
|
||||
Running the client graphics interface is the default behavior. Running
|
||||
the app. in "dedicated" mode skips the graphics and client interface
|
||||
initialization. This mode is used to run dedicated game servers and
|
||||
consumes less resources, but is not directly playable. You must connect
|
||||
to a dedicated server using another instances of the demo app running in
|
||||
client mode. Example of dedicated mode using command line arguments:</p>
|
||||
<pre>
|
||||
cd "c:\Program Files\Torque Game Engine Demo"
|
||||
demo -dedicated -mission demo\data\missions\stronghold.mis
|
||||
</pre>
|
||||
|
||||
<p>Games (servers) can also be hosted through the client interface, and a
|
||||
client may play the game being hosted.</p>
|
||||
|
||||
<p><b>Note:</b> for Mac users, command line arguments can be placed
|
||||
in a text file called <i>maccmdline.txt</i> in the same directory as the demo
|
||||
executable.
|
||||
</p>
|
||||
|
||||
<h4 id="synopsis">Command Line Arguments</h4>
|
||||
<p>
|
||||
demo
|
||||
[-fullscreen] [-windowed] [-noSound] [-openGL] [-directX]
|
||||
[-autoVideo] [-prefs file] [-dedicated]
|
||||
[-mission mission] [-log level]
|
||||
[-mod modName] [-game gameName] [-show shapeFile]
|
||||
[-console] [-jSave file] [-jPlay file] [-jDebug file]
|
||||
[-help]
|
||||
</p>
|
||||
<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td width=50> </td>
|
||||
<td width=100>-fullscreen</td><td>Run in fullscreen mode</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-windowed</td><td>Run in a window</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-noSound</td><td>Dsisable sound</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-openGL</td><td>Use the OpenGL driver</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-directX</td><td>Use the DirectX driver</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-autoVideo</td><td>Autodetect the video driver</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-prefs</td><td>Load the given config file</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-dedicated</td><td>Run as a dedicated server</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-mission mission</td><td>Load the given mission.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-log level</td><td>Set the log level = [0,1,2]</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-mod modName</td><td>Load the specified mod</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-game gameName</td><td>Load the specified game, clears all previously loaded mods</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-show [file.dts]</td><td>Start the Show mod and optionally load the specified file</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-console</td><td>Start up a seperate console window</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-jSave file</td><td>Record a journal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-jPlay file</td><td>Play back a journal</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-jDebug file</td><td>Same as jPlay, except that a debug
|
||||
break (int3) is issued when the journal ends</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>-help</td><td>Display this help to the console</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<h4 id='keys'>Key Bindings</h4>
|
||||
<p>
|
||||
The client default key bindings for the demo game. The script
|
||||
file which binds these keys can be found in
|
||||
the <i>torque/fps/client/scripts/default.bind.cs</i>
|
||||
file. Here are some of the current bindings:
|
||||
</p>
|
||||
<p>
|
||||
<table>
|
||||
<tr>
|
||||
<td width=50> </td>
|
||||
<td width=100 spansize=2><b>Movement</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>w</td><td>Forward</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>s</td><td>Backward</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>a</td><td>Left</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>d</td><td>Right</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>space</td><td>Jump / Brake</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td spansize=2><br><b>View Control</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>e</td><td>Zoom</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>r</td><td>Set Zoom FOV</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>TAB</td><td>First/Third person</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>alt c</td><td>Toggle between camera and player</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td spansize=2><br><b>Chat Messaging</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>u</td><td>Send chat message</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td spansize=2><br><b>Misc. Functions</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>Ctrl-O</td><td>In-game options dialog</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>F1</td><td>In-game help dialog box</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>F2</td><td>Score board</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td spansize=2><br><b>Mission Editing</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>F7</td><td>Switch contol to the player and position him at the camera</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>F8</td><td>Switch contol to the camera and position it at the player</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td>F9</td><td>Toggle between outline, interior debug, and normal rendering modes</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
<!-------------------------------------------------------->
|
||||
</body>
|
||||
</html>
|
69
example/demo/client/defaults.cs
Executable 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;
|
||||
|
244
example/demo/client/init.cs
Executable 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>.");
|
||||
}
|
||||
}
|
||||
|
||||
|
109
example/demo/client/menu_threads.cs
Executable 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);
|
||||
|
18
example/demo/client/scripts/DemoEditorAlert.cs
Executable 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;
|
||||
}
|
40
example/demo/client/scripts/audioProfiles.cs
Executable 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;
|
||||
};
|
78
example/demo/client/scripts/centerPrint.cs
Executable 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 = "";
|
||||
}
|
286
example/demo/client/scripts/chatHud.cs
Executable 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();
|
||||
}
|
32
example/demo/client/scripts/client.cs
Executable 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);
|
||||
}
|
||||
|
369
example/demo/client/scripts/default.bind.cs
Executable 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();");
|
35
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();
|
||||
}
|
||||
|
||||
|
53
example/demo/client/scripts/game.cs
Executable 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;
|
||||
}
|
||||
|
||||
|
||||
|
145
example/demo/client/scripts/joinServerGui.cs
Executable 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();
|
||||
}
|
||||
}
|
||||
|
47
example/demo/client/scripts/loadingGui.cs
Executable 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...
|
||||
}
|
186
example/demo/client/scripts/mainMenuGui.cs
Executable 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
112
example/demo/client/scripts/messageHud.cs
Executable 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();
|
||||
}
|
||||
}
|
154
example/demo/client/scripts/missionDownload.cs
Executable 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.
|
||||
}
|
566
example/demo/client/scripts/optionsDlg.cs
Executable 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();
|
||||
}
|
134
example/demo/client/scripts/pageGui.cs
Executable 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
example/demo/client/scripts/playGui.cs
Executable 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";
|
||||
}
|
||||
|
||||
|
32
example/demo/client/scripts/playerList.cs
Executable 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);
|
||||
}
|
38
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();
|
||||
}
|
||||
|
||||
|
82
example/demo/client/scripts/sceneGui.cs
Executable 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();
|
||||
}
|
||||
|
||||
|
||||
|
168
example/demo/client/scripts/serverConnection.cs
Executable 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();
|
||||
}
|
||||
|
96
example/demo/client/scripts/startMissionGui.cs
Executable 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);
|
||||
}
|
||||
|
7
example/demo/client/ui/0. About.hfl
Executable 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
example/demo/client/ui/1. Credits.hfl
Executable 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
example/demo/client/ui/1.1 Game Controls.hfl
Executable 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
example/demo/client/ui/AnimationSceneGUI.gui
Executable 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 ---
|
61
example/demo/client/ui/DemoEditorAlert.gui
Executable 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 ---
|
39
example/demo/client/ui/DetailSceneGui.gui
Executable 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 ---
|
149
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
example/demo/client/ui/GarageGames.jpg
Executable file
After Width: | Height: | Size: 76 KiB |
41
example/demo/client/ui/MountingSceneGui.gui
Executable 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 ---
|
114
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 ---
|
121
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 ---
|
17
example/demo/client/ui/SceneGui.gui
Executable 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
example/demo/client/ui/Splash.jpg
Executable file
After Width: | Height: | Size: 138 KiB |
43
example/demo/client/ui/StartupGui.gui
Executable 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 );
|
||||
}
|
||||
|
162
example/demo/client/ui/TheoraGui.gui
Executable 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 ---
|
96
example/demo/client/ui/aboutDlg.gui
Executable 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
example/demo/client/ui/arrows/arrow_left_h.png
Executable file
After Width: | Height: | Size: 5.9 KiB |
BIN
example/demo/client/ui/arrows/arrow_left_n.png
Executable file
After Width: | Height: | Size: 5.7 KiB |
BIN
example/demo/client/ui/arrows/arrow_right_h.png
Executable file
After Width: | Height: | Size: 5.9 KiB |
BIN
example/demo/client/ui/arrows/arrow_right_n.png
Executable file
After Width: | Height: | Size: 5.8 KiB |
BIN
example/demo/client/ui/arrows/exit_h.png
Executable file
After Width: | Height: | Size: 6.1 KiB |
BIN
example/demo/client/ui/arrows/exit_n.png
Executable file
After Width: | Height: | Size: 5.9 KiB |
BIN
example/demo/client/ui/background.jpg
Executable file
After Width: | Height: | Size: 86 KiB |
BIN
example/demo/client/ui/btm_border.png
Normal file
After Width: | Height: | Size: 580 B |
BIN
example/demo/client/ui/btm_corner.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
example/demo/client/ui/button_h.png
Executable file
After Width: | Height: | Size: 3.1 KiB |
BIN
example/demo/client/ui/button_n.png
Executable file
After Width: | Height: | Size: 3.2 KiB |
BIN
example/demo/client/ui/buttons/buy_now_h.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
example/demo/client/ui/buttons/buy_now_n.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
example/demo/client/ui/buttons/credits_h.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
example/demo/client/ui/buttons/credits_n.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
example/demo/client/ui/buttons/exit_h.png
Executable file
After Width: | Height: | Size: 899 B |
BIN
example/demo/client/ui/buttons/exit_n.png
Executable file
After Width: | Height: | Size: 931 B |
BIN
example/demo/client/ui/buttons/home_h.png
Executable file
After Width: | Height: | Size: 1.1 KiB |
BIN
example/demo/client/ui/buttons/home_n.png
Executable file
After Width: | Height: | Size: 1.2 KiB |
BIN
example/demo/client/ui/buttons/options_h.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
example/demo/client/ui/buttons/options_n.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
example/demo/client/ui/buttons/purchase_h.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
example/demo/client/ui/buttons/purchase_n.png
Executable file
After Width: | Height: | Size: 1.7 KiB |
BIN
example/demo/client/ui/buttons/website_h.png
Executable file
After Width: | Height: | Size: 1.6 KiB |
BIN
example/demo/client/ui/buttons/website_n.png
Executable file
After Width: | Height: | Size: 1.7 KiB |
160
example/demo/client/ui/chatHud.gui
Executable file
@ -0,0 +1,160 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Chat edit window
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
new GuiControl(MessageHud)
|
||||
{
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "0";
|
||||
noCursor = true;
|
||||
|
||||
new GuiBitmapBorderCtrl(MessageHud_Frame) {
|
||||
profile = "ChatHudBorderProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "120 375";
|
||||
extent = "400 40";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
|
||||
new GuiBitmapCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "8 8";
|
||||
extent = "384 24";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./hudfill";
|
||||
wrap = "0";
|
||||
};
|
||||
|
||||
new GuiTextCtrl(MessageHud_Text)
|
||||
{
|
||||
profile = "ChatHudTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "14 12";
|
||||
extent = "10 22";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
};
|
||||
|
||||
new GuiTextEditCtrl(MessageHud_Edit)
|
||||
{
|
||||
profile = "ChatHudEditProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 13";
|
||||
extent = "10 22";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
altCommand = "$ThisControl.eval();";
|
||||
escapeCommand = "MessageHud_Edit.onEscape();";
|
||||
historySize = "5";
|
||||
maxLength = "120";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(MainChatHud) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
noCursor = "1";
|
||||
|
||||
new GuiControl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "relative";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "400 300";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiBitmapBorderCtrl(OuterChatHud) {
|
||||
profile = "ChatHudBorderProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "272 88";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
useVariable = "0";
|
||||
tile = "0";
|
||||
|
||||
new GuiBitmapCtrl() {
|
||||
profile = "GuiDefaultProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "8 8";
|
||||
extent = "256 72";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./hudfill";
|
||||
wrap = "0";
|
||||
};
|
||||
|
||||
new GuiButtonCtrl(chatPageDown) {
|
||||
profile = "GuiButtonProfile";
|
||||
horizSizing = "left";
|
||||
vertSizing = "top";
|
||||
position = "220 58";
|
||||
extent = "36 14";
|
||||
minExtent = "8 8";
|
||||
visible = "0";
|
||||
helpTag = "0";
|
||||
text = "Dwn";
|
||||
groupNum = "-1";
|
||||
buttonType = "PushButton";
|
||||
};
|
||||
new GuiScrollCtrl(ChatScrollHud) {
|
||||
profile = "ChatHudScrollProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "8 8";
|
||||
extent = "256 72";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOff";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMessageVectorCtrl(ChatHud) {
|
||||
profile = "ChatHudMessageProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "1 1";
|
||||
extent = "252 16";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "0";
|
||||
lineContinuedIndex = "10";
|
||||
allowedMatches[0] = "http";
|
||||
allowedMatches[1] = "tgeserver";
|
||||
matchColor = "0 0 255 255";
|
||||
maxColorIndex = "5";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
BIN
example/demo/client/ui/chatHudBorderArray.png
Executable file
After Width: | Height: | Size: 8.5 KiB |
BIN
example/demo/client/ui/crossHair.png
Executable file
After Width: | Height: | Size: 329 B |
174
example/demo/client/ui/customProfiles.cs
Executable file
@ -0,0 +1,174 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (c) 2002 GarageGames.Com
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
new GuiControlProfile (GuiDefaultProfile)
|
||||
{
|
||||
tab = false;
|
||||
canKeyFocus = false;
|
||||
hasBitmapArray = false;
|
||||
mouseOverSelected = false;
|
||||
|
||||
// fill color
|
||||
opaque = false;
|
||||
fillColor = "127 136 153";
|
||||
fillColorHL = "197 202 211";
|
||||
fillColorNA = "144 154 171";
|
||||
|
||||
// border color
|
||||
border = false;
|
||||
borderColor = "0 0 0";
|
||||
borderColorHL = "197 202 211";
|
||||
borderColorNA = "91 101 119";
|
||||
|
||||
bevelColorHL = "255 255 255";
|
||||
bevelColorLL = "0 0 0";
|
||||
|
||||
// font
|
||||
fontType = "Arial";
|
||||
fontSize = 14;
|
||||
fontCharset = CHINESEBIG5;
|
||||
|
||||
fontColor = "0 0 0";
|
||||
fontColorHL = "73 82 97";
|
||||
fontColorNA = "0 0 0";
|
||||
fontColorSEL= "226 237 255";
|
||||
|
||||
// bitmap information
|
||||
bitmap = "./demoWindow";
|
||||
bitmapBase = "";
|
||||
textOffset = "0 0";
|
||||
|
||||
// used by guiTextControl
|
||||
modal = true;
|
||||
justify = "left";
|
||||
autoSizeWidth = false;
|
||||
autoSizeHeight = false;
|
||||
returnTab = false;
|
||||
numbersOnly = false;
|
||||
cursorColor = "0 0 0 255";
|
||||
|
||||
// sounds
|
||||
soundButtonDown = "";
|
||||
soundButtonOver = "";
|
||||
};
|
||||
|
||||
new GuiControlProfile (TooltipProfile)
|
||||
{
|
||||
fillColor = "255 255 225";
|
||||
border = true;
|
||||
borderColor = "0 0 0";
|
||||
fontSize = 14;
|
||||
fontType = "Arial";
|
||||
fontColor = "0 0 0";
|
||||
};
|
||||
|
||||
new GuiControlProfile (GuiWindowProfile)
|
||||
{
|
||||
opaque = true;
|
||||
border = 2;
|
||||
fillColor = "145 154 171";
|
||||
fillColorHL = "221 202 173";
|
||||
fillColorNA = "221 202 173";
|
||||
fontColor = "255 255 255";
|
||||
fontColorHL = "255 255 255";
|
||||
text = "GuiWindowCtrl test";
|
||||
bitmap = "./demoWindow";
|
||||
textOffset = "6 6";
|
||||
hasBitmapArray = true;
|
||||
justify = "center";
|
||||
};
|
||||
|
||||
new GuiControlProfile (GuiScrollProfile)
|
||||
{
|
||||
opaque = true;
|
||||
fillColor = "255 255 255";
|
||||
border = 3;
|
||||
borderThickness = 2;
|
||||
borderColor = "0 0 0";
|
||||
bitmap = "./demoScroll";
|
||||
hasBitmapArray = true;
|
||||
};
|
||||
|
||||
$fontColorHL = "55 64 78";
|
||||
new GuiControlProfile (GuiButtonProfile)
|
||||
{
|
||||
opaque = true;
|
||||
border = true;
|
||||
fontColor = "0 0 0";
|
||||
fontColorHL = $fontColorHL;
|
||||
fixedExtent = true;
|
||||
justify = "center";
|
||||
canKeyFocus = false;
|
||||
};
|
||||
|
||||
new GuiControlProfile (GuiOkayButtonProfile)
|
||||
{
|
||||
opaque = true;
|
||||
border = true;
|
||||
fontColor = "0 0 0";
|
||||
fontColorHL = $fontColorHL;
|
||||
fontSize = 24;
|
||||
fixedExtent = true;
|
||||
justify = "center";
|
||||
canKeyFocus = false;
|
||||
};
|
||||
|
||||
new GuiControlProfile (GuiCheckBoxProfile)
|
||||
{
|
||||
opaque = false;
|
||||
fillColor = "0 0 0";
|
||||
border = false;
|
||||
borderColor = "0 0 0";
|
||||
fontSize = 14;
|
||||
fontColor = "0 0 0";
|
||||
fontColorHL = $fontColorHL;
|
||||
fixedExtent = true;
|
||||
justify = "left";
|
||||
bitmap = "./demoCheck";
|
||||
hasBitmapArray = true;
|
||||
};
|
||||
|
||||
new GuiControlProfile (GuiRadioProfile)
|
||||
{
|
||||
fontSize = 14;
|
||||
fillColor = "0 0 0";
|
||||
fontColorHL = $fontColorHL;
|
||||
fixedExtent = true;
|
||||
bitmap = "./demoRadio";
|
||||
hasBitmapArray = true;
|
||||
};
|
||||
|
||||
new GuiControlProfile (GuiTitleProfile)
|
||||
{
|
||||
opaque = false;
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 32;
|
||||
fontColor = "255 255 255";
|
||||
fontColorHL = "255 255 255";
|
||||
justify = "right";
|
||||
};
|
||||
|
||||
new GuiControlProfile (GuiPopUpTextProfile)
|
||||
{
|
||||
fontType = "Arial";
|
||||
fontSize = 14;
|
||||
fontColor = "255 255 255";
|
||||
fontColorHL = "255 255 255";
|
||||
fontColorLink = "255 96 96";
|
||||
fontColorLinkHL = "0 0 255";
|
||||
};
|
||||
|
||||
new GuiControlProfile (GuiEditorsTextProfile)
|
||||
{
|
||||
fontType = "Arial Bold";
|
||||
fontSize = 19;
|
||||
fontColor = "255 255 255";
|
||||
fontColorHL = "255 255 255";
|
||||
fontColorLink = "255 96 96";
|
||||
fontColorLinkHL = "0 0 255";
|
||||
};
|
||||
|
||||
|
||||
|
137
example/demo/client/ui/defaultGameProfiles.cs
Executable file
@ -0,0 +1,137 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Override base controls
|
||||
GuiButtonProfile.soundButtonOver = "AudioButtonOver";
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Chat Hud profiles
|
||||
|
||||
|
||||
new GuiControlProfile (ChatHudEditProfile)
|
||||
{
|
||||
opaque = false;
|
||||
fillColor = "255 255 255";
|
||||
fillColorHL = "128 128 128";
|
||||
border = false;
|
||||
borderThickness = 0;
|
||||
borderColor = "40 231 240";
|
||||
fontColor = "40 231 240";
|
||||
fontColorHL = "40 231 240";
|
||||
fontColorNA = "128 128 128";
|
||||
textOffset = "0 2";
|
||||
autoSizeWidth = false;
|
||||
autoSizeHeight = true;
|
||||
tab = true;
|
||||
canKeyFocus = true;
|
||||
};
|
||||
|
||||
|
||||
new GuiControlProfile( GuiBevelLoweredProfile )
|
||||
{
|
||||
opaque = true;
|
||||
fillColor = "255 255 255 80";
|
||||
border = 3;
|
||||
borderThickness = 2;
|
||||
borderColor = "0 0 0 80";
|
||||
bitmap = "./demoScroll";
|
||||
hasBitmapArray = true;
|
||||
};
|
||||
|
||||
|
||||
new GuiControlProfile (ChatHudTextProfile)
|
||||
{
|
||||
opaque = false;
|
||||
fillColor = "255 255 255";
|
||||
fillColorHL = "128 128 128";
|
||||
border = false;
|
||||
borderThickness = 0;
|
||||
borderColor = "40 231 240";
|
||||
fontColor = "40 231 240";
|
||||
fontColorHL = "40 231 240";
|
||||
fontColorNA = "128 128 128";
|
||||
textOffset = "0 0";
|
||||
autoSizeWidth = true;
|
||||
autoSizeHeight = true;
|
||||
tab = true;
|
||||
canKeyFocus = true;
|
||||
};
|
||||
|
||||
new GuiControlProfile ("ChatHudMessageProfile")
|
||||
{
|
||||
fontType = "Arial";
|
||||
fontSize = 16;
|
||||
fontColor = "44 172 181"; // default color (death msgs, scoring, inventory)
|
||||
fontColors[1] = "4 235 105"; // client join/drop, tournament mode
|
||||
fontColors[2] = "219 200 128"; // gameplay, admin/voting, pack/deployable
|
||||
fontColors[3] = "77 253 95"; // team chat, spam protection message, client tasks
|
||||
fontColors[4] = "40 231 240"; // global chat
|
||||
fontColors[5] = "200 200 50 200"; // used in single player game
|
||||
// WARNING! Colors 6-9 are reserved for name coloring
|
||||
autoSizeWidth = true;
|
||||
autoSizeHeight = true;
|
||||
};
|
||||
|
||||
new GuiControlProfile ("ChatHudScrollProfile")
|
||||
{
|
||||
opaque = false;
|
||||
border = false;
|
||||
borderColor = "0 255 0";
|
||||
bitmap = "common/ui/darkScroll";
|
||||
hasBitmapArray = true;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Common Hud profiles
|
||||
|
||||
new GuiControlProfile ("HudScrollProfile")
|
||||
{
|
||||
opaque = false;
|
||||
border = true;
|
||||
borderColor = "0 255 0";
|
||||
bitmap = "common/ui/darkScroll";
|
||||
hasBitmapArray = true;
|
||||
};
|
||||
|
||||
new GuiControlProfile ("HudTextProfile")
|
||||
{
|
||||
opaque = false;
|
||||
fillColor = "128 128 128";
|
||||
fontColor = "0 255 0";
|
||||
border = true;
|
||||
borderColor = "0 255 0";
|
||||
};
|
||||
|
||||
new GuiControlProfile ("ChatHudBorderProfile")
|
||||
{
|
||||
bitmap = "./chatHudBorderArray";
|
||||
hasBitmapArray = true;
|
||||
opaque = false;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Center and bottom print
|
||||
|
||||
new GuiControlProfile ("CenterPrintProfile")
|
||||
{
|
||||
opaque = false;
|
||||
fillColor = "128 128 128";
|
||||
fontColor = "0 255 0";
|
||||
border = true;
|
||||
borderColor = "0 255 0";
|
||||
};
|
||||
|
||||
new GuiControlProfile ("CenterPrintTextProfile")
|
||||
{
|
||||
opaque = false;
|
||||
fontType = "Arial";
|
||||
fontSize = 12;
|
||||
fontColor = "0 255 0";
|
||||
};
|
||||
|
||||
|
BIN
example/demo/client/ui/demoCheck.png
Executable file
After Width: | Height: | Size: 509 B |
BIN
example/demo/client/ui/demoMenu.png
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
example/demo/client/ui/demoRadio.png
Executable file
After Width: | Height: | Size: 604 B |
BIN
example/demo/client/ui/demoScroll.png
Executable file
After Width: | Height: | Size: 1.9 KiB |
BIN
example/demo/client/ui/demoWindow.png
Executable file
After Width: | Height: | Size: 1.7 KiB |
BIN
example/demo/client/ui/editor.png
Executable file
After Width: | Height: | Size: 119 KiB |
71
example/demo/client/ui/endGameGui.gui
Executable file
@ -0,0 +1,71 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiChunkedBitmapCtrl(EndGameGui) {
|
||||
profile = "GuiContentProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
bitmap = "./background";
|
||||
useVariable = "0";
|
||||
tile = "0";
|
||||
|
||||
new GuiControl() {
|
||||
profile = "GuiWindowProfile";
|
||||
horizSizing = "center";
|
||||
vertSizing = "center";
|
||||
position = "92 86";
|
||||
extent = "455 308";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
|
||||
new GuiTextCtrl() {
|
||||
profile = "GuiMediumTextProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "101 15";
|
||||
extent = "251 28";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
text = "Game Over - Final Scores:";
|
||||
maxLength = "255";
|
||||
};
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiScrollProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "5 51";
|
||||
extent = "444 251";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "dynamic";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
defaultLineHeight = "15";
|
||||
|
||||
new GuiTextListCtrl(EndGameGuiList) {
|
||||
profile = "GuiTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "2 2";
|
||||
extent = "440 16";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
enumerate = "0";
|
||||
resizeCell = "1";
|
||||
columns = "0 256";
|
||||
fitParentWidth = "1";
|
||||
clipColumnText = "0";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
118
example/demo/client/ui/features/features_core.txt
Normal file
@ -0,0 +1,118 @@
|
||||
|
||||
<font:Arial Bold:18><lmargin%:2>Below is a more detailed list of Torque Game Engine features grouped by area of interest. This is by no means a complete feature list.
|
||||
<font:Arial:16>
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Torque Core<spop>
|
||||
<lmargin%:5>• Multi-Platform
|
||||
• Windows server & client with OpenGL and DirectX
|
||||
• Mac OS 9/X server & client with OpenGL
|
||||
• Linux server & client with OpenGL
|
||||
• Journaling and Integrated hierarchical profiler
|
||||
• Math library, Vector, Matrix, Quaternion, etc.
|
||||
• Efficient memory manager with extensive debugging features
|
||||
• Resource Manager
|
||||
• File and Stream IO
|
||||
• Keyboard, Mouse and Joystick Input
|
||||
• SFX/Music driver using OpenAL
|
||||
• Spatial Database
|
||||
• Collision Testing
|
||||
• Vehicle Physics
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Torque Script<spop>
|
||||
<lmargin%:5>• C++ like syntax
|
||||
• Local and Remote Debugging
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Integrated Script Compiler<spop>
|
||||
<lmargin%:5>• Intermediate tokenized object format
|
||||
• On-demand compilation
|
||||
• Large complement of functions including math, object manipulation, fileIO, TCP/IP, etc.
|
||||
• Easily extend with plug-ins
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Tools<spop>
|
||||
<lmargin%:5>• Complete source code for all tools
|
||||
• Milkshape and 3DStudio Max plug-ins, including an exporter and helper objects
|
||||
• Quark and WorldCraft converter and lighting
|
||||
• Integrated World Editor, GUI Editor, Terrain Editor, Terrain Generator
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>World Editor<spop>
|
||||
<lmargin%:5>• Integrated world builder
|
||||
• WYSIWYG
|
||||
• Construct, place, size, scale and rotate objects
|
||||
• Multi-level undo/redo
|
||||
• Edit object properties
|
||||
• Control lighting
|
||||
• Script object behaviors
|
||||
• Built-in terrain editor
|
||||
• Rule based fractal height field generator
|
||||
• Rule based fractal terrain texturing
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>GUI Editor<spop>
|
||||
<lmargin%:5>• Integrated GUI editor
|
||||
• WYSIWYG
|
||||
• Build fully scriptable interfaces
|
||||
• Includes set of default controls
|
||||
• Write custom controls
|
||||
• Extensive font support
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Networking<spop>
|
||||
<lmargin%:5>• Award winning client/server architecture
|
||||
• Uses UDP and TCP
|
||||
• Packet stream manager
|
||||
• Object ghost manager with partial object updates
|
||||
• Bit level stream packing
|
||||
• String and message packing
|
||||
• Uses the optimal Notified Delivery Protocol
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Rendering Engine<spop>
|
||||
<lmargin%:5>• Multi-pass texturing
|
||||
• Layered volumetric fog
|
||||
• Decals
|
||||
• Detail texturing
|
||||
• Environment mapping
|
||||
• Vertex and multi-pass lighting
|
||||
• True spherical distance fogging (for terrain, buildings)
|
||||
• Spherical distance clipping (for terrain, buildings)
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Terrain Engine<spop>
|
||||
<lmargin%:5>• Continuous, seemless, LOD mesh generation (using screen error metrics)
|
||||
• Aggregated tile mip-mapping
|
||||
• Light mapped for hill and building shadows
|
||||
• Dynamically generated blend tiles
|
||||
• Altitude based fog banks
|
||||
• Seamless integration with the interior engine
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Interior/Building Engine<spop>
|
||||
<lmargin%:5>• Portal based interiors
|
||||
• Seamless integration with the terrain engine
|
||||
• Detail brushes
|
||||
• Animated lightmaps
|
||||
• Buildings can be instanced, placed, manipulated and yes, scaled, with the world editor
|
||||
• Quark and Worldcraft converter
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Mesh Engine<spop>
|
||||
<lmargin%:5>• Continuous level of detail based on a progressive mesh algorithm
|
||||
• Supports, bone, mesh, texture bitmap, texture coor. and visibilty animation
|
||||
• Mesh vertex deformation animation
|
||||
• Multi-bone mesh skeletal animation
|
||||
• Simple interface to multi-sequence animation manager
|
||||
• Damage detail level
|
||||
• Collision detail level
|
||||
• Projected object shadows (clipped against the environment)
|
||||
• 3DStudio Max & MilkShape exporters
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Water Engine<spop>
|
||||
<lmargin%:5>• Continuous, seemless, LOD mesh generation (using screen error metrics) for large bodies of water
|
||||
• Dynamic waves
|
||||
• Multi-pass wave crest and shoreline textures
|
||||
• Integration with terrain and interior engines
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Particle Engine<spop>
|
||||
<lmargin%:5>• Integrated with scripting engine
|
||||
• Animate texture and scale
|
||||
• Specify particle mass, drag, starting velocity, etc.
|
||||
• Sophisticated particle generators which can emit multiple particle types at once
|
||||
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Sound<spop>
|
||||
<lmargin%:5>• Multi-channel prioritized SFX manager
|
||||
• 3D sound support; panning, volume, doppler, cones
|
||||
• OpenAL
|
||||
|
46
example/demo/client/ui/features/features_gui.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_gui) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "GUI System & Editor";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_gui.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
24
example/demo/client/ui/features/features_gui.txt
Normal file
@ -0,0 +1,24 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/gui_editor>
|
||||
<just:left><font:Arial Bold:18>GUI System and WYSIWYG Editor
|
||||
<font:Arial:16><lmargin%:5>If you have ever built a GUI system from scratch, you know how time consuming it is to implement all the features today's users are accustomed to: Copy, cut paste, tabbing, text selection, window focus, modal and non-modal dialogs, etc. The Torque Game Engine comes with a complete GUI implementation (Torque Script enabled of course) as well as a full-featured, in-engine, WYSIWYG editor for rapid prototyping and development. You can use the built in controls or easily create your own.
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>GUI System Features<font:Arial:16><lmargin%:5>
|
||||
• Build fully scriptable interfaces
|
||||
• Includes a complete set of default controls
|
||||
• Write custom controls
|
||||
• Fully Unicode compliant
|
||||
• Extensive font support
|
||||
• Integrates with OS clipboard
|
||||
• Includes complex text-flow controls (like this one) supporting hyperlinks, images, text formatting and more
|
||||
• Automatically adjust and scale to resolution changes
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>GUI Editor Features<font:Arial:16><lmargin%:5>
|
||||
• Integrated WYSIWYG GUI editor
|
||||
• Edit and test without exiting.
|
||||
• Hierarchal control view
|
||||
• Property editor
|
||||
• Drag and drop interface
|
||||
• Supports copy, cut paste of controls
|
||||
• Align selected controls
|
||||
• Auto space selected controls
|
||||
• Bring forward/back assign parent controls
|
46
example/demo/client/ui/features/features_interior.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_interior) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Interior Rendering";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_interior.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
18
example/demo/client/ui/features/features_interior.txt
Normal file
@ -0,0 +1,18 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/ss_ie>
|
||||
<just:left><font:Arial Bold:18>Interior Rendering Engine<font:Arial:16>
|
||||
<lmargin%:5>The portal based interior engine is capable of rendering enormous enclosed spaces. External light sources filter through windows and properly illuminate interior surfaces.
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>Feature Highlights:<font:Arial:16><lmargin%:5>
|
||||
• Portal based visibility
|
||||
• Level-of-Detail support
|
||||
• Detail brushes
|
||||
• Per pixel, colored light maps
|
||||
• Animated lightmaps
|
||||
• Buildings can be instanced, placed, manipulated and scaled
|
||||
• Seamless integration with the terrain engine
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>Editors:<font:Arial:16><lmargin%:5>
|
||||
• Constructor .map editor
|
||||
• Quark .map editor
|
||||
• 3D World Studio editor
|
||||
• Hammer .map editor
|
46
example/demo/client/ui/features/features_main.gui
Executable file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_main) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Torque in a Nutshell";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "2 2";
|
||||
extent = "553 514";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_main.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
8
example/demo/client/ui/features/features_main.txt
Executable file
@ -0,0 +1,8 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/tge>
|
||||
<just:left><font:Arial Bold:18>The Torque Game Engine<font:Arial:16>
|
||||
<lmargin%:5>The Torque Game Engine (TGE) is a full featured AAA game engine with award winning multiplayer network code, seamless indoor/outdoor rendering engines, state of the art skeletal animation, drag and drop GUI creation, a built in world editor, and a C-like scripting language. Unlike most commercial game engines, as part of the low cost license, you receive all C++ source code to the engine and built in tools, so you can customize the engine and make your game perform exactly to your own specifications.
|
||||
|
||||
Don't spend your limited time reinventing the technology wheel. Instead, use an industry proven game development engine that can enhance your creativity, productivity and get your game done faster.
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>Features<font:Arial:16>
|
||||
<lmargin%:5>The next several pages provide an overview of the major engine features. Click the right arrow below to learn more about Scripting, the GUI System, Networking, Audio, Rendering, Interiors, Terrains, Water and much more....
|
46
example/demo/client/ui/features/features_mesh.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_mesh) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Mesh Rendering";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_mesh.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
17
example/demo/client/ui/features/features_mesh.txt
Normal file
@ -0,0 +1,17 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/ss_me>
|
||||
<just:left><font:Arial Bold:18>Mesh Rendering Engine<font:Arial:16>
|
||||
<lmargin%:5>The work-horse of the Torque Game Engine, the mesh rendering engine does it all. Use single mesh and hierarchal mesh part shapes for players, vehicles, guns, projectiles, trees, rocks, you name it. Add multiple complex animation sequences and even blend between multiple active animations!
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>Feature Highlights:<font:Arial:16><lmargin%:5>
|
||||
• Continuous Level-of-Detail based on a progressive mesh algorithm
|
||||
• Supports bone, mesh, texture bitmap, texture coordinate and visibility animations
|
||||
• Supports both discrete LOD meshes as well as progressive LOD
|
||||
• Blend between multiple simultaneous animations
|
||||
• Mesh vertex deformation animation
|
||||
• Multi-bone mesh skeletal animation
|
||||
• Simple interface to multi-sequence animation manager
|
||||
• Damage detail level
|
||||
• Full collision implementation
|
||||
• Projected object shadows (clipped against the environment)
|
||||
• 3D Studio Max, Maya, Blender, Lightwave and MilkShape exporters
|
||||
• Robust animation SDK you can use and extend in your own objects
|
46
example/demo/client/ui/features/features_net.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_net) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Torque Networking";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_net.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
23
example/demo/client/ui/features/features_net.txt
Normal file
@ -0,0 +1,23 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/torquenetworking>
|
||||
<just:left><font:Arial Bold:18>Torque Networking<font:Arial:16><lmargin%:5>
|
||||
The Torque Game Engine has a strong foundation built into the code for multiplayer games. This award winning network code has been recognized by press and developers alike as being one of the most efficient and responsive multiplayer codebases available. Easily support dozens of players, with support for hundreds of players attainable with close attention to detailing and bandwidth usage (Tribes2 used this code to support 128 player servers). Key features of Torque networking code are: support for multiple data delivery requirements, partial object state updates and an efficient packet delivery notification protocol.
|
||||
|
||||
<font:Arial Bold:18><lmargin%:2>Feature Highlights<font:Arial:16><lmargin%:5>
|
||||
• Award winning client/server architecture
|
||||
• Uses UDP and TCP
|
||||
• Packet stream manager
|
||||
• Object ghost manager
|
||||
• Partial object updates
|
||||
• Metric based partial updates
|
||||
• Bit level stream packing
|
||||
• String and message packing
|
||||
• Uses the optimal Notified Delivery Protocol
|
||||
|
||||
<font:Arial Bold:18><lmargin%:2>Torque Network Library (API)<font:Arial:16><lmargin%:5>
|
||||
Torque Network Library allows developers to take the Torque Game Engine's networking code to the next level. The Torque Network Library (TNL) is a robust, secure, easy to use cross-platform C++ networking API designed for high performance simulations and games. TNL is designed to be easy to integrate into existing products. In less than an hour, you can have a minimal TNL implementation up and running in your game or network product. Within weeks you can take advantage of all the advanced features of the TNL, allowing your game to support more players while using less bandwidth per client than any other solution on the market.
|
||||
|
||||
More information about TNL can be found at <a:www.garagegames.com/pg/product/view.php?id=37>GarageGames</a> and <a:www.opentnl.org>OpenTNL.org</a>.
|
||||
|
||||
<font:Arial Bold:18><lmargin%:2>References<font:Arial:16><lmargin%:5>
|
||||
Session Presentation Notes from Game Developers Conference 2000
|
||||
<a:www.garagegames.com/articles/networking1/>The TRIBES Engine Networking Model or How to Make the Internet Rock for Multi-player Games</a>
|
46
example/demo/client/ui/features/features_particles.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_particles) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Features...";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_particles.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
5
example/demo/client/ui/features/features_particles.txt
Normal file
@ -0,0 +1,5 @@
|
||||
<spush><font:Arial Bold:18><lmargin%:2>Particle Engine<spop>
|
||||
<lmargin%:5>• Integrated with scripting engine
|
||||
- Animate texture and scale
|
||||
- Specify particle mass, drag, starting velocity, etc.
|
||||
- Sophisticated particle generators which can emit multiple particle types at once
|
46
example/demo/client/ui/features/features_render.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_render) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Rendering Engine Overview";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_render.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
17
example/demo/client/ui/features/features_render.txt
Normal file
@ -0,0 +1,17 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/ss_re>
|
||||
<just:left><font:Arial Bold:18>Rendering Engine Overview<font:Arial:16>
|
||||
<lmargin%:5>The scenegraph based rendering system in the Torque Game Engine supports a wide array of rendering tasks: from vast terrains to detailed interior spaces, animated meshes and clouded skys all seamlessly integrate together producing stunning scenery. The next couple pages provide an overview of the major rendering sub-systems.
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>Feature Highlights:<font:Arial:16><lmargin%:5>
|
||||
• Terrain rendering
|
||||
• Interior rendering
|
||||
• Sky and environmental effects
|
||||
• Complex animated meshes
|
||||
• Multi-pass texturing
|
||||
• Layered volumetric fog
|
||||
• Decals
|
||||
• Detail texturing
|
||||
• Environment mapping
|
||||
• Vertex and multi-pass lighting
|
||||
• True spherical distance fogging (for terrain, buildings)
|
||||
• Spherical distance clipping (for terrain, buildings)
|
46
example/demo/client/ui/features/features_script.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_script) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "TorqueScript";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_script.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
32
example/demo/client/ui/features/features_script.txt
Normal file
@ -0,0 +1,32 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/torquescript>
|
||||
<just:left><font:Arial Bold:18>TorqueScript<font:Arial:16><lmargin%:5>
|
||||
TorqueScript is the powerful C-like scripting language built into the core of the Torque Game Engine. TorqueScript reduces your development time by allowing you to quickly associate scripted logic and data to engine objects at runtime without exiting the engine. Take a look at any of the numerous .cs and .gui files that come with this demo and you will see just how extensively TorqueScript can be leveraged to get your project done quickly.
|
||||
|
||||
<font:Arial Bold:18><lmargin%:2>Feature Highlights<font:Arial:16><lmargin%:5>
|
||||
• C-like syntax
|
||||
• Large complement of functions including math, object manipulation, fileIO, TCP/IP, etc.
|
||||
• Easily extend with plug-ins
|
||||
• Integrated script compiler
|
||||
• Intermediate tokenized object format
|
||||
• On-demand compilation
|
||||
• Local and remote debugging using built in debugger
|
||||
• Overlay package support
|
||||
• Easily extended from C++ or script
|
||||
|
||||
<font:Arial Bold:18><lmargin%:2>Script Example: AI Player Task Control
|
||||
<lmargin%:5><font:Courier New:14>
|
||||
function AIPlayer::test()
|
||||
{
|
||||
%player = AIPlayer::spawnOnPath("xasd","MissionGroup/Paths/Path2");
|
||||
%player.mountImage(CrossbowImage,0);
|
||||
%player.setInventory(CrossbowAmmo,1000);
|
||||
|
||||
%player.pushTask("followPath(\"MissionGroup/Paths/Path2\")");
|
||||
%player.pushTask("aimAt(\"MissionGroup/Room6/target\")");
|
||||
%player.pushTask("wait(1)");
|
||||
%player.pushTask("fire(true)");
|
||||
%player.pushTask("wait(10)");
|
||||
%player.pushTask("fire(false)");
|
||||
%player.pushTask("playThread(0,\"celwave\")");
|
||||
%player.pushTask("done()");
|
||||
}
|
46
example/demo/client/ui/features/features_sound.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_sound) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Sound System";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_sound.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
11
example/demo/client/ui/features/features_sound.txt
Normal file
@ -0,0 +1,11 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/ss_ae>
|
||||
<just:left><font:Arial Bold:18>OpenAL Audio<font:Arial:16>
|
||||
<lmargin%:5>The Torque Game Engine uses OpenAL as its cross-platform 3D audio API. OpenAL is an industry standard audio API used in many popular games as well as other types of audio applications. Torque adds extensions to simplify many common gaming audio tasks.
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>Feature Highlights:<font:Arial:16><lmargin%:5>
|
||||
• Uses OpenAL: an industry standard multi-platform audio API
|
||||
• Multi-channel prioritized audio manager
|
||||
• 3D Positional sound support with Doppler and cone emitters
|
||||
• 2D sound support with panning, pitch and volume
|
||||
• Looping controls
|
||||
• Audio resource management
|
46
example/demo/client/ui/features/features_terrain.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_terrain) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Terrain Rendering";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_terrain.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|
18
example/demo/client/ui/features/features_terrain.txt
Normal file
@ -0,0 +1,18 @@
|
||||
<lmargin%:2><just:right><bitmap:demo/client/ui/features/ss_te>
|
||||
<just:left><font:Arial Bold:18>Terrain Rendering Engine<font:Arial:16>
|
||||
<lmargin%:5>The Terrain system can render truly spectacular vistas with impressive visual distance. Using the in-game editors you can quickly generate realistic heightfields and cover with textures many kilometers of terrain with a few mouse clicks. The screen error based and continuous LOD mesh reduction keeps the poly count low, the mesh rock solid and the distance visibility high.
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>Integrated Editors:<font:Arial:16><lmargin%:5>
|
||||
• Integrated Heightfield Generator
|
||||
• Import/export grayscale heightfield bitmaps
|
||||
• Integrated rule-based texture tile placement
|
||||
• Integrated texture tile "painting"
|
||||
|
||||
<lmargin%:2><font:Arial Bold:18>Feature Highlights:<font:Arial:16><lmargin%:5>
|
||||
• Continuous, seamless, Level-of-Detail (LOD) mesh
|
||||
• LOD reduction uses adjustable screen error metrics
|
||||
• Light mapped self shadowing and building shadows
|
||||
• Dynamically generated blend tiles
|
||||
• Aggregated tile mip-mapping
|
||||
• Altitude based fog banks
|
||||
• Seamless integration with the interior engine
|
46
example/demo/client/ui/features/features_water.gui
Normal file
@ -0,0 +1,46 @@
|
||||
//--- OBJECT WRITE BEGIN ---
|
||||
new GuiControl(features_water) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "right";
|
||||
vertSizing = "bottom";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
title = "Water Rendering";
|
||||
|
||||
new GuiScrollCtrl() {
|
||||
profile = "GuiBevelLoweredProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "30 106";
|
||||
extent = "580 270";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
willFirstRespond = "1";
|
||||
hScrollBar = "alwaysOff";
|
||||
vScrollBar = "alwaysOn";
|
||||
constantThumbHeight = "0";
|
||||
childMargin = "0 0";
|
||||
|
||||
new GuiMLTextCtrl() {
|
||||
profile = "GuiMLTextProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "14 12";
|
||||
extent = "553 14";
|
||||
minExtent = "8 2";
|
||||
visible = "1";
|
||||
helpTag = "0";
|
||||
lineSpacing = "2";
|
||||
allowColorChars = "0";
|
||||
maxChars = "-1";
|
||||
text = "main";
|
||||
fileName = "demo/client/ui/features/features_water.txt";
|
||||
};
|
||||
};
|
||||
};
|
||||
//--- OBJECT WRITE END ---
|
||||
|