Merge branch 'development' into ConvexProxies

This commit is contained in:
Areloch 2018-12-09 15:34:12 -06:00 committed by GitHub
commit bb30de04f7
2803 changed files with 195958 additions and 224299 deletions

View file

@ -1,13 +0,0 @@
<ModuleDefinition
ModuleId="Art"
VersionId="1"
Description="Default module for the Full template game assets."
ScriptFile=""
CreateFunction="create"
DestroyFunction="destroy"
Group="Game"
Dependencies="">
<DeclaredAssets
Extension="asset.taml"
Recurse="true"/>
</ModuleDefinition>

View file

@ -1,3 +0,0 @@
<ShapeAsset
AssetName="SoldierPlayer"
fileName="art/shapes/actors/Soldier/soldier_rigged.DAE"/>

View file

@ -49,11 +49,11 @@ singleton Material(debri_debris)
{
mapTo = "debris";
diffuseColor[0] = "0.7 0.7 0.7 1";
diffuseMap[0] = "rock_diffuse.dds";
normalMap[0] = "rock_normals.dds";
diffuseMap[0] = "rock_d";
normalMap[0] = "rock_n";
specularMap[0] = "rock_s";
specular[0] = "1 1 1 0";
specularPower[0] = "50";
specularMap[0] = "rock_specular.dds";
specularPower[0] = "50";
castShadows = "0";
translucentBlendOp = "None";
materialTag0 = "Weapon";

View file

@ -39,7 +39,7 @@ singleton Material(TP_Ryder_Base)
mapTo = "TP_Ryder_Base";
diffuseMap[0] = "./TP_Ryder_D.dds";
normalMap[0] = "./TP_Ryder_N.dds";
specularMap[0] = "./TP_Ryder_D.dds";
specularMap[0] = "./TP_Ryder_S.dds";
specular[0] = "1.0 1.0 1.0 1";
specularPower[0] = "10";
translucentBlendOp = "None";

View file

@ -29,7 +29,7 @@ singleton Material(Turret_Base)
translucentBlendOp = "None";
normalMap[0] = "art/shapes/weapons/Turret/Turret_N.dds";
pixelSpecular[0] = "1";
specularMap[0] = "art/shapes/weapons/Turret/Turret_D.dds";
specularMap[0] = "art/shapes/weapons/Turret/Turret_S.dds";
useAnisotropic[0] = "1";
castDynamicShadows = true;
materialTag0 = "Weapon";

View file

@ -34,5 +34,4 @@ singleton Material( DesertSkyMat )
{
cubemap = DesertSkyCubemap;
materialTag0 = "Skies";
isSky = true;
};

View file

@ -34,7 +34,6 @@ singleton Material( NightSkyMat )
{
cubemap = NightCubemap;
materialTag0 = "Skies";
isSky = true;
};
singleton Material( Moon_Glow_Mat )
@ -51,5 +50,4 @@ singleton Material( Moon_Mat )
emissive = true;
translucent = true;
vertColor[ 0 ] = true;
isSky = true;
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Before After
Before After

View file

@ -1,54 +1,192 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(ConsoleDlg) {
profile = "GuiDefaultProfile";
position = "0 0";
extent = "1024 768";
minExtent = "8 8";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "640 480";
minExtent = "8 8";
profile = "GuiDefaultProfile";
visible = "1";
helpTag = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "1";
helpTag = "0";
new GuiConsoleEditCtrl(ConsoleEntry) {
profile = "ConsoleTextEditProfile";
horizSizing = "width";
vertSizing = "top";
position = "0 462";
extent = "640 18";
minExtent = "8 8";
visible = "1";
altCommand = "ConsoleEntry::eval();";
helpTag = "0";
maxLength = "255";
useSiblingScroller = "1";
historySize = "40";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "1";
useSiblingScroller = "1";
password = "0";
passwordMask = "*";
maxLength = "255";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 750";
extent = "1024 18";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "top";
profile = "ConsoleTextEditProfile";
visible = "1";
active = "1";
altCommand = "ConsoleEntry::eval();";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiContainer() {
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "1 728";
extent = "1024 22";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "top";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
new GuiBitmapCtrl() {
bitmap = "data/ui/art/hudfill.png";
color = "255 255 255 255";
wrap = "0";
position = "0 0";
extent = "1024 22";
minExtent = "8 2";
horizSizing = "width";
vertSizing = "bottom";
profile = "GuiDefaultProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ConsoleDlgErrorFilterBtn) {
text = "Errors";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "2 2";
extent = "113 20";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ConsoleDlgWarnFilterBtn) {
text = "Warnings";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "119 2";
extent = "113 20";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
new GuiCheckBoxCtrl(ConsoleDlgNormalFilterBtn) {
text = "Normal Messages";
groupNum = "-1";
buttonType = "ToggleButton";
useMouseEvents = "0";
position = "236 2";
extent = "113 20";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiCheckBoxProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
};
};
new GuiScrollCtrl() {
internalName = "Scroll";
profile = "ConsoleScrollProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "640 462";
minExtent = "8 8";
visible = "1";
helpTag = "0";
willFirstRespond = "1";
hScrollBar = "alwaysOn";
vScrollBar = "alwaysOn";
lockHorizScroll = "false";
lockVertScroll = "false";
lockHorizScroll = "0";
lockVertScroll = "0";
constantThumbHeight = "0";
childMargin = "0 0";
mouseWheelScrollSpeed = "-1";
margin = "0 0 0 0";
padding = "0 0 0 0";
anchorTop = "1";
anchorBottom = "0";
anchorLeft = "1";
anchorRight = "0";
position = "0 0";
extent = "1024 730";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "ConsoleScrollProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
internalName = "Scroll";
canSave = "1";
canSaveDynamicFields = "0";
new GuiConsole( ConsoleMessageLogView ) {
profile = "GuiConsoleProfile";
position = "0 0";
};
new GuiConsole(ConsoleMessageLogView) {
position = "1 1";
extent = "622 324";
minExtent = "8 2";
horizSizing = "right";
vertSizing = "bottom";
profile = "GuiConsoleProfile";
visible = "1";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "1";
canSave = "1";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---
@ -173,3 +311,35 @@ function ConsoleMessageLogView::onMessageSelected( %this, %level, %message )
EditorOpenFileInTorsion( %fileName, %lineNumber );
}
function ConsoleDlg::onWake(%this)
{
ConsoleDlgErrorFilterBtn.setStateOn(ConsoleMessageLogView.getErrorFilter());
ConsoleDlgWarnFilterBtn.setStateOn(ConsoleMessageLogView.getWarnFilter());
ConsoleDlgNormalFilterBtn.setStateOn(ConsoleMessageLogView.getNormalFilter());
ConsoleMessageLogView.refresh();
}
function ConsoleDlgErrorFilterBtn::onClick(%this)
{
ConsoleMessageLogView.toggleErrorFilter();
}
function ConsoleDlgWarnFilterBtn::onClick(%this)
{
ConsoleMessageLogView.toggleWarnFilter();
}
function ConsoleDlgNormalFilterBtn::onClick(%this)
{
ConsoleMessageLogView.toggleNormalFilter();
}
function ConsoleMessageLogView::onNewMessage(%this, %errorCount, %warnCount, %normalCount)
{
ConsoleDlgErrorFilterBtn.setText("(" @ %errorCount @ ") Errors");
ConsoleDlgWarnFilterBtn.setText("(" @ %warnCount @ ") Warnings");
ConsoleDlgNormalFilterBtn.setText("(" @ %normalCount @ ") Messages");
}

View file

@ -34,7 +34,6 @@ singleton Material( BlackSkyMat )
{
cubemap = BlackSkyCubemap;
materialTag0 = "Skies";
isSky = true;
};
singleton CubemapData( BlueSkyCubemap )

View file

@ -87,6 +87,16 @@ function initRenderManager()
// Resolve format change token last.
DiffuseRenderPassManager.addManager( new RenderPassStateBin(FinalBin) { renderOrder = 1.7; stateToken = AL_FormatToken; } );
// AFX CODE BLOCK (interior-zodiacs)(polysoup-zodiacs) <<
if(isObject(afxZodiacTerrainRenderer))
{
DiffuseRenderPassManager.addManager( new afxZodiacTerrainRenderer() { bintype = "TerrainZodiac"; renderOrder = 1.41; processAddOrder = 1.41; } );
DiffuseRenderPassManager.addManager( new afxZodiacPolysoupRenderer() { bintype = "PolysoupZodiac"; renderOrder = 1.42; processAddOrder = 1.42; } );
DiffuseRenderPassManager.addManager( new afxZodiacGroundPlaneRenderer() { bintype = "GroundPlaneZodiac"; renderOrder = 1.43; processAddOrder = 1.43; } );
DiffuseRenderPassManager.addManager( new afxZodiacMeshRoadRenderer() { bintype = "MeshRoadZodiac"; renderOrder = 1.44; processAddOrder = 1.44; } );
DiffuseRenderPassManager.addManager( new afxRenderHighlightMgr() { renderOrder = 1.55; processAddOrder = 1.55; } ); // for selection-highlighting
}
}
/// This post effect is used to copy data from the non-MSAA back-buffer to the

View file

@ -1,13 +0,0 @@
<ModuleDefinition
ModuleId="Scripts"
VersionId="1"
Description="Default module for the Full template game assets."
ScriptFile=""
CreateFunction="create"
DestroyFunction="destroy"
Group="Game"
Dependencies="">
<DeclaredAssets
Extension="asset.taml"
Recurse="true"/>
</ModuleDefinition>

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="AnimationComponentAsset"
componentName=""
componentClass="AnimationComponent"
friendlyName="Animation"
componentType="Animation"
description="Allows a mesh component to be animated."/>

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="CameraOrbiterComponentAsset"
componentName=""
componentClass="CameraOrbiterComponent"
friendlyName="Camera Orbiter"
componentType="Game"
description="Acts as a boon arm for a camera component."/>

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="CollisionComponentAsset"
componentName=""
componentClass="CollisionComponent"
friendlyName="Collision"
componentType="Collision"
description="Enables an entity to collide with things."/>

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="CameraComponentAsset"
componentName=""
componentClass="CameraComponent"
friendlyName="Camera"
componentType="Game"
description="Allows the component owner to operate as a camera."/>

View file

@ -1,196 +0,0 @@
//-----------------------------------------------------------------------------
// 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 CameraComponent::onAdd(%this)
{
%this.addComponentField(clientOwner, "The client that views this camera", "int", "1", "");
%test = %this.clientOwner;
%barf = ClientGroup.getCount();
%clientID = %this.getClientID();
if(%clientID && !isObject(%clientID.camera))
{
%this.scopeToClient(%clientID);
%this.setDirty();
%clientID.setCameraObject(%this.owner);
%clientID.setControlCameraFov(%this.FOV);
%clientID.camera = %this.owner;
}
%res = $pref::Video::mode;
%derp = 0;
}
function CameraComponent::onRemove(%this)
{
%clientID = %this.getClientID();
if(%clientID)
%clientID.clearCameraObject();
}
function CameraComponent::onInspectorUpdate(%this)
{
//if(%this.clientOwner)
//%this.clientOwner.setCameraObject(%this.owner);
}
function CameraComponent::getClientID(%this)
{
return ClientGroup.getObject(%this.clientOwner-1);
}
function CameraComponent::isClientCamera(%this, %client)
{
%clientID = ClientGroup.getObject(%this.clientOwner-1);
if(%client.getID() == %clientID)
return true;
else
return false;
}
function CameraComponent::onClientConnect(%this, %client)
{
//if(%this.isClientCamera(%client) && !isObject(%client.camera))
//{
%this.scopeToClient(%client);
%this.setDirty();
%client.setCameraObject(%this.owner);
%client.setControlCameraFov(%this.FOV);
%client.camera = %this.owner;
//}
//else
//{
// echo("CONNECTED CLIENT IS NOT CAMERA OWNER!");
//}
}
function CameraComponent::onClientDisconnect(%this, %client)
{
Parent::onClientDisconnect(%this, %client);
if(isClientCamera(%client)){
%this.clearScopeToClient(%client);
%client.clearCameraObject();
}
}
//move to the editor later
GlobalActionMap.bind("keyboard", "alt c", "toggleEditorCam");
function switchCamera(%client, %newCamEntity)
{
if(!isObject(%client) || !isObject(%newCamEntity))
return error("SwitchCamera: No client or target camera!");
%cam = %newCamEntity.getComponent(CameraComponent);
if(!isObject(%cam))
return error("SwitchCamera: Target camera doesn't have a camera behavior!");
//TODO: Cleanup clientOwner for previous camera!
if(%cam.clientOwner == 0 || %cam.clientOwner $= "")
%cam.clientOwner = 0;
%cam.scopeToClient(%client);
%cam.setDirty();
%client.setCameraObject(%newCamEntity);
%client.setControlCameraFov(%cam.FOV);
%client.camera = %newCamEntity;
}
function buildEditorCamera()
{
if(isObject("EditorCamera"))
return EditorCamera;
%camObj = SGOManager.spawn("SpectatorObject", false);
%camObj.name = "EditorCamera";
%client = ClientGroup.getObject(0);
%camObj.getComponent(SpectatorControls).setupControls(%client);
MissionCleanup.add(%camObj);
return %camObj;
}
//TODO: Move this somewhere else!
function toggleEditorCam(%val)
{
if(!%val)
return;
%client = ClientGroup.getObject(0);
if(!isObject(%client.camera))
return error("ToggleEditorCam: no existing camera!");
%editorCam = buildEditorCamera();
//if this is our first switch, just go to the editor camera
if(%client.lastCam $= "" || %client.camera.getId() != %editorCam.getId())
{
if(%client.lastCam $= "")
{
//set up the position
%editorCam.position = %client.camera.position;
%editorCam.rotation = %client.camera.rotation;
}
%client.lastCam = %client.camera;
%client.lastController = %client.getControlObject();
switchCamera(%client, %editorCam);
switchControlObject(%client, %editorCam);
}
else
{
switchCamera(%client, %client.lastCam);
switchControlObject(%client, %client.lastController);
%client.lastCam = %editorCam;
%client.lastController = %editorCam;
}
}
function serverCmdSetClientAspectRatio(%client, %width, %height)
{
echo("Client: " @ %client SPC "changing screen res to: " @ %width SPC %height);
%client.screenExtent = %width SPC %height;
%cam = %client.getCameraObject();
if(!isObject(%cam))
return;
%cameraComp = %cam.getComponent(CameraComponent);
%cameraComp.ScreenAspect = %width SPC %height;
}

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="ControlObjectComponentAsset"
componentName="ControlObjectComponent"
componentClass="Component"
friendlyName="Control Object"
componentType="Game"
description="Allows the component owner to be controlled by a client."/>

View file

@ -1,89 +0,0 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
//registerComponent("ControlObjectComponent", "Component", "Control Object", "Game", false, "Allows the behavior owner to operate as a camera.");
function ControlObjectComponent::onAdd(%this)
{
%this.addComponentField(clientOwner, "The shape to use for rendering", "int", "1", "");
%clientID = %this.getClientID();
if(%clientID && !isObject(%clientID.getControlObject()))
%clientID.setControlObject(%this.owner);
}
function ControlObjectComponent::onRemove(%this)
{
%clientID = %this.getClientID();
if(%clientID)
%clientID.setControlObject(0);
}
function ControlObjectComponent::onClientConnect(%this, %client)
{
if(%this.isControlClient(%client) && !isObject(%client.getControlObject()))
%client.setControlObject(%this.owner);
}
function ControlObjectComponent::onClientDisconnect(%this, %client)
{
if(%this.isControlClient(%client))
%client.setControlObject(0);
}
function ControlObjectComponent::getClientID(%this)
{
return ClientGroup.getObject(%this.clientOwner-1);
}
function ControlObjectComponent::isControlClient(%this, %client)
{
%clientID = ClientGroup.getObject(%this.clientOwner-1);
if(%client.getID() == %clientID)
return true;
else
return false;
}
function ControlObjectComponent::onInspectorUpdate(%this, %field)
{
%clientID = %this.getClientID();
if(%clientID && !isObject(%clientID.getControlObject()))
%clientID.setControlObject(%this.owner);
}
function switchControlObject(%client, %newControlEntity)
{
if(!isObject(%client) || !isObject(%newControlEntity))
return error("SwitchControlObject: No client or target controller!");
%control = %newControlEntity.getComponent(ControlObjectComponent);
if(!isObject(%control))
return error("SwitchControlObject: Target controller has no conrol object behavior!");
%client.setControlObject(%newControlEntity);
}

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="ItemRotationComponentAsset"
componentName="ItemRotationComponent"
componentClass="Component"
friendlyName="Item Rotation"
componentType="Game"
description="Rotates the entity around an axis, like an item pickup."/>

View file

@ -1,49 +0,0 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
//registerComponent("ItemRotationComponent", "Component", "Item Rotation", "Game", false, "Rotates the entity around the z axis, like an item pickup.");
function ItemRotationComponent::onAdd(%this)
{
%this.addComponentField(rotationsPerMinute, "Number of rotations per minute", "float", "5", "");
%this.addComponentField(forward, "Rotate forward or backwards", "bool", "1", "");
%this.addComponentField(horizontal, "Rotate horizontal or verticle, true for horizontal", "bool", "1", "");
}
function ItemRotationComponent::Update(%this)
{
%tickRate = 0.032;
//Rotations per second is calculated based on a standard update tick being 32ms. So we scale by the tick speed, then add that to our rotation to
//get a nice rotation speed.
if(%this.horizontal)
{
if(%this.forward)
%this.owner.rotation.z += ( ( 360 * %this.rotationsPerMinute ) / 60 ) * %tickRate;
else
%this.owner.rotation.z -= ( ( 360 * %this.rotationsPerMinute ) / 60 ) * %tickRate;
}
else
{
%this.owner.rotation.x += ( ( 360 * %this.rotationsPerMinute ) / 60 ) * %tickRate;
}
}

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="PlayerSpawnerComponentAsset"
componentName="PlayerSpawner"
componentClass="Component"
friendlyName="Player Spawner"
componentType="Game"
description="When a client connects, it spawns a player object for them and attaches them to it."/>

View file

@ -1,70 +0,0 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
//registerComponent("PlayerSpawner", "Component",
// "Player Spawner", "Game", false, "When a client connects, it spawns a player object for them and attaches them to it");
function PlayerSpawner::onAdd(%this)
{
%this.clientCount = 1;
%this.friendlyName = "Player Spawner";
%this.componentType = "Spawner";
%this.addComponentField("GameObjectName", "The name of the game object we spawn for the players", string, "PlayerObject");
}
function PlayerSpawner::onClientConnect(%this, %client)
{
%playerObj = SGOManager.spawn(%this.GameObjectName);
if(!isObject(%playerObj))
return;
%playerObj.position = %this.owner.position;
MissionCleanup.add(%playerObj);
for(%b = 0; %b < %playerObj.getComponentCount(); %b++)
{
%comp = %playerObj.getComponentByIndex(%b);
if(%comp.isMethod("onClientConnect"))
%comp.onClientConnect(%client);
}
switchControlObject(%client, %playerObj);
switchCamera(%client, %playerObj);
//%playerObj.getComponent(FPSControls).setupControls(%client);
%this.clientCount++;
}
function PlayerSpawner::onClientDisConnect(%this, %client)
{
}
function PlayerSpawner::getClientID(%this)
{
return ClientGroup.getObject(%this.clientOwner-1);
}

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="FPSControlsComponentAsset"
componentName="FPSControls"
componentClass="Component"
friendlyName="FPS Controls"
componentType="Input"
description="First Person Shooter-type controls."/>

View file

@ -1,247 +0,0 @@
//-----------------------------------------------------------------------------
// 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.
//-----------------------------------------------------------------------------
//registerComponent("FPSControls", "Component", "FPS Controls", "Input", false, "First Person Shooter-type controls");
function FPSControls::onAdd(%this)
{
//
%this.beginGroup("Keys");
%this.addComponentField(forwardKey, "Key to bind to vertical thrust", keybind, "keyboard w");
%this.addComponentField(backKey, "Key to bind to vertical thrust", keybind, "keyboard s");
%this.addComponentField(leftKey, "Key to bind to horizontal thrust", keybind, "keyboard a");
%this.addComponentField(rightKey, "Key to bind to horizontal thrust", keybind, "keyboard d");
%this.addComponentField(jump, "Key to bind to horizontal thrust", keybind, "keyboard space");
%this.endGroup();
%this.beginGroup("Mouse");
%this.addComponentField(pitchAxis, "Key to bind to horizontal thrust", keybind, "mouse yaxis");
%this.addComponentField(yawAxis, "Key to bind to horizontal thrust", keybind, "mouse xaxis");
%this.endGroup();
%this.addComponentField(moveSpeed, "Horizontal thrust force", float, 300.0);
%this.addComponentField(jumpStrength, "Vertical thrust force", float, 3.0);
//
%control = %this.owner.getComponent( ControlObjectComponent );
if(!%control)
return echo("SPECTATOR CONTROLS: No Control Object behavior!");
//%this.Physics = %this.owner.getComponent( PlayerPhysicsComponent );
//%this.Animation = %this.owner.getComponent( AnimationComponent );
//%this.Camera = %this.owner.getComponent( MountedCameraComponent );
//%this.Animation.playThread(0, "look");
%this.setupControls(%control.getClientID());
}
function FPSControls::onRemove(%this)
{
Parent::onBehaviorRemove(%this);
commandToClient(%control.clientOwnerID, 'removeInput', %this.forwardKey);
commandToClient(%control.clientOwnerID, 'removeInput', %this.backKey);
commandToClient(%control.clientOwnerID, 'removeInput', %this.leftKey);
commandToClient(%control.clientOwnerID, 'removeInput', %this.rightKey);
commandToClient(%control.clientOwnerID, 'removeInput', %this.pitchAxis);
commandToClient(%control.clientOwnerID, 'removeInput', %this.yawAxis);
}
function FPSControls::onBehaviorFieldUpdate(%this, %field)
{
%controller = %this.owner.getBehavior( ControlObjectBehavior );
commandToClient(%controller.clientOwnerID, 'updateInput', %this.getFieldValue(%field), %field);
}
function FPSControls::onClientConnect(%this, %client)
{
%this.setupControls(%client);
}
function FPSControls::setupControls(%this, %client)
{
%control = %this.owner.getComponent( ControlObjectComponent );
if(!%control.isControlClient(%client))
{
echo("FPS CONTROLS: Client Did Not Match");
return;
}
%inputCommand = "FPSControls";
%test = %this.forwardKey;
/*SetInput(%client, %this.forwardKey.x, %this.forwardKey.y, %inputCommand@"_forwardKey");
SetInput(%client, %this.backKey.x, %this.backKey.y, %inputCommand@"_backKey");
SetInput(%client, %this.leftKey.x, %this.leftKey.y, %inputCommand@"_leftKey");
SetInput(%client, %this.rightKey.x, %this.rightKey.y, %inputCommand@"_rightKey");
SetInput(%client, %this.jump.x, %this.jump.y, %inputCommand@"_jump");
SetInput(%client, %this.pitchAxis.x, %this.pitchAxis.y, %inputCommand@"_pitchAxis");
SetInput(%client, %this.yawAxis.x, %this.yawAxis.y, %inputCommand@"_yawAxis");*/
SetInput(%client, "keyboard", "w", %inputCommand@"_forwardKey");
SetInput(%client, "keyboard", "s", %inputCommand@"_backKey");
SetInput(%client, "keyboard", "a", %inputCommand@"_leftKey");
SetInput(%client, "keyboard", "d", %inputCommand@"_rightKey");
SetInput(%client, "keyboard", "space", %inputCommand@"_jump");
SetInput(%client, "mouse", "yaxis", %inputCommand@"_pitchAxis");
SetInput(%client, "mouse", "xaxis", %inputCommand@"_yawAxis");
SetInput(%client, "keyboard", "f", %inputCommand@"_flashlight");
}
function FPSControls::onMoveTrigger(%this, %triggerID)
{
//check if our jump trigger was pressed!
if(%triggerID == 2)
{
%this.owner.applyImpulse("0 0 0", "0 0 " @ %this.jumpStrength);
}
}
function FPSControls::Update(%this)
{
return;
%moveVector = %this.owner.getMoveVector();
%moveRotation = %this.owner.getMoveRotation();
%this.Physics.moveVector = "0 0 0";
if(%moveVector.x != 0)
{
%fv = VectorNormalize(%this.owner.getRightVector());
%forMove = VectorScale(%fv, (%moveVector.x));// * (%this.moveSpeed * 0.032)));
//%this.Physics.velocity = VectorAdd(%this.Physics.velocity, %forMove);
%this.Physics.moveVector = VectorAdd(%this.Physics.moveVector, %forMove);
//if(%forMove > 0)
// %this.Animation.playThread(1, "run");
}
/*else
{
%fv = VectorNormalize(%this.owner.getRightVector());
%forMove = VectorScale(%fv, (%moveVector.x * (%this.moveSpeed * 0.032)));
if(%forMove <= 0)
%this.Animation.stopThread(1);
}*/
if(%moveVector.y != 0)
{
%fv = VectorNormalize(%this.owner.getForwardVector());
%forMove = VectorScale(%fv, (%moveVector.y));// * (%this.moveSpeed * 0.032)));
//%this.Physics.velocity = VectorAdd(%this.Physics.velocity, %forMove);
%this.Physics.moveVector = VectorAdd(%this.Physics.moveVector, %forMove);
//if(VectorLen(%this.Physics.velocity) < 2)
// %this.Physics.velocity = VectorAdd(%this.Physics.velocity, %forMove);
}
/*if(%moveVector.z)
{
%fv = VectorNormalize(%this.owner.getUpVector());
%forMove = VectorScale(%fv, (%moveVector.z * (%this.moveSpeed * 0.032)));
%this.Physics.velocity = VectorAdd(%this.Physics.velocity, %forMove);
}*/
if(%moveRotation.x != 0)
{
%look = mRadToDeg(%moveRotation.x) / 180;
//%this.Animation.setThreadPos(0, %look);
%this.owner.getComponent( MountedCameraComponent ).rotationOffset.x += mRadToDeg(%moveRotation.x);
//%this.Camera.rotationOffset.x += mRadToDeg(%moveRotation.x);
}
// %this.owner.rotation.x += mRadToDeg(%moveRotation.x);
if(%moveRotation.z != 0)
{
%zrot = mRadToDeg(%moveRotation.z);
%this.owner.getComponent( MountedCameraComponent ).rotationOffset.z += %zrot;
//%this.owner.rotation.z += %zrot;
}
}
//
function FPSControls_forwardKey(%val)
{
$mvForwardAction = %val;
}
function FPSControls_backKey(%val)
{
$mvBackwardAction = %val;
}
function FPSControls_leftKey(%val)
{
$mvLeftAction = %val;
}
function FPSControls_rightKey(%val)
{
$mvRightAction = %val;
}
function FPSControls_yawAxis(%val)
{
$mvYaw += getMouseAdjustAmount(%val);
}
function FPSControls_pitchAxis(%val)
{
$mvPitch += getMouseAdjustAmount(%val);
}
function FPSControls_jump(%val)
{
$mvTriggerCount2++;
}
function FPSControls_flashLight(%val)
{
$mvTriggerCount3++;
}

View file

@ -1,82 +0,0 @@
//-----------------------------------------------------------------------------
// 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 SetInput(%client, %device, %key, %command, %bindMap, %behav)
{
commandToClient(%client, 'SetInput', %device, %key, %command, %bindMap, %behav);
}
function RemoveInput(%client, %device, %key, %command, %bindMap)
{
commandToClient(%client, 'removeInput', %device, %key, %command, %bindMap);
}
function clientCmdSetInput(%device, %key, %command, %bindMap, %behav)
{
//if we're requesting a custom bind map, set that up
if(%bindMap $= "")
%bindMap = moveMap;
if (!isObject(%bindMap)){
new ActionMap(moveMap);
moveMap.push();
}
//get our local
//%localID = ServerConnection.resolveGhostID(%behav);
//%tmpl = %localID.getTemplate();
//%tmpl.insantiateNamespace(%tmpl.getName());
//first, check if we have an existing command
%oldBind = %bindMap.getBinding(%command);
if(%oldBind !$= "")
%bindMap.unbind(getField(%oldBind, 0), getField(%oldBind, 1));
//now, set the requested bind
%bindMap.bind(%device, %key, %command);
}
function clientCmdRemoveSpecCtrlInput(%device, %key, %bindMap)
{
//if we're requesting a custom bind map, set that up
if(%bindMap $= "")
%bindMap = moveMap;
if (!isObject(%bindMap))
return;
%bindMap.unbind(%device, %key);
}
function clientCmdSetupClientBehavior(%bhvrGstID)
{
%localID = ServerConnection.resolveGhostID(%bhvrGstID);
%tmpl = %localID.getTemplate();
%tmpl.insantiateNamespace(%tmpl.getName());
}
function getMouseAdjustAmount(%val)
{
// based on a default camera FOV of 90'
return(%val * ($cameraFov / 90) * 0.01) * $pref::Input::LinkMouseSensitivity;
}

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="MeshComponentAsset"
componentName=""
componentClass="MeshComponent"
friendlyName="Mesh"
componentType="Render"
description="Enables an entity to render a shape."/>

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="PlayerControllerComponentAsset"
componentName=""
componentClass="PlayerControllerComponent"
friendlyName="Player Controller"
componentType="Game"
description="Enables an entity to move like a player object."/>

View file

@ -1,7 +0,0 @@
<ComponentAsset
AssetName="StateMachineComponentAsset"
componentName=""
componentClass="StateMachineComponent"
friendlyName="State Machine"
componentType="Game"
description="Enables a state machine on the entity."/>

View file

@ -1,123 +0,0 @@
//-----------------------------------------------------------------------------
// 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 execGameObjects()
{
//find all GameObjectAssets
%assetQuery = new AssetQuery();
if(!AssetDatabase.findAssetType(%assetQuery, "GameObjectAsset"))
return; //if we didn't find ANY, just exit
%count = %assetQuery.getCount();
for(%i=0; %i < %count; %i++)
{
%assetId = %assetQuery.getAsset(%i);
%gameObjectAsset = AssetDatabase.acquireAsset(%assetId);
if(isFile(%gameObjectAsset.scriptFilePath))
exec(%gameObjectAsset.scriptFilePath);
}
}
function findGameObject(%name)
{
//find all GameObjectAssets
%assetQuery = new AssetQuery();
if(!AssetDatabase.findAssetType(%assetQuery, "GameObjectAsset"))
return 0; //if we didn't find ANY, just exit
%count = %assetQuery.getCount();
for(%i=0; %i < %count; %i++)
{
%assetId = %assetQuery.getAsset(%i);
%gameObjectAsset = AssetDatabase.acquireAsset(%assetId);
if(%gameObjectAsset.gameObjectName $= %name)
{
if(isFile(%gameObjectAsset.TAMLFilePath))
{
return %gameObjectAsset;
}
}
}
return 0;
}
function spawnGameObject(%name, %addToMissionGroup)
{
if(%addToMissionGroup $= "")
%addToMissionGroup = true;
%gameObjectAsset = findGameObject(%name);
if(isObject(%gameObjectAsset))
{
%newSGOObject = TamlRead(%gameObjectAsset.TAMLFilePath);
if(%addToMissionGroup == true) //save instance when saving level
MissionGroup.add(%newSGOObject);
else // clear instance on level exit
MissionCleanup.add(%newSGOObject);
return %newSGOObject;
}
return 0;
}
function saveGameObject(%name, %tamlPath, %scriptPath)
{
%gameObjectAsset = findGameObject(%name);
//find if it already exists. If it does, we'll update it, if it does not, we'll make a new asset
if(isObject(%gameObjectAsset))
{
%assetID = %gameObjectAsset.getAssetId();
%gameObjectAsset.TAMLFilePath = %tamlPath;
%gameObjectAsset.scriptFilePath = %scriptPath;
TAMLWrite(%gameObjectAsset, AssetDatabase.getAssetFilePath(%assetID));
AssetDatabase.refreshAsset(%assetID);
}
else
{
//Doesn't exist, so make a new one
%gameObjectAsset = new GameObjectAsset()
{
assetName = %name @ "Asset";
gameObjectName = %name;
TAMLFilePath = %tamlPath;
scriptFilePath = %scriptPath;
};
//Save it alongside the taml file
%path = filePath(%tamlPath);
TAMLWrite(%gameObjectAsset, %path @ "/" @ %name @ ".asset.taml");
AssetDatabase.refreshAllAssets(true);
}
}

View file

@ -1,5 +0,0 @@
<GameObjectAsset
AssetName="ThirdPersonPlayerGameObjectAsset"
gameObjectName="ThirdPersonPlayer"
TAMLFilePath="scripts/server/gameObjects/ThirdPersonPlayerObject.taml"
scriptFilePath="scripts/server/gameObjects/ThirdPersonPlayerObject.cs"/>

View file

@ -1,247 +0,0 @@
function ThirdPersonPlayerObject::onAdd(%this)
{
%this.turnRate = 0.3;
%this.phys = %this.getComponent("PlayerControllerComponent");
%this.collision = %this.getComponent("CollisionComponent");
%this.cam = %this.getComponent("CameraComponent");
%this.camArm = %this.getComponent("CameraOrbiterComponent");
%this.animation = %this.getComponent("AnimationComponent");
%this.stateMachine = %this.getComponent("StateMachineComponent");
%this.mesh = %this.getComponent("MeshComponent");
%this.stateMachine.forwardVector = 0;
%this.crouch = false;
%this.firstPerson = false;
%this.crouchSpeedMod = 0.5;
%this.aimOrbitDist = 1.5;
%this.regularOrbitDist = 5;
%this.regularOrbitMaxPitch = 70;
%this.regularOrbitMinPitch = -10;
%this.aimedMaxPitch = 90;
%this.aimedMinPitch = -90;
}
function ThirdPersonPlayerObject::onRemove(%this)
{
}
function ThirdPersonPlayerObject::moveVectorEvent(%this)
{
%moveVector = %this.getMoveVector();
// forward of the camera on the x-z plane
%cameraForward = %this.cam.getForwardVector();
%cameraRight = %this.cam.getRightVector();
%moveVec = VectorAdd(VectorScale(%cameraRight, %moveVector.x), VectorScale(%cameraForward, %moveVector.y));
if(%this.aiming || %this.firstPerson)
{
%forMove = "0 0 0";
if(%moveVector.x != 0)
{
%this.phys.inputVelocity.x = %moveVector.x * 10;
}
else
{
%this.phys.inputVelocity.x = 0;
}
if(%moveVector.y != 0)
{
%this.phys.inputVelocity.y = %moveVector.y * 10;
}
else
{
%this.phys.inputVelocity.y = 0;
}
}
else
{
if(%moveVec.x == 0 && %moveVec.y == 0)
{
%this.phys.inputVelocity = "0 0 0";
%this.stateMachine.forwardVector = 0;
}
else
{
%moveVec.z = 0;
%curForVec = %this.getForwardVector();
%newForVec = VectorLerp(%curForVec, %moveVec, %this.turnRate);
%this.setForwardVector(%newForVec);
%this.phys.inputVelocity.y = 10;
%this.stateMachine.forwardVector = 1;
}
}
if(%this.crouch)
%this.phys.inputVelocity = VectorScale(%this.phys.inputVelocity, %this.crouchSpeedMod);
}
function ThirdPersonPlayerObject::moveYawEvent(%this)
{
%moveRotation = %this.getMoveRotation();
%camOrb = %this.getComponent("CameraOrbiterComponent");
if(%this.aiming || %this.firstPerson)
{
%this.rotation.z += %moveRotation.z * 10;
}
%camOrb.rotation.z += %moveRotation.z * 10;
}
function ThirdPersonPlayerObject::movePitchEvent(%this)
{
%moveRotation = %this.getMoveRotation();
%camOrb = %this.getComponent("CameraOrbiterComponent");
%camOrb.rotation.x += %moveRotation.x * 10;
}
function ThirdPersonPlayerObject::moveRollEvent(%this){}
function ThirdPersonPlayerObject::moveTriggerEvent(%this, %triggerNum, %triggerValue)
{
if(%triggerNum == 3 && %triggerValue)
{
if(%triggerValue)
{
%this.firstPerson = !%this.firstPerson;
if(%this.firstPerson)
{
%this.rotation.z = %this.cam.rotationOffset.z;
%this.camArm.orbitDistance = 0;
%this.camArm.maxPitchAngle = %this.aimedMaxPitch;
%this.camArm.minPitchAngle = %this.aimedMinPitch;
%this.cam.positionOffset = "0 0 0";
%this.cam.rotationOffset = "0 0 0";
}
else if(%this.aiming)
{
%this.camArm.orbitDistance = %this.aimOrbitDist;
%this.camArm.maxPitchAngle = %this.aimedMaxPitch;
%this.camArm.minPitchAngle = %this.aimedMinPitch;
}
else
{
%this.camArm.orbitDistance = %this.regularOrbitDist;
%this.camArm.maxPitchAngle = %this.regularOrbitMaxPitch;
%this.camArm.minPitchAngle = %this.regularOrbitMinPitch;
}
commandToClient(localclientConnection, 'SetClientRenderShapeVisibility',
localclientConnection.getGhostID(%this.getComponent("MeshComponent")), !%this.firstPerson);
}
}
else if(%triggerNum == 2 && %triggerValue == true)
{
//get our best collision assuming up is 0 0 1
%collisionAngle = %this.collision.getBestCollisionAngle("0 0 1");
if(%collisionAngle >= 80)
{
%surfaceNormal = %this.collision.getCollisionNormal(0);
%jumpVector = VectorScale(%surfaceNormal, 200);
echo("Jump surface Angle is at: " @ %surfaceNormal);
%this.phys.applyImpulse(%this.position, %jumpVector);
%this.setForwardVector(%jumpVector);
}
else
%this.phys.applyImpulse(%this.position, "0 0 300");
}
else if(%triggerNum == 4)
{
%this.crouch = %triggerValue;
}
else if(%triggerNum == 1)
{
%this.aiming = %triggerValue;
if(%this.aiming)
{
%this.rotation.z = %this.cam.rotationOffset.z;
%this.camArm.orbitDistance = %this.aimOrbitDist;
%this.camArm.maxPitchAngle = %this.aimedMaxPitch;
%this.camArm.minPitchAngle = %this.aimedMinPitch;
}
else
{
%this.camArm.orbitDistance = %this.regularOrbitDist;
%this.camArm.maxPitchAngle = %this.regularOrbitMaxPitch;
%this.camArm.minPitchAngle = %this.regularOrbitMinPitch;
}
}
}
function ThirdPersonPlayerObject::onCollisionEvent(%this, %colObject, %colNormal, %colPoint, %colMatID, %velocity)
{
if(!%this.phys.isContacted())
echo(%this @ " collided with " @ %colObject);
}
function ThirdPersonPlayerObject::processTick(%this)
{
%moveVec = %this.getMoveVector();
%bestFit = "";
if(%this.crouch)
{
if(%moveVec.x != 0 || %moveVec.y != 0)
%bestFit = "Crouch_Forward";
else
%bestFit = "Crouch_Root";
}
else
{
if(%moveVec.x != 0 || %moveVec.y != 0)
%bestFit = "Run";
else
%bestFit = "Root";
}
if(%this.animation.getThreadAnimation(0) !$= %bestFit)
%this.animation.playThread(0, %bestFit);
}
//Used for first person mode
function clientCmdSetClientRenderShapeVisibility(%id, %visiblilty)
{
%localID = ServerConnection.resolveGhostID(%id);
%localID.enabled = %visiblilty;
}
function serverToClientObject( %serverObject )
{
assert( isObject( LocalClientConnection ), "serverToClientObject() - No local client connection found!" );
assert( isObject( ServerConnection ), "serverToClientObject() - No server connection found!" );
%ghostId = LocalClientConnection.getGhostId( %serverObject );
if ( %ghostId == -1 )
return 0;
return ServerConnection.resolveGhostID( %ghostId );
}

View file

@ -1,98 +0,0 @@
<Entity
scale="1 1 1"
class="ThirdPersonPlayerObject"
canSave="true"
canSaveDynamicFields="true"
position="0 0 0"
rotation="0 0 0">
<Component
networked="false"
enabled="true"
class="ControlObjectComponent"
clientOwner="1" />
<CollisionComponent
friendlyName="Collision(Component)"
networked="false"
enabled="true"
collisionType="Bounds"
LineOfSightType="Collision Mesh"
decalType="Collision Mesh"
CollisionMeshPrefix="Collision"
BlockCollisions="true" />
<PlayerControllerComponent
componentType="Physics"
friendlyName="Simple Physics"
description="Simple physics behavior that allows gravity and impulses."
networked="false"
enabled="true"
gravity="0 0 -9"
velocity="0 0 0"
isStatic="false" />
<MeshComponent
componentType="Render"
friendlyName="Mesh Component"
description="Causes the object to render a non-animating 3d shape using the file provided."
networked="true"
enabled="true"
MeshAsset="Art:SoldierPlayer" />
<Component
networked="false"
enabled="true"
class="FPSControls" />
<CameraComponent
networked="false"
enabled="true"
FOV="80"
MinFOV="5"
MaxFOV="175"
ScreenAspect="1024 768"
targetNode="Eye"
positionOffset="0 0 0"
rotationOffset="0 0 0"
useParentTransform="false" />
<CameraOrbiterComponent
orbitDistance="5"
maxPitchAngle="70"
minPitchAngle="-70"
networked="false"
enabled="true" />
<AnimationComponent
componentType="Render"
friendlyName="Animation Component"
description="An animation component"
networked="true"
enabled="true"/>
<SpotLight
range="10"
innerAngle="40"
outerAngle="45"
isEnabled="true"
color="1 1 1 1"
brightness="1"
castShadows="false"
priority="1"
animate="true"
animationPeriod="1"
animationPhase="1"
flareScale="1"
attenuationRatio="0 1 1"
shadowType="Spot"
texSize="512"
overDarkFactor="2000 1000 500 100"
shadowDistance="400"
shadowSoftness="0.15"
numSplits="1"
logWeight="0.91"
fadeStartDistance="0"
lastSplitTerrainOnly="false"
representedInLightmap="false"
shadowDarkenColor="0 0 0 -1"
includeLightmappedGeometryInShadow="false"
position="0 0 1.6137"
rotation="0 0 1 0"
mountNode="-1"
mountPos="0 0 1.5"
mountRot="1 0 0 0"
canSave="true"
canSaveDynamicFields="true" />
</Entity>

View file

@ -58,23 +58,3 @@ exec("./turret.cs");
// Load our gametypes
exec("./gameCore.cs"); // This is the 'core' of the gametype functionality.
exec("./gameDM.cs"); // Overrides GameCore with DeathMatch functionality.
//Entity/Component stuff
if(isFile("./components/game/camera.cs"))
exec("./components/game/camera.cs");
if(isFile("./components/game/controlObject.cs"))
exec("./components/game/controlObject.cs");
if(isFile("./components/game/itemRotate.cs"))
exec("./components/game/itemRotate.cs");
if(isFile("./components/game/playerSpawner.cs"))
exec("./components/game/playerSpawner.cs");
if(isFile("./components/input/fpsControls.cs"))
exec("./components/input/fpsControls.cs");
if(isFile("./components/input/inputManager.cs"))
exec("./components/input/inputManager.cs");
if(isFile("./gameObjects/GameObjectManager.cs"))
{
exec("./gameObjects/GameObjectManager.cs");
execGameObjects();
}

View file

@ -21,7 +21,7 @@
//-----------------------------------------------------------------------------
#include "./../../torque.hlsl"
#include "./../postFX.hlsl"
#include "./../postFx.hlsl"
struct VertToPix
{

View file

@ -20,7 +20,7 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "../../ShaderModelAutoGen.hlsl"
#include "../../shaderModelAutoGen.hlsl"
#include "./../postFx.hlsl"
TORQUE_UNIFORM_SAMPLER2D(occludeMap, 0);

View file

@ -20,7 +20,7 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#include "../../ShaderModelAutoGen.hlsl"
#include "../../shaderModelAutoGen.hlsl"
#include "./../postFx.hlsl"
#define DOSMALL

View file

@ -152,9 +152,20 @@ function MenuBuilder::onAdd(%this)
}
}
function MenuBuilder::reloadItems(%this)
{
%this.clearItems();
for(%i = 0;%this.item[%i] !$= "";%i++)
{
%this.addItem(%i);
}
}
function MenuBuilder::onRemove(%this)
{
%this.removeFromMenuBar();
if(%this.isMethod("removeFromMenuBar"))
%this.removeFromMenuBar();
}
//////////////////////////////////////////////////////////////////////////

View file

@ -50,7 +50,7 @@ function ForestEditorGui::onActiveForestUpdated( %this, %forest, %createNew )
/// Called from a message box when a forest is not found.
function ForestEditorGui::createForest( %this )
{
%forestObject = parseMissionGroupForIds("Forest", "");
%forestObject = trim(parseMissionGroupForIds("Forest", ""));
if ( isObject( %forestObject ) )
{

View file

@ -143,7 +143,7 @@ function ForestEditorPlugin::onActivated( %this )
//ForestEditToolbar.setVisible( true );
//Get our existing forest object in our current mission if we have one
%forestObject = parseMissionGroupForIds("Forest", "");
%forestObject = trim(parseMissionGroupForIds("Forest", ""));
if(isObject(%forestObject))
{
ForestEditorGui.setActiveForest(%forestObject.getName());
@ -241,7 +241,7 @@ function ForestEditorPlugin::onSaveMission( %this, %missionFile )
ForestDataManager.saveDirty();
//First, find out if we have an existing forest object
%forestObject = parseMissionGroupForIds("Forest", "");
%forestObject = trim(parseMissionGroupForIds("Forest", ""));
if ( isObject( %forestObject ) )
{

View file

@ -35,4 +35,3 @@ exec("./GuiEaseEditDlg.ed.cs");
exec("./guiObjectInspector.ed.cs");
exec("./uvEditor.ed.gui");
exec("./objectSelection.ed.cs");
exec("./guiPlatformGenericMenubar.ed.cs");

View file

@ -1,19 +0,0 @@
if(isClass(GuiPlatformGenericMenuBar))
{
exec("./guiPlatformGenericMenubar.ed.gui");
}
else
{
%guiContent = new GuiControl(PlatformGenericMenubar) {
profile = "GuiModelessDialogProfile";
new GuiControl()
{
internalName = "menubar";
extent = "1024 20";
minExtent = "320 20";
horizSizing = "width";
profile = "GuiMenuBarProfile";
};
};
}

View file

@ -1,14 +0,0 @@
//--- OBJECT WRITE BEGIN ---
%guiContent = new GuiControl(PlatformGenericMenubar) {
profile = "GuiModelessDialogProfile";
new GuiPlatformGenericMenuBar()
{
internalName = "menubar";
extent = "1024 20";
minExtent = "320 20";
horizSizing = "width";
profile = "GuiMenuBarProfile";
};
};
//--- OBJECT WRITE END ---

View file

@ -223,7 +223,7 @@ function GuiEditor::switchToWorldEditor( %this )
function GuiEditor::enableMenuItems(%this, %val)
{
%menu = GuiEditCanvas.menuBar->EditMenu.getID();
%menu = GuiEditCanvas.menuBar.findMenu("Edit").getID();
%menu.enableItem( 3, %val ); // cut
%menu.enableItem( 4, %val ); // copy
@ -239,8 +239,8 @@ function GuiEditor::enableMenuItems(%this, %val)
%menu.enableItem( 18, %val ); // group
%menu.enableItem( 19, %val ); // ungroup
GuiEditCanvas.menuBar->LayoutMenu.enableAllItems( %val );
GuiEditCanvas.menuBar->MoveMenu.enableAllItems( %val );
GuiEditCanvas.menuBar.findMenu("Layout").enableAllItems( %val );
GuiEditCanvas.menuBar.findMenu("Move").enableAllItems( %val );
}
//---------------------------------------------------------------------------------------------
@ -294,7 +294,7 @@ function GuiEditor::updateUndoMenu(%this)
%nextUndo = %uman.getNextUndoName();
%nextRedo = %uman.getNextRedoName();
%editMenu = GuiEditCanvas.menuBar->editMenu;
%editMenu = GuiEditCanvas.menuBar.findMenu("Edit");
%editMenu.setItemName( 0, "Undo " @ %nextUndo );
%editMenu.setItemName( 1, "Redo " @ %nextRedo );
@ -443,7 +443,7 @@ function GuiEditor::setPreviewResolution( %this, %width, %height )
function GuiEditor::toggleEdgeSnap( %this )
{
%this.snapToEdges = !%this.snapToEdges;
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_EDGESNAP_INDEX, %this.snapToEdges );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_EDGESNAP_INDEX, %this.snapToEdges );
GuiEditorEdgeSnapping_btn.setStateOn( %this.snapToEdges );
}
@ -452,7 +452,7 @@ function GuiEditor::toggleEdgeSnap( %this )
function GuiEditor::toggleCenterSnap( %this )
{
%this.snapToCenters = !%this.snapToCenters;
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CENTERSNAP_INDEX, %this.snapToCenters );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CENTERSNAP_INDEX, %this.snapToCenters );
GuiEditorCenterSnapping_btn.setStateOn( %this.snapToCenters );
}
@ -461,7 +461,7 @@ function GuiEditor::toggleCenterSnap( %this )
function GuiEditor::toggleFullBoxSelection( %this )
{
%this.fullBoxSelection = !%this.fullBoxSelection;
GuiEditCanvas.menuBar->EditMenu.checkItem( $GUI_EDITOR_MENU_FULLBOXSELECT_INDEX, %this.fullBoxSelection );
GuiEditCanvas.menuBar.findMenu("Edit").checkItem( $GUI_EDITOR_MENU_FULLBOXSELECT_INDEX, %this.fullBoxSelection );
}
//---------------------------------------------------------------------------------------------
@ -469,7 +469,7 @@ function GuiEditor::toggleFullBoxSelection( %this )
function GuiEditor::toggleDrawGuides( %this )
{
%this.drawGuides= !%this.drawGuides;
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_DRAWGUIDES_INDEX, %this.drawGuides );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_DRAWGUIDES_INDEX, %this.drawGuides );
}
//---------------------------------------------------------------------------------------------
@ -477,7 +477,7 @@ function GuiEditor::toggleDrawGuides( %this )
function GuiEditor::toggleGuideSnap( %this )
{
%this.snapToGuides = !%this.snapToGuides;
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_GUIDESNAP_INDEX, %this.snapToGuides );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_GUIDESNAP_INDEX, %this.snapToGuides );
}
//---------------------------------------------------------------------------------------------
@ -485,7 +485,7 @@ function GuiEditor::toggleGuideSnap( %this )
function GuiEditor::toggleControlSnap( %this )
{
%this.snapToControls = !%this.snapToControls;
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CONTROLSNAP_INDEX, %this.snapToControls );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CONTROLSNAP_INDEX, %this.snapToControls );
}
//---------------------------------------------------------------------------------------------
@ -493,7 +493,7 @@ function GuiEditor::toggleControlSnap( %this )
function GuiEditor::toggleCanvasSnap( %this )
{
%this.snapToCanvas = !%this.snapToCanvas;
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CANVASSNAP_INDEX, %this.snapToCanvas );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CANVASSNAP_INDEX, %this.snapToCanvas );
}
//---------------------------------------------------------------------------------------------
@ -506,7 +506,7 @@ function GuiEditor::toggleGridSnap( %this )
else
%this.setSnapToGrid( %this.snap2GridSize );
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_GRIDSNAP_INDEX, %this.snap2Grid );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_GRIDSNAP_INDEX, %this.snap2Grid );
GuiEditorSnapCheckBox.setStateOn( %this.snap2Grid );
}
@ -993,14 +993,14 @@ function GuiEditorGui::onWake( %this )
// Set up initial menu toggle states.
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_EDGESNAP_INDEX, GuiEditor.snapToEdges );
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CENTERSNAP_INDEX, GuiEditor.snapToCenters );
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_GUIDESNAP_INDEX, GuiEditor.snapToGuides );
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CONTROLSNAP_INDEX, GuiEditor.snapToControls );
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_CANVASSNAP_INDEX, GuiEditor.snapToCanvas );
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_GRIDSNAP_INDEX, GuiEditor.snap2Grid );
GuiEditCanvas.menuBar->SnapMenu.checkItem( $GUI_EDITOR_MENU_DRAWGUIDES_INDEX, GuiEditor.drawGuides );
GuiEditCanvas.menuBar->EditMenu.checkItem( $GUI_EDITOR_MENU_FULLBOXSELECT_INDEX, GuiEditor.fullBoxSelection );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_EDGESNAP_INDEX, GuiEditor.snapToEdges );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CENTERSNAP_INDEX, GuiEditor.snapToCenters );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_GUIDESNAP_INDEX, GuiEditor.snapToGuides );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CONTROLSNAP_INDEX, GuiEditor.snapToControls );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_CANVASSNAP_INDEX, GuiEditor.snapToCanvas );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_GRIDSNAP_INDEX, GuiEditor.snap2Grid );
GuiEditCanvas.menuBar.findMenu("Snap").checkItem( $GUI_EDITOR_MENU_DRAWGUIDES_INDEX, GuiEditor.drawGuides );
GuiEditCanvas.menuBar.findMenu("Edit").checkItem( $GUI_EDITOR_MENU_FULLBOXSELECT_INDEX, GuiEditor.fullBoxSelection );
// Sync toolbar buttons.

