Page 1 of 1

localised description for shortcuts

Posted: Mon Jan 27, 2025 10:32 am
by Quezler
Currently shortcuts either have the spawned item's description or nothing at all, it would be nice if you could add a description for lua shortcuts and such.

Re: localised description for shortcuts

Posted: Tue Jan 28, 2025 6:06 am
by picklock
You can give your shortcut a description by assigning the description to your shortcut via "localised_name".

Re: localised description for shortcuts

Posted: Tue Jan 28, 2025 9:16 am
by Quezler
Isn't that just the name? i am referring to what comes after the horizontal line under it.

Re: localised description for shortcuts

Posted: Tue Jan 28, 2025 10:37 am
by picklock
No, this is the text that is displayed as a tooltip when you hover over the shortcut icon in the shortcut bar. Do you mean something else?

Re: localised description for shortcuts

Posted: Tue Jan 28, 2025 11:11 am
by Quezler
You can currently only set the name, the description is only there when the shortcut spawns an item, otherwise it is always blank:

Re: localised description for shortcuts

Posted: Tue Jan 28, 2025 11:54 am
by picklock
OK. Then I misunderstood you.

Re: localised description for shortcuts

Posted: Tue Jan 28, 2025 12:07 pm
by Xorimuth
+1

Specifically I'd like to be able to alter the description of the Spidertron Remote shortcut. Currently it is hardcoded, and I can sort of override it by re-defining the locale key of one of the bullet points but
a) that looks a bit weird as I can only alter text of existing bullet points, not add more
b) I can't do that dynamically depending on mod settings, existence of other mods, etc, which I would like to be able to do (so I need `localised_description`)

Re: localised description for shortcuts

Posted: Tue Feb 04, 2025 5:07 pm
by protocol_1903
+1

Re: localised description for shortcuts

Posted: Sat Apr 11, 2026 11:41 am
by Shemp
+1

Just to clarify, if you define a "spawn-item" shortcut, and both that item and the shortcut have a localised_description, what should happen?

Re: localised description for shortcuts

Posted: Wed Apr 22, 2026 1:31 pm
by Rseding91
Shortcuts already support localised_description. The only issue I found is the spawn-item type would always force-take the description from the spawned item if it existed and was valid. I've fixed that for 2.1 so it will take the description if no other description was set yet (if the shortcut didn't have a valid one).

Code: Select all

  {
    type = "shortcut",
    name = "lua-shortcut",
    order = "b[blueprints]-g[blueprint]",
    action = "lua",
    localised_name = {"shortcut.make-blueprint"},
    localised_description = {"", "This is my custom description on a lua shortcut."};
    style = "blue",
    icon = "__base__/graphics/icons/shortcut-toolbar/mip/new-blueprint-x56.png",
    icon_size = 56,
    small_icon = "__base__/graphics/icons/shortcut-toolbar/mip/new-blueprint-x24.png",
    small_icon_size = 24
  }
04-22-2026, 09-33-53.png
04-22-2026, 09-33-53.png (37.64 KiB) Viewed 324 times

Re: localised description for shortcuts

Posted: Thu Apr 23, 2026 10:18 am
by Quezler
> Shortcuts already support localised_description.

looks like that is new in 2.1 then, in 2.0 the localised_description on shortcuts is completely ignored.

glad to hear that in addition to that fix the localised_description will override the description of whatever item the shortcut might spawn.

Re: localised description for shortcuts

Posted: Sun Apr 26, 2026 4:37 pm
by Rseding91
Ah, my mistake - I only tested in 2.1 under the assumption nobody was changing this logic (since I didn't remember anything around it). It looks like it was fixed as a side effect of the fix for this report 131555

So, both issues are fixed in 2.1.