BVB Source Codes

CRYENGINE Show DialogLoader.h Source code

Return Download CRYENGINE: download DialogLoader.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:   DialogLoader.h
  5. //  Version:     v1.00
  6. //  Created:     07/07/2006 by AlexL
  7. //  Compilers:   Visual Studio.NET
  8. //  Description: Dialog Loader
  9. // -------------------------------------------------------------------------
  10. //  History:
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13.  
  14. #ifndef __DIALOGLOADER_H__
  15. #define __DIALOGLOADER_H__
  16.  
  17. #pragma once
  18.  
  19. #include "DialogScript.h"
  20.  
  21. class CDialogSystem;
  22.  
  23. class CDialogLoader
  24. {
  25. public:
  26.         CDialogLoader(CDialogSystem* pDS);
  27.         virtual ~CDialogLoader();
  28.  
  29.         // Loads all DialogScripts below a given path
  30.         bool LoadScriptsFromPath(const string& path, TDialogScriptMap& outScripts);
  31.  
  32.         // Loads a single DialogScript
  33.         bool LoadScript(const string& fileName, TDialogScriptMap& outScripts);
  34.  
  35. protected:
  36.  
  37.         // some intermediate data structure
  38.         struct IMScriptLine
  39.         {
  40.                 IMScriptLine() { Reset(); }
  41.                 void Reset()
  42.                 {
  43.                         audioID = INVALID_AUDIO_CONTROL_ID;
  44.                         actor = anim = facial = lookat = "";
  45.                         delay = facialFadeTime = 0.0f;
  46.                         facialWeight = 0.5f;
  47.                 }
  48.  
  49.                 bool IsValid() const { return (actor != 0 && *actor != 0); }
  50.  
  51.                 const char*    actor;
  52.                 //const char* sound;
  53.                 AudioControlId audioID;
  54.                 const char*    anim;
  55.                 const char*    lookat;
  56.                 float          delay;
  57.                 string         facial;
  58.                 float          facialWeight;
  59.                 float          facialFadeTime;
  60.         };
  61.  
  62.         struct IMScript
  63.         {
  64.                 IMScript() { Reset(); }
  65.                 void Reset()         { name = 0; lines.resize(0); }
  66.                 bool IsValid() const { return (name != 0 && *name != 0 && lines.size() > 0); }
  67.                 const char*               name;
  68.                 std::vector<IMScriptLine> lines;
  69.         };
  70.  
  71.         // returns the numer of successfully loaded scripts
  72.         int LoadFromTable(XmlNodeRef tableNode, const string& fileName, TDialogScriptMap& outScriptMap);
  73.  
  74.         // preprocessing stuff
  75.         bool ProcessScript(IMScript& theScript, const string& groupName, TDialogScriptMap& outScriptMap);
  76.  
  77.         // get actor from string [1-based]
  78.         bool GetActor(const char* actor, int& outID);
  79.         bool GetLookAtActor(const char* actor, int& outID, bool& outSticky);
  80.  
  81. protected:
  82.  
  83.         CDialogSystem* m_pDS;
  84. };
  85.  
  86. #endif
  87.  
downloadDialogLoader.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