예제 #1
0
        static void Main(string[] args)
        {
            //string filePath = @"E:\BreathOfTheWild\WiiUDiskImage\content\Map\MainField\A-1\A-1.11_Clustering.sblwp";
            string rootDirectory = @"E:\BreathOfTheWild\WiiUDiskImage\content\Map\MainField";

            foreach (var folder in Directory.GetDirectories(rootDirectory))
            {
                foreach (var file in Directory.GetFiles(folder, "*.sblwp"))
                {
                    Console.WriteLine($"Opening file {Path.GetFileName(file)}...");
                    using (var fileStream = FileUtilities.LoadFile(file))
                    {
                        BLWP blwpFile = new BLWP(Path.GetFileNameWithoutExtension(file));
                        blwpFile.LoadFromStream(fileStream);

                        foreach (var instanceHeader in blwpFile.ObjectInstances)
                        {
                            //Console.WriteLine($"Instance Name: {instanceHeader.InstanceName} Count: {instanceHeader.Instances.Count}");

                            int count = 0;
                            foreach (var instance in instanceHeader.Instances)
                            {
                                //Console.WriteLine($"{count}");
                                //Console.WriteLine($"\tPosition: {instance.Position}");
                                //Console.WriteLine($"\tRotation: {instance.Rotation}");
                                //Console.WriteLine($"\tUniScale: {instance.UniformScale}");
                                count++;
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
        private void OnUserRequestNewFile()
        {
            if (CurrentFile != null)
            {
                bool wantsAction = CloseCurrentFileWithConfirm();
                if (!wantsAction)
                {
                    return;
                }
            }

            CurrentFile = new BLWP(string.Empty);
        }
예제 #3
0
        private void OpenNewFile(string filePath)
        {
            if (!File.Exists(filePath))
            {
                throw new InvalidOperationException("Attempted to open file from non-existant path!");
            }

            m_fileSavePath = filePath;
            string fileName = Path.GetFileNameWithoutExtension(filePath);
            var    newFile  = new BLWP(fileName);

            using (var reader = FileUtilities.LoadFile(filePath))
            {
                newFile.LoadFromStream(reader);
            }

            // Wait until the BLWP is loaded before triggering the INotifyPropertyChanged.
            CurrentFile = newFile;
        }