public static bool ChangeColor(InventoryDataObject_SalvageWeapon __instance, InventoryItemElement theWidget) { try { if (__instance.componentDef == null) { return(true); } theWidget.iconBGColors.SetColor(__instance.componentDef); return(false); } catch (Exception e) { Control.LogError(e); return(true); } }
public static bool ChangeColor(InventoryDataObject_SalvageWeapon __instance, InventoryItemElement theWidget) { try { if (__instance.componentDef == null) { return(true); } ColorExtentions.ChangeBackColor(__instance.weaponDef ?? __instance.componentDef, theWidget); TColorExtentions.ChangeTextIconColor(__instance.weaponDef ?? __instance.componentDef, theWidget); return(false); } catch (Exception e) { Control.LogError(e); return(true); } }
public static void Postfix(InventoryDataObject_SalvageWeapon __instance, InventoryItemElement theWidget) { try { if (__instance.componentDef == null) { return; } if (HasOverrideColor(__instance.componentDef, out Color overrideColor)) { UIColorRefTracker[] array = theWidget.iconBGColors; for (int i = 0; i < array.Length; i++) { array[i].OverrideWithColor(overrideColor); } } } catch (Exception e) { Logger.Error(e); } }
public static void Postfix(InventoryDataObject_SalvageWeapon __instance, InventoryItemElement theWidget) { try { if (__instance.componentDef == null) { return; } /* * // Colorize icon * UIColorRefTracker iconColor = theWidget.icon.GetComponent<UIColorRefTracker>(); * if (iconColor == null) * { * iconColor = theWidget.icon.gameObject.AddComponent<UIColorRefTracker>(); * } * iconColor.OverrideWithColor(Color.black); */ if (HasOverrideColor(__instance.componentDef, out Color overrideColor)) { UIColorRefTracker[] array = theWidget.iconBGColors; for (int i = 0; i < array.Length; i++) { array[i].OverrideWithColor(overrideColor); } } } catch (Exception e) { Logger.Error(e); } }