From efe954b7002f3131a0157643c1a68603627e9cbb Mon Sep 17 00:00:00 2001 From: Brevven Date: Fri, 5 Nov 2021 22:29:39 -0700 Subject: [PATCH] compatible with k2 beta --- changelog.txt | 6 ++++++ data-util.lua | 7 +++++++ info.json | 2 +- titanium-enriched.lua | 2 +- titanium-matter.lua | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 6ea0665..4cd5ba6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,10 @@ --------------------------------------------------------------------------------------------------- +Version: 1.0.0 +Date: 2021-11-06 + Changes: + - Arbitrary decision to mark 1.0, as features have been stable for a time. + - K2: Beta compatibility +--------------------------------------------------------------------------------------------------- Version: 0.12.7 Date: 2021-10-11 Fixes: diff --git a/data-util.lua b/data-util.lua index e6e7451..03359d2 100644 --- a/data-util.lua +++ b/data-util.lua @@ -22,6 +22,13 @@ function util.get_stack_size(default) return default end +function util.k2assets() + if mods["Krastorio2Assets"] then + return "__Krastorio2Assets__" + end + return "__Krastorio2__/graphics" +end + -- check if a table contains a sought value function util.contains(table, sought) for i, value in pairs(table) do diff --git a/info.json b/info.json index 3676c26..c375ba9 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bztitanium", - "version": "0.12.5", + "version": "1.0.0", "factorio_version": "1.1", "title": "Titanium", "author": "Brevven", diff --git a/titanium-enriched.lua b/titanium-enriched.lua index 7853ef2..435451d 100644 --- a/titanium-enriched.lua +++ b/titanium-enriched.lua @@ -79,7 +79,7 @@ data:extend( icons = { { - icon = "__Krastorio2__/graphics/technologies/enriched-ores.png", + icon = util.k2assets().."/technologies/enriched-ores.png", icon_size = 256, tint = { a=1.0, b=0.75, r=0.75, g=0.75 } }, diff --git a/titanium-matter.lua b/titanium-matter.lua index 62c7c0e..637d1c4 100644 --- a/titanium-matter.lua +++ b/titanium-matter.lua @@ -11,7 +11,7 @@ data:extend( icons = { { - icon = "__Krastorio2__/graphics/technologies/matter-stone.png", + icon = util.k2assets().."/technologies/matter-stone.png", icon_size = 256, }, {