| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#include "core/variant/typed_dictionary.h" |
| 34 |
#include "editor/inspector/editor_inspector.h" |
| 35 |
|
| 36 |
class SceneDebuggerObject; |
| 37 |
|
| 38 |
class EditorDebuggerRemoteObjects : public Object { |
| 39 |
GDCLASS(EditorDebuggerRemoteObjects, Object); |
| 40 |
|
| 41 |
private: |
| 42 |
bool _set_impl(const StringName &p_name, const Variant &p_value, const String &p_field); |
| 43 |
|
| 44 |
protected: |
| 45 |
bool _set(const StringName &p_name, const Variant &p_value); |
| 46 |
bool _get(const StringName &p_name, Variant &r_ret) const; |
| 47 |
void _get_property_list(List<PropertyInfo> *p_list) const; |
| 48 |
static void _bind_methods(); |
| 49 |
|
| 50 |
public: |
| 51 |
TypedArray<uint64_t> remote_object_ids; |
| 52 |
String type_name; |
| 53 |
List<PropertyInfo> prop_list; |
| 54 |
HashMap<StringName, TypedDictionary<uint64_t, Variant>> prop_values; |
| 55 |
|
| 56 |
bool _hide_script_from_inspector() { return true; } |
| 57 |
bool _hide_metadata_from_inspector() { return true; } |
| 58 |
|
| 59 |
void set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field); |
| 60 |
String get_title(); |
| 61 |
Variant get_variant(const StringName &p_name); |
| 62 |
|
| 63 |
void clear() { |
| 64 |
prop_list.clear(); |
| 65 |
prop_values.clear(); |
| 66 |
} |
| 67 |
|
| 68 |
void update() { notify_property_list_changed(); } |
| 69 |
}; |
| 70 |
|
| 71 |
class EditorDebuggerInspector : public EditorInspector { |
| 72 |
GDCLASS(EditorDebuggerInspector, EditorInspector); |
| 73 |
|
| 74 |
private: |
| 75 |
LocalVector<EditorDebuggerRemoteObjects *> remote_objects_list; |
| 76 |
HashSet<Ref<Resource>> remote_dependencies; |
| 77 |
EditorDebuggerRemoteObjects *variables = nullptr; |
| 78 |
|
| 79 |
void _object_selected(ObjectID p_object); |
| 80 |
void _objects_edited(const String &p_prop, const TypedDictionary<uint64_t, Variant> &p_values, const String &p_field); |
| 81 |
|
| 82 |
protected: |
| 83 |
void _notification(int p_what); |
| 84 |
static void _bind_methods(); |
| 85 |
|
| 86 |
public: |
| 87 |
EditorDebuggerInspector(); |
| 88 |
~EditorDebuggerInspector(); |
| 89 |
|
| 90 |
|
| 91 |
EditorDebuggerRemoteObjects *set_objects(const Array &p_array); |
| 92 |
void clear_remote_inspector(); |
| 93 |
void clear_cache(); |
| 94 |
void invalidate_selection_from_cache(const TypedArray<uint64_t> &p_ids); |
| 95 |
|
| 96 |
|
| 97 |
String get_stack_variable(const String &p_var); |
| 98 |
void add_stack_variable(const Array &p_arr, int p_offset = -1); |
| 99 |
void clear_stack_variables(); |
| 100 |
}; |