コード例 #1
0
        private void CopyToAll(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show(
                "Are you sure you want to replace the configuration in all " +
                worlds.Items.Count + " worlds with the current values?",
                "Copy world configuration", MessageBoxButton.YesNo,
                MessageBoxImage.Warning);

            if (result == MessageBoxResult.Yes)
            {
                RenderItem current = SelectedRender;
                foreach (RenderItem item in worlds.Items)
                {
                    item.RenderNormal               = current.RenderNormal;
                    item.RenderLighting             = current.RenderLighting;
                    item.RenderSmoothLighting       = current.RenderSmoothLighting;
                    item.RenderCave                 = current.RenderCave;
                    item.RenderNight                = current.RenderNight;
                    item.RenderSmoothNight          = current.RenderSmoothNight;
                    item.RenderNether               = current.RenderNether;
                    item.RenderNetherLighting       = current.RenderNetherLighting;
                    item.RenderNetherSmoothLighting = current.RenderNetherSmoothLighting;

                    item.RegionItems = current.RegionItems;
                }
            }
        }
コード例 #2
0
        private void SetFocusWorld(RenderItem item)
        {
            RenderName = item.RenderName;

            RenderNormal               = item.RenderNormal;
            RenderLighting             = item.RenderLighting;
            RenderSmoothLighting       = item.RenderSmoothLighting;
            RenderCave                 = item.RenderCave;
            RenderNight                = item.RenderNight;
            RenderSmoothNight          = item.RenderSmoothNight;
            RenderNether               = item.RenderNether;
            RenderNetherLighting       = item.RenderNetherLighting;
            RenderNetherSmoothLighting = item.RenderNetherSmoothLighting;

            RegionList = item.RegionItems;
        }
コード例 #3
0
        private void AddRegion(object sender, RoutedEventArgs e)
        {
            int[] co = BlockSelectionCoords;

            if (co == null)
            {
                console.AppendError("Invalid selection... Use only numbers please");
            }
            else
            {
                this.x1.Clear();
                this.x2.Clear();
                this.z1.Clear();
                this.z2.Clear();

                RegionItem item = new RegionItem(
                    co[0], co[1], co[2], co[3], BlockSelectionMode);

                regions.Items.Add(item);
                RenderItem render = SelectedRender;
                render.RegionItems.Add(item);
            }
        }
コード例 #4
0
        /// <summary>
        /// Inserts all worlds contained inside the directory
        /// It cascades over all of its sub directories
        /// </summary>
        /// <param name="path">Initial folder path</param>
        /// <returns>Total browsed worlds</returns>
        public int AddWorlds(string path)
        {
            int result = 0;

            if (IsWorld(path))
            {
                try {
                    RenderItem item = new RenderItem(path);
                    worlds.Items.Add(item);
                    //console.Append("World added: " + item.Content, ColorCode.MSG);
                    result++;
                } catch (Exception e) {
                    console.AppendError("World at " + path + " seems corrupt. Is the level.dat correct?");
                }
            }
            else
            {
                foreach (DirectoryInfo dir in new DirectoryInfo(path).GetDirectories())
                {
                    result += AddWorlds(dir.FullName);
                }
            }
            return(result);
        }