private void Keys_DrawElementCallback(Rect rect, int index, bool isActive, bool isFocused)
        {
            int line = 0;

            Section section = data.Sections[currentSection];
            Key     key     = section[index];

            if (!sectionExpanded[currentSection])
            {
                EditorGUI.LabelField(LineRect(rect), ModSettingsData.FormattedName(key.Name));
                SetKeySize(currentSection, index, lineHeight);
                return;
            }

            if (IsPreset)
            {
                using (new EditorGUI.DisabledScope(!CurrentPreset[section.Name]))
                {
                    CurrentPreset[section.Name, key.Name] = EditorGUI.ToggleLeft(LineRect(rect, line++), key.Name, CurrentPreset[section.Name, key.Name]);
                    EditorGUI.LabelField(LineRect(rect, line++), key.Description);
                }
            }
            else
            {
                key.Name        = EditorGUI.TextField(LineRect(rect, line++), "Name", key.Name);
                key.Description = EditorGUI.TextField(LineRect(rect, line++), "Description", key.Description);
            }

            using (new EditorGUI.DisabledScope(IsPreset))
                data.SetType(currentSection, index, ref key, (KeyType)EditorGUI.EnumPopup(LineRect(rect, line++), "UI Control", key.KeyType));

            using (new EditorGUI.DisabledScope(IsPreset && !CurrentPreset[section.Name]))
            {
                rect.y += lineHeight * 3;
                int lines = key.OnEditorWindow(
                    rect,
                    (subrect, label, rects) => GUILayoutHelper.Horizontal(subrect, label, rects),
                    (subrect, linesPerItem, rects) => GUILayoutHelper.Vertical(subrect, linesPerItem, rects),
                    cache);

                SetKeySize(currentSection, index, (lines + 4) * lineHeight);
            }
        }
        private void Sections_DrawElementCallback(Rect rect, int index, bool isActive, bool isFocused)
        {
            Section section = data.Sections[currentSection = index];

            if (sectionsExpanded)
            {
                keys[index].DoList(rect);
            }
            else if (IsPreset)
            {
                CurrentPreset[section.Name] = EditorGUI.ToggleLeft(LineRect(rect), section.Name, CurrentPreset[section.Name]);
            }
            else
            {
                GUILayoutHelper.Vertical(rect, 1,
                                         (line) => GUILayoutHelper.Horizontal(line, null,
                                                                              (r) => section.Name       = EditorGUI.TextField(r, "Name", section.Name),
                                                                              (r) => section.IsAdvanced = EditorGUI.ToggleLeft(r, "Is Advanced or experimental", section.IsAdvanced)),
                                         (line) => section.Description = EditorGUI.TextField(line, "Description", section.Description));
            }
        }
        private void OnGUI()
        {
            lineHeight = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;

            GUILayoutHelper.Vertical(() =>
            {
                GUILayoutHelper.Area(new Rect(0, 0, 3 * position.width / 8, position.height), () =>
                {
                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        GUILayout.Box((Texture2D)EditorGUIUtility.Load("Assets/Resources/AppIcon1.png"), GUILayout.Width(50), GUILayout.Height(50));
                        var titleStyle      = new GUIStyle(EditorStyles.largeLabel);
                        titleStyle.font     = EditorGUIUtility.Load("Assets/Resources/Fonts/TESFonts/Kingthings Petrock.ttf") as Font;
                        titleStyle.fontSize = 50;
                        GUILayout.Label(modName, titleStyle);
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        GUILayout.Label(localPath);

                        if (IconButton("d_editicon.sml", "Select target path"))
                        {
                            if (!string.IsNullOrEmpty(targetPath = EditorUtility.OpenFolderPanel("Select mod folder", rootPath, "Mod")))
                            {
                                Load();
                            }
                        }
                        if (IconButton("d_Refresh", "Reload and discharge unsaved changes"))
                        {
                            Load();
                        }
                        using (new EditorGUI.DisabledScope(modName == "None" || duplicateSections || duplicateKeys))
                            if (IconButton("d_P4_CheckOutLocal", "Save settings to disk"))
                            {
                                Save();
                            }
                    });

                    saveOnExit = EditorGUILayout.ToggleLeft(new GUIContent("Save on Exit", "Save automatically when window is closed."), saveOnExit);

                    if (data == null)
                    {
                        EditorGUILayout.HelpBox("Select a folder to store settings.", MessageType.Info);
                        return;
                    }

                    if (duplicateSections)
                    {
                        EditorGUILayout.HelpBox("Multiple sections with the same name detected!", MessageType.Error);
                    }
                    if (duplicateKeys)
                    {
                        EditorGUILayout.HelpBox("Multiple keys with the same name in a section detected!", MessageType.Error);
                    }

                    DrawHeader("Header");
                    EditorGUILayout.HelpBox("Version of settings checked against local values and presets.", MessageType.None);
                    data.Version = EditorGUILayout.TextField("Version", data.Version);

                    DrawHeader("Presets");
                    EditorGUILayout.HelpBox("Pre-defined values for all or a set of settings. Author is an optional field.", MessageType.None);
                    presetsScrollPosition = GUILayoutHelper.ScrollView(presetsScrollPosition, () => presets.DoLayoutList());
                    EditorGUILayout.Space();
                    if (presets.index != -1)
                    {
                        var preset    = data.Presets[presets.index];
                        preset.Author = EditorGUILayout.TextField("Author", preset.Author);
                        EditorGUILayout.PrefixLabel("Description");
                        preset.Description = EditorGUILayout.TextArea(preset.Description);
                    }

                    GUILayout.FlexibleSpace();

                    DrawHeader("Tools");
                    if (GUILayout.Button("Import Legacy INI"))
                    {
                        string iniPath;
                        if (!string.IsNullOrEmpty(iniPath = EditorUtility.OpenFilePanel("Select ini file", rootPath, "ini")))
                        {
                            data.ImportLegacyIni(new IniParser.FileIniDataParser().ReadFile(iniPath));
                        }
                    }
                    else if (GUILayout.Button("Merge presets"))
                    {
                        string path;
                        if (!string.IsNullOrEmpty(path = EditorUtility.OpenFilePanel("Select preset file", rootPath, "json")))
                        {
                            data.LoadPresets(path, true);
                        }
                    }
                    else if (GUILayout.Button("Export localization table"))
                    {
                        string path;
                        if (!string.IsNullOrEmpty(path = EditorUtility.OpenFolderPanel("Select a folder", textPath, "")))
                        {
                            MakeTextDatabase(Path.Combine(path, string.Format("mod_{0}.txt", modName)));
                        }
                    }

                    EditorGUILayout.Space();
                });

                if (data == null)
                {
                    return;
                }

                float areaWidth = 5 * position.width / 8;
                GUILayoutHelper.Area(new Rect(position.width - areaWidth, 0, areaWidth, position.height), () =>
                {
                    EditorGUILayout.Space();

                    if (data.Presets.Count > 0 && presets.index != -1)
                    {
                        if (GUILayout.SelectionGrid(IsPreset ? 1 : 0, new string[] { "Defaults", data.Presets[presets.index].Title }, 2) == 0)
                        {
                            if (IsPreset)
                            {
                                LoadPreset(-1);
                            }
                        }
                        else
                        {
                            if (currentPreset != presets.index)
                            {
                                LoadPreset(presets.index);
                            }
                        }
                    }

                    mainScrollPosition = GUILayoutHelper.ScrollView(mainScrollPosition, () =>
                    {
                        sections.DoLayoutList();

                        duplicateSections = duplicateKeys = false;
                        var sectionNames  = new List <string>();
                        foreach (var section in data.Sections)
                        {
                            section.Name = !string.IsNullOrEmpty(section.Name) ? section.Name.Replace(" ", string.Empty) : GetUniqueName(sectionNames, "Section");
                            sectionNames.Add(section.Name);

                            var keyNames = new List <string>();
                            foreach (var key in section.Keys)
                            {
                                key.Name = !string.IsNullOrEmpty(key.Name) ? key.Name.Replace(" ", string.Empty) : GetUniqueName(keyNames, "Key");
                                keyNames.Add(key.Name);
                            }

                            duplicateKeys |= DuplicatesDetected(keyNames);
                            this.keyNames.Add(keyNames);
                        }
                        this.sectionNames  = sectionNames;
                        duplicateSections |= DuplicatesDetected(sectionNames);
                    });

                    GUILayout.FlexibleSpace();
                    EditorGUILayout.Space();
                });
            });
        }
