public new void Reset()
 {
     // default to scene unless we get told otherwise
     filterType = TEMPLATE_TYPE.SCENE;
     windowType = EditorWindowType.NewSceneWizard;
     Control.Reset();
     base.Reset();
 }
 public void SetWizardType(TEMPLATE_TYPE filter)
 {
     filterType = filter;
 }
        /// <summary>
        /// Draw our left side 'template list' view with an optional filter for the type of template to show
        /// </summary>
        /// <param name="filter">Only show TEMPLATE_TYPE templates in the list</param>
        protected void GenerateTemplateListView(CONTENTWINDOW windowType, TEMPLATE_TYPE filter, bool canEdit)
        {
            GUILayout.BeginVertical(GUILayout.MaxWidth(LEFTCOLUMNSIZE), GUILayout.MinWidth(LEFTCOLUMNSIZE));
            {
                GUILayout.Space(10f);
                GUILayout.Label(Loc.TEMPLATELIST, EditorStyles.boldLabel);

                var scrollHeight = curWindowSize.y - 115;
                if (canEdit)
                {
                    scrollHeight = curWindowSize.y - 165;
                }
                _templateScroll = EditorGUILayout.BeginScrollView(_templateScroll, false, true,
                                                                  GUILayout.MinWidth(LEFTCOLUMNSIZE),
                                                                  GUILayout.MaxWidth(LEFTCOLUMNSIZE - 50),
                                                                  GUILayout.MinHeight(scrollHeight));
                {
                    GUILayout.Space(10f);

                    /*
                     *  Our default templates
                     */
                    GUILayout.Label(Loc.BUILTINTEMPLATES, EditorStyles.centeredGreyMiniLabel);
                    GUILayout.Space(10f);
                    foreach (var button in Control.defaultTemplateButtons)
                    {
                        if (filter != TEMPLATE_TYPE.ALL)
                        {
                            // if it's a match, draw it
                            if (button.type == filter)
                            {
                                CreateTemplateButton(button);
                            }
                        }
                        else
                        {
                            CreateTemplateButton(button);
                        }
                    }
                    GUILayout.Space(10f);

                    /*
                     *  Any available user templates in the project
                     */
                    GUILayout.Label(Loc.USERTEMPLATES, EditorStyles.centeredGreyMiniLabel);
                    GUILayout.Space(10f);
                    foreach (var button in Control.userTemplateButtons)
                    {
                        if (filter != TEMPLATE_TYPE.ALL)
                        {
                            if (button.type == filter)
                            {
                                CreateTemplateButton(button);
                            }
                        }
                        else
                        {
                            CreateTemplateButton(button);
                        }
                    }
                    GUILayout.Space(10f);
                }
                GUILayout.EndScrollView();
                GUILayout.Space(10f);

                if (canEdit)
                {
                    // our bottom buttons (below the template list) - users can add a new template or refresh the list (in case they edited / updated them outside of Unity)
                    GUILayout.BeginHorizontal();
                    {
                        var buttonWidth = 115f;

                        GUILayout.Space(10f);
                        var style = EditorStyles.miniButton;

                        var add = new GUIContent(Loc.ADD, null, Loc.TOOLTIP_ADDTEMPLATE);
                        if (GUILayout.Button(add, style, GUILayout.Width(buttonWidth), GUILayout.Height(STANDARDBUTTONHEIGHT)))
                        {
                            // if the user has changed the current config at all, we need to verify what they want us to do before refreshing the template liste
                            if (Control.activeConfigEditDirty)
                            {
                                var action = EditorUtility.DisplayDialogComplex(Loc.DIALOG_CONFIG_DIRTY_LOSECHANGES_TITLE,
                                                                                Loc.DIALOG_CONFIG_DIRTY_LOSECHANGES_MESSAGE,
                                                                                Loc.DIALOG_YES,
                                                                                Loc.DIALOG_NO,
                                                                                Loc.DIALOG_CANCEL);
                                switch (action)
                                {
                                // save
                                case 0:
                                {
                                    Control.SaveConfigChanges();                // save changes
                                    Control.CreateNewConfig(this);              // create new config
                                    break;
                                }

                                // don't save
                                case 1:
                                {
                                    Reset();                                    // undo changes
                                    Control.CreateNewConfig(this);              // create new config
                                    break;
                                }

                                // cancel
                                case 2:
                                {
                                    break;
                                }
                                }
                            }
                            else
                            {
                                Control.CreateNewConfig(this);
                            }
                        }

                        // refresh the template list
                        var refresh = new GUIContent(Loc.REFRESH, null, Loc.TOOLTIP_REFRESHTEMPLATE);
                        if (GUILayout.Button(refresh, style, GUILayout.Width(buttonWidth), GUILayout.Height(STANDARDBUTTONHEIGHT)))
                        {
                            // if the user has changed the current config at all, we need to verify what they want us to do before refreshing the template liste
                            if (Control.activeConfigEditDirty)
                            {
                                var action = EditorUtility.DisplayDialogComplex(Loc.DIALOG_CONFIG_DIRTY_LOSECHANGES_TITLE,
                                                                                Loc.DIALOG_CONFIG_DIRTY_LOSECHANGES_MESSAGE,
                                                                                Loc.DIALOG_YES,
                                                                                Loc.DIALOG_NO,
                                                                                Loc.DIALOG_CANCEL);
                                switch (action)
                                {
                                // save
                                case 0:
                                {
                                    Debug.Log("FIXME: Save changes before refresh");
                                    break;
                                }

                                // don't save
                                case 1:
                                {
                                    Debug.Log("Discard Changes, refresh template list");
                                    Reset();
                                    break;
                                }

                                // cancel
                                case 2:
                                {
                                    Debug.Log("Cancel, don't refresh");
                                    break;
                                }
                                }
                            }
                            else
                            {
                                Reset();
                            }
                        }
                    }
                    GUILayout.EndHorizontal();
                }
            }
            GUILayout.EndVertical();
        }