improved graphics and localization

This commit is contained in:
Monica Moniot
2022-12-08 14:19:02 -05:00
parent cf9717308c
commit 3a6b4308ee
10 changed files with 38 additions and 26 deletions

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -3,16 +3,18 @@ cybersyn-ticks-per-second=Central planning updates per second
cybersyn-update-rate=Central planning update rate cybersyn-update-rate=Central planning update rate
cybersyn-request-threshold=Default requester threshold cybersyn-request-threshold=Default requester threshold
cybersyn-network-flag=Default network mask cybersyn-network-flag=Default network mask
cybersyn-depot-bypass-threshold=Depot bypass fuel threshold cybersyn-fuel-threshold=Fuel threshold
cybersyn-depot-bypass-enabled=Depot bypass enabled
cybersyn-warmup-time=Station warmup time (sec) cybersyn-warmup-time=Station warmup time (sec)
cybersyn-stuck-train-time=Stuck train timeout (sec) cybersyn-stuck-train-time=Stuck train timeout (sec)
[mod-setting-description] [mod-setting-description]
cybersyn-ticks-per-second=How many times per second the central planner should update the state of the network and schedule deliveries. This value will be rounded up to a divisor of 60. cybersyn-ticks-per-second=How many times per second the central planner should update the state of the network and schedule deliveries. This value will be rounded up to a divisor of 60. Setting this to 0 will stop all dispatches.
cybersyn-update-rate=How many stations per tick can be polled at once or can have deliveries scheduled at once. Larger number allow the central planner to keep more up to date on the current state of the network, but at the cost of performance. cybersyn-update-rate=How many stations per tick can be polled at once or can have deliveries scheduled at once. Larger number allow the central planner to keep more up to date on the current state of the network, but at the cost of performance.
cybersyn-request-threshold=The default request threshold when a request threshold signal is not given to a station. When a station receives a negative item signal that surpasses its request threshold, so long as any station exists with a positive signal greater than the request threshold, a delivery of that item will be scheduled between the two stations. cybersyn-request-threshold=The default request threshold when a request threshold signal is not given to a station. When a station receives a negative item signal that surpasses its request threshold, so long as any station exists with a positive signal greater than the request threshold, a delivery of that item will be scheduled between the two stations.
cybersyn-network-flag=The default set of sub-networks a station will service when no network signal is given to a station. This integer is interpretted bit-wise to give 32 possible sub-networks to choose from. cybersyn-network-flag=The default set of sub-networks a station will service when no network signal is given to a station. This integer is interpretted bit-wise to give 32 possible sub-networks to choose from.
cybersyn-depot-bypass-threshold=What percentage of the fuel inventory of the a train must be full to activate depot bypass. When a train qualifies for depot bypass, it may take a new order from the network before having to return to its depot, dramatically reducing travel time. If this is set to 1, depot bypass will be disabled. cybersyn-fuel-threshold=What percentage of a train's fuel inventory must be full to skip refueling. If this is set to 1, trains will always visit a fuel loader after completing a delivery.
cybersyn-depot-bypass-enabled=If checked, when a train completes a delivery and refueling, it may take a new order from the network before having to return to its depot.
cybersyn-warmup-time=How many seconds a cybernetic combinator will wait before connecting to the Cybersyn network. This is a grace period to modify or correct the circuit network before trains start dispatching to a newly blueprinted station. cybersyn-warmup-time=How many seconds a cybernetic combinator will wait before connecting to the Cybersyn network. This is a grace period to modify or correct the circuit network before trains start dispatching to a newly blueprinted station.
cybersyn-stuck-train-time=After this many seconds from a train's dispatch, an alert will be sent to let you know a train is probably stuck and has not completed its delivery. The player will likely have to debug their network to get the train unstuck. cybersyn-stuck-train-time=After this many seconds from a train's dispatch, an alert will be sent to let you know a train is probably stuck and has not completed its delivery. The player will likely have to debug their network to get the train unstuck.
@@ -49,12 +51,12 @@ stuck-train=A train from depot __1__ is stuck
[cybersyn-gui] [cybersyn-gui]
combinator-title=Cybernetic combinator combinator-title=Cybernetic combinator
operation=Mode operation=Control Mode
comb1=Primary station control comb1=Primary station
comb2=Optional station control comb2=Optional station
depot=Depot control depot=Depot
refueler=Refueling station control refueler=Fuel loader
wagon-manifest=Wagon control wagon-manifest=Wagon
network=Network network=Network
network-tooltip=A signal is used to identify which network this combinator is a member of. Trains will only be dispatched from depots to provide and request stations if they are all identified with the same signal. network-tooltip=A signal is used to identify which network this combinator is a member of. Trains will only be dispatched from depots to provide and request stations if they are all identified with the same signal.
auto-tooltip=When checked trains in the network are automatically added to the allow-list if every wagon of the train is able to be loaded or unloaded by this station. When unchecked the allow-list is not used and all trains are allowed to park here. auto-tooltip=When checked trains in the network are automatically added to the allow-list if every wagon of the train is able to be loaded or unloaded by this station. When unchecked the allow-list is not used and all trains are allowed to park here.

