Jump to content

Liquid ingredients in fabricator recipes are missing tinting


Tigin
  • Branch: Live Branch Version: Windows Pending

image.png.0820297799a2bd9b76b546bc102cc004.pngimage.png.16875e6ee77813375af87b99b31cc827.pngimage.png.2cb7456510bae2dbe86acb2cb21fe790.png


Steps to Reproduce

See above




User Feedback


also affects gasses (if you have a modded recipe that consumes a gas)

the bug sits in the ingredient loop in RefreshIngredientDescriptors();

Def.GetUISprite(newTag, "") is called, but the tint color (which is relevant for liquid/gas elements) is discarded, instead the image color is always set to white or a 55% opacity white when not enough material is available

the following code (decompiled, but it should be findable)

 Image reference2 = component2.GetReference<Image>("Icon");
 reference2.material = !hasEnoughMaterial ? GlobalResources.Instance().AnimMaterialUIDesaturated : GlobalResources.Instance().AnimUIMaterial;
 reference2.color = hasEnoughMaterial ? Color.white : new Color(1f, 1f, 1f, 0.55f);
 reference1.SetText(ingredientDescription);
 reference2.sprite = Def.GetUISprite(newTag, "").first;

needs to be changed to

Image reference2 = component2.GetReference<Image>("Icon");
Tuple<Sprite, Color> uiSpriteWithTint = Def.GetUISprite(newTag, "");
Color elementColor = uiSpriteWithTint.second;
Sprite uiSprite = uiSpriteWithTint.first;
reference2.material = !hasEnoughMaterial ? GlobalResources.Instance().AnimMaterialUIDesaturated : GlobalResources.Instance().AnimUIMaterial;
reference2.color = hasEnoughMaterial ? elementColor : new Color(elementColor.r, elementColor.g, elementColor.b, 0.55f);
reference1.SetText(ingredientDescription);
reference2.sprite = uiSprite;

or something similar

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...