Where and how to change maximum allowed vertical size of inventory window?
Console command? Config string?
More detailed explanation, why I want it:
When I play vanilla mode inventory window have reasonable size.
As soon as I try to play with mods (like Bob's or Angel's) inventory window grows from top of the screen to its bottom and obscure all surrounding. If I play a little more, a vertical scrollbar appears in inventory.
Since scrolling for this window works well, I think there should be a way to limit it vertical size to something more comfortable.
I was searching around forums but did not found answer, and did not managed to find correct parameter in Factorio API. I suppose it's near game.player.inventory, but did not found exact variable name.
inventory window height - how to modify it?
Re: inventory window height - how to modify it?
No one knows? Or it's technically difficult?
I thought all interface windows have some properties, like current height. For inventory it's probably recalculated every time when something adds a new recipe to available list. But there should be maximum allowed height, that is probably calculated at the moment when whole interface is created or resized. As soon as current inventory height becomes greater then max.allowed a scroll bar appears. So parameter I'm looking for probably should be called like "maximum allowed visible height of inventory window".
It might be not visible from LUA code, but that is less likely, because, as I know, almost all Factorio code is written on LUA, with some exceptions on C++. Correct?
I thought all interface windows have some properties, like current height. For inventory it's probably recalculated every time when something adds a new recipe to available list. But there should be maximum allowed height, that is probably calculated at the moment when whole interface is created or resized. As soon as current inventory height becomes greater then max.allowed a scroll bar appears. So parameter I'm looking for probably should be called like "maximum allowed visible height of inventory window".
It might be not visible from LUA code, but that is less likely, because, as I know, almost all Factorio code is written on LUA, with some exceptions on C++. Correct?
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: inventory window height - how to modify it?
Alsmost all of factorio is written in C++, with some exceptions written in LUA.Dixi wrote:It might be not visible from LUA code, but that is less likely, because, as I know, almost all Factorio code is written on LUA, with some exceptions on C++. Correct?
The base gui components are not accessible for mods or console commands.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: inventory window height - how to modify it?
... but, as the devs are working on a gui rewrite, I hope this will change with the new gui
Koub - Please consider English is not my native language.
Re: inventory window height - how to modify it?
Looking in Factorio API.
There is a class LuaStyle, that has property
maximal_height :: int [RW]
There is a reference there to LuaGuiElement, and sample
game.player.gui.<main_Inventory?>.style.maximal_height = 300
that might work. Will it?
The problem is I dunno how graphical interface designed. When I open an inventory in the game, is it one big window with 3 child windows "Inventory", "Logistic", "Crafting" attached to it? Or it's 3 different clipped windows? And graphical tab icons in Crafting, do they linked to corresponding LuaGuiElement, and just setting it visible?
Maybe someone saw a scheme in API guide? I did not found it yet.
There is a class LuaStyle, that has property
maximal_height :: int [RW]
There is a reference there to LuaGuiElement, and sample
I suppose if I find correct name for player inventory window and write something likegame.player.gui.top.add{type="label", name="greeting", caption="Hi"}
game.player.gui.top.greeting.caption = "Hello there!"
game.player.gui.top["greeting"].caption = "Actually, nevermind, I don't like your face"
game.player.gui.<main_Inventory?>.style.maximal_height = 300
that might work. Will it?
The problem is I dunno how graphical interface designed. When I open an inventory in the game, is it one big window with 3 child windows "Inventory", "Logistic", "Crafting" attached to it? Or it's 3 different clipped windows? And graphical tab icons in Crafting, do they linked to corresponding LuaGuiElement, and just setting it visible?
Maybe someone saw a scheme in API guide? I did not found it yet.
Re: inventory window height - how to modify it?
The core game GUIs aren't done through the mod-accessible GUI system and as such you don't have access to change them through mods. The core game GUIs have a ton of non-game-state information that would trigger desyncs if any mod tried to us that information among other reasons.Dixi wrote:Looking in Factorio API.
There is a class LuaStyle, that has property
maximal_height :: int [RW]
There is a reference there to LuaGuiElement, and sampleI suppose if I find correct name for player inventory window and write something likegame.player.gui.top.add{type="label", name="greeting", caption="Hi"}
game.player.gui.top.greeting.caption = "Hello there!"
game.player.gui.top["greeting"].caption = "Actually, nevermind, I don't like your face"
game.player.gui.<main_Inventory?>.style.maximal_height = 300
that might work. Will it?
The problem is I dunno how graphical interface designed. When I open an inventory in the game, is it one big window with 3 child windows "Inventory", "Logistic", "Crafting" attached to it? Or it's 3 different clipped windows? And graphical tab icons in Crafting, do they linked to corresponding LuaGuiElement, and just setting it visible?
Maybe someone saw a scheme in API guide? I did not found it yet.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5206
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: inventory window height - how to modify it?
@Koub
@Rseding91
I thought about it and in a kinda-sorta-roundabouter fashion this is already possible. But due to current layout ofc horribly breaks other stuff:
Even the base GUIs use data.raw['gui-style'].default for their styles, so can enforce a maximal_height on those styles in the data stage. On a quick look it didn't seem like the inventory has a unique style though so changing it breaks other stuff.
@Rseding91
I thought about it and in a kinda-sorta-roundabouter fashion this is already possible. But due to current layout ofc horribly breaks other stuff:
Even the base GUIs use data.raw['gui-style'].default for their styles, so can enforce a maximal_height on those styles in the data stage. On a quick look it didn't seem like the inventory has a unique style though so changing it breaks other stuff.
Code: Select all
for k,v in next, gui do
if v.type == 'frame_style' then --didn't bother to test all styles seperately
print(k)
v.maximal_height = 300
end
end
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.