I wish LuaEntity.color can also link to the color of locomotive.
A player suggested to implement my Color Picker for changing locomotive color. But when I attempted to get the opened locomotive's color, it returns nil. So I don't know how to get and set the color now.
PS: according to the document, "The character or rolling stock color", so I think it is also supposed to link to the colors of car and tank? But now it is also nil when I get their colors. character.color works however.
LuaEntity.color can also get/set the color of locomotive
Re: LuaEntity.color can also get/set the color of locomotive
The color property for LuaEntity returns nil if the locomotive/train doesn't have a custom color set.
If it has one set it returns the color value that it's set too.
If it has one set it returns the color value that it's set too.
If you want to get ahold of me I'm almost always on Discord.
Re: LuaEntity.color can also get/set the color of locomotive
I see... what if it provides the default (prototype) color instead of nil in that case? If it is nil, I will have to assume that the locomotive has default color of Red. Unfortunately, FARL provides a locomotive with default color of Yellow. So the assumption will be wrong. And it seems there is no color property in LuaEntityPrototype.
If it is implemented, is it also possible to make that changing LuaEntity.color will also update the GUI?
I have checked that it doesn't update the GUI now.
If it is implemented, is it also possible to make that changing LuaEntity.color will also update the GUI?
I have checked that it doesn't update the GUI now.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: LuaEntity.color can also get/set the color of locomotive
IMO the GUI colour should not be based on player colour (and if it was, maybe only the toolbar above the minimap).Mooncat wrote:If it is implemented, is it also possible to make that changing LuaEntity.color will also update the GUI?
I have checked that it doesn't update the GUI now.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: LuaEntity.color can also get/set the color of locomotive
It isn't related to player color. I meant the GUI for changing locomotive's color. The one that has 3 scrollbars, with an image of the locomotive at the left side.aubergine18 wrote:IMO the GUI colour should not be based on player colour (and if it was, maybe only the toolbar above the minimap).Mooncat wrote:If it is implemented, is it also possible to make that changing LuaEntity.color will also update the GUI?
I have checked that it doesn't update the GUI now.