Page 1 of 1

[Twinsen][1.1.5] Modded notched_slider button has no tooltip.

Posted: Mon Dec 14, 2020 5:25 pm
by eradicator
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.

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)

Re: [Twinsen][1.1.5] Modded notched_slider button has no tooltip.

Posted: Tue Dec 15, 2020 12:21 pm
by Twinsen
We have some internal system that is not exposed to lua.

But for now I made it so that setting the tooltip on a slider will set the same tooltip on both the body and the notch.

Re: [Twinsen][1.1.5] Modded notched_slider button has no tooltip.

Posted: Tue Dec 15, 2020 12:50 pm
by eradicator
Thank you berry much :).
Twinsen wrote: Tue Dec 15, 2020 12:21 pm But for now
Should i get my hopes up that in the future there might be more access? As i had a similar problem with the sliders internal elements i was a bit tempted to request access to each of the internal children styles. Assuming that if access was limited to the styles mods shouldn't be able to break the internal logic.

Re: [Twinsen][1.1.5] Modded notched_slider button has no tooltip.

Posted: Tue Dec 15, 2020 1:45 pm
by Twinsen
eradicator wrote: Tue Dec 15, 2020 12:50 pm Should i get my hopes up that in the future there might be more access? As i had a similar problem with the sliders internal elements i was a bit tempted to request access to each of the internal children styles. Assuming that if access was limited to the styles mods shouldn't be able to break the internal logic.
Eh, I wouldn't get my hopes up too much. There's nothing planned for now.