protected void init(SVGAsset image, string caption, string tooltip) { Icon.vectorGraphics = image; Text.SetText("-"); if (Control.Settings.ColorHardpointsBack) { if (uicolor != UIColor.Custom) { backcolor = LazySingletonBehavior <UIManager> .Instance.UIColorRefs.GetUIColor(uicolor); } else { backcolor = color; } backcolor.a = Control.Settings.HardpointBackAlpha; if (BackImage != null) { BackImage.color = backcolor; } } SetIconColor(); SetTextColor(); SetTooltip(caption, tooltip); Show(); }
public static bool ChatListViewItem_SetData_Prefix(ChatListViewItem __instance, ChatMessage message, LocalizableText ____chatMessage) { string expandedSender = message.SenderName.Replace(">", ">"); expandedSender = expandedSender.Replace("<", "<"); string senderText = $"{expandedSender}"; Mod.Log.Debug($"Message senderName: '{message.SenderName}' expandedSender: '{expandedSender}' senderText: '{senderText}'"); string messageColor = "#" + ColorUtility.ToHtmlStringRGBA(LazySingletonBehavior <UIManager> .Instance.UIColorRefs.whiteHalf); string expandedMessage = message.Message.Replace(">", ">"); expandedMessage = expandedMessage.Replace("<", "<"); string messageText = $"<{messageColor}>{expandedMessage}</color>"; Mod.Log.Debug($"Message text: '{expandedMessage}'"); Localize.Text translatedText = new Localize.Text("<size=-3>" + senderText + " " + messageText + "</size>"); ____chatMessage.text = translatedText.ToString(); DOTweenAnimation componentInChildren = ____chatMessage.GetComponentInChildren <DOTweenAnimation>(); if (componentInChildren != null) { componentInChildren.delay = 50; componentInChildren.CreateTween(); componentInChildren.DOPlay(); } return(false); }
private static DialogueContent BuildContent(CastDef castDef, List <string> quips) { string quip = quips[Mod.Random.Next(0, quips.Count)]; string localizedQuip = new Localize.Text(quip).ToString(); return(Coordinator.BuildDialogueContent(castDef, localizedQuip, Color.white)); }
static void Postfix(CombatHUDFireButton __instance, CombatHUDFireButton.FireMode value) { if (__instance.gameObject != null) { if (__instance.gameObject.name == ModConsts.ChargeFB_GO_ID) { string localText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Label_Melee_Type_Charge]).ToString(); __instance.FireText.SetText(localText, new object[] { }); } else if (__instance.gameObject.name == ModConsts.KickFB_GO_ID) { string localText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Label_Melee_Type_Kick]).ToString(); __instance.FireText.SetText(localText, new object[] { }); } else if (__instance.gameObject.name == ModConsts.PhysicalWeaponFB_GO_ID) { string localText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Label_Melee_Type_Physical_Weapon]).ToString(); __instance.FireText.SetText(localText, new object[] { }); } else if (__instance.gameObject.name == ModConsts.PunchFB_GO_ID) { string localText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Label_Melee_Type_Punch]).ToString(); __instance.FireText.SetText(localText, new object[] { }); } } }
private static void Postfix(CombatHUDWeaponSlot __instance, ICombatant target, Weapon ___displayedWeapon, CombatHUD ___HUD) { if (__instance == null || ___displayedWeapon == null || ___HUD.SelectedActor == null || target == null) { return; } Mod.Log.Trace?.Write("CHUDWS:SHC - entered."); Traverse AddToolTipDetailMethod = Traverse.Create(__instance).Method("AddToolTipDetail", new Type[] { typeof(string), typeof(int) }); AbstractActor attacker = __instance.DisplayedWeapon.parent; string cacheKey = StraightTonnageCalculator.CacheKey(attacker, target); bool keyExists = ModState.CachedComparisonMods.TryGetValue(cacheKey, out int modifier); if (!keyExists) { modifier = StraightTonnageCalculator.Modifier(attacker, target); ModState.CachedComparisonMods.Add(cacheKey, modifier); } string localText = new Localize.Text(Mod.LocalizedText.Label[ModText.LT_AttackModSizeDelta]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, modifier }); }
// Generates a random quip and publishes it public static void PublishQuip(AbstractActor source, List <string> quips) { string quip = quips[Mod.Random.Next(0, quips.Count)]; string localizedQuip = new Localize.Text(quip).ToString(); CastDef castDef = Coordinator.CreateCast(source); DialogueContent content = Coordinator.BuildDialogueContent(castDef, localizedQuip, Color.white); Mod.Log.Info?.Write($"Publishing quip: {localizedQuip} with portrait: {castDef.defaultEmotePortrait.portraitAssetPath}"); source.Combat.MessageCenter.PublishMessage(new CustomDialogMessage(source, content, 3)); }
// Generates a random quip and publishes it public static void PublishQuip(AbstractActor source, List <string> quips) { string quip = quips[Mod.Random.Next(0, quips.Count)]; string localizedQuip = new Localize.Text(quip).ToString(); CastDef castDef = Coordinator.CreateCast(source); DialogueContent content = new DialogueContent( localizedQuip, Color.white, castDef.id, null, null, DialogCameraDistance.Medium, DialogCameraHeight.Default, 0 ); content.ContractInitialize(source.Combat); source.Combat.MessageCenter.PublishMessage(new CustomDialogMessage(source, content, 3)); }
protected virtual void SetTooltip(string caption, string text) { if (Tooltip == null) { return; } var loctext = new Text(text); var captest = new Text(caption); var desc = new BaseDescriptionDef("hardpoint", captest.ToString(), loctext.ToString(), HPInfo == null ? "" : HPInfo.WeaponCategory.Icon); Tooltip.SetDefaultStateData(TooltipUtilities.GetStateDataFromObject(desc)); }
static bool Prefix(SGBarracksRosterList __instance, LocalizableText ___mechWarriorCount) { if (ModState.SimGameState == null) { return(true); // Only patch if we're in SimGame } int usedBerths = CrewHelper.UsedBerths(ModState.SimGameState.PilotRoster); Mod.Log.Debug?.Write($"Berths => used: {usedBerths} available: {ModState.SimGameState.GetMaxMechWarriors()}"); string text = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Crew_Berths_Used], new object[] { usedBerths, ModState.SimGameState.GetMaxMechWarriors() }).ToString(); ___mechWarriorCount.SetText(text); return(false); }
public string UILabel() { // Parse light string lightLabel; if (isDay) { lightLabel = Mod.Config.LocalizedText[ModConfig.LT_MAP_LIGHT_BRIGHT]; } else if (isDim) { lightLabel = Mod.Config.LocalizedText[ModConfig.LT_MAP_LIGHT_DIM]; } else { lightLabel = Mod.Config.LocalizedText[ModConfig.LT_MAP_LIGHT_DARK]; } lightLabel = new Localize.Text(lightLabel).ToString(); // Parse weather string weatherLabel = null; if (hasHeavyFog) { weatherLabel = Mod.Config.LocalizedText[ModConfig.LT_MAP_FOG_HEAVY]; } else if (hasLightFog) { weatherLabel = Mod.Config.LocalizedText[ModConfig.LT_MAP_FOG_LIGHT]; } else if (hasSnow) { weatherLabel = Mod.Config.LocalizedText[ModConfig.LT_MAP_SNOW]; } else if (hasRain) { weatherLabel = Mod.Config.LocalizedText[ModConfig.LT_MAP_RAIN]; } if (weatherLabel != null) { weatherLabel = new Localize.Text(weatherLabel).ToString(); } return(weatherLabel == null ? lightLabel : lightLabel + ", " + weatherLabel); }
// Copied from OnMechLabDrop() but with inplace replacing of parts removed public static bool Prefix( MechLabLocationWidget __instance, MechLabPanel ___mechLab, Localize.Text ____dropErrorMessage, PointerEventData eventData, MechLabDropTargetType addToType) { return(_harmonyManager.PrefixLogExceptions(() => { if (!___mechLab.Initialized) { return; } if (___mechLab.DragItem == null) { return; } IMechLabDraggableItem dragItem = ___mechLab.DragItem; bool flag = __instance.ValidateAdd(dragItem.ComponentRef); if (!flag) { ___mechLab.ShowDropErrorMessage(____dropErrorMessage); ___mechLab.OnDrop(eventData); return; } bool clearOriginalItem = __instance.OnAddItem(dragItem, true); if (__instance.Sim != null) { WorkOrderEntry_InstallComponent subEntry = __instance.Sim.CreateComponentInstallWorkOrder(___mechLab.baseWorkOrder.MechID, dragItem.ComponentRef, __instance.loadout.Location, dragItem.MountedLocation); ___mechLab.baseWorkOrder.AddSubEntry(subEntry); } dragItem.MountedLocation = __instance.loadout.Location; ___mechLab.ClearDragItem(clearOriginalItem); __instance.RefreshHardpointData(); ___mechLab.ValidateLoadout(false); })); }
private static void ChatListViewItem_SetData(ChatListViewItem __instance, ChatMessage message, LocalizableText ____chatMessage) { string expandedSender = message.SenderName.Replace(">", ">"); expandedSender = expandedSender.Replace("<", "<"); string senderText = $"{expandedSender}"; Mod.Log.Debug($"Message senderName: '{message.SenderName}' expandedSender: '{expandedSender}' senderText: '{senderText}'"); string messageColor = "#" + ColorUtility.ToHtmlStringRGBA(LazySingletonBehavior <UIManager> .Instance.UIColorRefs.whiteHalf); string expandedMessage = message.Message.Replace(">", ">"); expandedMessage = expandedMessage.Replace("<", "<"); string messageText = $"<{messageColor}>{expandedMessage}</color>"; Mod.Log.Debug($"Message text: '{expandedMessage}'"); Localize.Text translatedText = new Localize.Text("<size=-3>" + senderText + " " + messageText + "</size>"); ____chatMessage.text = translatedText.ToString(); }
private static void Postfix(CombatHUDWeaponSlot __instance, ICombatant target, Weapon ___displayedWeapon, CombatHUD ___HUD) { if (__instance == null || ___displayedWeapon == null || ___HUD.SelectedActor == null || target == null) { return; } Mod.Log.Trace?.Write("CHUDWS:SHC - entered."); AbstractActor attacker = __instance.DisplayedWeapon.parent; Traverse AddToolTipDetailMethod = Traverse.Create(__instance).Method("AddToolTipDetail", new Type[] { typeof(string), typeof(int) }); if (target is AbstractActor targetActor && __instance.DisplayedWeapon != null) { float magnitude = (attacker.CurrentPosition - target.CurrentPosition).magnitude; EWState attackerState = new EWState(attacker); EWState targetState = new EWState(targetActor); // If we can't see the target, apply the No Visuals penalty bool canSpotTarget = VisualLockHelper.CanSpotTarget(attacker, attacker.CurrentPosition, target, target.CurrentPosition, target.CurrentRotation, attacker.Combat.LOS); int mimeticMod = targetState.MimeticAttackMod(attackerState); int eyeballAttackMod = canSpotTarget ? mimeticMod : Mod.Config.Attack.NoVisualsPenalty; // Zoom applies independently of visibility (request from Harkonnen) LineOfFireLevel lofLevel; Vector3 attackPosition = ___HUD.SelectionHandler.ActiveState.PreviewPos; if (Vector3.Distance(attacker.CurrentPosition, attackPosition) > 0.1f) { Vector3 vector; lofLevel = attacker.Combat.LOS.GetLineOfFire(attacker, attackPosition, target, target.CurrentPosition, target.CurrentRotation, out vector); } else { lofLevel = attacker.VisibilityCache.VisibilityToTarget(target).LineOfFireLevel; } int zoomVisionMod = attackerState.GetZoomVisionAttackMod(__instance.DisplayedWeapon, magnitude); int zoomAttackMod = attackerState.HasZoomVisionToTarget(__instance.DisplayedWeapon, magnitude, lofLevel) ? zoomVisionMod - mimeticMod : Mod.Config.Attack.NoVisualsPenalty; Mod.Log.Debug?.Write($" Visual attack == eyeball: {eyeballAttackMod} mimetic: {mimeticMod} zoomAtack: {zoomAttackMod}"); bool hasVisualAttack = (eyeballAttackMod < Mod.Config.Attack.NoVisualsPenalty || zoomAttackMod < Mod.Config.Attack.NoVisualsPenalty); // Sensor attack bucket. Sensors always fallback, so roll everything up and cap int narcAttackMod = targetState.NarcAttackMod(attackerState); int tagAttackMod = targetState.TagAttackMod(attackerState); int ecmShieldAttackMod = targetState.ECMAttackMod(attackerState); int stealthAttackMod = targetState.StealthAttackMod(attackerState, __instance.DisplayedWeapon, magnitude); Mod.Log.Debug?.Write($" Sensor attack penalties == narc: {narcAttackMod} tag: {tagAttackMod} ecmShield: {ecmShieldAttackMod} stealth: {stealthAttackMod}"); bool hasSensorAttack = SensorLockHelper.CalculateSharedLock(targetActor, attacker) > SensorScanType.NoInfo; int sensorsAttackMod = Mod.Config.Attack.NoSensorsPenalty; if (hasSensorAttack) { sensorsAttackMod = 0; sensorsAttackMod -= narcAttackMod; sensorsAttackMod -= tagAttackMod; sensorsAttackMod += ecmShieldAttackMod; sensorsAttackMod += stealthAttackMod; } if (sensorsAttackMod > Mod.Config.Attack.NoSensorsPenalty) { Mod.Log.Debug?.Write($" Rollup of penalties {sensorsAttackMod} is > than NoSensors, defaulting to {Mod.Config.Attack.NoSensorsPenalty} "); hasSensorAttack = false; } // Check firing blind if (!hasVisualAttack && !hasSensorAttack) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_FIRING_BLIND]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, Mod.Config.Attack.FiringBlindPenalty }); } else { // Visual attacks if (!hasVisualAttack) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_NO_VISUALS]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, Mod.Config.Attack.NoVisualsPenalty }); } else { // If the zoom + mimetic is better than eyeball, use that. Otherwise, we're using the good ol mk.1 eyeball if (zoomAttackMod < eyeballAttackMod) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_ZOOM_VISION]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, zoomVisionMod }); } if (mimeticMod != 0) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_MIMETIC]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, mimeticMod }); } } if (attackerState.HasHeatVisionToTarget(__instance.DisplayedWeapon, magnitude)) { int heatAttackMod = attackerState.GetHeatVisionAttackMod(targetActor, magnitude, __instance.DisplayedWeapon); string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_HEAT_VISION]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, heatAttackMod }); } if (!hasSensorAttack) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_NO_SENSORS]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, Mod.Config.Attack.NoSensorsPenalty }); } else { if (ecmShieldAttackMod != 0) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_ECM_SHEILD]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, ecmShieldAttackMod }); } if (narcAttackMod != 0) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_NARCED]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, narcAttackMod }); } if (tagAttackMod != 0) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_TAGGED]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, tagAttackMod }); } if (stealthAttackMod != 0) { string localText = new Localize.Text(Mod.Config.LocalizedText[ModConfig.LT_ATTACK_STEALTH]).ToString(); AddToolTipDetailMethod.GetValue(new object[] { localText, stealthAttackMod }); } } } } }
public virtual void SetText(string txt) { Text.SetText(txt); }
public virtual void SetText(int n) { Text.SetText(n.ToString()); }
static void Postfix(SGBarracksRosterSlot __instance, Pilot ___pilot, GameObject ___AbilitiesObject, LocalizableText ___callsign, Image ___portrait, SVGImage ___roninIcon, SVGImage ___veteranIcon, LocalizableText ___expertise, HBSTooltip ___ExpertiseTooltip) { if (ModState.SimGameState == null) { return; // Only patch if we're in SimGame } if (___pilot == null) { return; } Mod.Log.Debug?.Write($"POST Calling refresh for pilot: {___pilot.Name}"); CrewDetails details = ModState.GetCrewDetails(___pilot.pilotDef); // Find the common GameObjects we need to manipulate GameObject portraitOverride = GetOrCreateProfileOverride(___portrait); if (details.IsAerospaceCrew || details.IsMechTechCrew || details.IsMedTechCrew || details.IsVehicleCrew) { portraitOverride.SetActive(true); } else { portraitOverride.SetActive(false); } GameObject crewBlock = GetOrCreateCrewBlock(___portrait.gameObject); if (details.IsAerospaceCrew || details.IsMechTechCrew || details.IsMedTechCrew) { crewBlock.SetActive(true); } else { crewBlock.SetActive(false); } GameObject mwStats = ___portrait.transform.parent.parent.gameObject.FindFirstChildNamed(ModConsts.GO_HBS_Profile_Stats_Block); if (details.IsAerospaceCrew || details.IsMechTechCrew || details.IsMedTechCrew) { mwStats.SetActive(false); } else { mwStats.SetActive(true); } GameObject layoutTitleGO = __instance.GameObject.FindFirstChildNamed(ModConsts.GO_HBS_Profile_Layout_Title); Image layoutTitleImg = layoutTitleGO.GetComponent <Image>(); if (details.IsAerospaceCrew) { Mod.Log.Debug?.Write($" -- pilot is Aerospace crew"); layoutTitleImg.color = Mod.Config.Crew.AerospaceColor; ___portrait.gameObject.SetActive(false); ___AbilitiesObject.SetActive(false); ___roninIcon.gameObject.SetActive(false); ___veteranIcon.gameObject.SetActive(false); // Set the portrait icon SVGAsset icon = ModState.SimGameState.DataManager.GetObjectOfType <SVGAsset>(Mod.Config.Icons.CrewPortrait_Aerospace, BattleTechResourceType.SVGAsset); if (icon == null) { Mod.Log.Warn?.Write($"ERROR READING ICON: {Mod.Config.Icons.CrewPortrait_Aerospace}"); } SVGImage image = portraitOverride.GetComponentInChildren <SVGImage>(); image.vectorGraphics = icon; // Set the crew size LocalizableText[] texts = crewBlock.GetComponentsInChildren <LocalizableText>(); LocalizableText lt1 = texts[0]; string sizeText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Crew_Size], new object[] { details.SizeLabel, details.Size }).ToString(); lt1.SetText(sizeText); // Force the font size here, otherwise the right hand panel isn't correct lt1.fontSize = 16f; lt1.fontSizeMin = 16f; lt1.fontSizeMax = 16f; LocalizableText lt2 = texts[1]; string skillText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Skill_Aerospace_Points], new object[] { details.Value }).ToString(); lt2.SetText(skillText); // Force the font size here, otherwise the right hand panel isn't correct lt2.fontSize = 16f; lt2.fontSizeMin = 16f; lt2.fontSizeMax = 16f; // Set the expertise of the crew ___expertise.color = Color.white; ___expertise.SetText(details.ExpertiseLabel); } else if (details.IsMechTechCrew) { Mod.Log.Debug?.Write($" -- pilot is Mechtech crew"); layoutTitleImg.color = Mod.Config.Crew.MechTechCrewColor; ___portrait.gameObject.SetActive(false); ___AbilitiesObject.SetActive(false); ___roninIcon.gameObject.SetActive(false); ___veteranIcon.gameObject.SetActive(false); // Set the portrait icon SVGAsset icon = ModState.SimGameState.DataManager.GetObjectOfType <SVGAsset>(Mod.Config.Icons.CrewPortrait_MechTech, BattleTechResourceType.SVGAsset); if (icon == null) { Mod.Log.Warn?.Write($"ERROR READING ICON: {Mod.Config.Icons.CrewPortrait_MechTech}"); } SVGImage image = portraitOverride.GetComponentInChildren <SVGImage>(); image.vectorGraphics = icon; // Set the crew size LocalizableText[] texts = crewBlock.GetComponentsInChildren <LocalizableText>(); LocalizableText lt1 = texts[0]; string sizeText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Crew_Size], new object[] { details.SizeLabel, details.Size }).ToString(); lt1.SetText(sizeText); // Force the font size here, otherwise the right hand panel isn't correct lt1.fontSize = 16f; lt1.fontSizeMin = 16f; lt1.fontSizeMax = 16f; LocalizableText lt2 = texts[1]; string skillText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Skill_MechTech_Points], new object[] { details.Value }).ToString(); lt2.SetText(skillText); // Force the font size here, otherwise the right hand panel isn't correct lt2.fontSize = 16f; lt2.fontSizeMin = 16f; lt2.fontSizeMax = 16f; // Set the expertise of the crew ___expertise.color = Color.white; ___expertise.SetText(details.ExpertiseLabel); } else if (details.IsMedTechCrew) { Mod.Log.Debug?.Write($" -- pilot is Medtech crew"); layoutTitleImg.color = Mod.Config.Crew.MedTechCrewColor; ___portrait.gameObject.SetActive(false); ___AbilitiesObject.SetActive(false); ___roninIcon.gameObject.SetActive(false); ___veteranIcon.gameObject.SetActive(false); // Set the portrait icon SVGAsset icon = ModState.SimGameState.DataManager.GetObjectOfType <SVGAsset>(Mod.Config.Icons.CrewPortrait_MedTech, BattleTechResourceType.SVGAsset); if (icon == null) { Mod.Log.Warn?.Write($"ERROR READING ICON: {Mod.Config.Icons.CrewPortrait_MedTech}"); } SVGImage image = portraitOverride.GetComponentInChildren <SVGImage>(); image.vectorGraphics = icon; // Set the crew size LocalizableText[] texts = crewBlock.GetComponentsInChildren <LocalizableText>(); LocalizableText lt1 = texts[0]; string sizeText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Crew_Size], new object[] { details.SizeLabel, details.Size }).ToString(); lt1.SetText(sizeText); // Force the font size here, otherwise the right hand panel isn't correct lt1.fontSize = 16f; lt1.fontSizeMin = 16f; lt1.fontSizeMax = 16f; LocalizableText lt2 = texts[1]; string skillText = new Localize.Text(Mod.LocalizedText.Labels[ModText.LT_Skill_MedTech_Points], new object[] { details.Value }).ToString(); lt2.SetText(skillText); // Force the font size here, otherwise the right hand panel isn't correct lt2.fontSize = 16f; lt2.fontSizeMin = 16f; lt2.fontSizeMax = 16f; // Set the expertise of the crew ___expertise.color = Color.white; ___expertise.SetText(details.ExpertiseLabel); } else if (details.IsVehicleCrew) { Mod.Log.Debug?.Write($" -- pilot is Vehicle crew"); layoutTitleImg.color = Mod.Config.Crew.VehicleCrewColor; ___portrait.gameObject.SetActive(false); ___roninIcon.gameObject.SetActive(false); ___callsign.SetText("VCREW: " + ___pilot.Callsign); // Set the portrait icon SVGAsset icon = ModState.SimGameState.DataManager.GetObjectOfType <SVGAsset>(Mod.Config.Icons.CrewPortrait_Vehicle, BattleTechResourceType.SVGAsset); if (icon == null) { Mod.Log.Warn?.Write($"ERROR READING ICON: {Mod.Config.Icons.CrewPortrait_Vehicle}"); } SVGImage image = portraitOverride.GetComponentInChildren <SVGImage>(); image.vectorGraphics = icon; ___expertise.color = Color.white; } else { Mod.Log.Debug?.Write($" -- pilot is Mechwarrior"); ___portrait.gameObject.SetActive(true); } Mod.Log.Debug?.Write($"LayoutTitleImg color set to: {layoutTitleImg.color}"); }