/usr/share/games/minetest/mods/mobf/mobf_settings/tab_feature_config.lua is in minetest-mod-mobf-core 2.5.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | --------------------------------------------------------------------------------
-- Mob Framework Settings Mod by Sapier
--
-- You may copy, use, modify or do nearly anything except removing this
-- copyright notice.
-- And of course you are NOT allowed to pretend you have written it.
--
--! @file tab_feature_config.lua
--! @brief settings gui for mobf
--! @copyright Sapier
--! @author Sapier
--! @date 2014-05-30
--
-- Contact sapier a t gmx net
--------------------------------------------------------------------------------
local function get_formspec(tabview, name, tabdata)
if not tabdata.is_admin then
return "label[0.75,0.25;" ..
fgettext("Insufficient permissions to view this tab.")
.. "]"
end
local retval = ""
local ypos = 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_disable_animal_spawning;" ..
"Disable mob spawning;" ..
mobf_settings.setting_gettext("mobf_disable_animal_spawning") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_disable_3d_mode;" ..
"Disable 3D mobs;" ..
mobf_settings.setting_gettext("mobf_disable_3d_mode") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_animal_spawning_secondary;" ..
"Enable secondary spawning;" ..
mobf_settings.setting_gettext("mobf_animal_spawning_secondary") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_delete_disabled_mobs;" ..
"Delete disabled mobs+spawners;" ..
mobf_settings.setting_gettext("mobf_delete_disabled_mobs") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_log_bug_warnings;" ..
"Log MOBF bug warnings;" ..
mobf_settings.setting_gettext("mobf_log_bug_warnings") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_vombie_3d_burn_animation_enabled;" ..
"Vombie 3D burn animation;" ..
mobf_settings.setting_gettext("vombie_3d_burn_animation_enabled") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_log_removed_entities;" ..
"Log all removed mobs;" ..
mobf_settings.setting_gettext("mobf_log_removed_entities") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_grief_protection;" ..
"Enable grief protection;" ..
mobf_settings.setting_gettext("mobf_grief_protection") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_lifebar;" ..
"Show mob lifebar;" ..
mobf_settings.setting_gettext("mobf_lifebar") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_enable_statistics;" ..
"Enable statistics;" ..
mobf_settings.setting_gettext("mobf_enable_statistics") .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_disable_pathfinding;" ..
"Disable core pathfinding support;" ..
mobf_settings.setting_gettext("mobf_disable_pathfinding") .."]"
ypos = ypos + 0.5
local showspawner = core.setting_get("adv_spawning.debug")
local spawner_setting_text = "false"
if (showspawner) then
spawner_setting_text = "true"
end
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_features_show_spawners;" ..
"Show spawner entities;" .. spawner_setting_text .."]"
ypos = ypos + 0.5
retval = retval .. "checkbox[1," .. ypos .. ";" ..
"cb_adv_spawning_refresh_spawners;" ..
"Refresh spawners (spawn mobs in old maps);" ..
(core.setting_get("adv_spawning_validate_spawners") or "false") .."]"
ypos = ypos + 0.5
return retval
end
local function handle_settings_buttons(self, fields, tabname, tabdata)
if not tabdata.is_admin then
core.log("error", "MOBF_Settings: someone managed to press a button " ..
"she/he shouldn't even see!")
return false
end
if fields["cb_features_disable_animal_spawning"] then
mobf_set_world_setting("mobf_disable_animal_spawning",
core.is_yes(fields["cb_features_disable_animal_spawning"]))
return true
end
if fields["cb_features_disable_3d_mode"] then
mobf_set_world_setting("mobf_disable_3d_mode",
core.is_yes(fields["cb_features_disable_3d_mode"]))
return true
end
if fields["cb_features_animal_spawning_secondary"] then
mobf_set_world_setting("mobf_animal_spawning_secondary",
core.is_yes(fields["cb_features_animal_spawning_secondary"]))
return true
end
if fields["cb_features_delete_disabled_mobs"] then
mobf_set_world_setting("mobf_delete_disabled_mobs",
core.is_yes(fields["cb_features_delete_disabled_mobs"]))
return true
end
if fields["cb_features_log_bug_warnings"] then
mobf_set_world_setting("mobf_log_bug_warnings",
core.is_yes(fields["cb_features_log_bug_warnings"]))
return true
end
if fields["cb_features_vombie_3d_burn_animation_enabled"] then
mobf_set_world_setting("vombie_3d_burn_animation_enabled",
core.is_yes(fields["cb_features_vombie_3d_burn_animation_enabled"]))
return true
end
if fields["cb_features_log_removed_entities"] then
mobf_set_world_setting("mobf_log_removed_entities",
core.is_yes(fields["cb_features_log_removed_entities"]))
return true
end
if fields["cb_features_grief_protection"] then
mobf_set_world_setting("mobf_grief_protection",
core.is_yes(fields["cb_features_grief_protection"]))
return true
end
if fields["cb_features_lifebar"] then
mobf_set_world_setting("mobf_lifebar",
core.is_yes(fields["cb_features_lifebar"]))
return true
end
if fields["cb_features_enable_statistics"] then
mobf_set_world_setting("mobf_enable_statistics",
core.is_yes(fields["cb_features_enable_statistics"]))
return true
end
if fields["cb_features_delayed_spawning"] then
mobf_set_world_setting("mobf_delayed_spawning",
core.is_yes(fields["cb_features_delayed_spawning"]))
return true
end
if fields["cb_features_disable_pathfinding"] then
mobf_set_world_setting("mobf_disable_pathfinding",
core.is_yes(fields["cb_features_disable_pathfinding"]))
return true
end
if fields["cb_features_show_spawners"] then
core.setting_set("adv_spawning.debug",
fields["cb_features_show_spawners"])
return true
end
if fields["cb_adv_spawning_refresh_spawners"] then
core.setting_set("adv_spawning_validate_spawners",
fields["cb_adv_spawning_refresh_spawners"])
return true
end
return false
end
mobf_settings_tab_features = {
name = "features",
caption = fgettext("Features"),
cbf_formspec = get_formspec,
cbf_button_handler = handle_settings_buttons
}
|