diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4c4ffc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.zip diff --git a/README.md b/README.md index b3f25f5..105b360 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,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 ### 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 5a077cd..5b77c61 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,11 +1,16 @@ --------------------------------------------------------------------------------------------------- +Version: 0.18.9 +Date: 2020-03-29 + Features: + - Added integration with Factorio Wiki Mod (for german and english locales) +--------------------------------------------------------------------------------------------------- Version: 0.18.8 -Date: 6. 3. 2020 +Date: 2020-03-06 Changes: - Merged Informatron pages into single one --------------------------------------------------------------------------------------------------- Version: 0.18.7 -Date: 5. 3. 2020 +Date: 2020-03-05 Features: - Added integration with Informatron (for german and english locales) Changes: @@ -13,14 +18,14 @@ Date: 5. 3. 2020 - Added earlier check for setting "none" to prevent more code from running --------------------------------------------------------------------------------------------------- Version: 0.18.6 -Date: 27. 2. 2020 +Date: 2020-02-27 Changes: - Updated retroactive downgrade to be on par with this version Bugfixes: - Fixed empty filter check, so it checks all slots instead of just the first one --------------------------------------------------------------------------------------------------- Version: 0.18.5 -Date: 24. 2. 2020 +Date: 2020-02-24 Changes: - Added hidden dependency to Bob's Adjustable Inserters (fixes setting filter from wrong inventory when pickup location is rotated) - Added check for empty filter and whitelist mode to avoid overwriting filter on replacing preexisting inserters/ghosts @@ -29,14 +34,14 @@ Date: 24. 2. 2020 - Added translated mod description --------------------------------------------------------------------------------------------------- Version: 0.18.4 -Date: 23. 2. 2020 +Date: 2020-02-23 Changes: - Removed incompatibility with Upgrade Builder and Planner (see Bugfixes) Bugfixes: - Added additional check for entity type, since event filters are not applied to mod-raised events --------------------------------------------------------------------------------------------------- Version: 0.18.3 -Date: 23. 2. 2020 +Date: 2020-02-23 Changes: - Minor improvements (typos, code style) - Added incompatibility with Upgrade Builder and Planner (until crash is fixed, see https://mods.factorio.com/mod/Autofilter/discussion/5e5177cbf26569000bdd51eb) @@ -44,24 +49,24 @@ Date: 23. 2. 2020 - Changed thumbnail to the better --------------------------------------------------------------------------------------------------- Version: 0.18.2 -Date: 22. 2. 2020 +Date: 2020-02-22 Changes: - Matched changelog file format to what Factorio expects Info: - Also downgraded to Factorio 0.17, see below --------------------------------------------------------------------------------------------------- Version: 0.18.1 -Date: 22. 2. 2020 +Date: 2020-02-22 Bugfixes: - Added missing entity check (caused game crash on inserter placement without adjacent entity) --------------------------------------------------------------------------------------------------- Version: 0.18.0 -Date: 22. 2. 2020 +Date: 2020-02-22 Features: - Added automatic setting of filter on inserter placement - Added player mod setting to control mod behaviour --------------------------------------------------------------------------------------------------- Version: 0.17.0 -Date: 27. 2. 2020 +Date: 2020-02-27 Info: - Retroactive downgrade \ No newline at end of file diff --git a/control.lua b/control.lua index 34fe07a..0b40929 100644 --- a/control.lua +++ b/control.lua @@ -1,5 +1,6 @@ --control.lua require("integrations.informatron.control") +require("integrations.wiki.control") --functions definitions local function is_filter_empty(inserter) diff --git a/data.lua b/data.lua index 13980e6..1aeda22 100644 --- a/data.lua +++ b/data.lua @@ -1,2 +1,3 @@ --data.lua -require("integrations.informatron.data") \ No newline at end of file +require("integrations.informatron.data") +require("integrations.wiki.data") \ No newline at end of file diff --git a/integrations/informatron/thumbnail.png b/graphics/logo.png similarity index 100% rename from integrations/informatron/thumbnail.png rename to graphics/logo.png diff --git a/integrations/informatron/settings_contents.png b/graphics/settings_contents.png similarity index 100% rename from integrations/informatron/settings_contents.png rename to graphics/settings_contents.png diff --git a/integrations/informatron/settings_filter.png b/graphics/settings_filter.png similarity index 100% rename from integrations/informatron/settings_filter.png rename to graphics/settings_filter.png diff --git a/integrations/informatron/settings_none.png b/graphics/settings_none.png similarity index 100% rename from integrations/informatron/settings_none.png rename to graphics/settings_none.png diff --git a/info.json b/info.json index 956be9e..2013778 100644 --- a/info.json +++ b/info.json @@ -1,12 +1,13 @@ { "name": "Autofilter", - "version": "0.18.8", + "version": "0.18.9", "title": "Autofilter", "author": "Wyrrrd", "dependencies": [ "base >= 0.18.0", "(?) bobinserters >= 0.18.0", - "? informatron >= 0.1.5" + "? informatron >= 0.1.5", + "? wiki >= 0.18.01" ], "description": "Automatically set inserter filters based on adjacent inventory.", "factorio_version": "0.18" diff --git a/integrations/informatron/control.lua b/integrations/informatron/control.lua index 6373d01..b35f181 100644 --- a/integrations/informatron/control.lua +++ b/integrations/informatron/control.lua @@ -15,7 +15,7 @@ end function autofilter_page_content(page_name, player_index, element) if page_name == "autofilter" then - element.add{type="button", name="image_autofilter", style="autofilter_thumbnail"} + 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"} diff --git a/integrations/informatron/data.lua b/integrations/informatron/data.lua index 4a8101b..ad1acad 100644 --- a/integrations/informatron/data.lua +++ b/integrations/informatron/data.lua @@ -1,6 +1,6 @@ if mods["informatron"] then - informatron_make_image("autofilter_thumbnail", "__Autofilter__/integrations/informatron/thumbnail.png", 360, 156) - informatron_make_image("autofilter_settings_contents", "__Autofilter__/integrations/informatron/settings_contents.png", 400, 128) - informatron_make_image("autofilter_settings_filter", "__Autofilter__/integrations/informatron/settings_filter.png", 400, 128) - informatron_make_image("autofilter_settings_none", "__Autofilter__/integrations/informatron/settings_none.png", 400, 128) + informatron_make_image("autofilter_logo", "__Autofilter__/graphics/logo.png", 360, 156) + informatron_make_image("autofilter_settings_contents", "__Autofilter__/graphics/settings_contents.png", 400, 128) + informatron_make_image("autofilter_settings_filter", "__Autofilter__/graphics/settings_filter.png", 400, 128) + informatron_make_image("autofilter_settings_none", "__Autofilter__/graphics/settings_none.png", 400, 128) end \ No newline at end of file diff --git a/integrations/wiki/control.lua b/integrations/wiki/control.lua new file mode 100644 index 0000000..e786638 --- /dev/null +++ b/integrations/wiki/control.lua @@ -0,0 +1,10 @@ +require("integrations.wiki.wiki") + +if script.active_mods["wiki"] then + local initialize_wiki = function() + remote.call("wiki","register_mod_wiki",autofilter_wiki) + end + + script.on_init(function() initialize_wiki() end) + script.on_load(function() initialize_wiki() end) +end \ No newline at end of file diff --git a/integrations/wiki/data.lua b/integrations/wiki/data.lua new file mode 100644 index 0000000..afda419 --- /dev/null +++ b/integrations/wiki/data.lua @@ -0,0 +1,5 @@ +require("integrations.wiki.wiki") + +if mods["wiki"] then + wiki_register_mod_wiki(autofilter_wiki) +end \ No newline at end of file diff --git a/integrations/wiki/wiki.lua b/integrations/wiki/wiki.lua new file mode 100644 index 0000000..28bc484 --- /dev/null +++ b/integrations/wiki/wiki.lua @@ -0,0 +1,25 @@ +autofilter_wiki = +{ + name = "Autofilter", + title = "Autofilter", + mod_path = "__Autofilter__", + { + 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 = "line"}, + {type = "title", title = {"autofilter.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 = "line"}, + {type = "title", title = {"autofilter.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 = "line"}, + {type = "title", title = {"autofilter.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"} }, + } + } +} \ No newline at end of file