Factorio Wiki Mod


Common Wiki GUI interface for mods.

3 months ago
0.18
1159
Owner:
btarrant
Source:
pixelwhipped/ModMash
Homepage:
N/A
License:
GNU GPLv3
Created:
3 months ago
Latest Version:
0.18.05 (3 months ago)
Factorio version:
0.18
Downloaded:
1159 times


Discord

Factorio Wiki Mod


Factorio Wiki Mod provides a re-usable Wiki Interface. This mod's concept has an obvious source of inspiration but is designed to be simply added as a mod requirement which then allows calls to a function or remote interface in the Data and Control stage to populate the Wiki.

Changes


Reworked the base code and now you can add custom elements
In your topic you can now add something like

    {type = "custom", interface = "modmash", func = "test"}

and register in on_init and on_load a remote interface
example

     remote.add_interface("modmash",{test = test})

what this will do is call the function test passing it a horizontal flow element to work with when generating the wiki description

Example wiki.lua


modmash_wiki = 
{
    name = "modmash",  --mod name
    title    = "ModMash",   --title shown in mod filter
    {
        name = {"gui.modmash-wiki-topic-main"},  --This is a topic defined in local.cfg under [gui]
        topic = {  -- the topic details
            {type = "title", title = {"gui.modmash-wiki-topic-main-title"} },  --a localized title
            {type = "line"},  --a simple line
            {               
                type = "image",   --an image
                name = "mm-topic-main-img-1",
                filepath = "__modmash__/graphics/wiki/thumbnail.png",
                width = 144,
                height = 144,
                scale = 1
            },
            {type = "text", text = "Some Text Here"} -- some non localized text
        }
    }
}

Example control.lua


local initialize_wiki = function()
    remote.call("wiki","register_mod_wiki",modmash_wiki)
    end

script.on_init(function() initialize_wiki() end)
script.on_load(function() initialize_wiki() end)

Example data.lua


require("wiki") 
wiki_register_mod_wiki(modmash_wiki)

Credit


Note though different and parts re-written this code is derived from Krastorio 2

Other Mods


https://mods.factorio.com/mod/modmash
https://mods.factorio.com/mod/mininukes
https://mods.factorio.com/mod/spaghetti
https://mods.factorio.com/mod/coffee