View file

@ -66,9 +66,13 @@ function GuiEditCanvas::onCreateMenu(%this)
}
// Menu bar
%this.menuBar = new MenuBar()
%this.menuBar = new GuiMenuBar(GuiEditorMenubar)
{
dynamicItemInsertPos = 3;
extent = "1024 20";
minExtent = "320 20";
horizSizing = "width";
profile = "GuiMenuBarProfile";
new PopupMenu()
{

View file

@ -28,33 +28,6 @@
function GuiEditorTreeView::init(%this)
{
if( !isObject( %this.contextMenu ) )
%this.contextMenu = new PopupMenu()
{
superClass = "MenuBuilder";
isPopup = true;
item[ 0 ] = "Rename" TAB "" TAB "GuiEditorTreeView.showItemRenameCtrl( GuiEditorTreeView.findItemByObjectId( %this.object ) );";
item[ 1 ] = "Delete" TAB "" TAB "GuiEditor.deleteControl( %this.object );";
item[ 2 ] = "-";
item[ 3 ] = "Locked" TAB "" TAB "%this.object.setLocked( !%this.object.locked ); GuiEditorTreeView.update();";
item[ 4 ] = "Hidden" TAB "" TAB "%this.object.setVisible( !%this.object.isVisible() ); GuiEditorTreeView.update();";
item[ 5 ] = "-";
item[ 6 ] = "Add New Controls Here" TAB "" TAB "GuiEditor.setCurrentAddSet( %this.object );";
item[ 7 ] = "Add Child Controls to Selection" TAB "" TAB "GuiEditor.selectAllControlsInSet( %this.object, false );";
item[ 8 ] = "Remove Child Controls from Selection" TAB "" TAB "GuiEditor.selectAllControlsInSet( %this.object, true );";
object = -1;
};
if( !isObject( %this.contextMenuMultiSel ) )
%this.contextMenuMultiSel = new PopupMenu()
{
superClass = "MenuBuilder";
isPopup = true;
item[ 0 ] = "Delete" TAB "" TAB "GuiEditor.deleteSelection();";
};
}
//---------------------------------------------------------------------------------------------
@ -113,12 +86,36 @@ function GuiEditorTreeView::onRightMouseDown( %this, %item, %pts, %obj )
{
if( %this.getSelectedItemsCount() > 1 )
{
%popup = %this.contextMenuMultiSel;
%popup = new PopupMenu()
{
superClass = "MenuBuilder";
isPopup = true;
object = -1;
};
%popup.item[ 0 ] = "Delete" TAB "" TAB "GuiEditor.deleteSelection();";
%popup.reloadItems();
%popup.showPopup( Canvas );
}
else if( %obj )
{
%popup = %this.contextMenu;
%popup = new PopupMenu()
{
superClass = "MenuBuilder";
isPopup = true;
object = %obj;
};
%popup.item[ 0 ] = "Rename" TAB "" TAB "GuiEditorTreeView.showItemRenameCtrl( GuiEditorTreeView.findItemByObjectId(" @ %popup.object @ ") );";
%popup.item[ 1 ] = "Delete" TAB "" TAB "GuiEditor.deleteControl(" @ %popup.object @ ");";
%popup.item[ 2 ] = "-";
%popup.item[ 3 ] = "Locked" TAB "" TAB "%this.object.setLocked( !" @ %popup.object @ ".locked); GuiEditorTreeView.update();";
%popup.item[ 4 ] = "Hidden" TAB "" TAB "%this.object.setVisible( !" @ %popup.object @ ".isVisible() ); GuiEditorTreeView.update();";
%popup.item[ 5 ] = "-";
%popup.item[ 6 ] = "Add New Controls Here" TAB "" TAB "GuiEditor.setCurrentAddSet( " @ %popup.object @ ");";
%popup.item[ 7 ] = "Add Child Controls to Selection" TAB "" TAB "GuiEditor.selectAllControlsInSet( " @ %popup.object @ ", false );";
%popup.item[ 8 ] = "Remove Child Controls from Selection" TAB "" TAB "GuiEditor.selectAllControlsInSet( " @ %popup.object @ ", true );";
%popup.checkItem( 3, %obj.locked );
%popup.checkItem( 4, !%obj.isVisible() );
@ -127,7 +124,8 @@ function GuiEditorTreeView::onRightMouseDown( %this, %item, %pts, %obj )
%popup.enableItem( 7, %obj.getCount() > 0 );
%popup.enableItem( 8, %obj.getCount() > 0 );
%popup.object = %obj;
%popup.reloadItems();
%popup.showPopup( Canvas );
}
}

View file

@ -2719,7 +2719,7 @@ function ShapeEdDetailTree::onRightMouseUp( %this, %itemId, %mouse )
superClass = "MenuBuilder";
isPopup = "1";
item[ 0 ] = "Hidden" TAB "" TAB "ShapeEdDetailTree.onHideMeshItem( %this._objName, !%this._itemHidden );";
item[ 0 ] = "Hidden" TAB "" TAB "ShapeEdDetailTree.onHideMeshItem(" @ ShapeEdMeshPopup._objName @ ", !" @ ShapeEdMeshPopup @ "._itemHidden );";
item[ 1 ] = "-";
item[ 2 ] = "Hide all" TAB "" TAB "ShapeEdDetailTree.onHideMeshItem( \"\", true );";
item[ 3 ] = "Show all" TAB "" TAB "ShapeEdDetailTree.onHideMeshItem( \"\", false );";

View file

@ -1302,6 +1302,7 @@ function VisibilityDropdownToggle()
{
EVisibility.setVisible(true);
visibilityToggleBtn.setStateOn(1);
EVisibility.setExtent("200 540");
}
}
@ -1569,169 +1570,112 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
%haveObjectEntries = false;
%haveLockAndHideEntries = true;
// Handle multi-selection.
//Set up the generic pop-up pre-emptively if we haven't already
%popup = new PopupMenu()
{
superClass = "MenuBuilder";
isPopup = "1";
object = -1;
bookmark = -1;
};
if( %this.getSelectedItemsCount() > 1 )
{
%popup = ETMultiSelectionContextPopup;
if( !isObject( %popup ) )
%popup = new PopupMenu( ETMultiSelectionContextPopup )
{
superClass = "MenuBuilder";
isPopup = "1";
item[ 0 ] = "Delete" TAB "" TAB "EditorMenuEditDelete();";
item[ 1 ] = "Group" TAB "" TAB "EWorldEditor.addSimGroup( true );";
};
%popup.item[ 0 ] = "Delete" TAB "" TAB "EditorMenuEditDelete();";
%popup.item[ 1 ] = "Group" TAB "" TAB "EWorldEditor.addSimGroup( true );";
}
// Open context menu if this is a CameraBookmark
else if( %obj.isMemberOfClass( "CameraBookmark" ) )
{
%popup = ETCameraBookmarkContextPopup;
if( !isObject( %popup ) )
%popup = new PopupMenu( ETCameraBookmarkContextPopup )
{
superClass = "MenuBuilder";
isPopup = "1";
item[ 0 ] = "Go To Bookmark" TAB "" TAB "EditorGui.jumpToBookmark( %this.bookmark.getInternalName() );";
bookmark = -1;
};
ETCameraBookmarkContextPopup.bookmark = %obj;
}
// Open context menu if this is set CameraBookmarks group.
else if( %obj.name $= "CameraBookmarks" )
{
%popup = ETCameraBookmarksGroupContextPopup;
if( !isObject( %popup ) )
%popup = new PopupMenu( ETCameraBookmarksGroupContextPopup )
{
superClass = "MenuBuilder";
isPopup = "1";
item[ 0 ] = "Add Camera Bookmark" TAB "" TAB "EditorGui.addCameraBookmarkByGui();";
};
}
// Open context menu if this is a SimGroup
else if( !%obj.isMemberOfClass( "SceneObject" ) )
{
%popup = ETSimGroupContextPopup;
if( !isObject( %popup ) )
%popup = new PopupMenu( ETSimGroupContextPopup )
{
superClass = "MenuBuilder";
isPopup = "1";
item[ 0 ] = "Rename" TAB "" TAB "EditorTree.showItemRenameCtrl( EditorTree.findItemByObjectId( %this.object ) );";
item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject( %this.object );";
item[ 2 ] = "Inspect" TAB "" TAB "inspectObject( %this.object );";
item[ 3 ] = "-";
item[ 4 ] = "Toggle Lock Children" TAB "" TAB "EWorldEditor.toggleLockChildren( %this.object );";
item[ 5 ] = "Toggle Hide Children" TAB "" TAB "EWorldEditor.toggleHideChildren( %this.object );";
item[ 6 ] = "-";
item[ 7 ] = "Group" TAB "" TAB "EWorldEditor.addSimGroup( true );";
item[ 8 ] = "-";
item[ 9 ] = "Add New Objects Here" TAB "" TAB "EWCreatorWindow.setNewObjectGroup( %this.object );";
item[ 10 ] = "Add Children to Selection" TAB "" TAB "EWorldEditor.selectAllObjectsInSet( %this.object, false );";
item[ 11 ] = "Remove Children from Selection" TAB "" TAB "EWorldEditor.selectAllObjectsInSet( %this.object, true );";
object = -1;
};
%popup.object = %obj;
%hasChildren = %obj.getCount() > 0;
%popup.enableItem( 10, %hasChildren );
%popup.enableItem( 11, %hasChildren );
%haveObjectEntries = true;
%haveLockAndHideEntries = false;
}
// Open generic context menu.
else
{
%popup = ETContextPopup;
if( !isObject( %popup ) )
%popup = new PopupMenu( ETContextPopup )
{
superClass = "MenuBuilder";
isPopup = "1";
item[ 0 ] = "Rename" TAB "" TAB "EditorTree.showItemRenameCtrl( EditorTree.findItemByObjectId( %this.object ) );";
item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject( %this.object );";
item[ 2 ] = "Inspect" TAB "" TAB "inspectObject( %this.object );";
item[ 3 ] = "-";
item[ 4 ] = "Locked" TAB "" TAB "%this.object.setLocked( !%this.object.locked ); EWorldEditor.syncGui();";
item[ 5 ] = "Hidden" TAB "" TAB "EWorldEditor.hideObject( %this.object, !%this.object.hidden ); EWorldEditor.syncGui();";
item[ 6 ] = "-";
item[ 7 ] = "Group" TAB "" TAB "EWorldEditor.addSimGroup( true );";
object = -1;
};
if( %obj.isMemberOfClass( "CameraBookmark" ) )
{
%popup.bookmark = %obj;
if(%obj.isMemberOfClass("Entity"))
{
%popup = ETEntityContextPopup;
if( !isObject( %popup ) )
%popup = new PopupMenu( ETEntityContextPopup : ETSimGroupContextPopup )
{
superClass = "MenuBuilder";
isPopup = "1";
item[ 12 ] = "-";
item[ 13 ] = "Convert to Game Object" TAB "" TAB "EWorldEditor.createGameObject( %this.object );";
};
%popup.item[ 0 ] = "Go To Bookmark" TAB "" TAB "EditorGui.jumpToBookmark( " @ %popup.bookmark.getInternalName() @ " );";
}
// Specialized version for ConvexShapes.
else if( %obj.isMemberOfClass( "ConvexShape" ) )
else if( %obj.name $= "CameraBookmarks" )
{
%popup = ETConvexShapeContextPopup;
if( !isObject( %popup ) )
%popup = new PopupMenu( ETConvexShapeContextPopup : ETContextPopup )
{
superClass = "MenuBuilder";
isPopup = "1";
item[ 8 ] = "-";
item[ 9 ] = "Convert to Zone" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"Zone\" );";
item[ 10 ] = "Convert to Portal" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"Portal\" );";
item[ 11 ] = "Convert to Occluder" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"OcclusionVolume\" );";
item[ 12 ] = "Convert to Sound Space" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"SFXSpace\" );";
};
%popup.item[ 0 ] = "Add Camera Bookmark" TAB "" TAB "EditorGui.addCameraBookmarkByGui();";
}
// Specialized version for polyhedral objects.
else if( %obj.isMemberOfClass( "Zone" ) ||
else
{
%popup.object = %obj;
%haveObjectEntries = true;
%popup.item[ 0 ] = "Rename" TAB "" TAB "EditorTree.showItemRenameCtrl( EditorTree.findItemByObjectId(" @ %popup.object @ ") );";
%popup.item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject(" @ %popup.object @ ");";
%popup.item[ 2 ] = "Inspect" TAB "" TAB "inspectObject(" @ %popup.object @ ");";
%popup.item[ 3 ] = "-";
%popup.item[ 4 ] = "Locked" TAB "" TAB "%this.object.setLocked( !" @ %popup.object @ ".locked ); EWorldEditor.syncGui();";
%popup.item[ 5 ] = "Hidden" TAB "" TAB "EWorldEditor.hideObject( " @ %popup.object @ ", !" @ %popup.object @ ".hidden ); EWorldEditor.syncGui();";
%popup.item[ 6 ] = "-";
%popup.item[ 7 ] = "Group" TAB "" TAB "EWorldEditor.addSimGroup( true );";
if( %obj.isMemberOfClass( "ConvexShape" ) )
{
%popup.item[ 8 ] = "-";
%popup.item[ 9 ] = "Convert to Zone" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"Zone\" );";
%popup.item[ 10 ] = "Convert to Portal" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"Portal\" );";
%popup.item[ 11 ] = "Convert to Occluder" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"OcclusionVolume\" );";
%popup.item[ 12 ] = "Convert to Sound Space" TAB "" TAB "EWorldEditor.convertSelectionToPolyhedralObjects( \"SFXSpace\" );";
}
else if( %obj.isMemberOfClass( "Zone" ) ||
%obj.isMemberOfClass( "Portal" ) ||
%obj.isMemberOfClass( "OcclusionVolume" ) ||
%obj.isMemberOfClass( "SFXSpace" ) )
{
%popup = ETPolyObjectContextPopup;
if( !isObject( %popup ) )
%popup = new PopupMenu( ETPolyObjectContextPopup : ETContextPopup )
{
%popup.item[ 8 ] = "-";
%popup.item[ 9 ] = "Convert to ConvexShape" TAB "" TAB "EWorldEditor.convertSelectionToConvexShape();";
}
else if(%obj.getClassName() $= "SimGroup" ||
%obj.isMemberOfClass( "Path" ) ||
%obj.isMemberOfClass("Entity") )
{
//If it's not any special-handle classes above, then it'll be group-based stuff here
%popup.item[ 4 ] = "Toggle Lock Children" TAB "" TAB "EWorldEditor.toggleLockChildren( " @ %popup.object @ " );";
%popup.item[ 5 ] = "Toggle Hide Children" TAB "" TAB "EWorldEditor.toggleHideChildren( " @ %popup.object @ " );";
%popup.item[ 8 ] = "-";
%popup.item[ 9 ] = "Add New Objects Here" TAB "" TAB "EWCreatorWindow.setNewObjectGroup( " @ %popup.object @ " );";
%popup.item[ 10 ] = "Add Children to Selection" TAB "" TAB "EWorldEditor.selectAllObjectsInSet( " @ %popup.object @ ", false );";
%popup.item[ 11 ] = "Remove Children from Selection" TAB "" TAB "EWorldEditor.selectAllObjectsInSet( " @ %popup.object @ ", true );";
%hasChildren = %obj.getCount() > 0;
%popup.enableItem( 10, %hasChildren );
%popup.enableItem( 11, %hasChildren );
%haveObjectEntries = true;
%haveLockAndHideEntries = false;
//Special case for Entities, which is special-case AND does group stuff with chld objects
if(%obj.isMemberOfClass("Entity"))
{
superClass = "MenuBuilder";
isPopup = "1";
item[ 8 ] = "-";
item[ 9 ] = "Convert to ConvexShape" TAB "" TAB "EWorldEditor.convertSelectionToConvexShape();";
};
%popup.item[ 12 ] = "-";
%popup.item[ 13 ] = "Convert to Game Object" TAB "" TAB "EWorldEditor.createGameObject( " @ %popup.object @ " );";
%popup.item[ 14 ] = "Duplicate Game Object" TAB "" TAB "EWorldEditor.duplicateGameObject( " @ %popup.object @ " );";
%popup.item[ 15 ] = "Show in Asset Browser" TAB "" TAB "EWorldEditor.showGameObjectInAssetBrowser( " @ %popup.object @ " );";
if(!isObject(AssetDatabase.acquireAsset(%obj.gameObjectAsset)))
{
%popup.enableItem(13, true);
%popup.enableItem(14, false);
%popup.enableItem(15, false);
}
else
{
%popup.enableItem(13, false);
%popup.enableItem(14, true);
%popup.enableItem(15, true);
}
}
}
}
%popup.object = %obj;
%haveObjectEntries = true;
}
if( %haveObjectEntries )
{
%popup.enableItem( 0, %obj.isNameChangeAllowed() && %obj.getName() !$= "MissionGroup" );
%popup.enableItem( 1, %obj.getName() !$= "MissionGroup" );
if( %haveLockAndHideEntries )
{
%popup.checkItem( 4, %obj.locked );
@ -1740,6 +1684,7 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
%popup.enableItem( 7, %this.isItemSelected( %itemId ) );
}
%popup.reloadItems();
%popup.showPopup( Canvas );
}
@ -2017,7 +1962,7 @@ function EWorldEditor::syncGui( %this )
%this.syncToolPalette();
EditorTree.update();
Editor.getUndoManager().updateUndoMenu( EditorGui.menuBar-->EditMenu );
Editor.getUndoManager().updateUndoMenu( EditorGui.findMenu("Edit") );
EditorGuiStatusBar.setSelectionObjectsByCount( %this.getSelectionSize() );
EWTreeWindow-->LockSelection.setStateOn( %this.getSelectionLockCount() > 0 );
@ -2253,155 +2198,6 @@ function EWorldEditor::deleteMissionObject( %this, %object )
EditorTree.buildVisibleTree( true );
}
function EWorldEditor::createGameObject( %this, %entity )
{
if(!isObject(GameObjectBuilder))
{
new GuiControl(GameObjectBuilder, EditorGuiGroup) {
profile = "ToolsGuiDefaultProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "0 0";
extent = "800 600";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
new GuiWindowCtrl(GameObjectBuilderTargetWindow) {
profile = "ToolsGuiWindowProfile";
horizSizing = "center";
vertSizing = "center";
position = "384 205";
extent = "256 102";
minExtent = "256 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
text = "Create Object";
new GuiTextCtrl() {
profile = "GuiCenterTextProfile";
horizSizing = "right";
vertSizing = "bottom";
position = "9 26";
extent = "84 16";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
text = "Object Name:";
};
new GuiTextEditCtrl(GameObjectBuilderObjectName) {
class = ObjectBuilderGuiTextEditCtrl;
profile = "ToolsGuiTextEditProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "78 26";
extent = "172 18";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
helpTag = "0";
historySize = "0";
};
new GuiButtonCtrl(GameObjectBuilderOKButton) {
profile = "ToolsGuiButtonProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "7 250";
extent = "156 24";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
command = "EWorldEditor.buildGameObject();";
helpTag = "0";
text = "Create New";
Accelerator = "return";
};
new GuiButtonCtrl(GameObjectBuilderCancelButton) {
profile = "ToolsGuiButtonProfile";
horizSizing = "left";
vertSizing = "bottom";
position = "170 250";
extent = "80 24";
minExtent = "8 8";
visible = "1";
setFirstResponder = "0";
modal = "1";
command = "Canvas.popDialog(GameObjectBuilder);";
helpTag = "0";
text = "Cancel";
Accelerator = "escape";
};
};
};
GameObjectBuilderTargetWindow.extent = getWord(GameObjectBuilderTargetWindow.extent, 0) SPC 88;
GameObjectBuilderOKButton.position = getWord(GameObjectBuilderOKButton.position, 0) SPC 57;
GameObjectBuilderCancelButton.position = getWord(GameObjectBuilderCancelButton.position, 0) SPC 57;
}
GameObjectBuilderObjectName.text = "";
GameObjectBuilder.selectedEntity = %entity;
Canvas.pushDialog(GameObjectBuilder);
}
function EWorldEditor::buildGameObject(%this)
{
if(GameObjectBuilderObjectName.getText() $= "")
{
error("Attempted to make a new Game Object with no name!");
Canvas.popDialog(GameObjectBuilder);
return;
}
%path = EditorSettings.value( "WorldEditor/newGameObjectDir" );
%className = GameObjectBuilderObjectName.getText();
GameObjectBuilder.selectedEntity.class = %className;
Inspector.inspect(GameObjectBuilder.selectedEntity);
%file = new FileObject();
if(%file.openForWrite(%path @ "\\" @ %className @ ".cs"))
{
%file.writeline("function " @ %className @ "::onAdd(%this)\n{\n\n}\n");
%file.writeline("function " @ %className @ "::onRemove(%this)\n{\n\n}\n");
//todo, pre-write any event functions of interest
%file.close();
}
//set up the paths
%tamlPath = %path @ "/" @ %className @ ".taml";
%scriptPath = %path @ "/" @ %className @ ".cs";
saveGameObject(%className, %tamlPath, %scriptPath);
//reload it
execGameObjects();
//now, add the script file and a ref to the taml into our SGO manifest so we can readily spawn it later.
TamlWrite(GameObjectBuilder.selectedEntity, %tamlpath);
GameObjectBuilder.selectedEntity = "";
Canvas.popDialog(GameObjectBuilder);
}
function EWorldEditor::selectAllObjectsInSet( %this, %set, %deselect )
{
if( !isObject( %set ) )

View file

@ -34,7 +34,6 @@ EditorSettings.setDefaultValue( "orthoFOV", "50" );
EditorSettings.setDefaultValue( "orthoShowGrid", "1" );
EditorSettings.setDefaultValue( "currentEditor", "WorldEditorInspectorPlugin" );
EditorSettings.setDefaultValue( "newLevelFile", "tools/levels/BlankRoom.mis" );
EditorSettings.setDefaultValue( "newGameObjectDir", "scripts/server/gameObjects" );
if( isFile( "C:/Program Files/Torsion/Torsion.exe" ) )
EditorSettings.setDefaultValue( "torsionPath", "C:/Program Files/Torsion/Torsion.exe" );

View file

@ -304,36 +304,6 @@ function EWCreatorWindow::navigate( %this, %address )
%this.addShapeIcon( %obj );
}
}
//Add a separate folder for Game Objects
if(isClass("Entity"))
{
if(%address $= "")
{
%this.addFolderIcon("GameObjects");
}
else
{
//find all GameObjectAssets
%assetQuery = new AssetQuery();
if(!AssetDatabase.findAssetType(%assetQuery, "GameObjectAsset"))
return 0; //if we didn't find ANY, just exit
%count = %assetQuery.getCount();
for(%i=0; %i < %count; %i++)
{
%assetId = %assetQuery.getAsset(%i);
%gameObjectAsset = AssetDatabase.acquireAsset(%assetId);
if(isFile(%gameObjectAsset.TAMLFilePath))
{
%this.addGameObjectIcon( %gameObjectAsset.gameObjectName );
}
}
}
}
}
if ( %this.tab $= "Meshes" )
@ -768,22 +738,6 @@ function EWCreatorWindow::addPrefabIcon( %this, %fullPath )
%this.contentCtrl.addGuiControl( %ctrl );
}
function EWCreatorWindow::addGameObjectIcon( %this, %gameObjectName )
{
%ctrl = %this.createIcon();
%ctrl.altCommand = "spawnGameObject( \"" @ %gameObjectName @ "\", true );";
%ctrl.iconBitmap = EditorIconRegistry::findIconByClassName( "Prefab" );
%ctrl.text = %gameObjectName;
%ctrl.class = "CreatorGameObjectIconBtn";
%ctrl.tooltip = "Spawn the " @ %gameObjectName @ " GameObject";
%ctrl.buttonType = "radioButton";
%ctrl.groupNum = "-1";
%this.contentCtrl.addGuiControl( %ctrl );
}
function CreatorPopupMenu::onSelect( %this, %id, %text )
{
%split = strreplace( %text, "/", " " );

View file

@ -110,9 +110,13 @@ function EditorGui::buildMenus(%this)
};
// Menu bar
%this.menuBar = new MenuBar(WorldEditorMenubar)
%this.menuBar = new GuiMenuBar(WorldEditorMenubar)
{
dynamicItemInsertPos = 3;
extent = "1024 20";
minExtent = "320 20";
horizSizing = "width";
profile = "GuiMenuBarProfile";
};
// File Menu
@ -158,7 +162,7 @@ function EditorGui::buildMenus(%this)
%fileMenu.appendItem("Exit Level" TAB "" TAB "EditorExitMission();");
%fileMenu.appendItem("Quit" TAB %quitShortcut TAB "EditorQuitGame();");
%this.menuBar.insert(%fileMenu, %this.menuBar.getCount());
%this.menuBar.insert(%fileMenu);
// Edit Menu
%editMenu = new PopupMenu()
@ -187,7 +191,7 @@ function EditorGui::buildMenus(%this)
item[15] = "Game Options..." TAB "" TAB "Canvas.pushDialog(optionsDlg);";
item[16] = "PostEffect Manager" TAB "" TAB "Canvas.pushDialog(PostFXManager);";
};
%this.menuBar.insert(%editMenu, %this.menuBar.getCount());
%this.menuBar.insert(%editMenu);
// View Menu
%viewMenu = new PopupMenu()
@ -201,7 +205,7 @@ function EditorGui::buildMenus(%this)
item[ 0 ] = "Visibility Layers" TAB "Alt V" TAB "VisibilityDropdownToggle();";
item[ 1 ] = "Show Grid in Ortho Views" TAB %cmdCtrl @ "-Shift-Alt G" TAB "EditorGui.toggleOrthoGrid();";
};
%this.menuBar.insert(%viewMenu, %this.menuBar.getCount());
%this.menuBar.insert(%viewMenu);
// Camera Menu
%cameraMenu = new PopupMenu()
@ -229,7 +233,7 @@ function EditorGui::buildMenus(%this)
Item[15] = "Manage Bookmarks..." TAB "Ctrl-Shift B" TAB "EditorGui.toggleCameraBookmarkWindow();";
item[16] = "Jump to Bookmark" TAB %this.cameraBookmarksMenu;
};
%this.menuBar.insert(%cameraMenu, %this.menuBar.getCount());
%this.menuBar.insert(%cameraMenu);
// Editors Menu
%editorsMenu = new PopupMenu()
@ -246,7 +250,7 @@ function EditorGui::buildMenus(%this)
//item[4] = "Terrain Painter" TAB "F4" TAB TerrainPainterPlugin;
//item[5] = "-";
};
%this.menuBar.insert(%editorsMenu, %this.menuBar.getCount());
%this.menuBar.insert(%editorsMenu);
// Lighting Menu
%lightingMenu = new PopupMenu()
@ -263,7 +267,7 @@ function EditorGui::buildMenus(%this)
// NOTE: The light managers will be inserted as the
// last menu items in EditorLightingMenu::onAdd().
};
%this.menuBar.insert(%lightingMenu, %this.menuBar.getCount());
%this.menuBar.insert(%lightingMenu);
// Tools Menu
%toolsMenu = new PopupMenu()
@ -278,7 +282,7 @@ function EditorGui::buildMenus(%this)
item[2] = "Torque SimView" TAB "" TAB "tree();";
item[3] = "Make Selected a Mesh" TAB "" TAB "makeSelectedAMesh();";
};
%this.menuBar.insert(%toolsMenu, %this.menuBar.getCount());
%this.menuBar.insert(%toolsMenu);
// Help Menu
%helpMenu = new PopupMenu()
@ -293,7 +297,7 @@ function EditorGui::buildMenus(%this)
item[2] = "Offline Reference Guide..." TAB "" TAB "shellexecute(EWorldEditor.documentationReference);";
item[3] = "Torque 3D Forums..." TAB "" TAB "gotoWebPage(EWorldEditor.forumURL);";
};
%this.menuBar.insert(%helpMenu, %this.menuBar.getCount());
%this.menuBar.insert(%helpMenu);
// Menus that are added/removed dynamically (temporary)
@ -398,9 +402,9 @@ function EditorGui::setMenuDefaultState(%this)
if(! isObject(%this.menuBar))
return 0;
for(%i = 0;%i < %this.menuBar.getCount();%i++)
for(%i = 0;%i < %this.menuBar.getMenuCount();%i++)
{
%menu = %this.menuBar.getObject(%i);
%menu = %this.menuBar.getMenu(%i);
%menu.setupDefaultState();
}
@ -414,9 +418,10 @@ function EditorGui::findMenu(%this, %name)
if(! isObject(%this.menuBar))
return 0;
for(%i = 0;%i < %this.menuBar.getCount();%i++)
for(%i = 0; %i < %this.menuBar.getMenuCount(); %i++)
{
%menu = %this.menuBar.getObject(%i);
%menu = %this.menuBar.getMenu(%i);
if(%name $= %menu.barTitle)
return %menu;