mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-07-29 05:52:30 +09:00
.
This commit is contained in:
@@ -4,6 +4,7 @@ local infinity_container = require('control/infinity-container')
|
|||||||
local inserter = require('control/inserter')
|
local inserter = require('control/inserter')
|
||||||
local pump = require('control/pump')
|
local pump = require('control/pump')
|
||||||
local rail_support = require('control/rail-support')
|
local rail_support = require('control/rail-support')
|
||||||
|
local shortcut = require('control/shortcut')
|
||||||
local trash = require('control/trash')
|
local trash = require('control/trash')
|
||||||
|
|
||||||
local function entity_build(event)
|
local function entity_build(event)
|
||||||
@@ -115,3 +116,8 @@ if settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and set
|
|||||||
entity_build({entity=event.destination})
|
entity_build({entity=event.destination})
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if settings.startup['PHI-CT'].value then
|
||||||
|
script.on_event(defines.events.on_lua_shortcut, shortcut.toggle)
|
||||||
|
script.on_event(defines.events.on_player_toggled_map_editor, shortcut.after_toggle)
|
||||||
|
end
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
local main = {}
|
||||||
|
|
||||||
|
function main.toggle(event)
|
||||||
|
if event.prototype_name ~= 'phi-cl-toggle-editor' then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local player = game.players[event.player_index]
|
||||||
|
|
||||||
|
if player.permission_group and not player.permission_group.allows_action(defines.input_action.toggle_map_editor) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if player.admin then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
player.toggle_map_editor()
|
||||||
|
end
|
||||||
|
|
||||||
|
function main.after_toggle(event)
|
||||||
|
local player = game.players[event.player_index]
|
||||||
|
player.set_shortcut_toggled('phi-cl-toggle-editor', player.physical_controller_type == defines.controllers.editor)
|
||||||
|
game.tick_paused = false
|
||||||
|
end
|
||||||
|
|
||||||
|
return main
|
||||||
@@ -168,6 +168,18 @@ if data.raw['infinity-container'] and data.raw['infinity-container']['infinity-c
|
|||||||
}})
|
}})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- CT A 1 BASE SHORTCUT
|
||||||
|
if data.raw['blueprint-book'] and data.raw['blueprint-book']['blueprint-book'] then
|
||||||
|
data:extend({{
|
||||||
|
type = 'shortcut',
|
||||||
|
name = 'phi-cl-toggle-editor',
|
||||||
|
action = 'lua',
|
||||||
|
toggleable = true,
|
||||||
|
icon = data.raw['blueprint-book']['blueprint-book'].icon,
|
||||||
|
icon_size = data.raw['blueprint-book']['blueprint-book'].icon_size
|
||||||
|
}})
|
||||||
|
end
|
||||||
|
|
||||||
-- CT A 1 BASE MAP_GEN_PRESET
|
-- CT A 1 BASE MAP_GEN_PRESET
|
||||||
if settings.startup['PHI-CT-TILE'].value then
|
if settings.startup['PHI-CT-TILE'].value then
|
||||||
data.raw['map-gen-presets']['default']['empty-world'] = {
|
data.raw['map-gen-presets']['default']['empty-world'] = {
|
||||||
|
|||||||
Reference in New Issue
Block a user