1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2026-06-20 16:32:28 +02:00

Minor adjustments

This commit is contained in:
Gerkiz
2021-07-23 17:23:33 +02:00
parent 42e7496322
commit 6a165c79cb
5 changed files with 40 additions and 36 deletions
+12 -12
View File
@@ -212,7 +212,7 @@ local function on_player_ammo_inventory_changed(event)
if this.enable_capsule_cursor_warning then
local nukes = player.remove_item({name = 'atomic-bomb', count = 1000})
if nukes > 0 then
Utils.action_warning('{Nuke}', player.name .. ' tried to equip nukes but was not trusted.')
Utils.action_warning('[Nuke]', player.name .. ' tried to equip nukes but was not trusted.')
damage_player(player)
end
end
@@ -342,7 +342,7 @@ local function on_player_used_capsule(event)
return
end
local prefix = '{Capsule}'
local prefix = '[Capsule]'
msg = format(player.name .. ' damaged: %s with: %s', get_entities(name, entities), name)
local ban_msg = format('Damaged: %s with: %s. This action was performed automatically. Visit getcomfy.eu/discord for forgiveness', get_entities(name, entities), name)
@@ -553,7 +553,7 @@ local function on_gui_opened(event)
end
if player.name ~= corpse_owner.name then
Utils.action_warning('{Corpse}', player.name .. ' is looting ' .. corpse_owner.name .. '´s body.')
Utils.action_warning('[Corpse]', player.name .. ' is looting ' .. corpse_owner.name .. '´s body.')
if not this.corpse_history then
this.corpse_history = {}
end
@@ -608,7 +608,7 @@ local function on_pre_player_mined_item(event)
return
end
if player.name ~= corpse_owner.name then
Utils.action_warning('{Corpse}', player.name .. ' has looted ' .. corpse_owner.name .. '´s body.')
Utils.action_warning('[Corpse]', player.name .. ' has looted ' .. corpse_owner.name .. '´s body.')
if not this.corpse_history then
this.corpse_history = {}
end
@@ -688,7 +688,7 @@ local function on_player_cursor_stack_changed(event)
if ammo_names[name] then
local item_to_remove = player.remove_item({name = name, count = 1000})
if item_to_remove > 0 then
Utils.action_warning('{Capsule}', player.name .. ' equipped ' .. name .. ' but was not trusted.')
Utils.action_warning('[Capsule]', player.name .. ' equipped ' .. name .. ' but was not trusted.')
damage_player(player)
end
end
@@ -716,7 +716,7 @@ local function on_player_cancelled_crafting(event)
player.character.die('player')
Utils.action_warning(
'{Crafting}',
'[Crafting]',
player.name ..
' canceled their craft of item ' ..
event.recipe.name .. ' of total count ' .. crafting_queue_item_count .. ' in raw items (' .. crafted_items .. ' slots) but had no inventory left.'
@@ -778,7 +778,7 @@ local function on_permission_group_added(event)
local group = event.group
if group then
Utils.log_msg('{Permission_Group}', player.name .. ' added ' .. group.name)
Utils.log_msg('[Permission_Group]', player.name .. ' added ' .. group.name)
end
end
@@ -794,7 +794,7 @@ local function on_permission_group_deleted(event)
local name = event.group_name
local id = event.id
if name then
Utils.log_msg('{Permission_Group}', player.name .. ' deleted ' .. name .. ' with ID: ' .. id)
Utils.log_msg('[Permission_Group]', player.name .. ' deleted ' .. name .. ' with ID: ' .. id)
end
end
@@ -815,18 +815,18 @@ local function on_permission_group_edited(event)
action = k
end
end
Utils.log_msg('{Permission_Group}', player.name .. ' edited ' .. group.name .. ' with type: ' .. event.type .. ' with action: ' .. action)
Utils.log_msg('[Permission_Group]', player.name .. ' edited ' .. group.name .. ' with type: ' .. event.type .. ' with action: ' .. action)
end
if event.other_player_index then
local other_player = game.get_player(event.other_player_index)
if other_player and other_player.valid then
Utils.log_msg('{Permission_Group}', player.name .. ' moved ' .. other_player.name .. ' with type: ' .. event.type .. ' to group: ' .. group.name)
Utils.log_msg('[Permission_Group]', player.name .. ' moved ' .. other_player.name .. ' with type: ' .. event.type .. ' to group: ' .. group.name)
end
end
local old_name = event.old_name
local new_name = event.new_name
if old_name and new_name then
Utils.log_msg('{Permission_Group}', player.name .. ' renamed ' .. group.name .. '. New name: ' .. new_name .. '. Old Name: ' .. old_name)
Utils.log_msg('[Permission_Group]', player.name .. ' renamed ' .. group.name .. '. New name: ' .. new_name .. '. Old Name: ' .. old_name)
end
end
@@ -839,7 +839,7 @@ local function on_permission_string_imported(event)
return
end
Utils.log_msg('{Permission_Group}', player.name .. ' imported a permission string')
Utils.log_msg('[Permission_Group]', player.name .. ' imported a permission string')
end
--- This is used for the RPG module, when casting capsules.
+20 -20
View File
@@ -176,20 +176,20 @@ local functions = {
if event.element.switch_state == 'left' then
game.permissions.get_group('Default').set_allows_action(defines.input_action.open_blueprint_library_gui, true)
game.permissions.get_group('Default').set_allows_action(defines.input_action.import_blueprint_string, true)
get_actor(event, '{Blueprints}', 'has enabled blueprints!')
get_actor(event, '[Blueprints]', 'has enabled blueprints!')
else
game.permissions.get_group('Default').set_allows_action(defines.input_action.open_blueprint_library_gui, false)
game.permissions.get_group('Default').set_allows_action(defines.input_action.import_blueprint_string, false)
get_actor(event, '{Blueprints}', 'has disabled blueprints!')
get_actor(event, '[Blueprints]', 'has disabled blueprints!')
end
end,
['comfy_panel_spaghett_toggle'] = function(event)
if event.element.switch_state == 'left' then
this.gui_config.spaghett.enabled = true
get_actor(event, '{Spaghett}', 'has enabled spaghett mode!')
get_actor(event, '[Spaghett]', 'has enabled spaghett mode!')
else
this.gui_config.spaghett.enabled = nil
get_actor(event, '{Spaghett}', 'has disabled spaghett mode!')
get_actor(event, '[Spaghett]', 'has disabled spaghett mode!')
end
spaghett()
end,
@@ -225,10 +225,10 @@ local poll_function = {
['comfy_panel_poll_trusted_toggle'] = function(event)
if event.element.switch_state == 'left' then
this.gui_config.poll_trusted = true
get_actor(event, '{Poll Mode}', 'has disabled non-trusted people to do polls.')
get_actor(event, '[Poll Mode]', 'has disabled non-trusted people to do polls.')
else
this.gui_config.poll_trusted = false
get_actor(event, '{Poll Mode}', 'has allowed non-trusted people to do polls.')
get_actor(event, '[Poll Mode]', 'has allowed non-trusted people to do polls.')
end
end,
['comfy_panel_poll_no_notify_toggle'] = function(event)
@@ -247,10 +247,10 @@ local antigrief_functions = {
local AG = Antigrief.get()
if event.element.switch_state == 'left' then
AG.enabled = true
get_actor(event, '{Antigrief}', 'has enabled the antigrief function.', true)
get_actor(event, '[Antigrief]', 'has enabled the antigrief function.', true)
else
AG.enabled = false
get_actor(event, '{Antigrief}', 'has disabled the antigrief function.', true)
get_actor(event, '[Antigrief]', 'has disabled the antigrief function.', true)
end
trust_connected_players()
end
@@ -262,10 +262,10 @@ local fortress_functions = {
local Module = Fullness.get()
if event.element.switch_state == 'left' then
Module.fullness_enabled = true
get_actor(event, '{Fullness}', 'has enabled the inventory fullness function.')
get_actor(event, '[Fullness]', 'has enabled the inventory fullness function.')
else
Module.fullness_enabled = false
get_actor(event, '{Fullness}', 'has disabled the inventory fullness function.')
get_actor(event, '[Fullness]', 'has disabled the inventory fullness function.')
end
end,
['comfy_panel_offline_players'] = function(event)
@@ -273,10 +273,10 @@ local fortress_functions = {
local Module = WPT.get()
if event.element.switch_state == 'left' then
Module.offline_players_enabled = true
get_actor(event, '{Offline Players}', 'has enabled the offline player function.')
get_actor(event, '[Offline Players]', 'has enabled the offline player function.')
else
Module.offline_players_enabled = false
get_actor(event, '{Offline Players}', 'has disabled the offline player function.')
get_actor(event, '[Offline Players]', 'has disabled the offline player function.')
end
end,
['comfy_panel_collapse_grace'] = function(event)
@@ -284,10 +284,10 @@ local fortress_functions = {
local Module = WPT.get()
if event.element.switch_state == 'left' then
Module.collapse_grace = true
get_actor(event, '{Collapse}', 'has enabled the collapse function. Collapse will occur after wave 100!')
get_actor(event, '[Collapse]', 'has enabled the collapse function. Collapse will occur after wave 100!')
else
Module.collapse_grace = false
get_actor(event, '{Collapse}', 'has disabled the collapse function. You must reach zone 2 for collapse to occur!')
get_actor(event, '[Collapse]', 'has disabled the collapse function. You must reach zone 2 for collapse to occur!')
end
end,
['comfy_panel_spill_items_to_surface'] = function(event)
@@ -295,10 +295,10 @@ local fortress_functions = {
local Module = WPT.get()
if event.element.switch_state == 'left' then
Module.spill_items_to_surface = true
get_actor(event, '{Item Spill}', 'has enabled the ore spillage function. Ores now drop to surface when mining.')
get_actor(event, '[Item Spill]', 'has enabled the ore spillage function. Ores now drop to surface when mining.')
else
Module.spill_items_to_surface = false
get_actor(event, '{Item Spill}', 'has disabled the item spillage function. Ores no longer drop to surface when mining.')
get_actor(event, '[Item Spill]', 'has disabled the item spillage function. Ores no longer drop to surface when mining.')
end
end,
['comfy_panel_void_or_tile'] = function(event)
@@ -306,10 +306,10 @@ local fortress_functions = {
local Module = WPT.get()
if event.element.switch_state == 'left' then
Module.void_or_tile = 'out-of-map'
get_actor(event, '{Void}', 'has changes the tiles of the zones to: out-of-map (void)')
get_actor(event, '[Void]', 'has changes the tiles of the zones to: out-of-map (void)')
else
Module.void_or_tile = 'lab-dark-2'
get_actor(event, '{Void}', 'has changes the tiles of the zones to: dark-tiles (flammable tiles)')
get_actor(event, '[Void]', 'has changes the tiles of the zones to: dark-tiles (flammable tiles)')
end
end,
['comfy_panel_trusted_only_car_tanks'] = function(event)
@@ -317,10 +317,10 @@ local fortress_functions = {
local Module = WPT.get()
if event.element.switch_state == 'left' then
Module.trusted_only_car_tanks = true
get_actor(event, '{Market}', 'has changed so only trusted people can buy car/tanks.', true)
get_actor(event, '[Market]', 'has changed so only trusted people can buy car/tanks.', true)
else
Module.trusted_only_car_tanks = false
get_actor(event, '{Market}', 'has changed so everybody can buy car/tanks.', true)
get_actor(event, '[Market]', 'has changed so everybody can buy car/tanks.', true)
end
end
}
+2 -2
View File
@@ -660,7 +660,7 @@ function Public.save_car(ic, event)
log_err(ic, 'Owner of this vehicle is: ' .. p.name)
save_surface(ic, entity, p)
Utils.action_warning('{Car}', player.name .. ' has looted ' .. p.name .. '´s car.')
Utils.action_warning('[Car]', player.name .. ' has looted ' .. p.name .. '´s car.')
player.print('This car was not yours to keep.', Color.warning)
local params = {
player = player,
@@ -745,7 +745,7 @@ function Public.validate_owner(ic, player, entity)
if car.owner ~= player.index and player.driving then
player.driving = false
if not player.admin then
return Utils.print_to(nil, '{Car} ' .. player.name .. ' tried to drive ' .. p.name .. '´s car.')
return Utils.print_to(nil, '[Car] ' .. player.name .. ' tried to drive ' .. p.name .. '´s car.')
end
end
end
+4
View File
@@ -213,8 +213,10 @@ function Public.add_player_to_permission_group(player, group, forced)
locomotive_group.set_allows_action(defines.input_action.admin_action, false)
locomotive_group.set_allows_action(defines.input_action.drop_item, false)
locomotive_group.set_allows_action(defines.input_action.deconstruct, false)
locomotive_group.set_allows_action(defines.input_action.activate_cut, false)
local default_group = game.permissions.get_group('Default')
default_group.set_allows_action(defines.input_action.deconstruct, false)
default_group.set_allows_action(defines.input_action.activate_cut, false)
end
if not game.permissions.get_group('plebs') then
@@ -225,6 +227,7 @@ function Public.add_player_to_permission_group(player, group, forced)
plebs_group.set_allows_action(defines.input_action.add_permission_group, false)
plebs_group.set_allows_action(defines.input_action.admin_action, false)
plebs_group.set_allows_action(defines.input_action.deconstruct, false)
plebs_group.set_allows_action(defines.input_action.activate_cut, false)
end
if not game.permissions.get_group('not_trusted') then
@@ -251,6 +254,7 @@ function Public.add_player_to_permission_group(player, group, forced)
not_trusted.set_allows_action(defines.input_action.set_trains_limit, false)
not_trusted.set_allows_action(defines.input_action.set_train_stopped, false)
not_trusted.set_allows_action(defines.input_action.deconstruct, false)
not_trusted.set_allows_action(defines.input_action.activate_cut, false)
end
if not AG.enabled then
+2 -2
View File
@@ -460,7 +460,7 @@ local jail = function(player, griefer, msg, raised)
end
Utils.print_to(nil, message)
Utils.action_warning_embed('{Jailed}', message)
Utils.action_warning_embed('[Jailed]', message)
if votejail[griefer] then
votejail[griefer].jailed = true
@@ -489,7 +489,7 @@ local free = function(player, griefer)
set_data(jailed_data_set, griefer, nil)
Utils.print_to(nil, message)
Utils.action_warning_embed('{Jailed}', message)
Utils.action_warning_embed('[Jailed]', message)
return true
end