project_settings.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*************************************************************************/
  2. /* project_settings.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* http://www.godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  9. /* */
  10. /* Permission is hereby granted, free of charge, to any person obtaining */
  11. /* a copy of this software and associated documentation files (the */
  12. /* "Software"), to deal in the Software without restriction, including */
  13. /* without limitation the rights to use, copy, modify, merge, publish, */
  14. /* distribute, sublicense, and/or sell copies of the Software, and to */
  15. /* permit persons to whom the Software is furnished to do so, subject to */
  16. /* the following conditions: */
  17. /* */
  18. /* The above copyright notice and this permission notice shall be */
  19. /* included in all copies or substantial portions of the Software. */
  20. /* */
  21. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  22. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  23. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  24. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  25. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  26. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  27. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  28. /*************************************************************************/
  29. #ifndef PROJECT_SETTINGS_H
  30. #define PROJECT_SETTINGS_H
  31. #include "scene/gui/dialogs.h"
  32. #include "property_editor.h"
  33. #include "optimized_save_dialog.h"
  34. #include "undo_redo.h"
  35. #include "editor_data.h"
  36. //#include "project_export_settings.h"
  37. class ProjectSettings : public AcceptDialog {
  38. OBJ_TYPE( ProjectSettings, AcceptDialog );
  39. Timer *timer;
  40. InputEvent::Type add_type;
  41. String add_at;
  42. EditorData *data;
  43. UndoRedo *undo_redo;
  44. PropertyEditor *globals_editor;
  45. ConfirmationDialog *message;
  46. LineEdit *category;
  47. LineEdit *property;
  48. OptionButton *type;
  49. PopupMenu *popup_add;
  50. ConfirmationDialog *press_a_key;
  51. Label*press_a_key_label;
  52. ConfirmationDialog *device_input;
  53. SpinBox *device_id;
  54. OptionButton *device_index;
  55. Label *device_index_label;
  56. MenuButton *popup_platform;
  57. LineEdit *action_name;
  58. Tree *input_editor;
  59. bool setting;
  60. bool updating_translations;
  61. InputEvent last_wait_for_key;
  62. FileDialog *translation_file_open;
  63. Tree *translation_list;
  64. Button *translation_res_option_add_button;
  65. FileDialog *translation_res_file_open;
  66. FileDialog *translation_res_option_file_open;
  67. Tree *translation_remap;
  68. Tree *translation_remap_options;
  69. Tree *autoload_list;
  70. FileDialog *autoload_file_open;
  71. LineEdit *autoload_add_name;
  72. LineEdit *autoload_add_path;
  73. void _update_autoload();
  74. void _autoload_file_callback(const String& p_path);
  75. void _autoload_add();
  76. void _autoload_file_open();
  77. void _autoload_delete(Object *p_item,int p_column, int p_button);
  78. void _item_selected();
  79. void _item_adds(String);
  80. void _item_add();
  81. void _item_del();
  82. void _update_actions();
  83. void _save();
  84. void _add_item(int p_item);
  85. void _action_adds(String);
  86. void _action_add();
  87. void _device_input_add();
  88. void _item_checked(const String& p_item, bool p_check);
  89. void _action_persist_toggle();
  90. void _action_button_pressed(Object* p_obj, int p_column,int p_id);
  91. void _wait_for_key(const InputEvent& p_event);
  92. void _press_a_key_confirm();
  93. void _settings_prop_edited(const String& p_name);
  94. void _settings_changed();
  95. //ProjectExportSettings *export_settings;
  96. void _copy_to_platform(int p_which);
  97. void _translation_file_open();
  98. void _translation_add(const String& p_path);
  99. void _translation_delete(Object *p_item,int p_column, int p_button);
  100. void _update_translations();
  101. void _translation_res_file_open();
  102. void _translation_res_add(const String& p_path);
  103. void _translation_res_delete(Object *p_item,int p_column, int p_button);
  104. void _translation_res_select();
  105. void _translation_res_option_file_open();
  106. void _translation_res_option_add(const String& p_path);
  107. void _translation_res_option_changed();
  108. void _translation_res_option_delete(Object *p_item,int p_column, int p_button);
  109. ProjectSettings();
  110. static ProjectSettings *singleton;
  111. protected:
  112. void _notification(int p_what);
  113. static void _bind_methods();
  114. public:
  115. void add_translation(const String& p_translation);
  116. static ProjectSettings *get_singleton() { return singleton; }
  117. void popup_project_settings();
  118. ProjectSettings(EditorData *p_data);
  119. };
  120. #endif // PROJECT_SETTINGS_H