예제 #4
0
        void OnGUI()
        {
            EditorGUI.indentLevel++;

            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Create New Mod"))
                {
                    modInfo      = new ModInfo();
                    modInfo.GUID = System.Guid.NewGuid().ToString();
                    fileOpen     = SaveModFile();
                    if (modInfo != null)
                    {
                        modInfo.DFUnity_Version = VersionInfo.DaggerfallUnityVersion;
                    }
                }

                else if (GUILayout.Button("Open Existing Mod Settings File"))
                {
                    try
                    {
                        currentFilePath = EditorUtility.OpenFilePanelWithFilters("", ModManager.EditorModsDirectory, new string[] { "JSON", "dfmod.json" });

                        if (!File.Exists(currentFilePath))
                        {
                            Debug.Log("Invalid file selection");
                            currentFilePath = null;
                            fileOpen        = false;
                            return;
                        }

                        modInfo = ReadModInfoFile(currentFilePath);
                        Debug.Log(string.Format("opened mod file for: {0}", modInfo.ModTitle));
                    }
                    catch (Exception ex)
                    {
                        Debug.Log(string.Format("Error while trying to open mod file at: {0} \n {1}", currentFilePath, ex.Message));
                        currentFilePath = null;
                        fileOpen        = false;
                        return;
                    }

                    fileOpen = true;
                }

                if (GUILayout.Button(documentationGUIContent))
                {
                    Help.BrowseURL("https://www.dfworkshop.net/projects/daggerfall-unity/modding/");
                }
            });

            if (!isSupportedEditorVersion)
            {
                EditorGUILayout.HelpBox("Unsupported version of Unity Editor: generated mods may not be compatible with release builds!", MessageType.Warning);
            }

            if (modInfo == null)
            {
                fileOpen = false;
                modInfo  = new ModInfo();
            }

            if (!fileOpen) // if no fileopen, hide rest of UI
            {
                EditorGUILayout.HelpBox("Open a manifest file or create a new one to edit or build a mod.", MessageType.Info);
                return;
            }

            GUILayoutHelper.Vertical(() =>
            {
                EditorGUILayout.Space();
                GUILayoutHelper.Horizontal(() =>
                {
                    EditorGUILayout.LabelField(new GUIContent("Current File: "), titleStyle);
                    GUILayout.Space(-1000);
                    EditorGUILayout.LabelField(new GUIContent(currentFilePath), fieldStyle);
                });
                EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);

                EditorGUI.indentLevel++;

                GUILayoutHelper.Vertical(() =>
                {
                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Title:"), titleStyle);
                        modInfo.ModTitle = EditorGUILayout.TextField(modInfo.ModTitle, GUILayout.MinWidth(1000));
                    });

                    EditorGUILayout.Space();


                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Version:"), titleStyle);
                        modInfo.ModVersion = EditorGUILayout.TextField(modInfo.ModVersion, GUILayout.MinWidth(1000));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Creator:"), titleStyle);
                        modInfo.ModAuthor = EditorGUILayout.TextField(modInfo.ModAuthor, GUILayout.MinWidth(1000));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Contact Info:"), titleStyle);
                        modInfo.ContactInfo = EditorGUILayout.TextField(modInfo.ContactInfo, GUILayout.MinWidth(1000));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("DFUnity Version:"), titleStyle);
                        modInfo.DFUnity_Version = EditorGUILayout.TextField(modInfo.DFUnity_Version, GUILayout.MinWidth(1000));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Description:"), titleStyle);
                        modInfo.ModDescription = EditorGUILayout.TextArea(modInfo.ModDescription, GUILayout.MinWidth(1000));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod GUID: "), titleStyle);
                        EditorGUILayout.LabelField(new GUIContent(modInfo.GUID));
                        if (GUILayout.Button("Generate New GUID"))
                        {
                            modInfo.GUID = System.Guid.NewGuid().ToString();
                        }
                        GUILayout.Space(300);
                    });
                });

                EditorGUILayout.Space();
                EditorGUILayout.Space();
                EditorGUILayout.Space();
                EditorGUI.indentLevel--;

                GUILayoutHelper.Horizontal(() =>
                {
                    if (GUILayout.Button("Add Selected Asset(s)"))
                    {
                        AddSelectedAssetsToMod();
                    }

                    else if (GUILayout.Button("Remove Selected Asset(s)"))
                    {
                        if (Assets == null || Assets.Count < 1)
                        {
                            return;
                        }
                        else if (assetSelection < 0 || assetSelection > Assets.Count)
                        {
                            return;
                        }
                        else
                        {
                            Assets.RemoveAt(assetSelection);
                        }
                    }
                    else if (GUILayout.Button("Clear ALL Asset(s)"))
                    {
                        if (Assets != null)
                        {
                            Assets = new List <string>();
                        }
                    }
                });
            });

            EditorGUILayout.Space();

            ShowFileFoldOut = GUILayoutHelper.Foldout(ShowFileFoldOut, new GUIContent("Files"), () =>
            {
                scrollPos = GUILayoutHelper.ScrollView(scrollPos, () =>
                {
                    assetSelection = GUILayout.SelectionGrid(assetSelection, modInfo.Files.ToArray(), 1);
                });
            });

            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();

            EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);

            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.BeginVertical();

            GUILayout.Label("\tBuild Targets:\n", titleStyle);

            for (int i = 0; i < buildTargetsToggles.Length; i++)
            {
                buildTargetsToggles[i] = EditorGUILayout.Toggle(buildTargets[i].ToString(), buildTargetsToggles[i], GUILayout.ExpandWidth(false));
            }

            EditorGUILayout.EndVertical();
            EditorGUILayout.BeginVertical();

            GUILayout.Label("Compression Type:\n", titleStyle);
            compressionOption = (ModCompressionOptions)EditorGUILayout.EnumPopup("", compressionOption, GUILayout.MaxWidth(125));
            EditorGUILayout.EndVertical();

            if (GUILayout.Button("Collect Dependencies", GUILayout.MaxWidth(200)) && ModInfoReady)
            {
                foreach (var assetPath in Assets.ToArray())
                {
                    var depends = AssetDatabase.GetDependencies(assetPath);
                    foreach (var d in depends)
                    {
                        AddAssetToMod(d);
                    }
                }
            }

            GUILayout.Space(100);
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();

            EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);

            EditorGUILayout.Space();

            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField("Build Path:", titleStyle);
                GUILayout.Space(-1000);
                EditorGUILayout.LabelField(modOutPutPath, fieldStyle);
                if (GUILayout.Button("Set", GUILayout.Width(50)))
                {
                    modOutPutPath = EditorUtility.SaveFolderPanel("Select Destination,", Application.dataPath, "");
                    Debug.Log("build path: " + modOutPutPath);
                }
            });
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);

            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Save Mod Settings to File"))
                {
                    SaveModFile(File.Exists(currentFilePath));
                    Debug.Log("got path: " + currentFilePath);
                }
                else if (GUILayout.Button("Build Mod"))
                {
                    SaveModFile(true);
                    BuildMod();
                }
            });
        }
        void OnGUI()
        {
            EditorGUI.indentLevel++;

            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Create New Mod"))
                {
                    fileOpen = true;
                    if (modInfo != null)
                    {
                        modInfo.DFUnity_Verion = VersionInfo.DaggerfallUnityVersion;
                    }
                }

                else if (GUILayout.Button("Open Existing Mod Settings File"))
                {
                    try
                    {
                        currentFilePath = EditorUtility.OpenFilePanelWithFilters("", Application.dataPath, new string[] { "JSON", "dfmod.json" });

                        if (!File.Exists(currentFilePath))
                        {
                            Debug.Log("Invalid file selection");
                            currentFilePath = null;
                            fileOpen        = false;
                            return;
                        }

                        string inPut = File.ReadAllText(currentFilePath);
                        modInfo      = (ModInfo)JsonUtility.FromJson(inPut, typeof(ModInfo));

                        Debug.Log(string.Format("opened mod file for: {0}", modInfo.ModTitle));
                    }
                    catch (Exception ex)
                    {
                        Debug.Log(string.Format("Error while trying to open mod file at: {0} \n {1}", currentFilePath, ex.Message));
                        currentFilePath = null;
                        fileOpen        = false;
                        return;
                    }

                    fileOpen = true;
                }
            });

            if (modInfo == null)
            {
                fileOpen = false;
                modInfo  = new ModInfo();
            }
            if (!fileOpen) // if no fileopen, hide rest of UI
            {
                return;
            }

            GUILayoutHelper.Vertical(() =>
            {
                EditorGUILayout.LabelField(new GUIContent("Mod File Path:" + currentFilePath));
                EditorGUI.indentLevel++;

                GUILayoutHelper.Vertical(() =>
                {
                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod File Name:"));
                        modInfo.ModFileName = EditorGUILayout.TextField(modInfo.ModFileName.ToLower(), GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Title:"));
                        modInfo.ModTitle = EditorGUILayout.TextField(modInfo.ModTitle, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();


                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Version:"));
                        modInfo.ModVersion = EditorGUILayout.TextField(modInfo.ModVersion, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Creator:"));
                        modInfo.ModAuthor = EditorGUILayout.TextField(modInfo.ModAuthor, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Contact Info:"));
                        modInfo.ContactInfo = EditorGUILayout.TextField(modInfo.ContactInfo, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("DFUnity Version:"));
                        modInfo.DFUnity_Verion = EditorGUILayout.TextField(modInfo.DFUnity_Verion, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Description:"));
                        modInfo.ModDescription = EditorGUILayout.TextArea(modInfo.ModDescription, GUILayout.MinWidth(600));
                    });
                });

                EditorGUILayout.Space();
                EditorGUI.indentLevel--;

                GUILayoutHelper.Horizontal(() =>
                {
                    if (GUILayout.Button("Add Selected Asset(s)"))
                    {
                        AddAssetToMod();
                    }

                    else if (GUILayout.Button("Remove Selected Asset(s)"))
                    {
                        if (Assets == null || Assets.Count < 1)
                        {
                            return;
                        }
                        else if (assetSelection < 0 || assetSelection > Assets.Count)
                        {
                            return;
                        }
                        else
                        {
                            Assets.RemoveAt(assetSelection);
                        }
                    }
                    else if (GUILayout.Button("Clear ALL Asset(s)"))
                    {
                        if (Assets != null)
                        {
                            Assets = new List <string>();
                        }
                    }
                });
            });

            EditorGUILayout.Space();

            ShowFileFoldOut = GUILayoutHelper.Foldout(ShowFileFoldOut, new GUIContent("Files"), () =>
            {
                scrollPos = GUILayoutHelper.ScrollView(scrollPos, () =>
                {
                    assetSelection = GUILayout.SelectionGrid(assetSelection, modInfo.Files.ToArray(), 1);
                });
            });

            EditorGUILayout.Space();
            EditorGUILayout.Space();

            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Save Mod Settings to File"))
                {
                    SaveModFile();
                    Debug.Log("got path: " + currentFilePath);
                }
                else if (GUILayout.Button("Build Mod"))
                {
                    SaveModFile();
                    BuildMod();
                }
            });
        }
