Sorting of Items in Crafting Window

Place to get help with not working mods / modding interface.
Paned
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Mar 13, 2016 10:02 am
Contact:

Sorting of Items in Crafting Window

Post by Paned »

Hi there

i like to sort my Items at the Crafting Window.
I read much of it.. but most things are confusing me or just not what i am searching for..

The order at the item seams to only have affect at the sorting at the inventory.

how do i decide which crafting recipe is at the first line and which one is at the next and so on?
Attachments
mf.png
mf.png (215.81 KiB) Viewed 2660 times
User avatar
Ghoulish
Filter Inserter
Filter Inserter
Posts: 469
Joined: Fri Oct 16, 2015 8:40 am

Re: Sorting of Items in Crafting Window

Post by Ghoulish »

Currently this isn't possible, even with mods, most of the UI elements are hard coded.
See the daily™ struggles with my Factory! :D https://www.twitch.tv/repetitivebeats
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: Sorting of Items in Crafting Window

Post by orzelek »

It is possible to reorder items inside the category.
There are item groups and sub-groups that you can assign items into.

Each defined sub-group will start from new row in item display.

You can take a look at files in data/base/prototypes/item folder inside Factorio to see how it is done for base items.
Paned
Burner Inserter
Burner Inserter
Posts: 17
Joined: Sun Mar 13, 2016 10:02 am
Contact:

Re: Sorting of Items in Crafting Window

Post by Paned »

Thank you, that helped me out :)
But now i know the answer to my next question.. i think it is not possible to locate my recipe for iron-plate, copper-plate and steel-plate to my tab without moving the original ones to that tab too?

for everyone else with the same Problem, here is the code of my item-groups.lua file
just replace the my_name with the item-group/ subgroup you want

Code: Select all

data:extend(
{
  --item-group creation (for the new tab)
  {
    type = "item-group",
    name = "my_itemgroup", 
    icon = "__mymod__/graphics/group.png",
    icon_size = 128,
    inventory_order = "f",
    order = "e"
  },
 -- creation of the subgroups for my item-group (the letter at order decides in which line my items of that subgroup are displayed)
  {
    type = "item-subgroup",
    name = "my_pulver",
    group = "my_itemgroup", -- has to be the same as the name of the item-group to tell factorio that it is located in that tab
    order = "a"
  },
  {
    type = "item-subgroup",
    name = "my_craft",
    group = "my_itemgroup",
    order = "b"
  },
  {
    type = "item-subgroup",
    name = "my_chemie",
    group = "my_itemgroup",
    order = "c"
  },
  {
    type = "item-subgroup",
    name = "my_machines",
    group = "my_itemgroup",
    order = "d"
  }
})
and that is how it looks like:
Attachments
mf2.png
mf2.png (199.99 KiB) Viewed 2614 times
Post Reply

Return to “Modding help”