InstalledList.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef FREESHOP_INSTALLEDLIST_HPP
  2. #define FREESHOP_INSTALLEDLIST_HPP
  3. #include <TweenEngine/TweenManager.h>
  4. #include <cpp3ds/Window/Event.hpp>
  5. #include <cpp3ds/System/Mutex.hpp>
  6. #include "InstalledItem.hpp"
  7. #include "InstalledOptions.hpp"
  8. #include "GUI/Scrollable.hpp"
  9. #include "States/BrowseState.hpp"
  10. namespace FreeShop {
  11. class InstalledList : public cpp3ds::Drawable, public Scrollable, public util3ds::TweenTransformable<cpp3ds::Transformable> {
  12. public:
  13. static InstalledList &getInstance();
  14. void refresh();
  15. void update(float delta);
  16. bool processEvent(const cpp3ds::Event& event);
  17. virtual void setScroll(float position);
  18. virtual float getScroll();
  19. virtual const cpp3ds::Vector2f &getScrollSize();
  20. static bool isInstalled(cpp3ds::Uint64 titleId);
  21. protected:
  22. InstalledList();
  23. virtual void draw(cpp3ds::RenderTarget& target, cpp3ds::RenderStates states) const;
  24. void repositionItems();
  25. void expandItem(InstalledItem *item);
  26. private:
  27. cpp3ds::Mutex m_mutexRefresh;
  28. std::vector<cpp3ds::Uint64> m_installedTitleIds;
  29. std::vector<std::unique_ptr<InstalledItem>> m_installedItems;
  30. TweenEngine::TweenManager m_tweenManager;
  31. float m_scrollPos;
  32. cpp3ds::Vector2f m_size;
  33. InstalledItem *m_expandedItem;
  34. InstalledOptions m_options;
  35. };
  36. } // namespace FreeShop
  37. #endif // FREESHOP_INSTALLEDLIST_HPP