Rich text on UI Label

Place to get help with not working mods / modding interface.
Post Reply
heyqule
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Sun Mar 05, 2017 1:35 am
Contact:

Rich text on UI Label

Post by heyqule »

I'm trying to add GPS ping to my UI. The GPS tag can display fine. But it's not clickable. Then I tried adding a coal item rich-text. Hovering on that didn't trigger the popup of the coal item tag.

The item and entity tags in Tip and Trick work perfectly fine. Hovering them show the item/entity popup.

I couldn't spot anything odd in ctrl+f6 UI debug.

Am I missing something? I tried it on other UI types, textfield and text-box, as well. They didn't work. :?: :?: :?:

Code: Select all

    local tabbed_pane = main_window.add{ type="tabbed-pane", name='main-tab' }
    local pane= tabbed_pane.add{type="tab", caption="Help", name='help-tab'}
    local help_msg = pane.add { type="label", caption={'gui-army.cc_description3'}}
    help_msg.style.rich_text_setting = defines.rich_text_setting.highlight

Code: Select all

cc_description3=When the command center is idle for 5 minutes, they will unlink to preserve game performance. [gps=0,0] [item=coal]
Attachments
hmmm.JPG
hmmm.JPG (271.9 KiB) Viewed 633 times

Bilka
Factorio Staff
Factorio Staff
Posts: 3128
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Rich text on UI Label

Post by Bilka »

It looks like the gps tag is only clickable in the console. You may be lucky that this gets changed if you make a request here: viewforum.php?f=28

I can't tell why the hovering doesn't work for the coal in your label, besides the fact that the tips and tricks use a different rich text setting that is not available to mods (ChatMode).
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Modding help”