Exemplo n.º 1
0
        private static void AddFillersToSlot(List <Transform> slots, LocationLoadoutDef loadout, MechLabLocationWidget instance)
        {
            List <Image> images = new List <Image>();



            foreach (var slot in slots)
            {
                var go   = new GameObject();
                var rect = go.AddComponent <RectTransform>();
                rect.pivot            = new Vector2(0.5f, 0.5f);
                rect.anchorMin        = new Vector2(0, 0);
                rect.anchorMax        = new Vector2(1, 1);
                rect.anchoredPosition = Vector2.zero;
                rect.sizeDelta        = new Vector2(-6, -6);
                go.AddComponent <CanvasRenderer>();

                var image = go.AddComponent <Image>();
                image.color = Color.red;
                images.Add(image);

                rect.SetParent(slot, false);
            }

            var loc = new LocationInfo(instance, images, loadout);

            ReservedSlots.RegisterLocation(loc);
        }
 public static void Validate(MechDef mechDef, ref Dictionary <MechValidationType, List <string> > errorMessages)
 {
     UniqueController.ValidationRulesCheck(mechDef, ref errorMessages);
     Armor.ValidationRulesCheck(mechDef, ref errorMessages);
     Structure.ValidationRulesCheck(mechDef, ref errorMessages);
     ReservedSlots.ValidationRulesCheck(mechDef, ref errorMessages);
     EngineHeat.ValidationRulesCheck(mechDef, ref errorMessages);
     EngineMisc.ValidationRulesCheck(mechDef, ref errorMessages);
     Gyro.ValidationRulesCheck(mechDef, ref errorMessages);
     Cockpit.ValidationRulesCheck(mechDef, ref errorMessages);
 }
Exemplo n.º 3
0
            public static void Postfix(MechLabPanel __instance, MechDef ___activeMechDef)
            {
                try
                {
                    Current = __instance;
                }
                catch (Exception e)
                {
                    Control.mod.Logger.LogError(e);
                }

                ReservedSlots.CurrentMechDef = ___activeMechDef;
                ReservedSlots.RefreshData(___activeMechDef);
            }
Exemplo n.º 4
0
 public static void Postfix(MechLabPanel __instance, MechDef ___activeMechDef)
 {
     ReservedSlots.RefreshData(___activeMechDef);
 }