mirror of
https://github.com/PHIDIAS0303/factorio-mod-PHI.git
synced 2026-07-29 05:52:30 +09:00
.
This commit is contained in:
@@ -43,6 +43,12 @@ script.on_init(function()
|
|||||||
gui_create(player)
|
gui_create(player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if settings.startup['PHI-CT'].value then
|
||||||
|
for _, player in pairs(game.players) do
|
||||||
|
player.set_shortcut_available('phi-cl-toggle-editor', settings.global['PHI-CT-EDITOR'].value)
|
||||||
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
script.on_configuration_changed(function()
|
script.on_configuration_changed(function()
|
||||||
@@ -55,6 +61,12 @@ script.on_configuration_changed(function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if settings.startup['PHI-CT'].value then
|
||||||
|
for _, player in pairs(game.players) do
|
||||||
|
player.set_shortcut_available('phi-cl-toggle-editor', settings.global['PHI-CT-EDITOR'].value)
|
||||||
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '') then
|
if settings.startup['PHI-MI'].value or (settings.startup['PHI-GM'].value and settings.startup['PHI-GM'].value ~= '') then
|
||||||
@@ -105,4 +117,5 @@ end
|
|||||||
if settings.startup['PHI-CT'].value then
|
if settings.startup['PHI-CT'].value then
|
||||||
script.on_event(defines.events.on_lua_shortcut, editor.toggle)
|
script.on_event(defines.events.on_lua_shortcut, editor.toggle)
|
||||||
script.on_event(defines.events.on_player_toggled_map_editor, editor.toggle_editor)
|
script.on_event(defines.events.on_player_toggled_map_editor, editor.toggle_editor)
|
||||||
|
script.on_event(defines.events.on_runtime_mod_setting_changed, editor.setting_change)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -24,4 +24,18 @@ function main.toggle_editor(event)
|
|||||||
game.tick_paused = false
|
game.tick_paused = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function main.setting_change(event)
|
||||||
|
if event.setting_type ~= 'runtime-global' then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if event.setting ~= 'PHI-CT-EDITOR' then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
for _, p in pairs(game.players) do
|
||||||
|
p.set_shortcut_available('phi-cl-toggle-editor', settings.global['PHI-CT-EDITOR'].value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return main
|
return main
|
||||||
|
|||||||
@@ -174,5 +174,12 @@ data:extend({
|
|||||||
localised_name = {'phi-cl.setting-class-color', 'CT1', '', {'mod-setting-name.PHI-CT-TILE'}},
|
localised_name = {'phi-cl.setting-class-color', 'CT1', '', {'mod-setting-name.PHI-CT-TILE'}},
|
||||||
localised_description = {'', {'phi-cl.setting-change-color', '[1] A1'}},
|
localised_description = {'', {'phi-cl.setting-change-color', '[1] A1'}},
|
||||||
order = 'E01'
|
order = 'E01'
|
||||||
|
}, {
|
||||||
|
type = 'bool-setting',
|
||||||
|
name = 'PHI-CT-EDITOR',
|
||||||
|
setting_type = 'runtime-global',
|
||||||
|
default_value = true,
|
||||||
|
localised_name = {'phi-cl.setting-category-color', 'CT', {'phi-cl.enable'}, {'gui-permissions-names.ToggleMapEditor'}},
|
||||||
|
order = 'E00'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user