Browse Source

Include materialball shape asset info
Includes spectatorGameplay by default for streamline testing for now
Adds in reparentItem for GuiTreeViewCtrl
Added gitignore to shaderCache/.gitignore
Fixed material asset import logic to properly parent included images to the material
Includes D3D_Compiler47.dll for dependency compliance, and modified cmake file to not install said dll if not using D3D11 API

Areloch 6 năm trước cách đây
mục cha
commit
d9f80140f1
99 tập tin đã thay đổi với 3056 bổ sung334 xóa
  1. 397 323
      Engine/source/gui/controls/guiTreeViewCtrl.cpp
  2. 6 0
      Engine/source/gui/controls/guiTreeViewCtrl.h
  3. 5 0
      Templates/BaseGame/game/data/StaticShapeTest/Shapes/materials.cs
  4. 3 0
      Templates/BaseGame/game/data/shaderCache/.gitignore
  5. 69 0
      Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.cs
  6. 15 0
      Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.module
  7. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_heavy.dds
  8. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_light.dds
  9. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_med.dds
  10. 97 0
      Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.DAE
  11. 8 0
      Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.cs
  12. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/lights/corona.png
  13. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet0.png
  14. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet1.png
  15. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensflareSheet3.png
  16. 30 0
      Templates/BaseGame/game/data/spectatorGameplay/art/lights/materials.cs
  17. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_black.png
  18. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_blue.png
  19. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen.png
  20. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen_lines.png
  21. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_green.png
  22. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey.png
  23. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey_base.png
  24. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange.png
  25. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange_lines.png
  26. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_red.png
  27. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/black.png
  28. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/fizz_noise.dds
  29. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/gray.png
  30. 17 0
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/materials.cs
  31. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/splash.bmp
  32. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/misc/white.png
  33. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/particles/defaultParticle.png
  34. 87 0
      Templates/BaseGame/game/data/spectatorGameplay/art/particles/ribbon/materials.cs
  35. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureOther.png
  36. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureTop.png
  37. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath.png
  38. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath_normal.png
  39. 42 0
      Templates/BaseGame/game/data/spectatorGameplay/art/roads/materials.cs
  40. 1 0
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/.gitignore
  41. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/blue.jpg
  42. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.dts
  43. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.mb
  44. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.png
  45. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/green.jpg
  46. 67 0
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/materials.cs
  47. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.3ds
  48. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.dts
  49. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.3ds
  50. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.dts
  51. 10 0
      Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.mtl
  52. 19 0
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/materials.cs
  53. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_1.jpg
  54. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_2.jpg
  55. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_3.jpg
  56. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_4.jpg
  57. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_5.jpg
  58. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_6.jpg
  59. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud1.png
  60. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud2.png
  61. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud3.png
  62. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/clouds_normal_displacement.png
  63. 53 0
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/materials.cs
  64. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_noglow.png
  65. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wcorona.png
  66. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wglow.png
  67. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_1.png
  68. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_2.png
  69. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_3.png
  70. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_4.png
  71. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_5.png
  72. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_6.png
  73. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/water/depthcolor_ramp.png
  74. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/water/foam.dds
  75. BIN
      Templates/BaseGame/game/data/spectatorGameplay/art/water/ripple.dds
  76. 7 0
      Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.asset.taml
  77. 109 0
      Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.mis
  78. 51 0
      Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.postfxpreset.cs
  79. BIN
      Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room_preview.png
  80. 118 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/client/default.keybinds.cs
  81. 426 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/client/inputCommands.cs
  82. 4 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/camera.cs
  83. 66 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/defaultParticle.cs
  84. 608 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/lights.cs
  85. 24 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDatablocks.cs
  86. 25 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDecalData.cs
  87. 21 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedForestItemData.cs
  88. 24 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleData.cs
  89. 24 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleEmitterData.cs
  90. 39 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/markers.cs
  91. 46 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/ribbons.cs
  92. 22 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/sounds.cs
  93. 80 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.cs
  94. 39 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.gui
  95. 193 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/server/DefaultGame.cs
  96. 106 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/server/VolumetricFog.cs
  97. 85 0
      Templates/BaseGame/game/data/spectatorGameplay/scripts/server/camera.cs
  98. 9 11
      Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs
  99. 4 0
      Tools/CMake/torque3d.cmake

+ 397 - 323
Engine/source/gui/controls/guiTreeViewCtrl.cpp

@@ -1035,7 +1035,7 @@ void GuiTreeViewCtrl::_destroyTree()
    {
       Item *pFreeItem = mItems[ i ];
       if( pFreeItem != NULL )
-         delete pFreeItem;
+         _destroyItem(pFreeItem);
    }
 
    mItems.clear();
@@ -3145,328 +3145,7 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event)
       
       // Reparent the items.
 
-      for (S32 i = 0; i <mSelectedItems.size();i++) 
-      {
-         newItem = newItem2;
-         Item * item = mSelectedItems[i];
-
-         if (mDebug) Con::printf("----------------------------");
-      
-         // clear old highlighting of the item
-         item->mState.clear(Item::MouseOverBmp | Item::MouseOverText );
-
-         // move the selected item to the newItem
-         Item* oldParent = item->mParent;
-         // Snag the current parent set if any for future reference
-         SimSet *parentSet = NULL;
-
-         if(oldParent->isInspectorData())
-            parentSet = dynamic_cast<SimSet*>(oldParent->getObject());
-         else 
-         {
-            // parent is probably script data so we search up the tree for a
-            // set to put our object in
-            Item * temp = oldParent;
-            while (temp) 
-            {
-               if (temp->isInspectorData())
-                  break;
-               temp = temp->mParent;
-            }
-            // found an ancestor who is an inspectorData
-            if (temp) 
-            {
-               if (temp->isInspectorData())
-                  parentSet = dynamic_cast<SimSet*>(temp->getObject());
-            }
-         }
-         
-         // unlink from the current position in the list
-         unlinkItem(item);
-
-         // update the parent's children
-
-         // check if we an only child
-         if (item->mParent->mChild == item)
-         {
-            if (item->mNext)
-               item->mParent->mChild = item->mNext;
-            else
-               item->mParent->mChild = NULL;
-         }
-
-         if (mDragMidPoint != NomDragMidPoint)
-         {
-
-            //if it is below an expanded tree, place as last item in the tree
-            //if it is below a parent who isn't expanded put below it
-
-            // position the item above or below another item
-            if (mDragMidPoint == AbovemDragMidPoint)
-            {
-               // easier to treat everything as "Below the mDragMidPoint" so make some adjustments
-               if (mDebug) Con::printf("adding item above mDragMidPoint");
-
-               // above the mid point of an item, so grab either the parent
-               // or the previous sibling
-
-               // does the item have a previous sibling?
-               if (newItem->mPrevious)
-               {
-                  newItem = newItem->mPrevious;
-
-                  if (mDebug) Con::printf("treating as if below an item that isn't expanded");
-
-                  // otherwise add below that item as a sibling
-                  item->mParent = newItem->mParent;
-                  item->mPrevious = newItem;
-                  item->mNext = newItem->mNext;
-                  if (newItem->mNext)
-                     newItem->mNext->mPrevious = item;
-                  newItem->mNext = item;                  
-               } 
-               else
-               {
-                  if (mDebug) Con::printf("treating as if adding below the parent of the item");
-
-                  // instead we add as the first item below the newItem's parent
-                  item->mParent = newItem->mParent;
-                  item->mNext = newItem;
-                  item->mPrevious = NULL;
-                  newItem->mPrevious = item;
-                  item->mParent->mChild = item;
-               }
-            }
-            else if (mDragMidPoint == BelowmDragMidPoint)
-            {
-               if ((newItem->isParent())&&(newItem->isExpanded()))
-               {
-                  if (mDebug) Con::printf("adding item to an expanded parent below the mDragMidPoint");
-
-                  item->mParent = newItem;
-
-                  // then add the new item as a child
-                  item->mNext = newItem->mChild;
-                  if (newItem->mChild)
-                     newItem->mChild->mPrevious = item;
-                  item->mParent->mChild = item;
-                  item->mPrevious = NULL;
-               }
-               else if ((!newItem->mNext)&&(newItem->mParent)&&(newItem->mParent->mParent)) 
-               {
-                  // add below it's parent.
-                  if (mDebug) Con::printf("adding below a tree");
-
-                  item->mParent = newItem->mParent->mParent;
-                  item->mNext = newItem->mParent->mNext;
-                  item->mPrevious = newItem->mParent;
-
-                  if (newItem->mParent->mNext)
-                     newItem->mParent->mNext->mPrevious = item;
-
-                  newItem->mParent->mNext = item;
-               }
-               else 
-               {
-                  // adding below item not as a child
-                  if (mDebug) Con::printf("adding item below the mDragMidPoint of an item");
-
-                  item->mParent = newItem->mParent;
-                  // otherwise the item is a sibling
-                  if (newItem->mNext)
-                     newItem->mNext->mPrevious = item;
-                  item->mNext = newItem->mNext;
-                  item->mPrevious = newItem;
-                  newItem->mNext = item;
-               }
-            }
-         }
-         // if we're not allowed to add to items, then try to add to the parent of the hit item.
-         // if we are, just add to the item we hit.
-         else 
-         {
-            if (mDebug) 
-            {
-               if (item->isInspectorData() && item->getObject())
-                  Con::printf("Item: %i",item->getObject()->getId());
-               if (newItem->isInspectorData() && newItem->getObject())
-                  Con::printf("Parent: %i",newItem->getObject()->getId());
-               Con::printf("dragged onto an item");
-            }
-            
-            // If the hit item is not a valid drag target,
-            // then try to add to the parent.
-            
-            if( !isValidDragTarget( newItem ) )
-            {
-                // add to the item's parent.
-               if(!newItem->mParent || !newItem->mParent->isParent())
-               {
-                  if(mDebug)
-                     Con::printf("could not find the parent of that item. dragging to an item is not allowed, kicking out.");
-                  mDragMidPoint = NomDragMidPoint;
-                  continue;
-               }
-               newItem = newItem->mParent;
-            }
-
-            // new parent is the item in the current cell
-            item->mParent = newItem;
-
-            // adjust children if any
-            if (newItem->mChild)
-            {
-               if (mDebug) Con::printf("not the first child");
-
-               // put it at the top of the list (easier to find if there are many children)
-               if (newItem->mChild)
-                  newItem->mChild->mPrevious = item;
-               item->mNext = newItem->mChild;
-               newItem->mChild = item;
-               item->mPrevious = NULL;
-            }
-            else 
-            {
-               if (mDebug) Con::printf("first child");
-
-               // only child
-               newItem->mChild = item;
-               item->mNext = NULL;
-               item->mPrevious = NULL;
-            }
-         }
-
-         // expand the item we added to, if it isn't expanded already
-         if( !item->mParent->mState.test( Item::Expanded ) )
-            setItemExpanded( item->mParent->mId, true );
-
-         //----------------------------------------------------------------
-         // handle objects
-
-         // Get our active SimObject if any
-         SimObject *simObj = NULL;
-         if(item->isInspectorData()) 
-         {
-            simObj = item->getObject();
-         }
-
-         // Remove from the old parentset
-         if((simObj && parentSet)&&(oldParent != item->mParent))
-         {
-            if (mDebug) Con::printf("removing item from old parentset");
-         
-            // hack to get around the way removeObject takes the last item of the set
-            // and moves it into the place of the object we removed
-            if (parentSet->size()>0)
-            {
-               SimObject *lastObject = parentSet->last();
-               parentSet->removeObject(simObj);
-               parentSet->reOrder(lastObject);
-            }
-            else
-            {
-               parentSet->removeObject(simObj);
-            }
-         }
-
-         // Snag the newparent set if any...
-         SimSet *newParentSet = NULL;
-
-         if(item->mParent->isInspectorData()) 
-         {
-            if (mDebug) Con::printf("getting a new parent set");
-
-            SimObject * tmpObj = item->mParent->getObject();
-            newParentSet = dynamic_cast<SimSet*>(tmpObj);
-         }
-         else
-         {
-            // parent is probably script data so we search up the tree for a
-            // set to put our object in
-            if (mDebug) Con::printf("oh nos my parent is script!");
-
-            Item * temp = item->mParent;
-            while (temp) 
-            {
-               if (temp->isInspectorData())
-                  break;
-               temp = temp->mParent;
-            }
-            
-            // found a ancestor who is an inspectorData
-            if (temp) 
-            {
-               if (temp->isInspectorData())
-                  newParentSet = dynamic_cast<SimSet*>(temp->getObject());
-            } 
-            else 
-            {
-               newParentSet = NULL;
-            }
-         }
-
-         if(simObj && newParentSet)
-         {
-            if (mDebug) Con::printf("simobj and new ParentSet");
-
-            if (oldParent != item->mParent)
-               newParentSet->addObject(simObj);
-
-            //order the objects in the simset according to their
-            //order in the tree view control
-            if(!item->mNext)
-            {
-               if( item->mPrevious )
-               {
-                  //bring to the end of the set
-                  SimObject *prevObject = item->mPrevious->getObject();
-                  if (prevObject && item->getObject()) 
-                  {
-                     newParentSet->reOrder(item->getObject(), prevObject);
-                  }
-               }
-            }
-            else
-            {
-               //reorder within the set
-               SimObject *nextObject = item->mNext->getObject();
-               if(nextObject && item->getObject())
-               {
-                  newParentSet->reOrder(item->getObject(), nextObject);
-               }
-            }
-         } 
-         else if (!simObj&&newParentSet) 
-         {
-            // our current item is script data. but it may have children who
-            // is inspector data who need an updated set
-            if (mDebug) Con::printf("no simobj but new parentSet");
-            if (item->mChild)
-               inspectorSearch(item->mChild, item, parentSet, newParentSet);
-
-         }
-         else if (simObj&&!newParentSet) 
-         {
-            if (mDebug) Con::printf("simobject and no new parent set");
-         }
-         else
-            if (mDebug) Con::printf("no simobject and no new parent set");
-
-         // Notify script.
-
-         if( item->isInspectorData() )
-            onReparent_callback(
-               item->getObject()->getId(),
-               oldParent->getObject()->getId(),
-               item->mParent->getObject()->getId()
-            );
-         else
-            onReparent_callback(
-               item->mId,
-               oldParent->mId,
-               item->mParent->mId
-            );
-      }
+      reparentItems(mSelectedItems, newItem2);
       
       onEndReparenting_callback();
 
