[0.17.41][API request] LuaGuiElement.add allow specifying direction for scroll-pane

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
lovely_santa
Filter Inserter
Filter Inserter
Posts: 502
Joined: Sat Feb 18, 2017 9:41 pm
Contact:

[0.17.41][API request] LuaGuiElement.add allow specifying direction for scroll-pane

Post by lovely_santa »

Hi,

I have 5 different UI's that I want to show an overview, but it could be quite long (for example configuration of the ForceField walls, a section could easly exist out of 50-ish walls, so 50 buttons next to each other). To make sure this is easy accessable in the UI, I create a scroll-pane and add a horizontal flow inside. This is how I've done it in 0.16 - where I learned creating GUIs. With the 0.17 debug options I learned alot from GUIs, and hence my request:
  • If I create a flow, I can define if it needs to stack its children horizontaly or verticaly.
  • If I create a frame, the game engine creates the actual visible frame, with a hidden flow inside. The API allows me to define the direction of the hidden flow in the creation of the frame.
  • If I create a scroll-pane, the API states:
    Factorio API wrote:Similar to a flow but includes the ability to show and use scroll bars.
    which the game engine creates a hidden vertical flow that can scroll, as shown in the picture. To add my horizontal buttons I have to add a horizontal flow inside instead.
screenshot.PNG
screenshot.PNG (552.99 KiB) Viewed 456 times

:arrow: My request is to expose the flow direction to the API just like is done with the frame, where we can define the direction of it:
New Factorio API wrote:
  • Other attributes may have to be specified, depending on type
    • scroll-pane
      • direction :: string: The initial direction of the scroll-pane's layout. See LuaGuiElement::direction.
      • horizontal_scroll_policy :: string (optional): Policy of the horizontal scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
      • vertical_scroll_policy :: string (optional): Policy of the vertical scroll bar, possible values are "auto" (default), "never", "always", "auto-and-reserve-space".
Kind regards,
lovely_santa
You can find all my mods on the mod portal. Also helping on Arch666Angel's mods.
Image

Post Reply

Return to “Modding interface requests”