diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /hammer/ToolBase.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'hammer/ToolBase.cpp')
| -rw-r--r-- | hammer/ToolBase.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/hammer/ToolBase.cpp b/hammer/ToolBase.cpp new file mode 100644 index 0000000..fa04b9c --- /dev/null +++ b/hammer/ToolBase.cpp @@ -0,0 +1,45 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#include "stdafx.h" +#include "ToolInterface.h" +#include "mapdoc.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include <tier0/memdbgon.h> + +void CBaseTool::Init( CMapDoc *pDocument ) +{ + m_bActiveTool = false; + m_pDocument = pDocument; +} + +//----------------------------------------------------------------------------- +// Purpose: Called whtn this tool is becoming the active tool. +// Input : eOldTool - The tool that was previously active. +//----------------------------------------------------------------------------- +void CBaseTool::Activate() +{ + OnActivate(); + + m_pDocument->UpdateAllViews( MAPVIEW_UPDATE_TOOL ); + + m_bActiveTool = true; +} + +//----------------------------------------------------------------------------- +// Purpose: Called when this tool is no longer the active tool. +// Input : eNewTool - The tool that is being activated. +//----------------------------------------------------------------------------- +void CBaseTool::Deactivate() +{ + OnDeactivate(); + + if ( m_pDocument ) + m_pDocument->UpdateAllViews( MAPVIEW_UPDATE_TOOL ); + + m_bActiveTool = false; +}
\ No newline at end of file |