mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 04:08:17 -06:00
Added startup mod setting to disable/enable manager in the event it causes crashes or UPS issues so that it can be "optional"
This commit is contained in:
@@ -12,6 +12,8 @@ cybersyn-warmup-time=Station warmup time (sec)
|
||||
cybersyn-stuck-train-time=Stuck train timeout (sec)
|
||||
cybersyn-allow-cargo-in-depot=Allow cargo in depots
|
||||
cybersyn-invert-sign=Invert combinator output (deprecated)
|
||||
cybersyn-manager-enabled=Enable the Cybersyn GUI.
|
||||
cybersyn-manager-update-rate=Manager refresh tick interval
|
||||
|
||||
[mod-setting-description]
|
||||
cybersyn-enable-planner=Enable or disable the central planning algorithm. If disabled no new trains will be dispatched.
|
||||
@@ -28,6 +30,7 @@ cybersyn-stuck-train-time=After this many seconds from a train's dispatch, an al
|
||||
cybersyn-allow-cargo-in-depot=If checked, trains will be allowed to have cargo in depots; no alerts will be generated and the train will not be held. In addition, trains with orders to visit requester stations with "Inactivity condition" checked will wait for inactivity instead of waiting for empty cargo. Useful for creating train systems where depots handle excess cargo. For advanced users only.
|
||||
cybersyn-invert-sign=Flip the sign of the output of cybernetic combinators to be the same as it is in LTN or in earlier versions of Project Cybersyn.
|
||||
|
||||
|
||||
[item-name]
|
||||
cybersyn-combinator=Cybernetic combinator
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ iterations-per-tick=Decrease this number if you're having performance issues.
|
||||
[cybersyn-mod-setting-name]
|
||||
history-length=History length
|
||||
iterations-per-tick=Iterations per tick [img=info]
|
||||
cybersyn-manager-update-rate=Manager refresh tick interval
|
||||
|
||||
[shortcut-name]
|
||||
cybersyn-toggle-gui=Toggle Cybersyn Manager
|
||||
|
||||
@@ -825,6 +825,7 @@ local function grab_all_settings()
|
||||
mod_settings.stuck_train_time = settings.global["cybersyn-stuck-train-time"].value--[[@as double]]
|
||||
mod_settings.allow_cargo_in_depot = settings.global["cybersyn-allow-cargo-in-depot"].value--[[@as boolean]]
|
||||
mod_settings.invert_sign = settings.global["cybersyn-invert-sign"].value--[[@as boolean]]
|
||||
mod_settings.manager_enabled = settings.startup["cybersyn-manager-enabled"].value--[[@as boolean]]
|
||||
mod_settings.manager_update_rate = settings.startup["cybersyn-manager-update-rate"].value--[[@as int]]
|
||||
end
|
||||
local function on_settings_changed(event)
|
||||
@@ -904,7 +905,7 @@ local function main()
|
||||
end
|
||||
|
||||
|
||||
local MANAGER_ENABLED = true --convert to mod setting?
|
||||
local MANAGER_ENABLED = mod_settings.manager_enabled
|
||||
|
||||
script.on_init(function()
|
||||
local setting = settings.global["cybersyn-invert-sign"]
|
||||
|
||||
@@ -111,6 +111,13 @@ data:extend({
|
||||
minimum_value = 1,
|
||||
maximum_value = 2147483647,
|
||||
},
|
||||
{
|
||||
type = "bool-setting",
|
||||
name = "cybersyn-manager-enabled",
|
||||
order = "aa",
|
||||
setting_type = "startup",
|
||||
default_value = true,
|
||||
},
|
||||
--{
|
||||
-- type = "bool-setting",
|
||||
-- name = "cybersyn-disable-top-left-button",
|
||||
|
||||
Reference in New Issue
Block a user