diff --git a/README.md b/README.md index 105b360..1f53867 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ This mod should work with all modded filter inserters, but I specifically added + [Bob's Adjustable Inserters](https://mods.factorio.com/mod/bobinserters) - rotated pickup positions + [Informatron](https://mods.factorio.com/mod/informatron) - informational page to explain modes + [Factorio Wiki Mod](https://mods.factorio.com/mod/wiki) - informational topic to explain modes ++ [Booktorio](https://mods.factorio.com/mod/Booktorio) - informational thread to explain modes ### Locale If you want to contribute by translating this mod, you can view the existing translations [here](https://github.com/Wyrrrd/Autofilter/tree/master/locale). I'd be happy to add your language and credits to the next release. \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 5b77c61..ece1839 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.18.10 +Date: 2020-04-03 + Features: + - Added integration with Booktorio (for german and english locales) +--------------------------------------------------------------------------------------------------- Version: 0.18.9 Date: 2020-03-29 Features: diff --git a/control.lua b/control.lua index 0b40929..0d3f9c5 100644 --- a/control.lua +++ b/control.lua @@ -1,6 +1,7 @@ --control.lua require("integrations.informatron.control") require("integrations.wiki.control") +require("integrations.Booktorio.control") --functions definitions local function is_filter_empty(inserter) diff --git a/data.lua b/data.lua index 1aeda22..e36c0c2 100644 --- a/data.lua +++ b/data.lua @@ -1,3 +1,4 @@ --data.lua require("integrations.informatron.data") -require("integrations.wiki.data") \ No newline at end of file +require("integrations.wiki.data") +require("integrations.Booktorio.data") \ No newline at end of file diff --git a/info.json b/info.json index 2013778..666f605 100644 --- a/info.json +++ b/info.json @@ -1,11 +1,12 @@ { "name": "Autofilter", - "version": "0.18.9", + "version": "0.18.10", "title": "Autofilter", "author": "Wyrrrd", "dependencies": [ "base >= 0.18.0", "(?) bobinserters >= 0.18.0", + "? Booktorio >= 1.1.0", "? informatron >= 0.1.5", "? wiki >= 0.18.01" ], diff --git a/integrations/Booktorio/control.lua b/integrations/Booktorio/control.lua new file mode 100644 index 0000000..d5724d7 --- /dev/null +++ b/integrations/Booktorio/control.lua @@ -0,0 +1,41 @@ +local autofilter_thread = +{ + name = {"autofilter.menu_autofilter"}, + specified_version = 0, + topics = + { + { + name = {"autofilter.title_autofilter"}, + topic = + { + {type = "image", spritename = "autofilter-logo"}, + {type = "text", text = "info.page_autofilter_text"} + } + }, + { + name = {"info.page_modes_heading"}, + topic = + { + {type = "title", title = {"info.page_modes_heading"}}, + {type = "subtitle", subtitle = {"info.page_contents_heading"}}, + {type = "image", spritename = "autofilter-settings-contents"}, + {type = "text", text = "info.page_contents_text"}, + {type = "subtitle", subtitle = {"info.page_filter_heading"}}, + {type = "image", spritename = "autofilter-settings-filter"}, + {type = "text", text = "info.page_filter_text"}, + {type = "subtitle", subtitle = {"info.page_none_heading"}}, + {type = "image", spritename = "autofilter-settings-none"}, + {type = "text", text = "info.page_none_text"} + } + } + } +} + +local function registerThread() + if remote.interfaces["Booktorio"] then + remote.call("Booktorio", "add_thread", autofilter_thread) + end +end + +script.on_init(registerThread) +script.on_configuration_changed(registerThread) \ No newline at end of file diff --git a/integrations/Booktorio/data.lua b/integrations/Booktorio/data.lua new file mode 100644 index 0000000..a0bdaad --- /dev/null +++ b/integrations/Booktorio/data.lua @@ -0,0 +1,37 @@ +if mods["Booktorio"] then + data:extend( + { + { + type = "sprite", + name = "autofilter-logo", + filename = "__Autofilter__/graphics/logo.png", + width = 360, + height = 156, + scale = 1 + }, + { + type = "sprite", + name = "autofilter-settings-contents", + filename = "__Autofilter__/graphics/settings_contents.png", + width = 400, + height = 128, + scale = 1 + }, + { + type = "sprite", + name = "autofilter-settings-filter", + filename = "__Autofilter__/graphics/settings_filter.png", + width = 400, + height = 128, + scale = 1 + }, + { + type = "sprite", + name = "autofilter-settings-none", + filename = "__Autofilter__/graphics/settings_none.png", + width = 400, + height = 128, + scale = 1 + } + }) +end \ No newline at end of file diff --git a/integrations/informatron/control.lua b/integrations/informatron/control.lua index b35f181..5822217 100644 --- a/integrations/informatron/control.lua +++ b/integrations/informatron/control.lua @@ -16,16 +16,16 @@ end function autofilter_page_content(page_name, player_index, element) if page_name == "autofilter" then element.add{type="button", name="image_autofilter", style="autofilter_logo"} - element.add{type="label", name="text_autofilter", caption={"autofilter.page_autofilter_text"}} - element.add{type="label", name="heading_modes", caption={"autofilter.page_modes_heading"}, style="heading_1_label"} - element.add{type="label", name="heading_contents", caption={"autofilter.page_contents_heading"}, style="heading_2_label"} + element.add{type="label", name="text_autofilter", caption={"info.page_autofilter_text"}} + element.add{type="label", name="heading_modes", caption={"info.page_modes_heading"}, style="heading_1_label"} + element.add{type="label", name="heading_contents", caption={"info.page_contents_heading"}, style="heading_2_label"} element.add{type="button", name="image_contents", style="autofilter_settings_contents"} - element.add{type="label", name="text_contents", caption={"autofilter.page_contents_text"}} - element.add{type="label", name="heading_filter", caption={"autofilter.page_filter_heading"}, style="heading_2_label"} + element.add{type="label", name="text_contents", caption={"info.page_contents_text"}} + element.add{type="label", name="heading_filter", caption={"info.page_filter_heading"}, style="heading_2_label"} element.add{type="button", name="image_filter", style="autofilter_settings_filter"} - element.add{type="label", name="text_filter", caption={"autofilter.page_filter_text"}} - element.add{type="label", name="heading_none", caption={"autofilter.page_none_heading"}, style="heading_2_label"} + element.add{type="label", name="text_filter", caption={"info.page_filter_text"}} + element.add{type="label", name="heading_none", caption={"info.page_none_heading"}, style="heading_2_label"} element.add{type="button", name="image_none", style="autofilter_settings_none"} - element.add{type="label", name="text_none", caption={"autofilter.page_none_text"}} + element.add{type="label", name="text_none", caption={"info.page_none_text"}} end end \ No newline at end of file diff --git a/integrations/wiki/wiki.lua b/integrations/wiki/wiki.lua index 28bc484..2a2d27a 100644 --- a/integrations/wiki/wiki.lua +++ b/integrations/wiki/wiki.lua @@ -7,19 +7,19 @@ autofilter_wiki = name = {"autofilter.title_autofilter"}, topic = { {type = "image", name = "image_autofilter", filepath = "__Autofilter__/graphics/logo.png", width = 360, height = 156, scale = 1}, - {type = "text", text = {"autofilter.page_autofilter_text"} }, + {type = "text", text = {"info.page_autofilter_text"} }, {type = "line"}, - {type = "title", title = {"autofilter.page_contents_heading"} }, + {type = "title", title = {"info.page_contents_heading"} }, {type = "image", name = "image_contents", filepath = "__Autofilter__/graphics/settings_contents.png", width = 400, height = 128, scale = 0.9}, - {type = "text", text = {"autofilter.page_contents_text"} }, + {type = "text", text = {"info.page_contents_text"} }, {type = "line"}, - {type = "title", title = {"autofilter.page_filter_heading"} }, + {type = "title", title = {"info.page_filter_heading"} }, {type = "image", name = "image_filter", filepath = "__Autofilter__/graphics/settings_filter.png", width = 400, height = 128, scale = 0.9}, - {type = "text", text = {"autofilter.page_filter_text"} }, + {type = "text", text = {"info.page_filter_text"} }, {type = "line"}, - {type = "title", title = {"autofilter.page_none_heading"} }, + {type = "title", title = {"info.page_none_heading"} }, {type = "image", name = "image_none", filepath = "__Autofilter__/graphics/settings_none.png", width = 400, height = 128, scale = 0.9}, - {type = "text", text = {"autofilter.page_none_text"} }, + {type = "text", text = {"info.page_none_text"} }, } } } \ No newline at end of file diff --git a/locale/de/strings.cfg b/locale/de/strings.cfg index d869e24..4e8d44a 100644 --- a/locale/de/strings.cfg +++ b/locale/de/strings.cfg @@ -15,6 +15,8 @@ autofilter_mode-none=Keiner [autofilter] menu_autofilter=Autofilter title_autofilter=Autofilter + +[info] page_autofilter_text=Diese Mod sorgt dafür, dass Greifarmfilter beim manuellen Platzieren automatischgesetzt werden, basierend auf dem angrenzenden Inventar. Der Modus, nachdem die Gegenstände für den Filter ausgewählt werden, kann in den Spieler-Mod-Einstellungen während des Spiels angepasst werden. page_modes_heading=Modus page_contents_heading=Inhalt diff --git a/locale/en/strings.cfg b/locale/en/strings.cfg index f5751a7..c9ad7a1 100644 --- a/locale/en/strings.cfg +++ b/locale/en/strings.cfg @@ -15,6 +15,8 @@ autofilter_mode-none=None [Autofilter] menu_autofilter=Autofilter title_autofilter=Autofilter + +[info] page_autofilter_text=This mod causes inserter filters to be set automatically on manual placement, based on the adjacent inventory. The modus, which specifies the items used for the filter, can be changed on the fly in player mod settings. page_modes_heading=Modus page_contents_heading=Contents