Exemple #1
0
        private void load()
        {
            RelativeSizeAxes = Axes.None;
            selectedPack     = MainScreen.CustomPackBindable.Value;
            // Masking Container for Round Corners at 0

            AddInternal(new SpriteText
            {
                Text     = "Choose Your Pack".ToUpper(),
                Font     = TCCFont.GetFont(Typeface.Ageo, 29, FontWeight.Regular),
                Position = new Vector2(0, -230),
                Anchor   = Anchor.Centre,
                Origin   = Anchor.Centre
            });
            AddInternal(new Container
            {
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Position         = new Vector2(0, -160),
                Masking          = true,
                RelativeSizeAxes = Axes.Both,
                CornerRadius     = 10,
                Children         = new Drawable[]
                {
                    new PackItemComponent
                    {
                        DisplayName      = "Minimum",
                        DisplayColour    = new Color4(0, 1, 0, 0.7f),
                        Anchor           = Anchor.CentreLeft,
                        Origin           = Anchor.CentreLeft,
                        RelativeSizeAxes = Axes.Both,
                        PackSize         = 100000000, // 100 mb
                    }, new PackItemComponent
                    {
                        DisplayName      = "Standart",
                        DisplayColour    = new Color4(0, 0, 1, 0.7f),
                        Anchor           = Anchor.Centre,
                        Origin           = Anchor.Centre,
                        RelativeSizeAxes = Axes.Both,
                        PackSize         = 700000000, // 700 mb
                    }, new PackItemComponent
                    {
                        DisplayName      = "Deluxe",
                        DisplayColour    = new Color4(1, 0, 0, 0.7f),
                        Anchor           = Anchor.CentreRight,
                        Origin           = Anchor.CentreRight,
                        RelativeSizeAxes = Axes.Both,
                        PackSize         = 1400000000, // 1.4 GB
                    }
                }
            });
        }
Exemple #2
0
        public static void Patch()
        {
            // Step 1 - Instantiate the service class
            var cbService = new CustomBatteriesService();

            // Step 2 - Get your plugin pack instance
            var myPlugin = new MyPlugin();

            // Step 3 - Call the AddPluginPackFromMod method with your plugin pack
            CustomPack myPack = cbService.AddPluginPackFromMod(myPlugin);

            // It will return a CustomPack that has everything you might need to continue patching.
            // The ModPrefabs CustomBattery and CustomPowerCell are already patched.
            TechType myBattery   = myPack.CustomBattery.TechType;
            TechType myPowercell = myPack.CustomPowerCell.TechType;

            // Do whatever other patching your mod requires
        }