Code: Select all
data:extend({
{
type = "custom-input",
name = "modname-hotkey-main-window",
key_sequence = "Y",
consuming = "script-only"
}
})
Code: Select all
data:extend({
{
type = "custom-input",
name = "modname-hotkey-main-window",
key_sequence = "Y",
consuming = "script-only"
}
})
Setting a gui tooltip toapriori wrote:Code: Select all
data:extend({ { type = "custom-input", name = "modname-hotkey-main-window", key_sequence = "Y", consuming = "script-only" } })
Code: Select all
{"auto-trash-tooltip-pause"}
Code: Select all
auto-trash-tooltip-pause = (__CONTROL__autotrash_pause__)
(__CONTROL__autotrash_pause__) - have you tried that? How can I find out which keywords should be used in this syntax construction? __CONTROL__what_should_be_here__Choumiko wrote:Code: Select all
auto-trash-tooltip-pause = (__CONTROL__autotrash_pause__)
No. To my sorrow. Read above, Choumiko gave me some rows, and I tried to use it...aubergine18 wrote:Wow, the __CONTROL__ thing already existed?! Where do people get this information - I couldn't find this anywhere in API guide or wiki. @apriori do you have access to source code or something? Where did you find the infos?
How to join?DedlySpyder wrote:Factorio IRC is normally the best place to get undocumented information. I believe that's where we got the pastebin for custom inputs when they first came out.
Yes, old sequence is being shown.apriori wrote:Got it!
First of all you should "create" key sequence. You can do it in data.lua or in another lua (for example "prototypes/hotkey.lua") file and include it using require("prototypes.hotkey"):data.lua[Optional] Then you create an event handler for your hotkey. And make a function to show LuaGuiElement with required tooltip/text:control.luaNow you can include key sequence into locale:locale.cfgIt works!resultPS: I dunno what will be in this tooltip if I'll change key sequence using game menu... Maybe, old sequence will be shown.
Meaning that the tooltip doesn't update? How much have you tested it? I assume a restart wouldn't change it, but does redrawing the GUI update it?apriori wrote:...
Yes, old sequence is being shown.
No, updating (destroy -> add) doesn't help. I think, because tooltip is {"localized-string"} is being loaded on game launch.DedlySpyder wrote: Meaning that the tooltip doesn't update? How much have you tested it? I assume a restart wouldn't change it, but does redrawing the GUI update it?