Info
System: Windows 10 - 64bit
Studio Version: Version 0.614.0.6140412 (64bit)
Description
The bug, is that when you save the game. It will also save that what the StyleRules are modifying, and then it won’t modify them anymore.
Below is a clarification. Overwriting a property manually on an Instance that is being overwritten by StyleRule, permanently unlinks that property from StyleRule - #3 by HealthyKarl
Overwriting a property manually on an Instance that is being overwritten by StyleRule, permanently unlinks that property from StyleRule.
e.g. a TextLabel is listening to a StyleRule, which changes the BackgroundColor3
property.
However, if you However, saving the game overwrites the BackgroundColor3
property on the TextLabel, and the StyleRule will no longer apply the BackgroundColor3
on it, doesn’t matter what you do. You’re forced to destroy the TextLabel and create an entire new one through a Script, which doesn’t touch the BackgroundColor3
property.
Loading any save file, destroys any links from StyleRule. I believe the reason for that is
You Load a save fileIt initializes Instances, such as their Colors and seems to set the Color property ontop in its own Object againThen StyleRule doesn’t work on it.
The Reproduction Steps and rest below are not updated, see the comment below this Overwriting a property manually on an Instance that is being overwritten by StyleRule, permanently unlinks that property from StyleRule - #3 by HealthyKarl
Reproduction Steps
Before you start you need the following Fast Flags.
{"FFlagEnableStylingEverywhere":true}
-
Get this game:
bug_repro_stylerule_overwrite.rbxlx (74.4 KB) -
Copy paste this code into the console
local TextLabel = Instance.new("TextLabel")
TextLabel.Size = UDim2.new(0.5, 0, 0.5, 0)
TextLabel.Position = UDim2.new(0.25, 0, 0.1707921, 0)
TextLabel.Parent = game:GetService("StarterGui").ScreenGui
TextLabel:AddTag("ControlColor")
- Go to
.ControlColor
and use the Color Picker from the Attribute. - You will notice that the Color changes with the TextLabel’s
BackgroundColor3
_(which is intended) - Go to the TextLabel and change the Color Property manually
Now the Color of the TextLabel is no longer synced with StyleRule, doesn’t matter if you re-link the StyleLink. The TextLabel needs to be destroyed and created again.
OR
Run the scripts in these, by copy pasting them into the console
Expected Result
That the StyleRule still overrides the color, regardless of TextLabel overriding the color on its own. (well, HTML AND CSS has inline style rule, but this one can’t be controlled with StyleRule yet)
Actual Result
It looks like, if you load a Place or anything like that, if the Instance wasn’t freshly created, StyleRule won’t overwrite the defined properties, in this case it doesn’t overwrite BackgroundColor3
.