Пример #1
0
        public unsafe void ReadSettings()
        {
            Properties.Settings settings = Properties.Settings.Default;

            ModelEditorSettings viewerSettings =
                settings.ViewerSettingsSet ? settings.ViewerSettings : ModelEditorSettings.Default();

            if (viewerSettings == null)
            {
                return;
            }

            modelEditControl1.DistributeSettings(viewerSettings);
            modelEditControl1.ModelPanel.ResetCamera();

            if (viewerSettings.Maximize)
            {
                WindowState = FormWindowState.Maximized;
            }
            else if (viewerSettings.SavePosition)
            {
                StartPosition = FormStartPosition.Manual;
                Location      = new Point(viewerSettings._posX, viewerSettings._posY);
                if (viewerSettings._height > 0)
                {
                    Height = viewerSettings._height;
                }

                if (viewerSettings._width > 0)
                {
                    Width = viewerSettings._width;
                }
            }
        }
Пример #2
0
        public ModelEditorSettings CollectSettings()
        {
            if (Properties.Settings.Default.ViewerSettings == null)
            {
                Properties.Settings.Default.ViewerSettings    = ModelEditorSettings.Default();
                Properties.Settings.Default.ViewerSettingsSet = true;
                Properties.Settings.Default.Save();
            }

            ModelEditorSettings settings = new ModelEditorSettings
            {
                RetrieveCorrAnims    = RetrieveCorrespondingAnimations,
                DisplayExternalAnims = chkExternalAnims.Checked,
                DisplayBRRESAnims    = chkBRRESAnims.Checked,
                DisplayNonBRRESAnims = chkNonBRRESAnims.Checked,
                SyncTexToObj         = SyncTexturesToObjectList,
                SyncObjToVIS0        = SyncVIS0,
                DisableBonesOnPlay   = DisableBonesWhenPlaying,
                GenTansCHR           = CHR0EntryNode._generateTangents,
                GenTansSRT           = SRT0TextureNode._generateTangents,
                GenTansSHP           = SHP0VertexSetNode._generateTangents,
                GenTansLight         = SCN0LightNode._generateTangents,
                GenTansFog           = SCN0FogNode._generateTangents,
                GenTansCam           = SCN0CameraNode._generateTangents,
                FlatBoneList         = rightPanel.pnlBones.chkFlat.Checked,
                BoneListContains     = rightPanel.pnlBones.chkContains.Checked,
                SnapToColl           = _snapToCollisions,
                Maximize             = _maximize,
                UseBindStateBox      = UseBindStateBoxes,
                UsePixelLighting     = ShaderGenerator.UsePixelLighting,

                HideMainWindow = _hideMainWindow,
                SavePosition   = _savePosition,
                _width         = ParentForm.Width,
                _height        = ParentForm.Height,
                _posX          = ParentForm.Location.X,
                _posY          = ParentForm.Location.Y,

                _orbColor            = (ARGBPixel)MDL0BoneNode.DefaultNodeColor,
                _lineColor           = (ARGBPixel)MDL0BoneNode.DefaultLineColor,
                _lineDeselectedColor = (ARGBPixel)MDL0BoneNode.DefaultLineDeselectedColor,
                _floorColor          = (ARGBPixel)_floorHue,

                _undoCount       = _allowedUndos,
                _imageCapFmt     = _imgType,
                _rightPanelWidth = (uint)rightPanel.Width,

                _screenCapPath     = ScreenCapBgLocText.Text,
                _liveTexFolderPath = LiveTextureFolderPath.Text,

                _bgColor    = Properties.Settings.Default.ViewerSettings._bgColor,
                _stgBgColor = Properties.Settings.Default.ViewerSettings._stgBgColor,

                _viewports = ModelPanel.Select(x => ((ModelPanelViewport)x).GetInfo()).ToList()
            };

            return(settings);
        }
        public unsafe void ReadSettings()
        {
            BrawlBox.Properties.Settings settings = BrawlBox.Properties.Settings.Default;
            bool isStage = false;

            if (MainForm.Instance.RootNode is ARCWrapper)
            {
                if (((ARCNode)((ARCWrapper)MainForm.Instance.RootNode).ResourceNode).IsStage)
                {
                    isStage = true;
                }
            }

            ModelEditorSettings viewerSettings = settings.ViewerSettingsSet ? settings.ViewerSettings : ModelEditorSettings.Default(isStage);

            if (settings.ViewerSettingsSet)
            {
                if (settings.ViewerSettings._viewports.Count > 0)
                {
                    if (settings.ViewerSettings._viewports[0]._backColor == new ARGBPixel((byte)0, (byte)230, (byte)230, (byte)250) && isStage)
                    {
                        settings.ViewerSettings.SetColor(Color.Black);
                    }
                    else if (settings.ViewerSettings._viewports[0]._backColor == new ARGBPixel((byte)0, (byte)0, (byte)0, (byte)0) && !isStage)
                    {
                        settings.ViewerSettings.SetColor(Color.Lavender);
                    }
                }
            }

            if (viewerSettings == null)
            {
                return;
            }



            modelEditControl1.DistributeSettings(viewerSettings);
            modelEditControl1.ModelPanel.ResetCamera();

            if (viewerSettings.Maximize)
            {
                WindowState = FormWindowState.Maximized;
            }
            else if (viewerSettings.SavePosition)
            {
                StartPosition = FormStartPosition.Manual;
                Location      = new Point(viewerSettings._posX, viewerSettings._posY);
                if (viewerSettings._height > 0)
                {
                    Height = viewerSettings._height;
                }
                if (viewerSettings._width > 0)
                {
                    Width = viewerSettings._width;
                }
            }
        }
