mirror of
https://github.com/tribes2/engine.git
synced 2026-03-27 16:19:19 +00:00
t2 engine svn checkout
This commit is contained in:
commit
ff569bd2ae
988 changed files with 394180 additions and 0 deletions
72
sim/cannedChatDataBlock.cc
Normal file
72
sim/cannedChatDataBlock.cc
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// V12 Engine
|
||||
//
|
||||
// Copyright (c) 2001 GarageGames.Com
|
||||
// Portions Copyright (c) 2001 by Sierra Online, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "Sim/cannedChatDataBlock.h"
|
||||
#include "console/consoleTypes.h"
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
static const char* getDataTypeCannedChatItemPtr( void* dptr, EnumTable*, BitSet32 )
|
||||
{
|
||||
CannedChatItem** obj = reinterpret_cast<CannedChatItem**>( dptr );
|
||||
return ( *obj ? (*obj)->getName() : "" );
|
||||
}
|
||||
|
||||
|
||||
static void setDataTypeCannedChatItemPtr( void* dptr, S32 argc, const char** argv, EnumTable*, BitSet32 )
|
||||
{
|
||||
if ( argc == 1 )
|
||||
{
|
||||
if ( !Sim::findObject( argv[0], *reinterpret_cast<CannedChatItem**>( dptr ) ) )
|
||||
Con::printf( "Object \"%s\" is not a CannedChatItem data block", argv[0] );
|
||||
}
|
||||
else
|
||||
Con::printf( "(TypeCannedChatItemPtr) Can't set multiple args to a single pointer." );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
IMPLEMENT_CO_DATABLOCK_V1( CannedChatItem );
|
||||
CannedChatItem::CannedChatItem()
|
||||
{
|
||||
mName = NULL;
|
||||
mText = NULL;
|
||||
mAudioFile = NULL;
|
||||
mAnimation = NULL;
|
||||
mTeamOnly = false;
|
||||
mPlay3D = false;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void CannedChatItem::consoleInit()
|
||||
{
|
||||
addField( "name", TypeString, Offset( mName, CannedChatItem ) );
|
||||
addField( "text", TypeString, Offset( mText, CannedChatItem ) );
|
||||
addField( "audioFile", TypeString, Offset( mAudioFile, CannedChatItem ) );
|
||||
addField( "animation", TypeString, Offset( mAnimation, CannedChatItem ) );
|
||||
// more?
|
||||
addField( "teamOnly", TypeBool, Offset( mTeamOnly, CannedChatItem ) );
|
||||
addField( "play3D", TypeBool, Offset( mPlay3D, CannedChatItem ) );
|
||||
Con::registerType( TypeCannedChatItemPtr, sizeof( CannedChatItem* ), getDataTypeCannedChatItemPtr, setDataTypeCannedChatItemPtr );
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void CannedChatItem::initPersistFields()
|
||||
{
|
||||
Parent::initPersistFields();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
bool CannedChatItem::onAdd()
|
||||
{
|
||||
if ( !Parent::onAdd() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue