Tab container for storage

Place to get help with not working mods / modding interface.
User avatar
Phakx
Inserter
Inserter
Posts: 32
Joined: Sun Sep 07, 2014 8:57 pm
Contact:

Tab container for storage

Post by Phakx »

For the idea to build a storage for better organisation.

if you open the building interface there should be a small storage window and on the upper side there are some tabs with which you could browse through the storage parts. is there a mod or coding for that? help me please :D
Check out my "TrueBuildings" - Mod
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Tab container for storage

Post by FreeER »

modifying (or replacing) the GUIs used by the game (ie, the inventory management system) isn't actually possible. However,

Theoretically it might be possible to use the GUIs Factorio does provide access to (see the wiki Lua/Gui page) similar to how the testing mode mod gives a list of items to spawn in (except you'd do it by a listing of what that container has). I believe (but haven't tested) it is possible to prevent the opening of the normal gui for entities by setting their operable property to false (during runtime, so probably through the onentitybuilt event), at which point you'd just need to know when the player wants to open the container so that you can create the gui (which can be done with the onputitem event by scanning the provided position (player clicks with an item to open their chests), or by scanning the game.player.cursorposition in which case game.player.screen2realposition might be useful (player hovers mouse over chests). And by scan I mean game.findentities[filtered]).

edit: if you mean for the inventory menu where the player crafts things then...that's a bit easier, you'd have to make a mod that uses data.raw to overwrite all of the "subgroup" properties for item prototypes. data.raw.item["item_name"].subgroup = "name_of_desired_subgroup", subgroups are just prototypes defined as seen in data\base\prototypes\item\item-groups.lua. The rest of the code for that feature is hardcoded.
User avatar
Phakx
Inserter
Inserter
Posts: 32
Joined: Sun Sep 07, 2014 8:57 pm
Contact:

Re: Tab container for storage

Post by Phakx »

That was my though too. The problem will be the entity who doesn't know in which container they put their items.
I thought that this storage should only be used by the player itself. I try to do some coding and hope it works. I let you know, if i got something ;)
Check out my "TrueBuildings" - Mod
Post Reply

Return to “Modding help”