public static bool Prefix(ListElementController_SalvageMechPart_NotListView __instance, ref string __result) { if (__instance.mechDef != null && __instance.mechDef.IsVehicle()) { __result = __instance.mechDef.Chassis.Description.Name; return(false); } return(true); }
public static void Postfix(ListElementController_SalvageMechPart_NotListView __instance, InventoryItemElement_NotListView theWidget, SimGameState ___simState) { int pieces = ___simState.GetItemCount(__instance.mechDef.Description.Id, "MECHPART", SimGameState.ItemCountType.UNDAMAGED_ONLY); int needed = ___simState.Constants.Story.DefaultMechPartMax; int varpieces = SimpleMechAssembly_Main.GetNumPartsForAssembly(___simState, __instance.mechDef); int owned = SimpleMechAssembly_Main.GetNumberOfMechsOwnedOfType(___simState, __instance.mechDef); theWidget.mechPartsNumbersText.SetText(string.Format("{0}({1})/{3}({2})", pieces, varpieces, owned, needed)); }
public static void ChangeColor(ListElementController_SalvageMechPart_NotListView __instance, InventoryItemElement_NotListView theWidget) { try { TColorExtentions.ResetTextIconColor(theWidget); } catch (Exception e) { Control.LogError(e); } }
public static void Postfix(ListElementController_SalvageMechPart_NotListView __instance, InventoryItemElement_NotListView theWidget, MechDef ___mechDef, SalvageDef ___salvageDef) { Mod.Log.Debug($"LEC_SMP_NLV:RIOW - entered"); if (___salvageDef.RewardID != null && ___salvageDef.RewardID.Contains("_qty")) { int qtyIdx = ___salvageDef.RewardID.IndexOf("_qty"); string countS = ___salvageDef.RewardID.Substring(qtyIdx + 4); int count = int.Parse(countS); Mod.Log.Debug($"LEC_SMP_NLV:RIOW - found quantity {count}, changing mechdef"); DescriptionDef currentDesc = ___mechDef.Chassis.Description; string newUIName = $"{currentDesc.UIName} <lowercase>[QTY:{count}]</lowercase>"; Text newPartName = new Text(newUIName, new object[] { }); theWidget.mechPartName.SetText(newPartName); } }
public static void Postfix(ListElementController_SalvageMechPart_NotListView __instance, InventoryItemElement_NotListView theWidget, SimGameState ___simState) { if (Main.Settings.DependsOnArgoUpgrade && !___simState.PurchasedArgoUpgrades.Contains(Main.Settings.ArgoUpgrade)) { return; } var defaultMechPartMax = ___simState.Constants.Story.DefaultMechPartMax; Main.ExcludedVariantHolder = __instance.mechDef; var thisMechPieces = Main.GetMechParts(___simState, __instance.mechDef); var allMechPieces = Main.GetAllVariantMechParts(___simState, __instance.mechDef); if (!Main.Settings.VariantExceptions.Contains(__instance.mechDef.Description.Id)) { theWidget.mechPartsNumbersText.SetText($"{thisMechPieces} ({allMechPieces}) / {defaultMechPartMax}"); } else { theWidget.mechPartsNumbersText.SetText($"{thisMechPieces} (R) / {defaultMechPartMax}"); } }
public static bool GetName(ListElementController_SalvageMechPart_NotListView __instance, ref string __result) { __result = __instance.salvageDef.Description.Name; return(false); }
public static void Postfix(ListElementController_SalvageMechPart_NotListView __instance, InventoryItemElement_NotListView theWidget, SimGameState ___simState) { theWidget.mechPartsNumbersText.SetText(SimpleMechAssembly_Main.GetMechCountDescrString(___simState, __instance.mechDef)); }