mirror of
https://github.com/Wyrrrd/Gun_Turret_Alerts.git
synced 2026-03-25 16:49:50 +01:00
Localisation tweaks
- Added alerts to locale - Customized alerts with localised name of entities
This commit is contained in:
@@ -31,10 +31,10 @@ script.on_nth_tick(600, function (event)
|
||||
inv_var = turret_entity.get_inventory(defines.inventory.turret_ammo)
|
||||
if inv_var.is_empty() then
|
||||
-- no ammo alert
|
||||
player.add_custom_alert(turret_entity, {type = "virtual", name = "ammo-icon-red"}, "Turret out of ammo", true)
|
||||
player.add_custom_alert(turret_entity, {type = "virtual", name = "ammo-icon-red"}, {"gun-turret-alerts.message-empty", turret_entity.localised_name}, true)
|
||||
elseif inv_var[1].count < player_threshold then
|
||||
-- low ammo alert
|
||||
player.add_custom_alert(turret_entity, {type = "virtual", name = "ammo-icon-yellow"}, "Turret ammo low", true)
|
||||
player.add_custom_alert(turret_entity, {type = "virtual", name = "ammo-icon-yellow"}, {"gun-turret-alerts.message-low", turret_entity.localised_name}, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -47,10 +47,10 @@ script.on_nth_tick(600, function (event)
|
||||
inv_var = car_entity.get_inventory(defines.inventory.car_ammo)
|
||||
if inv_var.is_empty() then
|
||||
-- no ammo alert
|
||||
player.add_custom_alert(car_entity, {type = "virtual", name = "ammo-icon-red"}, "Car out of ammo", true)
|
||||
player.add_custom_alert(car_entity, {type = "virtual", name = "ammo-icon-red"}, {"gun-turret-alerts.message-empty", car_entity.localised_name}, true)
|
||||
elseif inv_var[1].count < player_threshold then
|
||||
-- low ammo alert
|
||||
player.add_custom_alert(car_entity, {type = "virtual", name = "ammo-icon-yellow"}, "Car ammo low", true)
|
||||
player.add_custom_alert(car_entity, {type = "virtual", name = "ammo-icon-yellow"}, {"gun-turret-alerts.message-low", car_entity.localised_name}, true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user