Exemple #1
0
        private static void DrawBottomSlots(Rect rect, Blueprint bp, BlueprintHandlerState state)
        {
            try
            {
                GUI.BeginGroup(rect);

                List <object> list = new List <object>()
                {
                    1, 2, 3
                };

                float slotWidth      = rect.width / 3;
                Rect  armourSlotRect = new Rect(slotWidth, rect.height - TotalSlotRectHeight, slotWidth, TotalSlotRectHeight);
                if (bp.HasArmourPlating)
                {
                    List <PartCustomisePack> armour = bp.GetPartCustomisePacks(DroidCustomiseGroupDef.Named("MD3_DroidArmourPlating"), true);
                    var pack = armour.First();
                    DrawSlot(pack, armourSlotRect, bp.ChassisType, state);
                    foreach (var p in armour)
                    {
                        p.Part = pack.Part;
                    }
                    bp.Recache();
                }

                Rect motivator1SlotRect = new Rect(0f, armourSlotRect.y, armourSlotRect.width, armourSlotRect.height);
            }
            finally
            {
                GUI.EndGroup();
            }
        }
        private void Setup()
        {
            List <PartCustomisePack> list = design.GetPartCustomisePacks(group).ToList();

            if (list.Count > 0)
            {
                int count = Mathf.Min(6, list.Count);
                //Initialise the values of each slot
                for (int i = 0; i < count; i++)
                {
                    switch (i)
                    {
                    case 0:
                        Slot1     = list[i];
                        Slot1Temp = Slot1.CreateCopy();
                        break;

                    case 1:
                        Slot2     = list[i];
                        Slot2Temp = Slot2.CreateCopy();
                        break;

                    case 2:
                        Slot3     = list[i];
                        Slot3Temp = Slot3.CreateCopy();
                        break;

                    case 3:
                        Slot4     = list[i];
                        Slot4Temp = Slot4.CreateCopy();
                        break;

                    case 4:
                        Slot5     = list[i];
                        Slot5Temp = Slot5.CreateCopy();
                        break;

                    case 5:
                        Slot6     = list[i];
                        Slot6Temp = Slot6.CreateCopy();
                        break;

                    default:
                        break;
                    }
                }
            }
        }