UIPlatformsInfo.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #include "AtomicEditor.h"
  5. #include <TurboBadger/tb_window.h>
  6. #include <TurboBadger/tb_select.h>
  7. #include <TurboBadger/tb_editfield.h>
  8. #include <Atomic/Core/Context.h>
  9. #include <Atomic/UI/UI.h>
  10. #include "Resources/AEResourceOps.h"
  11. #include "AEPreferences.h"
  12. #include "AEEditor.h"
  13. #include "AEEvents.h"
  14. #include "Project/AEProject.h"
  15. #include "Project/ProjectUtils.h"
  16. #include "License/AELicenseSystem.h"
  17. #include "UIPlatformsInfo.h"
  18. namespace AtomicEditor
  19. {
  20. // UIBuildSettings------------------------------------------------
  21. PlatformsInfo::PlatformsInfo(Context* context):
  22. UIModalOpWindow(context)
  23. {
  24. Editor* editor = GetSubsystem<Editor>();
  25. UI* tbui = GetSubsystem<UI>();
  26. window_->SetSettings(WINDOW_SETTINGS_DEFAULT & ~WINDOW_SETTINGS_CLOSE_BUTTON);
  27. window_->SetText("Atomic Game Engine Pro Required");
  28. tbui->LoadResourceFile(window_->GetContentRoot(), "AtomicEditor/editor/ui/platformsinfo.tb.txt");
  29. window_->ResizeToFitContent();
  30. Center();
  31. }
  32. PlatformsInfo::~PlatformsInfo()
  33. {
  34. }
  35. bool PlatformsInfo::OnEvent(const TBWidgetEvent &ev)
  36. {
  37. if (ev.type == EVENT_TYPE_CLICK)
  38. {
  39. UIModalOps* ops = GetSubsystem<UIModalOps>();
  40. if (ev.target->GetID() == TBIDC("ok"))
  41. {
  42. ops->Hide();
  43. return true;
  44. }
  45. if (ev.target->GetID() == TBIDC("purchase"))
  46. {
  47. //Editor* editor = GetSubsystem<Editor>();
  48. FileSystem* fs = GetSubsystem<FileSystem>();
  49. fs->SystemOpen("https://store.atomicgameengine.com/site");
  50. ops->Hide();
  51. return true;
  52. }
  53. }
  54. return false;
  55. }
  56. }