Esempio n. 1
0
        public static void SaveMaterial(string path, GensMaterial mat)
        {
            uint rootNodeType = mat.Header.RootNodeType;

            switch (Types.CurrentDataType)
            {
            case Types.DataTypes.Forces:
            case Types.DataTypes.LW:
                mat.Header = new MirageHeader();
                mat.Header.RootNodeType = rootNodeType;
                break;

            case Types.DataTypes.Gens:
            case Types.DataTypes.SU:
                mat.Header = new GensHeader();
                mat.Header.RootNodeType = rootNodeType;
                break;

            // TODO: Add Storybook Support
            case Types.DataTypes.Storybook:
                throw new NotImplementedException(
                          "Could not save, Storybook materials are not yet supported!");

            // TODO: Add Colors Support
            case Types.DataTypes.Colors:
                throw new NotImplementedException(
                          "Could not save, Colors materials are not yet supported!");

            // TODO: Add 06 Support
            case Types.DataTypes.S06:
                throw new NotImplementedException(
                          "Could not save, '06 materials are not yet supported!");

            // TODO: Add Heroes/Shadow Support
            case Types.DataTypes.Shadow:
            case Types.DataTypes.Heroes:
                throw new NotImplementedException(
                          "Could not save, Heroes/Shadow materials are not yet supported!");

            // TODO: Add SA2 Support
            case Types.DataTypes.SA2:
                throw new NotImplementedException(
                          "Could not save, SA2 materials are not yet supported!");

            default:
                throw new Exception(
                          "Could not save, game type has not been set!");
            }

            mat.Save(path, true);
        }
Esempio n. 2
0
        public void SaveMaterial(bool saveAs)
        {
            if (saveAs)
            {
                var sfd = new SaveFileDialog()
                {
                    Title  = "Save Material As...",
                    Filter = "Hedgehog Engine Material (*.material)|*.material|All files (*.*)|*.*"
                };

                if (sfd.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                matPath = sfd.FileName;
            }

            UpdateMaterial();
            Material.Save(matPath, true);
            UpdateTitle(Path.GetFileNameWithoutExtension(matPath));
        }