Ejemplo n.º 1
0
        protected virtual void  OnDisable()
        {
            InternalNGDebug.VerboseLog("NGHub.OnDisable," + this.initialized + "," + this.dockedAsMenu);
            if (this.initialized == false)
            {
                return;
            }

            if (this.dockedAsMenu == true)
            {
                NGEditorPrefs.SetInt(NGHubWindow.ForceRecreateKeyPref + "_" + Application.dataPath, (int)DockState.ProperlyDisabled);
            }

            HQ.SettingsChanged     -= this.OnSettingsChanged;
            Undo.undoRedoPerformed -= this.RestoreComponents;

            Utility.DirectSaveEditorPref(this.backgroundColor, typeof(Color), NGHubWindow.BackgroundColorKeyPref);

            this.initialized = false;

            for (int i = 0; i < this.components.Count; i++)
            {
                this.components[i].Uninit();
            }
        }
Ejemplo n.º 2
0
        private void    SetDockMode(bool mode)
        {
            this.dockedAsMenu = mode;

            if (mode == true)
            {
                NGEditorPrefs.SetInt(NGHubWindow.ForceRecreateKeyPref + "_" + Application.dataPath, (int)DockState.ProperlyEnabled);
                this.UpdateDockPosition();
                Utility.RegisterIntervalCallback(this.UpdateDockPosition, 50);
            }
            else
            {
                NGEditorPrefs.SetInt(NGHubWindow.ForceRecreateKeyPref + "_" + Application.dataPath, (int)DockState.ProperlyDisabled);
                Utility.UnregisterIntervalCallback(this.UpdateDockPosition);
            }
        }
Ejemplo n.º 3
0
        public override void    OnGUIModule(Rect r, NGRemoteHierarchyWindow hierarchy)
        {
            using (LabelWidthRestorer.Get(110F))
            {
                r.height = Constants.SingleLineHeight;
                EditorGUI.BeginChangeCheck();
                this.useJPG = EditorGUI.Toggle(r, "Use JPG", this.useJPG);
                if (EditorGUI.EndChangeCheck() == true)
                {
                    NGEditorPrefs.SetBool(ScreenshotModuleEditor.UseJPGKeyPref, this.useJPG, true);

                    if (hierarchy.IsClientConnected() == true)
                    {
                        hierarchy.Client.AddPacket(new ClientModuleSetUseJPGPacket(this.useJPG));
                    }
                }
                r.y += r.height + 2F;

                EditorGUI.BeginChangeCheck();
                this.useCompression = EditorGUI.Toggle(r, "Use Compression", this.useCompression);
                if (EditorGUI.EndChangeCheck() == true)
                {
                    NGEditorPrefs.SetBool(ScreenshotModuleEditor.UseCompressionKeyPref, this.useCompression, true);

                    if (hierarchy.IsClientConnected() == true)
                    {
                        hierarchy.Client.AddPacket(new ClientModuleSetUseCompressionPacket(this.useCompression));
                    }
                }
                r.y += r.height + 2F;

                EditorGUI.BeginChangeCheck();
                r.width        = 210F;
                this.scaleMode = (ScaleMode)NGEditorGUILayout.EnumPopup(r, "Scale Mode", this.scaleMode);
                if (EditorGUI.EndChangeCheck() == true)
                {
                    NGEditorPrefs.SetInt(ScreenshotModuleEditor.ScaleModeKeyPref, (int)this.scaleMode, true);
                }
            }
        }
Ejemplo n.º 4
0
        private static void     SaveHistoric()
        {
            if (NGNavSelectionWindow.hasChanged == true)
            {
                NGNavSelectionWindow.hasChanged = false;

                StringBuilder buffer = Utility.GetBuffer();

                for (int i = 0; i < NGNavSelectionWindow.historic.Count; ++i)
                {
                    for (int j = 0; j < NGNavSelectionWindow.historic[i].refs.Count; j++)
                    {
                        Object o = NGNavSelectionWindow.historic[i][j];

                        if (o != null)
                        {
                            buffer.Append(o.GetInstanceID());
                            buffer.Append(';');
                        }
                    }

                    // Should never happens, except if the save is corrupted.
                    if (buffer.Length > 0)
                    {
                        buffer.Length -= 1;
                        buffer.Append(',');
                    }
                }

                if (buffer.Length > 0)
                {
                    buffer.Length -= 1;
                }

                NGEditorPrefs.SetString(NGNavSelectionWindow.AutoSavePrefKey, Utility.ReturnBuffer(buffer), true);
                NGEditorPrefs.SetInt(NGNavSelectionWindow.LastHashPrefKey, NGNavSelectionWindow.lastHash);
            }
        }
Ejemplo n.º 5
0
 public override void    Save(string path)
 {
     NGEditorPrefs.SetInt(path, (Int32)this.value);
 }
Ejemplo n.º 6
0
 private void    CloseDock()
 {
     NGEditorPrefs.SetInt(NGHubWindow.ForceRecreateKeyPref + "_" + Application.dataPath, (int)DockState.Closed);
     this.Close();
 }