1
0
mirror of https://github.com/Wyrrrd/Gun_Turret_Alerts.git synced 2026-07-01 20:51:08 +02:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Wyrrrd 846fb1412e Fixed migration breaking multiplayer
Removed migration, fixed missing car index through on_config_changed
2021-04-02 14:20:20 +02:00
Wyrrrd 2b5f19052e Localisation tweaks
- Added alerts to locale
- Customized alerts with localised name of entities
2021-03-29 09:42:18 +02:00
6 changed files with 30 additions and 12 deletions
+8
View File
@@ -1,4 +1,12 @@
---------------------------------------------------------------------------------------------------
Version: 1.1.4
Date: 2021-04-02
Bugfixes:
- Fix multiplayer incompatibility by clearing index on game version/mod version/config change
Locale:
- Added alerts to locale
- Customized alerts with localised name of entities
---------------------------------------------------------------------------------------------------
Version: 1.1.3
Date: 2021-03-29
Changes:
+11 -5
View File
@@ -2,7 +2,13 @@
--This mod scans the map for cars and gun-turrets and places alerts when they are low.
script.on_init(function (event)
-- car and turret index init
-- index init
global.turret_entities = {}
global.car_entities = {}
end)
script.on_configuration_changed(function (event)
-- index init fix
global.turret_entities = {}
global.car_entities = {}
end)
@@ -31,10 +37,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 +53,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
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Gun_Turret_Alerts",
"version": "1.1.3",
"version": "1.1.4",
"title": "Ammo Alerts",
"author": "Wyrrrd",
"factorio_version": "1.1",
+5 -1
View File
@@ -6,4 +6,8 @@ gun-turret-alerts-threshold=Grenze für wenig Munition
[mod-setting-description]
gun-turret-alerts-enabled=Aktiviert Alarme für Geschützturmmunition für deinen Spieler
gun-turret-alerts-car-enabled=Aktiviert Alarme für Fahrzeugmunition für deinen Spieler
gun-turret-alerts-threshold=Wenn ein Fahrzeug oder Geschützturm weniger als diese Anzahl Munition hat, wird ein Alarm zu deinem Spieler hinzugefügt
gun-turret-alerts-threshold=Wenn ein Fahrzeug oder Geschützturm weniger als diese Anzahl Munition hat, wird ein Alarm zu deinem Spieler hinzugefügt
[gun-turret-alerts]
message-empty=__1__ hat keine Munition
message-low=__1__ hat wenig Munition
+5 -1
View File
@@ -6,4 +6,8 @@ gun-turret-alerts-threshold=Low ammo threshold
[mod-setting-description]
gun-turret-alerts-enabled=Enables turret ammo alerts to be added to your player
gun-turret-alerts-car-enabled=Enables car ammo alerts to be added to your player
gun-turret-alerts-threshold=If a car or turret has less than this much ammo an alert will be added to your player
gun-turret-alerts-threshold=If a car or turret has less than this much ammo an alert will be added to your player
[gun-turret-alerts]
message-empty=__1__ out of ammo
message-low=__1__ ammo low
-4
View File
@@ -1,4 +0,0 @@
script.on_configuration_changed(function (event)
-- car index init fix
global.car_entities = {}
end)