1
0
mirror of https://github.com/Wyrrrd/Gun_Turret_Alerts.git synced 2026-06-30 12:05:44 +02:00

Compare commits

..

3 Commits

Author SHA1 Message Date
Wyrrrd db141f81ca Icon meta changes 2021-03-29 08:50:35 +02:00
Wyrrrd 1eb12f0f28 Merge pull request #2 from snouz/master
New ammo icons, new thumbnail
2021-03-29 06:44:45 +00:00
snouz eb3b6cf0e6 graphics
-mod icon
-actual yellow and red ammo alerts (yellow derivated from existing vanilla ammo alert)
2021-03-29 01:24:55 +02:00
9 changed files with 27 additions and 7 deletions
+2 -1
View File
@@ -5,4 +5,5 @@
Adds alerts when a car or gun turret is out of ammo or has low ammo.
### Credit
Thanks to [unhott](https://mods.factorio.com/user/unhott) for the [original mod](https://mods.factorio.com/mod/GunTurretAlerts).
Thanks to [unhott](https://mods.factorio.com/user/unhott) for the [original mod](https://mods.factorio.com/mod/GunTurretAlerts).
Thanks to [snouz](https://mods.factorio.com/user/snouz) for the new icons and thumbnail.
+5
View File
@@ -1,4 +1,9 @@
---------------------------------------------------------------------------------------------------
Version: 1.1.3
Date: 2021-03-29
Changes:
- Icon and message overhaul (by snouz)
---------------------------------------------------------------------------------------------------
Version: 1.1.2
Date: 2021-03-28
Bugfixes:
+4 -5
View File
@@ -31,15 +31,14 @@ 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 = "item", name = "piercing-rounds-magazine"}, "Out of ammo", true)
player.add_custom_alert(turret_entity, {type = "virtual", name = "ammo-icon-red"}, "Turret out of ammo", true)
elseif inv_var[1].count < player_threshold then
-- low ammo alert
player.add_custom_alert(turret_entity, {type = "item", name = "firearm-magazine"}, "Ammo low", true)
player.add_custom_alert(turret_entity, {type = "virtual", name = "ammo-icon-yellow"}, "Turret ammo low", true)
end
end
end
end
if GTA_car_enabled and car_entities then
for _,car_entity in pairs(car_entities) do
@@ -48,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 = "item", name = "piercing-rounds-magazine"}, "Out of ammo", true)
player.add_custom_alert(car_entity, {type = "virtual", name = "ammo-icon-red"}, "Car out of ammo", true)
elseif inv_var[1].count < player_threshold then
-- low ammo alert
player.add_custom_alert(car_entity, {type = "item", name = "firearm-magazine"}, "Ammo low", true)
player.add_custom_alert(car_entity, {type = "virtual", name = "ammo-icon-yellow"}, "Car ammo low", true)
end
end
end
+1
View File
@@ -1 +1,2 @@
--data.lua
require("prototypes.signals")
Binary file not shown.

After

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Gun_Turret_Alerts",
"version": "1.1.2",
"version": "1.1.3",
"title": "Ammo Alerts",
"author": "Wyrrrd",
"factorio_version": "1.1",
+14
View File
@@ -0,0 +1,14 @@
data:extend({
{
type = "virtual-signal",
name = "ammo-icon-red",
icon = "__Gun_Turret_Alerts__/graphics/ammo-icon-red.png",
icon_size = 64,
},
{
type = "virtual-signal",
name = "ammo-icon-yellow",
icon = "__Gun_Turret_Alerts__/graphics/ammo-icon-yellow.png",
icon_size = 64,
}
})
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 23 KiB