I'm currently working on a themed mod gui and it looks like the scroll-panes scroll-bar looks can not be changed? At least none of the base games scroll_pane_style prototypes have a (default_)graphical_set and assigning one to a custom style doesn't have any effect.
Scroll-pane scroll-bar graphical_set access.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
- bobingabout
- Smart Inserter
- Posts: 7352
- Joined: Fri May 09, 2014 1:01 pm
- Contact:
Re: Scroll-pane scroll-bar graphical_set access.
Hey, I like the progress so far.
Shame we can't actually have more than just the default theme applied.
Shame we can't actually have more than just the default theme applied.
Re: Scroll-pane scroll-bar graphical_set access.
Scroll bars use "thumb_button_style", "top_button_style" and "bottom_button_style" which are internally button styles.
You should be able to set those on the default scroll bar style.
You should be able to set those on the default scroll bar style.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Scroll-pane scroll-bar graphical_set access.
Hm, interesting. I can see there are type="horizontal/vertical_scrollbar_style" styles in the default gui that have the button styles you mentioned. But how do i get a reference to the scroll-bar gui element? .add{type='scroll-pane'} only returns a reference to the scroll-pane which doesn't accept scroll_bar_style and doesn't have any children. Perhaps .add should return should return the bar as a second return value?
local pane,bar = gui.add{type="scroll-pane"}
Unless i'm missing something else.
Thanks for the help btw ;)
local pane,bar = gui.add{type="scroll-pane"}
Unless i'm missing something else.
Thanks for the help btw ;)
Re: Scroll-pane scroll-bar graphical_set access.
You don't, you'd set the style on the parent GUI element that owns the scroll bars. That is, if it's exposed (I think it is but haven't checked).eradicator wrote:Hm, interesting. I can see there are type="horizontal/vertical_scrollbar_style" styles in the default gui that have the button styles you mentioned. But how do i get a reference to the scroll-bar gui element? .add{type='scroll-pane'} only returns a reference to the scroll-pane which doesn't accept scroll_bar_style and doesn't have any children. Perhaps .add should return should return the bar as a second return value?
local pane,bar = gui.add{type="scroll-pane"}
Unless i'm missing something else.
Thanks for the help btw
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Scroll-pane scroll-bar graphical_set access.
I already tried that before and couldn't find it. Tested a brute force approach now and still can't find it:
According to pcall all attempts to set the style fail (and in the process makes the scroll bar vanish completely :P).
Edit:
(Hrng, pressed submit too early:P)
The code to create the scroll-pane is something like:
Code: Select all
local function force_style(element)
element.style = 'vertical_scrollbar'
end
local function for_all_children(element)
local err,stat = pcall(force_style, element)
print(err)
for _,child in pairs(element.children) do
for_all_children(child)
end
end
for_all_children(p.gui.center)
Edit:
(Hrng, pressed submit too early:P)
The code to create the scroll-pane is something like:
Code: Select all
local center = player.gui.center
local flow = center.add{type='flow'}
local frame = flow.add{type='frame'}
local pane = frame.add{type='scroll-pane'}
Re: Scroll-pane scroll-bar graphical_set access.
I guess it isn't setup then. I'll see about getting support added for it.
If you want to get ahold of me I'm almost always on Discord.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Scroll-pane scroll-bar graphical_set access.
Yay. Thanks =)