mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-16 18:01:40 +00:00
Rename minetest.*
to core.*
in devtest
This commit is contained in:
parent
d849d51c2d
commit
88c7a54e08
78 changed files with 914 additions and 914 deletions
|
@ -63,11 +63,11 @@ local function dump_lighting(lighting)
|
|||
return result
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("set_lighting", {
|
||||
core.register_chatcommand("set_lighting", {
|
||||
params = "",
|
||||
description = "Tune lighting parameters",
|
||||
func = function(player_name, param)
|
||||
local player = minetest.get_player_by_name(player_name);
|
||||
local player = core.get_player_by_name(player_name);
|
||||
if not player then return end
|
||||
|
||||
local lighting = player:get_lighting()
|
||||
|
@ -107,14 +107,14 @@ minetest.register_chatcommand("set_lighting", {
|
|||
}
|
||||
table.insert_all(form, content)
|
||||
|
||||
minetest.show_formspec(player_name, "lighting", table.concat(form))
|
||||
core.show_formspec(player_name, "lighting", table.concat(form))
|
||||
local debug_value = dump_lighting(lighting)
|
||||
local debug_ui = player:hud_add({type="text", position={x=0.1, y=0.3}, scale={x=1,y=1}, alignment = {x=1, y=1}, text=debug_value, number=0xFFFFFF})
|
||||
player:get_meta():set_int("lighting_hud", debug_ui)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
core.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname ~= "lighting" then return end
|
||||
|
||||
if not player then return end
|
||||
|
@ -137,7 +137,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||
for _,v in ipairs(parameters) do
|
||||
|
||||
if fields[section.n.."."..v.n] then
|
||||
local event = minetest.explode_scrollbar_event(fields[section.n.."."..v.n])
|
||||
local event = core.explode_scrollbar_event(fields[section.n.."."..v.n])
|
||||
if event.type == "CHG" then
|
||||
local value = v.min + (v.max - v.min) * (event.value / 1000);
|
||||
if v.type == "log2" then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue