rename some stuff
This commit is contained in:
parent
f0bfc883d3
commit
3e918cfeae
@ -69,11 +69,11 @@ end)
|
||||
-- show predefined formspecs
|
||||
function chat_formspec.show_predefined(name)
|
||||
local context = chat_formspec.get_context(name)
|
||||
minetest.show_formspec(name, "chat_formspec:predefined", chat_formspec.get_predefined_template(context))
|
||||
minetest.show_formspec(name, "chat_formspec:custom", chat_formspec.create_custom_fs(context))
|
||||
end
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname ~= "chat_formspec:predefined" then return false end
|
||||
if formname ~= "chat_formspec:custom" then return false end
|
||||
local name = player:get_player_name()
|
||||
local context = chat_formspec.get_context(name)
|
||||
if fields.target then
|
||||
@ -84,7 +84,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
chat_formspec.show_select_predefined(name)
|
||||
elseif fields.change_text then
|
||||
context.replacement = minetest.formspec_escape(fields.change_text_field or "")
|
||||
minetest.show_formspec(name, "chat_formspec:predefined", chat_formspec.get_predefined_template(context))
|
||||
minetest.show_formspec(name, "chat_formspec:custom", chat_formspec.create_custom_fs(context))
|
||||
elseif fields.send then
|
||||
if not minetest.check_player_privs(name, chat_formspec.predefined_priv) then return true end
|
||||
local fs = chat_formspec.create_target_fs(context)
|
||||
|
||||
@ -32,7 +32,7 @@ chat_formspec.predefined_template = [[
|
||||
field_close_on_enter[target;false]
|
||||
]]
|
||||
|
||||
function chat_formspec.get_predefined_template(context)
|
||||
function chat_formspec.create_custom_fs(context)
|
||||
if not chat_formspec.predefined[context.id] then return end -- in case someone hacks their client and sends an invalid id in their fs submission
|
||||
local predefined = chat_formspec.predefined[context.id].fs
|
||||
local replacement = context.replacement or chat_formspec.predefined[context.id].replacement
|
||||
|
||||
Reference in New Issue
Block a user