DialogState.hpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef FREESHOP_DIALOGSTATE_HPP
  2. #define FREESHOP_DIALOGSTATE_HPP
  3. #include <cpp3ds/Window/Window.hpp>
  4. #include <TweenEngine/TweenManager.h>
  5. #include "State.hpp"
  6. #include "../TweenObjects.hpp"
  7. namespace FreeShop {
  8. class DialogState: public State {
  9. public:
  10. enum EventType {
  11. GetText,
  12. Response,
  13. };
  14. struct Event {
  15. EventType type;
  16. void *data;
  17. };
  18. DialogState(StateStack& stack, Context& context, StateCallback callback);
  19. virtual void renderTopScreen(cpp3ds::Window& window);
  20. virtual void renderBottomScreen(cpp3ds::Window& window);
  21. virtual bool update(float delta);
  22. virtual bool processEvent(const cpp3ds::Event& event);
  23. private:
  24. bool m_isClosing;
  25. util3ds::TweenRectangleShape m_overlay;
  26. util3ds::TweenNinePatch m_background;
  27. util3ds::TweenText m_message;
  28. TweenEngine::TweenManager m_tweenManager;
  29. util3ds::TweenRectangleShape m_buttonOkBackground;
  30. util3ds::TweenRectangleShape m_buttonCancelBackground;
  31. util3ds::TweenText m_buttonOkText;
  32. util3ds::TweenText m_buttonCancelText;
  33. };
  34. } // namespace FreeShop
  35. #endif // FREESHOP_DIALOGSTATE_HPP