Пример #4
0
        public override void SetDefaultSettings()
        {
            bool isStage = false;

            if (MainForm.Instance.RootNode is ARCWrapper)
            {
                if (((ARCNode)((ARCWrapper)MainForm.Instance.RootNode).ResourceNode).IsStage)
                {
                    isStage = true;
                }
            }

            DistributeSettings(ModelEditorSettings.Default(isStage));
        }
Пример #5
0
        public void DistributeSettings(ModelEditorSettings settings)
        {
            if (settings == null)
            {
                return;
            }

            _updating = true;
            ModelPanel.BeginUpdate();

            RetrieveCorrespondingAnimations = settings.RetrieveCorrAnims;
            SyncTexturesToObjectList        = settings.SyncTexToObj;
            SyncVIS0 = settings.SyncObjToVIS0;
            DisableBonesWhenPlaying = settings.DisableBonesOnPlay;
            _snapToCollisions       = settings.SnapToColl;
            _maximize                               = settings.Maximize;
            _savePosition                           = settings.SavePosition;
            _hideMainWindow                         = settings.HideMainWindow;
            chkExternalAnims.Checked                = settings.DisplayExternalAnims;
            chkBRRESAnims.Checked                   = settings.DisplayBRRESAnims;
            chkNonBRRESAnims.Checked                = settings.DisplayNonBRRESAnims;
            rightPanel.pnlBones.chkFlat.Checked     = settings.FlatBoneList;
            rightPanel.pnlBones.chkContains.Checked = settings.BoneListContains;
            UseBindStateBoxes                       = settings.UseBindStateBox;
            ShaderGenerator.UsePixelLighting        = settings.UsePixelLighting;

            MDL0BoneNode.DefaultNodeColor           = (Color)settings._orbColor;
            MDL0BoneNode.DefaultLineColor           = (Color)settings._lineColor;
            MDL0BoneNode.DefaultLineDeselectedColor = (Color)settings._lineDeselectedColor;
            _floorHue = (Color)settings._floorColor;

            int w = (int)settings._rightPanelWidth;

            if (w >= 50)
            {
                rightPanel.Width = w;
            }

            _allowedUndos     = settings._undoCount;
            ScreenCaptureType = settings._imageCapFmt;

            CHR0EntryNode._generateTangents     = settings.GenTansCHR;
            SRT0TextureNode._generateTangents   = settings.GenTansSRT;
            SHP0VertexSetNode._generateTangents = settings.GenTansSHP;
            SCN0LightNode._generateTangents     = settings.GenTansLight;
            SCN0FogNode._generateTangents       = settings.GenTansFog;
            SCN0CameraNode._generateTangents    = settings.GenTansCam;

            string applicationFolder = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);

            string t = settings._screenCapPath;

            ScreenCapBgLocText.Text = !String.IsNullOrEmpty(t) ? t : applicationFolder + "\\ScreenCaptures";

            t = settings._liveTexFolderPath;
            LiveTextureFolderPath.Text = MDL0TextureNode.TextureOverrideDirectory = !String.IsNullOrEmpty(t) ? t : applicationFolder;

            EnableLiveTextureFolder.Checked = MDL0TextureNode._folderWatcher.EnableRaisingEvents;

            ModelPanel b = this.ModelPanel;

            b.ClearViewports();

            foreach (ModelPanelViewportInfo s in settings._viewports)
            {
                b.AddViewport(s.AsViewport());
            }

            ModelPanel.EndUpdate();
            _updating = false;
        }
Пример #6
0
 public override void SetDefaultSettings()
 {
     DistributeSettings(ModelEditorSettings.Default());
 }