@@ -4798,6 +4477,362 @@ void GuiTreeViewCtrl::setItemFilterException(U32 item, bool isExempted)
    }
 }
 
+void GuiTreeViewCtrl::reparentItems(Vector<Item*> selectedItems, Item* newParent)
+{
+   for (S32 i = 0; i < selectedItems.size(); i++)
+   {
+      Item* item = selectedItems[i];
+
+      if (mDebug)
+         Con::printf("----------------------------");
+
+      // clear old highlighting of the item
+      item->mState.clear(Item::MouseOverBmp | Item::MouseOverText);
+
+      // move the selected item to the newParent
+      Item * oldParent = item->mParent;
+      // Snag the current parent set if any for future reference
+      SimSet * parentSet = NULL;
+
+      if (oldParent != nullptr && oldParent->isInspectorData())
+      {
+         parentSet = dynamic_cast<SimSet*>(oldParent->getObject());
+      }
+      else
+      {
+         // parent is probably script data so we search up the tree for a
+         // set to put our object in
+         Item* temp = oldParent;
+         while (temp)
+         {
+            if (temp->isInspectorData())
+               break;
+            temp = temp->mParent;
+         }
+         // found an ancestor who is an inspectorData
+         if (temp)
+         {
+            if (temp->isInspectorData())
+               parentSet = dynamic_cast<SimSet*>(temp->getObject());
+         }
+      }
+
+      // unlink from the current position in the list
+      unlinkItem(item);
+
+      // update the parent's children
+
+      // check if we an only child
+      if (item->mParent->mChild == item)
+      {
+         if (item->mNext)
+            item->mParent->mChild = item->mNext;
+         else
+            item->mParent->mChild = NULL;
+      }
+
+      if (mDragMidPoint != NomDragMidPoint)
+      {
+
+         //if it is below an expanded tree, place as last item in the tree
+         //if it is below a parent who isn't expanded put below it
+
+         // position the item above or below another item
+         if (mDragMidPoint == AbovemDragMidPoint)
+         {
+            // easier to treat everything as "Below the mDragMidPoint" so make some adjustments
+            if (mDebug)
+               Con::printf("adding item above mDragMidPoint");
+
+            // above the mid point of an item, so grab either the parent
+            // or the previous sibling
+
+            // does the item have a previous sibling?
+            if (newParent->mPrevious)
+            {
+               newParent = newParent->mPrevious;
+
+               if (mDebug)
+                  Con::printf("treating as if below an item that isn't expanded");
+
+               // otherwise add below that item as a sibling
+               item->mParent = newParent->mParent;
+               item->mPrevious = newParent;
+               item->mNext = newParent->mNext;
+               if (newParent->mNext)
+                  newParent->mNext->mPrevious = item;
+               newParent->mNext = item;
+            }
+            else
+            {
+               if (mDebug)
+                  Con::printf("treating as if adding below the parent of the item");
+
+               // instead we add as the first item below the newParent's parent
+               item->mParent = newParent->mParent;
+               item->mNext = newParent;
+               item->mPrevious = NULL;
+               newParent->mPrevious = item;
+               item->mParent->mChild = item;
+            }
+         }
+         else if (mDragMidPoint == BelowmDragMidPoint)
+         {
+            if ((newParent->isParent()) && (newParent->isExpanded()))
+            {
+               if (mDebug)
+                  Con::printf("adding item to an expanded parent below the mDragMidPoint");
+
+               item->mParent = newParent;
+
+               // then add the new item as a child
+               item->mNext = newParent->mChild;
+               if (newParent->mChild)
+                  newParent->mChild->mPrevious = item;
+               item->mParent->mChild = item;
+               item->mPrevious = NULL;
+            }
+            else if ((!newParent->mNext) && (newParent->mParent) && (newParent->mParent->mParent))
+            {
+               // add below it's parent.
+               if (mDebug)
+                  Con::printf("adding below a tree");
+
+               item->mParent = newParent->mParent->mParent;
+               item->mNext = newParent->mParent->mNext;
+               item->mPrevious = newParent->mParent;
+
+               if (newParent->mParent->mNext)
+                  newParent->mParent->mNext->mPrevious = item;
+
+               newParent->mParent->mNext = item;
+            }
+            else
+            {
+               // adding below item not as a child
+               if (mDebug)
+                  Con::printf("adding item below the mDragMidPoint of an item");
+
+               item->mParent = newParent->mParent;
+               // otherwise the item is a sibling
+               if (newParent->mNext)
+                  newParent->mNext->mPrevious = item;
+               item->mNext = newParent->mNext;
+               item->mPrevious = newParent;
+               newParent->mNext = item;
+            }
+         }
+      }
+      // if we're not allowed to add to items, then try to add to the parent of the hit item.
+      // if we are, just add to the item we hit.
+      else
+      {
+         if (mDebug)
+         {
+            if (item->isInspectorData() && item->getObject())
+               Con::printf("Item: %i", item->getObject()->getId());
+            if (newParent->isInspectorData() && newParent->getObject())
+               Con::printf("Parent: %i", newParent->getObject()->getId());
+            Con::printf("dragged onto an item");
+         }
+
+         // If the hit item is not a valid drag target,
+         // then try to add to the parent.
+
+         if (!isValidDragTarget(newParent))
+         {
+            // add to the item's parent.
+            if (!newParent->mParent || !newParent->mParent->isParent())
+            {
+               if (mDebug)
+                  Con::printf("could not find the parent of that item. dragging to an item is not allowed, kicking out.");
+               mDragMidPoint = NomDragMidPoint;
+               continue;
+            }
+            newParent = newParent->mParent;
+         }
+
+         // new parent is the item in the current cell
+         item->mParent = newParent;
+
+         // adjust children if any
+         if (newParent->mChild)
+         {
+            if (mDebug) Con::printf("not the first child");
+
+            // put it at the top of the list (easier to find if there are many children)
+            if (newParent->mChild)
+               newParent->mChild->mPrevious = item;
+            item->mNext = newParent->mChild;
+            newParent->mChild = item;
+            item->mPrevious = NULL;
+         }
+         else
+         {
+            if (mDebug) Con::printf("first child");
+
+            // only child
+            newParent->mChild = item;
+            item->mNext = NULL;
+            item->mPrevious = NULL;
+         }
+      }
+
+      // expand the item we added to, if it isn't expanded already
+      if (!item->mParent->mState.test(Item::Expanded))
+         setItemExpanded(item->mParent->mId, true);
+
+      //----------------------------------------------------------------
+      // handle objects
+
+      // Get our active SimObject if any
+      SimObject* simObj = NULL;
+      if (item->isInspectorData())
+      {
+         simObj = item->getObject();
+      }
+
+      // Remove from the old parentset
+      if ((simObj && parentSet) && (oldParent != item->mParent))
+      {
+         if (mDebug)
+            Con::printf("removing item from old parentset");
+
+         // hack to get around the way removeObject takes the last item of the set
+         // and moves it into the place of the object we removed
+         if (parentSet->size() > 0)
+         {
+            SimObject* lastObject = parentSet->last();
+            parentSet->removeObject(simObj);
+            parentSet->reOrder(lastObject);
+         }
+         else
+         {
+            parentSet->removeObject(simObj);
+         }
+      }
+
+      // Snag the newparent set if any...
+      SimSet* newParentSet = NULL;
+
+      if (item->mParent->isInspectorData())
+      {
+         if (mDebug)
+            Con::printf("getting a new parent set");
+
+         SimObject* tmpObj = item->mParent->getObject();
+         newParentSet = dynamic_cast<SimSet*>(tmpObj);
+      }
+      else
+      {
+         // parent is probably script data so we search up the tree for a
+         // set to put our object in
+         if (mDebug)
+            Con::printf("oh nos my parent is script!");
+
+         Item* temp = item->mParent;
+         while (temp)
+         {
+            if (temp->isInspectorData())
+               break;
+            temp = temp->mParent;
+         }
+
+         // found a ancestor who is an inspectorData
+         if (temp)
+         {
+            if (temp->isInspectorData())
+               newParentSet = dynamic_cast<SimSet*>(temp->getObject());
+         }
+         else
+         {
+            newParentSet = NULL;
+         }
+      }
+
+      if (simObj && newParentSet)
+      {
+         if (mDebug)
+            Con::printf("simobj and new ParentSet");
+
+         if (oldParent != item->mParent)
+            newParentSet->addObject(simObj);
+
+         //order the objects in the simset according to their
+         //order in the tree view control
+         if (!item->mNext)
+         {
+            if (item->mPrevious)
+            {
+               //bring to the end of the set
+               SimObject* prevObject = item->mPrevious->getObject();
+               if (prevObject && item->getObject())
+               {
+                  newParentSet->reOrder(item->getObject(), prevObject);
+               }
+            }
+         }
+         else
+         {
+            //reorder within the set
+            SimObject* nextObject = item->mNext->getObject();
+            if (nextObject && item->getObject())
+            {
+               newParentSet->reOrder(item->getObject(), nextObject);
+            }
+         }
+      }
+      else if (!simObj && newParentSet)
+      {
+         // our current item is script data. but it may have children who
+         // is inspector data who need an updated set
+         if (mDebug)
+            Con::printf("no simobj but new parentSet");
+         if (item->mChild)
+            inspectorSearch(item->mChild, item, parentSet, newParentSet);
+
+      }
+      else if (simObj && !newParentSet)
+      {
+         if (mDebug)
+            Con::printf("simobject and no new parent set");
+      }
+      else
+         if (mDebug)
+            Con::printf("no simobject and no new parent set");
+
+      // Notify script.
+
+      if (item->isInspectorData())
+      {
+         if (item->getObject() && oldParent->getObject() && item->mParent->getObject())
+            onReparent_callback(
+               item->getObject()->getId(),
+               oldParent->getObject()->getId(),
+               item->mParent->getObject()->getId()
+            );
+      }
+      else
+      {
+         onReparent_callback(
+            item->mId,
+            oldParent->mId,
+            item->mParent->mId
+         );
+      }
+   }
+}
+
+S32 GuiTreeViewCtrl::getTabLevel(S32 itemId)
+{
+   Item* item = getItem(itemId);
+   if (item != nullptr)
+   {
+      return item->mTabLevel;
+   }
+
+   return 0;
+}
 //=============================================================================
 //    Console Methods.
 //=============================================================================
