From 1de395b6148613e30b3fea1274cbbddc539c695f Mon Sep 17 00:00:00 2001 From: PHIDIAS Date: Mon, 2 Sep 2024 06:18:14 +0900 Subject: [PATCH] Decon log locale (#319) * Update deconlog.lua * Update addons.cfg * Update addons.cfg * Update addons.cfg * Update deconlog.lua * Update deconlog.lua * Update addons.cfg * Update addons.cfg * Update addons.cfg * Update modules/addons/deconlog.lua --------- Co-authored-by: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> --- locale/en/addons.cfg | 3 +++ locale/zh-CN/addons.cfg | 3 +++ locale/zh-TW/addons.cfg | 3 +++ modules/addons/deconlog.lua | 9 +++++---- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/locale/en/addons.cfg b/locale/en/addons.cfg index 0bd2c2fa..a3d5f75c 100644 --- a/locale/en/addons.cfg +++ b/locale/en/addons.cfg @@ -86,3 +86,6 @@ jail=__1__ was jailed because they removed too many protected entities. Please w [nukeprotect] found=You cannot have __1__ in your inventory, so it was placed into the chests at spawn. + +[deconlog] +decon=__1__ tried to deconstruct on __2__ from __3__ to __4__ which has __5__ items. diff --git a/locale/zh-CN/addons.cfg b/locale/zh-CN/addons.cfg index c584afbf..1188abc1 100644 --- a/locale/zh-CN/addons.cfg +++ b/locale/zh-CN/addons.cfg @@ -86,3 +86,6 @@ jail=__1__ 因被多次拆除受保護物體而被禁止行動。請等候管理 [nukeprotect] found=你的用戶組不允許你有 __1__ ,所以該物品已放在出生點的箱子。 + +[deconlog] +decon=__1__ 試圖拆除在 __2__ 上從 __3__ 到 __4__ ,有 __5__ 個物品。 diff --git a/locale/zh-TW/addons.cfg b/locale/zh-TW/addons.cfg index c584afbf..1188abc1 100644 --- a/locale/zh-TW/addons.cfg +++ b/locale/zh-TW/addons.cfg @@ -86,3 +86,6 @@ jail=__1__ 因被多次拆除受保護物體而被禁止行動。請等候管理 [nukeprotect] found=你的用戶組不允許你有 __1__ ,所以該物品已放在出生點的箱子。 + +[deconlog] +decon=__1__ 試圖拆除在 __2__ 上從 __3__ 到 __4__ ,有 __5__ 個物品。 diff --git a/modules/addons/deconlog.lua b/modules/addons/deconlog.lua index 58f415f9..0f3c8fd5 100644 --- a/modules/addons/deconlog.lua +++ b/modules/addons/deconlog.lua @@ -39,23 +39,24 @@ Event.on_init(function() end) if config.decon_area then - Event.add(defines.events.on_player_deconstructed_area, function (e) + Event.add(defines.events.on_player_deconstructed_area, function(e) if e.alt then return end local player = game.get_player(e.player_index) - if Roles.player_has_flag(player, "deconlog-bypass") then + + if Roles.player_has_flag(player, 'deconlog-bypass') then return end local items = e.surface.find_entities_filtered{area=e.area, force=player.force} if #items > 250 then - print_to_players(true, player.name .. ' tried to deconstruct the area ' .. pos_to_gps_string(e.area.left_top) .. ' to ' .. pos_to_gps_string(e.area.right_bottom) .. ' that have ' .. format_number(#items) .. ' items, but were not allowed.') + print_to_players(true, {'deconlog.decon', player.name, e.surface.name, pos_to_gps_string(e.area.left_top), pos_to_gps_string(e.area.right_bottom), format_number(#items)}) end - add_log(get_secs() .. "," .. player.name .. ",decon_area," .. pos_to_string(e.area.left_top) .. "," .. pos_to_string(e.area.right_bottom)) + add_log(get_secs() .. ',' .. player.name .. ',decon_area,' .. e.surface.name .. ',' .. pos_to_string(e.area.left_top) .. ',' .. pos_to_string(e.area.right_bottom)) end) end