Change the default variable constructor to use EditorInspector and updated property hints that were changed.

This commit is contained in:
K. S. Ernest (iFire) Lee 2018-09-08 02:51:23 -07:00
parent 4b6846a59d
commit 7ce9e67355
2 changed files with 5 additions and 7 deletions

View file

@ -321,7 +321,7 @@ protected:
p_list->push_back(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt)); p_list->push_back(PropertyInfo(Variant::INT, "type", PROPERTY_HINT_ENUM, argt));
p_list->push_back(PropertyInfo(script->get_variable_info(var).type, "value", script->get_variable_info(var).hint, script->get_variable_info(var).hint_string, PROPERTY_USAGE_DEFAULT)); p_list->push_back(PropertyInfo(script->get_variable_info(var).type, "value", script->get_variable_info(var).hint, script->get_variable_info(var).hint_string, PROPERTY_USAGE_DEFAULT));
// Update this when PropertyHint changes // Update this when PropertyHint changes
p_list->push_back(PropertyInfo(Variant::INT, "hint", PROPERTY_HINT_ENUM, "None,Range,ExpRange,Enum,ExpEasing,Length,SpriteFrame,KeyAccel,Flags,Layers2dRender,Layers2dPhysics,Layer3dRender,Layer3dPhysics,File,Dir,GlobalFile,GlobalDir,ResourceType,MultilineText,ColorNoAlpha,ImageCompressLossy,ImageCompressLossLess,ObjectId,String,NodePathToEditedNode,MethodOfVariantType,MethodOfBaseType,MethodOfInstance,MethodOfScript,PropertyOfVariantType,PropertyOfBaseType,PropertyOfInstance,PropertyOfScript,ObjectTooBig")); p_list->push_back(PropertyInfo(Variant::INT, "hint", PROPERTY_HINT_ENUM, "None,Range,ExpRange,Enum,ExpEasing,Length,SpriteFrame,KeyAccel,Flags,Layers2dRender,Layers2dPhysics,Layer3dRender,Layer3dPhysics,File,Dir,GlobalFile,GlobalDir,ResourceType,MultilineText,PlaceholderText,ColorNoAlpha,ImageCompressLossy,ImageCompressLossLess,ObjectId,String,NodePathToEditedNode,MethodOfVariantType,MethodOfBaseType,MethodOfInstance,MethodOfScript,PropertyOfVariantType,PropertyOfBaseType,PropertyOfInstance,PropertyOfScript,ObjectTooBig,NodePathValidTypes"));
p_list->push_back(PropertyInfo(Variant::STRING, "hint_string")); p_list->push_back(PropertyInfo(Variant::STRING, "hint_string"));
p_list->push_back(PropertyInfo(Variant::BOOL, "export")); p_list->push_back(PropertyInfo(Variant::BOOL, "export"));
} }
@ -3615,8 +3615,7 @@ VisualScriptEditor::VisualScriptEditor() {
edit_signal_dialog->set_title(TTR("Edit Signal Arguments:")); edit_signal_dialog->set_title(TTR("Edit Signal Arguments:"));
signal_editor = memnew(VisualScriptEditorSignalEdit); signal_editor = memnew(VisualScriptEditorSignalEdit);
edit_signal_edit = memnew(PropertyEditor); edit_signal_edit = memnew(EditorInspector);
edit_signal_edit->hide_top_label();
edit_signal_dialog->add_child(edit_signal_edit); edit_signal_dialog->add_child(edit_signal_edit);
edit_signal_edit->edit(signal_editor); edit_signal_edit->edit(signal_editor);
@ -3627,8 +3626,7 @@ VisualScriptEditor::VisualScriptEditor() {
edit_variable_dialog->set_title(TTR("Edit Variable:")); edit_variable_dialog->set_title(TTR("Edit Variable:"));
variable_editor = memnew(VisualScriptEditorVariableEdit); variable_editor = memnew(VisualScriptEditorVariableEdit);
edit_variable_edit = memnew(PropertyEditor); edit_variable_edit = memnew(EditorInspector);
edit_variable_edit->hide_top_label();
edit_variable_dialog->add_child(edit_variable_edit); edit_variable_dialog->add_child(edit_variable_edit);
edit_variable_edit->edit(variable_editor); edit_variable_edit->edit(variable_editor);

View file

@ -93,7 +93,7 @@ class VisualScriptEditor : public ScriptEditorBase {
VisualScriptEditorSignalEdit *signal_editor; VisualScriptEditorSignalEdit *signal_editor;
AcceptDialog *edit_signal_dialog; AcceptDialog *edit_signal_dialog;
PropertyEditor *edit_signal_edit; EditorInspector *edit_signal_edit;
VisualScriptPropertySelector *method_select; VisualScriptPropertySelector *method_select;
VisualScriptPropertySelector *new_connect_node_select; VisualScriptPropertySelector *new_connect_node_select;
@ -102,7 +102,7 @@ class VisualScriptEditor : public ScriptEditorBase {
VisualScriptEditorVariableEdit *variable_editor; VisualScriptEditorVariableEdit *variable_editor;
AcceptDialog *edit_variable_dialog; AcceptDialog *edit_variable_dialog;
PropertyEditor *edit_variable_edit; EditorInspector *edit_variable_edit;
CustomPropertyEditor *default_value_edit; CustomPropertyEditor *default_value_edit;