[Twinsen][1.1.5] Modded notched_slider button has no tooltip.
Posted: Mon Dec 14, 2020 5:25 pm
What
Contrary to vanilla gui slider buttons the tooltip for modded sliders only shows when the player hovers over the slider bar, but not when the player hovers the slider button.
Expected behavior
Setting a tooltip on the slider should automatically set it to the slider button.
I know that technically the slider and button are two different elements, but from the mod side i have no access to the button child LuaGuiElement as far as i understand. So i guess this is 50% bug report and 50% request ;)?
Reproduction
User the code. Drag the slider. See how the tooltip is only on the bar, not the button.
Contrary to vanilla gui slider buttons the tooltip for modded sliders only shows when the player hovers over the slider bar, but not when the player hovers the slider button.
Expected behavior
Setting a tooltip on the slider should automatically set it to the slider button.
I know that technically the slider and button are two different elements, but from the mod side i have no access to the button child LuaGuiElement as far as i understand. So i guess this is 50% bug report and 50% request ;)?
Reproduction
User the code. Drag the slider. See how the tooltip is only on the bar, not the button.
Code: Select all
/c
local p = game.player
p.gui.center.clear()
local f = p.gui.center.add{
type = 'frame'
}
local s = f.add{
type = 'slider',
minimum_value = 1,
maximum_value = 10,
value = 1,
value_step = 1,
discrete_slider = true,
discrete_values = true,
name = 'testslider',
style = 'notched_slider',
}
s.style.width = 200
script.on_event(defines.events.on_gui_value_changed, function(e)
if e.element.name == 'testslider' then
e.element.tooltip = e.element.slider_value .. '%'
--[[ e.element.children[1].tooltip = e.element.slider_value .. '%' ]]
end
end)