Example #1
0
        public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
        {
            m_subsystemGameInfo           = base.Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
            m_subsystemParticles          = base.Project.FindSubsystem <SubsystemParticles>(throwOnError: true);
            m_subsystemAudio              = base.Project.FindSubsystem <SubsystemAudio>(throwOnError: true);
            m_subsystemTime               = base.Project.FindSubsystem <SubsystemTime>(throwOnError: true);
            m_subsystemTerrain            = base.Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
            m_subsystemPickables          = base.Project.FindSubsystem <SubsystemPickables>(throwOnError: true);
            m_componentGui                = base.Entity.FindComponent <ComponentGui>(throwOnError: true);
            m_componentHumanModel         = base.Entity.FindComponent <ComponentHumanModel>(throwOnError: true);
            m_componentBody               = base.Entity.FindComponent <ComponentBody>(throwOnError: true);
            m_componentOuterClothingModel = base.Entity.FindComponent <ComponentOuterClothingModel>(throwOnError: true);
            m_componentVitalStats         = base.Entity.FindComponent <ComponentVitalStats>(throwOnError: true);
            m_componentLocomotion         = base.Entity.FindComponent <ComponentLocomotion>(throwOnError: true);
            m_componentPlayer             = base.Entity.FindComponent <ComponentPlayer>(throwOnError: true);
            SteedMovementSpeedFactor      = 1f;
            Insulation                    = 0f;
            LeastInsulatedSlot            = ClothingSlot.Feet;
            m_clothes[ClothingSlot.Head]  = new List <int>();
            m_clothes[ClothingSlot.Torso] = new List <int>();
            m_clothes[ClothingSlot.Legs]  = new List <int>();
            m_clothes[ClothingSlot.Feet]  = new List <int>();
            ValuesDictionary value = valuesDictionary.GetValue <ValuesDictionary>("Clothes");

            SetClothes(ClothingSlot.Head, HumanReadableConverter.ValuesListFromString <int>(';', value.GetValue <string>("Head")));
            SetClothes(ClothingSlot.Torso, HumanReadableConverter.ValuesListFromString <int>(';', value.GetValue <string>("Torso")));
            SetClothes(ClothingSlot.Legs, HumanReadableConverter.ValuesListFromString <int>(';', value.GetValue <string>("Legs")));
            SetClothes(ClothingSlot.Feet, HumanReadableConverter.ValuesListFromString <int>(';', value.GetValue <string>("Feet")));
            Display.DeviceReset += Display_DeviceReset;
        }
Example #2
0
        public SetModeDialog(CreatorAPI creatorAPI)
        {
            this.creatorAPI = creatorAPI;
            this.player     = creatorAPI.componentMiner.ComponentPlayer;
            XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/模式设置");

            WidgetsManager.LoadWidgetContents(this, this, node);
            this.CreativeButton    = Children.Find <ButtonWidget>("创造模式", true);
            this.ChallengingButton = Children.Find <ButtonWidget>("挑战模式", true);
            this.HarmlessButton    = Children.Find <ButtonWidget>("无害模式", true);
            this.AdventureButton   = Children.Find <ButtonWidget>("闯关模式", true);
            this.CruelButton       = Children.Find <ButtonWidget>("残酷模式", true);
            this.cancelButton      = Children.Find <ButtonWidget>("取消", true);
            gameInfo = player.Project.FindSubsystem <SubsystemGameInfo>(true);
            if (gameInfo.WorldSettings.GameMode == GameMode.Creative)
            {
                CreativeButton.IsEnabled = false;
            }
            else if (gameInfo.WorldSettings.GameMode == GameMode.Challenging)
            {
                ChallengingButton.IsEnabled = false;
            }
            else if (gameInfo.WorldSettings.GameMode == GameMode.Harmless)
            {
                HarmlessButton.IsEnabled = false;
            }
            else if (gameInfo.WorldSettings.GameMode == GameMode.Adventure)
            {
                AdventureButton.IsEnabled = false;
            }
            else if (gameInfo.WorldSettings.GameMode == GameMode.Cruel)
            {
                CruelButton.IsEnabled = false;
            }
        }
        public override void Load(ValuesDictionary valuesDictionary)
        {
            subsystemGame         = Project.FindSubsystem <SubsystemGameInfo>(throwOnError: true);
            subsystemTerrain      = Project.FindSubsystem <SubsystemTerrain>(throwOnError: true);
            subsystemMovingBlocks = Project.FindSubsystem <SubsystemMovingBlocks>(throwOnError: true);

            terrain = subsystemTerrain.Terrain;
        }
