Index: ./aai-programmable-vehicles_0.5.4/prototypes/entity/entity-update.lua =================================================================== --- ./aai-programmable-vehicles_0.5.4/prototypes/entity/entity-update.lua (date 0) +++ entity-update.lua (date 1554404836293) @@ -6,6 +6,12 @@ local show_navigator = false +-- hacked function to get the right icon +local function icon_getter(object) + if object.icon then return {{icon=object.icon}} end + if object.icons then return object.icons end +end + -- energy per hitpoint is the impact damage multiplier for _,vehicle in pairs(data.raw.car) do local multiplier = vehicle_impact_low @@ -116,7 +122,8 @@ -- this is the ai driver local driver = table.deepcopy(data.raw.player.player) - driver.icon = vehicle.icon + --driver.icon = vehicle.icon + driver.icons = icon_getter(vehicle) driver.alert_when_damaged = true driver.selectable_in_game = false driver.localised_name = localised_name @@ -132,7 +139,8 @@ { type = "unit", name = vehicle.name.. data_util.composite_suffix.."navigator", - icon = vehicle.icon, + -- icon = vehicle.icon, + icons = icon_getter(vehicle), icon_size = 32, flags = {"placeable-neutral", "placeable-off-grid"}, selectable_in_game = false, @@ -205,7 +213,8 @@ { type = "simple-entity", name = vehicle.name.. data_util.composite_suffix.."buffer", - icon = vehicle.icon, + --icon = vehicle.icon, + icons = icon_getter(vehicle), icon_size = 32, flags = {"placeable-neutral", "placeable-off-grid"}, subgroup = "grass", @@ -229,22 +238,33 @@ type = "virtual-signal", name = vehicle.name.. data_util.composite_suffix.."signal", --icon = vehicle.icon, - icons = { - { - icon = "__aai-programmable-vehicles__/graphics/icons/ids/id_background.png" - }, - { - icon = vehicle.icon - }, - { - icon = "__aai-programmable-vehicles__/graphics/icons/ids/id_overlay.png" - }, - }, +-- icons = { +-- { +-- icon = "__aai-programmable-vehicles__/graphics/icons/ids/id_background.png" +-- }, +-- { +-- icon = vehicle.icon +-- }, +-- { +-- icon = "__aai-programmable-vehicles__/graphics/icons/ids/id_overlay.png" +-- }, +-- }, icon_size = 32, subgroup = "vehicle-ids", order = "a[vehicle]", localised_name = { "vehicle-signal", localised_name} } + + -- hacked workaround for icons + local generated_icon = {} + table.insert(generated_icon, {icon = "__aai-programmable-vehicles__/graphics/icons/ids/id_background.png"}) + for _, icon in pairs(icon_getter(vehicle)) do + table.insert(generated_icon, icon) + end + table.insert(generated_icon, {icon = "__aai-programmable-vehicles__/graphics/icons/ids/id_overlay.png"}) + virtual_signal.icons = generated_icon + -- ---------------- + data:extend{ virtual_signal } end