mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 15:14:35 +00:00
Merge pull request #1673 from Azaezel/alpha41/ContextCleanups
minor cleanups for https://github.com/TorqueGameEngines/Torque3D/pull/1672
This commit is contained in:
commit
e7ffff8cb2
4 changed files with 11 additions and 29 deletions
|
|
@ -28,6 +28,7 @@
|
||||||
#include "console/engineAPI.h"
|
#include "console/engineAPI.h"
|
||||||
#include "collision/boxConvex.h"
|
#include "collision/boxConvex.h"
|
||||||
#include "console/script.h"
|
#include "console/script.h"
|
||||||
|
#include "console/consoleInternal.h"
|
||||||
|
|
||||||
#include "core/stream/bitStream.h"
|
#include "core/stream/bitStream.h"
|
||||||
#include "math/mathIO.h"
|
#include "math/mathIO.h"
|
||||||
|
|
@ -172,8 +173,9 @@ Trigger::Trigger()
|
||||||
|
|
||||||
mPhysicsRep = NULL;
|
mPhysicsRep = NULL;
|
||||||
mTripOnce = false;
|
mTripOnce = false;
|
||||||
|
mTripped = false;
|
||||||
mTrippedBy = 0xFFFFFFFF;
|
mTrippedBy = 0xFFFFFFFF;
|
||||||
mTripIf = "";
|
mTripIf.clear();
|
||||||
|
|
||||||
//Default up a basic square
|
//Default up a basic square
|
||||||
Point3F vecs[3] = { Point3F(1.0, 0.0, 0.0),
|
Point3F vecs[3] = { Point3F(1.0, 0.0, 0.0),
|
||||||
|
|
@ -748,21 +750,11 @@ void Trigger::potentialEnterObject(GameBase* enter)
|
||||||
mObjects.push_back(enter);
|
mObjects.push_back(enter);
|
||||||
deleteNotify(enter);
|
deleteNotify(enter);
|
||||||
|
|
||||||
if(evalCmD(&mEnterCommand))
|
if(isServerObject() && evalCmD(&mEnterCommand))
|
||||||
{
|
{
|
||||||
String command = String("%obj = ") + enter->getIdString() + ";";
|
String command = String("%obj = ") + enter->getIdString() + ";";
|
||||||
command = command + String("%this = ") + getIdString() + ";" + mEnterCommand;
|
command = command + String("%this = ") + getIdString() + ";" + mEnterCommand;
|
||||||
|
Con::evaluate(command.c_str(), false, Con::getCurrentScriptModulePath());
|
||||||
StringTableEntry objectName = getName();
|
|
||||||
if (objectName != NULL)
|
|
||||||
objectName = getIdString();
|
|
||||||
|
|
||||||
StringTableEntry groupName = getGroup()->getName();
|
|
||||||
if (groupName != NULL)
|
|
||||||
groupName = getGroup()->getIdString();
|
|
||||||
|
|
||||||
String context = String::ToString("%s\nGroup: %s, Object: %s", getFilename(), groupName, objectName);
|
|
||||||
Con::evaluate(command.c_str(), false, context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( mDataBlock && testTrippable() && testCondition())
|
if( mDataBlock && testTrippable() && testCondition())
|
||||||
|
|
@ -807,21 +799,11 @@ void Trigger::processTick(const Move* move)
|
||||||
mObjects.erase(i);
|
mObjects.erase(i);
|
||||||
clearNotify(remove);
|
clearNotify(remove);
|
||||||
|
|
||||||
if (evalCmD(&mLeaveCommand))
|
if (isServerObject() && evalCmD(&mLeaveCommand))
|
||||||
{
|
{
|
||||||
String command = String("%obj = ") + remove->getIdString() + ";";
|
String command = String("%obj = ") + remove->getIdString() + ";";
|
||||||
command = command + String("%this = ") + getIdString() + ";" + mLeaveCommand;
|
command = command + String("%this = ") + getIdString() + ";" + mLeaveCommand;
|
||||||
|
Con::evaluate(command.c_str(), false, Con::getCurrentScriptModulePath());
|
||||||
StringTableEntry objectName = getName();
|
|
||||||
if (objectName != NULL)
|
|
||||||
objectName = getIdString();
|
|
||||||
|
|
||||||
StringTableEntry groupName = getGroup()->getName();
|
|
||||||
if (groupName != NULL)
|
|
||||||
groupName = getGroup()->getIdString();
|
|
||||||
|
|
||||||
String context = String::ToString("%s\nGroup: %s, Object: %s", getFilename(), groupName, objectName);
|
|
||||||
Con::evaluate(command.c_str(), false, context);
|
|
||||||
}
|
}
|
||||||
if (testTrippable() && testCondition())
|
if (testTrippable() && testCondition())
|
||||||
mDataBlock->onLeaveTrigger_callback( this, remove );
|
mDataBlock->onLeaveTrigger_callback( this, remove );
|
||||||
|
|
@ -829,7 +811,7 @@ void Trigger::processTick(const Move* move)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evalCmD(&mTickCommand))
|
if (isServerObject() && evalCmD(&mTickCommand))
|
||||||
{
|
{
|
||||||
StringTableEntry objectName = getName();
|
StringTableEntry objectName = getName();
|
||||||
if (objectName != NULL)
|
if (objectName != NULL)
|
||||||
|
|
|
||||||
|
|
@ -496,7 +496,7 @@ void GuiGameSettingsCtrl::doScriptCommand(StringTableEntry command)
|
||||||
setThisControl();
|
setThisControl();
|
||||||
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
|
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
|
||||||
String context = String::ToString("%s\nObject: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
|
String context = String::ToString("%s\nObject: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
|
||||||
Con::evaluate(command, false, context);
|
Con::evaluate(command, false, context.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ bool GuiMLTextEditCtrl::onKeyDown(const GuiEvent& event)
|
||||||
{
|
{
|
||||||
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
|
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
|
||||||
String context = String::ToString("%s, Object: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
|
String context = String::ToString("%s, Object: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
|
||||||
Con::evaluate( mEscapeCommand, false, context );
|
Con::evaluate( mEscapeCommand, false, context.c_str());
|
||||||
return( true );
|
return( true );
|
||||||
}
|
}
|
||||||
return( Parent::onKeyDown( event ) );
|
return( Parent::onKeyDown( event ) );
|
||||||
|
|
|
||||||
|
|
@ -1486,7 +1486,7 @@ bool ActionMap::processAction(const InputEventInfo* pEvent)
|
||||||
{
|
{
|
||||||
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
|
StringTableEntry objectName = getName() != StringTable->EmptyString() ? getName() : getInternalName();
|
||||||
String context = String::ToString("%s\nObject: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
|
String context = String::ToString("%s\nObject: %s", Platform::makeRelativePathName(getFilename(), NULL), objectName);
|
||||||
Con::evaluate(pNode->makeConsoleCommand, false, context);
|
Con::evaluate(pNode->makeConsoleCommand, false, context.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (pNode->flags & Node::Held)
|
else if (pNode->flags & Node::Held)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue