Counter Strike : Global Offensive Source Code
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.

57 lines
1.3 KiB

  1. //===== Copyright � Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: Defines gameui scripting system.
  4. //
  5. //===========================================================================//
  6. #ifndef GAMEUISCRIPT_H
  7. #define GAMEUISCRIPT_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "gameuiscriptsystem.h"
  12. class CGameUIScriptInterface;
  13. class CGameUIDefinition;
  14. class KeyValues;
  15. class CGameUIScript
  16. {
  17. public:
  18. CGameUIScript( );
  19. ~CGameUIScript( );
  20. void Shutdown();
  21. IScriptVM *GetVM( ) { return m_pScriptVM; }
  22. CUtlString &GetName( ) { return m_Name; }
  23. int GetVersion( ) { return m_Version; }
  24. CUtlString &GetScriptFile( ) { return m_ScriptFile; }
  25. bool IsActive( ) { return m_IsActive; }
  26. bool SetScript( const char *pszFileName, CGameUIDefinition *pDef );
  27. void SetActive( bool IsActive ) { m_IsActive = IsActive; }
  28. bool Execute( KeyValues *pData, KeyValues **ppResult );
  29. CGameUIScriptInterface * GetScriptInterface() const { return m_pGameUIScriptInterface; }
  30. private:
  31. bool GetScriptName( );
  32. bool GetScriptType( );
  33. bool GetScriptVersion( );
  34. CGameUIScriptInterface *m_pGameUIScriptInterface;
  35. CUtlString m_Name;
  36. int m_Version;
  37. bool m_IsActive;
  38. CUtlString m_ScriptFile;
  39. IScriptVM *m_pScriptVM;
  40. HSCRIPT m_Scope;
  41. };
  42. #endif // GAMEUISCRIPT_H