BVB Source Codes

CRYENGINE Show FlashUIAction.h Source code

Return Download CRYENGINE: download FlashUIAction.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:   FlashUIAction.h
  5. //  Version:     v1.00
  6. //  Created:     10/9/2010 by Paul Reindell.
  7. //  Description:
  8. // -------------------------------------------------------------------------
  9. //  History:
  10. //
  11. ////////////////////////////////////////////////////////////////////////////
  12. #ifndef __FlashUIAction_H__
  13. #define __FlashUIAction_H__
  14.  
  15. #include <CrySystem/Scaleform/IFlashUI.h>
  16. #include <CryFlowGraph/IFlowSystem.h>
  17. #include <CryCore/Containers/CryListenerSet.h>
  18.  
  19. class CFlashUIAction : public IUIAction
  20. {
  21. public:
  22.         CFlashUIAction(EUIActionType type);
  23.         virtual ~CFlashUIAction();
  24.  
  25.         virtual EUIActionType    GetType() const            { return m_type; }
  26.  
  27.         virtual const char*      GetName() const            { return m_sName.c_str(); }
  28.         virtual void             SetName(const char* sName) { m_sName = sName; }
  29.  
  30.         virtual bool             Init();
  31.         virtual bool             IsValid() const { return m_bIsValid; }
  32.  
  33.         virtual void             SetEnabled(bool bEnabled);
  34.         virtual bool             IsEnabled() const    { return m_bEnabled && m_bIsValid; }
  35.  
  36.         virtual IFlowGraphPtr    GetFlowGraph() const { CRY_ASSERT_MESSAGE(m_type == eUIAT_FlowGraph, "Try to access Flowgraph of Lua UI Action"); return m_pFlowGraph; }
  37.         virtual SmartScriptTable GetScript() const    { CRY_ASSERT_MESSAGE(m_type == eUIAT_LuaScript, "Try to access ScriptTable of FG UI Action"); return m_pScript; }
  38.  
  39.         virtual bool             Serialize(XmlNodeRef& xmlNode, bool bIsLoading);
  40.         virtual bool             Serialize(const char* scriptFile, bool bIsLoading);
  41.  
  42.         virtual void             GetMemoryUsage(ICrySizer* s) const;
  43.  
  44.         bool                     ReloadScript();
  45.  
  46.         void                     SetValid(bool bValid) { m_bIsValid = bValid; }
  47.  
  48.         void                     Update();
  49.  
  50.         // for script actions
  51.         void StartScript(const SUIArguments& args);
  52.         void EndScript();
  53.  
  54. private:
  55.         string           m_sName;
  56.         string           m_sScriptFile;
  57.         IFlowGraphPtr    m_pFlowGraph;
  58.         SmartScriptTable m_pScript;
  59.         bool             m_bIsValid;
  60.         bool             m_bEnabled;
  61.         EUIActionType    m_type;
  62.         enum EScriptFunction
  63.         {
  64.                 eSF_OnInit,
  65.                 eSF_OnStart,
  66.                 eSF_OnUpdate,
  67.                 eSF_OnEnd,
  68.                 eSF_OnEnabled
  69.         };
  70.         std::map<EScriptFunction, bool> m_scriptAvail;
  71. };
  72.  
  73. //--------------------------------------------------------------------------------------------
  74. struct CUIActionManager : public IUIActionManager
  75. {
  76. public:
  77.         CUIActionManager() : m_listener(32), m_bAcceptRequests(true) {}
  78.         void         Init();
  79.  
  80.         virtual void StartAction(IUIAction* pAction, const SUIArguments& args);
  81.         virtual void EndAction(IUIAction* pAction, const SUIArguments& args);
  82.  
  83.         virtual void EnableAction(IUIAction* pAction, bool bEnable);
  84.  
  85.         virtual void AddListener(IUIActionListener* pListener, const char* name);
  86.         virtual void RemoveListener(IUIActionListener* pListener);
  87.  
  88.         virtual void GetMemoryUsage(ICrySizer* s) const;
  89.  
  90.         void         Update();
  91.  
  92. private:
  93.         void StartActionInt(IUIAction* pAction, const SUIArguments& args);
  94.         void EndActionInt(IUIAction* pAction, const SUIArguments& args);
  95.         void EnableActionInt(IUIAction* pAction, bool bEnable);
  96.  
  97. private:
  98.         typedef CListenerSet<IUIActionListener*>   TActionListener;
  99.         typedef std::map<IUIAction*, bool>         TActionMap;
  100.         typedef std::map<IUIAction*, SUIArguments> TActionArgMap;
  101.  
  102.         TActionListener m_listener;
  103.         TActionMap      m_actionStateMap;
  104.         TActionMap      m_actionEnableMap;
  105.         TActionArgMap   m_actionStartMap;
  106.         TActionArgMap   m_actionEndMap;
  107.         bool            m_bAcceptRequests;
  108. };
  109.  
  110. #endif // #ifndef __FlashUIAction_H__
  111.  
downloadFlashUIAction.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