Closed zepumph closed 2 months ago
Getting pretty close, but not quite there yet:
phet.densityBuoyancyCommon.DensityBuoyancyCommonStrings.massLabel["1aStringProperty"].value = '22fdsafdsa2'
Ok, we are at a good stopping point. Next we can make custom colors for different MassTag. I also feel like we may want to change MassTag to a class instead of an enum for better flexibility.
Good progress here, but I shelved the changes locally and will need to come back to it.
Alright. I finally got to a commit point. This means that we now have a new file called MassTag, a new serialization for PhET-iO, and much more flexibility about how to provide the desired color for a mass tag (from the model side. It also meant that the task in https://github.com/phetsims/buoyancy/issues/96 ended up being one line of code, which is definitely a great thing! We also were able to improve the mobius code quite a bit, making it more dynamic, since that is the direction that our code base (and design requests) is heading towards.
Closing
While working on https://github.com/phetsims/buoyancy/issues/96, I was asked for:
And what I ended up finding was a lot of very connected, hard coded, duplicated, and confusing code that I would like to tease out. Basically the label for the numeric mass of an object, and the label/name for the mass, are kinda overloaded.
MassLabelNode
is doing both, but really it should just be working for the readout of the mass of the mass. I'd like to make a new type forMassTagView
, the quad that provided the label to THREE for the name of the object (A/B/1A...).Furthermore, there was awkard logic special to if it was primary/secondard vs a custom other tag. This made the color change request really challenging. I'll clean up the code before adding support for any MassTag to have its own custom color.