Skip to content

Commit

Permalink
Added wiki integration
Browse files Browse the repository at this point in the history
Also moved graphics to be used by both integrations
  • Loading branch information
Wyrrrd committed Mar 29, 2020
1 parent e6164a2 commit c36e55c
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.zip
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
25 changes: 15 additions & 10 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
---------------------------------------------------------------------------------------------------
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:
- Minor code readability improvements
- 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
Expand All @@ -29,39 +34,39 @@ 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)
Graphics:
- 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
1 change: 1 addition & 0 deletions control.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
--control.lua
require("integrations.informatron.control")
require("integrations.wiki.control")

--functions definitions
local function is_filter_empty(inserter)
Expand Down
3 changes: 2 additions & 1 deletion data.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--data.lua
require("integrations.informatron.data")
require("integrations.informatron.data")
require("integrations.wiki.data")
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
5 changes: 3 additions & 2 deletions info.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integrations/informatron/control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
8 changes: 4 additions & 4 deletions integrations/informatron/data.lua
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions integrations/wiki/control.lua
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions integrations/wiki/data.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require("integrations.wiki.wiki")

if mods["wiki"] then
wiki_register_mod_wiki(autofilter_wiki)
end
25 changes: 25 additions & 0 deletions integrations/wiki/wiki.lua
Original file line number Diff line number Diff line change
@@ -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"} },
}
}
}

0 comments on commit c36e55c

Please sign in to comment.