@@ -5633,3 +5668,42 @@ DefineEngineMethod(GuiTreeViewCtrl, getItemAtPosition, S32, (Point2I position),
 {
    return object->getItemAtPosition(position);
 }
+
+DefineEngineMethod(GuiTreeViewCtrl, reparentItem, void, (S32 itemId, S32 parentId), (0, 0),
+   "Check whether the given item is currently selected in the tree.\n\n"
+   "@param id Item/object ID.\n"
+   "@return True if the given item/object is currently selected in the tree.")
+{
+   if (itemId == parentId || itemId < 0 || parentId < 0)
+      return;
+
+   const Vector< GuiTreeViewCtrl::Item* > & selectedItems = object->getItems();
+   Vector<GuiTreeViewCtrl::Item*> items;
+   GuiTreeViewCtrl::Item * parent = nullptr;
+
+   for (S32 i = 0; i < selectedItems.size(); ++i)
+   {
+      if (selectedItems[i]->mId == itemId)
+      {
+         items.push_back(selectedItems[i]);
+      }
+
+      if (selectedItems[i]->mId == parentId)
+      {
+         parent = selectedItems[i];
+      }
+   }
+
+   if (!items.empty() && parent != nullptr)
+   {
+      object->reparentItems(items, parent);
+   }
+}
+
+DefineEngineMethod(GuiTreeViewCtrl, getTabLevel, S32, (S32 itemId), (0),
+   "Get the tree item at the passed in position.\n\n"
+   "@param position The position to check for what item is below it.\n"
+   "@return The id of the item under the position.")
+{
+   return object->getTabLevel(itemId);
+}

+ 6 - 0
Engine/source/gui/controls/guiTreeViewCtrl.h

@@ -485,6 +485,8 @@ class GuiTreeViewCtrl : public GuiArrayCtrl
       const Vector< Item* >& getSelectedItems() const { return mSelectedItems; }
       const Vector< S32 >& getSelected() const { return mSelected; }
 
+      const Vector< Item* >& getItems() const { return mItems; }
+
       bool isSelected(S32 itemId)
       {
          return isSelected( getItem( itemId ) );
@@ -580,6 +582,10 @@ class GuiTreeViewCtrl : public GuiArrayCtrl
       /// Clear the current item filtering pattern.
       void clearFilterText() { setFilterText( String::EmptyString ); }
 
+      void reparentItems(Vector<Item*> selectedItems, Item* newParent);
+
+      S32 getTabLevel(S32 itemId);
+
       /// @}
 
       // GuiControl

+ 5 - 0
Templates/BaseGame/game/data/StaticShapeTest/Shapes/materials.cs

@@ -16,4 +16,9 @@ singleton Material(Grid_512_Orange)
    specularPower0 = "0.25";
    emissive[0] = "1";
    translucent = "1";
+   normalMap[0] = "data/pbr/images/FloorEbony_normal.png";
+   invertSmoothness[0] = "1";
+   roughMap[0] = "data/pbr/images/FloorEbony_rough.png";
+   aoMap[0] = "data/pbr/images/FloorEbony_ao.png";
+   metalMap[0] = "data/pbr/images/FloorEbony_metal.png";
 };

+ 3 - 0
Templates/BaseGame/game/data/shaderCache/.gitignore

@@ -0,0 +1,3 @@
+*.hlsl
+*.glsl
+*.h

+ 69 - 0
Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.cs

@@ -0,0 +1,69 @@
+
+// The general flow of a gane - server's creation, loading and hosting clients, and then destruction is as follows:
+
+// First, a client will always create a server in the event that they want to host a single player
+// game. Torque3D treats even single player connections as a soft multiplayer game, with some stuff
+// in the networking short-circuited to sidestep around lag and packet transmission times.
+
+// initServer() is called, loading the default server scripts.
+// After that, if this is a dedicated server session, initDedicated() is called, otherwise initClient is called
+// to prep a playable client session.
+
+// When a local game is started - a listen server - via calling StartGame() a server is created and then the client is
+// connected to it via createAndConnectToLocalServer().
+
+function SpectatorGameplay::create( %this )
+{
+   //server scripts
+   exec("./scripts/server/camera.cs");
+   exec("./scripts/server/DefaultGame.cs");
+   exec("./scripts/server/VolumetricFog.cs");
+   
+   //add DBs
+   if(isObject(DatablockFilesList))
+   {
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/camera.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/defaultParticle.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/lights.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedDatablocks.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedDecalData.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedForestItemData.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedParticleData.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/managedParticleEmitterData.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/markers.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/ribbons.cs" );
+      DatablockFilesList.add( "data/spectatorGameplay/scripts/datablocks/sounds.cs" );
+   }
+   
+   if(isObject(LevelFilesList))
+   {
+      for( %file = findFirstFile( "data/spectatorGameplay/levels/*.mis" );
+      %file !$= "";
+      %file = findNextFile( "data/spectatorGameplay/levels/*.mis" ))
+      {
+         LevelFilesList.add(%file);
+      }
+   }
+   
+   if (!$Server::Dedicated)
+   {
+      //client scripts
+      $KeybindPath = "data/spectatorGameplay/scripts/client/default.keybinds.cs";
+      exec($KeybindPath);
+      
+      %prefPath = getPrefpath();
+      if(isFile(%prefPath @ "/keybinds.cs"))
+         exec(%prefPath @ "/keybinds.cs");
+         
+      exec("data/spectatorGameplay/scripts/client/inputCommands.cs");
+      
+      //guis
+      exec("./scripts/gui/playGui.gui");
+      exec("./scripts/gui/playGui.cs");
+   }
+}
+
+function SpectatorGameplay::destroy( %this )
+{
+   
+}

+ 15 - 0
Templates/BaseGame/game/data/spectatorGameplay/SpectatorGameplay.module

@@ -0,0 +1,15 @@
+<ModuleDefinition
+	ModuleId="SpectatorGameplay"
+	VersionId="1"
+	Description="Default module for the game."
+	ScriptFile="SpectatorGameplay.cs"
+	CreateFunction="create"
+	DestroyFunction="destroy"
+	Group="Game"
+	Dependencies="UI=1">
+	<DeclaredAssets
+        canSave="true"
+        canSaveDynamicFields="true"
+        Extension="asset.taml"
+        Recurse="true" />
+</ModuleDefinition>

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_heavy.dds


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_light.dds


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/environment/FogMod_med.dds


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 97 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.DAE


+ 8 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/environment/Fog_Cube.cs

@@ -0,0 +1,8 @@
+
+singleton TSShapeConstructor(Fog_CubeDAE)
+{
+   baseShape = "./Fog_Cube.DAE";
+   lodType = "TrailingNumber";
+   neverImport = "env*";
+   loadLights = "0";
+};

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/lights/corona.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet0.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensFlareSheet1.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/lights/lensflareSheet3.png


+ 30 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/lights/materials.cs

@@ -0,0 +1,30 @@
+//-----------------------------------------------------------------------------
+// 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( Corona_Mat )
+{
+   emissive = true;
+   translucent = true;
+   mapTo = "corona.png";
+   diffuseMap[0] = "./corona.png";
+   materialTag0 = "FX";
+};

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_black.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_blue.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_forestgreen_lines.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_green.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_grey_base.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_orange_lines.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/512_red.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/black.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/fizz_noise.dds


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/gray.png


+ 17 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/misc/materials.cs

@@ -0,0 +1,17 @@
+singleton Material(White)
+{
+   mapTo = "unmapped_mat";
+   diffuseMap[0] = "data/spectatorGameplay/art/misc/white.png";
+};
+
+singleton Material(Grid_512_Gray)
+{
+   mapTo = "unmapped_mat";
+   diffuseMap[0] = "data/spectatorGameplay/art/misc/512_grey.png";
+};
+
+singleton Material(Orange512_lines)
+{
+   mapTo = "unmapped_mat";
+   diffuseMap[0] = "data/spectatorGameplay/art/misc/512_orange_lines.png";
+};

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/splash.bmp


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/misc/white.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/particles/defaultParticle.png


+ 87 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/particles/ribbon/materials.cs

@@ -0,0 +1,87 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+// This material should work fine for uniformly colored ribbons.
+
+//Basic ribbon shader/////////////////////////////////////////////
+ 
+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;
+};
+
+// This material can render a texture on top of a ribbon.
+
+//Texture ribbon shader/////////////////////////////////////////////
+ 
+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"] = "data/spectatorGameplay/art/ribbons/ribTex.png";
+   
+   preload = true;
+};

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureOther.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultRoadTextureTop.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/roads/defaultpath_normal.png


+ 42 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/roads/materials.cs

@@ -0,0 +1,42 @@
+//-----------------------------------------------------------------------------
+// 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(DefaultDecalRoadMaterial)
+{
+   diffuseMap[0] = "data/spectatorGameplay/art/roads/defaultRoadTextureTop.png";
+   mapTo = "unmapped_mat";
+   materialTag0 = "RoadAndPath";
+};
+
+singleton Material(DefaultRoadMaterialTop)
+{
+   mapTo = "unmapped_mat";
+   diffuseMap[0] = "data/spectatorGameplay/art/roads/defaultRoadTextureTop.png";
+   materialTag0 = "RoadAndPath";
+};
+
+singleton Material(DefaultRoadMaterialOther)
+{
+   mapTo = "unmapped_mat";
+   diffuseMap[0] = "data/spectatorGameplay/art/roads/defaultRoadTextureOther.png";
+   materialTag0 = "RoadAndPath";
+};

+ 1 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/.gitignore

@@ -0,0 +1 @@
+# Keep directory in git repo

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/blue.jpg


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.dts


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.mb


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/camera.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/green.jpg


+ 67 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/materials.cs

