diff --git a/control.lua b/control.lua index 879a685..20cd7b2 100644 --- a/control.lua +++ b/control.lua @@ -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 diff --git a/data.lua b/data.lua index bcc4f19..0487fae 100644 --- a/data.lua +++ b/data.lua @@ -1 +1,2 @@ --data.lua +require("prototypes.signals") \ No newline at end of file diff --git a/graphics/ammo-icon-red.png b/graphics/ammo-icon-red.png new file mode 100644 index 0000000..91cd7b5 Binary files /dev/null and b/graphics/ammo-icon-red.png differ diff --git a/graphics/ammo-icon-yellow.png b/graphics/ammo-icon-yellow.png new file mode 100644 index 0000000..642e9f4 Binary files /dev/null and b/graphics/ammo-icon-yellow.png differ diff --git a/prototypes/signals.lua b/prototypes/signals.lua new file mode 100644 index 0000000..cd6cc01 --- /dev/null +++ b/prototypes/signals.lua @@ -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, + } +}) diff --git a/thumbnail.png b/thumbnail.png index 9061d76..5af3cff 100644 Binary files a/thumbnail.png and b/thumbnail.png differ