mirror of
https://github.com/Xevion/project-cybersyn.git
synced 2025-12-10 02:08:11 -06:00
Merge pull request #114 from FinalFrag/main
Added missing provider message
This commit is contained in:
@@ -67,6 +67,7 @@ depot-broken=A train is lost because its depot was broken
|
|||||||
refueler-broken=A train is lost because its refueler was broken
|
refueler-broken=A train is lost because its refueler was broken
|
||||||
station-broken=A train is lost because one of its delivery stations was broken
|
station-broken=A train is lost because one of its delivery stations was broken
|
||||||
train-at-incorrect=A train parked at a station it was not scheduled to delivered to
|
train-at-incorrect=A train parked at a station it was not scheduled to delivered to
|
||||||
|
missing-provider=Could not find a station providing __1__ to make a delivery to __2__
|
||||||
missing-train=Could not find any train on the correct network to make a delivery from __2__ to __1__
|
missing-train=Could not find any train on the correct network to make a delivery from __2__ to __1__
|
||||||
no-train-has-capacity=Could not find a train with enough cargo capacity to make a delivery from __2__ to __1__
|
no-train-has-capacity=Could not find a train with enough cargo capacity to make a delivery from __2__ to __1__
|
||||||
no-train-matches-r-layout=Could not find a train on the allow-list of __1__ to make a delivery
|
no-train-matches-r-layout=Could not find a train on the allow-list of __1__ to make a delivery
|
||||||
|
|||||||
@@ -498,7 +498,9 @@ local function tick_dispatch(map_data, mod_settings)
|
|||||||
create_delivery(map_data, r_station_id, p_station_id, best_train_id, manifest)
|
create_delivery(map_data, r_station_id, p_station_id, best_train_id, manifest)
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
if correctness == 1 then
|
if correctness == 0 then
|
||||||
|
send_alert_missing_provider(item_name, r_station.entity_stop)
|
||||||
|
elseif correctness == 1 then
|
||||||
send_alert_missing_train(r_station.entity_stop, closest_to_correct_p_station.entity_stop)
|
send_alert_missing_train(r_station.entity_stop, closest_to_correct_p_station.entity_stop)
|
||||||
elseif correctness == 2 then
|
elseif correctness == 2 then
|
||||||
send_alert_no_train_has_capacity(r_station.entity_stop, closest_to_correct_p_station.entity_stop)
|
send_alert_no_train_has_capacity(r_station.entity_stop, closest_to_correct_p_station.entity_stop)
|
||||||
|
|||||||
@@ -776,6 +776,17 @@ function send_alert_sounds(train)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---@param item_name string
|
||||||
|
---@param r_stop LuaEntity
|
||||||
|
function send_alert_missing_provider(item_name, r_stop)
|
||||||
|
for _, player in pairs(r_stop.force.players) do
|
||||||
|
player.add_custom_alert(
|
||||||
|
r_stop,
|
||||||
|
send_alert_about_missing_train_icon,
|
||||||
|
{"cybersyn-messages.missing-provider", item_name, r_stop.backer_name},
|
||||||
|
true)
|
||||||
|
end
|
||||||
|
end
|
||||||
---@param r_stop LuaEntity
|
---@param r_stop LuaEntity
|
||||||
---@param p_stop LuaEntity
|
---@param p_stop LuaEntity
|
||||||
function send_alert_missing_train(r_stop, p_stop)
|
function send_alert_missing_train(r_stop, p_stop)
|
||||||
|
|||||||
@@ -353,6 +353,7 @@ interface.add_refueler_schedule = add_refueler_schedule
|
|||||||
--[[alerts]]
|
--[[alerts]]
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
|
||||||
|
interface.send_alert_missing_provider = send_alert_missing_provider
|
||||||
interface.send_alert_missing_train = send_alert_missing_train
|
interface.send_alert_missing_train = send_alert_missing_train
|
||||||
interface.send_alert_unexpected_train = send_alert_unexpected_train
|
interface.send_alert_unexpected_train = send_alert_unexpected_train
|
||||||
interface.send_alert_nonempty_train_in_depot = send_alert_nonempty_train_in_depot
|
interface.send_alert_nonempty_train_in_depot = send_alert_nonempty_train_in_depot
|
||||||
|
|||||||
Reference in New Issue
Block a user