From 8aca2151bb52b75e1babbd7ca1876fed657fbbbd Mon Sep 17 00:00:00 2001 From: Adam Hellberg Date: Fri, 31 Mar 2023 01:33:37 +0200 Subject: [PATCH] Fix Nullius overwriting localised names Nullius modifies the names of some base items by writing to their `localised_name` property. This modification is done before the modified tables are copied and used by other mods (possibly depending on load order). As such, if mods use custom names from a `*.cfg` file, they will not be respected unless the mod also writes to the `localised_name` property in Lua code during the data stage. --- cybersyn/prototypes/entity.lua | 3 +++ cybersyn/prototypes/item.lua | 1 + 2 files changed, 4 insertions(+) diff --git a/cybersyn/prototypes/entity.lua b/cybersyn/prototypes/entity.lua index 7f597ad..92fc203 100644 --- a/cybersyn/prototypes/entity.lua +++ b/cybersyn/prototypes/entity.lua @@ -13,6 +13,9 @@ combinator_entity.radius_visualisation_specification = { } combinator_entity.active_energy_usage = "10KW" +if mods["nullius"] then + combinator_entity.localised_name = { "entity-name.cybersyn-combinator" } +end local COMBINATOR_SPRITE = "__cybersyn__/graphics/combinator/cybernetic-combinator.png" local COMBINATOR_HR_SPRITE = "__cybersyn__/graphics/combinator/hr-cybernetic-combinator.png" diff --git a/cybersyn/prototypes/item.lua b/cybersyn/prototypes/item.lua index a14d55a..7ed59e9 100644 --- a/cybersyn/prototypes/item.lua +++ b/cybersyn/prototypes/item.lua @@ -7,6 +7,7 @@ combinator_item.subgroup = data.raw["item"]["train-stop"].subgroup combinator_item.order = data.raw["item"]["train-stop"].order.."-b" combinator_item.place_result = COMBINATOR_NAME if mods["nullius"] then + combinator_item.localised_name = { "item-name.cybersyn-combinator" } -- Enable item in Nullius and place next to the regular train stop combinator_item.order = "nullius-eca" end