Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "stdafx.h"
  7. #include "ToolInterface.h"
  8. #include "mapdoc.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include <tier0/memdbgon.h>
  11. void CBaseTool::Init( CMapDoc *pDocument )
  12. {
  13. m_bActiveTool = false;
  14. m_pDocument = pDocument;
  15. }
  16. //-----------------------------------------------------------------------------
  17. // Purpose: Called whtn this tool is becoming the active tool.
  18. // Input : eOldTool - The tool that was previously active.
  19. //-----------------------------------------------------------------------------
  20. void CBaseTool::Activate()
  21. {
  22. OnActivate();
  23. m_pDocument->UpdateAllViews( MAPVIEW_UPDATE_TOOL );
  24. m_bActiveTool = true;
  25. }
  26. //-----------------------------------------------------------------------------
  27. // Purpose: Called when this tool is no longer the active tool.
  28. // Input : eNewTool - The tool that is being activated.
  29. //-----------------------------------------------------------------------------
  30. void CBaseTool::Deactivate()
  31. {
  32. OnDeactivate();
  33. if ( m_pDocument )
  34. m_pDocument->UpdateAllViews( MAPVIEW_UPDATE_TOOL );
  35. m_bActiveTool = false;
  36. }