MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / config

Method config

editor/plugins/plugin_config_dialog.cpp:177–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void PluginConfigDialog::config(const String &p_config_path) {
178 if (!p_config_path.is_empty()) {
179 Ref<ConfigFile> cf = memnew(ConfigFile);
180 Error err = cf->load(p_config_path);
181 ERR_FAIL_COND_MSG(err != OK, "Cannot load config file from path '" + p_config_path + "'.");
182
183 name_edit->set_text(cf->get_value("plugin", "name", ""));
184 subfolder_edit->set_text(p_config_path.get_base_dir().get_file());
185 desc_edit->set_text(cf->get_value("plugin", "description", ""));
186 author_edit->set_text(cf->get_value("plugin", "author", ""));
187 version_edit->set_text(cf->get_value("plugin", "version", ""));
188 script_edit->set_text(cf->get_value("plugin", "script", ""));
189
190 _edit_mode = true;
191 set_title(TTR("Edit a Plugin"));
192 } else {
193 _clear_fields();
194 _edit_mode = false;
195 set_title(TTR("Create a Plugin"));
196 }
197
198 for (Control *control : plugin_edit_hidden_controls) {
199 control->set_visible(!_edit_mode);
200 }
201
202 validation_panel->update();
203
204 get_ok_button()->set_disabled(!_edit_mode);
205 set_ok_button_text(_edit_mode ? TTR("Update") : TTR("Create"));
206}
207
208void PluginConfigDialog::_bind_methods() {
209 ADD_SIGNAL(MethodInfo("plugin_ready", PropertyInfo(Variant::STRING, "script_path", PROPERTY_HINT_NONE, ""), PropertyInfo(Variant::STRING, "activate_name")));

Callers 3

_create_clickedMethod · 0.45
_cell_button_pressedMethod · 0.45
EditorPluginSettingsMethod · 0.45

Calls 10

TTRFunction · 0.85
get_base_dirMethod · 0.80
is_emptyMethod · 0.45
loadMethod · 0.45
set_textMethod · 0.45
get_valueMethod · 0.45
get_fileMethod · 0.45
set_visibleMethod · 0.45
updateMethod · 0.45
set_disabledMethod · 0.45

Tested by

no test coverage detected