View File

@@ -212,6 +212,7 @@ combinator_entity.divide_symbol_sprites = create_combinator_display(30, 0, { 0,
combinator_entity.modulo_symbol_sprites = create_combinator_display(45, 0, { 0, -0.140625, }, { 0, -0.328125, }) combinator_entity.modulo_symbol_sprites = create_combinator_display(45, 0, { 0, -0.140625, }, { 0, -0.328125, })
combinator_entity.power_symbol_sprites = create_combinator_display(0, 11, { 0, -0.140625, }, { 0, -0.328125, }) combinator_entity.power_symbol_sprites = create_combinator_display(0, 11, { 0, -0.140625, }, { 0, -0.328125, })
combinator_entity.left_shift_symbol_sprites = create_combinator_display(15, 11, { 0, -0.140625, }, { 0, -0.328125, }) combinator_entity.left_shift_symbol_sprites = create_combinator_display(15, 11, { 0, -0.140625, }, { 0, -0.328125, })
combinator_entity.right_shift_symbol_sprites = create_combinator_display(30, 11, { 0, -0.140625, }, { 0, -0.328125, })
combinator_entity.multiply_symbol_sprites = combinator_entity.divide_symbol_sprites combinator_entity.multiply_symbol_sprites = combinator_entity.divide_symbol_sprites

View File

@@ -105,7 +105,8 @@
---@field public network_flag int ---@field public network_flag int
---@field public warmup_time double ---@field public warmup_time double
---@field public stuck_train_time double ---@field public stuck_train_time double
---@field public depot_bypass_threshold double ---@field public fuel_threshold double
---@field public depot_bypass_enabled boolean
---@field public missing_train_alert_enabled boolean --interface setting ---@field public missing_train_alert_enabled boolean --interface setting
---@field public stuck_train_alert_enabled boolean --interface setting ---@field public stuck_train_alert_enabled boolean --interface setting
---@field public react_to_nonempty_train_in_depot boolean --interface setting ---@field public react_to_nonempty_train_in_depot boolean --interface setting

View File

@@ -658,7 +658,8 @@ local function on_settings_changed(event)
mod_settings.update_rate = settings.global["cybersyn-update-rate"].value --[[@as int]] mod_settings.update_rate = settings.global["cybersyn-update-rate"].value --[[@as int]]
mod_settings.r_threshold = settings.global["cybersyn-request-threshold"].value--[[@as int]] mod_settings.r_threshold = settings.global["cybersyn-request-threshold"].value--[[@as int]]
mod_settings.network_flag = settings.global["cybersyn-network-flag"].value--[[@as int]] mod_settings.network_flag = settings.global["cybersyn-network-flag"].value--[[@as int]]
mod_settings.depot_bypass_threshold = settings.global["cybersyn-depot-bypass-threshold"].value--[[@as double]] mod_settings.fuel_threshold = settings.global["cybersyn-fuel-threshold"].value--[[@as double]]
mod_settings.depot_bypass_enabled = settings.global["cybersyn-depot-bypass-enabled"].value--[[@as boolean]]
mod_settings.warmup_time = settings.global["cybersyn-warmup-time"].value--[[@as double]] mod_settings.warmup_time = settings.global["cybersyn-warmup-time"].value--[[@as double]]
mod_settings.stuck_train_time = settings.global["cybersyn-stuck-train-time"].value--[[@as double]] mod_settings.stuck_train_time = settings.global["cybersyn-stuck-train-time"].value--[[@as double]]
if event.setting == "cybersyn-ticks-per-second" then if event.setting == "cybersyn-ticks-per-second" then
@@ -802,9 +803,10 @@ local function main()
mod_settings.update_rate = settings.global["cybersyn-update-rate"].value --[[@as int]] mod_settings.update_rate = settings.global["cybersyn-update-rate"].value --[[@as int]]
mod_settings.r_threshold = settings.global["cybersyn-request-threshold"].value--[[@as int]] mod_settings.r_threshold = settings.global["cybersyn-request-threshold"].value--[[@as int]]
mod_settings.network_flag = settings.global["cybersyn-network-flag"].value--[[@as int]] mod_settings.network_flag = settings.global["cybersyn-network-flag"].value--[[@as int]]
mod_settings.depot_bypass_threshold = settings.global["cybersyn-depot-bypass-threshold"].value--[[@as double]] mod_settings.fuel_threshold = settings.global["cybersyn-fuel-threshold"].value--[[@as double]]
mod_settings.warmup_time = settings.global["cybersyn-warmup-time"].value--[[@as double]] mod_settings.warmup_time = settings.global["cybersyn-warmup-time"].value--[[@as double]]
mod_settings.stuck_train_time = settings.global["cybersyn-stuck-train-time"].value--[[@as double]] mod_settings.stuck_train_time = settings.global["cybersyn-stuck-train-time"].value--[[@as double]]
mod_settings.depot_bypass_enabled = settings.global["cybersyn-depot-bypass-enabled"].value--[[@as boolean]]
mod_settings.missing_train_alert_enabled = true mod_settings.missing_train_alert_enabled = true
mod_settings.stuck_train_alert_enabled = true mod_settings.stuck_train_alert_enabled = true

View File

@@ -311,19 +311,14 @@ local function on_train_leaves_stop(map_data, mod_settings, train_id, train)
end end
end end
end end
if total_slots == 0 then if total_slots == 0 or fuel_fill/total_slots > mod_settings.fuel_threshold then
--if total_slots == 0 it's probably a modded electric train --if total_slots == 0, it's probably a modded electric train
if mod_settings.depot_bypass_threshold < 1 then if mod_settings.depot_bypass_enabled then
train.status = STATUS_TO_D_BYPASS train.status = STATUS_TO_D_BYPASS
add_available_train(map_data, train_id, train) add_available_train(map_data, train_id, train)
interface_raise_train_status_changed(train_id, STATUS_R, STATUS_TO_D_BYPASS) interface_raise_train_status_changed(train_id, STATUS_R, STATUS_TO_D_BYPASS)
return return
end end
elseif fuel_fill/total_slots > mod_settings.depot_bypass_threshold then
train.status = STATUS_TO_D_BYPASS
add_available_train(map_data, train_id, train)
interface_raise_train_status_changed(train_id, STATUS_R, STATUS_TO_D_BYPASS)
return
else else
local refuelers = map_data.to_refuelers[train.network_name] local refuelers = map_data.to_refuelers[train.network_name]
if refuelers then if refuelers then
@@ -363,13 +358,17 @@ local function on_train_leaves_stop(map_data, mod_settings, train_id, train)
interface_raise_train_status_changed(train_id, STATUS_R, STATUS_TO_D) interface_raise_train_status_changed(train_id, STATUS_R, STATUS_TO_D)
elseif train.status == STATUS_F then elseif train.status == STATUS_F then
local refueler = map_data.refuelers[train.refueler_id] local refueler = map_data.refuelers[train.refueler_id]
train.status = STATUS_TO_D_BYPASS
train.refueler_id = nil train.refueler_id = nil
refueler.trains_total = refueler.trains_total - 1 refueler.trains_total = refueler.trains_total - 1
add_available_train(map_data, train_id, train)
unset_wagon_combs(map_data, refueler) unset_wagon_combs(map_data, refueler)
set_combinator_output(map_data, refueler.entity_comb, nil) set_combinator_output(map_data, refueler.entity_comb, nil)
interface_raise_train_status_changed(train_id, STATUS_F, STATUS_TO_D_BYPASS) if mod_settings.depot_bypass_enabled then
train.status = STATUS_TO_D_BYPASS
add_available_train(map_data, train_id, train)
else
train.status = STATUS_TO_D
end
interface_raise_train_status_changed(train_id, STATUS_F, train.status)
elseif train.status == STATUS_D then elseif train.status == STATUS_D then
--The train is leaving the depot without a manifest, the player likely intervened --The train is leaving the depot without a manifest, the player likely intervened
local depot = map_data.depots[train.parked_at_depot_id--[[@as uint]]] local depot = map_data.depots[train.parked_at_depot_id--[[@as uint]]]

View File

@@ -47,17 +47,24 @@ data:extend({
}, },
{ {
type = "double-setting", type = "double-setting",
name = "cybersyn-depot-bypass-threshold", name = "cybersyn-fuel-threshold",
order = "ae", order = "ae",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = .5, default_value = .5,
minimum_value = 0, minimum_value = 0,
maximum_value = 1, maximum_value = 1,
}, },
{
type = "bool-setting",
name = "cybersyn-depot-bypass-enabled",
order = "af",
setting_type = "runtime-global",
default_value = true,
},
{ {
type = "double-setting", type = "double-setting",
name = "cybersyn-warmup-time", name = "cybersyn-warmup-time",
order = "af", order = "ag",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = 20, default_value = 20,
minimum_value = 0, minimum_value = 0,
@@ -66,7 +73,7 @@ data:extend({
{ {
type = "double-setting", type = "double-setting",
name = "cybersyn-stuck-train-time", name = "cybersyn-stuck-train-time",
order = "ag", order = "ah",
setting_type = "runtime-global", setting_type = "runtime-global",
default_value = 600, default_value = 600,
minimum_value = 0, minimum_value = 0,

BIN
dev/combinator-displays.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB