mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-14 13:40:07 +03:00
baseentity_shared.cpp baseentity.cpp c_baseentity.h c_baseentity.cpp c_world.h - Fixed critical ScriptSetContextThink bugs - Added C_BaseEntity::SetContextThink (ScriptSetContextThink) - Added C_BaseEntity::SetSize - Added C_BaseEntity::SetModel - Added C_BaseEntity::Destroy baseentity.h baseentity.cpp - Removed duplicate functions ScriptSetSize and ScriptUtilRemove player.cpp - Moved player script instance registration before player_spawn event vscript_server.cpp - Added CEntities::FindByClassNearestFacing vscript_funcs_shared.cpp - Added GetFrameCount - Added IntervalPerTick vscript_singletons.cpp - Better game event descriptors for CScriptGameEventListener - Added ::effects (CEffectsScriptHelper) - Added ::Convars (CScriptConvarAccessor) vscript_shared.cpp - Fixed clientside entity printing in script VM mapbase_con_groups.h mapbase_con_groups.cpp - Improved performance by changing string comparisons to direct array access vscript_bindings_base.h vscript_bindings_base.cpp - Added CScriptKeyValues::SubKeysToTable vscript_bindings_math.cpp - Added ::SimpleSplineRemapVal - Added ::SimpleSplineRemapValClamped - Added ::Bias - Added ::Gain - Added ::SmoothCurve - Added ::SmoothCurve_Tweak - Added ::ExponentialDecay vscript_squirrel.nut - Added ::Lerp - Added ::FLerp - Added ::SimpleSpline vscript_squirrel.cpp - Added Vector::_unm - Added Vector::Set - Added Vector::Add - Added Vector::Subtract - Added Vector::Multiply - Added Vector::Divide - Added Vector::DistTo - Added Vector::DistToSqr - Added Vector::IsEqualTo - Added Vector::WithinAABox - Added Vector::FromKVString - Changed vector print syntax
77 lines
2.4 KiB
C++
77 lines
2.4 KiB
C++
//========= Mapbase - https://github.com/mapbase-source/source-sdk-2013 =================
|
|
//
|
|
// Purpose:
|
|
//
|
|
// $NoKeywords: $
|
|
//=============================================================================
|
|
|
|
#ifndef VSCRIPT_BINDINGS_BASE
|
|
#define VSCRIPT_BINDINGS_BASE
|
|
#ifdef _WIN32
|
|
#pragma once
|
|
#endif
|
|
|
|
#include "vscript/ivscript.h"
|
|
#include "tier1/KeyValues.h"
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// KeyValues access
|
|
// ----------------------------------------------------------------------------
|
|
class CScriptKeyValues
|
|
{
|
|
public:
|
|
CScriptKeyValues( KeyValues *pKeyValues );
|
|
~CScriptKeyValues( );
|
|
|
|
HSCRIPT ScriptFindKey( const char *pszName );
|
|
HSCRIPT ScriptGetFirstSubKey( void );
|
|
HSCRIPT ScriptGetNextKey( void );
|
|
int ScriptGetKeyValueInt( const char *pszName );
|
|
float ScriptGetKeyValueFloat( const char *pszName );
|
|
const char *ScriptGetKeyValueString( const char *pszName );
|
|
bool ScriptIsKeyValueEmpty( const char *pszName );
|
|
bool ScriptGetKeyValueBool( const char *pszName );
|
|
void ScriptReleaseKeyValues( );
|
|
|
|
// Functions below are new with Mapbase
|
|
void TableToSubKeys( HSCRIPT hTable );
|
|
void SubKeysToTable( HSCRIPT hTable );
|
|
|
|
HSCRIPT ScriptFindOrCreateKey( const char *pszName );
|
|
|
|
const char *ScriptGetName();
|
|
int ScriptGetInt();
|
|
float ScriptGetFloat();
|
|
const char *ScriptGetString();
|
|
bool ScriptGetBool();
|
|
|
|
void ScriptSetKeyValueInt( const char *pszName, int iValue );
|
|
void ScriptSetKeyValueFloat( const char *pszName, float flValue );
|
|
void ScriptSetKeyValueString( const char *pszName, const char *pszValue );
|
|
void ScriptSetKeyValueBool( const char *pszName, bool bValue );
|
|
void ScriptSetName( const char *pszValue );
|
|
void ScriptSetInt( int iValue );
|
|
void ScriptSetFloat( float flValue );
|
|
void ScriptSetString( const char *pszValue );
|
|
void ScriptSetBool( bool bValue );
|
|
|
|
KeyValues *GetKeyValues() { return m_pKeyValues; }
|
|
|
|
KeyValues *m_pKeyValues; // actual KeyValue entity
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Exposes Color to VScript
|
|
//-----------------------------------------------------------------------------
|
|
class CScriptColorInstanceHelper : public IScriptInstanceHelper
|
|
{
|
|
bool ToString( void *p, char *pBuf, int bufSize );
|
|
|
|
bool Get( void *p, const char *pszKey, ScriptVariant_t &variant );
|
|
bool Set( void *p, const char *pszKey, ScriptVariant_t &variant );
|
|
};
|
|
|
|
void RegisterBaseBindings( IScriptVM *pVM );
|
|
|
|
#endif
|