@@ -81,6 +81,8 @@ void ProjectSettingsEditor::_notification(int p_what) {
81
81
search_button->set_icon (get_icon (" Search" , " EditorIcons" ));
82
82
clear_button->set_icon (get_icon (" Close" , " EditorIcons" ));
83
83
84
+ action_add_error->add_color_override (" font_color" , get_color (" error_color" , " Editor" ));
85
+
84
86
translation_list->connect (" button_pressed" , this , " _translation_delete" );
85
87
_update_actions ();
86
88
popup_add->add_icon_item (get_icon (" Keyboard" , " EditorIcons" ), TTR (" Key " ), INPUT_KEY); // "Key " - because the word 'key' has already been used as a key animation
@@ -819,20 +821,24 @@ void ProjectSettingsEditor::_action_check(String p_action) {
819
821
} else {
820
822
821
823
if (p_action.find (" /" ) != -1 || p_action.find (" :" ) != -1 ) {
822
- action_add->set_text (TTR (" Can't contain '/' or ':'" ));
824
+
825
+ action_add_error->set_text (TTR (" Can't contain '/' or ':'" ));
826
+ action_add_error->show ();
823
827
action_add->set_disabled (true );
824
828
return ;
825
829
}
826
830
if (ProjectSettings::get_singleton ()->has_setting (" input/" + p_action)) {
827
- action_add->set_text (TTR (" Already existing" ));
831
+
832
+ action_add_error->set_text (TTR (" Already existing" ));
833
+ action_add_error->show ();
828
834
action_add->set_disabled (true );
829
835
return ;
830
836
}
831
837
832
838
action_add->set_disabled (false );
833
839
}
834
840
835
- action_add-> set_text ( TTR ( " Add " ) );
841
+ action_add_error-> hide ( );
836
842
}
837
843
838
844
void ProjectSettingsEditor::_action_adds (String) {
@@ -869,7 +875,7 @@ void ProjectSettingsEditor::_action_add() {
869
875
return ;
870
876
r->select (0 );
871
877
input_editor->ensure_cursor_is_visible ();
872
- action_add-> set_text ( TTR ( " Add " ) );
878
+ action_add_error-> hide ( );
873
879
}
874
880
875
881
void ProjectSettingsEditor::_item_checked (const String &p_item, bool p_check) {
@@ -1696,6 +1702,10 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
1696
1702
action_name->connect (" text_entered" , this , " _action_adds" );
1697
1703
action_name->connect (" text_changed" , this , " _action_check" );
1698
1704
1705
+ action_add_error = memnew (Label);
1706
+ hbc->add_child (action_add_error);
1707
+ action_add_error->hide ();
1708
+
1699
1709
add = memnew (Button );
1700
1710
hbc->add_child (add);
1701
1711
add->set_custom_minimum_size (Size2 (150 , 0 ) * EDSCALE);
0 commit comments