mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-08 10:08:08 -06:00
improved localization
This commit is contained in:
@@ -37,9 +37,9 @@ cybersyn-locked-slots=Locked slots per cargo wagon
|
||||
|
||||
[cybersyn-messages]
|
||||
missing-trains=No trains available to make a delivery from __2__ to __1__
|
||||
lost-train=A train has become lost
|
||||
nonempty-train=A train has parked in a depot while still containing items; it cannot be dispatched until it is empty
|
||||
unexpected-train=A train has returned to the depot before completing it's delivery
|
||||
lost-train=A train from depot __1__ has become lost
|
||||
nonempty-train=A train is being held in the depot because it still has cargo
|
||||
unexpected-train=A train has returned to the depot before completing its delivery
|
||||
|
||||
[cybersyn-gui]
|
||||
combinator-title=Cybernetic combinator
|
||||
|
||||
@@ -219,14 +219,15 @@ end
|
||||
|
||||
local send_lost_train_alert_icon = {name = LOST_TRAIN_NAME, type = "fluid"}
|
||||
---@param train LuaTrain
|
||||
function send_lost_train_alert(train)
|
||||
---@param depot_name string
|
||||
function send_lost_train_alert(train, depot_name)
|
||||
local loco = train.front_stock or train.back_stock
|
||||
if loco then
|
||||
for _, player in pairs(loco.force.players) do
|
||||
player.add_custom_alert(
|
||||
loco,
|
||||
send_lost_train_alert_icon,
|
||||
{"cybersyn-messages.lost-train"},
|
||||
{"cybersyn-messages.lost-train", depot_name},
|
||||
true)
|
||||
player.play_sound({path = ALERT_SOUND})
|
||||
end
|
||||
|
||||
@@ -22,10 +22,8 @@ end
|
||||
---@param train Train
|
||||
---@param train_id uint
|
||||
function remove_train(map_data, train, train_id)
|
||||
map_data.trains[train_id] = nil
|
||||
local depot = train.depot
|
||||
if depot then
|
||||
remove_available_train(map_data, depot)
|
||||
if train.depot then
|
||||
remove_available_train(map_data, train.depot)
|
||||
end
|
||||
local layout_id = train.layout_id
|
||||
local count = map_data.layout_train_count[layout_id]
|
||||
@@ -38,6 +36,7 @@ function remove_train(map_data, train, train_id)
|
||||
else
|
||||
map_data.layout_train_count[layout_id] = count - 1
|
||||
end
|
||||
map_data.trains[train_id] = nil
|
||||
end
|
||||
|
||||
---@param map_data MapData
|
||||
|
||||
@@ -162,7 +162,7 @@ local function on_station_broken(map_data, station_id, station)
|
||||
on_failed_delivery(map_data, train)
|
||||
train.entity.schedule = nil
|
||||
remove_train(map_data, train, train_id)
|
||||
send_lost_train_alert(train.entity)
|
||||
send_lost_train_alert(train.entity, train.depot_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -609,7 +609,7 @@ local function on_train_arrives_buffer(map_data, stop, train)
|
||||
on_failed_delivery(map_data, train)
|
||||
remove_train(map_data, train, train.entity.id)
|
||||
train.entity.schedule = nil
|
||||
send_lost_train_alert(train.entity)
|
||||
send_lost_train_alert(train.entity, train.depot_name)
|
||||
end
|
||||
else
|
||||
--train is lost somehow, probably from player intervention
|
||||
|
||||
Reference in New Issue
Block a user