@@ -0,0 +1,67 @@
+//-----------------------------------------------------------------------------
+// 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] = "camera";
+
+   translucent = "1";
+   translucentBlendOp = "LerpAlpha";
+   emissive = "0";
+   castShadows = "0";
+
+   colorMultiply[0] = "0 1 0 1";
+};
+
+singleton Material(SimpleConeMat)
+{
+   mapTo = "blue";
+
+   diffuseMap[0] = "blue";
+   translucent = "0";
+   emissive = "1";
+   castShadows = "0";
+};
+
+//--- camera.dts MATERIALS BEGIN ---
+singleton Material(CameraMat)
+{
+   mapTo = "pasted__phongE1";
+
+	diffuseMap[0] = "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 ---

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.3ds


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/octahedron.dts


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.3ds


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.dts


+ 10 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/shapes/simplecone.mtl

@@ -0,0 +1,10 @@
+newmtl simplecone
+Ka 0 0 0
+Kd 0 0.501961 0.752941
+Ks 0 0 0
+Ni 1
+Ns 400
+Tf 1 1 1
+d 1
+map_Kd blue.jpg
+

+ 19 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/materials.cs

@@ -0,0 +1,19 @@
+//-----------------------------------------------------------------------------
+// Torque
+// Copyright GarageGames, LLC 2011
+//-----------------------------------------------------------------------------
+
+singleton CubemapData( BlankSkyCubemap )
+{
+   cubeFace[0] = "./skybox_1";
+   cubeFace[1] = "./skybox_2";
+   cubeFace[2] = "./skybox_3";
+   cubeFace[3] = "./skybox_4";
+   cubeFace[4] = "./skybox_5";
+   cubeFace[5] = "./skybox_6";
+};
+
+singleton Material( BlankSkyMat )
+{
+   cubemap = BlankSkyCubemap;
+};

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_1.jpg


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_2.jpg


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_3.jpg


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_4.jpg


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_5.jpg


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/Blank_sky/skybox_6.jpg


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud1.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud2.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/cloud3.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/clouds/clouds_normal_displacement.png


+ 53 - 0
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/materials.cs

@@ -0,0 +1,53 @@
+//-----------------------------------------------------------------------------
+// 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 CubemapData( NightCubemap )
+{
+   cubeFace[0] = "./skybox_1";
+   cubeFace[1] = "./skybox_2";
+   cubeFace[2] = "./skybox_3";
+   cubeFace[3] = "./skybox_4";
+   cubeFace[4] = "./skybox_5";
+   cubeFace[5] = "./skybox_6";
+};
+
+singleton Material( NightSkyMat )
+{
+   cubemap = NightCubemap;
+   materialTag0 = "Skies";
+};
+
+singleton Material( Moon_Glow_Mat )
+{
+   baseTex = "./moon_wglow.png";
+   emissive = true;
+   translucent = true;
+   vertColor[ 0 ] = true;
+};
+
+singleton Material( Moon_Mat )
+{
+   baseTex = "./moon_noglow.png";
+   emissive = true;
+   translucent = true;
+   vertColor[ 0 ] = true;
+};

BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_noglow.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wcorona.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/moon_wglow.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_1.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_2.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_3.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_4.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_5.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/skies/night/skybox_6.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/water/depthcolor_ramp.png


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/water/foam.dds


BIN
Templates/BaseGame/game/data/spectatorGameplay/art/water/ripple.dds


+ 7 - 0
Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.asset.taml

@@ -0,0 +1,7 @@
+<LevelAsset
+    canSave="true"
+    canSaveDynamicFields="true"
+    AssetName="Empty_Room"
+    LevelFile="data/spectatorGameplay/levels/Empty_Room.mis"
+    LevelDescription="An empty room"
+    VersionId="1" />

+ 109 - 0
Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.mis

@@ -0,0 +1,109 @@
+//--- OBJECT WRITE BEGIN ---
+new Scene(Empty_RoomLevel) {
+   canSave = "1";
+   canSaveDynamicFields = "1";
+      Enabled = "1";
+
+   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";
+      soundDistanceModel = "Linear";
+      class = "DefaultGame";
+      canSave = "1";
+      canSaveDynamicFields = "1";
+         desc0 = "An empty room ready to be populated with Torque objects.";
+         Enabled = "1";
+         levelName = "Empty Room";
+   };
+   new SkyBox(theSky) {
+      Material = "BlankSkyMat";
+      drawBottom = "1";
+      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.8 0.972549 0.996078 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 2000 1000 250";
+      shadowDistance = "400";
+      shadowSoftness = "0.25";
+      numSplits = "4";
+      logWeight = "0.96";
+      fadeStartDistance = "325";
+      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";
+   };
+   new SimGroup(PlayerDropPoints) {
+      canSave = "1";
+      canSaveDynamicFields = "1";
+         Enabled = "1";
+
+      new SpawnSphere(DefaultCameraSpawnSphere) {
+         autoSpawn = "0";
+         spawnTransform = "0";
+         radius = "5";
+         sphereWeight = "1";
+         indoorWeight = "1";
+         outdoorWeight = "1";
+         isAIControlled = "0";
+         dataBlock = "SpawnSphereMarker";
+         position = "0 -23.8079 2";
+         rotation = "1 0 0 0";
+         scale = "1 1 1";
+         canSave = "1";
+         canSaveDynamicFields = "1";
+            Enabled = "1";
+            homingCount = "0";
+            lockCount = "0";
+      };
+   };
+   new GroundPlane() {
+      squareSize = "128";
+      scaleU = "12";
+      scaleV = "12";
+      Material = "Grid_512_Gray";
+      canSave = "1";
+      canSaveDynamicFields = "1";
+         Enabled = "1";
+         position = "0 0 0";
+         rotation = "1 0 0 0";
+         scale = "1 1 1";
+   };
+};
+//--- OBJECT WRITE END ---
+

+ 51 - 0
Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room.postfxpreset.cs

@@ -0,0 +1,51 @@
+$PostFXManager::Settings::ColorCorrectionRamp = "data/postFX/art/null_color_ramp.png";
+$PostFXManager::Settings::DOF::BlurCurveFar = "";
+$PostFXManager::Settings::DOF::BlurCurveNear = "";
+$PostFXManager::Settings::DOF::BlurMax = "";
+$PostFXManager::Settings::DOF::BlurMin = "";
+$PostFXManager::Settings::DOF::EnableAutoFocus = "1";
+$PostFXManager::Settings::DOF::EnableDOF = "";
+$PostFXManager::Settings::DOF::FocusRangeMax = "";
+$PostFXManager::Settings::DOF::FocusRangeMin = "";
+$PostFXManager::Settings::EnableDOF = "1";
+$PostFXManager::Settings::EnableSSAO = "1";
+$PostFXManager::Settings::EnableHDR = "1";
+$PostFXManager::Settings::EnableLightRays = "0";
+$PostFXManager::Settings::EnablePostFX = "1";
+$PostFXManager::Settings::EnableVignette = "1";
+$PostFXManager::Settings::HDR::adaptRate = "2";
+$PostFXManager::Settings::HDR::blueShiftColor = "1.05 0.97 1.27";
+$PostFXManager::Settings::HDR::brightPassThreshold = "1";
+$PostFXManager::Settings::HDR::enableBloom = "1";
+$PostFXManager::Settings::HDR::enableBlueShift = "0";
+$PostFXManager::Settings::HDR::enableToneMapping = "0.346939";
+$PostFXManager::Settings::HDR::gaussMean = "0";
+$PostFXManager::Settings::HDR::gaussMultiplier = "0.3";
+$PostFXManager::Settings::HDR::gaussStdDev = "0.8";
+$PostFXManager::Settings::HDR::keyValue = "0.18";
+$PostFXManager::Settings::HDR::minLuminace = "0.001";
+$PostFXManager::Settings::HDR::whiteCutoff = "1";
+$PostFXManager::Settings::LightRays::brightScalar = "0.75";
+$PostFXManager::Settings::LightRays::decay = "1.0";
+$PostFXManager::Settings::LightRays::density = "0.94";
+$PostFXManager::Settings::LightRays::numSamples = "40";
+$PostFXManager::Settings::LightRays::weight = "5.65";
+$PostFXManager::Settings::SSAO::blurDepthTol = "0.001";
+$PostFXManager::Settings::SSAO::blurNormalTol = "0.95";
+$PostFXManager::Settings::SSAO::lDepthMax = "2";
+$PostFXManager::Settings::SSAO::lDepthMin = "0.2";
+$PostFXManager::Settings::SSAO::lDepthPow = "0.2";
+$PostFXManager::Settings::SSAO::lNormalPow = "2";
+$PostFXManager::Settings::SSAO::lNormalTol = "-0.5";
+$PostFXManager::Settings::SSAO::lRadius = "1";
+$PostFXManager::Settings::SSAO::lStrength = "10";
+$PostFXManager::Settings::SSAO::overallStrength = "2";
+$PostFXManager::Settings::SSAO::quality = "0";
+$PostFXManager::Settings::SSAO::sDepthMax = "1";
+$PostFXManager::Settings::SSAO::sDepthMin = "0.1";
+$PostFXManager::Settings::SSAO::sDepthPow = "1";
+$PostFXManager::Settings::SSAO::sNormalPow = "1";
+$PostFXManager::Settings::SSAO::sNormalTol = "0";
+$PostFXManager::Settings::SSAO::sRadius = "0.1";
+$PostFXManager::Settings::SSAO::sStrength = "6";
+$PostFXManager::Settings::Vignette::VMax = 1.04345;

BIN
Templates/BaseGame/game/data/spectatorGameplay/levels/Empty_Room_preview.png


+ 118 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/client/default.keybinds.cs

@@ -0,0 +1,118 @@
+//-----------------------------------------------------------------------------
+// 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( moveMap ) )
+   moveMap.delete();
+   
+new ActionMap(moveMap);
+
+//------------------------------------------------------------------------------
+// Non-remapable binds
+//------------------------------------------------------------------------------
+moveMap.bindCmd(keyboard, "escape", "", "Canvas.pushDialog(PauseMenu);");
+
+//------------------------------------------------------------------------------
+// Movement Keys
+//------------------------------------------------------------------------------
+moveMap.bind( keyboard, a, moveleft );
+moveMap.bind( keyboard, d, moveright );
+moveMap.bind( keyboard, left, moveleft );
+moveMap.bind( keyboard, right, moveright );
+
+moveMap.bind( keyboard, w, moveforward );
+moveMap.bind( keyboard, s, movebackward );
+moveMap.bind( keyboard, up, moveforward );
+moveMap.bind( keyboard, down, movebackward );
+
+moveMap.bind( keyboard, e, moveup );
+moveMap.bind( keyboard, c, movedown );
+
+moveMap.bind( keyboard, space, jump );
+moveMap.bind( mouse, xaxis, yaw );
+moveMap.bind( mouse, yaxis, pitch );
+
+moveMap.bind( gamepad, thumbrx, "D", "-0.23 0.23", gamepadYaw );
+moveMap.bind( gamepad, thumbry, "D", "-0.23 0.23", gamepadPitch );
+moveMap.bind( gamepad, thumblx, "D", "-0.23 0.23", gamePadMoveX );
+moveMap.bind( gamepad, thumbly, "D", "-0.23 0.23", gamePadMoveY );
+
+moveMap.bind( gamepad, btn_a, jump );
+moveMap.bindCmd( gamepad, btn_back, "disconnect();", "" );
+
+moveMap.bindCmd(gamepad, dpadl, "toggleLightColorViz();", "");
+moveMap.bindCmd(gamepad, dpadu, "toggleDepthViz();", "");
+moveMap.bindCmd(gamepad, dpadd, "toggleNormalsViz();", "");
+moveMap.bindCmd(gamepad, dpadr, "toggleLightSpecularViz();", "");
+
+
+//------------------------------------------------------------------------------
+// Mouse Trigger
+//------------------------------------------------------------------------------
+moveMap.bind( mouse, button0, mouseFire );
+moveMap.bind( mouse, button1, altTrigger );
+
+//------------------------------------------------------------------------------
+// Gamepad Trigger
+//------------------------------------------------------------------------------
+moveMap.bind(gamepad, triggerr, gamepadFire);
+moveMap.bind(gamepad, triggerl, gamepadAltTrigger);
+
+moveMap.bind(keyboard, f, setZoomFOV);
+moveMap.bind(keyboard, r, toggleZoom);
+moveMap.bind( gamepad, btn_b, toggleZoom );
+
+//------------------------------------------------------------------------------
+// Camera & View functions
+//------------------------------------------------------------------------------
+moveMap.bind( keyboard, z, toggleFreeLook );
+moveMap.bind(keyboard, tab, toggleFirstPerson );
+moveMap.bind(keyboard, "alt c", toggleCamera);
+
+moveMap.bind( gamepad, btn_back, toggleCamera );
+
+//------------------------------------------------------------------------------
+// Demo recording functions
+//------------------------------------------------------------------------------
+moveMap.bind( keyboard, F3, startRecordingDemo );
+moveMap.bind( keyboard, F4, stopRecordingDemo );
+
+
+//------------------------------------------------------------------------------
+// Helper Functions
+//------------------------------------------------------------------------------
+moveMap.bind(keyboard, "F8", dropCameraAtPlayer);
+moveMap.bind(keyboard, "F7", dropPlayerAtCamera);
+
+GlobalActionMap.bind(keyboard, "ctrl o", bringUpOptions);
+
+//------------------------------------------------------------------------------
+// Debugging Functions
+//------------------------------------------------------------------------------
+GlobalActionMap.bind(keyboard, "ctrl F2", showMetrics);
+GlobalActionMap.bind(keyboard, "ctrl F3", doProfile);
+
+//------------------------------------------------------------------------------
+// Misc.
+//------------------------------------------------------------------------------
+GlobalActionMap.bind(keyboard, "tilde", toggleConsole);
+GlobalActionMap.bindCmd(keyboard, "alt k", "cls();","");
+GlobalActionMap.bindCmd(keyboard, "alt enter", "", "Canvas.attemptFullscreenToggle();");

+ 426 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/client/inputCommands.cs

@@ -0,0 +1,426 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+// Non-remapable binds
+//------------------------------------------------------------------------------
+function escapeFromGame()
+{
+   /*if ( $Server::ServerType $= "SinglePlayer" )
+      MessageBoxYesNo( "Exit", "Exit from this Mission?", "disconnect();", "");
+   else
+      MessageBoxYesNo( "Disconnect", "Disconnect from the server?", "disconnect();", "");*/
+   disconnect();
+}
+
+//------------------------------------------------------------------------------
+// Movement Keys
+//------------------------------------------------------------------------------
+$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 getVerticalMouseAdjustAmount(%val)
+{
+   %sensitivity = $pref::Input::VertMouseSensitivity;
+   
+   // based on a default camera FOV of 90'
+   if(ServerConnection.zoomed)
+      %sensitivity = $pref::Input::ZoomVertMouseSensitivity;
+      
+   if($pref::Input::invertVerticalMouse)
+      %sensitivity *= -1;
+      
+   return(%val * ($cameraFov / 90) * 0.01) * %sensitivity;
+}
+
+function getHorizontalMouseAdjustAmount(%val)
+{
+   %sensitivity = $pref::Input::HorzMouseSensitivity;
+   
+   // based on a default camera FOV of 90'
+   if(ServerConnection.zoomed)
+      %sensitivity = $pref::Input::ZoomHorzMouseSensitivity;
+      
+   return(%val * ($cameraFov / 90) * 0.01) * %sensitivity;
+}
+
+function getRollMouseAdjustAmount(%val)
+{
+   return(%val * ($cameraFov / 90) * 0.01) * $pref::Input::RollMouseSensitivity;
+}
+
+function getGamepadAdjustAmount(%val)
+{
+   // based on a default camera FOV of 90'
+   return(%val * ($cameraFov / 90) * 0.01) * 10.0;
+}
+
+function yaw(%val)
+{
+   %yawAdj = getHorizontalMouseAdjustAmount(%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 = getVerticalMouseAdjustAmount(%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 )
+{
+   $mvXAxis_L = %val;
+}
+
+function gamePadMoveY( %val )
+{
+   $mvYAxis_L = %val;
+}
+
+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;
+   }
+}
+
+//------------------------------------------------------------------------------
+// Mouse Trigger
+//------------------------------------------------------------------------------
+function mouseFire(%val)
+{
+   $mvTriggerCount0++;
+}
+
+function altTrigger(%val)
+{
+   $mvTriggerCount1++;
+   
+   toggleZoom(%val);
+}
+
+//------------------------------------------------------------------------------
+// Gamepad Trigger
+//------------------------------------------------------------------------------
+function gamepadFire(%val)
+{
+   if(%val > 0.1 && !$gamepadFireTriggered)
+   {
+      $gamepadFireTriggered = true;
+      $mvTriggerCount0++;
+   }
+   else if(%val <= 0.1 && $gamepadFireTriggered)
+   {
+      $gamepadFireTriggered = false;
+      $mvTriggerCount0++;
+   }
+}
+
+function gamepadAltTrigger(%val)
+{
+   if(%val > 0.1 && !$gamepadAltTriggerTriggered)
+   {
+      $gamepadAltTriggerTriggered = true;
+      $mvTriggerCount1++;
+   }
+   else if(%val <= 0.1 && $gamepadAltTriggerTriggered)
+   {
+      $gamepadAltTriggerTriggered = false;
+      $mvTriggerCount1++;
+   }
+}
+
+//------------------------------------------------------------------------------
+// Zoom and FOV functions
+//------------------------------------------------------------------------------
+if($Player::CurrentFOV $= "")
+   $Player::CurrentFOV = $pref::Player::DefaultFOV;
+
+// toggleZoomFOV() works by dividing the CurrentFOV by 2.  Each time that this
+// toggle is hit it simply divides the CurrentFOV by 2 once again.  If the
+// FOV is reduced below a certain threshold then it resets to equal half of the
+// DefaultFOV value.  This gives us 4 zoom levels to cycle through.
+
+function toggleZoomFOV()
+{
+    $Player::CurrentFOV = $Player::CurrentFOV / 2;
+
+    if($Player::CurrentFOV < 5)
+        resetCurrentFOV();
+
+    if(ServerConnection.zoomed)
+      setFOV($Player::CurrentFOV);
+    else
+    {
+      setFov(ServerConnection.getControlCameraDefaultFov());
+    }
+}
+
+function resetCurrentFOV()
+{
+   $Player::CurrentFOV = ServerConnection.getControlCameraDefaultFov() / 2;
+}
+
+function turnOffZoom()
+{
+   ServerConnection.zoomed = false;
+   setFov(ServerConnection.getControlCameraDefaultFov());
+
+   // Rather than just disable the DOF effect, we want to set it to the level's
+   // preset values.
+   //DOFPostEffect.disable();
+   ppOptionsUpdateDOFSettings();
+}
+
+function setZoomFOV(%val)
+{
+   if(%val)
+      toggleZoomFOV();
+}
+
+function toggleZoom(%val)
+{
+   if (%val)
+   {
+      ServerConnection.zoomed = true;
+      setFov($Player::CurrentFOV);
+
+      DOFPostEffect.setAutoFocus( true );
+      DOFPostEffect.setFocusParams( 0.5, 0.5, 50, 500, -5, 5 );
+      DOFPostEffect.enable();
+   }
+   else
+   {
+      turnOffZoom();
+   }
+}
+
+//------------------------------------------------------------------------------
+// Camera & View functions
+//------------------------------------------------------------------------------
+function toggleFreeLook( %val )
+{
+   if ( %val )
+      $mvFreeLook = true;
+   else
+      $mvFreeLook = false;
+}
+
+function toggleFirstPerson(%val)
+{
+   if (%val)
+   {
+      ServerConnection.setFirstPerson(!ServerConnection.isFirstPerson());
+   }
+}
+
+function toggleCamera(%val)
+{
+   if (%val)
+      commandToServer('ToggleCamera');
+}
+
+//------------------------------------------------------------------------------
+// Demo recording functions
+//------------------------------------------------------------------------------
+function startRecordingDemo( %val )
+{
+   if ( %val )
+      startDemoRecord();
+}
+
+function stopRecordingDemo( %val )
+{
+   if ( %val )
+      stopDemoRecord();
+}
+
+//------------------------------------------------------------------------------
+// Helper Functions
+//------------------------------------------------------------------------------
+function dropCameraAtPlayer(%val)
+{
+   if (%val)
+      commandToServer('dropCameraAtPlayer');
+}
+
+function dropPlayerAtCamera(%val)
+{
+   if (%val)
+      commandToServer('DropPlayerAtCamera');
+}
+
+function bringUpOptions(%val)
+{
+   if (%val)
+      Canvas.pushDialog(OptionsDlg);
+}
+
+//------------------------------------------------------------------------------
+// Debugging Functions
+//------------------------------------------------------------------------------
+function showMetrics(%val)
+{
+   if(%val)
+      metrics("fps gfx shadow sfx terrain groundcover forest net");
+}
+
+//------------------------------------------------------------------------------
+//
+// Start profiler by pressing ctrl f3
+// ctrl f3 - starts profile that will dump to console and file
+//
+function doProfile(%val)
+{
+   if (%val)
+   {
+      // key down -- start profile
+      echo("Starting profile session...");
+      profilerReset();
+      profilerEnable(true);
+   }
+   else
+   {
+      // key up -- finish off profile
+      echo("Ending profile session...");
+
+      profilerDumpToFile("profilerDumpToFile" @ getSimTime() @ ".txt");
+      profilerEnable(false);
+   }
+}

+ 4 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/camera.cs

@@ -0,0 +1,4 @@
+datablock CameraData(Observer)
+{
+   mode = "Observer";
+};

+ 66 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/defaultParticle.cs

@@ -0,0 +1,66 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+datablock ParticleData(DefaultParticle)
+{
+   textureName = "data/spectatorGameplay/art/particles/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 = "data/spectatorGameplay/art/particles/defaultParticle";
+};
+
+datablock ParticleEmitterData(DefaultEmitter)
+{
+   ejectionPeriodMS = "50";
+   ejectionVelocity = "1";
+   velocityVariance = "0";
+   ejectionOffset = "0.2";
+   thetaMax = "40";
+   particles = "DefaultParticle";
+   blendStyle = "ADDITIVE";
+   softParticles = "0";
+   softnessDistance = "1";
+};

+ 608 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/lights.cs

