Page 1 of 1

[solved] scroll-pane and radiobutton not in API docs

Posted: Thu Sep 15, 2016 4:04 pm
by aubergine18
There are two big chunks of text near top of this page that list all the GUI element types, but neither mention scroll-pane or radiobutton: http://lua-api.factorio.com/latest/LuaGuiElement.html

Note: scroll-pane is mentioned way down near the bottom of the page, but barely noticeable unless reading all the property descriptions carefully

Prior to realising that there was a specific 'scroll-pane' type, upon reading the API docs page linked above I always had the impression that scrollbars were something that could be added to any frame or flow simply by setting the scroll policies on those things, which in turn is why I always thought those options were broken - I didn't realise they were specific to special 'scroll-pane' elements.

Re: scroll-pane and radiobutton not in API docs

Posted: Sun Sep 18, 2016 4:16 pm
by Mooncat
Is radiobutton really a thing!? :shock:

Anyway, according to my experience, this thread is going to be moved to the bug reports zone. :lol:

Re: scroll-pane and radiobutton not in API docs

Posted: Sun Sep 18, 2016 5:02 pm
by Rseding91
Mooncat wrote:Is radiobutton really a thing!? :shock:

Anyway, according to my experience, this thread is going to be moved to the bug reports zone. :lol:
I already fixed it :P if you refresh the link.

Re: scroll-pane and radiobutton not in API docs

Posted: Sun Sep 18, 2016 5:40 pm
by Mooncat
Rseding91 wrote:
Mooncat wrote:Is radiobutton really a thing!? :shock:

Anyway, according to my experience, this thread is going to be moved to the bug reports zone. :lol:
I already fixed it :P if you refresh the link.
That's great! Wow, I don't know we also have "sprite". :o
Would you mind also add their required attributes to the add function please? :P

Re: scroll-pane and radiobutton not in API docs

Posted: Sun Sep 18, 2016 5:46 pm
by Rseding91
Mooncat wrote:
Rseding91 wrote:
Mooncat wrote:Is radiobutton really a thing!? :shock:

Anyway, according to my experience, this thread is going to be moved to the bug reports zone. :lol:
I already fixed it :P if you refresh the link.
That's great! Wow, I don't know we also have "sprite". :o
Would you mind also add their required attributes to the add function please? :P
I did, scroll pane has none and sprite is done through the style.

Re: scroll-pane and radiobutton not in API docs

Posted: Sun Sep 18, 2016 6:00 pm
by Mooncat
Oh, I missed "radio-button" in the middle. :lol: And I thought "sprite" should be similar to "sprite-button".
I think I will need to find an example for the sprite style. Thanks for the explanation. :D

Re: scroll-pane and radiobutton not in API docs

Posted: Sun Sep 18, 2016 7:55 pm
by aubergine18
Wait, there's a 'sprite' now? Which version was that introduced?

EDIT: Is there a distinct style sheet prototype format for sprites?

Re: scroll-pane and radiobutton not in API docs

Posted: Mon Sep 19, 2016 7:49 am
by bobingabout
I personally found the radio button options while looking at some of the base game code, but decided to use checkbox style instead.
As for the scrole-pane? I had heard mention of it being added, but haven't seen, not used it myself. It would be an interesting one to use.

Re: scroll-pane and radiobutton not in API docs

Posted: Mon Sep 19, 2016 9:04 am
by Mooncat
bobingabout wrote:As for the scrole-pane? I had heard mention of it being added, but haven't seen, not used it myself.
Now you see it: :P
Inventory filter inside a scroll-pane
It can limits your UI size even if it has many elements inside, so users with small screens will be happy. 8-)

Re: scroll-pane and radiobutton not in API docs

Posted: Mon Sep 19, 2016 9:07 am
by aubergine18
Helfima (Helmod author) helped me with scroll-pane: #1

There doesn't seem to be a way to customise the scroll bar and slider for a specific scroll pane with style prototypes - it looks like there's just one default for those for entire GUI theme currently.

As for radio button, discovered that a few days ago: #18

With regards to sprite (the 'sprite' GUI element and the 'sprite' prototype), I'm still confused. The prototype seems quite unlike any other GUI style for following reasons: #33 #34

* It appears to be an image construct, yet it's named (unlike all other image types)
* It has it's own category: data.raw.sprite - unlike any other image or any other style prototype
* It seems to be both the image and the style for a `sprite` element (and can be used also as the 'sprite' setting of a 'sprite-button' element) - unlike any other image type or style type
* A sprite gui element apparently has no mandatory properties, unlike most other elements

/me confused by sprites

Re: scroll-pane and radiobutton not in API docs

Posted: Mon Sep 19, 2016 9:10 am
by Rseding91
aubergine18 wrote:Helfima (Helmod author) helped me with scroll-pane: https://github.com/aubergine10/Style/issues/1

There doesn't seem to be a way to customise the scroll bar and slider for a specific scroll pane with style prototypes - it looks like there's just one default for those for entire GUI theme currently.

As for radio button, discovered that a few days ago: https://github.com/aubergine10/Style/issues/18

With regards to sprite (the 'sprite' GUI element and the 'sprite' prototype), I'm still confused. The prototype seems quite unlike any other GUI style for following reasons: https://github.com/aubergine10/Style/issues/33

* It appears to be an image construct, yet it's named (unlike all other image types)
* It has it's own category: data.raw.sprite - unlike any other image or any other style prototype
* It seems to be both the image and the style for a `sprite` element (and can be used also as the 'sprite' setting of a 'sprite-button' element) - unlike any other image type or style type
* A sprite gui element apparently has no mandatory properties, unlike most other elements

/me confused by sprites
The sprite type works like the sprite button except you can't click it - it just exists.

Re: scroll-pane and radiobutton not in API docs

Posted: Mon Sep 19, 2016 9:38 am
by aubergine18
Rseding91 wrote:The sprite type works like the sprite button except you can't click it - it just exists.
Yup - I get the `control.lua` aspect of it, it's more the `data.lua` aspect that's confusing me.

There doesn't seem to be a `type="sprite_style"` (if there is, I can't find one after dumping data.raw)

So I'm left assuming the stuff on data.raw.sprite can be used as styles for the `sprite` element (and also the `sprite-button`) element.

Do sprite and sprite-button both have extra logic that allows them to use data.raw.sprite and also data.raw.gui-style.sprite_style?