Theme.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef FREESHOP_THEME_HPP
  2. #define FREESHOP_THEME_HPP
  3. #include <string>
  4. #include <rapidjson/document.h>
  5. #include <cpp3ds/Graphics/Color.hpp>
  6. namespace FreeShop {
  7. class Theme {
  8. public:
  9. //Images vars
  10. static bool isFlagsThemed;
  11. static bool isItemBG9Themed;
  12. static bool isButtonRadius9Themed;
  13. static bool isFSBGSD9Themed;
  14. static bool isFSBGNAND9Themed;
  15. static bool isInstalledItemBG9Themed;
  16. static bool isItemBGSelected9Themed;
  17. static bool isListItemBG9Themed;
  18. static bool isMissingIconThemed;
  19. static bool isNotification9Themed;
  20. static bool isQrSelector9Themed;
  21. static bool isScrollbar9Themed;
  22. //Sounds vars
  23. static bool isSoundBlipThemed;
  24. static bool isSoundChimeThemed;
  25. static bool isSoundStartupThemed;
  26. //Text theming
  27. static Theme& getInstance();
  28. void loadDefaults();
  29. static bool loadFromFile(const std::string& filename = FREESHOP_DIR "/theme/texts.json");
  30. static void saveToFile(const std::string& filename = FREESHOP_DIR "/theme/texts.json");
  31. static const rapidjson::Value &get(std::string key);
  32. static void loadNameDesc();
  33. static bool isTextThemed;
  34. static cpp3ds::Color primaryTextColor;
  35. static cpp3ds::Color secondaryTextColor;
  36. static cpp3ds::Color iconSetColor;
  37. static cpp3ds::Color iconSetColorActive;
  38. static cpp3ds::Color transitionScreenColor;
  39. static cpp3ds::Color loadingIcon;
  40. static cpp3ds::Color loadingText;
  41. static cpp3ds::Color freText;
  42. static cpp3ds::Color versionText;
  43. static cpp3ds::Color percentageText;
  44. static cpp3ds::Color boxColor;
  45. static cpp3ds::Color boxOutlineColor;
  46. static cpp3ds::Color dialogBackground;
  47. static cpp3ds::Color dialogButton;
  48. static cpp3ds::Color dialogButtonText;
  49. static cpp3ds::Color themeDescColor;
  50. //DarkTheme
  51. static cpp3ds::Color darkPrimaryTextColor;
  52. static cpp3ds::Color darkSecondaryTextColor;
  53. static cpp3ds::Color darkIconSetColor;
  54. static cpp3ds::Color darkIconSetColorActive;
  55. static cpp3ds::Color darkTransitionScreenColor;
  56. static cpp3ds::Color darkLoadingIcon;
  57. static cpp3ds::Color darkLoadingText;
  58. static cpp3ds::Color darkFreText;
  59. static cpp3ds::Color darkVersionText;
  60. static cpp3ds::Color darkPercentageText;
  61. static cpp3ds::Color darkBoxColor;
  62. static cpp3ds::Color darkBoxOutlineColor;
  63. static cpp3ds::Color darkDialogBackground;
  64. static cpp3ds::Color darkDialogButton;
  65. static cpp3ds::Color darkDialogButtonText;
  66. static cpp3ds::Color darkThemeDescColor;
  67. //Theme informations
  68. static std::string themeName;
  69. static std::string themeDesc;
  70. static std::string themeVersion;
  71. //DarkTheme informations
  72. static std::string darkThemeName;
  73. static std::string darkThemeDesc;
  74. static std::string darkThemeVersion;
  75. private:
  76. rapidjson::Document m_json;
  77. };
  78. } // namespace FreeShop
  79. #endif // FREESHOP_THEME_HPP