2
0

uid_upgrade_tool.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**************************************************************************/
  2. /* uid_upgrade_tool.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef UID_UPGRADE_TOOL_H
  31. #define UID_UPGRADE_TOOL_H
  32. #include "scene/gui/dialogs.h"
  33. class EditorFileSystemDirectory;
  34. class UIDUpgradeTool : public Object {
  35. GDCLASS(UIDUpgradeTool, Object);
  36. inline static UIDUpgradeTool *singleton = nullptr;
  37. static constexpr const char *UPGRADE_FINISHED = "upgrade_finished";
  38. static constexpr const char *META_RESAVE_PATHS = "resave_paths";
  39. void _add_files(EditorFileSystemDirectory *p_dir, Vector<String> &r_resave_paths);
  40. protected:
  41. static void _bind_methods();
  42. public:
  43. static constexpr const char *META_UID_UPGRADE_TOOL = "uid_upgrade_tool";
  44. static constexpr const char *META_RUN_ON_RESTART = "run_on_restart";
  45. static UIDUpgradeTool *get_singleton() { return singleton; }
  46. void prepare_upgrade();
  47. void begin_upgrade();
  48. void finish_upgrade();
  49. UIDUpgradeTool();
  50. ~UIDUpgradeTool();
  51. };
  52. class UIDUpgradeDialog : public ConfirmationDialog {
  53. GDCLASS(UIDUpgradeDialog, ConfirmationDialog);
  54. static constexpr const char *UID_UPGRADE_LEARN_MORE = "uid_upgrade_learn_more";
  55. Button *learn_more_button = nullptr;
  56. protected:
  57. void _on_custom_action(const String &p_action);
  58. void _notification(int p_what);
  59. public:
  60. void popup_on_demand();
  61. UIDUpgradeDialog();
  62. };
  63. #endif // UID_UPGRADE_TOOL_H