summaryrefslogtreecommitdiff
path: root/editor/editor_settings.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_settings.h')
-rw-r--r--editor/editor_settings.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index 13aebb7ea6..e5f8527faf 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -31,12 +31,11 @@
#ifndef EDITOR_SETTINGS_H
#define EDITOR_SETTINGS_H
-#include "core/object.h"
-
#include "core/io/config_file.h"
+#include "core/io/resource.h"
+#include "core/object/class_db.h"
#include "core/os/thread_safe.h"
-#include "core/resource.h"
-#include "core/translation.h"
+#include "core/string/translation.h"
#include "scene/gui/shortcut.h"
class EditorPlugin;
@@ -44,18 +43,18 @@ class EditorPlugin;
class EditorSettings : public Resource {
GDCLASS(EditorSettings, Resource);
-private:
_THREAD_SAFE_CLASS_
public:
+ inline static const String PROJECT_EDITOR_SETTINGS_PATH = "res://.godot/editor";
struct Plugin {
- EditorPlugin *instance;
+ EditorPlugin *instance = nullptr;
String path;
String name;
String author;
String version;
String description;
- bool installs;
+ bool installs = false;
String script;
Vector<String> install_files;
};
@@ -85,7 +84,8 @@ private:
int last_order;
Ref<Resource> clipboard;
- Map<String, Ref<ShortCut>> shortcuts;
+ mutable Map<String, Ref<Shortcut>> shortcuts;
+ Map<String, List<Ref<InputEvent>>> builtin_action_overrides;
String resource_path;
String settings_dir;
@@ -182,11 +182,14 @@ public:
Vector<String> get_script_templates(const String &p_extension, const String &p_custom_path = String());
String get_editor_layouts_config() const;
- void add_shortcut(const String &p_name, Ref<ShortCut> &p_shortcut);
+ void add_shortcut(const String &p_name, Ref<Shortcut> &p_shortcut);
bool is_shortcut(const String &p_name, const Ref<InputEvent> &p_event) const;
- Ref<ShortCut> get_shortcut(const String &p_name) const;
+ Ref<Shortcut> get_shortcut(const String &p_name) const;
void get_shortcut_list(List<String> *r_shortcuts);
+ void set_builtin_action_override(const String &p_name, const Array &p_events);
+ const Array get_builtin_action_overrides(const String &p_name) const;
+
void notify_changes();
EditorSettings();
@@ -203,7 +206,7 @@ Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_re
Variant _EDITOR_GET(const String &p_setting);
#define ED_IS_SHORTCUT(p_name, p_ev) (EditorSettings::get_singleton()->is_shortcut(p_name, p_ev))
-Ref<ShortCut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p_keycode = 0);
-Ref<ShortCut> ED_GET_SHORTCUT(const String &p_path);
+Ref<Shortcut> ED_SHORTCUT(const String &p_path, const String &p_name, uint32_t p_keycode = 0);
+Ref<Shortcut> ED_GET_SHORTCUT(const String &p_path);
#endif // EDITOR_SETTINGS_H