New gui element type: "player-inventory"
Posted: Thu May 10, 2018 7:06 am
What?
A gui element that contains the player inventory.
Why?
To mimic vanilla machine guis.
Explanation:
In the base game every time you open a machine gui you also additionally get a frame containing the player inventory so you can easily pick up items from it and drop them into a machine. But when trying to make a modded machine with a custom gui then currently i seem to have no other choice but to reimplement the whole thing in lua. Apart from that being a certain amount of work it can also not properly mimic the "vanilla inventory experience" for items with advanced tooltips/icons like blueprints/power-armor, as all mod-gui buttons are icon-based and carry no reference to the original item-stack.
As far as i can tell the "Character" gui frame is pretty much the same size and shape regardless of if you open a chest, roboport, assembler, yourself, or anything else. Thus width should be fixed to not mess up the row order. Height would need to be customizable to make it fit to the size of surrounding elements (i.e. vanilla chest gui / player crafting view).
The new gui element should also include all vanilla button interactions (take/filter/open).
A gui element that contains the player inventory.
Why?
To mimic vanilla machine guis.
Explanation:
In the base game every time you open a machine gui you also additionally get a frame containing the player inventory so you can easily pick up items from it and drop them into a machine. But when trying to make a modded machine with a custom gui then currently i seem to have no other choice but to reimplement the whole thing in lua. Apart from that being a certain amount of work it can also not properly mimic the "vanilla inventory experience" for items with advanced tooltips/icons like blueprints/power-armor, as all mod-gui buttons are icon-based and carry no reference to the original item-stack.
As far as i can tell the "Character" gui frame is pretty much the same size and shape regardless of if you open a chest, roboport, assembler, yourself, or anything else. Thus width should be fixed to not mess up the row order. Height would need to be customizable to make it fit to the size of surrounding elements (i.e. vanilla chest gui / player crafting view).
The new gui element should also include all vanilla button interactions (take/filter/open).