@LicenseCheckClass.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class LicenseCheckClass : ClosableWindow
  4. {
  5. class DeviceIDWindow : ClosableWindow
  6. {
  7. Text text;
  8. Button copy, open, retry;
  9. int item_id;
  10. static void Copy (DeviceIDWindow &cw);
  11. static void Open (DeviceIDWindow &cw);
  12. static void Retry(DeviceIDWindow &cw);
  13. void create(int item_id);
  14. public:
  15. DeviceIDWindow();
  16. };
  17. bool notify, steam_checking, steam_sub_known, steam_sub_is, steam_ordering;
  18. int steam_item_id;
  19. TextBlack ts;
  20. Text text, t_get_sub, t_cur_sub;
  21. TextLine license_key;
  22. Button ok, buy, buy_steam_monthly, buy_steam_yearly;
  23. EsenthelStore es[ELMS(EsenthelStoreEngineLicense)];
  24. DeviceIDWindow window;
  25. Download steam_order_id;
  26. #if STEAM
  27. SteamWorks.Subscription steam_sub;
  28. #endif
  29. static void BuySteamMonthly(LicenseCheckClass &lc);
  30. static void BuySteamYearly (LicenseCheckClass &lc);
  31. static void Changed(LicenseCheckClass &lc);
  32. static void OK (LicenseCheckClass &lc);
  33. bool steamSubValid()C;
  34. bool checking();
  35. void getSteamOrderID(int item_id);
  36. void testLicense(C Str &license_key); // initialize test license download
  37. void check(C Str &license_key, bool notify);
  38. virtual Window& show()override;
  39. void clear(bool params=true);
  40. void setSteamSub(C Str &text, bool buy_visible);
  41. void create();
  42. virtual void update(C GuiPC &gpc)override;
  43. void draw();
  44. public:
  45. LicenseCheckClass();
  46. };
  47. /******************************************************************************/
  48. /******************************************************************************/
  49. extern LicenseCheckClass LicenseCheck;
  50. /******************************************************************************/