Page 1 of 1

LuaEntity::custom_state_string

Posted: Sun Oct 22, 2023 5:46 pm
by braxbro
Hi. I noticed lately that disabling machines via script leads to a terribly unhelpful 'disabled by script' tooltip. Basegame entities have things like 'no power' or 'no ingredients' or the like for these tooltips, which can be really helpful to newer players wanting to troubleshoot their setups.

Hence, I propose a way to set a custom tooltip to override the text of the default states so that mods like Pyanodon's Alien Life can, for example, say 'missing <insert item here>' when they turn off their machines due to lack of the proper modules. Being able to do so would allow mods to have similar explanations to basegame entities, even when mods use scripts, compound entities, etc. to create custom mechanics and limitations.

Re: LuaEntity::custom_state_string

Posted: Mon Oct 23, 2023 11:47 am
by Deadlock989
+1

Re: LuaEntity::custom_state_string

Posted: Thu Dec 14, 2023 5:44 pm
by raiguard
Implemented for 2.0 as LuaEntity::custom_status read/write. You can specify both the diode color and the label text.

LuaEntity::status read and working visualisations will remain unchanged - the custom status will only show in GUIs.

Re: LuaEntity::custom_state_string

Posted: Thu Dec 14, 2023 6:44 pm
by Stringweasel
:D