UiManager.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef UI_MANAGER_H
  2. #define UI_MANAGER_H
  3. #include <OgreRenderQueueListener.h>
  4. #include <OgreSingleton.h>
  5. #include <OgreUTFString.h>
  6. #include <tinyxml/tinyxml.h>
  7. #include "UiFont.h"
  8. #include "UiWidget.h"
  9. class UiManager : public Ogre::RenderQueueListener, public Ogre::Singleton< UiManager >
  10. {
  11. public:
  12. UiManager();
  13. virtual ~UiManager();
  14. void Initialise();
  15. void Update();
  16. void OnResize();
  17. void SetLanguage( const Ogre::String& language );
  18. void AddText( const Ogre::String& name, TiXmlNode* text );
  19. void UnloadTexts();
  20. TiXmlNode* GetText( const Ogre::String& name ) const;
  21. void AddFont( UiFont* font );
  22. UiFont* GetFont( const Ogre::String& name );
  23. void AddPrototype( const Ogre::String& name, TiXmlNode* prototype );
  24. TiXmlNode* GetPrototype( const Ogre::String& name ) const;
  25. void AddWidget( UiWidget* widget );
  26. UiWidget* GetWidget( const Ogre::String& name );
  27. UiWidget* ScriptGetWidget( const char* name );
  28. void renderQueueStarted( Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation );
  29. private:
  30. struct UiText
  31. {
  32. Ogre::String name;
  33. TiXmlNode* node;
  34. };
  35. std::vector< UiText > m_Texts;
  36. std::vector< UiFont* > m_Fonts;
  37. struct UiPrototype
  38. {
  39. Ogre::String name;
  40. TiXmlNode* node;
  41. };
  42. std::vector< UiPrototype > m_Prototypes;
  43. std::vector< UiWidget* > m_Widgets;
  44. };
  45. #endif // UI_MANAGER_H