mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2025-12-27 11:05:22 +09:00
.
This commit is contained in:
@@ -38,6 +38,11 @@ if settings.startup['PHI-CT'].value then
|
||||
end
|
||||
end
|
||||
|
||||
script.on_event(defines.events.on_built_entity, trash_creation, {{filter='name', name='trash-chest', mode='or'}, {filter='name', name='trash-pipe', mode='or'}})
|
||||
script.on_event(defines.events.on_robot_built_entity, trash_creation, {{filter='name', name='trash-chest', mode='or'}, {filter='name', name='trash-pipe', mode='or'}})
|
||||
script.on_event(defines.events.script_raised_built, trash_creation)
|
||||
script.on_event(defines.events.script_raised_revive, trash_creation)
|
||||
|
||||
local function hidden_recipe_enable(e, enable)
|
||||
local force = game.players[e.player_index].force
|
||||
|
||||
@@ -53,6 +58,14 @@ if settings.startup['PHI-CT'].value then
|
||||
force.recipes['infinity-pipe'].enabled = enable
|
||||
end
|
||||
|
||||
script.on_event(defines.events.on_player_cheat_mode_enabled, function(e)
|
||||
hidden_recipe_enable(e, true)
|
||||
end)
|
||||
|
||||
script.on_event(defines.events.on_player_cheat_mode_disabled, function(e)
|
||||
hidden_recipe_enable(e, false)
|
||||
end)
|
||||
|
||||
function math2d.position.equal(p1, p2)
|
||||
p1, p2 = math2d.position.ensure_xy(p1), math2d.position.ensure_xy(p2)
|
||||
return p1.x == p2.x and p1.y == p2.y
|
||||
@@ -245,19 +258,6 @@ if settings.startup['PHI-CT'].value then
|
||||
gui.update(player, player.opened)
|
||||
end
|
||||
|
||||
script.on_event(defines.events.on_built_entity, trash_creation, {{filter='name', name='trash-chest', mode='or'}, {filter='name', name='trash-pipe', mode='or'}})
|
||||
script.on_event(defines.events.on_robot_built_entity, trash_creation, {{filter='name', name='trash-chest', mode='or'}, {filter='name', name='trash-pipe', mode='or'}})
|
||||
script.on_event(defines.events.script_raised_built, trash_creation)
|
||||
script.on_event(defines.events.script_raised_revive, trash_creation)
|
||||
|
||||
script.on_event(defines.events.on_player_cheat_mode_enabled, function(e)
|
||||
hidden_recipe_enable(e, true)
|
||||
end)
|
||||
|
||||
script.on_event(defines.events.on_player_cheat_mode_disabled, function(e)
|
||||
hidden_recipe_enable(e, false)
|
||||
end)
|
||||
|
||||
script.on_init(function(_)
|
||||
trash_check()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user