Example #4
0
        /*private Vector2? islandSize;
         *
         * private static float TGSurfaceMultiplier;
         * public bool TGWater;
         * public bool TGExtras;
         * public bool TGCavesAndPockets;*/

        public CreatorNormalTerrain(SubsystemTerrain subsystemTerrain)
        {
            this.subsystemTerrain = subsystemTerrain;
            this.subsystemBottomSuckerBlockBehavior = subsystemTerrain.Project.FindSubsystem <SubsystemBottomSuckerBlockBehavior>(true);
            SubsystemGameInfo subsystemGameInfo = subsystemTerrain.Project.FindSubsystem <SubsystemGameInfo>(true);

            this.worldSettings = subsystemGameInfo.WorldSettings;
            this.worldSeed     = subsystemGameInfo.WorldSeed;
            OldRandom oldRandom = new OldRandom(100 + this.worldSeed);

            Game.Random random = new Game.Random(this.worldSeed);
            float       num    = float.MaxValue;

            this.oceanCorner                = new Vector2(random.UniformFloat(-100f, -100f), random.UniformFloat(-100f, -100f));
            this.temperatureOffset          = new Vector2(random.UniformFloat(-2000f, 2000f), random.UniformFloat(-2000f, 2000f));
            this.humidityOffset             = new Vector2(random.UniformFloat(-2000f, 2000f), random.UniformFloat(-2000f, 2000f));
            this.mountainsOffset            = new Vector2(random.UniformFloat(-2000f, 2000f), random.UniformFloat(-2000f, 2000f));
            this.riversOffset               = new Vector2(random.UniformFloat(-2000f, 2000f), random.UniformFloat(-2000f, 2000f));
            this.TGNewBiomeNoise            = true;
            this.TGBiomeScaling             = 2.5f * this.worldSettings.BiomeSize;
            this.TGShoreFluctuations        = MathUtils.Clamp(2f * num, 0f, 150f);
            this.TGShoreFluctuationsScaling = MathUtils.Clamp(0.04f * num, 0.5f, 3f);
            this.TGOceanSlope               = 0.006f;
            this.TGOceanSlopeVariation      = 0.004f;
            this.TGIslandsFrequency         = 0.01f;
            this.TGDensityBias              = 55f;
            this.TGHeightBias               = 1f;
            this.TGRiversStrength           = 3f;
            this.TGMountainsStrength        = 125f;
            this.TGMountainsPeriod          = 0.0015f;
            this.TGMountainsPercentage      = 0.15f;
            this.TGHillsStrength            = 8f;
            this.TGTurbulenceStrength       = 35f;
            this.TGTurbulenceTopOffset      = 0f;
            this.TGTurbulencePower          = 0.3f;
            TerrainContentsGenerator.TGSurfaceMultiplier = 2f;

            /*this.TGWater = true;
             * this.TGExtras = true;
             * this.TGCavesAndPockets = true;*/
        }
        //private TerrainRaycastResult terrainRaycastResult;

        protected override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
        {
            base.Load(valuesDictionary, idToEntityMap);
            m_componentPlayer = Entity.FindComponent <ComponentPlayer>(true);
            //pilot = Entity.FindComponent<ComponentPilot>(true);
            m_subsystemTerrain  = Project.FindSubsystem <SubsystemTerrain>(true);
            m_subsystemGameInfo = Project.FindSubsystem <SubsystemGameInfo>(true);

            names.Add("Round");
            names.Add("Sphere");
            names.Add("Prism");
            names.Add("Square");
            names.Add("Frame or box");
            names.Add("Maze");
            names.Add("Mountain");
            names.Add("Line");
            names.Add("Coppy/Paste zone in file");
            names.Add("Fast Run");


            m_cameras.Add(new DebugCamera(m_componentPlayer.View));



            Directory.CreateDirectory(ZoneDialog.Path_mod);


            foreach (string category in names)
            {
                m_categories.Add(new Category()
                {
                    Name = category,
                });
            }



            this.LoadBTN();
        }