From 357babf46b7b8c0647e001eb4a7a964da3dea4c3 Mon Sep 17 00:00:00 2001 From: Brevven Date: Fri, 5 Nov 2021 22:54:35 -0700 Subject: [PATCH] k2 beta --- changelog.txt | 5 +++++ data-util.lua | 7 +++++++ info.json | 5 ++--- tungsten-matter.lua | 3 ++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index fbbe09c..b5f4028 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.4.0 +Date: 2021-11-06 + Changes: + - K2: Beta compatibility +--------------------------------------------------------------------------------------------------- Version: 0.3.8 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 637417a..eb05303 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,5 @@ -{ - "name": "bztungsten", - "version": "0.3.8", +{ "name": "bztungsten", + "version": "0.4.0", "factorio_version": "1.1", "title": "Tungsten", "author": "Brevven", diff --git a/tungsten-matter.lua b/tungsten-matter.lua index 57e050a..ab3d57a 100644 --- a/tungsten-matter.lua +++ b/tungsten-matter.lua @@ -1,5 +1,6 @@ -- Matter recipes for Krastorio2 if mods["Krastorio2"] then +local util = require("__bztungsten__.data-util"); local matter = require("__Krastorio2__/lib/public/data-stages/matter-util") data:extend( @@ -10,7 +11,7 @@ data:extend( icons = { { - icon = "__Krastorio2__/graphics/technologies/matter-stone.png", + icon = util.k2assets().."/technologies/matter-stone.png", icon_size = 256, }, {