BVB Source Codes

CRYENGINE Show DialogSystem.h Source code

Return Download CRYENGINE: download DialogSystem.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // -------------------------------------------------------------------------
  4. //  File name:   DialogSystem.h
  5. //  Version:     v1.00
  6. //  Created:     07/07/2006 by AlexL
  7. //  Compilers:   Visual Studio.NET
  8. //  Description: Dialog System
  9. // -------------------------------------------------------------------------
  10. //  History:
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13.  
  14. #ifndef __DIALOGSYSTEM_H__
  15. #define __DIALOGSYSTEM_H__
  16.  
  17. #pragma once
  18.  
  19. #include <CryNetwork/SerializeFwd.h>
  20.  
  21. #include "DialogScript.h"
  22. #include <CryAudio/Dialog/IDialogSystem.h>
  23. #include "ILevelSystem.h"
  24. #include "DialogQueuesManager.h"
  25.  
  26. class CDialogSession;
  27. class CDialogActorContext;
  28.  
  29. #ifndef _RELEASE
  30.         #define DEBUGINFO_DIALOGBUFFER
  31. #endif
  32.  
  33. class CDialogSystem : public IDialogSystem, ILevelSystemListener
  34. {
  35. public:
  36.         typedef int SessionID;
  37.         typedef int ActorContextID;
  38.  
  39.         CDialogSystem();
  40.         virtual ~CDialogSystem();
  41.  
  42.         void GetMemoryStatistics(ICrySizer* s);
  43.  
  44.         // Later go into IDialogSystem i/f
  45.         virtual void Update(const float dt);
  46.         virtual void Shutdown();
  47.         virtual void Serialize(TSerialize ser);   // serializes load/save. After load serialization PostLoad needs to be called
  48.  
  49.         // IDialogSystem
  50.         virtual bool                     Init();
  51.         virtual void                     Reset(bool bUnload);
  52.         virtual IDialogScriptIteratorPtr CreateScriptIterator();
  53.         virtual bool                     ReloadScripts(const char* levelName = NULL);
  54.         // ~IDialogSystem
  55.  
  56.         // ILevelSystemListener
  57.         virtual void OnLevelNotFound(const char* levelName)                    {};
  58.         virtual void OnLoadingStart(ILevelInfo* pLevel)                        {};
  59.         virtual void OnLoadingLevelEntitiesStart(ILevelInfo* pLevelInfo)       {}
  60.         virtual void OnLoadingComplete(ILevelInfo* pLevel);
  61.         virtual void OnLoadingError(ILevelInfo* pLevel, const char* error)     {};
  62.         virtual void OnLoadingProgress(ILevelInfo* pLevel, int progressAmount) {};
  63.         virtual void OnUnloadComplete(ILevelInfo* pLevel)                      {};
  64.         // ~ILevelSystemListener
  65.  
  66.         SessionID            CreateSession(const string& scriptID);
  67.         bool                 DeleteSession(SessionID id);
  68.         CDialogSession*      GetSession(SessionID id) const;
  69.         CDialogSession*      GetActiveSession(SessionID id) const;
  70.         CDialogActorContext* GetActiveSessionActorContext(ActorContextID id) const;
  71.         const CDialogScript* GetScriptByID(const string& scriptID) const;
  72.  
  73.         virtual bool         IsEntityInDialog(EntityId entityId) const;
  74.         bool                 FindSessionAndActorForEntity(EntityId entityId, SessionID& outSessionID, CDialogScript::TActorID& outActorId) const;
  75.  
  76.         // called from CDialogSession
  77.         bool AddSession(CDialogSession* pSession);
  78.         bool RemoveSession(CDialogSession* pSession);
  79.  
  80.         // Debug dumping
  81.         void                  Dump(int verbosity = 0);
  82.         void                  DumpSessions();
  83.  
  84.         CDialogQueuesManager* GetDialogQueueManager() { return &m_dialogQueueManager; }
  85.  
  86.         static int    sDiaLOGLevel;       // CVar ds_LogLevel
  87.         static int    sPrecacheSounds;    // CVar ds_PrecacheSounds
  88.         static int    sAutoReloadScripts; // CVar to reload scripts when jumping into GameMode
  89.         static int    sLoadSoundSynchronously;
  90.         static int    sLoadExcelScripts; // CVar to load legacy Excel based Dialogs
  91.         static int    sWarnOnMissingLoc; // CVar ds_WarnOnMissingLoc
  92.         static ICVar* ds_LevelNameOverride;
  93.  
  94. protected:
  95.         void            ReleaseScripts();
  96.         void            ReleaseSessions();
  97.         void            ReleasePendingDeletes();
  98.         void            RestoreSessions();
  99.         CDialogSession* InternalCreateSession(const string& scriptID, SessionID sessionID);
  100.  
  101. protected:
  102.         class CDialogScriptIterator;
  103.         typedef std::map<SessionID, CDialogSession*> TDialogSessionMap;
  104.         typedef std::vector<CDialogSession*>         TDialogSessionVec;
  105.  
  106.         int                    m_nextSessionID;
  107.         TDialogScriptMap       m_dialogScriptMap;
  108.         TDialogSessionMap      m_allSessions;
  109.         TDialogSessionVec      m_activeSessions;
  110.         TDialogSessionVec      m_pendingDeleteSessions;
  111.         std::vector<SessionID> m_restoreSessions;
  112.         CDialogQueuesManager   m_dialogQueueManager;
  113. };
  114.  
  115. #endif
  116.  
downloadDialogSystem.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top