Arrays now parse the hint_string in the new inspector.

Also, if a hint_string is given, when changing the size of an Array the new elements are initialized to the default value of that type hint.
This commit is contained in:
MrCdK
2018-12-03 04:41:18 +01:00
parent 8dd00ed176
commit 9c91cc00ea
3 changed files with 52 additions and 188 deletions

View File

@ -93,6 +93,9 @@ class EditorPropertyArray : public EditorProperty {
EditorSpinSlider *page;
HBoxContainer *page_hb;
Variant::Type array_type;
Variant::Type subtype;
PropertyHint subtype_hint;
String subtype_hint_string;
void _page_changed(double p_page);
void _length_changed(double p_page);
@ -108,7 +111,7 @@ protected:
void _notification(int p_what);
public:
void setup(Variant::Type p_array_type);
void setup(Variant::Type p_array_type, const String &p_hint_string = "");
virtual void update_property();
EditorPropertyArray();
};