@@ -0,0 +1,608 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+// LightAnimData
+//------------------------------------------------------------------------------
+
+datablock LightAnimData( NullLightAnim )
+{   
+   animEnabled = false;
+};
+
+datablock LightAnimData( PulseLightAnim )
+{   
+   brightnessA = 0;
+   brightnessZ = 1;
+   brightnessPeriod = 1;
+   brightnessKeys = "aza";
+   brightnessSmooth = true;
+};
+
+datablock LightAnimData( SubtlePulseLightAnim )
+{
+   brightnessA = 0.5;
+   brightnessZ = 1;
+   brightnessPeriod = 1;
+   brightnessKeys = "aza";
+   brightnessSmooth = true;
+};
+
+datablock LightAnimData( FlickerLightAnim )
+{
+   brightnessA = 1;
+   brightnessZ = 0;
+   brightnessPeriod = 5;
+   brightnessKeys = "aaazaaaaaazaaazaaazaaaaazaaaazzaaaazaaaaaazaaaazaaaza";
+   brightnessSmooth = false;
+};
+
+datablock LightAnimData( BlinkLightAnim )
+{
+   brightnessA = 0;
+   brightnessZ = 1;
+   brightnessPeriod = 5;
+   brightnessKeys = "azaaaazazaaaaaazaaaazaaaazzaaaaaazaazaaazaaaaaaa";
+   brightnessSmooth = false;
+};
+
+datablock LightAnimData( FireLightAnim )
+{
+   brightnessA = 0.75;
+   brightnessZ = 1;
+   brightnessPeriod = 0.7;
+   brightnessKeys = "annzzznnnzzzaznzzzz";
+   brightnessSmooth = 0;
+   offsetA[0] = "-0.05";
+   offsetA[1] = "-0.05";
+   offsetA[2] = "-0.05";
+   offsetZ[0] = "0.05";
+   offsetZ[1] = "0.05";
+   offsetZ[2] = "0.05";
+   offsetPeriod[0] = "1.25";
+   offsetPeriod[1] = "1.25";
+   offsetPeriod[2] = "1.25";
+   offsetKeys[0] = "ahahaazahakayajza";
+   offsetKeys[1] = "ahahaazahakayajza";
+   offsetKeys[2] = "ahahaazahakayajza";
+   rotKeys[0] = "";
+   rotKeys[1] = "";
+   rotKeys[2] = "";
+   colorKeys[0] = "";
+   colorKeys[1] = "";
+   colorKeys[2] = "";
+};
+
+datablock LightAnimData( SpinLightAnim )
+{
+   rotA[2] = "0";
+   rotZ[2] = "360";
+   rotPeriod[2] = "1";
+   rotKeys[2] = "az";
+   rotSmooth[2] = true;
+};
+
+
+//------------------------------------------------------------------------------
+// LightFlareData
+//------------------------------------------------------------------------------
+
+datablock LightFlareData( NullLightFlare )
+{
+   flareEnabled = false;
+};
+
+datablock LightFlareData( SunFlareExample )
+{      
+   overallScale = 4.0;
+   flareEnabled = true;
+   renderReflectPass = false;
+   flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0";  
+
+   elementRect[0] = "512 0 512 512";
+   elementDist[0] = 0.0;
+   elementScale[0] = 2.0;
+   elementTint[0] = "0.6 0.6 0.6";
+   elementRotate[0] = true;
+   elementUseLightColor[0] = true;
+   
+   elementRect[1] = "1152 0 128 128";
+   elementDist[1] = 0.3;
+   elementScale[1] = 0.7;
+   elementTint[1] = "1.0 1.0 1.0";
+   elementRotate[1] = true;
+   elementUseLightColor[1] = true;
+   
+   elementRect[2] = "1024 0 128 128";
+   elementDist[2] = 0.5;
+   elementScale[2] = 0.25;   
+   elementTint[2] = "1.0 1.0 1.0";
+   elementRotate[2] = true;
+   elementUseLightColor[2] = true;
+   
+   elementRect[3] = "1024 128 128 128";
+   elementDist[3] = 0.8;
+   elementScale[3] = 0.7;   
+   elementTint[3] = "1.0 1.0 1.0";
+   elementRotate[3] = true;
+   elementUseLightColor[3] = true;
+   
+   elementRect[4] = "1024 0 128 128";
+   elementDist[4] = 1.18;
+   elementScale[4] = 0.5;   
+   elementTint[4] = "1.0 1.0 1.0";
+   elementRotate[4] = true;
+   elementUseLightColor[4] = true;
+   
+   elementRect[5] = "1152 128 128 128";
+   elementDist[5] = 1.25;
+   elementScale[5] = 0.25;   
+   elementTint[5] = "1.0 1.0 1.0";
+   elementRotate[5] = true;
+   elementUseLightColor[5] = true;
+   
+   elementRect[6] = "1024 0 128 128";
+   elementDist[6] = 2.0;
+   elementScale[6] = 0.25;      
+   elementTint[6] = "1.0 1.0 1.0";
+   elementRotate[6] = true;
+   elementUseLightColor[6] = true;
+   occlusionRadius = "0.25";
+};
+
+datablock LightFlareData( SunFlareExample2 )
+{      
+   overallScale = 2.0;
+   flareEnabled = true;
+   renderReflectPass = false;
+   flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0";  
+   
+   elementRect[0] = "1024 0 128 128";
+   elementDist[0] = 0.5;
+   elementScale[0] = 0.25;   
+   elementTint[0] = "1.0 1.0 1.0";
+   elementRotate[0] = true;
+   elementUseLightColor[0] = true;
+   
+   elementRect[1] = "1024 128 128 128";
+   elementDist[1] = 0.8;
+   elementScale[1] = 0.7;   
+   elementTint[1] = "1.0 1.0 1.0";
+   elementRotate[1] = true;
+   elementUseLightColor[1] = true;
+   
+   elementRect[2] = "1024 0 128 128";
+   elementDist[2] = 1.18;
+   elementScale[2] = 0.5;   
+   elementTint[2] = "1.0 1.0 1.0";
+   elementRotate[2] = true;
+   elementUseLightColor[2] = true;
+   
+   elementRect[3] = "1152 128 128 128";
+   elementDist[3] = 1.25;
+   elementScale[3] = 0.25;   
+   elementTint[3] = "1.0 1.0 1.0";
+   elementRotate[3] = true;
+   elementUseLightColor[3] = true;
+   
+   elementRect[4] = "1024 0 128 128";
+   elementDist[4] = 2.0;
+   elementScale[4] = 0.25;      
+   elementTint[4] = "0.7 0.7 0.7";
+   elementRotate[4] = true;
+   elementUseLightColor[4] = true;
+   occlusionRadius = "0.25";
+};
+
+datablock LightFlareData(SunFlareExample3)
+{
+   overallScale = 2.0;
+   flareEnabled = true;
+   renderReflectPass = false;
+   flareTexture = "data/spectatorGameplay/art/lights/lensflareSheet3.png";  
+   
+   elementRect[0] = "0 256 256 256";
+   elementDist[0] = "-0.6";
+   elementScale[0] = "3.5";   
+   elementTint[0] = "0.537255 0.537255 0.537255 1";
+   elementRotate[0] = true;
+   elementUseLightColor[0] = true;
+   
+   elementRect[1] = "128 128 128 128";
+   elementDist[1] = "0.1";
+   elementScale[1] = "1.5";   
+   elementTint[1] = "0.996078 0.976471 0.721569 1";
+   elementRotate[1] = true;
+   elementUseLightColor[1] = true;
+   
+   elementRect[2] = "0 0 64 64";
+   elementDist[2] = "0.4";
+   elementScale[2] = "0.25";   
+   elementTint[2] = "0 0 1 1";
+   elementRotate[2] = true;
+   elementUseLightColor[2] = true;
+   
+   elementRect[3] = "0 0 64 64";
+   elementDist[3] = "0.45";
+   elementScale[3] = 0.25;   
+   elementTint[3] = "0 1 0 1";
+   elementRotate[3] = true;
+   elementUseLightColor[3] = true;
+   
+   elementRect[4] = "0 0 64 64";
+   elementDist[4] = "0.5";
+   elementScale[4] = 0.25;      
+   elementTint[4] = "1 0 0 1";
+   elementRotate[4] = true;
+   elementUseLightColor[4] = true;
+   elementRect[9] = "256 0 256 256";
+   elementDist[3] = "0.45";
+   elementScale[3] = "0.25";
+   elementScale[9] = "2";
+   elementRect[4] = "0 0 64 64";
+   elementRect[5] = "128 0 128 128";
+   elementDist[4] = "0.5";
+   elementDist[5] = "1.2";
+   elementScale[1] = "1.5";
+   elementScale[4] = "0.25";
+   elementScale[5] = "0.5";
+   elementTint[1] = "0.996078 0.976471 0.721569 1";
+   elementTint[2] = "0 0 1 1";
+   elementTint[5] = "0.721569 0 1 1";
+   elementRotate[5] = "0";
+   elementUseLightColor[5] = "1";
+   elementRect[0] = "0 256 256 256";
+   elementRect[1] = "128 128 128 128";
+   elementRect[2] = "0 0 64 64";
+   elementRect[3] = "0 0 64 64";
+   elementDist[0] = "-0.6";
+   elementDist[1] = "0.1";
+   elementDist[2] = "0.4";
+   elementScale[0] = "3.5";
+   elementScale[2] = "0.25";
+   elementTint[0] = "0.537255 0.537255 0.537255 1";
+   elementTint[3] = "0 1 0 1";
+   elementTint[4] = "1 0 0 1";
+   elementRect[6] = "64 64 64 64";
+   elementDist[6] = "0.9";
+   elementScale[6] = "4";
+   elementTint[6] = "0.00392157 0.721569 0.00392157 1";
+   elementRotate[6] = "0";
+   elementUseLightColor[6] = "1";
+   elementRect[7] = "64 64 64 64";
+   elementRect[8] = "64 64 64 64";
+   elementDist[7] = "0.25";
+   elementDist[8] = "0.18";
+   elementDist[9] = "0";
+   elementScale[7] = "2";
+   elementScale[8] = "0.5";
+   elementTint[7] = "0.6 0.0117647 0.741176 1";
+   elementTint[8] = "0.027451 0.690196 0.0117647 1";
+   elementTint[9] = "0.647059 0.647059 0.647059 1";
+   elementRotate[9] = "0";
+   elementUseLightColor[7] = "1";
+   elementUseLightColor[8] = "1";
+   elementRect[10] = "256 256 256 256";
+   elementRect[11] = "0 64 64 64";
+   elementRect[12] = "0 64 64 64";
+   elementRect[13] = "64 0 64 64";
+   elementDist[10] = "0";
+   elementDist[11] = "-0.3";
+   elementDist[12] = "-0.32";
+   elementDist[13] = "1";
+   elementScale[10] = "10";
+   elementScale[11] = "2.5";
+   elementScale[12] = "0.3";
+   elementScale[13] = "0.4";
+   elementTint[10] = "0.321569 0.321569 0.321569 1";
+   elementTint[11] = "0.443137 0.0431373 0.00784314 1";
+   elementTint[12] = "0.00784314 0.996078 0.0313726 1";
+   elementTint[13] = "0.996078 0.94902 0.00784314 1";
+   elementUseLightColor[10] = "1";
+   elementUseLightColor[11] = "1";
+   elementUseLightColor[13] = "1";
+   elementRect[14] = "0 0 64 64";
+   elementDist[14] = "0.15";
+   elementScale[14] = "0.8";
+   elementTint[14] = "0.505882 0.0470588 0.00784314 1";
+   elementRotate[14] = "1";
+   elementUseLightColor[9] = "1";
+   elementUseLightColor[14] = "1";
+   elementRect[15] = "64 64 64 64";
+   elementRect[16] = "0 64 64 64";
+   elementRect[17] = "0 0 64 64";
+   elementRect[18] = "0 64 64 64";
+   elementRect[19] = "256 0 256 256";
+   elementDist[15] = "0.8";
+   elementDist[16] = "0.7";
+   elementDist[17] = "1.4";
+   elementDist[18] = "-0.5";
+   elementDist[19] = "-1.5";
+   elementScale[15] = "3";
+   elementScale[16] = "0.3";
+   elementScale[17] = "0.2";
+   elementScale[18] = "1";
+   elementScale[19] = "35";
+   elementTint[15] = "0.00784314 0.00784314 0.996078 1";
+   elementTint[16] = "0.992157 0.992157 0.992157 1";
+   elementTint[17] = "0.996078 0.603922 0.00784314 1";
+   elementTint[18] = "0.2 0.00392157 0.47451 1";
+   elementTint[19] = "0.607843 0.607843 0.607843 1";
+   elementUseLightColor[15] = "1";
+   elementUseLightColor[18] = "1";
+   elementUseLightColor[19] = "1";
+   occlusionRadius = "0.25";
+};
+
+
+
+datablock LightFlareData(SunFlarePacificIsland)
+{
+   overallScale = 2.0;
+   flareEnabled = true;
+   renderReflectPass = false;
+   flareTexture = "data/spectatorGameplay/art/lights/lensflareSheet3.png";  
+   
+   elementRect[0] = "0 256 256 256";
+   elementDist[0] = "-0.6";
+   elementScale[0] = "3.5";   
+   elementTint[0] = "0.537255 0.537255 0.537255 1";
+   elementRotate[0] = true;
+   elementUseLightColor[0] = true;
+   
+   elementRect[1] = "128 128 128 128";
+   elementDist[1] = "0.1";
+   elementScale[1] = "1.5";   
+   elementTint[1] = "0.996078 0.976471 0.721569 1";
+   elementRotate[1] = true;
+   elementUseLightColor[1] = true;
+   
+   elementRect[2] = "0 0 64 64";
+   elementDist[2] = "0.4";
+   elementScale[2] = "0.25";   
+   elementTint[2] = "0 0 1 1";
+   elementRotate[2] = true;
+   elementUseLightColor[2] = true;
+   
+   elementRect[3] = "0 0 64 64";
+   elementDist[3] = "0.45";
+   elementScale[3] = 0.25;   
+   elementTint[3] = "0 1 0 1";
+   elementRotate[3] = true;
+   elementUseLightColor[3] = true;
+   
+   elementRect[4] = "0 0 64 64";
+   elementDist[4] = "0.5";
+   elementScale[4] = 0.25;      
+   elementTint[4] = "1 0 0 1";
+   elementRotate[4] = true;
+   elementUseLightColor[4] = true;
+   elementRect[9] = "256 0 256 256";
+   elementDist[3] = "0.45";
+   elementScale[3] = "0.25";
+   elementScale[9] = "2";
+   elementRect[4] = "0 0 64 64";
+   elementRect[5] = "128 0 128 128";
+   elementDist[4] = "0.5";
+   elementDist[5] = "1.2";
+   elementScale[1] = "1.5";
+   elementScale[4] = "0.25";
+   elementScale[5] = "0.5";
+   elementTint[1] = "0.996078 0.976471 0.721569 1";
+   elementTint[2] = "0 0 1 1";
+   elementTint[5] = "0.721569 0 1 1";
+   elementRotate[5] = "0";
+   elementUseLightColor[5] = "1";
+   elementRect[0] = "0 256 256 256";
+   elementRect[1] = "128 128 128 128";
+   elementRect[2] = "0 0 64 64";
+   elementRect[3] = "0 0 64 64";
+   elementDist[0] = "-0.6";
+   elementDist[1] = "0.1";
+   elementDist[2] = "0.4";
+   elementScale[0] = "3.5";
+   elementScale[2] = "0.25";
+   elementTint[0] = "0.537255 0.537255 0.537255 1";
+   elementTint[3] = "0 1 0 1";
+   elementTint[4] = "1 0 0 1";
+   elementRect[6] = "64 64 64 64";
+   elementDist[6] = "0.9";
+   elementScale[6] = "4";
+   elementTint[6] = "0.00392157 0.721569 0.00392157 1";
+   elementRotate[6] = "0";
+   elementUseLightColor[6] = "1";
+   elementRect[7] = "64 64 64 64";
+   elementRect[8] = "64 64 64 64";
+   elementDist[7] = "0.25";
+   elementDist[8] = "0.18";
+   elementDist[9] = "0";
+   elementScale[7] = "2";
+   elementScale[8] = "0.5";
+   elementTint[7] = "0.6 0.0117647 0.741176 1";
+   elementTint[8] = "0.027451 0.690196 0.0117647 1";
+   elementTint[9] = "0.647059 0.647059 0.647059 1";
+   elementRotate[9] = "0";
+   elementUseLightColor[7] = "1";
+   elementUseLightColor[8] = "1";
+   elementRect[10] = "256 256 256 256";
+   elementRect[11] = "0 64 64 64";
+   elementRect[12] = "0 64 64 64";
+   elementRect[13] = "64 0 64 64";
+   elementDist[10] = "0";
+   elementDist[11] = "-0.3";
+   elementDist[12] = "-0.32";
+   elementDist[13] = "1";
+   elementScale[10] = "10";
+   elementScale[11] = "2.5";
+   elementScale[12] = "0.3";
+   elementScale[13] = "0.4";
+   elementTint[10] = "0.321569 0.321569 0.321569 1";
+   elementTint[11] = "0.443137 0.0431373 0.00784314 1";
+   elementTint[12] = "0.00784314 0.996078 0.0313726 1";
+   elementTint[13] = "0.996078 0.94902 0.00784314 1";
+   elementUseLightColor[10] = "1";
+   elementUseLightColor[11] = "1";
+   elementUseLightColor[13] = "1";
+   elementRect[14] = "0 0 64 64";
+   elementDist[14] = "0.15";
+   elementScale[14] = "0.8";
+   elementTint[14] = "0.505882 0.0470588 0.00784314 1";
+   elementRotate[14] = "1";
+   elementUseLightColor[9] = "1";
+   elementUseLightColor[14] = "1";
+   elementRect[15] = "64 64 64 64";
+   elementRect[16] = "0 64 64 64";
+   elementRect[17] = "0 0 64 64";
+   elementRect[18] = "0 64 64 64";
+   elementRect[19] = "256 0 256 256";
+   elementDist[15] = "0.8";
+   elementDist[16] = "0.7";
+   elementDist[17] = "1.4";
+   elementDist[18] = "-0.5";
+   elementDist[19] = "-1.5";
+   elementScale[15] = "3";
+   elementScale[16] = "0.3";
+   elementScale[17] = "0.2";
+   elementScale[18] = "1";
+   elementScale[19] = "35";
+   elementTint[15] = "0.00784314 0.00784314 0.996078 1";
+   elementTint[16] = "0.992157 0.992157 0.992157 1";
+   elementTint[17] = "0.996078 0.603922 0.00784314 1";
+   elementTint[18] = "0.2 0.00392157 0.47451 1";
+   elementTint[19] = "0.607843 0.607843 0.607843 1";
+   elementUseLightColor[15] = "1";
+   elementUseLightColor[18] = "1";
+   elementUseLightColor[19] = "1";
+};
+
+
+
+datablock LightFlareData( LightFlareExample0 )
+{
+   overallScale = 2.0;
+   flareEnabled = true;
+   renderReflectPass = true;
+   flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet1";
+   
+   elementRect[0] = "0 512 512 512";
+   elementDist[0] = 0.0;
+   elementScale[0] = 0.5;
+   elementTint[0] = "1.0 1.0 1.0";
+   elementRotate[0] = false;
+   elementUseLightColor[0] = false;
+   
+   elementRect[1] = "512 0 512 512";
+   elementDist[1] = 0.0;
+   elementScale[1] = 2.0;
+   elementTint[1] = "0.5 0.5 0.5";
+   elementRotate[1] = false;
+   elementUseLightColor[1] = false;
+   occlusionRadius = "0.25";
+};
+
+datablock LightFlareData( LightFlareExample1 )
+{
+   overallScale = 2.0;
+   flareEnabled = true;
+   renderReflectPass = true;
+   flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet1";
+   
+   elementRect[0] = "512 512 512 512";
+   elementDist[0] = 0.0;
+   elementScale[0] = 0.5;
+   elementTint[0] = "1.0 1.0 1.0";
+   elementRotate[0] = false;
+   elementUseLightColor[0] = false;
+   
+   elementRect[1] = "512 0 512 512";
+   elementDist[1] = 0.0;
+   elementScale[1] = 2.0;
+   elementTint[1] = "0.5 0.5 0.5";
+   elementRotate[1] = false;
+   elementUseLightColor[1] = false;
+   occlusionRadius = "0.25";
+};
+
+datablock LightFlareData( LightFlareExample2 )
+{
+   overallScale = 2.0;
+   flareEnabled = true;
+   renderReflectPass = true;
+   flareTexture = "data/spectatorGameplay/art/lights/lensFlareSheet0";  
+
+   elementRect[0] = "512 512 512 512";
+   elementDist[0] = 0.0;
+   elementScale[0] = 0.5;
+   elementTint[0] = "1.0 1.0 1.0";
+   elementRotate[0] = true;
+   elementUseLightColor[0] = true;
+   
+   elementRect[1] = "512 0 512 512";
+   elementDist[1] = 0.0;
+   elementScale[1] = 2.0;
+   elementTint[1] = "0.7 0.7 0.7";
+   elementRotate[1] = true;
+   elementUseLightColor[1] = true;
+   
+   elementRect[2] = "1152 0 128 128";
+   elementDist[2] = 0.3;
+   elementScale[2] = 0.5;
+   elementTint[2] = "1.0 1.0 1.0";
+   elementRotate[2] = true;
+   elementUseLightColor[2] = true;
+   
+   elementRect[3] = "1024 0 128 128";
+   elementDist[3] = 0.5;
+   elementScale[3] = 0.25;   
+   elementTint[3] = "1.0 1.0 1.0";
+   elementRotate[3] = true;
+   elementUseLightColor[3] = true;
+   
+   elementRect[4] = "1024 128 128 128";
+   elementDist[4] = 0.8;
+   elementScale[4] = 0.6;   
+   elementTint[4] = "1.0 1.0 1.0";
+   elementRotate[4] = true;
+   elementUseLightColor[4] = true;
+   
+   elementRect[5] = "1024 0 128 128";
+   elementDist[5] = 1.18;
+   elementScale[5] = 0.5;   
+   elementTint[5] = "0.7 0.7 0.7";
+   elementRotate[5] = true;
+   elementUseLightColor[5] = true;
+   
+   elementRect[6] = "1152 128 128 128";
+   elementDist[6] = 1.25;
+   elementScale[6] = 0.35;   
+   elementTint[6] = "0.8 0.8 0.8";
+   elementRotate[6] = true;
+   elementUseLightColor[6] = true;
+   
+   elementRect[7] = "1024 0 128 128";
+   elementDist[7] = 2.0;
+   elementScale[7] = 0.25;      
+   elementTint[7] = "1.0 1.0 1.0";
+   elementRotate[7] = true;
+   elementUseLightColor[7] = true;
+};

