if fields["btn_restore"] then
local setting = settings[selected_setting]
if setting and setting.type ~= "category" then
- if setting.type == "noise_params_2d"
- or setting.type == "noise_params_3d" then
- core.settings:set_np_group(setting.name, setting.default_table)
- else
- core.settings:set(setting.name, setting.default)
- end
+ core.settings:remove(setting.name)
core.settings:write()
core.update_formspec(this:get_formspec())
end
case SPE_KVPAIR:
it = m_settings.find(name);
if (it != m_settings.end() &&
- (it->second.is_group || it->second.value != value)) {
+ (it->second.is_group || it->second.value != value)) {
printEntry(os, name, it->second, tab_depth);
was_modified = true;
+ } else if (it == m_settings.end()) {
+ // Remove by skipping
+ was_modified = true;
+ break;
} else {
os << line << "\n";
if (event == SPE_MULTILINE)
sanity_check(it->second.group != NULL);
was_modified |= it->second.group->updateConfigObject(is, os,
"}", tab_depth + 1);
+ } else if (it == m_settings.end()) {
+ // Remove by skipping
+ was_modified = true;
+ break;
} else {
printEntry(os, name, it->second, tab_depth);
was_modified = true;
if (it != m_settings.end()) {
delete it->second.group;
m_settings.erase(it);
+
+ doCallbacks(name);
return true;
}