Refactor: min/max → min_color/max_color

This commit is contained in:
Wuzzy 2022-04-20 06:20:49 +02:00
parent 9f64ebfd7d
commit b1c706bdf9

View File

@ -106,8 +106,8 @@ local current_options = {}
-- Side length of calculated perlin area
current_options.size = 64
-- Theoretical min and max values for Perlin noise (for colorization)
current_options.min = -1
current_options.max = 1
current_options.min_color = -1
current_options.max_color = 1
current_options.nodetype = 1
-- dimensions of current Perlin noise (2 or 3)
@ -776,8 +776,8 @@ minetest.register_chatcommand("perlin_set_options", {
end
current_options.dimensions = dimensions
current_options.sidelen = fix_sidelen(sidelen)
current_options.min = min
current_options.max = max
current_options.min_color = min
current_options.max_color = max
loaded_areas = {}
return true, S("Perlin map generation options set!")
end,
@ -1073,8 +1073,8 @@ local show_noise_formspec = function(player, noiseparams, profile_id)
pos_y = tostring(current_options.pos.y or "")
pos_z = tostring(current_options.pos.z or "")
end
local value_min = tostring(current_options.min or "")
local value_max = tostring(current_options.max or "")
local value_min = tostring(current_options.min_color or "")
local value_max = tostring(current_options.max_color or "")
local flags = np.flags
local flags_table = parse_flags_string(flags)
@ -1430,8 +1430,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
minetest.log("action", "[perlin_explorer] Perlin noise set!")
current_options.dimensions = dimensions
current_options.sidelen = fix_sidelen(sidelen)
current_options.min = value_min
current_options.max = value_max
current_options.min_color = value_min
current_options.max_color = value_max
current_options.nodetype = nodetype
if fields.toggle_autogen then
current_options.autogen = not current_options.autogen