+ 24 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDatablocks.cs

@@ -0,0 +1,24 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+// This is the default save location for any Datablocks created in the
+// Datablock Editor (this script is executed from onServerCreated())

+ 25 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedDecalData.cs

@@ -0,0 +1,25 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+// This is the default save location for any Decal datablocks created in the
+// Decal Editor (this script is executed from onServerCreated())
+

+ 21 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedForestItemData.cs

@@ -0,0 +1,21 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------

+ 24 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleData.cs

@@ -0,0 +1,24 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+// This is the default save location for any Particle datablocks created in the
+// Particle Editor (this script is executed from onServerCreated())

+ 24 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/managedParticleEmitterData.cs

@@ -0,0 +1,24 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+// This is the default save location for any Particle Emitter datablocks created in the
+// Particle Editor (this script is executed from onServerCreated())

+ 39 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/markers.cs

@@ -0,0 +1,39 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+datablock MissionMarkerData(WayPointMarker)
+{
+   category = "Misc";
+   shapeFile = "data/spectatorGameplay/art/shapes/octahedron.dts";
+};
+
+datablock MissionMarkerData(SpawnSphereMarker)
+{
+   category = "Misc";
+   shapeFile = "data/spectatorGameplay/art/shapes/octahedron.dts";
+};
+
+datablock MissionMarkerData(CameraBookmarkMarker)
+{
+   category = "Misc";
+   shapeFile = "data/spectatorGameplay/art/shapes/camera.dts";
+};

+ 46 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/ribbons.cs

@@ -0,0 +1,46 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+  
+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";
+};

+ 22 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/datablocks/sounds.cs

@@ -0,0 +1,22 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+

+ 80 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.cs

@@ -0,0 +1,80 @@
+//-----------------------------------------------------------------------------
+// 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
+   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
+   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";
+}

+ 39 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/gui/playGui.gui

@@ -0,0 +1,39 @@
+new GameTSCtrl(PlayGui) {
+   isContainer = "1";
+   profile = "GuiContentProfile";
+   horizSizing = "right";
+   vertSizing = "bottom";
+   position = "0 0";
+   extent = "1024 768";
+   minExtent = "8 8";
+   canSave = "1";
+   visible = "1";
+   margin = "0 0 0 0";
+   padding = "0 0 0 0";
+   anchorTop = "1";
+   anchorBottom = "0";
+   anchorLeft = "1";
+   anchorRight = "0";
+   cameraZRot = "0";
+   forceFOV = "0";
+   enabled = "1";
+   helpTag = "0";
+   noCursor = "1";
+
+   new GuiBitmapCtrl(LagIcon) {
+      bitmap = "data/ui/art/lagIcon.png";
+      wrap = "0";
+      isContainer = "0";
+      Profile = "GuiDefaultProfile";
+      HorizSizing = "right";
+      VertSizing = "bottom";
+      position = "572 3";
+      Extent = "32 32";
+      MinExtent = "8 8";
+      canSave = "1";
+      Visible = "0";
+      tooltipprofile = "GuiToolTipProfile";
+      hovertime = "1000";
+      canSaveDynamicFields = "0";
+   };
+};

+ 193 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/server/DefaultGame.cs

