sfence
2022-11-04 66e20a9231b9fea823f9b683e495c57ef9a4ad41
technic/machines/HV/forcefield.lua
@@ -112,15 +112,24 @@
   else
      formspec = formspec.."button[0,1;5,1;mesecon_mode_0;"..S("Controlled by Mesecon Signal").."]"
   end
   -- TODO: String replacement with %s will stop working with client-side translations
   if meta:get_int("enabled") == 0 then
      formspec = formspec.."button[0,1.75;5,1;enable;"..S("%s Disabled"):format(S("%s Forcefield Emitter"):format("HV")).."]"
      formspec = formspec.."button[0,1.75;5,1;enable;"..
         S("%s Disabled"):format(S("%s Forcefield Emitter"):format("HV")).."]"
   else
      formspec = formspec.."button[0,1.75;5,1;disable;"..S("%s Enabled"):format(S("%s Forcefield Emitter"):format("HV")).."]"
      formspec = formspec.."button[0,1.75;5,1;disable;"..
         S("%s Enabled"):format(S("%s Forcefield Emitter"):format("HV")).."]"
   end
   meta:set_string("formspec", formspec)
end
local forcefield_receive_fields = function(pos, formname, fields, sender)
   local player_name = sender:get_player_name()
   if minetest.is_protected(pos, player_name) then
      minetest.chat_send_player(player_name, "You are not allowed to edit this!")
      minetest.record_protection_violation(pos, player_name)
      return
   end
   local meta = minetest.get_meta(pos)
   local range = nil
   if fields.range then