Esempio n. 1
0
 private ListElementControllerCompare(ListElementController_BASE_NotListView item)
 {
     salvageDef   = item.salvageDef;
     componentDef = item.componentDef;
     ammoBoxDef   = item.ammoBoxDef;
     weaponDef    = item.weaponDef;
     mechDef      = item.mechDef;
     chassisDef   = item.chassisDef;
     shopDefItem  = item.shopDefItem;
 }
Esempio n. 2
0
 internal static void Postfix(ListElementController_BASE_NotListView __instance)
 {
     try
     {
         OverrideDescriptionsFeature.Shared.AdjustInventoryElement(__instance);
     }
     catch (Exception e)
     {
         Control.Logger.Error.Log(e);
     }
 }
 public MechComponentRef GetRef(ListElementController_BASE_NotListView lec)
 {
     if (lec is ListElementController_InventoryWeapon_NotListView)
     {
         return((lec as ListElementController_InventoryWeapon_NotListView).componentRef);
     }
     if (lec is ListElementController_InventoryGear_NotListView)
     {
         return((lec as ListElementController_InventoryGear_NotListView).componentRef);
     }
     LogError("[LimitItems] lec is not gear or weapon: " + lec.GetId());
     return(null);
 }
        public void AdjustInventoryElement(ListElementController_BASE_NotListView element)
        {
            var componentDef = element?.componentDef;

            if (componentDef == null)
            {
                return;
            }

            foreach (var cc in componentDef.GetComponents <IAdjustInventoryElement>())
            {
                cc.AdjustInventoryElement(element);
            }
        }
        public void AdjustInventoryElement(ListElementController_BASE_NotListView element)
        {
            var count = 0;

            foreach (var description in descriptions.Select(x => x.Long).Where(x => x != null).Take(2))
            {
                if (count == 0)
                {
                    element.ItemWidget.gearBonusText.text = description;
                    count++;
                }
                else if (count == 1)
                {
                    element.ItemWidget.gearBonusTextB.text = description;
                }
            }
        }
Esempio n. 6
0
 public static ListElementControllerCompare Wrap(ListElementController_BASE_NotListView item)
 {
     return(new ListElementControllerCompare(item));
 }