Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/editor/inspector/editor_properties.h
9896 views
1
/**************************************************************************/
2
/* editor_properties.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
31
#pragma once
32
33
#include "editor/inspector/editor_inspector.h"
34
35
class CheckBox;
36
class ColorPickerButton;
37
class CreateDialog;
38
class EditorFileDialog;
39
class EditorLocaleDialog;
40
class EditorResourcePicker;
41
class EditorSpinSlider;
42
class EditorVariantTypePopupMenu;
43
class MenuButton;
44
class PropertySelector;
45
class SceneTreeDialog;
46
class TextEdit;
47
class TextureButton;
48
49
class EditorPropertyNil : public EditorProperty {
50
GDCLASS(EditorPropertyNil, EditorProperty);
51
LineEdit *text = nullptr;
52
53
public:
54
virtual void update_property() override;
55
EditorPropertyNil();
56
};
57
58
class EditorPropertyVariant : public EditorProperty {
59
GDCLASS(EditorPropertyVariant, EditorProperty);
60
61
HBoxContainer *content = nullptr;
62
EditorProperty *sub_property = nullptr;
63
Button *edit_button = nullptr;
64
EditorVariantTypePopupMenu *change_type = nullptr;
65
66
Variant::Type current_type = Variant::VARIANT_MAX;
67
Variant::Type new_type = Variant::VARIANT_MAX;
68
69
void _change_type(int p_to_type);
70
void _popup_edit_menu();
71
72
protected:
73
virtual void _set_read_only(bool p_read_only) override;
74
void _notification(int p_what);
75
76
public:
77
virtual void update_property() override;
78
EditorPropertyVariant();
79
};
80
81
class EditorPropertyText : public EditorProperty {
82
GDCLASS(EditorPropertyText, EditorProperty);
83
LineEdit *text = nullptr;
84
85
bool updating = false;
86
bool string_name = false;
87
void _text_changed(const String &p_string);
88
void _text_submitted(const String &p_string);
89
90
protected:
91
virtual void _set_read_only(bool p_read_only) override;
92
93
public:
94
void set_string_name(bool p_enabled);
95
virtual void update_property() override;
96
void set_placeholder(const String &p_string);
97
void set_secret(bool p_enabled);
98
EditorPropertyText();
99
};
100
101
class EditorPropertyMultilineText : public EditorProperty {
102
GDCLASS(EditorPropertyMultilineText, EditorProperty);
103
TextEdit *text = nullptr;
104
105
AcceptDialog *big_text_dialog = nullptr;
106
TextEdit *big_text = nullptr;
107
Button *open_big_text = nullptr;
108
109
void _big_text_changed();
110
void _text_changed();
111
void _open_big_text();
112
bool expression = false;
113
114
protected:
115
virtual void _set_read_only(bool p_read_only) override;
116
void _notification(int p_what);
117
118
public:
119
virtual void update_property() override;
120
EditorPropertyMultilineText(bool p_expression = false);
121
};
122
123
class EditorPropertyTextEnum : public EditorProperty {
124
GDCLASS(EditorPropertyTextEnum, EditorProperty);
125
126
HBoxContainer *default_layout = nullptr;
127
HBoxContainer *edit_custom_layout = nullptr;
128
129
OptionButton *option_button = nullptr;
130
Button *edit_button = nullptr;
131
132
LineEdit *custom_value_edit = nullptr;
133
Button *accept_button = nullptr;
134
Button *cancel_button = nullptr;
135
136
Vector<String> options;
137
bool string_name = false;
138
bool loose_mode = false;
139
140
void _emit_changed_value(const String &p_string);
141
void _option_selected(int p_which);
142
143
void _edit_custom_value();
144
void _custom_value_submitted(const String &p_value);
145
void _custom_value_accepted();
146
void _custom_value_canceled();
147
148
protected:
149
virtual void _set_read_only(bool p_read_only) override;
150
void _notification(int p_what);
151
152
public:
153
void setup(const Vector<String> &p_options, bool p_string_name = false, bool p_loose_mode = false);
154
virtual void update_property() override;
155
EditorPropertyTextEnum();
156
};
157
158
class EditorPropertyPath : public EditorProperty {
159
GDCLASS(EditorPropertyPath, EditorProperty);
160
Vector<String> extensions;
161
bool folder = false;
162
bool global = false;
163
bool save_mode = false;
164
bool enable_uid = false;
165
bool display_uid = false;
166
167
EditorFileDialog *dialog = nullptr;
168
LineEdit *path = nullptr;
169
Button *toggle_uid = nullptr;
170
Button *path_edit = nullptr;
171
172
String _get_path_text(bool p_allow_uid = false);
173
174
void _path_selected(const String &p_path);
175
void _path_pressed();
176
void _path_focus_exited();
177
void _toggle_uid_display();
178
void _update_uid_icon();
179
void _drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
180
bool _can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
181
182
protected:
183
virtual void _set_read_only(bool p_read_only) override;
184
void _notification(int p_what);
185
186
public:
187
LineEdit *get_path_edit() const { return path; }
188
189
void setup(const Vector<String> &p_extensions, bool p_folder, bool p_global, bool p_enable_uid);
190
void set_save_mode();
191
virtual void update_property() override;
192
EditorPropertyPath();
193
};
194
195
class EditorPropertyLocale : public EditorProperty {
196
GDCLASS(EditorPropertyLocale, EditorProperty);
197
EditorLocaleDialog *dialog = nullptr;
198
LineEdit *locale = nullptr;
199
Button *locale_edit = nullptr;
200
201
void _locale_selected(const String &p_locale);
202
void _locale_pressed();
203
void _locale_focus_exited();
204
205
protected:
206
void _notification(int p_what);
207
208
public:
209
void setup(const String &p_hit_string);
210
virtual void update_property() override;
211
EditorPropertyLocale();
212
};
213
214
class EditorPropertyClassName : public EditorProperty {
215
GDCLASS(EditorPropertyClassName, EditorProperty);
216
217
private:
218
CreateDialog *dialog = nullptr;
219
Button *property = nullptr;
220
String selected_type;
221
String base_type;
222
void _property_selected();
223
void _dialog_created();
224
225
protected:
226
virtual void _set_read_only(bool p_read_only) override;
227
228
public:
229
void setup(const String &p_base_type, const String &p_selected_type);
230
virtual void update_property() override;
231
EditorPropertyClassName();
232
};
233
234
class EditorPropertyCheck : public EditorProperty {
235
GDCLASS(EditorPropertyCheck, EditorProperty);
236
CheckBox *checkbox = nullptr;
237
238
void _checkbox_pressed();
239
240
protected:
241
virtual void _set_read_only(bool p_read_only) override;
242
243
public:
244
virtual void update_property() override;
245
EditorPropertyCheck();
246
};
247
248
class EditorPropertyEnum : public EditorProperty {
249
GDCLASS(EditorPropertyEnum, EditorProperty);
250
OptionButton *options = nullptr;
251
252
void _option_selected(int p_which);
253
254
protected:
255
virtual void _set_read_only(bool p_read_only) override;
256
257
public:
258
void setup(const Vector<String> &p_options);
259
virtual void update_property() override;
260
void set_option_button_clip(bool p_enable);
261
EditorPropertyEnum();
262
};
263
264
class EditorPropertyFlags : public EditorProperty {
265
GDCLASS(EditorPropertyFlags, EditorProperty);
266
VBoxContainer *vbox = nullptr;
267
Vector<CheckBox *> flags;
268
Vector<uint32_t> flag_values;
269
270
void _flag_toggled(int p_index);
271
272
protected:
273
virtual void _set_read_only(bool p_read_only) override;
274
275
public:
276
void setup(const Vector<String> &p_options);
277
virtual void update_property() override;
278
EditorPropertyFlags();
279
};
280
281
///////////////////// LAYERS /////////////////////////
282
283
class EditorPropertyLayersGrid : public Control {
284
GDCLASS(EditorPropertyLayersGrid, Control);
285
286
private:
287
Vector<Rect2> flag_rects;
288
Rect2 expand_rect;
289
bool expand_hovered = false;
290
bool expanded = false;
291
int expansion_rows = 0;
292
uint32_t hovered_index = INT32_MAX; // Nothing is hovered.
293
bool read_only = false;
294
int renamed_layer_index = -1;
295
PopupMenu *layer_rename = nullptr;
296
ConfirmationDialog *rename_dialog = nullptr;
297
LineEdit *rename_dialog_text = nullptr;
298
299
void _rename_pressed(int p_menu);
300
void _rename_operation_confirm();
301
void _update_hovered(const Vector2 &p_position);
302
void _on_hover_exit();
303
void _update_flag(bool p_replace);
304
Size2 get_grid_size() const;
305
306
protected:
307
void _notification(int p_what);
308
static void _bind_methods();
309
310
public:
311
uint32_t value = 0;
312
int layer_group_size = 0;
313
uint32_t layer_count = 0;
314
Vector<String> names;
315
Vector<String> tooltips;
316
317
void set_read_only(bool p_read_only);
318
virtual Size2 get_minimum_size() const override;
319
virtual String get_tooltip(const Point2 &p_pos) const override;
320
void gui_input(const Ref<InputEvent> &p_ev) override;
321
void set_flag(uint32_t p_flag);
322
EditorPropertyLayersGrid();
323
};
324
325
class EditorPropertyLayers : public EditorProperty {
326
GDCLASS(EditorPropertyLayers, EditorProperty);
327
328
public:
329
enum LayerType {
330
LAYER_PHYSICS_2D,
331
LAYER_RENDER_2D,
332
LAYER_NAVIGATION_2D,
333
LAYER_PHYSICS_3D,
334
LAYER_RENDER_3D,
335
LAYER_NAVIGATION_3D,
336
LAYER_AVOIDANCE,
337
};
338
339
private:
340
EditorPropertyLayersGrid *grid = nullptr;
341
void _grid_changed(uint32_t p_grid);
342
String basename;
343
LayerType layer_type;
344
PopupMenu *layers = nullptr;
345
TextureButton *button = nullptr;
346
347
void _button_pressed();
348
void _menu_pressed(int p_menu);
349
void _refresh_names();
350
351
protected:
352
void _notification(int p_what);
353
virtual void _set_read_only(bool p_read_only) override;
354
355
public:
356
void setup(LayerType p_layer_type);
357
void set_layer_name(int p_index, const String &p_name);
358
String get_layer_name(int p_index) const;
359
virtual void update_property() override;
360
EditorPropertyLayers();
361
};
362
363
class EditorPropertyInteger : public EditorProperty {
364
GDCLASS(EditorPropertyInteger, EditorProperty);
365
EditorSpinSlider *spin = nullptr;
366
void _value_changed(int64_t p_val);
367
368
protected:
369
virtual void _set_read_only(bool p_read_only) override;
370
371
public:
372
virtual void update_property() override;
373
void setup(int64_t p_min, int64_t p_max, int64_t p_step, bool p_hide_slider, bool p_allow_greater, bool p_allow_lesser, const String &p_suffix = String());
374
EditorPropertyInteger();
375
};
376
377
class EditorPropertyObjectID : public EditorProperty {
378
GDCLASS(EditorPropertyObjectID, EditorProperty);
379
Button *edit = nullptr;
380
String base_type;
381
void _edit_pressed();
382
383
protected:
384
virtual void _set_read_only(bool p_read_only) override;
385
386
public:
387
virtual void update_property() override;
388
void setup(const String &p_base_type);
389
EditorPropertyObjectID();
390
};
391
392
class EditorPropertySignal : public EditorProperty {
393
GDCLASS(EditorPropertySignal, EditorProperty);
394
Button *edit = nullptr;
395
String base_type;
396
void _edit_pressed();
397
398
public:
399
virtual void update_property() override;
400
EditorPropertySignal();
401
};
402
403
class EditorPropertyCallable : public EditorProperty {
404
GDCLASS(EditorPropertyCallable, EditorProperty);
405
Button *edit = nullptr;
406
String base_type;
407
408
public:
409
virtual void update_property() override;
410
EditorPropertyCallable();
411
};
412
413
class EditorPropertyFloat : public EditorProperty {
414
GDCLASS(EditorPropertyFloat, EditorProperty);
415
EditorSpinSlider *spin = nullptr;
416
bool radians_as_degrees = false;
417
void _value_changed(double p_val);
418
419
protected:
420
virtual void _set_read_only(bool p_read_only) override;
421
422
public:
423
virtual void update_property() override;
424
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, bool p_exp_range, bool p_greater, bool p_lesser, const String &p_suffix = String(), bool p_radians_as_degrees = false);
425
EditorPropertyFloat();
426
};
427
428
class EditorPropertyEasing : public EditorProperty {
429
GDCLASS(EditorPropertyEasing, EditorProperty);
430
Control *easing_draw = nullptr;
431
PopupMenu *preset = nullptr;
432
EditorSpinSlider *spin = nullptr;
433
434
bool dragging = false;
435
bool full = false;
436
bool flip = false;
437
bool positive_only = false;
438
439
enum {
440
EASING_ZERO,
441
EASING_LINEAR,
442
EASING_IN,
443
EASING_OUT,
444
EASING_IN_OUT,
445
EASING_OUT_IN,
446
EASING_MAX
447
448
};
449
450
void _drag_easing(const Ref<InputEvent> &p_ev);
451
void _draw_easing();
452
void _set_preset(int);
453
454
void _setup_spin();
455
void _spin_value_changed(double p_value);
456
void _spin_focus_exited();
457
458
void _notification(int p_what);
459
460
protected:
461
virtual void _set_read_only(bool p_read_only) override;
462
463
public:
464
virtual void update_property() override;
465
void setup(bool p_positive_only, bool p_flip);
466
EditorPropertyEasing();
467
};
468
469
class EditorPropertyRect2 : public EditorProperty {
470
GDCLASS(EditorPropertyRect2, EditorProperty);
471
EditorSpinSlider *spin[4];
472
void _value_changed(double p_val, const String &p_name);
473
474
protected:
475
virtual void _set_read_only(bool p_read_only) override;
476
void _notification(int p_what);
477
478
public:
479
virtual void update_property() override;
480
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String());
481
EditorPropertyRect2(bool p_force_wide = false);
482
};
483
484
class EditorPropertyRect2i : public EditorProperty {
485
GDCLASS(EditorPropertyRect2i, EditorProperty);
486
EditorSpinSlider *spin[4];
487
void _value_changed(double p_val, const String &p_name);
488
489
protected:
490
virtual void _set_read_only(bool p_read_only) override;
491
void _notification(int p_what);
492
493
public:
494
virtual void update_property() override;
495
void setup(int p_min, int p_max, const String &p_suffix = String());
496
EditorPropertyRect2i(bool p_force_wide = false);
497
};
498
499
class EditorPropertyPlane : public EditorProperty {
500
GDCLASS(EditorPropertyPlane, EditorProperty);
501
EditorSpinSlider *spin[4];
502
void _value_changed(double p_val, const String &p_name);
503
504
protected:
505
virtual void _set_read_only(bool p_read_only) override;
506
void _notification(int p_what);
507
508
public:
509
virtual void update_property() override;
510
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String());
511
EditorPropertyPlane(bool p_force_wide = false);
512
};
513
514
class EditorPropertyQuaternion : public EditorProperty {
515
GDCLASS(EditorPropertyQuaternion, EditorProperty);
516
BoxContainer *default_layout = nullptr;
517
EditorSpinSlider *spin[4];
518
519
Button *warning = nullptr;
520
AcceptDialog *warning_dialog = nullptr;
521
522
Label *euler_label = nullptr;
523
VBoxContainer *edit_custom_bc = nullptr;
524
EditorSpinSlider *euler[3];
525
Button *edit_button = nullptr;
526
527
Vector3 edit_euler;
528
529
void _value_changed(double p_val, const String &p_name);
530
void _edit_custom_value();
531
void _custom_value_changed(double p_val);
532
void _warning_pressed();
533
534
bool is_grabbing_euler();
535
536
protected:
537
virtual void _set_read_only(bool p_read_only) override;
538
void _notification(int p_what);
539
540
public:
541
virtual void update_property() override;
542
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String(), bool p_hide_editor = false);
543
EditorPropertyQuaternion();
544
};
545
546
class EditorPropertyAABB : public EditorProperty {
547
GDCLASS(EditorPropertyAABB, EditorProperty);
548
EditorSpinSlider *spin[6];
549
void _value_changed(double p_val, const String &p_name);
550
551
protected:
552
virtual void _set_read_only(bool p_read_only) override;
553
void _notification(int p_what);
554
555
public:
556
virtual void update_property() override;
557
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String());
558
EditorPropertyAABB();
559
};
560
561
class EditorPropertyTransform2D : public EditorProperty {
562
GDCLASS(EditorPropertyTransform2D, EditorProperty);
563
EditorSpinSlider *spin[6];
564
void _value_changed(double p_val, const String &p_name);
565
566
protected:
567
virtual void _set_read_only(bool p_read_only) override;
568
void _notification(int p_what);
569
570
public:
571
virtual void update_property() override;
572
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String());
573
EditorPropertyTransform2D(bool p_include_origin = true);
574
};
575
576
class EditorPropertyBasis : public EditorProperty {
577
GDCLASS(EditorPropertyBasis, EditorProperty);
578
EditorSpinSlider *spin[9];
579
void _value_changed(double p_val, const String &p_name);
580
581
protected:
582
virtual void _set_read_only(bool p_read_only) override;
583
void _notification(int p_what);
584
585
public:
586
virtual void update_property() override;
587
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String());
588
EditorPropertyBasis();
589
};
590
591
class EditorPropertyTransform3D : public EditorProperty {
592
GDCLASS(EditorPropertyTransform3D, EditorProperty);
593
EditorSpinSlider *spin[12];
594
void _value_changed(double p_val, const String &p_name);
595
596
protected:
597
virtual void _set_read_only(bool p_read_only) override;
598
void _notification(int p_what);
599
600
public:
601
virtual void update_property() override;
602
virtual void update_using_transform(Transform3D p_transform);
603
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String());
604
EditorPropertyTransform3D();
605
};
606
607
class EditorPropertyProjection : public EditorProperty {
608
GDCLASS(EditorPropertyProjection, EditorProperty);
609
EditorSpinSlider *spin[16];
610
void _value_changed(double p_val, const String &p_name);
611
612
protected:
613
virtual void _set_read_only(bool p_read_only) override;
614
void _notification(int p_what);
615
616
public:
617
virtual void update_property() override;
618
virtual void update_using_transform(Projection p_transform);
619
void setup(double p_min, double p_max, double p_step, bool p_hide_slider, const String &p_suffix = String());
620
EditorPropertyProjection();
621
};
622
623
class EditorPropertyColor : public EditorProperty {
624
GDCLASS(EditorPropertyColor, EditorProperty);
625
ColorPickerButton *picker = nullptr;
626
void _color_changed(const Color &p_color);
627
void _picker_created();
628
void _popup_opening();
629
void _popup_closed();
630
631
Color last_color;
632
bool live_changes_enabled = true;
633
bool was_checked = false;
634
635
protected:
636
virtual void _set_read_only(bool p_read_only) override;
637
void _notification(int p_what);
638
639
public:
640
virtual void update_property() override;
641
void setup(bool p_show_alpha);
642
void set_live_changes_enabled(bool p_enabled);
643
EditorPropertyColor();
644
};
645
646
class EditorPropertyNodePath : public EditorProperty {
647
GDCLASS(EditorPropertyNodePath, EditorProperty);
648
649
enum {
650
ACTION_CLEAR,
651
ACTION_COPY,
652
ACTION_EDIT,
653
ACTION_SELECT,
654
};
655
656
Button *assign = nullptr;
657
MenuButton *menu = nullptr;
658
LineEdit *edit = nullptr;
659
660
SceneTreeDialog *scene_tree = nullptr;
661
bool use_path_from_scene_root = false;
662
bool editing_node = false;
663
bool dropping = false;
664
665
Vector<StringName> valid_types;
666
void _node_selected(const NodePath &p_path, bool p_absolute = true);
667
void _node_assign();
668
void _assign_draw();
669
Node *get_base_node();
670
void _update_menu();
671
void _menu_option(int p_idx);
672
void _accept_text();
673
void _text_submitted(const String &p_text);
674
const NodePath _get_node_path() const;
675
676
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
677
void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from);
678
bool is_drop_valid(const Dictionary &p_drag_data) const;
679
680
virtual Variant _get_cache_value(const StringName &p_prop, bool &r_valid) const override;
681
682
protected:
683
virtual void _set_read_only(bool p_read_only) override;
684
void _notification(int p_what);
685
686
public:
687
virtual void update_property() override;
688
void setup(const Vector<StringName> &p_valid_types, bool p_use_path_from_scene_root = true, bool p_editing_node = false);
689
EditorPropertyNodePath();
690
};
691
692
class EditorPropertyRID : public EditorProperty {
693
GDCLASS(EditorPropertyRID, EditorProperty);
694
Label *label = nullptr;
695
696
public:
697
virtual void update_property() override;
698
EditorPropertyRID();
699
};
700
701
class EditorPropertyResource : public EditorProperty {
702
GDCLASS(EditorPropertyResource, EditorProperty);
703
704
EditorResourcePicker *resource_picker = nullptr;
705
SceneTreeDialog *scene_tree = nullptr;
706
707
bool use_sub_inspector = false;
708
EditorInspector *sub_inspector = nullptr;
709
bool opened_editor = false;
710
bool use_filter = false;
711
712
void _resource_selected(const Ref<Resource> &p_resource, bool p_inspect);
713
void _resource_changed(const Ref<Resource> &p_resource);
714
715
void _viewport_selected(const NodePath &p_path);
716
717
void _sub_inspector_property_keyed(const String &p_property, const Variant &p_value, bool p_advance);
718
void _sub_inspector_resource_selected(const Ref<Resource> &p_resource, const String &p_property);
719
void _sub_inspector_object_id_selected(int p_id);
720
721
void _open_editor_pressed();
722
void _update_preferred_shader();
723
bool _should_stop_editing() const;
724
725
protected:
726
virtual void _set_read_only(bool p_read_only) override;
727
void _notification(int p_what);
728
static void _bind_methods();
729
730
public:
731
virtual void update_property() override;
732
void setup(Object *p_object, const String &p_path, const String &p_base_type);
733
734
void collapse_all_folding() override;
735
void expand_all_folding() override;
736
void expand_revertable() override;
737
738
void set_use_sub_inspector(bool p_enable);
739
void set_use_filter(bool p_use);
740
void fold_resource();
741
742
virtual bool is_colored(ColorationMode p_mode) override;
743
744
EditorPropertyResource();
745
};
746
747
///////////////////////////////////////////////////
748
/// \brief The EditorInspectorDefaultPlugin class
749
///
750
class EditorInspectorDefaultPlugin : public EditorInspectorPlugin {
751
GDCLASS(EditorInspectorDefaultPlugin, EditorInspectorPlugin);
752
753
public:
754
virtual bool can_handle(Object *p_object) override;
755
virtual bool parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const BitField<PropertyUsageFlags> p_usage, const bool p_wide = false) override;
756
757
static EditorProperty *get_editor_for_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const BitField<PropertyUsageFlags> p_usage, const bool p_wide = false);
758
};
759
760