예제 #6
0
        void OnGUI()
        {
            EditorGUI.indentLevel++;

            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Create New Mod"))
                {
                    modInfo      = new ModInfo();
                    modInfo.GUID = System.Guid.NewGuid().ToString();
                    fileOpen     = SaveModFile();
                    //currentFilePath = EditorUtility.SaveFilePanel("", GetTempModDirPath(), "", "dfmod.json");
                    if (modInfo != null)
                    {
                        modInfo.DFUnity_Version = VersionInfo.DaggerfallUnityVersion;
                    }
                }

                else if (GUILayout.Button("Open Existing Mod Settings File"))
                {
                    try
                    {
                        currentFilePath = EditorUtility.OpenFilePanelWithFilters("", GetTempModDirPath(), new string[] { "JSON", "dfmod.json" });

                        if (!File.Exists(currentFilePath))
                        {
                            Debug.Log("Invalid file selection");
                            currentFilePath = null;
                            fileOpen        = false;
                            return;
                        }

                        modInfo = ReadModInfoFile(currentFilePath);
                        Debug.Log(string.Format("opened mod file for: {0}", modInfo.ModTitle));
                    }
                    catch (Exception ex)
                    {
                        Debug.Log(string.Format("Error while trying to open mod file at: {0} \n {1}", currentFilePath, ex.Message));
                        currentFilePath = null;
                        fileOpen        = false;
                        return;
                    }

                    fileOpen = true;
                }
            });

            if (modInfo == null)
            {
                fileOpen = false;
                modInfo  = new ModInfo();
            }
            if (!fileOpen) // if no fileopen, hide rest of UI
            {
                return;
            }

            GUILayoutHelper.Vertical(() =>
            {
                EditorGUILayout.Space();
                GUILayoutHelper.Horizontal(() =>
                {
                    EditorGUILayout.LabelField(new GUIContent("Current File:  " + currentFilePath));
                });
                EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);

                EditorGUI.indentLevel++;

                GUILayoutHelper.Vertical(() =>
                {
                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Title:"));
                        modInfo.ModTitle = EditorGUILayout.TextField(modInfo.ModTitle, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();


                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Version:"));
                        modInfo.ModVersion = EditorGUILayout.TextField(modInfo.ModVersion, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Creator:"));
                        modInfo.ModAuthor = EditorGUILayout.TextField(modInfo.ModAuthor, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Contact Info:"));
                        modInfo.ContactInfo = EditorGUILayout.TextField(modInfo.ContactInfo, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("DFUnity Version:"));
                        modInfo.DFUnity_Version = EditorGUILayout.TextField(modInfo.DFUnity_Version, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod Description:"));
                        modInfo.ModDescription = EditorGUILayout.TextArea(modInfo.ModDescription, GUILayout.MinWidth(600));
                    });

                    EditorGUILayout.Space();

                    GUILayoutHelper.Horizontal(() =>
                    {
                        EditorGUILayout.LabelField(new GUIContent("Mod GUID: "));
                        EditorGUILayout.LabelField(new GUIContent(modInfo.GUID));
                        if (GUILayout.Button("Generate New GUID"))
                        {
                            modInfo.GUID = System.Guid.NewGuid().ToString();
                        }
                        //modInfo.ModDescription = EditorGUILayout.TextArea(modInfo.ModDescription, GUILayout.MinWidth(600));
                    });
                });

                EditorGUILayout.Space();
                EditorGUI.indentLevel--;

                GUILayoutHelper.Horizontal(() =>
                {
                    if (GUILayout.Button("Add Selected Asset(s)"))
                    {
                        AddSelectedAssetsToMod();
                    }

                    else if (GUILayout.Button("Remove Selected Asset(s)"))
                    {
                        if (Assets == null || Assets.Count < 1)
                        {
                            return;
                        }
                        else if (assetSelection < 0 || assetSelection > Assets.Count)
                        {
                            return;
                        }
                        else
                        {
                            Assets.RemoveAt(assetSelection);
                        }
                    }
                    else if (GUILayout.Button("Clear ALL Asset(s)"))
                    {
                        if (Assets != null)
                        {
                            Assets = new List <string>();
                        }
                    }
                });
            });

            EditorGUILayout.Space();

            ShowFileFoldOut = GUILayoutHelper.Foldout(ShowFileFoldOut, new GUIContent("Files"), () =>
            {
                scrollPos = GUILayoutHelper.ScrollView(scrollPos, () =>
                {
                    assetSelection = GUILayout.SelectionGrid(assetSelection, modInfo.Files.ToArray(), 1);
                });
            });

            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);

            GUILayout.Label("Build Targets");

            GUILayoutHelper.Horizontal(() =>
            {
                for (int i = 0; i < buildTargetsToggles.Length; i++)
                {
                    buildTargetsToggles[i] = EditorGUILayout.Toggle(buildTargets[i].ToString(), buildTargetsToggles[i], GUILayout.ExpandWidth(true));
                }
            });

            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);



            GUILayoutHelper.Horizontal(() =>
            {
                EditorGUILayout.LabelField("Build Path:     " + modOutPutPath);
                if (GUILayout.Button("Set", GUILayout.Width(50)))
                {
                    modOutPutPath = EditorUtility.SaveFolderPanel("Select Destination,", Application.dataPath, "");
                    Debug.Log("build path: " + modOutPutPath);
                }
            });
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.Space();
            EditorGUILayout.TextArea("", GUI.skin.horizontalSlider);


            GUILayoutHelper.Horizontal(() =>
            {
                if (GUILayout.Button("Save Mod Settings to File"))
                {
                    SaveModFile(File.Exists(currentFilePath));
                    Debug.Log("got path: " + currentFilePath);
                }
                else if (GUILayout.Button("Build Mod"))
                {
                    SaveModFile(true);
                    BuildMod();
                }
            });
        }