diff --git a/Engine/source/T3D/assets/TerrainMaterialAsset.cpp b/Engine/source/T3D/assets/TerrainMaterialAsset.cpp new file mode 100644 index 000000000..c653d43a9 --- /dev/null +++ b/Engine/source/T3D/assets/TerrainMaterialAsset.cpp @@ -0,0 +1,316 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2013 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +#ifndef TERRAINMATERIALASSET_H +#include "TerrainMaterialAsset.h" +#endif + +#ifndef _ASSET_MANAGER_H_ +#include "assets/assetManager.h" +#endif + +#ifndef _CONSOLETYPES_H_ +#include "console/consoleTypes.h" +#endif + +#ifndef _TAML_ +#include "persistence/taml/taml.h" +#endif + +#ifndef _ASSET_PTR_H_ +#include "assets/assetPtr.h" +#endif + +//----------------------------------------------------------------------------- + +IMPLEMENT_CONOBJECT(TerrainMaterialAsset); + +ConsoleType(TerrainMaterialAssetPtr, TypeTerrainMaterialAssetPtr, TerrainMaterialAsset, ASSET_ID_FIELD_PREFIX) + +//----------------------------------------------------------------------------- + +ConsoleGetType(TypeTerrainMaterialAssetPtr) +{ + // Fetch asset Id. + return (*((AssetPtr*)dptr)).getAssetId(); +} + +//----------------------------------------------------------------------------- + +ConsoleSetType(TypeTerrainMaterialAssetPtr) +{ + // Was a single argument specified? + if (argc == 1) + { + // Yes, so fetch field value. + const char* pFieldValue = argv[0]; + + // Fetch asset pointer. + AssetPtr* pAssetPtr = dynamic_cast*>((AssetPtrBase*)(dptr)); + + // Is the asset pointer the correct type? + if (pAssetPtr == NULL) + { + // No, so fail. + //Con::warnf("(TypeMaterialAssetPtr) - Failed to set asset Id '%d'.", pFieldValue); + return; + } + + // Set asset. + pAssetPtr->setAssetId(pFieldValue); + + return; + } + + // Warn. + Con::warnf("(TypeTerrainMaterialAssetPtr) - Cannot set multiple args to a single asset."); +} + +//----------------------------------------------------------------------------- + +TerrainMaterialAsset::TerrainMaterialAsset() +{ + mScriptFile = StringTable->EmptyString(); + mMatDefinitionName = StringTable->EmptyString(); +} + +//----------------------------------------------------------------------------- + +TerrainMaterialAsset::~TerrainMaterialAsset() +{ +} + +//----------------------------------------------------------------------------- + +void TerrainMaterialAsset::initPersistFields() +{ + // Call parent. + Parent::initPersistFields(); + + //addField("shaderGraph", TypeRealString, Offset(mShaderGraphFile, TerrainMaterialAsset), ""); + addProtectedField("scriptFile", TypeAssetLooseFilePath, Offset(mScriptFile, TerrainMaterialAsset), + &setScriptFile, &getScriptFile, "Path to the file containing the material definition."); + + addField("materialDefinitionName", TypeString, Offset(mMatDefinitionName, TerrainMaterialAsset), "Name of the material definition this asset is for."); +} + +void TerrainMaterialAsset::initializeAsset() +{ + // Call parent. + Parent::initializeAsset(); + + compileShader(); + + if (!Platform::isFullPath(mScriptFile)) + mScriptFile = getOwned() ? expandAssetFilePath(mScriptFile) : mScriptFile; + + if (Platform::isFile(mScriptFile)) + Con::executeFile(mScriptFile, false, false); +} + +void TerrainMaterialAsset::onAssetRefresh() +{ + mScriptFile = expandAssetFilePath(mScriptFile); + + if (Platform::isFile(mScriptFile)) + Con::executeFile(mScriptFile, false, false); + + if (mMatDefinitionName != StringTable->EmptyString()) + { + TerrainMaterial* matDef; + if (!Sim::findObject(mMatDefinitionName, matDef)) + { + Con::errorf("TerrainMaterialAsset: Unable to find the Material %s", mMatDefinitionName); + return; + } + + //matDef->reload(); + } +} + +void TerrainMaterialAsset::setScriptFile(const char* pScriptFile) +{ + // Sanity! + AssertFatal(pScriptFile != NULL, "Cannot use a NULL script file."); + + // Fetch image file. + pScriptFile = StringTable->insert(pScriptFile); + + // Update. + mScriptFile = getOwned() ? expandAssetFilePath(pScriptFile) : pScriptFile; + + // Refresh the asset. + refreshAsset(); +} + +//------------------------------------------------------------------------------ + +void TerrainMaterialAsset::compileShader() +{ +} + +void TerrainMaterialAsset::copyTo(SimObject* object) +{ + // Call to parent. + Parent::copyTo(object); +} + +DefineEngineMethod(TerrainMaterialAsset, compileShader, void, (), , "Compiles the material's generated shader, if any. Not yet implemented\n") +{ + object->compileShader(); +} + +//----------------------------------------------------------------------------- +// GuiInspectorTypeAssetId +//----------------------------------------------------------------------------- + +IMPLEMENT_CONOBJECT(GuiInspectorTypeTerrainMaterialAssetPtr); + +ConsoleDocClass(GuiInspectorTypeTerrainMaterialAssetPtr, + "@brief Inspector field type for Material Asset Objects\n\n" + "Editor use only.\n\n" + "@internal" +); + +void GuiInspectorTypeTerrainMaterialAssetPtr::consoleInit() +{ + Parent::consoleInit(); + + ConsoleBaseType::getType(TypeTerrainMaterialAssetPtr)->setInspectorFieldType("GuiInspectorTypeTerrainMaterialAssetPtr"); +} + +GuiControl* GuiInspectorTypeTerrainMaterialAssetPtr::constructEditControl() +{ + // Create base filename edit controls + mUseHeightOverride = true; + mHeightOverride = 100; + + mMatEdContainer = new GuiControl(); + mMatEdContainer->registerObject(); + + addObject(mMatEdContainer); + + // Create "Open in ShapeEditor" button + mMatPreviewButton = new GuiBitmapButtonCtrl(); + + const char* matAssetId = getData(); + + TerrainMaterialAsset* matAsset = AssetDatabase.acquireAsset< TerrainMaterialAsset>(matAssetId); + + TerrainMaterial* materialDef = nullptr; + + char bitmapName[512] = "tools/worldEditor/images/toolbar/shape-editor"; + + /*if (!Sim::findObject(matAsset->getMaterialDefinitionName(), materialDef)) + { + Con::errorf("GuiInspectorTypeTerrainMaterialAssetPtr::constructEditControl() - unable to find material in asset"); + } + else + { + mMatPreviewButton->setBitmap(materialDef->mDiffuseMapFilename[0]); + }*/ + + mMatPreviewButton->setPosition(0, 0); + mMatPreviewButton->setExtent(100,100); + + // Change filespec + char szBuffer[512]; + dSprintf(szBuffer, sizeof(szBuffer), "AssetBrowser.showDialog(\"TerrainMaterialAsset\", \"AssetBrowser.changeAsset\", %d, %s);", + mInspector->getComponentGroupTargetId(), mCaption); + mMatPreviewButton->setField("Command", szBuffer); + + mMatPreviewButton->setDataField(StringTable->insert("Profile"), NULL, "GuiButtonProfile"); + mMatPreviewButton->setDataField(StringTable->insert("tooltipprofile"), NULL, "GuiToolTipProfile"); + mMatPreviewButton->setDataField(StringTable->insert("hovertime"), NULL, "1000"); + + StringBuilder strbld; + strbld.append(matAsset->getMaterialDefinitionName()); + strbld.append("\n"); + strbld.append("Open this file in the Material Editor"); + + mMatPreviewButton->setDataField(StringTable->insert("tooltip"), NULL, strbld.data()); + + _registerEditControl(mMatPreviewButton); + //mMatPreviewButton->registerObject(); + mMatEdContainer->addObject(mMatPreviewButton); + + mMatAssetIdTxt = new GuiTextEditCtrl(); + mMatAssetIdTxt->registerObject(); + mMatAssetIdTxt->setActive(false); + + mMatAssetIdTxt->setText(matAssetId); + + mMatAssetIdTxt->setBounds(100, 0, 150, 18); + mMatEdContainer->addObject(mMatAssetIdTxt); + + return mMatEdContainer; +} + +bool GuiInspectorTypeTerrainMaterialAssetPtr::updateRects() +{ + S32 dividerPos, dividerMargin; + mInspector->getDivider(dividerPos, dividerMargin); + Point2I fieldExtent = getExtent(); + Point2I fieldPos = getPosition(); + + mCaptionRect.set(0, 0, fieldExtent.x - dividerPos - dividerMargin, fieldExtent.y); + mEditCtrlRect.set(fieldExtent.x - dividerPos + dividerMargin, 1, dividerPos - dividerMargin - 34, fieldExtent.y); + + bool resized = mEdit->resize(mEditCtrlRect.point, mEditCtrlRect.extent); + + if (mMatEdContainer != nullptr) + { + mMatPreviewButton->resize(mEditCtrlRect.point, mEditCtrlRect.extent); + } + + if (mMatPreviewButton != nullptr) + { + mMatPreviewButton->resize(Point2I::Zero, Point2I(100, 100)); + } + + if (mMatAssetIdTxt != nullptr) + { + mMatAssetIdTxt->resize(Point2I(100, 0), Point2I(mEditCtrlRect.extent.x - 100, 18)); + } + + return resized; +} + +void GuiInspectorTypeTerrainMaterialAssetPtr::setMaterialAsset(String assetId) +{ + mTargetObject->setDataField(mCaption, "", assetId); + + //force a refresh + SimObject* obj = mInspector->getInspectObject(); + mInspector->inspectObject(obj); +} + +DefineEngineMethod(GuiInspectorTypeTerrainMaterialAssetPtr, setMaterialAsset, void, (String assetId), (""), + "Gets a particular shape animation asset for this shape.\n" + "@param animation asset index.\n" + "@return Shape Animation Asset.\n") +{ + if (assetId == String::EmptyString) + return; + + return object->setMaterialAsset(assetId); +} diff --git a/Engine/source/T3D/assets/TerrainMaterialAsset.h b/Engine/source/T3D/assets/TerrainMaterialAsset.h new file mode 100644 index 000000000..ae9a28f01 --- /dev/null +++ b/Engine/source/T3D/assets/TerrainMaterialAsset.h @@ -0,0 +1,108 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2013 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- +#ifndef TERRAINMATERIALASSET_H +#define TERRAINMATERIALASSET_H + +#ifndef _ASSET_BASE_H_ +#include "assets/assetBase.h" +#endif + +#ifndef _ASSET_DEFINITION_H_ +#include "assets/assetDefinition.h" +#endif + +#ifndef _STRINGUNIT_H_ +#include "string/stringUnit.h" +#endif + +#ifndef _ASSET_FIELD_TYPES_H_ +#include "assets/assetFieldTypes.h" +#endif + +#ifndef _GFXDEVICE_H_ +#include "gfx/gfxDevice.h" +#endif + +#ifndef _GUI_INSPECTOR_TYPES_H_ +#include "gui/editor/guiInspectorTypes.h" +#endif + +#include "terrain/terrMaterial.h" + +//----------------------------------------------------------------------------- +class TerrainMaterialAsset : public AssetBase +{ + typedef AssetBase Parent; + + StringTableEntry mScriptFile; + StringTableEntry mMatDefinitionName; + +public: + TerrainMaterialAsset(); + virtual ~TerrainMaterialAsset(); + + /// Engine. + static void initPersistFields(); + virtual void copyTo(SimObject* object); + + void compileShader(); + + StringTableEntry getMaterialDefinitionName() { return mMatDefinitionName; } + + void setScriptFile(const char* pScriptFile); + inline StringTableEntry getScriptFile(void) const { return mScriptFile; }; + + /// Declare Console Object. + DECLARE_CONOBJECT(TerrainMaterialAsset); + +protected: + virtual void initializeAsset(); + virtual void onAssetRefresh(void); + + static bool setScriptFile(void *obj, const char *index, const char *data) { static_cast(obj)->setScriptFile(data); return false; } + static const char* getScriptFile(void* obj, const char* data) { return static_cast(obj)->getScriptFile(); } +}; + +DefineConsoleType(TypeTerrainMaterialAssetPtr, TerrainMaterialAsset) + +//----------------------------------------------------------------------------- +// TypeAssetId GuiInspectorField Class +//----------------------------------------------------------------------------- +class GuiInspectorTypeTerrainMaterialAssetPtr : public GuiInspectorField +{ + typedef GuiInspectorField Parent; +public: + + GuiControl* mMatEdContainer; + GuiBitmapButtonCtrl *mMatPreviewButton; + GuiTextEditCtrl *mMatAssetIdTxt; + + DECLARE_CONOBJECT(GuiInspectorTypeTerrainMaterialAssetPtr); + static void consoleInit(); + + virtual GuiControl* constructEditControl(); + virtual bool updateRects(); + void setMaterialAsset(String assetId); +}; + +#endif // _ASSET_BASE_H_ + diff --git a/Engine/source/gui/editor/guiPopupMenuCtrl.cpp b/Engine/source/gui/editor/guiPopupMenuCtrl.cpp index 1d72b794c..9fb25c497 100644 --- a/Engine/source/gui/editor/guiPopupMenuCtrl.cpp +++ b/Engine/source/gui/editor/guiPopupMenuCtrl.cpp @@ -169,6 +169,12 @@ void GuiPopupMenuTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool s PrimBuild::vertex2i(left, bottom); PrimBuild::end();*/ } + + //check if we're checked + if (mPopup->mMenuItems[cell.y].mIsChecked) + { + GFX->getDrawUtil()->draw2DSquare(Point2F(offset.x + mCellSize.y / 2, offset.y + mCellSize.y / 2), 5); + } } bool GuiPopupMenuTextListCtrl::onKeyDown(const GuiEvent &event) diff --git a/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs b/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs index 4164f351a..5f9ed8163 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/client/connectionToServer.cs @@ -32,7 +32,7 @@ function GameConnection::onConnectionAccepted(%this) // datablocks and objects are ghosted over. physicsInitWorld( "client" ); - callOnModules("onCreateClient", "Game"); + callOnModules("onCreateClientConnection", "Game"); } function GameConnection::initialControlSet(%this) @@ -134,5 +134,5 @@ function disconnectedCleanup() // We can now delete the client physics simulation. physicsDestroyWorld( "client" ); - callOnModules("onDestroyClient", "Game"); + callOnModules("onDestroyClientConnection", "Game"); } diff --git a/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.cs index 7da9a992e..269362638 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/server/levelInfo.cs @@ -140,6 +140,9 @@ function parseMissionGroupForIds( %className, %childGroup ) else %currentGroup = %childGroup; + if(!isObject(%currentGroup)) + return ""; + for(%i = 0; %i < (%currentGroup).getCount(); %i++) { if( (%currentGroup).getObject(%i).getClassName() $= %className ) diff --git a/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs b/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs index de43a641d..7e938042a 100644 --- a/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs +++ b/Templates/BaseGame/game/core/clientServer/scripts/server/server.cs @@ -242,6 +242,7 @@ function destroyServer() //Get our modules so we can exec any specific server-side loading/handling callOnModules("onDestroyGameServer", "Game"); + callOnModules("onDestroyGameServer", "Core"); // Save any server settings %prefPath = getPrefpath(); diff --git a/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs b/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs new file mode 100644 index 000000000..b04a2c795 --- /dev/null +++ b/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs @@ -0,0 +1,143 @@ +datablock ReflectorDesc( DefaultCubeDesc ) +{ + texSize = 256; + nearDist = 0.1; + farDist = 1000.0; + objectTypeMask = 0xFFFFFFFF; + detailAdjust = 1.0; + priority = 1.0; + maxRateMs = 15; + useOcclusionQuery = true; +}; + +datablock ParticleEmitterNodeData(DefaultEmitterNodeData) +{ + timeMultiple = 1; +}; + + +datablock ParticleData(DefaultParticle) +{ + textureName = "core/gameObjects/images/defaultParticle"; + dragCoefficient = 0.498534; + gravityCoefficient = 0; + inheritedVelFactor = 0.499022; + constantAcceleration = 0.0; + lifetimeMS = 1313; + lifetimeVarianceMS = 500; + useInvAlpha = true; + spinRandomMin = -360; + spinRandomMax = 360; + spinSpeed = 1; + + colors[0] = "0.992126 0.00787402 0.0314961 1"; + colors[1] = "1 0.834646 0 0.645669"; + colors[2] = "1 0.299213 0 0.330709"; + colors[3] = "0.732283 1 0 0"; + + sizes[0] = 0; + sizes[1] = 0.497467; + sizes[2] = 0.73857; + sizes[3] = 0.997986; + + times[0] = 0.0; + times[1] = 0.247059; + times[2] = 0.494118; + times[3] = 1; + + animTexName = "core/gameObjects/images/defaultParticle"; +}; + +datablock ParticleEmitterData(DefaultEmitter) +{ + ejectionPeriodMS = "50"; + ejectionVelocity = "1"; + velocityVariance = "0"; + ejectionOffset = "0.2"; + thetaMax = "40"; + particles = "DefaultParticle"; + blendStyle = "ADDITIVE"; + softParticles = "0"; + softnessDistance = "1"; +}; + +//----------------------------------------------------------------------------- +// DefaultTrigger is used by the mission editor. This is also an example +// of trigger methods and callbacks. + +datablock TriggerData(DefaultTrigger) +{ + // The period is value is used to control how often the console + // onTriggerTick callback is called while there are any objects + // in the trigger. The default value is 100 MS. + tickPeriodMS = 100; +}; + +datablock TriggerData(ClientTrigger : DefaultTrigger) +{ + clientSide = true; +}; + +datablock RibbonNodeData(DefaultRibbonNodeData) +{ + timeMultiple = 1.0; +}; + +//ribbon data//////////////////////////////////////// + +datablock RibbonData(BasicRibbon) +{ + size[0] = 0.5; + color[0] = "1.0 0.0 0.0 1.0"; + position[0] = 0.0; + + size[1] = 0.0; + color[1] = "1.0 0.0 0.0 0.0"; + position[1] = 1.0; + + RibbonLength = 40; + fadeAwayStep = 0.1; + UseFadeOut = true; + RibbonMaterial = BasicRibbonMat; + + category = "FX"; +}; + +datablock RibbonData(TexturedRibbon) +{ + RibbonMaterial = TexturedRibbonMat; + size[0] = 0.5; + color[0] = "1.0 1.0 1.0 1.0"; + position[0] = 0.0; + + size[1] = 0.5; + color[1] = "1.0 1.0 1.0 1.0"; + position[1] = 1.0; + + RibbonLength = 40; + fadeAwayStep = 0.1; + UseFadeOut = true; + tileScale = 1; + fixedTexCoords = true; + TexcoordsRelativeToDistance = true; + + category = "FX"; +}; + +datablock MissionMarkerData(WayPointMarker) +{ + category = "Misc"; + shapeFile = "core/gameObjects/shapes/octahedron.dts"; +}; + +datablock MissionMarkerData(SpawnSphereMarker) +{ + category = "Misc"; + shapeFile = "core/gameObjects/shapes/octahedron.dts"; +}; + +datablock MissionMarkerData(CameraBookmarkMarker) +{ + category = "Misc"; + shapeFile = "core/gameObjects/shapes/camera.dts"; +}; diff --git a/Templates/BaseGame/game/core/gameObjects/images/camera.png b/Templates/BaseGame/game/core/gameObjects/images/camera.png new file mode 100644 index 000000000..4cde4fe67 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/images/camera.png differ diff --git a/Templates/BaseGame/game/core/gameObjects/images/defaultParticle.png b/Templates/BaseGame/game/core/gameObjects/images/defaultParticle.png new file mode 100644 index 000000000..911ae3e46 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/images/defaultParticle.png differ diff --git a/Templates/BaseGame/game/core/gameObjects/images/defaultRoadTextureOther.png b/Templates/BaseGame/game/core/gameObjects/images/defaultRoadTextureOther.png new file mode 100644 index 000000000..a2f08fe6a Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/images/defaultRoadTextureOther.png differ diff --git a/Templates/BaseGame/game/core/gameObjects/images/defaultRoadTextureTop.png b/Templates/BaseGame/game/core/gameObjects/images/defaultRoadTextureTop.png new file mode 100644 index 000000000..93ca1330b Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/images/defaultRoadTextureTop.png differ diff --git a/Templates/BaseGame/game/core/gameObjects/images/defaultpath.png b/Templates/BaseGame/game/core/gameObjects/images/defaultpath.png new file mode 100644 index 000000000..2f08509c2 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/images/defaultpath.png differ diff --git a/Templates/BaseGame/game/core/gameObjects/images/defaultpath_normal.png b/Templates/BaseGame/game/core/gameObjects/images/defaultpath_normal.png new file mode 100644 index 000000000..3122dbe41 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/images/defaultpath_normal.png differ diff --git a/Templates/BaseGame/game/core/gameObjects/images/green.jpg b/Templates/BaseGame/game/core/gameObjects/images/green.jpg new file mode 100644 index 000000000..c95126226 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/images/green.jpg differ diff --git a/Templates/BaseGame/game/core/gameObjects/images/ribTex.png b/Templates/BaseGame/game/core/gameObjects/images/ribTex.png new file mode 100644 index 000000000..82dffb96a Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/images/ribTex.png differ diff --git a/Templates/BaseGame/game/core/gameObjects/materials/materials.cs b/Templates/BaseGame/game/core/gameObjects/materials/materials.cs new file mode 100644 index 000000000..9ea6fa1bd --- /dev/null +++ b/Templates/BaseGame/game/core/gameObjects/materials/materials.cs @@ -0,0 +1,78 @@ +new ShaderData( BasicRibbonShader ) +{ + DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderV.hlsl"; + DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/basicRibbonShaderP.hlsl"; + + OGLVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/gl/basicRibbonShaderV.glsl"; + OGLPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/gl/basicRibbonShaderP.glsl"; + + samplerNames[0] = "$ribTex"; + + pixVersion = 2.0; +}; + +singleton CustomMaterial( BasicRibbonMat ) +{ + shader = BasicRibbonShader; + version = 2.0; + + emissive[0] = true; + + doubleSided = true; + translucent = true; + BlendOp = AddAlpha; + translucentBlendOp = AddAlpha; + + preload = true; +}; + +new ShaderData( TexturedRibbonShader ) +{ + DXVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderV.hlsl"; + DXPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/texRibbonShaderP.hlsl"; + + OGLVertexShaderFile = $Core::CommonShaderPath @ "/ribbons/gl/texRibbonShaderV.glsl"; + OGLPixelShaderFile = $Core::CommonShaderPath @ "/ribbons/gl/texRibbonShaderP.glsl"; + + samplerNames[0] = "$ribTex"; + + pixVersion = 2.0; +}; + +singleton CustomMaterial( TexturedRibbonMat ) +{ + shader = TexturedRibbonShader; + version = 2.0; + + emissive[0] = true; + + doubleSided = true; + translucent = true; + BlendOp = AddAlpha; + translucentBlendOp = AddAlpha; + + sampler["ribTex"] = "core/gameObjects/images/ribTex.png"; + + preload = true; +}; + +singleton Material(DefaultDecalRoadMaterial) +{ + diffuseMap[0] = "core/gameObjects/images/defaultRoadTextureTop.png"; + mapTo = "unmapped_mat"; + materialTag0 = "RoadAndPath"; +}; + +singleton Material(DefaultRoadMaterialTop) +{ + mapTo = "unmapped_mat"; + diffuseMap[0] = "core/gameObjects/images/defaultRoadTextureTop.png"; + materialTag0 = "RoadAndPath"; +}; + +singleton Material(DefaultRoadMaterialOther) +{ + mapTo = "unmapped_mat"; + diffuseMap[0] = "core/gameObjects/images/defaultRoadTextureOther.png"; + materialTag0 = "RoadAndPath"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/core/gameObjects/shapes/camera.dts b/Templates/BaseGame/game/core/gameObjects/shapes/camera.dts new file mode 100644 index 000000000..fdd5dbbe0 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/shapes/camera.dts differ diff --git a/Templates/BaseGame/game/core/gameObjects/shapes/materials.cs b/Templates/BaseGame/game/core/gameObjects/shapes/materials.cs new file mode 100644 index 000000000..997ab23c9 --- /dev/null +++ b/Templates/BaseGame/game/core/gameObjects/shapes/materials.cs @@ -0,0 +1,112 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +singleton Material(OctahedronMat) +{ + mapTo = "green"; + + diffuseMap[0] = "core/gameObjects/images/camera"; + + translucent = "1"; + translucentBlendOp = "LerpAlpha"; + emissive = "0"; + castShadows = "0"; + + colorMultiply[0] = "0 1 0 1"; +}; + +//--- camera.dts MATERIALS BEGIN --- +singleton Material(CameraMat) +{ + mapTo = "pasted__phongE1"; + + diffuseMap[0] = "core/gameObjects/images/camera"; + + diffuseColor[0] = "0 0.627451 1 1"; + specular[0] = "1 1 1 1"; + specularPower[0] = 211; + pixelSpecular[0] = 1; + emissive[0] = 1; + + doubleSided = 1; + translucent = true; + translucentBlendOp = "LerpAlpha"; + castShadows = false; + materialTag0 = "Miscellaneous"; +}; + +//--- camera.dts MATERIALS END --- +//--- noshape.dts MATERIALS BEGIN --- +singleton Material(noshape_NoShape) +{ + mapTo = "NoShape"; + + diffuseMap[0] = ""; + + diffuseColor[0] = "0.8 0.003067 0 .8"; + emissive[0] = 0; + + doubleSided = false; + translucent = 1; + translucentBlendOp = "LerpAlpha"; + castShadows = false; +}; + +//--- noshape.dts MATERIALS END --- + +//--- noshapetext.dae MATERIALS BEGIN --- +singleton Material(noshapetext_lambert1) +{ + mapTo = "lambert1"; + + diffuseMap[0] = ""; + + diffuseColor[0] = "0.4 0.4 0.4 1"; + specular[0] = "1 1 1 1"; + specularPower[0] = 8; + pixelSpecular[0] = false; + emissive[0] = true; + + doubleSided = false; + translucent = false; + translucentBlendOp = "None"; +}; + +singleton Material(noshapetext_noshape_mat) +{ + mapTo = "noshape_mat"; + + diffuseMap[0] = ""; + + diffuseColor[0] = "0.4 0.3504 0.363784 0.33058"; + specular[0] = "1 1 1 1"; + specularPower[0] = 8; + pixelSpecular[0] = false; + emissive[0] = true; + + doubleSided = false; + translucent = true; + translucentBlendOp = "None"; +}; + +//--- noshapetext.dae MATERIALS END --- + diff --git a/Templates/BaseGame/game/core/gameObjects/shapes/noshape.dts b/Templates/BaseGame/game/core/gameObjects/shapes/noshape.dts new file mode 100644 index 000000000..a7a64cf10 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/shapes/noshape.dts differ diff --git a/Templates/BaseGame/game/core/gameObjects/shapes/octahedron.dts b/Templates/BaseGame/game/core/gameObjects/shapes/octahedron.dts new file mode 100644 index 000000000..c10f96663 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/shapes/octahedron.dts differ diff --git a/Templates/BaseGame/game/core/gameObjects/shapes/simplecone.dts b/Templates/BaseGame/game/core/gameObjects/shapes/simplecone.dts new file mode 100644 index 000000000..ed356132d Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/shapes/simplecone.dts differ diff --git a/Templates/BaseGame/game/core/gameObjects/shapes/unit_capsule.dts b/Templates/BaseGame/game/core/gameObjects/shapes/unit_capsule.dts new file mode 100644 index 000000000..bc9483fac Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/shapes/unit_capsule.dts differ diff --git a/Templates/BaseGame/game/core/gameObjects/shapes/unit_cube.dts b/Templates/BaseGame/game/core/gameObjects/shapes/unit_cube.dts new file mode 100644 index 000000000..feee7cf94 Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/shapes/unit_cube.dts differ diff --git a/Templates/BaseGame/game/core/gameObjects/shapes/unit_sphere.dts b/Templates/BaseGame/game/core/gameObjects/shapes/unit_sphere.dts new file mode 100644 index 000000000..4d435438e Binary files /dev/null and b/Templates/BaseGame/game/core/gameObjects/shapes/unit_sphere.dts differ diff --git a/Templates/BaseGame/game/data/ExampleModule/ExampleModule.cs b/Templates/BaseGame/game/data/ExampleModule/ExampleModule.cs new file mode 100644 index 000000000..7fb1b1850 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/ExampleModule.cs @@ -0,0 +1,105 @@ +//This is our create function. It's pointed to, by name, via a field defined in +//the ExampleModule.module file, which contains our module definition. It is called +//when the module is initially loaded by the engine. Generally, only common, base-level +//stuff is created(or destroyed, in the companion function), like things utilized or +//shared on both the client and server, or things that need to be loaded before anything +//else. +function ExampleModule::onCreate(%this) +{ + +} + +//Similar to the create function, this is defined in thye module file, and called +//when the module is destroyed, usually as part of the game shutting down. +function ExampleModule::onDestroy(%this) +{ + +} + +//This is called when the server part of the application is initially created. Torque3D +//assumes, even in a single player context, that there is ultimately a 'server' and a 'client' +//So during initial launch and startup of the engine, the server side is initialized in +//core/clientServer/scripts/server/server.cs - in the initServer() function where this is called. +//This is called on all modules that have this function defined. This is important for +//any persistant parts of the server that always need to run such as gameplay scripts +// +//Importantly, when the gane session server is created, several functions are called to as part of the gamemode logic +//The script below contains the callbacks so the gamemode can actually be set up, but the server-side callbacks in question: +//ExampleGameMode::onMissionStart +//ExampleGameMode::onMissionEnded +//ExampleGameMode::onMissionReset +//Are called during the startup, shut down, and resetting of any and all active gamemodes, as informed by the loaded scenes +//when the game server is processed. +//These callbacks are activated in core/clientServer/scripts/server/levelLoad.cs +function FPSGameplay::initServer(%this) +{ + //This script contains our ExampleGameMode logic + exec("./scripts/ExampleGamemodeScript.cs"); +} + +//This is called when a game session server is actually created so the game may be played. It's called +//from core/clientServer/scripts/server/server.cs - in the createServer() function, which is called when +//A game session is actually launched, and the server is generated so game clients can connect to it. +//This is utilized to set up common things that need to be set up each time the game session server is +//created, such as common variables, datablocks to be transmitted to the client, etc. +function ExampleModule::onCreateGameServer(%this) +{ + //In particular, the default client/server module handles the transmission of datablocks from + //server to client automatically as part of the connection and prepping process alongside + //validation and tramission of level objects. It does this in an abstracted way by adding + //the file paths to a master DatablockFilesList array as per below. When the server is created in + //onServerCreated(), it loads the datablocks via this array, and when when the server goes + //to pass data to the client, it iterates over this list and processes it, ensuring all datablocks + //are the most up to date possible for transmission to the connecting client + %this.registerDatablock("./datablocks/ExampleDatablock.cs"); +} + +//This is called when a game session server is destroyed, when the game shuts down. It's called from +//core/clientServer/scripts/server/server.cs - in the destroyServer() function, which just cleans up anything +//The module may have set up as part of the game server being created. +function ExampleModule::onDestroyGameServer(%this) +{ + +} + +//Similar to initServer, this is called during the initial launch of the application and the client component +//is set up. The difference is that the client may not actually be created, such as in the case for dedicated servers +//Where no UI or gameplay interface is required. It's called from core/clientServer/scripts/client/client.cs - +//in the initClient() function. It sets up common elements that the client will always need, such as scripts, GUIs +//and the like +function ExampleModule::initClient(%this) +{ + //client scripts + //Here, we exec out keybind scripts so the player is able to move when they get into a game + exec("./scripts/default.keybinds.cs"); + + %prefPath = getPrefpath(); + if(isFile(%prefPath @ "/keybinds.cs")) + exec(%prefPath @ "/keybinds.cs"); + + exec("./scripts/inputCommands.cs"); +} + +//This is called when a game session client successfuly connects to a game server. +//It's called from core/clientServer/scripts/client/connectionToServer.cs - in the GameConnection::onConnectionAccepted() function +//It's used for any client-side specific game session stuff that the client needs to load or pass to the server, such as profile data +//account progress, preferences, etc. +// +//When a client is connected, the gamemode logic also has a callback activated - ExampleGameMode::onClientEnterGame(). +function ExampleModule::onCreateClientConnection(%this) +{ + //This will push our keybind movemap onto the input stack, so we can control our camera in our ExampleGameMode + ExampleMoveMap.push(); +} + +//This is called when a client game session disconnects from a game server +//It's called from core/clientServer/scripts/client/connectionToServer.cs - in the disconnectedCleanup() function +//It's used to clean up and potentially write out any client-side stuff that needs housekeeping when disconnecting for any reason. +//It will be called if the connection is manually terminated, or lost due to any sort of connection issue. +// +//When a client disconnects, the gamemode logic has a callback activated - ExampleGameMode::onClientLeaveGame(). +function ExampleModule::onDestroyClientConnection(%this) +{ + //This will pop the keybind, cleaning it up from the input stack, as it no longer applies + ExampleMoveMap.pop(); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ExampleModule/ExampleModule.module b/Templates/BaseGame/game/data/ExampleModule/ExampleModule.module new file mode 100644 index 000000000..d66580ddb --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/ExampleModule.module @@ -0,0 +1,25 @@ + + + + + diff --git a/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.asset.taml b/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.asset.taml new file mode 100644 index 000000000..c25ac42a2 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.asset.taml @@ -0,0 +1,7 @@ + diff --git a/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.cs b/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.cs new file mode 100644 index 000000000..be5495d3f --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.cs @@ -0,0 +1,9 @@ +function ExampleGUI::onWake(%this) +{ + +} + +function ExampleGUI::onSleep(%this) +{ + +} diff --git a/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.gui b/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.gui new file mode 100644 index 000000000..48bf13f92 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/GUIs/ExampleGUI.gui @@ -0,0 +1,7 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(ExampleGUI) +{ + position = "0 0"; + extent = "100 100"; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.asset.taml b/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.asset.taml new file mode 100644 index 000000000..7d2affa3e --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.asset.taml @@ -0,0 +1,9 @@ + diff --git a/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.cs b/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.cs new file mode 100644 index 000000000..497b0e41d --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/components/ExampleComponent.cs @@ -0,0 +1,26 @@ +//onAdd is called when the component is created and then added to it's owner entity. +//You would also add any script-defined component fields via addComponentField(). +function ExampleComponent::onAdd(%this) +{ + +} +//onAdd is called when the component is removed and deleted from it's owner entity. +function ExampleComponent::onRemove(%this) +{ + +} +//onClientConnect is called any time a new client connects to the server. +function ExampleComponent::onClientConnect(%this, %client) +{ + +} +//onClientDisconnect is called any time a client disconnects from the server. +function ExampleComponent::onClientDisonnect(%this, %client) +{ + +} +//update is called when the component does an update tick. +function ExampleComponent::Update(%this) +{ + +} diff --git a/Templates/BaseGame/game/data/ExampleModule/datablocks/ExampleDatablock.cs b/Templates/BaseGame/game/data/ExampleModule/datablocks/ExampleDatablock.cs new file mode 100644 index 000000000..e69de29bb diff --git a/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.asset.taml b/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.asset.taml new file mode 100644 index 000000000..daa6d2045 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.asset.taml @@ -0,0 +1,8 @@ + diff --git a/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis b/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis new file mode 100644 index 000000000..b77aab33b --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/levels/ExampleLevel.mis @@ -0,0 +1,99 @@ +//--- OBJECT WRITE BEGIN --- +new Scene(EditorTemplateLevel) { + canSave = "1"; + canSaveDynamicFields = "1"; + cdTrack = "2"; + CTF_scoreLimit = "5"; + enabled = "1"; + musicTrack = "lush"; + gameModeName="ExampleGameMode"; + + new LevelInfo(TheLevelInfo) { + nearClip = "0.1"; + visibleDistance = "1000"; + visibleGhostDistance = "0"; + decalBias = "0.0015"; + fogColor = "0.6 0.6 0.7 1"; + fogDensity = "0"; + fogDensityOffset = "700"; + fogAtmosphereHeight = "0"; + canvasClearColor = "0 0 0 255"; + ambientLightBlendPhase = "1"; + ambientLightBlendCurve = "0 0 -1 -1"; + advancedLightmapSupport = "0"; + soundAmbience = "AudioAmbienceDefault"; + soundDistanceModel = "Linear"; + canSave = "1"; + canSaveDynamicFields = "1"; + desc0 = "A blank room template that acts as a starting point."; + enabled = "1"; + levelName = "Blank Room Template"; + }; + new SkyBox(theSky) { + Material = "BlankSkyMat"; + drawBottom = "0"; + fogBandHeight = "0"; + position = "0 0 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + canSave = "1"; + canSaveDynamicFields = "1"; + }; + new Sun(theSun) { + azimuth = "230.396"; + elevation = "45"; + color = "0.968628 0.901961 0.901961 1"; + ambient = "0.337255 0.533333 0.619608 1"; + brightness = "1"; + castShadows = "1"; + staticRefreshFreq = "250"; + dynamicRefreshFreq = "8"; + coronaEnabled = "1"; + coronaScale = "0.5"; + coronaTint = "1 1 1 1"; + coronaUseLightColor = "1"; + flareScale = "1"; + attenuationRatio = "0 1 1"; + shadowType = "PSSM"; + texSize = "1024"; + overDarkFactor = "3000 1500 750 250"; + shadowDistance = "200"; + shadowSoftness = "0.25"; + numSplits = "4"; + logWeight = "0.9"; + fadeStartDistance = "0"; + lastSplitTerrainOnly = "0"; + representedInLightmap = "0"; + shadowDarkenColor = "0 0 0 -1"; + includeLightmappedGeometryInShadow = "0"; + position = "0 0 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + canSave = "1"; + canSaveDynamicFields = "1"; + bias = "0.1"; + Blur = "1"; + enabled = "1"; + height = "1024"; + lightBleedFactor = "0.8"; + minVariance = "0"; + pointShadowType = "PointShadowType_Paraboloid"; + shadowBox = "-100 -100 -100 100 100 100"; + splitFadeDistances = "1 1 1 1"; + width = "3072"; + }; + new GroundPlane() { + squareSize = "128"; + scaleU = "25"; + scaleV = "25"; + Material = "Grid_512_Grey"; + canSave = "1"; + canSaveDynamicFields = "1"; + enabled = "1"; + position = "0 0 0"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + }; +}; +//--- OBJECT WRITE END --- + diff --git a/Templates/BaseGame/game/data/ExampleModule/postFXs/ExamplePostEffect.asset.taml b/Templates/BaseGame/game/data/ExampleModule/postFXs/ExamplePostEffect.asset.taml new file mode 100644 index 000000000..4b2db03a5 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/postFXs/ExamplePostEffect.asset.taml @@ -0,0 +1,6 @@ + diff --git a/Templates/BaseGame/game/data/ExampleModule/postFXs/ExamplePostEffect.cs b/Templates/BaseGame/game/data/ExampleModule/postFXs/ExamplePostEffect.cs new file mode 100644 index 000000000..9afb33843 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/postFXs/ExamplePostEffect.cs @@ -0,0 +1,96 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +singleton ShaderData( ExamplePostEffect_Shader ) +{ + DXVertexShaderFile = $Core::CommonShaderPath @ "/postFX/postFxV.hlsl"; + DXPixelShaderFile = $Core:modulePath @ "ExamplePostEffectP.hlsl"; + OGLVertexShaderFile = $Core::CommonShaderPath @ "/postFX/gl/postFxV.glsl"; + OGLPixelShaderFile = $Core:modulePath @ "ExamplePostEffectP.glsl"; + + samplerNames[0] = "$inputTex"; + + pixVersion = 3.0; +}; + +singleton GFXStateBlockData( ExamplePostEffect_StateBlock ) +{ + samplersDefined = true; + samplerStates[0] = SamplerClampLinear; + samplerStates[1] = SamplerClampLinear; + samplerStates[2] = SamplerClampLinear; + samplerStates[3] = SamplerClampLinear; + + blendDefined = true; + blendDest = GFXBlendOne; + blendSrc = GFXBlendZero; + + zDefined = true; + zEnable = false; + zWriteEnable = false; + + cullDefined = true; + cullMode = GFXCullNone; +}; + + +function ExamplePostEffect::setShaderConsts( %this ) +{ +} + +function ExamplePostEffect::preProcess( %this ) +{ +} + +function ExamplePostEffect::onEnabled( %this ) +{ + return true; +} + +function ExamplePostEffect::onDisabled( %this ) +{ +} + +singleton PostEffect( ExamplePostEffect ) +{ + isEnabled = false; + allowReflectPass = false; + + // Resolve the HDR before we render any editor stuff + // and before we resolve the scene to the backbuffer. + renderTime = "PFXBeforeBin"; + renderBin = "EditorBin"; + renderPriority = 9999; + + // The bright pass generates a bloomed version of + // the scene for pixels which are brighter than a + // fixed threshold value. + // + // This is then used in the final HDR combine pass + // at the end of this post effect chain. + shader = ExamplePostEffect_Shader; + stateBlock = ExamplePostEffect_StateBlock; + texture[0] = "$backBuffer"; + target = "$outTex"; + targetFormat = "GFXFormatR16G16B16A16F"; + targetScale = "1 1"; +}; diff --git a/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.asset.taml b/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.asset.taml new file mode 100644 index 000000000..c45a62fa2 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.asset.taml @@ -0,0 +1,6 @@ + diff --git a/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs b/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs new file mode 100644 index 000000000..6689eb01f --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs @@ -0,0 +1,128 @@ +//----------------------------------------------------------------------------- +// The server has started up so do some game start up +//----------------------------------------------------------------------------- + +//This file implements game mode logic for an Example gamemode. The primary functions: +//ExampleGameMode::onMissionStart +//ExampleGameMode::onMissionReset +//ExampleGameMode::onMissionEnd +//Are the primary hooks for the server to start, restart and end any active gamemodes +//onMissionStart, for example is called from core/clientServer/scripts/server/levelLoad.cs +//It's called once the server has successfully loaded the level, and has parsed +//through any active scenes to get GameModeNames defined by them. It then iterates +//over them and calls these callbacks to envoke gamemode behaviors. This allows multiple +//gamemodes to be in effect at one time. Modules can implement as many gamemodes as you want. +// +//For levels that can be reused for multiple gammodes, the general setup would be a primary level file +//with the Scene in it having the main geometry, weapons, terrain, etc. You would then have subScenes that +//each contain what's necessary for the given gamemode, such as a subScene that just adds the flags and capture +//triggers for a CTF mode. The subscene would then have it's GameModeName defined to run the CTF gamemode logic +//and the levelLoad code will execute it. + +//This function is called when the level finishes loading. It sets up the initial configuration, variables and +//spawning and dynamic objects, timers or rules needed for the gamemode to run +function ExampleGameMode::onMissionStart() +{ + //set up the game and game variables + ExampleGameMode::initGameVars(); + + if ($Game::Running) + { + error("onMissionStart: End the game first!"); + return; + } + + // Start the game timer + if ($Game::Duration) + $Game::Schedule = schedule($Game::Duration * 1000, "onGameDurationEnd"); + + $Game::Running = true; + + $Game = ExampleGameMode; +} + +//This function is called when the level ends. It can be envoked due to the gamemode ending +//but is also kicked off when the game server is shut down as a form of cleanup for anything the gamemode +//created or is managing like the above mentioned dynamic objects or timers +function ExampleGameMode::onMissionEnded() +{ + if (!$Game::Running) + { + error("onMissionEnded: No game running!"); + return; + } + + // Stop any game timers + cancel($Game::Schedule); + + $Game::Running = false; + $Game = ""; +} + +//This function is called in the event the server resets and is used to re-initialize the gamemode +function ExampleGameMode::onMissionReset() +{ + // Called by resetMission(), after all the temporary mission objects + // have been deleted. + ExampleGameMode::initGameVars(); +} + +//This sets up our gamemode's duration time +function ExampleGameMode::initGameVars() +{ + // Set the gameplay parameters + $Game::Duration = 30 * 60; +} + +//This is called when the timer runs out, allowing the gamemode to end +function ExampleGameMode::onGameDurationEnd() +{ + //we don't end if we're currently editing the level + if ($Game::Duration && !(EditorIsActive() && GuiEditorIsActive())) + ExampleGameMode::onMissionEnded(); +} + +//This is called when a client enters the game server. It's used to spawn a player object +//set up any client-specific properties such as saved configs, values, their name, etc +//These callbacks are activated in core/clientServer/scripts/server/levelDownload.cs +function ExampleGameMode::onClientEnterGame(%client) +{ + //Set the player name based on the client's connection data + %client.setPlayerName(%client.connectData); + + //In this example, we just spawn a camera + if (!isObject(%client.camera)) + { + if(!isObject(Observer)) + { + datablock CameraData(Observer) + { + mode = "Observer"; + }; + } + + %client.camera = spawnObject("Camera", Observer); + } + + // If we have a camera then set up some properties + if (isObject(%client.camera)) + { + MissionCleanup.add( %this.camera ); + %client.camera.scopeToClient(%client); + + %client.setControlObject(%client.camera); + + %client.camera.setTransform("0 0 1 0 0 0 0"); + } +} + +//This is called when the player leaves the game server. It's used to clean up anything that +//was spawned or setup for the client when it connected, in onClientEnterGame +//These callbacks are activated in core/clientServer/scripts/server/levelDownload.cs +function ExampleGameMode::onClientLeaveGame(%client) +{ + // Cleanup the camera + if (isObject(%client.camera)) + %client.camera.delete(); + +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ExampleModule/scripts/default.keybinds.cs b/Templates/BaseGame/game/data/ExampleModule/scripts/default.keybinds.cs new file mode 100644 index 000000000..12203204e --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/scripts/default.keybinds.cs @@ -0,0 +1,73 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +if ( isObject( ExampleMoveMap ) ) + ExampleMoveMap.delete(); +new ActionMap(ExampleMoveMap); + +//------------------------------------------------------------------------------ +// Non-remapable binds +//------------------------------------------------------------------------------ +ExampleMoveMap.bind( keyboard, F2, showPlayerList ); + +ExampleMoveMap.bind(keyboard, "ctrl h", hideHUDs); + +ExampleMoveMap.bind(keyboard, "alt p", doScreenShotHudless); + +ExampleMoveMap.bindCmd(keyboard, "escape", "", "disconnect();"); + +//------------------------------------------------------------------------------ +// Movement Keys +//------------------------------------------------------------------------------ +ExampleMoveMap.bind( keyboard, a, moveleft ); +ExampleMoveMap.bind( keyboard, d, moveright ); +ExampleMoveMap.bind( keyboard, left, moveleft ); +ExampleMoveMap.bind( keyboard, right, moveright ); + +ExampleMoveMap.bind( keyboard, w, moveforward ); +ExampleMoveMap.bind( keyboard, s, movebackward ); +ExampleMoveMap.bind( keyboard, up, moveforward ); +ExampleMoveMap.bind( keyboard, down, movebackward ); + +ExampleMoveMap.bind( keyboard, e, moveup ); +ExampleMoveMap.bind( keyboard, c, movedown ); + +ExampleMoveMap.bind( keyboard, space, jump ); +ExampleMoveMap.bind( mouse, xaxis, yaw ); +ExampleMoveMap.bind( mouse, yaxis, pitch ); + +ExampleMoveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw ); +ExampleMoveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch ); +ExampleMoveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX ); +ExampleMoveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY ); + +ExampleMoveMap.bind( gamepad, btn_a, jump ); +ExampleMoveMap.bindCmd( gamepad, btn_back, "disconnect();", "" ); + +//------------------------------------------------------------------------------ +// Misc. +//------------------------------------------------------------------------------ +GlobalActionMap.bind(keyboard, "tilde", toggleConsole); +GlobalActionMap.bindCmd(keyboard, "alt k", "cls();",""); +GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.attemptFullscreenToggle();"); +GlobalActionMap.bindCmd(keyboard, "F1", "", "contextHelp();"); +ExampleMoveMap.bindCmd(keyboard, "n", "toggleNetGraph();", ""); \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ExampleModule/scripts/inputCommands.cs b/Templates/BaseGame/game/data/ExampleModule/scripts/inputCommands.cs new file mode 100644 index 000000000..229e18364 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/scripts/inputCommands.cs @@ -0,0 +1,204 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- +function escapeFromGame() +{ + disconnect(); +} + +$movementSpeed = 1; // m/s + +function setSpeed(%speed) +{ + if(%speed) + $movementSpeed = %speed; +} + +function moveleft(%val) +{ + $mvLeftAction = %val * $movementSpeed; +} + +function moveright(%val) +{ + $mvRightAction = %val * $movementSpeed; +} + +function moveforward(%val) +{ + $mvForwardAction = %val * $movementSpeed; +} + +function movebackward(%val) +{ + $mvBackwardAction = %val * $movementSpeed; +} + +function moveup(%val) +{ + %object = ServerConnection.getControlObject(); + + if(%object.isInNamespaceHierarchy("Camera")) + $mvUpAction = %val * $movementSpeed; +} + +function movedown(%val) +{ + %object = ServerConnection.getControlObject(); + + if(%object.isInNamespaceHierarchy("Camera")) + $mvDownAction = %val * $movementSpeed; +} + +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) * $pref::Input::LinkMouseSensitivity; +} + +function getGamepadAdjustAmount(%val) +{ + // based on a default camera FOV of 90' + return(%val * ($cameraFov / 90) * 0.01) * 10.0; +} + +function yaw(%val) +{ + %yawAdj = getMouseAdjustAmount(%val); + if(ServerConnection.isControlObjectRotDampedCamera()) + { + // Clamp and scale + %yawAdj = mClamp(%yawAdj, -m2Pi()+0.01, m2Pi()-0.01); + %yawAdj *= 0.5; + } + + $mvYaw += %yawAdj; +} + +function pitch(%val) +{ + %pitchAdj = getMouseAdjustAmount(%val); + if(ServerConnection.isControlObjectRotDampedCamera()) + { + // Clamp and scale + %pitchAdj = mClamp(%pitchAdj, -m2Pi()+0.01, m2Pi()-0.01); + %pitchAdj *= 0.5; + } + + $mvPitch += %pitchAdj; +} + +function jump(%val) +{ + $mvTriggerCount2++; +} + +function gamePadMoveX( %val ) +{ + if(%val > 0) + { + $mvRightAction = %val * $movementSpeed; + $mvLeftAction = 0; + } + else + { + $mvRightAction = 0; + $mvLeftAction = -%val * $movementSpeed; + } +} + +function gamePadMoveY( %val ) +{ + if(%val > 0) + { + $mvForwardAction = %val * $movementSpeed; + $mvBackwardAction = 0; + } + else + { + $mvForwardAction = 0; + $mvBackwardAction = -%val * $movementSpeed; + } +} + +function gamepadYaw(%val) +{ + %yawAdj = getGamepadAdjustAmount(%val); + if(ServerConnection.isControlObjectRotDampedCamera()) + { + // Clamp and scale + %yawAdj = mClamp(%yawAdj, -m2Pi()+0.01, m2Pi()-0.01); + %yawAdj *= 0.5; + } + + if(%yawAdj > 0) + { + $mvYawLeftSpeed = %yawAdj; + $mvYawRightSpeed = 0; + } + else + { + $mvYawLeftSpeed = 0; + $mvYawRightSpeed = -%yawAdj; + } +} + +function gamepadPitch(%val) +{ + %pitchAdj = getGamepadAdjustAmount(%val); + if(ServerConnection.isControlObjectRotDampedCamera()) + { + // Clamp and scale + %pitchAdj = mClamp(%pitchAdj, -m2Pi()+0.01, m2Pi()-0.01); + %pitchAdj *= 0.5; + } + + if(%pitchAdj > 0) + { + $mvPitchDownSpeed = %pitchAdj; + $mvPitchUpSpeed = 0; + } + else + { + $mvPitchDownSpeed = 0; + $mvPitchUpSpeed = -%pitchAdj; + } +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ExampleModule/source/ExampleCppObject.asset.taml b/Templates/BaseGame/game/data/ExampleModule/source/ExampleCppObject.asset.taml new file mode 100644 index 000000000..d80aab2e9 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/source/ExampleCppObject.asset.taml @@ -0,0 +1,7 @@ + diff --git a/Templates/BaseGame/game/data/ExampleModule/source/ExampleCppObject.cpp b/Templates/BaseGame/game/data/ExampleModule/source/ExampleCppObject.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/Templates/BaseGame/game/data/ExampleModule/source/ExampleCppObject.h b/Templates/BaseGame/game/data/ExampleModule/source/ExampleCppObject.h new file mode 100644 index 000000000..e69de29bb diff --git a/Templates/BaseGame/game/data/ExampleModule/source/ExampleModule.cpp b/Templates/BaseGame/game/data/ExampleModule/source/ExampleModule.cpp new file mode 100644 index 000000000..8e76b3ba5 --- /dev/null +++ b/Templates/BaseGame/game/data/ExampleModule/source/ExampleModule.cpp @@ -0,0 +1,18 @@ +#include "core/module.h" +#include "console/engineAPI.h" + +MODULE_BEGIN(ExampleModule_Module) + +MODULE_INIT_AFTER(Sim) +MODULE_SHUTDOWN_BEFORE(Sim) + +MODULE_INIT +{ + // Setup anything needed when the engine initializes here +} +MODULE_SHUTDOWN +{ + // Cleanup anything that was initialized before here +} +MODULE_END; + diff --git a/Templates/BaseGame/game/data/gameUI/GUIs/playGui.cs b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.cs new file mode 100644 index 000000000..59a7cf49c --- /dev/null +++ b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.cs @@ -0,0 +1,122 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// 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... + // sfxStop( ... ); + + $enableDirectInput = "1"; + activateDirectInput(); + + // Message hud dialog + if ( isObject( MainChatHud ) ) + { + Canvas.pushDialog( MainChatHud ); + chatHud.attach(HudMessageVector); + } + + // just update the action map here + if(isObject(moveMap)) + moveMap.push(); + + // hack city - these controls are floating around and need to be clamped + if ( isFunction( "refreshCenterTextCtrl" ) ) + schedule(0, 0, "refreshCenterTextCtrl"); + if ( isFunction( "refreshBottomTextCtrl" ) ) + schedule(0, 0, "refreshBottomTextCtrl"); +} + +function PlayGui::onSleep(%this) +{ + if ( isObject( MainChatHud ) ) + Canvas.popDialog( MainChatHud ); + + // pop the keymaps + if(isObject(moveMap)) + moveMap.pop(); +} + +function PlayGui::clearHud( %this ) +{ + Canvas.popDialog( MainChatHud ); + + while ( %this.getCount() > 0 ) + %this.getObject( 0 ).delete(); +} + +//----------------------------------------------------------------------------- + +function refreshBottomTextCtrl() +{ + BottomPrintText.position = "0 0"; +} + +function refreshCenterTextCtrl() +{ + CenterPrintText.position = "0 0"; +} + +/*function PlayGui::onRightMouseDown(%this) +{ + %this.nocursor = true; + Canvas.checkCursor(); +} + +function PlayGui::onRightMouseUp(%this) +{ + %this.nocursor = false; + Canvas.checkCursor(); +}*/ + +/*function PlayGui::onInputEvent(%this, %device, %action, %state) +{ + if(%device $= "mouse0" && %action $= "button1") + { + if(%state == 1) + { + %this.nocursor = true; + Canvas.checkCursor(); + } + else + { + %this.nocursor = false; + Canvas.checkCursor(); + } + } + else if(%device $= "keyboard") + { + if(%action $= "w") + moveforward(%state); + else if(%action $= "a") + moveleft(%state); + else if(%action $= "s") + movebackward(%state); + else if(%action $= "d") + moveright(%state); + } +}*/ \ No newline at end of file diff --git a/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui new file mode 100644 index 000000000..e9522b42f --- /dev/null +++ b/Templates/BaseGame/game/data/gameUI/GUIs/playGui.gui @@ -0,0 +1,50 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GameTSCtrl(PlayGui) { + cameraZRot = "0"; + forceFOV = "0"; + reflectPriority = "1"; + renderStyle = "standard"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 0"; + extent = "1920 1080"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + enabled = "1"; + helpTag = "0"; + noCursor = "1"; + + new GuiBitmapCtrl(LagIcon) { + bitmap = "data/ui/art/lagIcon.png"; + color = "255 255 255 255"; + wrap = "0"; + position = "572 3"; + extent = "32 32"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/gameUI/gameUI.cs b/Templates/BaseGame/game/data/gameUI/gameUI.cs new file mode 100644 index 000000000..e52cb6890 --- /dev/null +++ b/Templates/BaseGame/game/data/gameUI/gameUI.cs @@ -0,0 +1,14 @@ +function gameUI::create( %this ) +{ + if (!$Server::Dedicated) + { + //guis + exec("./GUIs/playGui.gui"); + exec("./GUIs/playGui.cs"); + } +} + +function gameUI::destroy( %this ) +{ + +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/gameUI/gameUI.module b/Templates/BaseGame/game/data/gameUI/gameUI.module new file mode 100644 index 000000000..02952d63c --- /dev/null +++ b/Templates/BaseGame/game/data/gameUI/gameUI.module @@ -0,0 +1,15 @@ + + + \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/UI.cs b/Templates/BaseGame/game/data/ui/UI.cs index cdba56091..38de0958e 100644 --- a/Templates/BaseGame/game/data/ui/UI.cs +++ b/Templates/BaseGame/game/data/ui/UI.cs @@ -19,56 +19,76 @@ function UI::create( %this ) // Use our prefs to configure our Canvas/Window configureCanvas(); - +} + +function UI::destroy( %this ) +{ +} + +function UI::initServer(%this){} + +function UI::onCreateServer(%this){} + +function UI::onDestroyServer(%this){} + +function UI::initClient(%this) +{ //Load UI stuff //we need to load this because some of the menu profiles use the sounds here - exec("./scripts/datablocks/guiSounds.cs"); + exec("./datablocks/guiSounds.cs"); //Profiles exec("./scripts/profiles.cs"); //Now gui files - exec("./scripts/guis/mainMenu.gui"); - exec("./scripts/guis/chooseLevelDlg.gui"); - exec("./scripts/guis/joinServerMenu.gui"); - exec("./scripts/guis/loadingGui.gui"); - exec("./scripts/guis/optionsMenu.gui"); - exec("./scripts/guis/pauseMenu.gui"); - exec("./scripts/guis/remapDlg.gui"); - exec("./scripts/guis/remapConfirmDlg.gui"); + exec("./guis/mainMenu.gui"); + exec("./guis/mainMenu.cs"); - exec("./scripts/guis/profiler.gui"); - exec("./scripts/guis/netGraphGui.gui"); - exec("./scripts/guis/RecordingsDlg.gui"); - exec("./scripts/guis/FileDialog.gui"); - exec("./scripts/guis/guiMusicPlayer.gui"); - exec("./scripts/guis/startupGui.gui"); + exec("./guis/chooseLevelDlg.gui"); + exec("./guis/chooseLevelDlg.cs"); - //Load gui companion scripts - exec("./scripts/chooseLevelDlg.cs"); + exec("./guis/joinServerMenu.gui"); + exec("./guis/joinServerMenu.cs"); + + exec("./guis/loadingGui.gui"); + + exec("./guis/optionsMenu.gui"); + exec("./guis/optionsMenu.cs"); + + exec("./guis/pauseMenu.gui"); + exec("./guis/pauseMenu.cs"); + + exec("./guis/remapDlg.gui"); + exec("./guis/remapConfirmDlg.gui"); + + exec("./guis/profiler.gui"); + exec("./guis/profiler.cs"); + + exec("./guis/netGraphGui.gui"); + exec("./guis/RecordingsDlg.gui"); + + //exec("./guis/FileDialog.gui"); + //exec("./guis/FileDialog.cs"); + + exec("./guis/guiMusicPlayer.gui"); + exec("./guis/guiMusicPlayer.cs"); + + exec("./guis/startupGui.gui"); + exec("./guis/startupGui.cs"); + + //Load scripts exec("./scripts/optionsList.cs"); - exec("./scripts/optionsMenu.cs"); exec("./scripts/graphicsMenu.cs"); exec("./scripts/controlsMenu.cs"); - exec("./scripts/chooseLevelDlg.cs"); - exec("./scripts/mainMenu.cs"); - exec("./scripts/joinServerMenu.cs"); - exec("./scripts/pauseMenu.cs"); exec("./scripts/messageBoxes.cs"); exec("./scripts/help.cs"); exec("./scripts/cursors.cs"); - exec("./scripts/profiler.cs"); - exec("./scripts/FileDialog.cs"); - exec("./scripts/GuiTreeViewCtrl.cs"); - exec("./scripts/guiMusicPlayer.cs"); - exec("./scripts/startupGui.cs"); - %dbList = new ArrayObject(LevelFilesList); + //exec("./scripts/GuiTreeViewCtrl.cs"); loadStartup(); } -function Game::destroy( %this ) -{ - -} \ No newline at end of file +function UI::onCreateClientConnection(%this){} + +function UI::onDestroyClientConnection(%this){} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/datablocks/guiSounds.cs b/Templates/BaseGame/game/data/ui/datablocks/guiSounds.cs new file mode 100644 index 000000000..0aab47fb9 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/datablocks/guiSounds.cs @@ -0,0 +1,34 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- +singleton SFXProfile(menuButtonPressed) +{ + preload = true; + description = AudioGui; + fileName = "data/ui/sounds/buttonClick"; +}; + +singleton SFXProfile(menuButtonHover) +{ + preload = true; + description = AudioGui; + fileName = "data/ui/sounds/buttonHover"; +}; \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/guis/FileDialog.gui b/Templates/BaseGame/game/data/ui/guis/FileDialog.gui new file mode 100644 index 000000000..e855636f0 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/FileDialog.gui @@ -0,0 +1,293 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(PlatformFileDialog) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + + new GuiWindowCtrl() { + text = ""; + resizeWidth = "1"; + resizeHeight = "1"; + canMove = "1"; + canClose = "1"; + canMinimize = "1"; + canMaximize = "1"; + canCollapse = "0"; + closeCommand = "PlatformFileDialog.cancel();"; + edgeSnap = "1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "135 113"; + extent = "727 623"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiWindowProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "window"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiControl() { + position = "2 16"; + extent = "717 37"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapButtonCtrl() { + bitmap = "tools/gui/images/folderUp"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + groupNum = "0"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "9 9"; + extent = "20 19"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "ToolsGuiButtonProfile"; + visible = "1"; + active = "1"; + command = "PlatformFileDialog.navigateUp();"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "folderUpButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "36 9"; + extent = "666 18"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "ToolsGuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "PopupMenu"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiScrollCtrl() { + willFirstRespond = "1"; + hScrollBar = "dynamic"; + vScrollBar = "alwaysOff"; + lockHorizScroll = "0"; + lockVertScroll = "1"; + constantThumbHeight = "0"; + childMargin = "0 0"; + mouseWheelScrollSpeed = "-1"; + docking = "None"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "1"; + anchorLeft = "1"; + anchorRight = "0"; + position = "7 64"; + extent = "712 509"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiScrollProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiDynamicCtrlArrayControl() { + colCount = "1"; + colSize = "64"; + rowCount = "1"; + rowSize = "258"; + rowSpacing = "4"; + colSpacing = "4"; + frozen = "0"; + autoCellSize = "1"; + fillRowFirst = "0"; + dynamicSize = "1"; + padding = "0 0 0 0"; + position = "1 1"; + extent = "666 507"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "ToolsGuiTransparentProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "ToolsGuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "itemArray"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiContainer() { + docking = "Bottom"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "1"; + anchorLeft = "1"; + anchorRight = "1"; + position = "1 583"; + extent = "725 37"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { + text = "File Name"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "10 -1"; + extent = "51 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "58 5"; + extent = "561 18"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "fileNameEdit"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiContainer() { + docking = "Right"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "0"; + anchorBottom = "0"; + anchorLeft = "0"; + anchorRight = "0"; + position = "630 0"; + extent = "95 37"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiButtonCtrl() { + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "6 1"; + extent = "81 24"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "Button"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/IODropdownDlg.ed.gui b/Templates/BaseGame/game/data/ui/guis/IODropdownDlg.ed.gui new file mode 100644 index 000000000..5fa0093da --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/IODropdownDlg.ed.gui @@ -0,0 +1,159 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(IODropdownDlg) { + profile = "GuiDefaultProfile"; + horizSizing = "width"; + vertSizing = "height"; + position = "0 0"; + extent = "640 480"; + minExtent = "8 8"; + visible = "1"; + helpTag = "0"; + new GuiWindowCtrl(IODropdownFrame) { + canSaveDynamicFields = "0"; + Profile = "GuiWindowProfile"; + horizSizing = "center"; + vertSizing = "center"; + position = "272 77"; + extent = "256 117"; + minExtent = "256 8"; + canSave = "1"; + Visible = "1"; + hovertime = "1000"; + maxLength = "255"; + resizeWidth = "1"; + resizeHeight = "1"; + canMove = "1"; + canClose = "1"; + canMinimize = "0"; + canMaximize = "0"; + minSize = "50 50"; + text = ""; + closeCommand="IOCallback(IODropdownDlg,IODropdownDlg.cancelCallback);"; + + new GuiMLTextCtrl(IODropdownText) { + text = ""; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + isContainer = "0"; + profile = "GuiMLTextProfile"; + horizSizing = "center"; + vertSizing = "bottom"; + position = "9 26"; + extent = "237 16"; + minExtent = "8 8"; + canSave = "1"; + visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapBorderCtrl() { + isContainer = "0"; + profile = "GuiGroupBorderProfile"; + horizSizing = "width"; + vertSizing = "bottom"; + position = "7 51"; + extent = "243 28"; + minExtent = "0 0"; + canSave = "1"; + visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl(IOInputText) { + text = "Decal Datablock"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + isContainer = "0"; + profile = "GuiTextRightProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "5 5"; + extent = "105 18"; + minExtent = "8 2"; + canSave = "1"; + visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl(IODropdownMenu) { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + isContainer = "0"; + profile = "GuiPopUpMenuProfile"; + horizSizing = "width"; + vertSizing = "bottom"; + position = "115 5"; + extent = "122 18"; + minExtent = "8 2"; + canSave = "1"; + visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + }; + new GuiButtonCtrl() { + text = "OK"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + isContainer = "0"; + profile = "GuiButtonProfile"; + horizSizing = "width"; + vertSizing = "top"; + position = "7 85"; + extent = "156 24"; + minExtent = "8 8"; + canSave = "1"; + visible = "1"; + accelerator = "return"; + command = "IOCallback(IODropdownDlg,IODropdownDlg.callback);"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Cancel"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + isContainer = "0"; + profile = "GuiButtonProfile"; + horizSizing = "left"; + vertSizing = "top"; + position = "170 85"; + extent = "80 24"; + minExtent = "8 8"; + canSave = "1"; + visible = "1"; + accelerator = "escape"; + command = "IOCallback(IODropdownDlg,IODropdownDlg.cancelCallback);"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/RecordingsDlg.gui b/Templates/BaseGame/game/data/ui/guis/RecordingsDlg.gui new file mode 100644 index 000000000..0e863fff5 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/RecordingsDlg.gui @@ -0,0 +1,230 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(recordingsDlg) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + helpTag = "0"; + + new GuiWindowCtrl() { + text = "Demo Recordings"; + resizeWidth = "0"; + resizeHeight = "0"; + canMove = "1"; + canClose = "1"; + canMinimize = "0"; + canMaximize = "0"; + canCollapse = "0"; + closeCommand = "Canvas.popDialog(recordingsDlg);"; + edgeSnap = "1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "247 215"; + extent = "530 338"; + minExtent = "48 92"; + horizSizing = "center"; + vertSizing = "center"; + profile = "GuiWindowProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiScrollCtrl() { + willFirstRespond = "1"; + hScrollBar = "dynamic"; + vScrollBar = "alwaysOn"; + lockHorizScroll = "0"; + lockVertScroll = "0"; + constantThumbHeight = "0"; + childMargin = "0 0"; + mouseWheelScrollSpeed = "-1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "23 60"; + extent = "484 237"; + minExtent = "32 32"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiScrollProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextListCtrl(RecordingsDlgList) { + columns = "0"; + fitParentWidth = "1"; + clipColumnText = "0"; + position = "1 1"; + extent = "469 32"; + minExtent = "8 20"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextArrayProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiButtonCtrl(DR_CancelBtn) { + text = "Cancel"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "396 306"; + extent = "110 20"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "top"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog(recordingsDlg);"; + accelerator = "escape"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(DR_StartDemoBtn) { + text = "Play"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "25 305"; + extent = "110 20"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "top"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + command = "StartSelectedDemo();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "During gameplay press the following keys:"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "23 30"; + extent = "206 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Start = F3"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "253 32"; + extent = "50 15"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Stop = F4"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "320 32"; + extent = "49 13"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(DR_DelDemoBtn) { + text = "Delete"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "210 305"; + extent = "110 20"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + command = "deleteDemoRecord();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- + diff --git a/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.cs b/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.cs new file mode 100644 index 000000000..ef34e329d --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.cs @@ -0,0 +1,374 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +//---------------------------------------- +function ChooseLevelDlg::onWake( %this ) +{ + CL_levelList.clear(); + ChooseLevelWindow->SmallPreviews.clear(); + + %this->CurrentPreview.visible = false; + %this->levelName.visible = false; + %this->LevelDescriptionLabel.visible = false; + %this->LevelDescription.visible = false; + + %assetQuery = new AssetQuery(); + AssetDatabase.findAssetType(%assetQuery, "LevelAsset"); + + %count = %assetQuery.getCount(); + + if(%count == 0 && !IsDirectory("tools")) + { + //We have no levels found. Prompt the user to open the editor to the default level if the tools are present + MessageBoxOK("Error", "No levels were found in any modules. Please ensure you have modules loaded that contain gameplay code and level files.", + "Canvas.popDialog(ChooseLevelDlg); if(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();"); + + %assetQuery.delete(); + return; + } + + for(%i=0; %i < %count; %i++) + { + %assetId = %assetQuery.getAsset(%i); + + %levelAsset = AssetDatabase.acquireAsset(%assetId); + + %file = %levelAsset.LevelFile; + + if ( !isFile(%file @ ".mis") && !isFile(%file) ) + continue; + + // Skip our new level/mission if we arent choosing a level + // to launch in the editor. + if ( !%this.launchInEditor ) + { + %fileName = fileName(%file); + if (strstr(%fileName, "newMission.mis") > -1 || strstr(%fileName, "newLevel.mis") > -1) + continue; + } + + %this.addLevelAsset( %levelAsset ); + } + + // Also add the new level mission as defined in the world editor settings + // if we are choosing a level to launch in the editor. + if ( %this.launchInEditor ) + { + %file = EditorSettings.value( "WorldEditor/newLevelFile" ); + if ( %file !$= "" ) + %this.addMissionFile( %file ); + } + + // Sort our list + CL_levelList.sort(0); + + // Set the first row as the selected row + CL_levelList.setSelectedRow(0); + + for (%i = 0; %i < CL_levelList.rowCount(); %i++) + { + %preview = new GuiButtonCtrl() { + profile = "GuiMenuButtonProfile"; + internalName = "SmallPreview" @ %i; + Extent = "368 35"; + text = getField(CL_levelList.getRowText(%i), 0); + command = "ChooseLevelWindow.previewSelected(ChooseLevelWindow->SmallPreviews->SmallPreview" @ %i @ ");"; + buttonType = "RadioButton"; + }; + + ChooseLevelWindow->SmallPreviews.add(%preview); + + %rowText = CL_levelList.getRowText(%i); + + // Set the level index + %preview.levelIndex = %i; + + // Get the name + %name = getField(CL_levelList.getRowText(%i), 0); + + %preview.levelName = %name; + + %file = getField(CL_levelList.getRowText(%i), 1); + + // Find the preview image + %levelPreview = getField(CL_levelList.getRowText(%i), 3); + + // Test against all of the different image formats + // This should probably be moved into an engine function + if (isFile(%levelPreview @ ".png") || + isFile(%levelPreview @ ".jpg") || + isFile(%levelPreview @ ".bmp") || + isFile(%levelPreview @ ".gif") || + isFile(%levelPreview @ ".jng") || + isFile(%levelPreview @ ".mng") || + isFile(%levelPreview @ ".tga")) + { + %preview.bitmap = %levelPreview; + } + + // Get the description + %desc = getField(CL_levelList.getRowText(%i), 2); + + %preview.levelDesc = %desc; + } + + ChooseLevelWindow->SmallPreviews.firstVisible = -1; + ChooseLevelWindow->SmallPreviews.lastVisible = -1; + + if (ChooseLevelWindow->SmallPreviews.getCount() > 0) + { + ChooseLevelWindow->SmallPreviews.firstVisible = 0; + + if (ChooseLevelWindow->SmallPreviews.getCount() < 6) + ChooseLevelWindow->SmallPreviews.lastVisible = ChooseLevelWindow->SmallPreviews.getCount() - 1; + else + ChooseLevelWindow->SmallPreviews.lastVisible = 4; + } + + if (ChooseLevelWindow->SmallPreviews.getCount() > 0) + ChooseLevelWindow.previewSelected(ChooseLevelWindow->SmallPreviews.getObject(0)); + + // If we have 5 or less previews then hide our next/previous buttons + // and resize to fill their positions + if (ChooseLevelWindow->SmallPreviews.getCount() < 6) + { + ChooseLevelWindow->PreviousSmallPreviews.setVisible(false); + ChooseLevelWindow->NextSmallPreviews.setVisible(false); + + %previewPos = ChooseLevelWindow->SmallPreviews.getPosition(); + %previousPos = ChooseLevelWindow->PreviousSmallPreviews.getPosition(); + + %previewPosX = getWord(%previousPos, 0); + %previewPosY = getWord(%previewPos, 1); + + ChooseLevelWindow->SmallPreviews.setPosition(%previewPosX, %previewPosY); + + ChooseLevelWindow->SmallPreviews.colSpacing = 10;//((getWord(NextSmallPreviews.getPosition(), 0)+11)-getWord(PreviousSmallPreviews.getPosition(), 0))/4; + ChooseLevelWindow->SmallPreviews.refresh(); + } + + /*if (ChooseLevelWindow->SmallPreviews.getCount() <= 1) + { + // Hide the small previews + ChooseLevelWindow->SmallPreviews.setVisible(false); + + // Shrink the ChooseLevelWindow so that we don't have a large blank space + %extentX = getWord(ChooseLevelWindow.getExtent(), 0); + %extentY = getWord(ChooseLevelWindow->SmallPreviews.getPosition(), 1); + + ChooseLevelWIndow.setExtent(%extentX, %extentY); + } + else + { + // Make sure the small previews are visible + ChooseLevelWindow->SmallPreviews.setVisible(true); + + %extentX = getWord(ChooseLevelWindow.getExtent(), 0); + + %extentY = getWord(ChooseLevelWindow->SmallPreviews.getPosition(), 1); + %extentY = %extentY + getWord(ChooseLevelWindow->SmallPreviews.getExtent(), 1); + %extentY = %extentY + 9; + + //ChooseLevelWIndow.setExtent(%extentX, %extentY); + //}*/ +} + +function ChooseLevelDlg::addMissionFile( %this, %file ) +{ + %levelName = fileBase(%file); + %levelDesc = "A Torque level"; + + %LevelInfoObject = getLevelInfo(%file); + + if (%LevelInfoObject != 0) + { + if(%LevelInfoObject.levelName !$= "") + %levelName = %LevelInfoObject.levelName; + else if(%LevelInfoObject.name !$= "") + %levelName = %LevelInfoObject.name; + + if (%LevelInfoObject.desc0 !$= "") + %levelDesc = %LevelInfoObject.desc0; + + if (%LevelInfoObject.preview !$= "") + %levelPreview = %LevelInfoObject.preview; + + %LevelInfoObject.delete(); + } + + CL_levelList.addRow( CL_levelList.rowCount(), %levelName TAB %file TAB %levelDesc TAB %levelPreview ); +} + +function ChooseLevelDlg::addLevelAsset( %this, %levelAsset ) +{ + %file = %levelAsset.LevelFile; + + /*%levelName = fileBase(%file); + %levelDesc = "A Torque level"; + + %LevelInfoObject = getLevelInfo(%file); + + if (%LevelInfoObject != 0) + { + if(%LevelInfoObject.levelName !$= "") + %levelName = %LevelInfoObject.levelName; + else if(%LevelInfoObject.name !$= "") + %levelName = %LevelInfoObject.name; + + if (%LevelInfoObject.desc0 !$= "") + %levelDesc = %LevelInfoObject.desc0; + + if (%LevelInfoObject.preview !$= "") + %levelPreview = %LevelInfoObject.preview; + + %LevelInfoObject.delete(); + }*/ + + %levelName = %levelAsset.LevelName; + %levelDesc = %levelAsset.description; + %levelPreview = %levelAsset.levelPreviewImage; + + CL_levelList.addRow( CL_levelList.rowCount(), %levelName TAB %file TAB %levelDesc TAB %levelPreview ); +} + +function ChooseLevelDlg::onSleep( %this ) +{ + // This is set from the outside, only stays true for a single wake/sleep + // cycle. + %this.launchInEditor = false; +} + +function ChooseLevelWindow::previewSelected(%this, %preview) +{ + // Set the selected level + if (isObject(%preview) && %preview.levelIndex !$= "") + CL_levelList.setSelectedRow(%preview.levelIndex); + else + CL_levelList.setSelectedRow(-1); + + // Set the large preview image + if (isObject(%preview) && %preview.bitmap !$= "") + { + %this->CurrentPreview.visible = true; + %this->CurrentPreview.setBitmap(%preview.bitmap); + } + else + { + %this->CurrentPreview.visible = false; + } + + // Set the current level name + if (isObject(%preview) && %preview.levelName !$= "") + { + %this->LevelName.visible = true; + %this->LevelName.setText(%preview.levelName); + } + else + { + %this->LevelName.visible = false; + } + + // Set the current level description + if (isObject(%preview) && %preview.levelDesc !$= "") + { + %this->LevelDescription.visible = true; + %this->LevelDescriptionLabel.visible = true; + %this->LevelDescription.setText(%preview.levelDesc); + } + else + { + %this->LevelDescription.visible = false; + %this->LevelDescriptionLabel.visible = false; + } +} + +function ChooseLevelWindow::previousPreviews(%this) +{ + %prevHiddenIdx = %this->SmallPreviews.firstVisible - 1; + + if (%prevHiddenIdx < 0) + return; + + %lastVisibleIdx = %this->SmallPreviews.lastVisible; + + if (%lastVisibleIdx >= %this->SmallPreviews.getCount()) + return; + + %prevHiddenObj = %this->SmallPreviews.getObject(%prevHiddenIdx); + %lastVisibleObj = %this->SmallPreviews.getObject(%lastVisibleIdx); + + if (isObject(%prevHiddenObj) && isObject(%lastVisibleObj)) + { + %this->SmallPreviews.firstVisible--; + %this->SmallPreviews.lastVisible--; + + %prevHiddenObj.setVisible(true); + %lastVisibleObj.setVisible(false); + } +} + +function ChooseLevelWindow::nextPreviews(%this) +{ + %firstVisibleIdx = %this->SmallPreviews.firstVisible; + + if (%firstVisibleIdx < 0) + return; + + %firstHiddenIdx = %this->SmallPreviews.lastVisible + 1; + + if (%firstHiddenIdx >= %this->SmallPreviews.getCount()) + return; + + %firstVisibleObj = %this->SmallPreviews.getObject(%firstVisibleIdx); + %firstHiddenObj = %this->SmallPreviews.getObject(%firstHiddenIdx); + + if (isObject(%firstVisibleObj) && isObject(%firstHiddenObj)) + { + %this->SmallPreviews.firstVisible++; + %this->SmallPreviews.lastVisible++; + + %firstVisibleObj.setVisible(false); + %firstHiddenObj.setVisible(true); + } +} + +// Do this onMouseUp not via Command which occurs onMouseDown so we do +// not have a lingering mouseUp event lingering in the ether. +function ChooseLevelDlgGoBtn::onMouseUp( %this ) +{ + // So we can't fire the button when loading is in progress. + if ( isObject( ServerGroup ) ) + return; + + // Launch the chosen level with the editor open? + if ( ChooseLevelDlg.launchInEditor ) + { + activatePackage( "BootEditor" ); + ChooseLevelDlg.launchInEditor = false; + StartGame("", "SinglePlayer"); + } + else + { + StartGame(); + } +} + diff --git a/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.gui b/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.gui new file mode 100644 index 000000000..ab125b36c --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/chooseLevelDlg.gui @@ -0,0 +1,272 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(ChooseLevelDlg) { + position = "0 0"; + extent = "1280 1024"; + minExtent = "8 8"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + enabled = "1"; + launchInEditor = "0"; + returnGui = "MainMenuGui"; + + new GuiControl(ChooseLevelWindow) { + position = "80 36"; + extent = "770 616"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "data/ui/images/no-preview"; + color = "255 255 255 255"; + wrap = "0"; + position = "369 31"; + extent = "400 300"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "CurrentPreview"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + enabled = "1"; + }; + new GuiTextCtrl() { + text = "Empty Room"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "370 335"; + extent = "90 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "levelName"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Description:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "370 354"; + extent = "91 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "LevelDescriptionLabel"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiMLTextCtrl() { + lineSpacing = "2"; + allowColorChars = "0"; + maxChars = "-1"; + useURLMouseCursor = "0"; + position = "370 380"; + extent = "165 14"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMLWhiteTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "LevelDescription"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "data/ui/images/previous-button"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "2 -1"; + extent = "368 33"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "0"; + active = "1"; + command = "ChooseLevelWindow.previousPreviews();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "PreviousSmallPreviews"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + enabled = "1"; + wrap = "0"; + }; + new GuiBitmapButtonCtrl() { + bitmap = "data/ui/images/next-button"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "-3 549"; + extent = "374 33"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "0"; + active = "1"; + command = "ChooseLevelWindow.nextPreviews();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "NextSmallPreviews"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + enabled = "1"; + wrap = "0"; + }; + new GuiTextListCtrl(CL_levelList) { + columns = "0"; + fitParentWidth = "1"; + clipColumnText = "0"; + position = "-7 1"; + extent = "80 30"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextArrayProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiDynamicCtrlArrayControl() { + colCount = "1"; + colSize = "368"; + rowCount = "14"; + rowSize = "35"; + rowSpacing = "0"; + colSpacing = "10"; + frozen = "0"; + autoCellSize = "1"; + fillRowFirst = "0"; + dynamicSize = "0"; + padding = "0 0 0 0"; + position = "2 33"; + extent = "368 516"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "SmallPreviews"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(ChooseLevelDlgGoBtn) { + text = "Start Level"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "371 583"; + extent = "399 33"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(ChooseLevelDlgBackBtn) { + text = "Return to Menu"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "0 583"; + extent = "371 33"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog(ChooseLevelDlg);\n\nif(isObject(ChooseLevelDlg.returnGui) && ChooseLevelDlg.returnGui.isMethod(\"onReturnTo\")) ChooseLevelDlg.returnGui.onReturnTo();"; + accelerator = "escape"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/controlsMenuSetting.taml b/Templates/BaseGame/game/data/ui/guis/controlsMenuSetting.taml new file mode 100644 index 000000000..e2794ca4a --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/controlsMenuSetting.taml @@ -0,0 +1,102 @@ + + + + + + + diff --git a/Templates/BaseGame/game/data/ui/guis/graphicsMenuSettingsCtrl.taml b/Templates/BaseGame/game/data/ui/guis/graphicsMenuSettingsCtrl.taml new file mode 100644 index 000000000..7472ae9d5 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/graphicsMenuSettingsCtrl.taml @@ -0,0 +1,123 @@ + + + + + + + diff --git a/Templates/BaseGame/game/data/ui/guis/graphicsMenuSettingsSlider.taml b/Templates/BaseGame/game/data/ui/guis/graphicsMenuSettingsSlider.taml new file mode 100644 index 000000000..56ba7d027 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/graphicsMenuSettingsSlider.taml @@ -0,0 +1,142 @@ + + + + + + + + + diff --git a/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.cs b/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.cs new file mode 100644 index 000000000..6af2c48ea --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.cs @@ -0,0 +1,244 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +// A very simple music player. + +//--------------------------------------------------------------------------------------------- +// Prerequisites. + +if( !isObject( GuiMusicPlayer ) ) + exec( "./guiMusicPlayer.gui" ); + +//--------------------------------------------------------------------------------------------- +// Preferences. + +$pref::GuiMusicPlayer::filePattern = "*.ogg\t*.wav"; +$pref::GuiMusicPlayer::filePatternFMOD = "*.aiff\t*.asf\t*.flac\t*.it\t*.mid\t*.mod\t*.mp2\t*.mp3\t*.ogg\t*.s3m\t*.vag\t*.wav\t*.wma\t*.xm"; +$pref::GuiMusicPlayer::fadeTime = "3.0"; + +//--------------------------------------------------------------------------------------------- +// Datablocks. + +singleton SFXDescription( GuiMusicPlayerStream : AudioMusic2D ) +{ + volume = 1.0; + isLooping = false; + isStreaming = true; + is3D = false; +}; +singleton SFXDescription( GuiMusicPlayerLoopingStream : AudioMusic2D ) +{ + volume = 1.0; + isLooping = true; + isStreaming = true; + is3D = false; +}; + +//--------------------------------------------------------------------------------------------- +// Functions. + +function toggleMusicPlayer() +{ + if( !GuiMusicPlayer.isAwake() ) + { + GuiMusicPlayer.setExtent( Canvas.getExtent() ); + GuiMusicPlayer.setPosition( 0, 0 ); + + Canvas.pushDialog( GuiMusicPlayer ); + } + else + Canvas.popDialog( GuiMusicPlayer ); +} + +//--------------------------------------------------------------------------------------------- +// Methods. + +function GuiMusicPlayer_onSFXSourceStatusChange( %id, %status ) +{ + if( %status $= "Stopped" ) + GuiMusicPlayer.onStop(); +} + +function GuiMusicPlayerClass::play( %this ) +{ + if( %this.status $= "Stopped" + || %this.status $= "Paused" + || %this.status $= "" ) + { + %isPlaying = true; + if( %this.status $= "Paused" && isObject( %this.sfxSource ) ) + %this.sfxSource.play(); + else + { + %sel = GuiMusicPlayerMusicList.getSelectedItem(); + if( %sel == -1 ) + %isPlaying = false; + else + { + %desc = GuiMusicPlayerStream; + if( GuiMusicPlayerLoopCheckBox.getValue() ) + %desc = GuiMusicPlayerLoopingStream; + + if( GuiMusicPlayerFadeCheckBox.getValue() ) + { + %desc.fadeInTime = $pref::GuiMusicPlayer::fadeTime; + %desc.fadeOutTime = $pref::GuiMusicPlayer::fadeTime; + } + else + { + %desc.fadeInTime = 0; + %desc.fadeOutTime = 0; + } + + %file = GuiMusicPlayerMusicList.getItemText( %sel ); + %this.sfxSource = sfxPlayOnce( %desc, %file ); + if( !%this.sfxSource ) + %isPlaying = false; + else + { + %this.sfxSource.statusCallback = "GuiMusicPlayer_onSFXSourceStatusChange"; + GuiMusicPlayer.status = "Playing"; + + GuiMusicPlayerScrubber.setActive( true ); + GuiMusicPlayerScrubber.setup( %this.sfxSource.getDuration() ); + } + } + } + + if( %isPlaying ) + { + GuiMusicPlayerPlayButton.setText( "Pause" ); + GuiMusicPlayerPlayButton.command = "GuiMusicPlayer.pause();"; + GuiMusicPlayerLoopCheckBox.setActive( false ); + GuiMusicPlayerFadeCheckBox.setActive( false ); + %this.status = "Playing"; + } + } +} + +function GuiMusicPlayerClass::stop( %this ) +{ + if( %this.status $= "Playing" + || %this.status $= "Paused" ) + { + if( isObject( %this.sfxSource ) ) + %this.sfxSource.stop( 0 ); // Stop immediately. + } +} + +function GuiMusicPlayerClass::onStop( %this ) +{ + %this.sfxSource = 0; + + GuiMusicPlayerLoopCheckBox.setActive( true ); + GuiMusicPlayerFadeCheckBox.setActive( true ); + GuiMusicPlayerScrubber.setActive( false ); + GuiMusicPlayerPlayButton.setText( "Play" ); + GuiMusicPlayerPlayButton.Command = "GuiMusicPlayer.play();"; + %this.status = "Stopped"; + + GuiMusicPlayerScrubber.setValue( 0 ); +} + +function GuiMusicPlayerClass::pause( %this ) +{ + if( %this.status $= "Playing" ) + { + if( isObject( %this.sfxSource ) ) + %this.sfxSource.pause( 0 ); + + GuiMusicPlayerPlayButton.setText( "Play" ); + GuiMusicPlayerPlayButton.command = "GuiMusicPlayer.play();"; + %this.status = "Paused"; + } +} + +function GuiMusicPlayerClass::seek( %this, %playtime ) +{ + if( ( %this.status $= "Playing" + || %this.status $= "Paused" ) + && isObject( %this.sfxSource ) ) + %this.sfxSource.setPosition( %playtime ); +} + +function GuiMusicPlayer::onWake( %this ) +{ + GuiMusicPlayerMusicList.load(); +} + +function GuiMusicPlayerMusicListClass::load( %this ) +{ + // Remove all the files currently in the list. + + %this.clearItems(); + + // Find the file matching pattern we should use. + + %filePattern = $pref::GuiMusicPlayer::filePattern; + %sfxProvider = getWord( sfxGetDeviceInfo(), 0 ); + %filePatternVarName = "$pref::GuiMusicPlayer::filePattern" @ %sfxProvider; + if( isDefined( %filePatternVarName ) ) + eval( "%filePattern = " @ %filePatternVarName @ ";" ); + + // Find all files matching the pattern. + + for( %file = findFirstFileMultiExpr( %filePattern ); + %file !$= ""; + %file = findNextFileMultiExpr( %filePattern ) ) + %this.addItem( makeRelativePath( %file, getMainDotCsDir() ) ); +} + +function GuiMusicPlayerMusicList::onDoubleClick( %this ) +{ + GuiMusicPlayer.stop(); + GuiMusicPlayer.play(); +} + +function GuiMusicPlayerScrubber::onMouseDragged( %this ) +{ + %this.isBeingDragged = true; +} + +function GuiMusicPlayerScrubberClass::setup( %this, %totalPlaytime ) +{ + %this.range = "0 " @ %totalPlaytime; + %this.ticks = %totalPlaytime / 5; // One tick per five seconds. + + %this.update(); +} + +function GuiMusicPlayerScrubberClass::update( %this ) +{ + if( GuiMusicPlayer.status $= "Playing" + && !%this.isBeingDragged ) + %this.setValue( GuiMusicPlayer.sfxSource.getPosition() ); + + if( GuiMusicPlayer.status $= "Playing" + || GuiMusicPlayer.status $= "Paused" ) + %this.schedule( 5, "update" ); +} + +function GuiMusicPlayerScrubberClass::onDragComplete( %this ) +{ + GuiMusicPlayer.seek( %this.getValue() ); + %this.isBeingDragged = false; +} diff --git a/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.gui b/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.gui new file mode 100644 index 000000000..291f3a356 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/guiMusicPlayer.gui @@ -0,0 +1,192 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(GuiMusicPlayer) { + isContainer = "1"; + Profile = "GuiWindowProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "0 0"; + Extent = "1024 768"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "1"; + superClass = "GuiMusicPlayerClass"; + + new GuiWindowCtrl() { + resizeWidth = "0"; + resizeHeight = "0"; + canMove = "1"; + canClose = "1"; + canMinimize = "1"; + canMaximize = "1"; + minSize = "50 50"; + EdgeSnap = "1"; + text = "Torque Music Player"; + Margin = "0 0 0 0"; + Padding = "0 0 0 0"; + AnchorTop = "1"; + AnchorBottom = "0"; + AnchorLeft = "1"; + AnchorRight = "0"; + isContainer = "1"; + Profile = "GuiWindowProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "29 35"; + Extent = "518 377"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + closeCommand = "toggleMusicPlayer();"; + + new GuiCheckBoxCtrl(GuiMusicPlayerFadeCheckBox) { + useInactiveState = "0"; + text = "Fade"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + isContainer = "0"; + Profile = "GuiCheckBoxProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "457 347"; + Extent = "53 30"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl(GuiMusicPlayerLoopCheckBox) { + useInactiveState = "0"; + text = "Loop"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + isContainer = "0"; + Profile = "GuiCheckBoxProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "457 330"; + Extent = "44 30"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + new GuiScrollCtrl() { + willFirstRespond = "1"; + hScrollBar = "dynamic"; + vScrollBar = "alwaysOn"; + lockHorizScroll = "0"; + lockVertScroll = "0"; + constantThumbHeight = "0"; + childMargin = "0 0"; + mouseWheelScrollSpeed = "-1"; + Margin = "0 0 0 0"; + Padding = "0 0 0 0"; + AnchorTop = "1"; + AnchorBottom = "0"; + AnchorLeft = "1"; + AnchorRight = "0"; + isContainer = "1"; + Profile = "GuiScrollProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "9 31"; + Extent = "500 298"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + + new GuiListBoxCtrl(GuiMusicPlayerMusicList) { + AllowMultipleSelections = "1"; + fitParentWidth = "1"; + isContainer = "0"; + Profile = "GuiListBoxProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "1 1"; + Extent = "485 2"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + superClass = "GuiMusicPlayerMusicListClass"; + }; + }; + new GuiSliderCtrl(GuiMusicPlayerScrubber) { + range = "0 1"; + ticks = "10"; + value = "0"; + snap = "false"; + isContainer = "0"; + Profile = "GuiSliderProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "114 343"; + Extent = "331 23"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + Command = "$thisControl.onDragComplete();"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + class = "GuiMusicPlayerScrubberClass"; + className = "GuiMusicPlayerScrubberClass"; + }; + new GuiButtonCtrl(GuiMusicPlayerStopButton) { + text = "Stop"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + isContainer = "0"; + Profile = "GuiButtonProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "57 338"; + Extent = "40 30"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + Command = "GuiMusicPlayer.stop();"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(GuiMusicPlayerPlayButton) { + text = "Play"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + isContainer = "0"; + Profile = "GuiButtonProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "13 338"; + Extent = "40 30"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + Command = "GuiMusicPlayer.play();"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/joinServerMenu.cs b/Templates/BaseGame/game/data/ui/guis/joinServerMenu.cs new file mode 100644 index 000000000..5529ebaed --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/joinServerMenu.cs @@ -0,0 +1,143 @@ + +function JoinServerMenu::onWake() +{ + // Double check the status. Tried setting this the control + // inactive to start with, but that didn't seem to work. + JoinServerJoinBtn.setActive(JS_serverList.rowCount() > 0); +} + +//---------------------------------------- +function JoinServerMenu::query(%this) +{ + queryMasterServer( + 0, // Query flags + $Client::GameTypeQuery, // gameTypes + $Client::MissionTypeQuery, // missionType + 0, // minPlayers + 100, // maxPlayers + 0, // maxBots + 2, // regionMask + 0, // maxPing + 100, // minCPU + 0 // filterFlags + ); +} + +//---------------------------------------- +function JoinServerMenu::queryLan(%this) +{ + queryLANServers( + $pref::Net::Port, // lanPort for local queries + 0, // Query flags + $Client::GameTypeQuery, // gameTypes + $Client::MissionTypeQuery, // missionType + 0, // minPlayers + 100, // maxPlayers + 0, // maxBots + 2, // regionMask + 0, // maxPing + 100, // minCPU + 0 // filterFlags + ); +} + +//---------------------------------------- +function JoinServerMenu::cancel(%this) +{ + cancelServerQuery(); + JS_queryStatus.setVisible(false); +} + + +//---------------------------------------- +function JoinServerMenu::join(%this) +{ + cancelServerQuery(); + %index = JS_serverList.getSelectedId(); + + JoinGame(%index); +} + +//---------------------------------------- +function JoinServerMenu::refresh(%this) +{ + cancelServerQuery(); + %index= JS_serverList.getSelectedId(); + + // The server info index is stored in the row along with the + // rest of displayed info. + if( setServerInfo( %index ) ) + querySingleServer( $ServerInfo::Address, 0 ); +} + +//---------------------------------------- +function JoinServerMenu::refreshSelectedServer( %this ) +{ + querySingleServer( $JoinGameAddress, 0 ); +} + +//---------------------------------------- +function JoinServerMenu::exit(%this) +{ + cancelServerQuery(); + + Canvas.popDialog(JoinServerMenu); +} + +//---------------------------------------- +function JoinServerMenu::update(%this) +{ + // Copy the servers into the server list. + JS_queryStatus.setVisible(false); + JS_serverList.clear(); + %sc = getServerCount(); + for( %i = 0; %i < %sc; %i ++ ) { + setServerInfo(%i); + JS_serverList.addRow( %i, + $ServerInfo::Name TAB + $ServerInfo::Ping TAB + $ServerInfo::PlayerCount @ "/" @ $ServerInfo::MaxPlayers TAB + $ServerInfo::Version TAB + $ServerInfo::MissionName + ); + } + JS_serverList.sort(0); + JS_serverList.setSelectedRow(0); + JS_serverList.scrollVisible(0); + + JoinServerJoinBtn.setActive(JS_serverList.rowCount() > 0); +} + +//---------------------------------------- +function onServerQueryStatus(%status, %msg, %value) +{ + echo("ServerQuery: " SPC %status SPC %msg SPC %value); + // Update query status + // States: start, update, ping, query, done + // value = % (0-1) done for ping and query states + if (!JS_queryStatus.isVisible()) + JS_queryStatus.setVisible(true); + + switch$ (%status) { + case "start": + JoinServerJoinBtn.setActive(false); + JoinServerQryInternetBtn.setActive(false); + JS_statusText.setText(%msg); + JS_statusBar.setValue(0); + JS_serverList.clear(); + + case "ping": + JS_statusText.setText("Ping Servers"); + JS_statusBar.setValue(%value); + + case "query": + JS_statusText.setText("Query Servers"); + JS_statusBar.setValue(%value); + + case "done": + JoinServerQryInternetBtn.setActive(true); + JS_queryStatus.setVisible(false); + JS_status.setText(%msg); + JoinServerMenu.update(); + } +} diff --git a/Templates/BaseGame/game/data/ui/guis/joinServerMenu.gui b/Templates/BaseGame/game/data/ui/guis/joinServerMenu.gui new file mode 100644 index 000000000..96545c438 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/joinServerMenu.gui @@ -0,0 +1,455 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(JoinServerMenu) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + + new GuiControl(JoinServerWindow) { + position = "80 36"; + extent = "800 616"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl(JS_status) { + text = "No servers found."; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "277 31"; + extent = "148 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiScrollCtrl() { + willFirstRespond = "1"; + hScrollBar = "dynamic"; + vScrollBar = "alwaysOn"; + lockHorizScroll = "0"; + lockVertScroll = "0"; + constantThumbHeight = "0"; + childMargin = "0 0"; + mouseWheelScrollSpeed = "-1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "10 80"; + extent = "780 461"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuScrollProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextListCtrl(JS_serverList) { + columns = "0 200 270 335 400"; + fitParentWidth = "1"; + clipColumnText = "0"; + position = "1 1"; + extent = "762 8"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextArrayProfile"; + visible = "1"; + active = "1"; + altCommand = "JoinServerDlg.join();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiTextEditCtrl() { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "116 31"; + extent = "144 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextEditProfile"; + visible = "1"; + active = "1"; + variable = "$pref::Player::Name"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Player Name:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "12 31"; + extent = "98 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Players"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "269 59"; + extent = "36 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMLWhiteTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Version"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "335 59"; + extent = "38 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMLWhiteTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Game"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "412 59"; + extent = "28 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMLWhiteTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Ping"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "212 59"; + extent = "20 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMLWhiteTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Server Name"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "12 59"; + extent = "63 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMLWhiteTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiControl(JS_queryStatus) { + position = "10 541"; + extent = "778 35"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiProgressCtrl(JS_statusBar) { + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "84 0"; + extent = "695 35"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiProgressProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(JS_cancelQuery) { + text = "Cancel!"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 0"; + extent = "84 35"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "JoinServerDlg.cancel();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(JS_statusText) { + text = "Querying master server"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "84 0"; + extent = "695 35"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiButtonCtrl(JoinServerBackBtn) { + text = "Return to Menu"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "0 583"; + extent = "160 33"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog(JoinServerMenu);\n\nif(isObject(JoinServerMenu.returnGui) && JoinServerMenu.returnGui.isMethod(\"onReturnTo\")) JoinServerMenu.returnGui.onReturnTo();"; + accelerator = "escape"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(JoinServerQryLanBtn) { + text = "Query Lan"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "160 583"; + extent = "160 33"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "JoinServerMenu.queryLan();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(JoinServerQryInternetBtn) { + text = "Query Internet"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "320 583"; + extent = "160 33"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "JoinServerMenu.query();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(JoinServerRefreshBtn) { + text = "Refresh Server"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "480 583"; + extent = "160 33"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "JoinServerMenu.refresh();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(JoinServerJoinBtn) { + text = "Join Server"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "640 583"; + extent = "160 33"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "0"; + command = "JoinServerMenu.join();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/loadingGui.gui b/Templates/BaseGame/game/data/ui/guis/loadingGui.gui new file mode 100644 index 000000000..e907dd193 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/loadingGui.gui @@ -0,0 +1,102 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiChunkedBitmapCtrl(LoadingGui) { + bitmap = "data/ui/images/background-dark.png"; + useVariable = "0"; + tile = "0"; + position = "0 0"; + extent = "1600 838"; + minExtent = "8 8"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + Enabled = "1"; + + new GuiControl() { + position = "391 429"; + extent = "497 166"; + minExtent = "8 8"; + horizSizing = "center"; + vertSizing = "center"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "disconnect();\nCanvas.setContent(ProjectSettings.value(\"UI/mainMenuName\"));"; + accelerator = "escape"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl(LoadingLogo) { + bitmap = "data/ui/images/Torque-3D-logo.png"; + wrap = "0"; + position = "27 6"; + extent = "443 139"; + minExtent = "8 2"; + horizSizing = "center"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiProgressBitmapCtrl(LoadingProgress) { + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "17 126"; + extent = "464 24"; + minExtent = "8 2"; + horizSizing = "center"; + vertSizing = "bottom"; + profile = "GuiProgressBitmapProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(LoadingProgressTxt) { + text = "LOADING DATABLOCKS"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "28 144"; + extent = "440 20"; + minExtent = "8 8"; + horizSizing = "center"; + vertSizing = "bottom"; + profile = "GuiMenuTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/mainMenu.cs b/Templates/BaseGame/game/data/ui/guis/mainMenu.cs new file mode 100644 index 000000000..96820ba99 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/mainMenu.cs @@ -0,0 +1,41 @@ +function MainMenuGui::onWake(%this) +{ + if (isFunction("getWebDeployment") && + getWebDeployment() && + isObject(%this-->ExitButton)) + %this-->ExitButton.setVisible(false); + + MainMenuButtonContainer.hidden = false; +} + +function MainMenuGui::openSinglePlayerMenu(%this) +{ + $pref::HostMultiPlayer=false; + Canvas.pushDialog(ChooseLevelDlg); + ChooseLevelDlg.returnGui = %this; + MainMenuButtonContainer.hidden = true; + MainMenuAppLogo.setBitmap("data/ui/images/Torque-3D-logo"); +} + +function MainMenuGui::openMultiPlayerMenu(%this) +{ + $pref::HostMultiPlayer=true; + Canvas.pushDialog(ChooseLevelDlg); + ChooseLevelDlg.returnGui = %this; + MainMenuButtonContainer.hidden = true; + MainMenuAppLogo.setBitmap("data/ui/images/Torque-3D-logo"); +} + +function MainMenuGui::openOptionsMenu(%this) +{ + Canvas.pushDialog(OptionsMenu); + OptionsMenu.returnGui = %this; + MainMenuButtonContainer.hidden = true; + MainMenuAppLogo.setBitmap("data/ui/images/Torque-3D-logo"); +} + +function MainMenuGui::onReturnTo(%this) +{ + MainMenuButtonContainer.hidden = false; + MainMenuAppLogo.setBitmap("data/ui/images/Torque-3D-logo-shortcut"); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/guis/mainMenu.gui b/Templates/BaseGame/game/data/ui/guis/mainMenu.gui new file mode 100644 index 000000000..1b0fb9811 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/mainMenu.gui @@ -0,0 +1,234 @@ +exec( "tools/gui/profiles.ed.cs" ); + +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiChunkedBitmapCtrl(MainMenuGui) { + bitmap = "data/ui/images/BackgroundImage.png"; + useVariable = "0"; + tile = "0"; + position = "0 0"; + extent = "1024 768"; + minExtent = "8 8"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + Enabled = "1"; + isDecoy = "0"; + + new GuiBitmapButtonCtrl(MainMenuAppLogo) { + bitmap = "data/ui/images/Torque-3D-logo-shortcut"; + bitmapMode = "Stretched"; + autoFitExtents = "0"; + useModifiers = "0"; + useStates = "1"; + masked = "0"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "550 30"; + extent = "443 139"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + command = "gotoWebPage(\"forums.torque3d.org\");"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "1"; + }; + new GuiControl(MainMenuButtonContainer) { + position = "20 193"; + extent = "442 381"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "center"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiDynamicCtrlArrayControl() { + colCount = "1"; + colSize = "442"; + rowCount = "9"; + rowSize = "40"; + rowSpacing = "0"; + colSpacing = "0"; + frozen = "0"; + autoCellSize = "1"; + fillRowFirst = "0"; + dynamicSize = "0"; + padding = "0 0 0 0"; + position = "0 0"; + extent = "442 381"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiButtonCtrl() { + text = "Singleplayer"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "0 0"; + extent = "442 40"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "MainMenuGui.openSinglePlayerMenu();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Create Server"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 40"; + extent = "442 40"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "MainMenuGui.openMultiPlayerMenu();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Join Server"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 80"; + extent = "442 40"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.pushDialog(JoinServerMenu);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Options"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 120"; + extent = "442 40"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "MainMenuGui.openOptionsMenu();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Launch World Editor"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 160"; + extent = "442 40"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "fastLoadWorldEdit(1);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Launch GUI Editor"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 200"; + extent = "442 40"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "fastLoadGUIEdit(1);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Exit"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 240"; + extent = "442 40"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "quit();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "ExitButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/messageBoxOK.gui b/Templates/BaseGame/game/data/ui/guis/messageBoxOK.gui new file mode 100644 index 000000000..52e119ea6 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/messageBoxOK.gui @@ -0,0 +1,60 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(MessageBoxOKDlg) { + profile = "GuiOverlayProfile"; + horizSizing = "width"; + vertSizing = "height"; + position = "0 0"; + extent = "640 480"; + minExtent = "8 8"; + visible = "1"; + helpTag = "0"; + + new GuiWindowCtrl(MBOKFrame) { + profile = "GuiWindowProfile"; + horizSizing = "center"; + vertSizing = "center"; + position = "170 175"; + extent = "300 107"; + minExtent = "48 95"; + visible = "1"; + helpTag = "0"; + maxLength = "255"; + resizeWidth = "1"; + resizeHeight = "1"; + canMove = "1"; + canClose = "0"; + canMinimize = "0"; + canMaximize = "0"; + minSize = "50 50"; + text = ""; + + new GuiMLTextCtrl(MBOKText) { + profile = "GuiMLTextProfile"; + horizSizing = "center"; + vertSizing = "bottom"; + position = "9 35"; + extent = "281 24"; + minExtent = "8 8"; + visible = "1"; + helpTag = "0"; + lineSpacing = "2"; + allowColorChars = "0"; + maxChars = "-1"; + }; + new GuiButtonCtrl() { + profile = "GuiButtonProfile"; + horizSizing = "right"; + vertSizing = "top"; + position = "111 75"; + extent = "80 24"; + minExtent = "8 8"; + visible = "1"; + command = "MessageCallback(MessageBoxOKDlg,MessageBoxOKDlg.callback);"; + accelerator = "return"; + helpTag = "0"; + text = "Ok"; + simpleStyle = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/messageBoxYesNo.gui b/Templates/BaseGame/game/data/ui/guis/messageBoxYesNo.gui new file mode 100644 index 000000000..3cd7d18ef --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/messageBoxYesNo.gui @@ -0,0 +1,75 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(MessageBoxYesNoDlg) { + profile = "GuiOverlayProfile"; + horizSizing = "width"; + vertSizing = "height"; + position = "0 0"; + extent = "640 480"; + minExtent = "8 8"; + visible = "1"; + helpTag = "0"; + + new GuiWindowCtrl(MBYesNoFrame) { + profile = "GuiWindowProfile"; + horizSizing = "center"; + vertSizing = "center"; + position = "170 175"; + extent = "300 100"; + minExtent = "48 92"; + visible = "1"; + helpTag = "0"; + maxLength = "255"; + resizeWidth = "1"; + resizeHeight = "1"; + canMove = "1"; + canClose = "1"; + canMinimize = "0"; + canMaximize = "0"; + minSize = "50 50"; + text = ""; + closeCommand = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);"; + + new GuiMLTextCtrl(MBYesNoText) { + profile = "GuiMLTextProfile"; + horizSizing = "center"; + vertSizing = "bottom"; + position = "11 38"; + extent = "280 14"; + minExtent = "8 8"; + visible = "1"; + helpTag = "0"; + lineSpacing = "2"; + allowColorChars = "0"; + maxChars = "-1"; + }; + new GuiButtonCtrl() { + profile = "GuiButtonProfile"; + horizSizing = "right"; + vertSizing = "top"; + position = "70 68"; + extent = "80 22"; + minExtent = "8 8"; + visible = "1"; + command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.yesCallback);"; + accelerator = "return"; + helpTag = "0"; + text = "Yes"; + simpleStyle = "0"; + }; + new GuiButtonCtrl() { + profile = "GuiButtonProfile"; + horizSizing = "right"; + vertSizing = "top"; + position = "167 68"; + extent = "80 22"; + minExtent = "8 8"; + visible = "1"; + command = "MessageCallback(MessageBoxYesNoDlg,MessageBoxYesNoDlg.noCallback);"; + accelerator = "escape"; + helpTag = "0"; + text = "No"; + simpleStyle = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/netGraphGui.gui b/Templates/BaseGame/game/data/ui/guis/netGraphGui.gui new file mode 100644 index 000000000..b034a447e --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/netGraphGui.gui @@ -0,0 +1,557 @@ +function execNetGraphGuiGUI() +{ + if ( isObject( NetGraphGui ) ) + NetGraphGui.delete(); + + if ( isObject( NetGraphProfile ) ) + NetGraphProfile.delete(); + + if ( isObject( NetGraphGhostsActiveProfile ) ) + NetGraphGhostsActiveProfile.delete(); + + if ( isObject( NetGraphGhostUpdatesProfile ) ) + NetGraphGhostUpdatesProfile.delete(); + + if ( isObject( NetGraphBitsSentProfile ) ) + NetGraphBitsSentProfile.delete(); + + if ( isObject( NetGraphBitsReceivedProfile ) ) + NetGraphBitsReceivedProfile.delete(); + + if ( isObject( NetGraphLatencyProfile ) ) + NetGraphLatencyProfile.delete(); + + if ( isObject( NetGraphPacketLossProfile ) ) + NetGraphPacketLossProfile.delete(); + + exec( "./NetGraphGui.gui" ); +} + +// Profiles +new GuiControlProfile (NetGraphProfile) +{ + modal = false; + opaque = false; + canKeyFocus = false; +}; + +new GuiControlProfile (NetGraphKeyContainerProfile) +{ + border = true; + opaque = true; + fillColor = "100 100 100 200"; +}; +new GuiControlProfile (NetGraphGhostsActiveProfile) +{ + border = false; + fontColor = "255 255 255"; +}; +new GuiControlProfile (NetGraphGhostUpdatesProfile) +{ + border = false; + fontColor = "255 0 0"; +}; +new GuiControlProfile (NetGraphBitsSentProfile) +{ + border = false; + fontColor = "0 255 0"; +}; +new GuiControlProfile (NetGraphBitsReceivedProfile) +{ + border = false; + fontColor = "0 0 255"; +}; +new GuiControlProfile (NetGraphLatencyProfile) +{ + border = false; + fontColor = "0 255 255"; +}; +new GuiControlProfile (NetGraphPacketLossProfile) +{ + border = false; + fontColor = "0 0 0"; +}; + +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(NetGraphGui) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + noCursor = "1"; + + new GuiGraphCtrl(NetGraph) { + centerY = "1"; + plotColor[0] = "1 1 1 1"; + plotColor[1] = "1 0 0 1"; + plotColor[2] = "0 1 0 1"; + plotColor[3] = "0 0 1 1"; + plotColor[4] = "0 1 1 1"; + plotColor[5] = "0 0 0 1"; + plotType[0] = "PolyLine"; + plotType[1] = "PolyLine"; + plotType[2] = "PolyLine"; + plotType[3] = "PolyLine"; + plotType[4] = "PolyLine"; + plotType[5] = "PolyLine"; + plotInterval[0] = "0"; + plotInterval[1] = "0"; + plotInterval[2] = "0"; + plotInterval[3] = "0"; + plotInterval[4] = "0"; + plotInterval[5] = "0"; + position = "816 5"; + extent = "200 200"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphKeyContainerProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiControl() { + position = "816 205"; + extent = "200 104"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphKeyContainerProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl(GhostsActive) { + text = "Ghosts Active"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 0"; + extent = "100 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphGhostsActiveProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(GhostUpdates) { + text = "Ghost Updates"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "100 0"; + extent = "100 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphGhostUpdatesProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(BitsSent) { + text = "Bytes Sent"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 18"; + extent = "100 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphBitsSentProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(BitsReceived) { + text = "Bytes Received"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "100 18"; + extent = "100 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphBitsReceivedProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(Latency) { + text = "Latency"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 36"; + extent = "100 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphLatencyProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(PacketLoss) { + text = "Packet Loss"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "100 36"; + extent = "59 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphPacketLossProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Network Simulation:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 52"; + extent = "97 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphPacketLossProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Simulated Latency:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 68"; + extent = "91 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphPacketLossProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "ms"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "179 68"; + extent = "20 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphPacketLossProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl(NetGraphSimLatency) { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + text = "0"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "112 67"; + extent = "64 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Simulated Packet Loss:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 83"; + extent = "111 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphPacketLossProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "%"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "179 84"; + extent = "20 18"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "bottom"; + profile = "NetGraphPacketLossProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl(NetGraphSimPacket) { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + text = "0"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "112 85"; + extent = "64 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextEditProfile"; + visible = "1"; + active = "1"; + command = "if(NetGraphSimLatency.text $= \"\" || NetGraphSimLatency.text < 0)\n{\n NetGraphSimLatency.text = 0;\n}\n\nif(NetGraphSimPacket.text $= \"\" || NetGraphSimPacket.text < 0)\n{\n NetGraphSimLatency.text = 0;\n}\nelse if(NetGraphSimPacket.text > 100)\n{\n NetGraphSimPacket.text = 100;\n}\n\nnetSimulateLag( NetGraphSimLatency.text, NetGraphSimPacket.text );"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- + +// Functions +function toggleNetGraph() +{ + if(!$NetGraph::isInitialized) + { + NetGraph::updateStats(); + $NetGraph::isInitialized = true; + } + + if(!Canvas.isMember(NetGraphGui)) + { + Canvas.add(NetGraphGui); + } + else + { + Canvas.remove(NetGraphGui); + netSimulateLag( 0, 0 ); + } +} + +function NetGraph::updateStats() +{ + $NetGraphThread = NetGraph.schedule(32, "updateStats"); + + if(!$Stats::netGhostUpdates) + return; + + if(isobject(NetGraph)) + { + if(isobject(ServerConnection)) + NetGraph.addDatum(0,ServerConnection.getGhostsActive()); + GhostsActive.setText("Ghosts Active: " @ ServerConnection.getGhostsActive()); + NetGraph.addDatum(1,$Stats::netGhostUpdates); + GhostUpdates.setText("Ghost Updates: " @ $Stats::netGhostUpdates); + NetGraph.addDatum(2,$Stats::netBitsSent); + BitsSent.setText("Bytes Sent: " @ $Stats::netBitsSent); + NetGraph.addDatum(3,$Stats::netBitsReceived); + BitsReceived.setText("Bytes Received: " @ $Stats::netBitsReceived); + NetGraph.matchScale(2,3); + NetGraph.addDatum(4,ServerConnection.getPing()); + Latency.setText("Latency: " @ ServerConnection.getPing()); + NetGraph.addDatum(5,ServerConnection.getPacketLoss()); + PacketLoss.setText("Packet Loss: " @ ServerConnection.getPacketLoss()); + } +} + +function NetGraph::toggleKey() +{ + if(!GhostsActive.visible) + { + GhostsActive.visible = 1; + GhostUpdates.visible = 1; + BitsSent.visible = 1; + BitsReceived.visible = 1; + Latency.visible = 1; + PacketLoss.visible = 1; + } + else + { + GhostsActive.visible = 0; + GhostUpdates.visible = 0; + BitsSent.visible = 0; + BitsReceived.visible = 0; + Latency.visible = 0; + PacketLoss.visible = 0; + } +} + +function NetGraphSimLatency::onReturn(%this) +{ + NetGraph.updateNetworkSimulation(); +} + +function NetGraphSimPacket::onReturn(%this) +{ + NetGraph.updateNetworkSimulation(); +} + +function NetGraph::updateNetworkSimulation(%this) +{ + %latency = NetGraphSimLatency.getText(); + + if(%latency $= "" || %latency < 0) + { + NetGraphSimLatency.text = 0; + %latency = 0; + } + + %packetLoss = NetGraphSimPacket.getText(); + + if(%packetLoss $= "" || %packetLoss < 0) + { + NetGraphSimLatency.text = 0; + %packetLoss = 0; + } + else if(%packetLoss > 100) + { + NetGraphSimPacket.text = 100; + %packetLoss = 100; + } + + netSimulateLag( %latency, %packetLoss ); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/guis/optionsDlg.gui b/Templates/BaseGame/game/data/ui/guis/optionsDlg.gui new file mode 100644 index 000000000..fcff1cb95 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/optionsDlg.gui @@ -0,0 +1,1417 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(OptionsDlg) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 8"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiOverlayProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + fixedAspectRatio = "0"; + + new GuiWindowCtrl() { + text = "Options"; + resizeWidth = "0"; + resizeHeight = "0"; + canMove = "1"; + canClose = "1"; + canMinimize = "0"; + canMaximize = "0"; + canCollapse = "0"; + closeCommand = "Canvas.popDialog(optionsDlg);"; + edgeSnap = "0"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "323 232"; + extent = "377 303"; + minExtent = "8 8"; + horizSizing = "center"; + vertSizing = "center"; + profile = "GuiWindowProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiButtonCtrl() { + text = "Done"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "306 271"; + extent = "60 23"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog(optionsDlg);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiBitmapBorderCtrl() { + position = "9 55"; + extent = "358 210"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTabBorderProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "OptControlsPane"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiScrollCtrl() { + willFirstRespond = "1"; + hScrollBar = "alwaysOff"; + vScrollBar = "alwaysOn"; + lockHorizScroll = "1"; + lockVertScroll = "0"; + constantThumbHeight = "0"; + childMargin = "0 0"; + mouseWheelScrollSpeed = "-1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "5 24"; + extent = "347 152"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiScrollProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextListCtrl() { + columns = "0 160"; + fitParentWidth = "1"; + clipColumnText = "0"; + position = "1 1"; + extent = "329 780"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + altCommand = "OptionsDlg.doRemap();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "OptRemapList"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiTextCtrl() { + text = "Control Name"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "6 6"; + extent = "64 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Control Binding"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "165 6"; + extent = "72 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + + new GuiSliderCtrl(OptMouseSensitivity) { + range = "0.02 2"; + ticks = "10"; + value = "0.75"; + isContainer = "0"; + Profile = "GuiSliderProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "105 182"; + Extent = "244 18"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + Command = "OptMouseSetSensitivity(OptMouseSensitivity.value);"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Mouse Sensitivity:"; + maxLength = "255"; + Margin = "0 0 0 0"; + Padding = "0 0 0 0"; + AnchorTop = "1"; + AnchorBottom = "0"; + AnchorLeft = "1"; + AnchorRight = "0"; + isContainer = "0"; + Profile = "GuiTextProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "15 182"; + Extent = "85 18"; + MinExtent = "8 8"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + canSaveDynamicFields = "0"; + }; + }; + new GuiBitmapBorderCtrl() { + position = "9 55"; + extent = "358 210"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTabBorderProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "OptAudioPane"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiMLTextCtrl() { + lineSpacing = "2"; + allowColorChars = "0"; + maxChars = "-1"; + useURLMouseCursor = "0"; + position = "149 10"; + extent = "190 14"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiMLTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptAudioInfo"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Audio Provider:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "16 16"; + extent = "75 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl(OptAudioProviderList) { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "Null"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "101 15"; + extent = "240 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Audio Device:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "23 48"; + extent = "75 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl(OptAudioDeviceList) { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "SFX Null Device"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "101 47"; + extent = "240 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiControl() { + position = "18 84"; + extent = "325 17"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { + text = "Master Volume"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 0"; + extent = "72 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiAutoSizeTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiSliderCtrl() { + range = "0 1"; + ticks = "0"; + snap = "0"; + value = "0.8"; + position = "85 1"; + extent = "240 14"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiSliderProfile"; + visible = "1"; + active = "1"; + altCommand = "OptAudioUpdateMasterVolume( $thisControl.value );"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptAudioVolumeMaster"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiControl() { + position = "9 115"; + extent = "334 17"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { + text = "Interface Volume"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 0"; + extent = "82 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiAutoSizeTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiSliderCtrl() { + range = "0 1"; + ticks = "0"; + snap = "0"; + value = "1"; + position = "94 2"; + extent = "240 13"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiSliderProfile"; + visible = "1"; + active = "1"; + altCommand = "OptAudioUpdateChannelVolume(AudioGui, $thisControl.value);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptAudioVolumeShell"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiControl() { + position = "18 146"; + extent = "325 17"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { + text = "Effects Volume"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 0"; + extent = "74 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiAutoSizeTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiSliderCtrl() { + range = "0 1"; + ticks = "0"; + snap = "0"; + value = "1"; + position = "85 2"; + extent = "240 13"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiSliderProfile"; + visible = "1"; + active = "1"; + altCommand = "OptAudioUpdateChannelVolume(AudioEffect, $thisControl.value);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptAudioVolumeSim"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiControl() { + position = "23 177"; + extent = "320 17"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiSliderCtrl() { + range = "0 1"; + ticks = "0"; + snap = "0"; + value = "1"; + position = "80 2"; + extent = "240 13"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiSliderProfile"; + visible = "1"; + active = "1"; + altCommand = "OptAudioUpdateChannelVolume(AudioMusic, $thisControl.value);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptAudioVolumeMusic"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Music Volume"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 0"; + extent = "67 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiAutoSizeTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + }; + new GuiBitmapBorderCtrl() { + position = "9 55"; + extent = "358 210"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTabBorderProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "OptGraphicsPane"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiTextCtrl() { + text = "Display Driver:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "11 8"; + extent = "70 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Resolution:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "11 35"; + extent = "53 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl() { + text = "Fullscreen"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "11 62"; + extent = "85 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptGraphicsFullscreenToggle"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl(OptGraphicsDriverMenu) { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "ATI Radeon HD 5700 Series (D3D9)"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "88 8"; + extent = "258 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "1024 x 768 (4:3)"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "67 35"; + extent = "127 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptGraphicsResolutionMenu"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Refresh:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "207 35"; + extent = "45 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "60"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "252 35"; + extent = "49 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptRefreshSelectMenu"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Mesh Quality:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "21 91"; + extent = "62 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "Low"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "90 91"; + extent = "78 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptMeshQualityPopup"; + class = "GraphicsQualityPopup"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "Low"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "90 118"; + extent = "78 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptTextureQualityPopup"; + class = "GraphicsQualityPopup"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Texture Quality:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "11 118"; + extent = "77 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "Low"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "90 143"; + extent = "78 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptLightingQualityPopup"; + class = "GraphicsQualityPopup"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Lighting Quality:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "11 143"; + extent = "73 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Effect Quality:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "191 91"; + extent = "73 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "263 91"; + extent = "78 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptEffectQualityPopup"; + class = "GraphicsQualityPopup"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Shader Quality:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "186 118"; + extent = "77 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "Low"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "263 118"; + extent = "78 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptShaderQualityPopup"; + class = "GraphicsQualityPopup"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Particle Quality:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "186 156"; + extent = "73 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "263 156"; + extent = "78 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "0"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptParticleQualityPopup"; + class = "GraphicsQualityPopup"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Anisotropic Filtering:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "22 167"; + extent = "105 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + text = "Off"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "123 167"; + extent = "45 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptAnisotropicPopup"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl() { + text = "Vertical Sync"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "92 62"; + extent = "85 18"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptGraphicsVSyncToggle"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Auto Detect Quality"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "205 152"; + extent = "110 27"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._autoDetectQuality();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiPopUpMenuCtrl() { + maxPopupHeight = "200"; + sbUsesNAColor = "0"; + reverseTextList = "0"; + bitmapBounds = "16 16"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "263 62"; + extent = "78 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiPopUpMenuProfile"; + visible = "1"; + active = "1"; + command = "OptionsDlg._updateApplyState();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptAAQualityPopup"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Anti-aliasing"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "191 62"; + extent = "73 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiControl() { + position = "0 190"; + extent = "352 15"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "GammaSliderContainer"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiSliderCtrl() { + range = "0.001 2.2"; + ticks = "0"; + snap = "0"; + value = "1"; + position = "76 -1"; + extent = "268 15"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiSliderProfile"; + visible = "1"; + active = "1"; + variable = "$pref::Video::Gamma"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Gamma:"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "22 -4"; + extent = "105 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + }; + new GuiControl() { + position = "9 55"; + extent = "357 208"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiWindowProfile"; + visible = "0"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "OptNetworkPane"; + hidden = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Graphics"; + groupNum = "-1"; + buttonType = "RadioButton"; + useMouseEvents = "0"; + position = "9 33"; + extent = "117 23"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonTabProfile"; + visible = "1"; + active = "1"; + command = "optionsDlg.setPane(Graphics);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "OptGraphicsButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Audio"; + groupNum = "-1"; + buttonType = "RadioButton"; + useMouseEvents = "0"; + position = "126 33"; + extent = "117 23"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonTabProfile"; + visible = "1"; + active = "1"; + command = "optionsDlg.setPane(Audio);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Controls"; + groupNum = "-1"; + buttonType = "RadioButton"; + useMouseEvents = "0"; + position = "243 33"; + extent = "117 23"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonTabProfile"; + visible = "1"; + active = "1"; + command = "optionsDlg.setPane(Controls);"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + text = "Apply"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "241 271"; + extent = "60 23"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "0"; + command = "optionsDlg.applyGraphics();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + internalName = "apply"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/optionsMenu.cs b/Templates/BaseGame/game/data/ui/guis/optionsMenu.cs new file mode 100644 index 000000000..3bc12b532 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/optionsMenu.cs @@ -0,0 +1,665 @@ +//options settings + +//Screen and Display menu +//Renderer Mode +//Screen resolution +//Windowed/fullscreen(borderless?) +//VSync + +//Screen brightness +//screen brightness +//screen gamma + +//Lighting Menu +//Shadow Distance(Distance shadows are drawn to. Also affects shadowmap slices) +//Shadow Quality(Resolution of shadows rendered, setting to none disables dynamic shadows) +//Soft Shadows(Whether shadow softening is used) +//Shadow caching(If the lights enable it, shadow caching is activated) +//Light Draw Distance(How far away lights are still drawn. Doesn't impact vector lights like the sun) + +//Mesh and Textures Menu +//Draw distance(Overall draw distance) -slider +//Object draw distance(Draw distance from small/unimportant objects) -slider +//Mesh quality +//Texture quality +//Foliage draw distance +//Terrain Quality +//Decal Quality + +//Effects Menu +//Parallax +//HDR +//Light shafts +//Motion Blur +//Depth of Field +//SSAO +//AA(ModelXAmount)[defualt is FXAA] +//Anisotropic filtering + +//Keybinds + +//Camera +//horizontal mouse sensitivity +//vert mouse sensitivity +//invert vertical +//zoom mouse sensitivities(both horz/vert) +//headbob +//FOV + +function OptionsMenu::onWake(%this) +{ + OptionsMain.hidden = false; + ControlsMenu.hidden = true; + GraphicsMenu.hidden = true; + AudioMenu.hidden = true; + CameraMenu.hidden = true; + ScreenBrightnessMenu.hidden = true; + + OptionsOKButton.hidden = false; + OptionsCancelButton.hidden = false; + OptionsDefaultsButton.hidden = false; + + OptionsMenu.tamlReader = new Taml(); + + OptionsSettingStack.clear(); + + %array = OptionsSettingStack; + %array.clear(); + + %keyboardMenuBtn = new GuiButtonCtrl(){ + text = "Keyboard and Mouse"; + profile = GuiMenuButtonProfile; + extent = %array.extent.x SPC "35"; + }; + + %controllerMenuBtn = new GuiButtonCtrl(){ + text = "Controller"; + profile = GuiMenuButtonProfile; + extent = %array.extent.x SPC "35"; + command="DisplayMenu::loadSettings();"; + }; + + %displayMenuBtn = new GuiButtonCtrl(){ + text = "Display"; + profile = GuiMenuButtonProfile; + extent = %array.extent.x SPC "35"; + command="DisplayMenu::loadSettings();"; + }; + + %graphicsMenuBtn = new GuiButtonCtrl(){ + text = "Graphics"; + profile = GuiMenuButtonProfile; + extent = %array.extent.x SPC "35"; + command="GraphicsMenu::loadSettings();"; + }; + + %audioMenuBtn = new GuiButtonCtrl(){ + text = "Audio"; + profile = GuiMenuButtonProfile; + extent = %array.extent.x SPC "35"; + command="AudioMenu::loadSettings();"; + }; + + %gameplayMenuBtn = new GuiButtonCtrl(){ + text = "Gameplay"; + profile = GuiMenuButtonProfile; + extent = %array.extent.x SPC "35"; + }; + + %array.add(%keyboardMenuBtn); + %array.add(%controllerMenuBtn); + %array.add(%displayMenuBtn); + %array.add(%graphicsMenuBtn); + %array.add(%audioMenuBtn); + %array.add(%gameplayMenuBtn); + + //We programmatically set up our settings here so we can do some prepwork on the fields/controls + //Presets + /*OptionsMenu.addSettingOption(%array, "Preset", "High", ShadowQualityList, $pref::Video::Resolution); + + //AA + OptionsMenu.addSettingOption(%array, "AntiAliasing", "FXAA 4x", ShadowQualityList, $pref::Video::Resolution); + + //Lighting + OptionsMenu.addSettingOption(%array, "Shadow Quality", "High", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Shadow Caching", "On", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Soft Shadows", "High", ShadowQualityList, $pref::Video::Resolution); + + //Models and Textures + OptionsMenu.addSettingOption(%array, "Level of Detail", "High", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Texture Quality", "High", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Material Quality", "High", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Terrain Detail", "High", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Decal Lifetime", "High", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Ground Clutter Density", "High", ShadowQualityList, $pref::Video::Resolution); + + //Effects + OptionsMenu.addSettingOption(%array, "HDR", "On", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Parallax", "On", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Ambient Occlusion", "On", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Light Rays", "On", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Depth of Field", "On", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Vignetting", "On", ShadowQualityList, $pref::Video::Resolution); + OptionsMenu.addSettingOption(%array, "Water Reflections", "On", ShadowQualityList, $pref::Video::Resolution); + + OptionsMenu.addSettingOption(%array, "Anisotropic Filtering", "16x", ShadowQualityList, $pref::Video::Resolution);*/ +} + +function OptionsMenuOKButton::onClick(%this) +{ + //save the settings and then back out + eval(OptionsMenu.currentMenu@"::apply();"); + OptionsMenu.backOut(); +} + +function OptionsMenuCancelButton::onClick(%this) +{ + //we don't save, so just back out of the menu + OptionsMenu.backOut(); +} + +function OptionsMenuDefaultsButton::onClick(%this) +{ + //we don't save, so go straight to backing out of the menu + eval(OptionsMenu.currentMenu@"::applyDefaults();"); + OptionsMenu.backOut(); +} + +function ControlsSettingsMenuButton::onClick(%this) +{ + OptionsMain.hidden = true; + ControlsMenu.hidden = false; + + KeyboardControlPanel.hidden = false; + MouseControlPanel.hidden = true; + + ControlsMenu.reload(); +} + +function GraphicsSettingsMenuButton::onClick(%this) +{ + OptionsMain.hidden = true; + GraphicsMenu.hidden = false; +} + +function CameraSettingsMenuButton::onClick(%this) +{ + OptionsMain.hidden = true; + CameraMenu.hidden = false; + + CameraMenu.loadSettings(); +} + +function AudioSettingsMenuButton::onClick(%this) +{ + OptionsMain.hidden = true; + AudioMenu.hidden = false; + AudioMenu.loadSettings(); +} + +function ScreenBrSettingsMenuButton::onClick(%this) +{ + OptionsMain.hidden = true; + ScreenBrightnessMenu.hidden = false; +} + +function OptionsMenu::backOut(%this) +{ + //save the settings and then back out + if(OptionsMain.hidden == false) + { + //we're not in a specific menu, so we're actually exiting + Canvas.popDialog(OptionsMenu); + + if(isObject(OptionsMenu.returnGui) && OptionsMenu.returnGui.isMethod("onReturnTo")) + OptionsMenu.returnGui.onReturnTo(); + } + else + { + OptionsMain.hidden = false; + ControlsMenu.hidden = true; + GraphicsMenu.hidden = true; + CameraMenu.hidden = true; + AudioMenu.hidden = true; + ScreenBrightnessMenu.hidden = true; + } +} + +function OptionsMenu::addSettingOption(%this, %arrayTarget, %optionName, %defaultValue, %settingsGroup, %targetVar) +{ + %option = TAMLRead("data/ui/guis/graphicsMenuSettingsCtrl.taml"); + + if(!isMethod(%settingsGroup, "get") || !isMethod(%settingsGroup, "set")) + { + error("OptionsMenu::addSettingsOption - unrecognized settings group of: " @ %settingsGroup @ ". Did not have proper getter/setter"); + return ""; + } + + %option-->nameText.text = %optionName; + %option-->SettingText.text = eval(%settingsGroup@"::"@"get();"); + %option.qualitySettingGroup = %settingsGroup; + %option.targetVar = %targetVar; + + %arrayTarget.add(%option); + + return %option; +} + +function OptionsMenu::addSliderOption(%this, %arrayTarget, %optionName, %variable, %range, %ticks, %value, %class) +{ + %option = TAMLRead("data/ui/guis/graphicsMenuSettingsSlider.taml"); + + %option-->nameText.text = %optionName; + + %arrayTarget.add(%option); + + if(%range !$= "") + { + %option-->slider.range = %range; + } + + if(%ticks !$= "") + { + %option-->slider.ticks = %ticks; + } + + if(%variable !$= "") + { + %option-->slider.variable = %variable; + } + + if(%value !$= "") + { + %option-->slider.setValue(%value); + } + + if(%class !$= "") + { + %option-->slider.className = %class; + } + else + %option-->slider.className = OptionsMenuSlider; + + %option-->slider.snap = true; + + %option-->slider.onValueSet(); + + return %option; +} + +function OptionsMenuSlider::onMouseDragged(%this) +{ + %this.onValueSet(); +} + +function OptionsMenuSlider::onValueSet(%this) +{ + %this.getParent().getParent()-->valueText.setText(mRound(%this.value * 10)); +} + +function FOVOptionSlider::onMouseDragged(%this) +{ + %this.onValueSet(); +} + +function FOVOptionSlider::onValueSet(%this) +{ + %this.getParent().getParent()-->valueText.setText(mRound(%this.value)); +} + +// +function OptionsMenuForwardSetting::onClick(%this) +{ + //we need to advance through the value list, unless it's the end, in which case we do nothing + echo("Move forward in the list!"); + + %settingCtrl = %this.getParent(); + %settingsList = eval(%settingCtrl.qualitySettingGroup@"::getList();"); + %settingsListCount = getTokenCount(%settingsList, ","); + %currentSetting = %settingCtrl-->SettingText.text; + + //We consider 'custom' to be the defacto end of the list. The only way back is to go lower + if(%currentSetting $= "Custom") + return; + + %currentSettingIdx = OptionsMenu.getCurrentIndexFromSetting(%settingCtrl); + + if(%currentSettingIdx != %settingsListCount-1) + { + %currentSettingIdx++; + + //advance by one + %newSetting = getToken(%settingsList, ",", %currentSettingIdx); + eval(%settingCtrl.qualitySettingGroup@"::set(\""@%newSetting@"\");"); + %settingCtrl-->SettingText.setText( %newSetting ); + + if(%currentSettingIdx == %settingsListCount) + { + //if we hit the end of the list, disable the forward button + } + } +} + +function OptionsMenuBackSetting::onClick(%this) +{ + //we need to advance through the value list, unless it's the end, in which case we do nothing + echo("Move back in the list!"); + + %settingCtrl = %this.getParent(); + %settingsList = eval(%settingCtrl.qualitySettingGroup@"::getList();"); + %settingsListCount = getTokenCount(%settingsList, ","); + %currentSetting = %settingCtrl-->SettingText.text; + + %currentSettingIdx = OptionsMenu.getCurrentIndexFromSetting(%settingCtrl); + + if(%currentSettingIdx != 0) + { + %currentSettingIdx--; + + //advance by one + %newSetting = getToken(%settingsList, ",", %currentSettingIdx); + eval(%settingCtrl.qualitySettingGroup@"::set("@%newSetting@");"); + %settingCtrl-->SettingText.setText( %newSetting ); + + if(%currentSettingIdx == %settingsListCount) + { + //if we hit the end of the list, disable the forward button + } + } +} + +function OptionsMenu::getCurrentIndexFromSetting(%this, %settingCtrl) +{ + %settingsList = eval(%settingCtrl.qualitySettingGroup@"::getList();"); + %settingsListCount = getTokenCount(%settingsList, ","); + %currentSetting = %settingCtrl-->SettingText.text; + + for ( %i=0; %i < %settingsListCount; %i++ ) + { + %level = getToken(%settingsList, ",", %i); + + //find our current level + if(%currentSetting $= %level) + { + return %i; + } + } + + return -1; +} + +// ============================================================================= +// CAMERA MENU +// ============================================================================= +function CameraMenu::onWake(%this) +{ + +} + +function CameraMenu::apply(%this) +{ + setFOV($pref::Player::defaultFov); +} + +function CameraMenu::loadSettings(%this) +{ + CameraMenuOptionsArray.clear(); + + %option = OptionsMenu.addSettingOption(CameraMenuOptionsArray); + %option-->nameText.setText("Invert Vertical"); + %option.qualitySettingGroup = InvertVerticalMouse; + %option.init(); + + %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::VertMouseSensitivity", $pref::Input::VertMouseSensitivity); + %option-->nameText.setText("Vertical Sensitivity"); + + %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::HorzMouseSensitivity", $pref::Input::HorzMouseSensitivity); + %option-->nameText.setText("Horizontal Sensitivity"); + + %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::ZoomVertMouseSensitivity", $pref::Input::ZoomVertMouseSensitivity); + %option-->nameText.setText("Zoom Vertical Sensitivity"); + + %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "0.1 1", 8, "$pref::Input::ZoomHorzMouseSensitivity", $pref::Input::ZoomHorzMouseSensitivity); + %option-->nameText.setText("Zoom Horizontal Sensitivity"); + + %option = OptionsMenu.addSliderOption(CameraMenuOptionsArray, "65 90", 25, "$pref::Player::defaultFov", $pref::Player::defaultFov, FOVOptionSlider); + %option-->nameText.setText("Field of View"); + + CameraMenuOptionsArray.refresh(); +} + +function CameraMenuOKButton::onClick(%this) +{ + //save the settings and then back out + CameraMenu.apply(); + OptionsMenu.backOut(); +} + +function CameraMenuDefaultsButton::onClick(%this) +{ + +} +// ============================================================================= +// AUDIO MENU +// ============================================================================= +$AudioTestHandle = 0; +// Description to use for playing the volume test sound. This isn't +// played with the description of the channel that has its volume changed +// because we know nothing about the playback state of the channel. If it +// is paused or stopped, the test sound would not play then. +$AudioTestDescription = new SFXDescription() +{ + sourceGroup = AudioChannelMaster; +}; + +function AudioMenu::loadSettings(%this) +{ + // Audio + //OptAudioHardwareToggle.setStateOn($pref::SFX::useHardware); + //OptAudioHardwareToggle.setActive( true ); + + %this-->OptAudioVolumeMaster.setValue( $pref::SFX::masterVolume ); + %this-->OptAudioVolumeShell.setValue( $pref::SFX::channelVolume[ $GuiAudioType] ); + %this-->OptAudioVolumeSim.setValue( $pref::SFX::channelVolume[ $SimAudioType ] ); + %this-->OptAudioVolumeMusic.setValue( $pref::SFX::channelVolume[ $MusicAudioType ] ); + + AudioMenuSoundDriver.clear(); + %buffer = sfxGetAvailableDevices(); + %count = getRecordCount( %buffer ); + for(%i = 0; %i < %count; %i++) + { + %record = getRecord(%buffer, %i); + %provider = getField(%record, 0); + + if ( AudioMenuSoundDriver.findText( %provider ) == -1 ) + AudioMenuSoundDriver.add( %provider, %i ); + } + + AudioMenuSoundDriver.sort(); + + %selId = AudioMenuSoundDriver.findText($pref::SFX::provider); + if ( %selId == -1 ) + AudioMenuSoundDriver.setFirstSelected(); + else + AudioMenuSoundDriver.setSelected( %selId ); +} + +function AudioMenu::loadDevices(%this) +{ + if(!isObject(SoundDeviceGroup)) + { + new SimGroup( SoundDeviceGroup ); + } + else + { + SoundDeviceGroup.clear(); + } + + %buffer = sfxGetAvailableDevices(); + %count = getRecordCount( %buffer ); + for (%i = 0; %i < %count; %i++) + { + %record = getRecord(%buffer, %i); + %provider = getField(%record, 0); + %device = getField(%record, 1); + + if($pref::SFX::provider !$= %provider) + continue; + + %setting = new ArrayObject() + { + class = "OptionsMenuSettingLevel"; + caseSensitive = true; + + displayName = %device; + + key["$pref::SFX::Device"] = %device; + }; + + SoundDeviceGroup.add(%setting); + } +} + +function AudioMenu::apply(%this) +{ + sfxSetMasterVolume( $pref::SFX::masterVolume ); + + sfxSetChannelVolume( $GuiAudioType, $pref::SFX::channelVolume[ $GuiAudioType ] ); + sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] ); + sfxSetChannelVolume( $MusicAudioType, $pref::SFX::channelVolume[ $MusicAudioType ] ); + + if ( !sfxCreateDevice( $pref::SFX::provider, + $pref::SFX::device, + $pref::SFX::useHardware, + -1 ) ) + error( "Unable to create SFX device: " @ $pref::SFX::provider + SPC $pref::SFX::device + SPC $pref::SFX::useHardware ); + + if( !isObject( $AudioTestHandle ) ) + { + sfxPlay(menuButtonPressed); + } +} + +function AudioMenuOKButton::onClick(%this) +{ + //save the settings and then back out + AudioMenu.apply(); + OptionsMenu.backOut(); +} + +function AudioMenuDefaultsButton::onClick(%this) +{ + sfxInit(); + AudioMenu.loadSettings(); +} + +function OptAudioUpdateMasterVolume( %volume ) +{ + if( %volume == $pref::SFX::masterVolume ) + return; + + sfxSetMasterVolume( %volume ); + $pref::SFX::masterVolume = %volume; + + if( !isObject( $AudioTestHandle ) ) + $AudioTestHandle = sfxPlayOnce( AudioChannel, "data/ui/sounds/volumeTest.wav" ); +} + +function OptAudioUpdateChannelVolume( %description, %volume ) +{ + %channel = sfxGroupToOldChannel( %description.sourceGroup ); + + if( %volume == $pref::SFX::channelVolume[ %channel ] ) + return; + + sfxSetChannelVolume( %channel, %volume ); + $pref::SFX::channelVolume[ %channel ] = %volume; + + if( !isObject( $AudioTestHandle ) ) + { + $AudioTestDescription.volume = %volume; + $AudioTestHandle = sfxPlayOnce( $AudioTestDescription, "data/ui/sounds/volumeTest.wav" ); + } +} + +function AudioMenuSoundDriver::onSelect( %this, %id, %text ) +{ + // Skip empty provider selections. + if ( %text $= "" ) + return; + + $pref::SFX::provider = %text; + AudioMenuSoundDevice.clear(); + + %buffer = sfxGetAvailableDevices(); + %count = getRecordCount( %buffer ); + for(%i = 0; %i < %count; %i++) + { + %record = getRecord(%buffer, %i); + %provider = getField(%record, 0); + %device = getField(%record, 1); + + if (%provider !$= %text) + continue; + + if ( AudioMenuSoundDevice.findText( %device ) == -1 ) + AudioMenuSoundDevice.add( %device, %i ); + } + + // Find the previous selected device. + %selId = AudioMenuSoundDevice.findText($pref::SFX::device); + if ( %selId == -1 ) + AudioMenuSoundDevice.setFirstSelected(); + else + AudioMenuSoundDevice.setSelected( %selId ); +} + +function AudioMenuSoundDevice::onSelect( %this, %id, %text ) +{ + // Skip empty selections. + if ( %text $= "" ) + return; + + $pref::SFX::device = %text; + + if ( !sfxCreateDevice( $pref::SFX::provider, + $pref::SFX::device, + $pref::SFX::useHardware, + -1 ) ) + error( "Unable to create SFX device: " @ $pref::SFX::provider + SPC $pref::SFX::device + SPC $pref::SFX::useHardware ); +} + +//============================================================================== +// DISPLAY MENU +//============================================================================== +function DisplayMenu::loadSettings() +{ + OptionsSettingStack.clear(); + + OptionsMenu.addSettingOption(OptionsSettingStack, "Resolution", "1024 x 768", "", $pref::Video::Resolution); + OptionsMenu.addSettingOption(OptionsSettingStack, "Full Screen", "Off", "", $pref::Video::FullScreen); + OptionsMenu.addSettingOption(OptionsSettingStack, "Refresh Rate", "60", "", $pref::Video::RefreshRate); + OptionsMenu.addSettingOption(OptionsSettingStack, "VSync", "Off", "", $pref::Video::Vsync); + + OptionsMenu.addSliderOption(OptionsSettingStack, "Field of View", $pref::Video::FOV, "65 120", 55, 75); + + OptionsMenu.addSliderOption(OptionsSettingStack, "Brightness", $pref::Video::Brightness, "0 1", 10, 5); + OptionsMenu.addSliderOption(OptionsSettingStack, "Contrast", $pref::Video::Contrast, "0 1", 10, 5); +} + +//============================================================================== +// AUDIO MENU +//============================================================================== +function AudioMenu::loadSettings() +{ + OptionsSettingStack.clear(); + + OptionsMenu.addSliderOption(OptionsSettingStack, "Master Volume", $pref::Video::Brightness, "0 1", 10, 5); + OptionsMenu.addSliderOption(OptionsSettingStack, "Menu Volume", $pref::Video::Brightness, "0 1", 10, 5); + OptionsMenu.addSliderOption(OptionsSettingStack, "Effects Volume", $pref::Video::Brightness, "0 1", 10, 5); + OptionsMenu.addSliderOption(OptionsSettingStack, "Music Volume", $pref::Video::Brightness, "0 1", 10, 5); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/guis/optionsMenu.gui b/Templates/BaseGame/game/data/ui/guis/optionsMenu.gui new file mode 100644 index 000000000..4f8f0eef7 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/optionsMenu.gui @@ -0,0 +1,247 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(OptionsMenu) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + returnGui = "MainMenuGui"; + tamlReader = "20077"; + tile = "0"; + useVariable = "0"; + + new GuiControl() { + position = "86 70"; + extent = "846 618"; + minExtent = "8 2"; + horizSizing = "center"; + vertSizing = "center"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "data/ui/images/hudfill.png"; + color = "255 255 255 255"; + wrap = "0"; + position = "0 0"; + extent = "846 618"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiControl() { + position = "0 0"; + extent = "846 20"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiBitmapCtrl() { + bitmap = "data/ui/images/hudfill.png"; + color = "255 255 255 255"; + wrap = "0"; + position = "0 0"; + extent = "846 20"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Options"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 0"; + extent = "846 20"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiScrollCtrl() { + willFirstRespond = "1"; + hScrollBar = "alwaysOff"; + vScrollBar = "dynamic"; + lockHorizScroll = "0"; + lockVertScroll = "0"; + constantThumbHeight = "0"; + childMargin = "0 0"; + mouseWheelScrollSpeed = "-1"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 25"; + extent = "846 522"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiScrollProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiStackControl(OptionsSettingStack) { + stackingType = "Vertical"; + horizStacking = "Left to Right"; + vertStacking = "Top to Bottom"; + padding = "0"; + dynamicSize = "1"; + dynamicNonStackExtent = "0"; + dynamicPos = "0"; + changeChildSizeToFit = "1"; + changeChildPosition = "1"; + position = "1 1"; + extent = "846 210"; + minExtent = "16 16"; + horizSizing = "width"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + new GuiMLTextCtrl() { + lineSpacing = "2"; + allowColorChars = "0"; + maxChars = "-1"; + text = "This is a test message to act as a tooltip for any selected options menus for more information on the given option."; + useURLMouseCursor = "0"; + position = "0 547"; + extent = "847 14"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "top"; + profile = "GuiMLWhiteTextProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + class="OptionsMenuOKButton"; + text = "OK"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "0 581"; + extent = "282 37"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "top"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + class="OptionsMenuDefaultsButton"; + text = "Defaults"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "282 581"; + extent = "282 37"; + minExtent = "8 2"; + horizSizing = "relative"; + vertSizing = "top"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl() { + class="OptionsMenuCancelButton"; + text = "Cancel"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "564 581"; + extent = "282 37"; + minExtent = "8 2"; + horizSizing = "left"; + vertSizing = "height"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/pauseMenu.cs b/Templates/BaseGame/game/data/ui/guis/pauseMenu.cs new file mode 100644 index 000000000..b23b423f0 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/pauseMenu.cs @@ -0,0 +1,30 @@ +function PauseMenu::onWake(%this) +{ + $timescale = 0; +} + +function PauseMenu::onSleep(%this) +{ + $timescale = 1; +} + +function PauseMenu::openOptionsMenu(%this) +{ + Canvas.pushDialog(OptionsMenu); + OptionsMenu.returnGui = %this; + PauseOptionsMain.hidden = true; +} + +function PauseMenu::openControlsMenu(%this) +{ + Canvas.pushDialog(OptionsMenu); + OptionsMenu.returnGui = %this; + PauseOptionsMain.hidden = true; + OptionsMain.hidden = true; + ControlsMenu.hidden = false; +} + +function PauseMenu::onReturnTo(%this) +{ + PauseOptionsMain.hidden = false; +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/guis/pauseMenu.gui b/Templates/BaseGame/game/data/ui/guis/pauseMenu.gui new file mode 100644 index 000000000..b59f13221 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/pauseMenu.gui @@ -0,0 +1,153 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(PauseMenu) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + tamlReader = "19772"; + tile = "0"; + useVariable = "0"; + + new GuiChunkedBitmapCtrl(PauseMenuBG) { + bitmap = "data/ui/images/hudfill"; + useVariable = "0"; + tile = "0"; + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + }; + new GuiControl() { + position = "155 118"; + extent = "700 518"; + minExtent = "8 2"; + horizSizing = "center"; + vertSizing = "center"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiControl(PauseOptionsMain) { + position = "1 1"; + extent = "700 320"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "center"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiButtonCtrl(PauseMenuExitButton) { + text = "Exit Game"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "0 0"; + extent = "700 35"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "escapeFromGame();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(PauseMenuOptionsButton) { + text = "Options"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "0 35"; + extent = "700 35"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "PauseMenu.openOptionsMenu();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(PauseMenuControlsButton) { + text = "Controls"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "0 70"; + extent = "700 35"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "PauseMenu.openControlsMenu();"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(PauseMenuCancelButton) { + text = "Cancel"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "1"; + position = "466 285"; + extent = "233 35"; + minExtent = "8 8"; + horizSizing = "relative"; + vertSizing = "bottom"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog();"; + accelerator = "escape"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + class = "OptionsMenuDefaultsButton"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/profiler.cs b/Templates/BaseGame/game/data/ui/guis/profiler.cs new file mode 100644 index 000000000..bc73338bf --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/profiler.cs @@ -0,0 +1,367 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +$MetricsParamArray[0] = "fps "; +$MetricsParamArray[1] = "shadow "; +$MetricsParamArray[2] = "gfx "; +$MetricsParamArray[3] = "sfx "; +$MetricsParamArray[4] = "terrain "; +$MetricsParamArray[5] = "groundcover "; +$MetricsParamArray[6] = "forest "; +$MetricsParamArray[7] = "net "; +$EnableProfiler = false; +$string = ""; //string used to collet the parameters for metrics function + +function showMetrics(%var) +{ + $string = ""; + if(ppShowFps.getValue()) + { + $string = $string @ $MetricsParamArray[0]; + } + if(ppShowShadow.getValue()) + { + $string = $string @ $MetricsParamArray[1]; + } + if(ppShowGfx.getValue()) + { + $string = $string @ $MetricsParamArray[2]; + } + if(ppShowSfx.getValue()) + { + $string = $string @ $MetricsParamArray[3]; + } + if(ppShowTerrain.getValue()) + { + $string = $string @ $MetricsParamArray[4]; + } + if(ppShowForest.getValue()) + { + $string = $string @ $MetricsParamArray[5]; + } + if(ppShowGroundcover.getValue()) + { + $string = $string @ $MetricsParamArray[6]; + } + if(ppShowNet.getValue()) + { + $string = $string @ $MetricsParamArray[7]; + } + + if(%var) + { + $EnableProfiler = !($EnableProfiler); + + if($EnableProfiler) + { + metrics($string); + } + else if((false == $EnableProfiler)) + { + metrics(); + } + } + else if($EnableProfiler) //will enter only when the enable/disable button was pressed + { + metrics($string); + } +} + +function showMetics(%var) +{ + if(%var) + { + metrics($string); + } + else if(true == $EnableProfiler) + { + $EnableProfiler = false; + metrics(); + } +} + +GlobalActionMap.bind(keyboard, "ctrl F2", showMetics); + +%guiContent = new GuiControl(FrameOverlayGui) { + profile = "GuiModelessDialogProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "0 0"; + extent = "640 480"; + minExtent = "8 8"; + visible = "True"; + setFirstResponder = "True"; + modal = "false"; + helpTag = "0"; + noCursor = true; + new GuiConsoleTextCtrl(TextOverlayControl) { + profile = "GuiConsoleTextProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "5 5"; + extent = "130 18"; + minExtent = "4 4"; + visible = "True"; + setFirstResponder = "True"; + modal = "True"; + helpTag = "0"; + expression = "10"; + command = "Canvas.popDialog(FrameOverlayGui);"; + accelerator = "escape"; + }; +}; + +// Note: To implement your own metrics overlay +// just add a function with a name in the form +// XXXXMetricsCallback which can be enabled via +// metrics( XXXX ) + +function fpsMetricsCallback() +{ + return " | FPS |" @ + " " @ $fps::real @ + " max: " @ $fps::realMax @ + " min: " @ $fps::realMin @ + " mspf: " @ 1000 / $fps::real; +} + +function gfxMetricsCallback() +{ + return " | GFX |" @ + " PolyCount: " @ $GFXDeviceStatistics::polyCount @ + " DrawCalls: " @ $GFXDeviceStatistics::drawCalls @ + " RTChanges: " @ $GFXDeviceStatistics::renderTargetChanges; + +} + +function terrainMetricsCallback() +{ + return " | Terrain |" @ + " Cells: " @ $TerrainBlock::cellsRendered @ + " Override Cells: " @ $TerrainBlock::overrideCells @ + " DrawCalls: " @ $TerrainBlock::drawCalls; +} + +function netMetricsCallback() +{ + return " | Net |" @ + " BitsSent: " @ $Stats::netBitsSent @ + " BitsRcvd: " @ $Stats::netBitsReceived @ + " GhostUpd: " @ $Stats::netGhostUpdates; +} + +function groundCoverMetricsCallback() +{ + return " | GroundCover |" @ + " Cells: " @ $GroundCover::renderedCells @ + " Billboards: " @ $GroundCover::renderedBillboards @ + " Batches: " @ $GroundCover::renderedBatches @ + " Shapes: " @ $GroundCover::renderedShapes; +} + +function forestMetricsCallback() +{ + return " | Forest |" @ + " Cells: " @ $Forest::totalCells @ + " Cells Meshed: " @ $Forest::cellsRendered @ + " Cells Billboarded: " @ $Forest::cellsBatched @ + " Meshes: " @ $Forest::cellItemsRendered @ + " Billboards: " @ $Forest::cellItemsBatched; +} + +function sfxMetricsCallback() +{ + return " | SFX |" @ + " Sounds: " @ $SFX::numSounds @ + " Lists: " @ ( $SFX::numSources - $SFX::numSounds - $SFX::Device::fmodNumEventSource ) @ + " Events: " @ $SFX::fmodNumEventSources @ + " Playing: " @ $SFX::numPlaying @ + " Culled: " @ $SFX::numCulled @ + " Voices: " @ $SFX::numVoices @ + " Buffers: " @ $SFX::Device::numBuffers @ + " Memory: " @ ( $SFX::Device::numBufferBytes / 1024.0 / 1024.0 ) @ " MB" @ + " Time/S: " @ $SFX::sourceUpdateTime @ + " Time/P: " @ $SFX::parameterUpdateTime @ + " Time/A: " @ $SFX::ambientUpdateTime; +} + +function sfxSourcesMetricsCallback() +{ + return sfxDumpSourcesToString(); +} + +function sfxStatesMetricsCallback() +{ + return " | SFXStates |" @ sfxGetActiveStates(); +} + +function timeMetricsCallback() +{ + return " | Time |" @ + " Sim Time: " @ getSimTime() @ + " Mod: " @ getSimTime() % 32; +} + +function reflectMetricsCallback() +{ + return " | REFLECT |" @ + " Objects: " @ $Reflect::numObjects @ + " Visible: " @ $Reflect::numVisible @ + " Occluded: " @ $Reflect::numOccluded @ + " Updated: " @ $Reflect::numUpdated @ + " Elapsed: " @ $Reflect::elapsed NL + + " Allocated: " @ $Reflect::renderTargetsAllocated @ + " Pooled: " @ $Reflect::poolSize NL + + " " @ getWord( $Reflect::textureStats, 1 ) TAB + " " @ getWord( $Reflect::textureStats, 2 ) @ "MB" TAB + " " @ getWord( $Reflect::textureStats, 0 ); +} + +function decalMetricsCallback() +{ + return " | DECAL |" @ + " Batches: " @ $Decal::Batches @ + " Buffers: " @ $Decal::Buffers @ + " DecalsRendered: " @ $Decal::DecalsRendered; +} + +function renderMetricsCallback() +{ + return " | Render |" @ + " Mesh: " @ $RenderMetrics::RIT_Mesh @ + " MeshDL: " @ $RenderMetrics::RIT_MeshDynamicLighting @ + " Shadow: " @ $RenderMetrics::RIT_Shadow @ + " Sky: " @ $RenderMetrics::RIT_Sky @ + " Obj: " @ $RenderMetrics::RIT_Object @ + " ObjT: " @ $RenderMetrics::RIT_ObjectTranslucent @ + " Decal: " @ $RenderMetrics::RIT_Decal @ + " Water: " @ $RenderMetrics::RIT_Water @ + " Foliage: " @ $RenderMetrics::RIT_Foliage @ + " Trans: " @ $RenderMetris::RIT_Translucent @ + " Custom: " @ $RenderMetrics::RIT_Custom; +} + +function shadowMetricsCallback() +{ + return " | Shadow |" @ + " Active: " @ $ShadowStats::activeMaps @ + " Updated: " @ $ShadowStats::updatedMaps @ + " PolyCount: " @ $ShadowStats::polyCount @ + " DrawCalls: " @ $ShadowStats::drawCalls @ + " RTChanges: " @ $ShadowStats::rtChanges @ + " PoolTexCount: " @ $ShadowStats::poolTexCount @ + " PoolTexMB: " @ $ShadowStats::poolTexMemory @ "MB"; +} + +function basicShadowMetricsCallback() +{ + return " | Shadow |" @ + " Active: " @ $BasicLightManagerStats::activePlugins @ + " Updated: " @ $BasicLightManagerStats::shadowsUpdated @ + " Elapsed Ms: " @ $BasicLightManagerStats::elapsedUpdateMs; +} + +function lightMetricsCallback() +{ + return " | Deferred Lights |" @ + " Active: " @ $lightMetrics::activeLights @ + " Culled: " @ $lightMetrics::culledLights; +} + +function particleMetricsCallback() +{ + return " | Particles |" @ + " # Simulated " @ $particle::numSimulated; +} +function partMetricsCallback() +{ + return particleMetricsCallback(); +} + +function imposterMetricsCallback() +{ + return " | IMPOSTER |" @ + " Rendered: " @ $ImposterStats::rendered @ + " Batches: " @ $ImposterStats::batches @ + " DrawCalls: " @ $ImposterStats::drawCalls @ + " Polys: " @ $ImposterStats::polyCount @ + " RtChanges: " @ $ImposterStats::rtChanges; +} + +// alias +function audioMetricsCallback() +{ + return sfxMetricsCallback(); +} + +// alias +function videoMetricsCallback() +{ + return gfxMetricsCallback(); +} + +// Add a metrics HUD. %expr can be a vector of names where each element +// must have a corresponding 'MetricsCallback()' function defined +// that will be called on each update of the GUI control. The results +// of each function are stringed together. +// +// Example: metrics( "fps gfx" ); + +function metrics( %expr ) +{ + %metricsExpr = ""; + if( %expr !$= "" ) + { + for( %i = 0;; %i ++ ) + { + %name = getWord( %expr, %i ); + if( %name $= "" ) + break; + else + { + %cb = %name @ "MetricsCallback"; + if( !isFunction( %cb ) ) + error( "metrics - undefined callback: " @ %cb ); + else + { + %cb = %cb @ "()"; + if( %i > 0 ) + %metricsExpr = %metricsExpr @ " NL "; + %metricsExpr = %metricsExpr @ %cb; + } + } + } + + if( %metricsExpr !$= "" ) + %metricsExpr = %metricsExpr @ " @ \" \""; + } + + if( %metricsExpr !$= "" ) + { + $GameCanvas.pushDialog( FrameOverlayGui, 1000 ); + TextOverlayControl.setValue( %metricsExpr ); + } + else + $GameCanvas.popDialog(FrameOverlayGui); +} \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/guis/profiler.gui b/Templates/BaseGame/game/data/ui/guis/profiler.gui new file mode 100644 index 000000000..46628c6df --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/profiler.gui @@ -0,0 +1,324 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(ProfilerGui) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + + new GuiWindowCtrl(ppProfilerWindow) { + text = "Profiler Manager"; + resizeWidth = "0"; + resizeHeight = "0"; + canMove = "1"; + canClose = "1"; + canMinimize = "0"; + canMaximize = "0"; + canCollapse = "0"; + closeCommand = "Canvas.popDialog(ProfilerGui);"; + edgeSnap = "0"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "306 216"; + extent = "415 199"; + minExtent = "8 8"; + horizSizing = "center"; + vertSizing = "center"; + profile = "GuiWindowProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiCheckBoxCtrl(ppShowFps) { + text = "Show Fps"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "13 24"; + extent = "127 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Enable or Disable the Fps counter"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl(ppShowGfx) { + text = "Show Gfx"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "13 40"; + extent = "127 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Enable or Disable the Gfx"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl(ppShowShadow) { + text = "Show Shadow"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "13 56"; + extent = "127 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Enable or Disable the Shdow"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl(ppShowNet) { + text = "Show Net"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "13 136"; + extent = "127 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Enable or Disable the Network activity"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl(ppShowForest) { + text = "Show Forest"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "13 120"; + extent = "127 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Enable or Disable the Forest"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl(ppShowGroundcover) { + text = "Show Groundcover"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "13 104"; + extent = "127 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Enable or Disable the Groundcover"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl(ppShowTerrain) { + text = "Show Terrain"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "13 88"; + extent = "127 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Enable or Disable the Terrain"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiCheckBoxCtrl(ppShowSfx) { + text = "Show Sfx"; + groupNum = "-1"; + buttonType = "ToggleButton"; + useMouseEvents = "0"; + position = "13 72"; + extent = "127 30"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiCheckBoxProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Enable or Disable the Sfx"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(ppOptionsEnableDisable) { + text = "On/Off OSD"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "309 38"; + extent = "93 23"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + command = "showMetrics(true);"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Apply the setting from the dialog box"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(ppOptionsUpdate) { + text = "Update"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "200 38"; + extent = "93 23"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + command = "showMetrics(false);"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Update the profiler with the new parameters"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(ppOptionsDoProfiling) { + text = "DoProfiling"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "309 141"; + extent = "93 23"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiButtonProfile"; + visible = "1"; + active = "1"; + command = "doProfileFromGui();"; + tooltipProfile = "GuiToolTipProfile"; + tooltip = "Does the profile for the ammount of time specified "; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(DurationLabel) { + text = "Duration[ms]"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "200 144"; + extent = "39 21"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextRightProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextEditCtrl(Duration) { + historySize = "0"; + tabComplete = "0"; + sinkAllKeyEvents = "0"; + password = "0"; + passwordMask = "*"; + text = "1000"; + maxLength = "1024"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "249 144"; + extent = "53 18"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiTextEditProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/remapConfirmDlg.gui b/Templates/BaseGame/game/data/ui/guis/remapConfirmDlg.gui new file mode 100644 index 000000000..6e32fd1ec --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/remapConfirmDlg.gui @@ -0,0 +1,125 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(RemapConfirmDlg) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + helpTag = "0"; + + new GuiContainer(RemapConfirmationPanel) { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "168 352"; + extent = "700 64"; + minExtent = "8 2"; + horizSizing = "center"; + vertSizing = "center"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiChunkedBitmapCtrl() { + bitmap = "data/ui/images/hudfill.png"; + useVariable = "0"; + tile = "0"; + position = "0 0"; + extent = "700 64"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl(RemapConfirmationText) { + text = "\"m\" is already bound to \"Forward\"!\nDo you wish to replace this mapping?"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "0 8"; + extent = "700 20"; + minExtent = "8 8"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + accelerator = "return"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(RemapConfirmationYesButton) { + text = "Yes"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "270 36"; + extent = "80 22"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "top"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "ControlsMenu.redoMapping(keyboard, \"m\", \"jump\", 0, 4); Canvas.popDialog();"; + accelerator = "return"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiButtonCtrl(RemapConfirmationNoButton) { + text = "No"; + groupNum = "-1"; + buttonType = "PushButton"; + useMouseEvents = "0"; + position = "367 36"; + extent = "80 22"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "top"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + command = "Canvas.popDialog();"; + accelerator = "escape"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/remapDlg.gui b/Templates/BaseGame/game/data/ui/guis/remapDlg.gui new file mode 100644 index 000000000..71832d81c --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/remapDlg.gui @@ -0,0 +1,122 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiControl(RemapDlg) { + position = "0 0"; + extent = "1024 768"; + minExtent = "8 8"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "1"; + helpTag = "0"; + + new GuiContainer(RemapPanel) { + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "162 352"; + extent = "700 64"; + minExtent = "8 2"; + horizSizing = "center"; + vertSizing = "center"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + + new GuiInputCtrl(OptRemapInputCtrl) { + lockMouse = "0"; + position = "480 0"; + extent = "64 64"; + minExtent = "8 8"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiInputCtrlProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiChunkedBitmapCtrl() { + bitmap = "data/ui/images/hudfill.png"; + useVariable = "0"; + tile = "0"; + position = "0 0"; + extent = "700 64"; + minExtent = "8 2"; + horizSizing = "right"; + vertSizing = "bottom"; + profile = "GuiDefaultProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "0"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Press escape to cancel"; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "247 34"; + extent = "242 20"; + minExtent = "8 8"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + new GuiTextCtrl() { + text = "Re-bind \"\" to..."; + maxLength = "255"; + margin = "0 0 0 0"; + padding = "0 0 0 0"; + anchorTop = "1"; + anchorBottom = "0"; + anchorLeft = "1"; + anchorRight = "0"; + position = "177 8"; + extent = "384 20"; + minExtent = "8 8"; + horizSizing = "width"; + vertSizing = "height"; + profile = "GuiMenuButtonProfile"; + visible = "1"; + active = "1"; + tooltipProfile = "GuiToolTipProfile"; + hovertime = "1000"; + isContainer = "1"; + internalName = "OptRemapText"; + canSave = "1"; + canSaveDynamicFields = "0"; + }; + }; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/guis/startupGui.cs b/Templates/BaseGame/game/data/ui/guis/startupGui.cs new file mode 100644 index 000000000..e8252ce44 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/startupGui.cs @@ -0,0 +1,157 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +//----------------------------------------------------------------------------- +// StartupGui is the splash screen that initially shows when the game is loaded +//----------------------------------------------------------------------------- + +function loadStartup() +{ + // The index of the current splash screen + $StartupIdx = 0; + + // A list of the splash screens and logos + // to cycle through. Note that they have to + // be in consecutive numerical order + StartupGui.bitmap[0] = "data/ui/images/background-dark"; + StartupGui.logo[0] = "data/ui/images/Torque-3D-logo"; + StartupGui.logoPos[0] = "178 251"; + StartupGui.logoExtent[0] = "443 139"; + + // Call the next() function to set our firt + // splash screen + StartupGui.next(); + + // Play our startup sound + //SFXPlayOnce(AudioGui, "data/ui/sounds/startup");//SFXPlay(startsnd); +} + +function StartupGui::onWake(%this) +{ + $enableDirectInput = "1"; + activateDirectInput(); +} + +function StartupGui::click(%this) +{ + %this.done = true; + %this.onDone(); +} + +function StartupGui::next(%this) +{ + // Set us to a blank screen while we load the next one + Canvas.setContent(BlankGui); + + // Set our bitmap and reset the done variable + %this.setBitmap(%this.bitmap[$StartupIdx]); + %this.done = false; + + // If we have a logo then set it + if (isObject(%this->StartupLogo)) + { + if (%this.logo[$StartupIdx] !$= "") + { + %this->StartupLogo.setBitmap(%this.logo[$StartupIdx]); + + if (%this.logoPos[$StartupIdx] !$= "") + { + %logoPosX = getWord(%this.logoPos[$StartupIdx], 0); + %logoPosY = getWord(%this.logoPos[$StartupIdx], 1); + + %this->StartupLogo.setPosition(%logoPosX, %logoPosY); + } + + if (%this.logoExtent[$StartupIdx] !$= "") + %this->StartupLogo.setExtent(%this.logoExtent[$StartupIdx]); + + %this->StartupLogo.setVisible(true); + } + else + %this->StartupLogo.setVisible(false); + } + + // If we have a secondary logo then set it + if (isObject(%this->StartupLogoSecondary)) + { + if (%this.seclogo[$StartupIdx] !$= "") + { + %this->StartupLogoSecondary.setBitmap(%this.seclogo[$StartupIdx]); + + if (%this.seclogoPos[$StartupIdx] !$= "") + { + %logoPosX = getWord(%this.seclogoPos[$StartupIdx], 0); + %logoPosY = getWord(%this.seclogoPos[$StartupIdx], 1); + + %this->StartupLogoSecondary.setPosition(%logoPosX, %logoPosY); + } + + if (%this.seclogoExtent[$StartupIdx] !$= "") + %this->StartupLogoSecondary.setExtent(%this.seclogoExtent[$StartupIdx]); + + %this->StartupLogoSecondary.setVisible(true); + } + else + %this->StartupLogoSecondary.setVisible(false); + } + + // Increment our screen index for the next screen + $StartupIdx++; + + // Set the Canvas to our newly updated GuiFadeinBitmapCtrl + Canvas.setContent(%this); +} + +function StartupGui::onDone(%this) +{ + // If we have been tagged as done decide if we need + // to end or cycle to the next one + if (%this.done) + { + // See if we have a valid bitmap for the next screen + if (%this.bitmap[$StartupIdx] $= "") + { + // Clear our data and load the main menu + %this.done = true; + + // NOTE: Don't ever ever delete yourself during a callback from C++. + // + // Deleting the whole gui itself seems a bit excessive, what if we want + // to return to the startup gui at a later time? Any bitmaps set on + // the controls should be unloaded automatically if the control is not + // awake, if this is not the case then that's what needs to be fixed. + + //%this.delete(); + //BlankGui.delete(); + //flushTextureCache(); + + %mainMenuGUI = ProjectSettings.value("UI/mainMenuName"); + if (isObject( %mainMenuGUI )) + Canvas.setContent( %mainMenuGUI ); + } + else + { + // We do have a bitmap so cycle to it + %this.next(); + } + } +} diff --git a/Templates/BaseGame/game/data/ui/guis/startupGui.gui b/Templates/BaseGame/game/data/ui/guis/startupGui.gui new file mode 100644 index 000000000..ad7afcf63 --- /dev/null +++ b/Templates/BaseGame/game/data/ui/guis/startupGui.gui @@ -0,0 +1,79 @@ +//--- OBJECT WRITE BEGIN --- +%guiContent = new GuiFadeinBitmapCtrl(StartupGui) { + canSaveDynamicFields = "0"; + Enabled = "1"; + isContainer = "1"; + Profile = "GuiInputCtrlProfile"; + HorizSizing = "right"; + VertSizing = "bottom"; + position = "0 0"; + Extent = "800 600"; + MinExtent = "8 8"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + bitmap = ""; + wrap = "0"; + fadeinTime = "1000"; + waitTime = "4000"; + fadeoutTime = "1000"; + done = "1"; + + new GuiBitmapButtonCtrl() { + canSaveDynamicFields = "1"; + internalName = "StartupLogo"; + Enabled = "1"; + isContainer = "0"; + Profile = "GuiDefaultProfile"; + HorizSizing = "center"; + VertSizing = "center"; + position = "399 302"; + Extent = "253 253"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + bitmap = ""; + wrap = "0"; + command = "StartupGui.click();"; + }; + new GuiBitmapButtonCtrl() { + canSaveDynamicFields = "1"; + internalName = "StartupLogoSecondary"; + Enabled = "1"; + isContainer = "0"; + Profile = "GuiDefaultProfile"; + HorizSizing = "left"; + VertSizing = "top"; + position = "275 440"; + Extent = "530 171"; + MinExtent = "8 2"; + canSave = "1"; + Visible = "1"; + tooltipprofile = "GuiToolTipProfile"; + hovertime = "1000"; + bitmap = ""; + wrap = "0"; + command = "StartupGui.click();"; + }; +}; +//--- OBJECT WRITE END --- +//--- OBJECT WRITE BEGIN --- +new GuiFadeinBitmapCtrl(BlankGui) { + profile = "GuiInputCtrlProfile"; + horizSizing = "right"; + vertSizing = "bottom"; + position = "0 0"; + extent = "800 600"; + minExtent = "8 8"; + visible = "1"; + helpTag = "0"; + bitmap = ""; + wrap = "0"; + fadeinTime = "100"; + waitTime = "2000"; + fadeoutTime = "100"; +}; +//--- OBJECT WRITE END --- diff --git a/Templates/BaseGame/game/data/ui/images/BackgroundImage.png b/Templates/BaseGame/game/data/ui/images/BackgroundImage.png new file mode 100644 index 000000000..d35403338 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/BackgroundImage.png differ diff --git a/Templates/BaseGame/game/data/ui/images/ScreenBrightness_Dark.png b/Templates/BaseGame/game/data/ui/images/ScreenBrightness_Dark.png new file mode 100644 index 000000000..85cde0bbc Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/ScreenBrightness_Dark.png differ diff --git a/Templates/BaseGame/game/data/ui/images/ScreenBrightness_Light.png b/Templates/BaseGame/game/data/ui/images/ScreenBrightness_Light.png new file mode 100644 index 000000000..6c16b7e44 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/ScreenBrightness_Light.png differ diff --git a/Templates/BaseGame/game/data/ui/images/Torque-3D-logo-shortcut.png b/Templates/BaseGame/game/data/ui/images/Torque-3D-logo-shortcut.png new file mode 100644 index 000000000..d993d4893 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/Torque-3D-logo-shortcut.png differ diff --git a/Templates/BaseGame/game/data/ui/images/Torque-3D-logo-w.png b/Templates/BaseGame/game/data/ui/images/Torque-3D-logo-w.png new file mode 100644 index 000000000..ec197dda3 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/Torque-3D-logo-w.png differ diff --git a/Templates/BaseGame/game/data/ui/images/Torque-3D-logo.png b/Templates/BaseGame/game/data/ui/images/Torque-3D-logo.png new file mode 100644 index 000000000..e31d42a68 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/Torque-3D-logo.png differ diff --git a/Templates/BaseGame/game/data/ui/images/Torque-3D-logo_alt.png b/Templates/BaseGame/game/data/ui/images/Torque-3D-logo_alt.png new file mode 100644 index 000000000..3836f1e7f Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/Torque-3D-logo_alt.png differ diff --git a/Templates/BaseGame/game/data/ui/images/background-dark.png b/Templates/BaseGame/game/data/ui/images/background-dark.png new file mode 100644 index 000000000..fedbcfc93 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/background-dark.png differ diff --git a/Templates/BaseGame/game/data/ui/images/background.png b/Templates/BaseGame/game/data/ui/images/background.png new file mode 100644 index 000000000..9444659f3 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/background.png differ diff --git a/Templates/BaseGame/game/data/ui/images/buttontab.png b/Templates/BaseGame/game/data/ui/images/buttontab.png new file mode 100644 index 000000000..047b88645 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/buttontab.png differ diff --git a/Templates/BaseGame/game/data/ui/images/chatHudBorderArray.png b/Templates/BaseGame/game/data/ui/images/chatHudBorderArray.png new file mode 100644 index 000000000..1aebdb2d8 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/chatHudBorderArray.png differ diff --git a/Templates/BaseGame/game/data/ui/images/checkbox.png b/Templates/BaseGame/game/data/ui/images/checkbox.png new file mode 100644 index 000000000..46e0ac959 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/checkbox.png differ diff --git a/Templates/BaseGame/game/data/ui/images/clear-btn_d.png b/Templates/BaseGame/game/data/ui/images/clear-btn_d.png new file mode 100644 index 000000000..229c71e8b Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/clear-btn_d.png differ diff --git a/Templates/BaseGame/game/data/ui/images/clear-btn_h.png b/Templates/BaseGame/game/data/ui/images/clear-btn_h.png new file mode 100644 index 000000000..5e67cb13b Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/clear-btn_h.png differ diff --git a/Templates/BaseGame/game/data/ui/images/clear-btn_n.png b/Templates/BaseGame/game/data/ui/images/clear-btn_n.png new file mode 100644 index 000000000..ecb13a8d6 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/clear-btn_n.png differ diff --git a/Templates/BaseGame/game/data/ui/images/collapse-toolbar_d.png b/Templates/BaseGame/game/data/ui/images/collapse-toolbar_d.png new file mode 100644 index 000000000..984a63853 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/collapse-toolbar_d.png differ diff --git a/Templates/BaseGame/game/data/ui/images/collapse-toolbar_h.png b/Templates/BaseGame/game/data/ui/images/collapse-toolbar_h.png new file mode 100644 index 000000000..7e3de8387 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/collapse-toolbar_h.png differ diff --git a/Templates/BaseGame/game/data/ui/images/collapse-toolbar_n.png b/Templates/BaseGame/game/data/ui/images/collapse-toolbar_n.png new file mode 100644 index 000000000..b36de3ae0 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/collapse-toolbar_n.png differ diff --git a/Templates/BaseGame/game/data/ui/images/defaultCursor.png b/Templates/BaseGame/game/data/ui/images/defaultCursor.png new file mode 100644 index 000000000..ee03cd483 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/defaultCursor.png differ diff --git a/Templates/BaseGame/game/data/ui/images/dropDown.png b/Templates/BaseGame/game/data/ui/images/dropDown.png new file mode 100644 index 000000000..9b7414acc Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/dropDown.png differ diff --git a/Templates/BaseGame/game/data/ui/images/dropdown-button-arrow.png b/Templates/BaseGame/game/data/ui/images/dropdown-button-arrow.png new file mode 100644 index 000000000..8c420ab85 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/dropdown-button-arrow.png differ diff --git a/Templates/BaseGame/game/data/ui/images/dropdown-textEdit.png b/Templates/BaseGame/game/data/ui/images/dropdown-textEdit.png new file mode 100644 index 000000000..3966efbb5 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/dropdown-textEdit.png differ diff --git a/Templates/BaseGame/game/data/ui/images/dropslider_d.png b/Templates/BaseGame/game/data/ui/images/dropslider_d.png new file mode 100644 index 000000000..0c65347aa Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/dropslider_d.png differ diff --git a/Templates/BaseGame/game/data/ui/images/dropslider_h.png b/Templates/BaseGame/game/data/ui/images/dropslider_h.png new file mode 100644 index 000000000..bd2cb89d8 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/dropslider_h.png differ diff --git a/Templates/BaseGame/game/data/ui/images/dropslider_n.png b/Templates/BaseGame/game/data/ui/images/dropslider_n.png new file mode 100644 index 000000000..a4577f9ea Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/dropslider_n.png differ diff --git a/Templates/BaseGame/game/data/ui/images/expand-toolbar_d.png b/Templates/BaseGame/game/data/ui/images/expand-toolbar_d.png new file mode 100644 index 000000000..462929e95 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/expand-toolbar_d.png differ diff --git a/Templates/BaseGame/game/data/ui/images/expand-toolbar_h.png b/Templates/BaseGame/game/data/ui/images/expand-toolbar_h.png new file mode 100644 index 000000000..c33bcad69 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/expand-toolbar_h.png differ diff --git a/Templates/BaseGame/game/data/ui/images/expand-toolbar_n.png b/Templates/BaseGame/game/data/ui/images/expand-toolbar_n.png new file mode 100644 index 000000000..0af2f1bd1 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/expand-toolbar_n.png differ diff --git a/Templates/BaseGame/game/data/ui/images/folder.png b/Templates/BaseGame/game/data/ui/images/folder.png new file mode 100644 index 000000000..571a904d0 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/folder.png differ diff --git a/Templates/BaseGame/game/data/ui/images/group-border.png b/Templates/BaseGame/game/data/ui/images/group-border.png new file mode 100644 index 000000000..61234ae1f Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/group-border.png differ diff --git a/Templates/BaseGame/game/data/ui/images/hudfill.png b/Templates/BaseGame/game/data/ui/images/hudfill.png new file mode 100644 index 000000000..57d72468b Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/hudfill.png differ diff --git a/Templates/BaseGame/game/data/ui/images/inactive-overlay.png b/Templates/BaseGame/game/data/ui/images/inactive-overlay.png new file mode 100644 index 000000000..feab83209 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/inactive-overlay.png differ diff --git a/Templates/BaseGame/game/data/ui/images/lagIcon.png b/Templates/BaseGame/game/data/ui/images/lagIcon.png new file mode 100644 index 000000000..cf158dd65 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/lagIcon.png differ diff --git a/Templates/BaseGame/game/data/ui/images/loadingbar.png b/Templates/BaseGame/game/data/ui/images/loadingbar.png new file mode 100644 index 000000000..34f594403 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/loadingbar.png differ diff --git a/Templates/BaseGame/game/data/ui/images/macCursor.png b/Templates/BaseGame/game/data/ui/images/macCursor.png new file mode 100644 index 000000000..22c444970 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/macCursor.png differ diff --git a/Templates/BaseGame/game/data/ui/images/menu-button.png b/Templates/BaseGame/game/data/ui/images/menu-button.png new file mode 100644 index 000000000..9964e0e69 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/menu-button.png differ diff --git a/Templates/BaseGame/game/data/ui/images/menu.png b/Templates/BaseGame/game/data/ui/images/menu.png new file mode 100644 index 000000000..2b7a33f58 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/menu.png differ diff --git a/Templates/BaseGame/game/data/ui/images/menuSlider.png b/Templates/BaseGame/game/data/ui/images/menuSlider.png new file mode 100644 index 000000000..92fee1e9c Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/menuSlider.png differ diff --git a/Templates/BaseGame/game/data/ui/images/new_d.png b/Templates/BaseGame/game/data/ui/images/new_d.png new file mode 100644 index 000000000..bdfc9400d Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/new_d.png differ diff --git a/Templates/BaseGame/game/data/ui/images/new_h.png b/Templates/BaseGame/game/data/ui/images/new_h.png new file mode 100644 index 000000000..1f9b722c1 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/new_h.png differ diff --git a/Templates/BaseGame/game/data/ui/images/new_n.png b/Templates/BaseGame/game/data/ui/images/new_n.png new file mode 100644 index 000000000..06531327d Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/new_n.png differ diff --git a/Templates/BaseGame/game/data/ui/images/next-button_d.png b/Templates/BaseGame/game/data/ui/images/next-button_d.png new file mode 100644 index 000000000..76c3ec0ff Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/next-button_d.png differ diff --git a/Templates/BaseGame/game/data/ui/images/next-button_h.png b/Templates/BaseGame/game/data/ui/images/next-button_h.png new file mode 100644 index 000000000..f52f5fb42 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/next-button_h.png differ diff --git a/Templates/BaseGame/game/data/ui/images/next-button_n.png b/Templates/BaseGame/game/data/ui/images/next-button_n.png new file mode 100644 index 000000000..203133732 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/next-button_n.png differ diff --git a/Templates/BaseGame/game/data/ui/images/no-preview.png b/Templates/BaseGame/game/data/ui/images/no-preview.png new file mode 100644 index 000000000..fccdc858b Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/no-preview.png differ diff --git a/Templates/BaseGame/game/data/ui/images/numericslider.png b/Templates/BaseGame/game/data/ui/images/numericslider.png new file mode 100644 index 000000000..6a97d60c8 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/numericslider.png differ diff --git a/Templates/BaseGame/game/data/ui/images/optionsMenuSliderBitmapArray.png b/Templates/BaseGame/game/data/ui/images/optionsMenuSliderBitmapArray.png new file mode 100644 index 000000000..bd41c15b7 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/optionsMenuSliderBitmapArray.png differ diff --git a/Templates/BaseGame/game/data/ui/images/previous-button_d.png b/Templates/BaseGame/game/data/ui/images/previous-button_d.png new file mode 100644 index 000000000..688b30345 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/previous-button_d.png differ diff --git a/Templates/BaseGame/game/data/ui/images/previous-button_h.png b/Templates/BaseGame/game/data/ui/images/previous-button_h.png new file mode 100644 index 000000000..26cf0e8c6 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/previous-button_h.png differ diff --git a/Templates/BaseGame/game/data/ui/images/previous-button_n.png b/Templates/BaseGame/game/data/ui/images/previous-button_n.png new file mode 100644 index 000000000..c0b9f4662 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/previous-button_n.png differ diff --git a/Templates/BaseGame/game/data/ui/images/radioButton.png b/Templates/BaseGame/game/data/ui/images/radioButton.png new file mode 100644 index 000000000..d5ecc9853 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/radioButton.png differ diff --git a/Templates/BaseGame/game/data/ui/images/scrollBar.png b/Templates/BaseGame/game/data/ui/images/scrollBar.png new file mode 100644 index 000000000..e8c34dc85 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/scrollBar.png differ diff --git a/Templates/BaseGame/game/data/ui/images/selector-button-blank.png b/Templates/BaseGame/game/data/ui/images/selector-button-blank.png new file mode 100644 index 000000000..e965b3af6 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/selector-button-blank.png differ diff --git a/Templates/BaseGame/game/data/ui/images/selector-button-dark.png b/Templates/BaseGame/game/data/ui/images/selector-button-dark.png new file mode 100644 index 000000000..84ee7e6f3 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/selector-button-dark.png differ diff --git a/Templates/BaseGame/game/data/ui/images/selector-button-highlight-only.png b/Templates/BaseGame/game/data/ui/images/selector-button-highlight-only.png new file mode 100644 index 000000000..77e01fc74 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/selector-button-highlight-only.png differ diff --git a/Templates/BaseGame/game/data/ui/images/selector-button.png b/Templates/BaseGame/game/data/ui/images/selector-button.png new file mode 100644 index 000000000..cd0780068 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/selector-button.png differ diff --git a/Templates/BaseGame/game/data/ui/images/separator-h.png b/Templates/BaseGame/game/data/ui/images/separator-h.png new file mode 100644 index 000000000..339c0fbe0 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/separator-h.png differ diff --git a/Templates/BaseGame/game/data/ui/images/separator-v.png b/Templates/BaseGame/game/data/ui/images/separator-v.png new file mode 100644 index 000000000..6a0f87361 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/separator-v.png differ diff --git a/Templates/BaseGame/game/data/ui/images/slider - Copy.png b/Templates/BaseGame/game/data/ui/images/slider - Copy.png new file mode 100644 index 000000000..92fee1e9c Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/slider - Copy.png differ diff --git a/Templates/BaseGame/game/data/ui/images/slider-w-box.png b/Templates/BaseGame/game/data/ui/images/slider-w-box.png new file mode 100644 index 000000000..d9ef04961 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/slider-w-box.png differ diff --git a/Templates/BaseGame/game/data/ui/images/slider.png b/Templates/BaseGame/game/data/ui/images/slider.png new file mode 100644 index 000000000..92fee1e9c Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/slider.png differ diff --git a/Templates/BaseGame/game/data/ui/images/tab-border.png b/Templates/BaseGame/game/data/ui/images/tab-border.png new file mode 100644 index 000000000..6703924d4 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/tab-border.png differ diff --git a/Templates/BaseGame/game/data/ui/images/tab.png b/Templates/BaseGame/game/data/ui/images/tab.png new file mode 100644 index 000000000..ecd81daf7 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/tab.png differ diff --git a/Templates/BaseGame/game/data/ui/images/textEdit.png b/Templates/BaseGame/game/data/ui/images/textEdit.png new file mode 100644 index 000000000..5a65fac3c Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/textEdit.png differ diff --git a/Templates/BaseGame/game/data/ui/images/textEditSliderBox.png b/Templates/BaseGame/game/data/ui/images/textEditSliderBox.png new file mode 100644 index 000000000..57a0c49d3 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/textEditSliderBox.png differ diff --git a/Templates/BaseGame/game/data/ui/images/window.png b/Templates/BaseGame/game/data/ui/images/window.png new file mode 100644 index 000000000..d9e8006e4 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/images/window.png differ diff --git a/Templates/BaseGame/game/data/ui/scripts/controlsMenu.cs b/Templates/BaseGame/game/data/ui/scripts/controlsMenu.cs index f9718e647..d6d7f5e73 100644 --- a/Templates/BaseGame/game/data/ui/scripts/controlsMenu.cs +++ b/Templates/BaseGame/game/data/ui/scripts/controlsMenu.cs @@ -118,7 +118,7 @@ function ControlsMenu::addKeybindOption(%this) { %tamlReader = new Taml(); - %graphicsOption = %tamlReader.read("data/ui/scripts/guis/controlsMenuSetting.taml"); + %graphicsOption = %tamlReader.read("data/ui/guis/controlsMenuSetting.taml"); ControlsMenuOptionsArray.add(%graphicsOption); diff --git a/Templates/BaseGame/game/data/ui/scripts/cursors.cs b/Templates/BaseGame/game/data/ui/scripts/cursors.cs index 0e9b54ef8..d8aa31eeb 100644 --- a/Templates/BaseGame/game/data/ui/scripts/cursors.cs +++ b/Templates/BaseGame/game/data/ui/scripts/cursors.cs @@ -26,7 +26,7 @@ if($platform $= "macos") { hotSpot = "4 4"; renderOffset = "0 0"; - bitmapName = "~/art/gui/images/macCursor"; + bitmapName = "data/ui/images/macCursor"; }; } else @@ -35,6 +35,6 @@ else { hotSpot = "1 1"; renderOffset = "0 0"; - bitmapName = "~/art/gui/images/defaultCursor"; + bitmapName = "data/ui/images/defaultCursor"; }; } \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/scripts/graphicsMenu.cs b/Templates/BaseGame/game/data/ui/scripts/graphicsMenu.cs index 5af6257c3..7f11dec21 100644 --- a/Templates/BaseGame/game/data/ui/scripts/graphicsMenu.cs +++ b/Templates/BaseGame/game/data/ui/scripts/graphicsMenu.cs @@ -1,16 +1,6 @@ // ============================================================================= // GRAPHICS MENU // ============================================================================= -//Mesh and Textures -// -function GraphicsMenu::onWake(%this) -{ - DisplaySettingsMenu.hidden = false; - GeneralGraphicsSettingsMenu.hidden = true; - - %this.refresh(); -} - function GraphicsMenu::refresh(%this) { // @@ -91,13 +81,6 @@ function GraphicsMenu::refresh(%this) GraphicsMenuLightRay.setStateOn($pref::PostFX::EnableLightRays); } -function GraphicsMenuOKButton::onClick(%this) -{ - //save the settings and then back out - GraphicsMenu.apply(); - OptionsMenu.backOut(); -} - function GraphicsMenu::initResMenu( %this ) { // Clear out previous values @@ -135,39 +118,6 @@ function GraphicsMenu::initResMenu( %this ) %resMenu.sort(); } -function GraphicsQualityPopup::init( %this, %qualityGroup ) -{ - assert( isObject( %this ) ); - assert( isObject( %qualityGroup ) ); - - %this.qualityGroup = %qualityGroup; - - // Clear the existing content first. - %this.clear(); - - // Fill it. - %select = -1; - for ( %i=0; %i < %qualityGroup.getCount(); %i++ ) - { - %level = %qualityGroup.getObject( %i ); - if ( %level.isCurrent() ) - %select = %i; - - %this.add( %level.displayName, %i ); - } - - // Setup a default selection. - if ( %select == -1 ) - %this.setText( "Custom" ); - else - %this.setSelected( %select ); -} - -function GraphicsQualityPopup::apply( %this ) -{ - %levelName = %this.getText(); - %this.qualityGroup.applySetting(%levelName); -} // function GraphicsMenu::Autodetect(%this) { @@ -368,95 +318,6 @@ function _makePrettyResString( %resString ) return %outRes; } -// -function GraphicsMenuSetting::init( %this ) -{ - assert( isObject( %this ) ); - //assert( isObject( %this.qualitySettingGroup ) ); - - // Fill it. - %select = -1; - %selectedName = ""; - for ( %i=0; %i < %this.qualitySettingGroup.getCount(); %i++ ) - { - %level = %this.qualitySettingGroup.getObject( %i ); - - %levelName = %level.displayName; - if ( %level.isCurrent() ) - { - %select = %i; - %selectedName = %level.displayName; - } - } - - // Setup a default selection. - if ( %select == -1 ) - { - %this-->SettingText.setText( "Custom" ); - %this.selectedLevel = %this.qualitySettingGroup.getCount(); - } - else - { - %this-->SettingText.setText(%selectedName); - %this.selectedLevel = %select; - } -} - -function GraphicsQualityLevel::isCurrent( %this ) -{ - // Test each pref to see if the current value - // equals our stored value. - - for ( %i=0; %i < %this.count(); %i++ ) - { - %pref = %this.getKey( %i ); - %value = %this.getValue( %i ); - - if ( getVariable( %pref ) !$= %value ) - return false; - } - - return true; -} - -function GraphicsQualityLevel::apply( %this ) -{ - for ( %i=0; %i < %this.count(); %i++ ) - { - %pref = %this.getKey( %i ); - %value = %this.getValue( %i ); - setVariable( %pref, %value ); - } - - // If we have an overloaded onApply method then - // call it now to finalize the changes. - if ( %this.isMethod( "onApply" ) ) - %this.onApply(); - else - { - %group = %this.getGroup(); - if ( isObject( %group ) && %group.isMethod( "onApply" ) ) - %group.onApply( %this ); - } -} - -function GraphicsOptionsMenuGroup::applySetting(%this, %settingName) -{ - for(%i=0; %i < %this.getCount(); %i++) - { - %setting = %this.getObject(%i); - if(%setting.displayName $= %settingName) - { - for ( %s=0; %s < %setting.count(); %s++ ) - { - %pref = %setting.getKey( %s ); - %value = %setting.getValue( %s ); - setVariable( %pref, %value ); - } - } - } -} - function GraphicsMenu::apply(%this) { %newAdapter = GraphicsMenuDriver.getText(); @@ -483,16 +344,16 @@ function GraphicsMenu::apply(%this) MessageBoxOK( "Change requires restart", "Please restart the game for a display device change to take effect." ); } - GraphicsMenuShadowQlty.apply(); - GraphicsMenuSoftShadow.apply(); + //Loop through the settings cache and actually apply the values + %cachedSettingCount = GraphicsSettingsCache.count(); - GraphicsMenuModelDtl.apply(); - GraphicsMenuTextureDtl.apply(); - GraphicsMenuTerrainDtl.apply(); - GraphicsMenuDecalLife.apply(); - GraphicsMenuGroundClutter.apply(); - - GraphicsMenuMaterialQlty.apply(); + for(%i=0; %i < %cachedSettingCount; %i++) + { + %var = GraphicsSettingsCache.getKey(%i); + %val = GraphicsSettingsCache.getValue(%i); + + setVariable(%var, %val); + } //Update Textures reloadTextures(); @@ -500,7 +361,7 @@ function GraphicsMenu::apply(%this) //Update lighting // Set the light manager. This should do nothing // if its already set or if its not compatible. - setLightManager( $pref::lightManager ); + //setLightManager( $pref::lightManager ); PostFXManager.settingsEffectSetEnabled("SSAO", $pref::PostFX::EnableSSAO); PostFXManager.settingsEffectSetEnabled("HDR", $pref::PostFX::EnableHDR); @@ -508,18 +369,12 @@ function GraphicsMenu::apply(%this) PostFXManager.settingsEffectSetEnabled("LightRays", $pref::PostFX::EnableLightRays); PostFXManager.settingsEffectSetEnabled("Vignette", $pref::PostFX::EnableVignette); - $pref::Video::disableParallaxMapping = !GraphicsMenuParallax.isStateOn(); - - //water reflections - $pref::Water::disableTrueReflections = !GraphicsMenuWaterRefl.isStateOn(); - //Update the display settings now $pref::Video::Resolution = getWords( Canvas.getMode( GraphicsMenuResolution.getSelected() ), $WORD::RES_X, $WORD::RES_Y ); %newBpp = 32; // ... its not 1997 anymore. $pref::Video::FullScreen = GraphicsMenuFullScreen.isStateOn() ? "true" : "false"; $pref::Video::RefreshRate = GraphicsMenuRefreshRate.getSelected(); $pref::Video::disableVerticalSync = !GraphicsMenuVSync.isStateOn(); - $pref::Video::AA = GraphicsMenuAA.getSelected(); if ( %newFullScreen $= "false" ) { @@ -551,17 +406,699 @@ function GraphicsMenu::apply(%this) configureCanvas(); } - // Check the anisotropic filtering. - %level = GraphicsMenuAniso.getSelected(); - if ( %level != $pref::Video::defaultAnisotropy ) - { - if ( %testNeedApply ) - return true; - - $pref::Video::defaultAnisotropy = %level; - } - echo("Exporting client prefs"); %prefPath = getPrefpath(); export("$pref::*", %prefPath @ "/clientPrefs.cs", false); +} + +function GraphicsMenu::loadSettings() +{ + OptionsMenu.currentMenu = "GraphicsMenu"; + OptionsSettingStack.clear(); + + OptionsMenu.addSettingOption(OptionsSettingStack, "Shadow Quality", "", "ShadowQuality"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Shadow Caching", "", "ShadowCaching"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Soft Shadows", "", "SoftShadow"); + + OptionsMenu.addSettingOption(OptionsSettingStack, "Model Detail", "", "MeshQuality"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Texture Detail", "", "TextureQuality"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Terrain Detail", "", "TerrainQuality"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Decal Lifetime", "", "DecalLifetime"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Ground Clutter Density", "", "GroundCoverDensity"); + + OptionsMenu.addSettingOption(OptionsSettingStack, "Material Quality", "", "ShaderQuality"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Parallax", "", "ParallaxSetting"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Ambient Occlusion", "", "AmbientOcclusionSetting"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Light Rays", "", "LightRaysSetting"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Depth of Field", "", "DOFSetting"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Vignetting", "", "VignetteSetting"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Water Reflections", "", "WaterReflectionSetting"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Anti Aliasing", "", "AASetting"); + OptionsMenu.addSettingOption(OptionsSettingStack, "Anisotropic Filtering", "", "AnisotropicFilteringSetting"); + + if(!isObject(GraphicsSettingsCache)) + { + new ArrayObject(GraphicsSettingsCache){}; + } + + GraphicsSettingsCache.empty(); +} + +function GraphicsMenu::set(%var, %val) +{ + %ex = GraphicsSettingsCache.getIndexFromKey(%var); + if(%ex != -1) + GraphicsSettingsCache.erase(%ex); + + GraphicsSettingsCache.add(%var, %val); +} + +// +// +// +function MeshQuality::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::TS::detailAdjust", "1.5"); + GraphicsMenu::set("$pref::TS::skipRenderDLs", "0"); + case "Medium": + GraphicsMenu::set("$pref::TS::detailAdjust", "1.0"); + GraphicsMenu::set("$pref::TS::skipRenderDLs", "0"); + case "Low": + GraphicsMenu::set("$pref::TS::detailAdjust", "0.75"); + GraphicsMenu::set("$pref::TS::skipRenderDLs", "0"); + case "Lowest": + GraphicsMenu::set("$pref::TS::detailAdjust", "0.5"); + GraphicsMenu::set("$pref::TS::skipRenderDLs", "0"); + default: + GraphicsMenu::set("$pref::TS::detailAdjust", "1.0"); + GraphicsMenu::set("$pref::TS::skipRenderDLs", "0"); + } +} + +function MeshQuality::get() +{ + if($pref::TS::detailAdjust == 1.5) + return "High"; + else if($pref::TS::detailAdjust == 1.0) + return "Medium"; + else if($pref::TS::detailAdjust == 0.75) + return "Low"; + else if($pref::TS::detailAdjust == 0.5) + return "Lowest"; + else + return "Custom"; +} + +function MeshQuality::getList() +{ + return "Lowest,Low,Medium,High"; +} + +// +function TextureQuality::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::Video::textureReductionLevel", "0"); + GraphicsMenu::set("$pref::Reflect::refractTexScale", "1.25"); + case "Medium": + GraphicsMenu::set("$pref::Video::textureReductionLevel", "0"); + GraphicsMenu::set("$pref::Reflect::refractTexScale", "1"); + case "Low": + GraphicsMenu::set("$pref::Video::textureReductionLevel", "1"); + GraphicsMenu::set("$pref::Reflect::refractTexScale", "0.75"); + case "Lowest": + GraphicsMenu::set("$pref::Video::textureReductionLevel", "2"); + GraphicsMenu::set("$pref::Reflect::refractTexScale", "0.5"); + default: + GraphicsMenu::set("$pref::Video::textureReductionLevel", "0"); + GraphicsMenu::set("$pref::Reflect::refractTexScale", "1"); + } +} + +function TextureQuality::get() +{ + if($pref::Video::textureReductionLevel == 0 && $pref::Reflect::refractTexScale == 1.25) + return "High"; + else if($pref::Video::textureReductionLevel == 0 && $pref::Reflect::refractTexScale == 1) + return "Medium"; + else if($pref::Video::textureReductionLevel == 1 && $pref::Reflect::refractTexScale == 0.75) + return "Low"; + else if($pref::Video::textureReductionLevel == 2 && $pref::Reflect::refractTexScale == 0.5) + return "Lowest"; + else + return "Custom"; +} + +function TextureQuality::getList() +{ + return "Lowest,Low,Medium,High"; +} + +// +function GroundCoverDensity::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::GroundCover::densityScale", "1"); + case "Medium": + GraphicsMenu::set("$pref::GroundCover::densityScale", "0.75"); + case "Low": + GraphicsMenu::set("$pref::GroundCover::densityScale", "0.5"); + case "Lowest": + GraphicsMenu::set("$pref::GroundCover::densityScale", "0.25"); + default: + GraphicsMenu::set("$pref::GroundCover::densityScale", "0.75"); + } +} + +function GroundCoverDensity::get() +{ + if($pref::GroundCover::densityScale == 1) + return "High"; + else if($pref::GroundCover::densityScale == 0.75) + return "Medium"; + else if($pref::GroundCover::densityScale == 0.5) + return "Low"; + else if($pref::GroundCover::densityScale == 0.25) + return "Lowest"; + else + return "Custom"; +} + +function GroundCoverDensity::getList() +{ + return "Lowest,Low,Medium,High"; +} + +// +function DecalLifetime::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::decalMgr::enabled", "true"); + GraphicsMenu::set("$pref::Decals::lifeTimeScale", "1"); + case "Medium": + GraphicsMenu::set("$pref::decalMgr::enabled", "true"); + GraphicsMenu::set("$pref::Decals::lifeTimeScale", "0.5"); + case "Low": + GraphicsMenu::set("$pref::decalMgr::enabled", "true"); + GraphicsMenu::set("$pref::Decals::lifeTimeScale", "0.25"); + case "None": + GraphicsMenu::set("$pref::decalMgr::enabled", "false"); + default: + GraphicsMenu::set("$pref::decalMgr::enabled", "true"); + GraphicsMenu::set("$pref::Decals::lifeTimeScale", "0.5"); + } +} + +function DecalLifetime::get() +{ + if($pref::decalMgr::enabled == true && $pref::Decals::lifeTimeScale == 1) + return "High"; + else if($pref::decalMgr::enabled == true && $pref::Decals::lifeTimeScale == 0.5) + return "Medium"; + else if($pref::decalMgr::enabled == true && $pref::Decals::lifeTimeScale == 0.25) + return "Low"; + else if($pref::decalMgr::enabled == true ) + return "None"; + else + return "Custom"; +} + +function DecalLifetime::getList() +{ + return "None,Low,Medium,High"; +} + +// +function TerrainQuality::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::Terrain::lodScale", "0.75"); + GraphicsMenu::set("$pref::Terrain::detailScale", "1.5"); + case "Medium": + GraphicsMenu::set("$pref::Terrain::lodScale", "1"); + GraphicsMenu::set("$pref::Terrain::detailScale", "1"); + case "Low": + GraphicsMenu::set("$pref::Terrain::lodScale", "1.5"); + GraphicsMenu::set("$pref::Terrain::detailScale", "0.75"); + case "Lowest": + GraphicsMenu::set("$pref::Terrain::lodScale", "2"); + GraphicsMenu::set("$pref::Terrain::detailScale", "0.5"); + default: + GraphicsMenu::set("$pref::decalMgr::enabled", "1"); + GraphicsMenu::set("$pref::Decals::lifeTimeScale", "1"); + } +} + +function TerrainQuality::get() +{ + if($pref::Terrain::lodScale == 0.75 && $pref::Terrain::detailScale == 1.5) + return "High"; + else if($pref::Terrain::lodScale == 1 && $pref::Terrain::detailScale == 1) + return "Medium"; + else if($pref::Terrain::lodScale == 1.5 && $pref::Terrain::detailScale == 0.75) + return "Low"; + else if($pref::Terrain::lodScale == 2 && $pref::Terrain::detailScale == 0.5) + return "Lowest"; + else + return "Custom"; +} + +function TerrainQuality::getList() +{ + return "Lowest,Low,Medium,High"; +} + +// +function ShadowQuality::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::Shadows::disable", "false"); + GraphicsMenu::set("$pref::Shadows::textureScalar", "1.0"); + case "Medium": + GraphicsMenu::set("$pref::Shadows::disable", "false"); + GraphicsMenu::set("$pref::Shadows::textureScalar", "0.5"); + case "Low": + GraphicsMenu::set("$pref::Shadows::disable", "false"); + GraphicsMenu::set("$pref::Shadows::textureScalar", "0.25"); + case "None": + GraphicsMenu::set("$pref::Shadows::disable", "true"); + GraphicsMenu::set("$pref::Shadows::textureScalar", "0.5"); + default: + GraphicsMenu::set("$pref::Shadows::disable", "false"); + GraphicsMenu::set("$pref::Shadows::textureScalar", "0.5"); + } +} + +function ShadowQuality::get() +{ + if($pref::Shadows::disable == false && $pref::Shadows::textureScalar == 1.0) + return "High"; + else if($pref::Shadows::disable == false && $pref::Shadows::textureScalar == 0.5) + return "Medium"; + else if($pref::Shadows::disable == false && $pref::Shadows::textureScalar == 0.25) + return "Low"; + else if($pref::Shadows::disable == true) + return "None"; + else + return "Custom"; +} + +function ShadowQuality::getList() +{ + return "None,Low,Medium,High"; +} + +// +function ShadowDistance::set(%setting) +{ + switch$(%setting) + { + case "Highest": + GraphicsMenu::set("$pref::Shadows::drawDistance", "1.0"); + case "High": + GraphicsMenu::set("$pref::Shadows::drawDistance", "0.75"); + case "Medium": + GraphicsMenu::set("$pref::Shadows::drawDistance", "0.5"); + case "Low": + GraphicsMenu::set("$pref::Shadows::drawDistance", "0.25"); + default: + GraphicsMenu::set("$pref::Shadows::drawDistance", "0.5"); + } +} + +function ShadowDistance::get() +{ + if($pref::Shadows::drawDistance == 1.0) + return "Highest"; + else if($pref::Shadows::drawDistance == 0.75) + return "High"; + else if($pref::Shadows::drawDistance == 0.5) + return "Medium"; + else if($pref::Shadows::drawDistance == 0.25) + return "Low"; + else + return "Custom"; +} + +function ShadowDistance::getList() +{ + return "Low,Medium,High,Highest"; +} + +// +function SoftShadow::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::Shadows::filterMode", "SoftShadowHighQuality"); + case "Low": + GraphicsMenu::set("$pref::Shadows::filterMode", "SoftShadow"); + case "Off": + GraphicsMenu::set("$pref::Shadows::filterMode", "None"); + default: + GraphicsMenu::set("$pref::Shadows::filterMode", "SoftShadow"); + } +} + +function SoftShadow::get() +{ + if($pref::Shadows::filterMode $= "SoftShadowHighQuality") + return "High"; + else if($pref::Shadows::filterMode $= "SoftShadow") + return "Low"; + else if($pref::Shadows::filterMode $= "None") + return "Off"; + else + return "Custom"; +} + +function SoftShadow::getList() +{ + return "Off,Low,High"; +} + +// +function LightDistance::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::Lights::drawDistance", "1"); + case "Medium": + GraphicsMenu::set("$pref::Lights::drawDistance", "0.75"); + case "Low": + GraphicsMenu::set("$pref::Lights::drawDistance", "0.5"); + case "Lowest": + GraphicsMenu::set("$pref::Lights::drawDistance", "0.25"); + default: + GraphicsMenu::set("$pref::Lights::drawDistance", "0.75"); + } +} + +function LightDistance::get() +{ + if($pref::Lights::drawDistance == 1) + return "High"; + else if($pref::Lights::drawDistance == 0.75) + return "Medium"; + else if($pref::Lights::drawDistance == 0.5) + return "Low"; + else if($pref::Lights::drawDistance == 0.25) + return "Lowest"; + else + return "Custom"; +} + +function LightDistance::getList() +{ + return "Lowest,Low,Medium,High"; +} + +// +function ShaderQuality::set(%setting) +{ + switch$(%setting) + { + case "High": + GraphicsMenu::set("$pref::Video::disablePixSpecular", "false"); + GraphicsMenu::set("$pref::Video::disableNormalmapping", "false"); + case "Low": + GraphicsMenu::set("$pref::Video::disablePixSpecular", "true"); + GraphicsMenu::set("$pref::Video::disableNormalmapping", "true"); + default: + GraphicsMenu::set("$pref::Video::disablePixSpecular", "false"); + GraphicsMenu::set("$pref::Video::disableNormalmapping", "false"); + } +} + +function ShaderQuality::get() +{ + if($pref::Video::disablePixSpecular == false || $pref::Video::disableNormalmapping == false) + return "High"; + else if($pref::Video::disablePixSpecular == true || $pref::Video::disableNormalmapping == true) + return "Low"; + else + return "Custom"; +} + +function ShaderQuality::getList() +{ + return "Low,High"; +} + +// +function ShadowCaching::set(%setting) +{ + switch$(%setting) + { + case "On": + GraphicsMenu::set("$pref::Shadows::useShadowCaching", "true"); + case "Off": + GraphicsMenu::set("$pref::Shadows::useShadowCaching", "false"); + default: + GraphicsMenu::set("$pref::Shadows::useShadowCaching", "true"); + } +} + +function ShadowCaching::get() +{ + if($pref::Shadows::useShadowCaching == true) + return "On"; + else + return "Off"; +} + +function ShadowCaching::getList() +{ + return "Off,On"; +} + +// +function ParallaxSetting::set(%setting) +{ + switch$(%setting) + { + case "On": + GraphicsMenu::set("$pref::Video::disableParallaxMapping", "false"); + case "Off": + GraphicsMenu::set("$pref::Video::disableParallaxMapping", "true"); + default: + GraphicsMenu::set("$pref::Video::disableParallaxMapping", "false"); + } +} + +function ParallaxSetting::get() +{ + if($pref::Video::disableParallaxMapping == false) + return "On"; + else + return "Off"; +} + +function ParallaxSetting::getList() +{ + return "Off,On"; +} + +// +function AmbientOcclusionSetting::set(%setting) +{ + switch$(%setting) + { + case "On": + GraphicsMenu::set("$pref::PostFX::EnableSSAO", "true"); + case "Off": + GraphicsMenu::set("$pref::PostFX::EnableSSAO", "false"); + default: + GraphicsMenu::set("$pref::PostFX::EnableSSAO", "true"); + } +} + +function AmbientOcclusionSetting::get() +{ + if($pref::PostFX::EnableSSAO == true) + return "On"; + else + return "Off"; +} + +function AmbientOcclusionSetting::getList() +{ + return "Off,On"; +} + +// +function LightRaysSetting::set(%setting) +{ + switch$(%setting) + { + case "On": + GraphicsMenu::set("$pref::PostFX::EnableLightRays", "true"); + case "Off": + GraphicsMenu::set("$pref::PostFX::EnableLightRays", "false"); + default: + GraphicsMenu::set("$pref::PostFX::EnableLightRays", "true"); + } +} + +function LightRaysSetting::get() +{ + if($pref::PostFX::EnableLightRays == true) + return "On"; + else + return "Off"; +} + +function LightRaysSetting::getList() +{ + return "Off,On"; +} + +// +function DOFSetting::set(%setting) +{ + switch$(%setting) + { + case "On": + GraphicsMenu::set("$pref::PostFX::EnableDOF", "true"); + case "Off": + GraphicsMenu::set("$pref::PostFX::EnableDOF", "false"); + default: + GraphicsMenu::set("$pref::PostFX::EnableDOF", "true"); + } +} + +function DOFSetting::get() +{ + if($pref::PostFX::EnableLightRays == true) + return "On"; + else + return "Off"; +} + +function DOFSetting::getList() +{ + return "Off,On"; +} + +// +function WaterReflectionSetting::set(%setting) +{ + switch$(%setting) + { + case "On": + GraphicsMenu::set("$pref::Water::disableTrueReflections", "false"); + case "Off": + GraphicsMenu::set("$pref::Water::disableTrueReflections", "true"); + default: + GraphicsMenu::set("$pref::Water::disableTrueReflections", "false"); + } +} + +function WaterReflectionSetting::get() +{ + if($pref::Water::disableTrueReflections == false) + return "On"; + else + return "Off"; +} + +function WaterReflectionSetting::getList() +{ + return "Off,On"; +} + +// +function VignetteSetting::set(%setting) +{ + switch$(%setting) + { + case "On": + GraphicsMenu::set("$pref::PostFX::EnableVignette", "true"); + case "Off": + GraphicsMenu::set("$pref::PostFX::EnableVignette", "false"); + default: + GraphicsMenu::set("$pref::PostFX::EnableVignette", "true"); + } +} + +function VignetteSetting::get() +{ + if($pref::PostFX::EnableVignette == true) + return "On"; + else + return "Off"; +} + +function VignetteSetting::getList() +{ + return "Off,On"; +} + +// +function AASetting::set(%setting) +{ + switch$(%setting) + { + case "4x": + GraphicsMenu::set("$pref::Video::AA", "4"); + case "2x": + GraphicsMenu::set("$pref::Video::AA", "2"); + case "1x": + GraphicsMenu::set("$pref::Video::AA", "1"); + case "Off": + GraphicsMenu::set("$pref::Video::AA", "0"); + default: + GraphicsMenu::set("$pref::Video::AA", "0"); + } +} + +function AASetting::get() +{ + if($pref::Video::AA == 4) + return "4x"; + else if($pref::Video::AA == 2) + return "2x"; + else if($pref::Video::AA == 1) + return "1x"; + else if($pref::Video::AA == 0) + return "Off"; + else + return "Custom"; +} + +function AASetting::getList() +{ + return "Off,1x,2x,4x"; +} + +// +function AnisotropicFilteringSetting::set(%setting) +{ + switch$(%setting) + { + case "16x": + GraphicsMenu::set("$pref::Video::defaultAnisotropy", "16"); + case "8x": + GraphicsMenu::set("$pref::Video::defaultAnisotropy", "8"); + case "4x": + GraphicsMenu::set("$pref::Video::defaultAnisotropy", "4"); + case "Off": + GraphicsMenu::set("$pref::Video::defaultAnisotropy", "0"); + default: + GraphicsMenu::set("$pref::Video::defaultAnisotropy", "0"); + } +} + +function AnisotropicFilteringSetting::get() +{ + if($pref::Video::defaultAnisotropy == 16) + return "16x"; + else if($pref::Video::defaultAnisotropy == 8) + return "8x"; + else if($pref::Video::defaultAnisotropy == 4) + return "4x"; + else if($pref::Video::defaultAnisotropy == 0) + return "Off"; + else + return "Custom"; +} + +function AnisotropicFilteringSetting::getList() +{ + return "Off,4x,8x,16x"; } \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/scripts/optionsList.cs b/Templates/BaseGame/game/data/ui/scripts/optionsList.cs index ad1da0759..e69de29bb 100644 --- a/Templates/BaseGame/game/data/ui/scripts/optionsList.cs +++ b/Templates/BaseGame/game/data/ui/scripts/optionsList.cs @@ -1,437 +0,0 @@ -new SimGroup( MeshQualityGroup ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::TS::detailAdjust"] = 1.5; - key["$pref::TS::skipRenderDLs"] = 0; - }; - new ArrayObject( ) - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::TS::detailAdjust"] = 1.0; - key["$pref::TS::skipRenderDLs"] = 0; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::TS::detailAdjust"] = 0.75; - key["$pref::TS::skipRenderDLs"] = 0; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Lowest"; - - key["$pref::TS::detailAdjust"] = 0.5; - key["$pref::TS::skipRenderDLs"] = 1; - }; -}; - -new SimGroup( TextureQualityGroup ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::Video::textureReductionLevel"] = 0; - key["$pref::Reflect::refractTexScale"] = 1.25; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::Video::textureReductionLevel"] = 0; - key["$pref::Reflect::refractTexScale"] = 1; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Video::textureReductionLevel"] = 1; - key["$pref::Reflect::refractTexScale"] = 0.75; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Lowest"; - - key["$pref::Video::textureReductionLevel"] = 2; - key["$pref::Reflect::refractTexScale"] = 0.5; - }; -}; - -new SimGroup( GroundCoverDensityGroup ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::GroundCover::densityScale"] = 1.0; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::GroundCover::densityScale"] = 0.75; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::GroundCover::densityScale"] = 0.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Lowest"; - - key["$pref::GroundCover::densityScale"] = 0.25; - }; -}; - -new SimGroup( DecalLifetimeGroup ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::decalMgr::enabled"] = true; - key["$pref::Decals::lifeTimeScale"] = 1; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::decalMgr::enabled"] = true; - key["$pref::Decals::lifeTimeScale"] = 0.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::decalMgr::enabled"] = true; - key["$pref::Decals::lifeTimeScale"] = 0.25; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "None"; - - key["$pref::decalMgr::enabled"] = false; - }; -}; - -new SimGroup( TerrainQualityGroup ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::Terrain::lodScale"] = 0.75; - key["$pref::Terrain::detailScale"] = 1.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::Terrain::lodScale"] = 1.0; - key["$pref::Terrain::detailScale"] = 1.0; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Terrain::lodScale"] = 1.5; - key["$pref::Terrain::detailScale"] = 0.75; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Lowest"; - - key["$pref::Terrain::lodScale"] = 2.0; - key["$pref::Terrain::detailScale"] = 0.5; - }; -}; - -//Shadows and Lighting -new SimGroup( ShadowQualityList ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = false; - key["$pref::Shadows::textureScalar"] = 1.0; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = false; - key["$pref::Shadows::textureScalar"] = 0.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = false; - key["$pref::Shadows::textureScalar"] = 0.25; - - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "None"; - - key["$pref::lightManager"] = "Advanced Lighting"; - key["$pref::Shadows::disable"] = true; - key["$pref::Shadows::textureScalar"] = 0.5; - }; -}; - -new SimGroup( ShadowDistanceList ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Highest"; - - key["$pref::Shadows::drawDistance"] = 2; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::Shadows::drawDistance"] = 1.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::Shadows::drawDistance"] = 1; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Shadows::drawDistance"] = 0.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Lowest"; - - key["$pref::Shadows::drawDistance"] = 0.25; - }; -}; - -new SimGroup( SoftShadowList ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::Shadows::filterMode"] = "SoftShadowHighQuality"; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Shadows::filterMode"] = "SoftShadow"; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Off"; - - key["$pref::Shadows::filterMode"] = "None"; - }; -}; - -new SimGroup( LightDistanceList ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Highest"; - - key["$pref::Lights::drawDistance"] = 2; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::Lights::drawDistance"] = 1.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Medium"; - - key["$pref::Lights::drawDistance"] = 1; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Lights::drawDistance"] = 0.5; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Lowest"; - - key["$pref::Lights::drawDistance"] = 0.25; - }; -}; - -new SimGroup( ShaderQualityGroup ) -{ - class = "GraphicsOptionsMenuGroup"; - - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "High"; - - key["$pref::Video::disablePixSpecular"] = false; - key["$pref::Video::disableNormalmapping"] = false; - }; - new ArrayObject() - { - class = "GraphicsQualityLevel"; - caseSensitive = true; - - displayName = "Low"; - - key["$pref::Video::disablePixSpecular"] = true; - key["$pref::Video::disableNormalmapping"] = true; - }; -}; \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/scripts/profiles.cs b/Templates/BaseGame/game/data/ui/scripts/profiles.cs index 7df4a03f8..b5345905a 100644 --- a/Templates/BaseGame/game/data/ui/scripts/profiles.cs +++ b/Templates/BaseGame/game/data/ui/scripts/profiles.cs @@ -12,7 +12,7 @@ new GuiControlProfile( GuiMenuButtonProfile ) fixedExtent = false; justify = "center"; canKeyFocus = false; - bitmap = "data/ui/art/menu-button"; + bitmap = "data/ui/images/menu-button"; hasBitmapArray = false; soundButtonDown = menuButtonPressed; soundButtonOver = menuButtonHover; @@ -33,7 +33,7 @@ new GuiControlProfile( GuiHighlightMenuButtonProfile ) fixedExtent = false; justify = "center"; canKeyFocus = false; - bitmap = "data/ui/art/selector-button-highlight-only"; + bitmap = "data/ui/images/selector-button-highlight-only"; hasBitmapArray = false; category = "Core"; }; @@ -52,7 +52,7 @@ new GuiControlProfile( GuiBlankMenuButtonProfile ) fixedExtent = false; justify = "center"; canKeyFocus = false; - bitmap = "data/ui/art/selector-button-blank"; + bitmap = "data/ui/images/selector-button-blank"; hasBitmapArray = false; soundButtonDown = menuButtonPressed; soundButtonOver = menuButtonHover; @@ -96,7 +96,7 @@ new GuiControlProfile( GuiGroupBorderProfile ) border = false; opaque = false; hasBitmapArray = true; - bitmap = "data/ui/art/group-border"; + bitmap = "data/ui/images/group-border"; category = "Core"; }; @@ -106,7 +106,7 @@ new GuiControlProfile( GuiTabBorderProfile ) border = false; opaque = false; hasBitmapArray = true; - bitmap = "data/ui/art/tab-border"; + bitmap = "data/ui/images/tab-border"; category = "Core"; }; @@ -224,7 +224,7 @@ new GuiControlProfile( GuiPopupMenuItemBorder : GuiButtonProfile ) fixedExtent = false; justify = "center"; canKeyFocus = false; - bitmap = "data/ui/art/button"; + bitmap = "data/ui/images/button"; category = "Core"; }; @@ -237,7 +237,7 @@ new GuiControlProfile( GuiPopUpMenuDefault : GuiDefaultProfile ) border = 0; borderThickness = 0; fixedExtent = true; - bitmap = "data/ui/art/scrollBar"; + bitmap = "data/ui/images/scrollBar"; hasBitmapArray = true; profileForChildren = GuiPopupMenuItemBorder; fillColor = "242 241 240 ";//"255 255 255";//100 @@ -254,7 +254,7 @@ if( !isObject( GuiPopUpMenuProfile ) ) new GuiControlProfile( GuiPopUpMenuProfile : GuiPopUpMenuDefault ) { textOffset = "6 4"; - bitmap = "data/ui/art/dropDown"; + bitmap = "data/ui/images/dropDown"; hasBitmapArray = true; border = 1; profileForChildren = GuiPopUpMenuDefault; @@ -272,7 +272,7 @@ new GuiControlProfile( GuiTabBookProfile ) fontType = "Arial"; fontSize = 14; justify = "center"; - bitmap = "data/ui/art/tab"; + bitmap = "data/ui/images/tab"; tabWidth = 64; tabHeight = 24; tabPosition = "Top"; @@ -289,7 +289,7 @@ new GuiControlProfile( GuiTabPageProfile : GuiDefaultProfile ) fontType = "Arial"; fontSize = 10; justify = "center"; - bitmap = "data/ui/art/tab"; + bitmap = "data/ui/images/tab"; opaque = false; fillColor = "240 239 238"; category = "Core"; @@ -383,7 +383,7 @@ new GuiControlProfile( GuiRadioProfile ) fontColor = "20 20 20"; fontColorHL = "80 80 80"; fixedExtent = true; - bitmap = "data/ui/art/radioButton"; + bitmap = "data/ui/images/radioButton"; hasBitmapArray = true; category = "Core"; }; @@ -394,7 +394,7 @@ new GuiControlProfile( GuiRadioProfile ) if( !isObject( GuiSliderProfile ) ) new GuiControlProfile( GuiSliderProfile ) { - bitmap = "data/ui/art/slider"; + bitmap = "data/ui/images/slider"; category = "Core"; }; @@ -409,7 +409,7 @@ new GuiControlProfile(GuiMenuScrollProfile) fontColor = "200 200 200"; fontColorHL = "250 250 250"; border = true; - bitmap = "data/ui/art/scrollBar"; + bitmap = "data/ui/images/scrollBar"; hasBitmapArray = true; category = "Core"; }; @@ -423,14 +423,14 @@ new GuiControlProfile(GuiMenuScrollProfile) fontColor = "0 0 0"; fontColorHL = "150 150 150"; border = true; - bitmap = "./images/scrollBar"; + bitmap = "data/ui/images/scrollBar"; hasBitmapArray = true; category = "Core"; }; singleton GuiControlProfile(SliderBitmapGUIProfile) { - bitmap = "data/ui/art/optionsMenuSliderBitmapArray.png"; + bitmap = "data/ui/images/optionsMenuSliderBitmapArray.png"; hasBitmapArray = true; opaque = false; }; \ No newline at end of file diff --git a/Templates/BaseGame/game/data/ui/sounds/buttonClick.wav b/Templates/BaseGame/game/data/ui/sounds/buttonClick.wav new file mode 100644 index 000000000..ec55432ee Binary files /dev/null and b/Templates/BaseGame/game/data/ui/sounds/buttonClick.wav differ diff --git a/Templates/BaseGame/game/data/ui/sounds/buttonHover.wav b/Templates/BaseGame/game/data/ui/sounds/buttonHover.wav new file mode 100644 index 000000000..e7276cde4 Binary files /dev/null and b/Templates/BaseGame/game/data/ui/sounds/buttonHover.wav differ diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.cs b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.cs index b11907929..ca795d4e8 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.cs +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/gameObject.cs @@ -21,7 +21,8 @@ function AssetBrowser::editGameObjectAssetScript(%this, %assetDef) { %scriptFile = %assetDef.scriptFile; - EditorOpenFileInTorsion(makeFullPath(%scriptFile), 0); + if(%scriptFile !$= "") + EditorOpenFileInTorsion(makeFullPath(%scriptFile), 0); } function AssetBrowser::applyInstanceToGameObject(%this, %assetDef) diff --git a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.cs.template b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.cs.template index 1b6dda406..bcc092757 100644 --- a/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.cs.template +++ b/Templates/BaseGame/game/tools/assetBrowser/scripts/templateFiles/module.cs.template @@ -12,12 +12,12 @@ function @@::initServer(%this) } //This is called when the server is created for an actual game/map to be played -function @@::onCreateServer(%this) +function @@::onCreateGameServer(%this) { } //This is called when the server is shut down due to the game/map being exited -function @@::onDestroyServer(%this) +function @@::onDestroyGameServer(%this) { } @@ -27,11 +27,11 @@ function @@::initClient(%this) } //This is called when a client connects to a server -function @@::onCreateClient(%this) +function @@::onCreateClientConnection(%this) { } //This is called when a client disconnects from a server -function @@::onDestroyClient(%this) +function @@::onDestroyClientConnection(%this) { } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs index c178a1c61..94ca1b065 100644 --- a/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs +++ b/Templates/BaseGame/game/tools/gui/editorSettingsWindow.ed.cs @@ -147,6 +147,11 @@ function SettingsInspector::changeEditorSetting(%this, %varName, %value) { %varName = strreplace(%varName, "-", "/"); + if(isFile(%value) || IsDirectory(%value)) + { + %value = makeFullPath(%value); + } + echo("Set " @ %varName @ " to be " @ %value); if(ESettingsWindow.mode $= "Editor") diff --git a/Templates/BaseGame/game/tools/worldEditor/main.cs b/Templates/BaseGame/game/tools/worldEditor/main.cs index 63ebb0a61..a503d23a6 100644 --- a/Templates/BaseGame/game/tools/worldEditor/main.cs +++ b/Templates/BaseGame/game/tools/worldEditor/main.cs @@ -68,6 +68,7 @@ function initializeWorldEditor() exec("./scripts/visibility/visibilityLayer.ed.cs"); exec("./scripts/visibility/lightViz.cs"); exec("./scripts/visibility/shadowViz.cs"); + exec("./scripts/visibility/probeViz.cs"); exec("./scripts/visibility/miscViz.cs"); // Load Custom Editors diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs index 02184046c..5e7d32893 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs @@ -579,7 +579,9 @@ function EditorGui::onSleep( %this ) // Remove the editor's ActionMaps. EditorMap.pop(); - MoveMap.pop(); + + if(isObject(moveMap)) + MoveMap.pop(); // Notify the editor plugins that the editor will be closing. diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs index 810f30eba..5a13b1117 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/lightViz.cs @@ -361,3 +361,68 @@ function toggleBackbufferViz( %enable ) } } +// +// +// +function setLightingMode(%mode) +{ + resetLightingMode(); + + switch$ ( %mode ) + { + case "Unlit": + $Shadows::disable = true; + $Light::renderReflectionProbes = false; + $Light::disableLights = true; + EVisibilityLightingModesOptions.checkItem(1, true); + case "NoShadows": + $Shadows::disable = true; + EVisibilityLightingModesOptions.checkItem(2, true); + case "DetailLighting": + //$Viz_ColorblindnessModeVar = "0"; + EVisibilityLightingModesOptions.checkItem(3, true); + case "LightingOnly": + $Light::renderReflectionProbes = false; + EVisibilityLightingModesOptions.checkItem(4, true); + case "ReflectionsOnly": + $Light::disableLights = true; + EVisibilityLightingModesOptions.checkItem(5, true); + } +} + +function resetLightingMode() +{ + for(%i=0; %i < 6; %i++) + { + EVisibilityLightingModesOptions.checkItem(%i, false); + } + + $Light::renderReflectionProbes = true; + $Light::disableLights = false; + $Shadows::disable = false; + EVisibilityLightingModesOptions.checkItem(0, true); +} + +function togglePSSMDebugViz() +{ + disableVisualizers(); + $AL::PSSMDebugRender = !$AL::PSSMDebugRender; +} + +function disablePSSMDebugViz() +{ + $AL::PSSMDebugRender = false; + $Light::renderReflectionProbes = true; +} + +// +// +function toggleLightFrustumViz() +{ + $Light::renderLightFrustums = !$Light::renderLightFrustums; +} + +function disableLightFrustumViz() +{ + $Light::renderLightFrustums = false; +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs index 80f0102ad..754c0bd6c 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/miscViz.cs @@ -90,8 +90,9 @@ new ShaderData( Viz_SurfaceProperties ) samplerNames[0] = "deferredTex"; samplerNames[1] = "colorBufferTex"; samplerNames[2] = "matinfoTex"; - samplerNames[3] = "$backBuffer"; - samplerNames[4] = "glowBuffer"; + samplerNames[3] = "ssaoMaskTex"; + samplerNames[4] = "$backBuffer"; + samplerNames[5] = "glowBuffer"; pixVersion = 2.0; }; @@ -103,8 +104,9 @@ singleton PostEffect( Viz_SurfacePropertiesPFX ) texture[0] = "#deferred"; texture[1] = "#color"; texture[2] = "#matinfo"; - texture[3] = "$backBuffer"; - texture[4] = "#glowbuffer"; + texture[3] = "#ssaoMask"; + texture[4] = "$backBuffer"; + texture[5] = "#glowbuffer"; target = "$backBuffer"; renderPriority = 9999; @@ -141,10 +143,12 @@ function toggleSurfacePropertiesViz( %mode ) $Viz_SurfacePropertiesModeVar = "10"; case "Fresnel": $Viz_SurfacePropertiesModeVar = "11"; - case "Backbuffer": + case "SSAO": $Viz_SurfacePropertiesModeVar = "12"; - case "Glow": + case "Backbuffer": $Viz_SurfacePropertiesModeVar = "13"; + case "Glow": + $Viz_SurfacePropertiesModeVar = "14"; default: $Viz_SurfacePropertiesModeVar = "-1"; } @@ -163,7 +167,7 @@ function toggleSurfacePropertiesViz( %mode ) } } - for(%i=0; %i < 14; %i++) + for(%i=0; %i < 15; %i++) { if(%i == $Viz_SurfacePropertiesModeVar) EVisibilityBufferVizOptions.checkItem(%i, true); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/probeViz.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/probeViz.cs index 136323d57..800d14011 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/probeViz.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/probeViz.cs @@ -1,5 +1,7 @@ -function toggleProbeVis(%mode) +function toggleProbeViz(%mode) { + setLightingMode("ReflectionsOnly"); + $Probes::showAttenuation = 0; $Probes::showSpecularCubemaps = 0; $Probes::showDiffuseCubemaps = 0; @@ -16,4 +18,10 @@ function toggleProbeVis(%mode) case "Diffuse": $Probes::showDiffuseCubemaps = 1; } +} + +function disableProbeViz() +{ + setLightingMode("Lit"); + toggleProbeViz(-1); } \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shaders/Viz_SurfacePropertiesP.hlsl b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shaders/Viz_SurfacePropertiesP.hlsl index 755bc4937..b489519a7 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shaders/Viz_SurfacePropertiesP.hlsl +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shaders/Viz_SurfacePropertiesP.hlsl @@ -28,8 +28,9 @@ TORQUE_UNIFORM_SAMPLER2D(deferredBuffer, 0); TORQUE_UNIFORM_SAMPLER2D(colorBuffer, 1); TORQUE_UNIFORM_SAMPLER2D(matInfoBuffer, 2); -TORQUE_UNIFORM_SAMPLER2D(backbufferTex, 3); -TORQUE_UNIFORM_SAMPLER2D(glowBuffer, 4); +TORQUE_UNIFORM_SAMPLER2D(ssaoMaskTex, 3); +TORQUE_UNIFORM_SAMPLER2D(backbufferTex, 4); +TORQUE_UNIFORM_SAMPLER2D(glowBuffer, 5); uniform float mode; uniform float3 eyePosWorld; @@ -73,8 +74,10 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0 else if(mode == 11) return float4(surface.F.rgb,1); else if(mode == 12) - float4(TORQUE_TEX2D( backbufferTex, IN.uv0 ).rgb, 1.0); + float4(TORQUE_TEX2D( ssaoMaskTex, IN.uv0 ).rgb, 1.0); else if(mode == 13) + float4(TORQUE_TEX2D( backbufferTex, IN.uv0 ).rgb, 1.0); + else if(mode == 14) float4(TORQUE_TEX2D( glowBuffer, IN.uv0 ).rgb, 1.0); return float4(0,0,0,1); diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shaders/Viz_TexelDensityV.hlsl b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shaders/Viz_TexelDensityV.hlsl new file mode 100644 index 000000000..bf6690bd0 --- /dev/null +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/shaders/Viz_TexelDensityV.hlsl @@ -0,0 +1,44 @@ +//----------------------------------------------------------------------------- +// Copyright (c) 2012 GarageGames, LLC +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +// IN THE SOFTWARE. +//----------------------------------------------------------------------------- + +#include "../../../../core/rendering/shaders/postFX/postFx.hlsl" +#include "../../../../core/rendering/shaders/torque.hlsl" + +uniform float4 rtParams0; +uniform float4 rtParams1; +uniform float4 rtParams2; +uniform float4 rtParams3; + +PFXVertToPix main( PFXVert IN ) +{ + PFXVertToPix OUT; + + OUT.hpos = float4(IN.pos,1.0); + OUT.uv0 = viewportCoordToRenderTarget( IN.uv, rtParams0 ); + OUT.uv1 = viewportCoordToRenderTarget( IN.uv, rtParams1 ); + OUT.uv2 = viewportCoordToRenderTarget( IN.uv, rtParams2 ); + OUT.uv3 = viewportCoordToRenderTarget( IN.uv, rtParams3 ); + + OUT.wsEyeRay = IN.wsEyeRay; + + return OUT; +} \ No newline at end of file diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs index f480ffc6e..17a00af9e 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/visibility/visibilityLayer.ed.cs @@ -91,27 +91,22 @@ function setupEditorVisibilityMenu() item[ 7 ] = "Show Sound Spaces" TAB "" TAB "$SFXSpace::isRenderable = !$SFXSpace::isRenderable;"; }; - EVisibility.addOption( "Debug Render: Player Collision", "$Player::renderCollision", "" ); - EVisibility.addOption( "Debug Render: Terrain", "TerrainBlock::debugRender", "" ); - EVisibility.addOption( "Debug Render: Decals", "$Decals::debugRender", "" ); - EVisibility.addOption( "Debug Render: Light Frustums", "$Light::renderLightFrustums", "" ); - EVisibility.addOption( "Debug Render: Bounding Boxes", "$Scene::renderBoundingBoxes", "" ); - EVisibility.addOption( "Debug Render: Physics World", "$PhysicsWorld::render", "togglePhysicsDebugViz" ); - %debugRenderpopup = new PopupMenu(EVisibilityDebugRenderOptions) { superClass = "MenuBuilder"; class = "EditorWorldMenu"; - item[ 0 ] = "Show Player Collision" TAB "" TAB ""; - item[ 1 ] = "Show Terrain Debug" TAB "" TAB ""; - item[ 2 ] = "Show Decals Debug" TAB "" TAB ""; - item[ 3 ] = "Show Bounding Boxes" TAB "" TAB ""; - item[ 4 ] = "Show Physics World" TAB "" TAB ""; + item[ 0 ] = "Show Player Collision" TAB "" TAB "$Player::renderCollision != $Player::renderCollision;"; + item[ 1 ] = "Show Terrain Debug" TAB "" TAB "$TerrainBlock::debugRender != $TerrainBlock::debugRender;"; + item[ 2 ] = "Show Decals Debug" TAB "" TAB "$Decals::debugRender != $Decals::debugRender;"; + item[ 3 ] = "Show Bounding Boxes" TAB "" TAB "$Scene::renderBoundingBoxes != $Scene::renderBoundingBoxes;"; + item[ 4 ] = "Show Physics World" TAB "" TAB "$PhysicsWorld::render != $PhysicsWorld::render;"; item[ 5 ] = "Show Player Collision" TAB "" TAB ""; item[ 6 ] = "Show Texel Density" TAB "" TAB "toggleTexelDensityViz();"; }; + %probespopup.enableItem(6, false); + // //Lighting stuff %lightingModepopup = new PopupMenu(EVisibilityLightingModesOptions) @@ -119,21 +114,23 @@ function setupEditorVisibilityMenu() superClass = "MenuBuilder"; class = "EditorWorldMenu"; - item[ 0 ] = "Lit" TAB "" TAB ""; - item[ 1 ] = "Unlit" TAB "" TAB ""; - item[ 2 ] = "No Shadows" TAB "" TAB "$Shadows::disable = !$Shadows::disable;"; - item[ 3 ] = "Detail Lighting" TAB "" TAB ""; - item[ 4 ] = "Lighting Only" TAB "" TAB ""; - item[ 5 ] = "Reflections Only" TAB "" TAB ""; + item[ 0 ] = "Lit" TAB "" TAB "setLightingMode(\"Lit\");"; + item[ 1 ] = "Unlit" TAB "" TAB "setLightingMode(\"Unlit\");"; + item[ 2 ] = "No Shadows" TAB "" TAB "setLightingMode(\"NoShadows\");"; + item[ 3 ] = "Detail Lighting" TAB "" TAB "setLightingMode(\"DetailLighting\");"; + item[ 4 ] = "Lighting Only" TAB "" TAB "setLightingMode(\"LightingOnly\");"; + item[ 5 ] = "Reflections Only" TAB "" TAB "setLightingMode(\"ReflectionsOnly\");"; }; + EVisibilityLightingModesOptions.checkItem(0, true); + %lightspopup = new PopupMenu(EVisibilityLightsOptions) { superClass = "MenuBuilder"; class = "EditorWorldMenu"; - item[ 0 ] = "Show Light Frustums" TAB "" TAB "$Light::renderLightFrustums = !$Light::renderLightFrustums;"; - item[ 1 ] = "Show Shadowmap Cascades" TAB "" TAB "$AL::PSSMDebugRender = !$AL::PSSMDebugRender;"; + item[ 0 ] = "Show Light Frustums" TAB "" TAB "toggleLightFrustumViz();"; + item[ 1 ] = "Show Shadowmap Cascades" TAB "" TAB "togglePSSMDebugViz();"; item[ 2 ] = "Show Specular Light" TAB "" TAB ""; item[ 3 ] = "Show Diffuse Light" TAB "" TAB ""; }; @@ -145,22 +142,14 @@ function setupEditorVisibilityMenu() superClass = "MenuBuilder"; class = "EditorWorldMenu"; - item[ 0 ] = "Show Probe Attenuation" TAB "" TAB "toggleProbeVis(\"Attenuation\");"; - item[ 1 ] = "Show Probe Contribution" TAB "" TAB "toggleProbeVis(\"Contribution\");"; - item[ 2 ] = "Show Probe Specular Reflections" TAB "" TAB "toggleProbeVis(\"Specular\");"; - item[ 3 ] = "Show Probe Diffuse Reflections" TAB "" TAB "toggleProbeVis(\"Diffuse\");"; + item[ 0 ] = "Show Probe Attenuation" TAB "" TAB "toggleProbeViz(\"Attenuation\");"; + item[ 1 ] = "Show Probe Contribution" TAB "" TAB "toggleProbeViz(\"Contribution\");"; + item[ 2 ] = "Show Probe Specular Reflections Only" TAB "" TAB "toggleProbeViz(\"Specular\");"; + item[ 3 ] = "Show Probe Diffuse Reflections Only" TAB "" TAB "toggleProbeViz(\"Diffuse\");"; item[ 4 ] = "Enable Live Updates on Selected Probe" TAB "" TAB ""; }; - %lightingpopup = new PopupMenu(EVisibilityLightingOptions) - { - superClass = "MenuBuilder"; - class = "EditorWorldMenu"; - - item[ 0 ] = "Lighting Modes" TAB EVisibilityLightingModesOptions; - item[ 1 ] = "Lights" TAB EVisibilityLightsOptions; - item[ 2 ] = "Probes" TAB EVisibilityProbesOptions; - }; + %probespopup.enableItem(4, false); // //Buffer Viz @@ -185,8 +174,10 @@ function setupEditorVisibilityMenu() item[ 11 ] = "Fresnel" TAB "" TAB "toggleSurfacePropertiesViz(\"Fresnel\");"; - item[ 12 ] = "Backbuffer" TAB "" TAB "toggleSurfacePropertiesViz(\"Backbuffer\");"; - item[ 13 ] = "Glow" TAB "" TAB "toggleSurfacePropertiesViz(\"Glow\");"; + item[ 12 ] = "Ambient Occlusion" TAB "" TAB "toggleSurfacePropertiesViz(\"SSAO\");"; + + item[ 13 ] = "Backbuffer" TAB "" TAB "toggleSurfacePropertiesViz(\"Backbuffer\");"; + item[ 14 ] = "Glow" TAB "" TAB "toggleSurfacePropertiesViz(\"Glow\");"; }; // @@ -232,10 +223,12 @@ function setupEditorVisibilityMenu() item[ 7 ] = "Disable Zone Culling" TAB "" TAB "$Scene::disableZoneCulling = !$Scene::disableZoneCulling;"; item[ 8 ] = "Disable Terrain Culling" TAB "" TAB "$Scene::disableTerrainOcclusion = !$Scene::disableTerrainOcclusion;"; item[ 9 ] = "-" TAB "" TAB ""; - item[ 10 ] = "Lighting" TAB EVisibilityLightingOptions; - item[ 11 ] = "Buffer Visualization" TAB EVisibilityBufferVizOptions; - item[ 12 ] = "-" TAB "" TAB ""; - item[ 13 ] = "Class Visibility" TAB EVisibilityClassVizOptions; + item[ 10 ] = "Lighting Modes" TAB EVisibilityLightingModesOptions; + item[ 11 ] = "Lights" TAB EVisibilityLightsOptions; + item[ 12 ] = "Probes" TAB EVisibilityProbesOptions; + item[ 13 ] = "Buffer Visualization" TAB EVisibilityBufferVizOptions; + item[ 14 ] = "-" TAB "" TAB ""; + item[ 15 ] = "Class Visibility" TAB EVisibilityClassVizOptions; }; } @@ -418,3 +411,16 @@ function togglePhysicsDebugViz( %enable ) physicsDebugDraw(%enable); } } + +function disableVisualizers() +{ + //Set lighting mode to lit + resetLightingMode(); + + disableSurfacePropertiesViz(); + disableColorblindnessViz(); + disablePSSMDebugViz(); + disableLightingOnlyViz(); + disableReflectionsOnlyViz(); + disableProbeViz(); +} \ No newline at end of file