@@ -0,0 +1,193 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// What kind of "player" is spawned is either controlled directly by the
+// SpawnSphere or it defaults back to the values set here. This also controls
+// which SimGroups to attempt to select the spawn sphere's from by walking down
+// the list of SpawnGroups till it finds a valid spawn object.
+// These override the values set in core/scripts/server/spawn.cs
+//-----------------------------------------------------------------------------
+function DefaultGame::initGameVars(%this)
+{
+   // Leave $Game::defaultPlayerClass and $Game::defaultPlayerDataBlock as empty strings ("")
+   // to spawn a the $Game::defaultCameraClass as the control object.
+   $Game::DefaultPlayerClass = "";
+   $Game::DefaultPlayerDataBlock = "";
+   $Game::DefaultPlayerSpawnGroups = "CameraSpawnPoints PlayerSpawnPoints PlayerDropPoints";
+
+   //-----------------------------------------------------------------------------
+   // What kind of "camera" is spawned is either controlled directly by the
+   // SpawnSphere or it defaults back to the values set here. This also controls
+   // which SimGroups to attempt to select the spawn sphere's from by walking down
+   // the list of SpawnGroups till it finds a valid spawn object.
+   // These override the values set in core/scripts/server/spawn.cs
+   //-----------------------------------------------------------------------------
+   $Game::DefaultCameraClass = "Camera";
+   $Game::DefaultCameraDataBlock = "Observer";
+   $Game::DefaultCameraSpawnGroups = "CameraSpawnPoints PlayerSpawnPoints PlayerDropPoints";
+
+   // Global movement speed that affects all Cameras
+   $Camera::MovementSpeed = 30;
+}
+
+//-----------------------------------------------------------------------------
+// DefaultGame manages the communication between the server's world and the
+// client's simulation. These functions are responsible for maintaining the
+// client's camera and player objects.
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// This is the main entry point for spawning a control object for the client.
+// The control object is the actual game object that the client is responsible
+// for controlling in the client and server simulations. We also spawn a
+// convenient camera object for use as an alternate control object. We do not
+// have to spawn this camera object in order to function in the simulation.
+//
+// Called for each client after it's finished downloading the mission and is
+// ready to start playing.
+//-----------------------------------------------------------------------------
+function DefaultGame::onClientEnterGame(%this, %client)
+{
+   // This function currently relies on some helper functions defined in
+   // core/scripts/spawn.cs. For custom spawn behaviors one can either
+   // override the properties on the SpawnSphere's or directly override the
+   // functions themselves.
+
+   // Find a spawn point for the camera
+   %cameraSpawnPoint = %this.pickCameraSpawnPoint($Game::DefaultCameraSpawnGroups);
+   
+   // Spawn a camera for this client using the found %spawnPoint
+   %this.spawnCamera(%cameraSpawnPoint, %client);
+}
+
+//-----------------------------------------------------------------------------
+// Clean up the client's control objects
+//-----------------------------------------------------------------------------
+function DefaultGame::onClientLeaveGame(%this, %client)
+{
+   // Cleanup the camera
+   if (isObject(%this.camera))
+      %this.camera.delete();
+}
+
+//-----------------------------------------------------------------------------
+// The server has started up so do some game start up
+//-----------------------------------------------------------------------------
+function DefaultGame::onMissionStart(%this)
+{
+   //set up the game and game variables
+   %this.initGameVars();
+
+   $Game::Duration = %this.duration;
+}
+
+function DefaultGame::onMissionEnded(%this)
+{
+   cancel($Game::Schedule);
+   $Game::Running = false;
+   $Game::Cycling = false;
+}
+
+function DefaultGame::onMissionReset(%this)
+{
+   // Called by resetMission(), after all the temporary mission objects
+   // have been deleted.
+   %this.initGameVars();
+
+   $Game::Duration = %this.duration;
+}
+
+//-----------------------------------------------------------------------------
+// Functions that implement game-play
+// These are here for backwards compatibilty only, games and/or mods should
+// really be overloading the server and mission functions listed ubove.
+//-----------------------------------------------------------------------------
+function DefaultGame::pickCameraSpawnPoint(%this, %spawnGroups)
+{
+   // Walk through the groups until we find a valid object
+   for (%i = 0; %i < getWordCount(%spawnGroups); %i++)
+   {
+      %group = getWord(%spawnGroups, %i);
+      
+      %count = getWordCount(%group);
+
+      if (isObject(%group))
+         %spawnPoint = %group.getRandom();
+
+      if (isObject(%spawnPoint))
+         return %spawnPoint;
+   }
+
+   // Didn't find a spawn point by looking for the groups
+   // so let's return the "default" SpawnSphere
+   // First create it if it doesn't already exist
+   if (!isObject(DefaultCameraSpawnSphere))
+   {
+      %spawn = new SpawnSphere(DefaultCameraSpawnSphere)
+      {
+         dataBlock      = "SpawnSphereMarker";
+         spawnClass     = $Game::DefaultCameraClass;
+         spawnDatablock = $Game::DefaultCameraDataBlock;
+      };
+
+      // Add it to the MissionCleanup group so that it
+      // doesn't get saved to the Mission (and gets cleaned
+      // up of course)
+      MissionCleanup.add(%spawn);
+   }
+
+   return DefaultCameraSpawnSphere;
+}
+
+function DefaultGame::spawnCamera(%this, %spawnPoint, %client)
+{
+   // Set the control object to the default camera
+   if (!isObject(%client.camera))
+   {
+      %camObj = spawnObject(Camera, Observer);
+      %client.camera = %camObj;
+   }
+
+   // If we have a camera then set up some properties
+   if (isObject(%client.camera))
+   {
+      MissionCleanup.add( %client.camera );
+      %client.camera.scopeToClient(%client);
+
+      %client.setControlObject(%client.camera);
+
+      if (isDefined("%spawnPoint"))
+      {
+         // Attempt to treat %spawnPoint as an object
+         if (getWordCount(%spawnPoint) == 1 && isObject(%spawnPoint))
+         {
+            %client.camera.setTransform(%spawnPoint.getTransform());
+         }
+         else
+         {
+            // Treat %spawnPoint as an AxisAngle transform
+            %client.camera.setTransform(%spawnPoint);
+         }
+      }
+   }
+}

+ 106 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/server/VolumetricFog.cs

@@ -0,0 +1,106 @@
+//-----------------------------------------------------------------------------
+// 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 VolumetricFog::onEnterFog(%this,%obj)
+{
+   // This method is called whenever the control object (Camera or Player)
+   // %obj enters the fog area.
+   
+   // echo("Control Object " @ %obj @ " enters fog " @ %this);
+}
+
+function VolumetricFog::onLeaveFog(%this,%obj)
+{
+   // This method is called whenever the control object (Camera or Player)
+   // %obj leaves the fog area.
+   
+   // echo("Control Object " @ %obj @ " left fog " @ %this);
+}
+
+function VolumetricFog::Dissolve(%this,%speed,%delete)
+{
+   // This method dissolves the fog at speed milliseconds
+   %this.isBuilding = true;
+   if (%this.FogDensity > 0)
+   {
+      %this.setFogDensity(%this.FogDensity - 0.005);
+      %this.schedule(%speed,Dissolve,%speed,%delete);
+   }
+   else
+   {
+      %this.isBuilding = false;
+      %this.SetFogDensity(0.0);
+      if (%delete !$= "" && %delete !$="0" && %delete !$="false")
+         %this.schedule(250,delete);
+   }
+}
+
+function VolumetricFog::Thicken(%this,%speed, %end_density)
+{
+   // This method thickens the fog at speed milliseconds to a density of %end_density
+
+   %this.isBuilding = true;
+   if (%this.FogDensity + 0.005 < %end_density)
+   {
+      %this.setFogDensity(%this.FogDensity + 0.005);
+      %this.schedule(%speed,Thicken,%speed, %end_density);
+   }
+   else
+   {
+      %this.setFogDensity(%end_density);
+      %this.isBuilding = false;
+   }
+}
+ 
+function GenerateFog(%pos,%scale,%color,%density)
+{
+   // This function can be used to generate some fog caused by massive gunfire etc.
+   // Change shape and modulation data to your likings.
+   
+   %fog=new VolumetricFog() {
+      shapeName = "data/FPSGameplay/art/environment/Fog_Sphere.dts";
+      fogColor = %color;
+      fogDensity = "0.0";
+      ignoreWater = "0";
+      MinSize = "250";
+      FadeSize = "750";
+      texture = "data/FPSGameplay/art/environment/FogMod_heavy.dds";
+      tiles = "1";
+      modStrength = "0.2";
+      PrimSpeed = "-0.01 0.04";
+      SecSpeed = "0.02 0.02";
+      position = %pos;
+      rotation = "0 0 1 20.354";
+      scale = %scale;
+      canSave = "1";
+      canSaveDynamicFields = "1";
+   };
+   
+   if (isObject(%fog))
+   {
+      MissionCleanup.add(%fog);
+      
+      %fog.Thicken(500,%density);
+   }
+   
+   return %fog;
+}

+ 85 - 0
Templates/BaseGame/game/data/spectatorGameplay/scripts/server/camera.cs

@@ -0,0 +1,85 @@
+//-----------------------------------------------------------------------------
+// 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.
+//-----------------------------------------------------------------------------
+
+// Global movement speed that affects all cameras.  This should be moved
+// into the camera datablock.
+$Camera::movementSpeed = 30;
+
+function Observer::onTrigger(%this,%obj,%trigger,%state)
+{
+   // state = 0 means that a trigger key was released
+   if (%state == 0)
+      return;
+
+   // Default player triggers: 0=fire 1=altFire 2=jump
+   %client = %obj.getControllingClient();
+   switch$ (%obj.mode)
+   {
+      case "Observer":
+         // Do something interesting.
+
+      case "Corpse":
+         // Viewing dead corpse, so we probably want to respawn.
+         %client.spawnPlayer();
+
+         // Set the camera back into observer mode, since in
+         // debug mode we like to switch to it.
+         %this.setMode(%obj,"Observer");
+   }
+}
+
+function Observer::setMode(%this,%obj,%mode,%arg1,%arg2,%arg3)
+{
+   switch$ (%mode)
+   {
+      case "Observer":
+         // Let the player fly around
+         %obj.setFlyMode();
+
+      case "Corpse":
+         // Lock the camera down in orbit around the corpse,
+         // which should be arg1
+         %transform = %arg1.getTransform();
+         %obj.setOrbitMode(%arg1, %transform, 0.5, 4.5, 4.5);
+
+   }
+   %obj.mode = %mode;
+}
+
+
+//-----------------------------------------------------------------------------
+// Camera methods
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+
+function Camera::onAdd(%this,%obj)
+{
+   // Default start mode
+   %this.setMode(%this.mode);
+}
+
+function Camera::setMode(%this,%mode,%arg1,%arg2,%arg3)
+{
+   // Punt this one over to our datablock
+   %this.getDatablock().setMode(%this,%mode,%arg1,%arg2,%arg3);
+}

+ 9 - 11
Templates/BaseGame/game/tools/assetBrowser/scripts/assetTypes/material.cs

@@ -90,17 +90,15 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
          
          %diffuseImageSuffix = ImportAssetWindow.parseImagePathSuffixes(%diffuseImagePath);
          
-         
-         
          if(ImportAssetWindow.activeImportConfig.UseDiffuseSuffixOnOriginImg == 1 && %diffuseImageSuffix $= "")
          {
             %diffuseToken = getToken(ImportAssetWindow.activeImportConfig.DiffuseTypeSuffixes, ",;", 0);
             
-            %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %materialItemId, %filename @ %diffuseToken);
+            %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %assetItem, %filename @ %diffuseToken);
          }
          else
          {
-            %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %materialItemId);
+            %diffuseAsset = AssetBrowser.addImportingAsset("Image", %diffuseImagePath, %assetItem);
          }
          
          %assetItem.diffuseImageAsset = %diffuseAsset;
@@ -141,7 +139,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
          
          if(%targetFilePath !$= "")
          {
-            %normalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId);
+            %normalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
             %assetItem.normalImageAsset = %normalAsset;
          }
       }
@@ -160,7 +158,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
             
             if(%foundFile)
             {
-               %specularAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId);
+               %specularAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
                %assetItem.specularImageAsset = %specularAsset;
                break;  
             }
@@ -182,7 +180,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
             
             if(%foundFile)
             {
-               %metalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId);
+               %metalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
                %assetItem.metalImageAsset = %metalAsset;
                break;  
             }
@@ -204,7 +202,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
             
             if(%foundFile)
             {
-               %roughnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId);
+               %roughnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
                %assetItem.roughnessImageAsset = %roughnessAsset;
                break;  
             }
@@ -226,7 +224,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
             
             if(%foundFile)
             {
-               %smoothnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId);
+               %smoothnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
                %assetItem.SmoothnessImageAsset = %smoothnessAsset;
                break;  
             }
@@ -248,7 +246,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
             
             if(%foundFile)
             {
-               %AOAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId);
+               %AOAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
                %assetItem.AOImageAsset = %AOAsset;
                break;  
             }
@@ -270,7 +268,7 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
             
             if(%foundFile)
             {
-               %compositeAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %materialItemId);
+               %compositeAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
                %assetItem.compositeImageAsset = %compositeAsset;
                break;  
             }

+ 4 - 0
Tools/CMake/torque3d.cmake

@@ -866,6 +866,10 @@ if(TORQUE_TEMPLATE)
     message("Prepare Template(${TORQUE_TEMPLATE}) install...")
     file(GLOB_RECURSE INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/*")
 
+    IF( NOT TORQUE_D3D11)
+        list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/D3DCompiler_47.dll")
+    ENDIF()
+
     foreach(ITEM ${INSTALL_FILES_AND_DIRS})
         get_filename_component( dir ${ITEM} DIRECTORY )
         STRING(REGEX REPLACE "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/" "${TORQUE_APP_DIR}/" INSTALL_DIR ${dir})

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác