[1.1.57] Tooltips on labels inside of buttons aren't displayed

Bugs that are actually features.
Post Reply
Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

[1.1.57] Tooltips on labels inside of buttons aren't displayed

Post by Xorimuth »

Space Exploration's Universe Explorer GUI has clickable rows (buttons) each containing a flow containing labels. The labels in some of the columns (Zone type and Primary resource) have implemented tooltips but they aren't visible.
If I modify zonelist.lua and remove the `row` buttons, so that it is just a list of flows then the label tooltips work correctly.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

Rseding91
Factorio Staff
Factorio Staff
Posts: 13201
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.57] Tooltips on labels inside of buttons aren't displayed

Post by Rseding91 »

Can you please provide some minimal mod that shows the issue?
If you want to get ahold of me I'm almost always on Discord.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: [1.1.57] Tooltips on labels inside of buttons aren't displayed

Post by Xorimuth »

Rseding91 wrote:
Mon May 02, 2022 7:35 pm
Can you please provide some minimal mod that shows the issue?
Here it is. Place an entity to trigger the GUI to pop up.

The issue isn't quite as conclusive as I thought. The tooltips work when ignored_by_interaction = false, but in that case the button hover highlighting doesn't work. I'd like both to work simultaneously, but I understand that this may be impossible.

Thanks for your time.

Code: Select all

script.on_event(defines.events.on_built_entity,
  function(event)
    local player = game.get_player(event.player_index)
    local frame = player.gui.screen.add{type = "frame", name = "tooltip-gui", caption = "Tooltip demo"}
    frame.add{type = "label", caption = "ignored_by_interaction:"}
    local button = frame.add{type = "button"}
    local flow = button.add{type = "flow", direction = "horizontal", ignored_by_interaction = true}
    flow.add{type = "label", caption = "true", tooltip = "Tooltip1"}
    flow.add{type = "label", caption = "label1", tooltip = "Tooltip2"}

    local button2 = frame.add{type = "button"}
    local flow2 = button2.add{type = "flow", direction = "horizontal"}
    flow2.add{type = "label", caption = "false", tooltip = "Tooltip1"}
    flow2.add{type = "label", caption = "label2", tooltip = "Tooltip2"}

    frame.force_auto_center()
    player.opened = frame
  end
)

-- Close GUI on E
script.on_event(defines.events.on_gui_closed,
  function(event)
    if event.element and event.element.name == "tooltip-gui" then
      event.element.destroy()
    end
  end
)
Attachments
missing-tooltips_1.0.0.zip
(1.1 KiB) Downloaded 51 times
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

Rseding91
Factorio Staff
Factorio Staff
Posts: 13201
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.57] Tooltips on labels inside of buttons aren't displayed

Post by Rseding91 »

Why don't you just use 'caption' on the botton and set the tooltip on the button itself? It would replicate the behavior exactly as you are describing you want. It's also the intended way to use buttons.
If you want to get ahold of me I'm almost always on Discord.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 624
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: [1.1.57] Tooltips on labels inside of buttons aren't displayed

Post by Xorimuth »

Rseding91 wrote:
Tue May 03, 2022 1:15 am
Why don't you just use 'caption' on the botton and set the tooltip on the button itself? It would replicate the behavior exactly as you are describing you want. It's also the intended way to use buttons.
Because there needs to be several labels inside the button each with their own tooltip. I don't think what you are suggesting would work for that?
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

Rseding91
Factorio Staff
Factorio Staff
Posts: 13201
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.57] Tooltips on labels inside of buttons aren't displayed

Post by Rseding91 »

Mostly; I don't think this is as bug. When setting "ignored_by_interaction = true" the inner-widget-logic is disabled. Only the parent tooltip functions.

So, if you wanted to keep doing that you'd just need to use multiple buttons.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”