public override void OnInspectorGUI()
        {
            EEGUIStyle.Ensure();

            GUILayout.BeginHorizontal();
            GUILayout.Box(Logo, EEGUIStyle.Box, GUILayout.Width(58), GUILayout.Height(36));
            EditorGUILayout.HelpBox(@"To modify this, open the settings window.", MessageType.Info);
            GUILayout.EndHorizontal();
            EditorGUILayout.Separator();

            var prevGUIState = GUI.enabled;

            GUI.enabled = false;
            base.OnInspectorGUI();
            GUI.enabled = prevGUIState;

            EditorGUILayout.Separator();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Edit", GUILayout.Width(100), GUILayout.Height(20)))
            {
                EESettingsEditor.OpenSettingsWindow();
            }
            GUILayout.Space(50);
            if (GUILayout.Button("Reset", GUILayout.Width(100), GUILayout.Height(20)))
            {
                if (EditorUtility.DisplayDialog("EasyExcel", "Are you sure to reset it?", "Yes", "Cancel"))
                {
                    EESettings.Current.ResetAll();
                    EditorUtility.SetDirty(EESettings.Current);
                }
            }
            GUILayout.EndHorizontal();
        }
Пример #2
0
        private void OnGUI()
        {
            EEGUIStyle.Ensure();

            GUILayout.Space(10);
            GUILayout.Label("EasyExcel", EEGUIStyle.largeLabel);

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("Version " + EEConstant.Version, EEGUIStyle.label);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("(c) 2019 Locke. All rights reserved.", EEGUIStyle.label);
            GUILayout.EndHorizontal();

            GUILayout.Space(20);

            GUILayout.Label("Support", EEGUIStyle.boldLabel);
            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("email [email protected]", EEGUIStyle.label);
            GUILayout.EndHorizontal();
        }
Пример #3
0
        private void OnGUI()
        {
            EEGUIStyle.Ensure();

            GUILayout.Space(10);
            GUILayout.Box(logo, EEGUIStyle.Box, GUILayout.Width(200), GUILayout.Height(124));
            GUILayout.Label("EasyExcel", EEGUIStyle.largeLabel);

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("Version " + EEConstant.Version, EEGUIStyle.label);
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            GUILayout.Label("(c) 2018-2019 Locke. All rights reserved.", EEGUIStyle.label);
            GUILayout.EndHorizontal();

            GUILayout.Space(10);

            GUILayout.Label("Support", EEGUIStyle.boldLabel);

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            if (GUILayout.Button("Asset Store", EEGUIStyle.link))
            {
                Application.OpenURL("http://u3d.as/WsS");
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(5);

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            if (GUILayout.Button("locke.indienova.com", EEGUIStyle.link))
            {
                Application.OpenURL("https://locke.indienova.com/");
            }
            GUILayout.EndHorizontal();

            GUILayout.Space(5);

            GUILayout.BeginHorizontal();
            GUILayout.Space(20);
            if (GUILayout.Button("Email [email protected]", EEGUIStyle.link))
            {
                Application.OpenURL("mailto:[email protected]");
            }
            GUILayout.EndHorizontal();
        }
Пример #4
0
 private void OnGUI()
 {
     EEGUIStyle.Ensure();
     try
     {
         if (_currentEeWorkbook != null)
         {
             EditorDrawHelper.DrawTableTab(_currentEeWorkbook, ref selectIndex);
             _currentEeWorksheet = _currentEeWorkbook.sheets[selectIndex];
             EditorDrawHelper.DrawTable(_currentEeWorksheet);
             DrawMenus();
         }
     }
     catch (Exception e)
     {
         EELog.LogError(e.ToString());
     }
 }
Пример #5
0
        public override void OnInspectorGUI()
        {
            EEGUIStyle.Ensure();

            var dataCollection = target as EERowDataCollection;

            if (dataCollection != null)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Box(Logo, EEGUIStyle.Box, GUILayout.Width(58), GUILayout.Height(36));
                EditorGUILayout.HelpBox(@"This file is generated from " + dataCollection.ExcelFileName, MessageType.Info);
                GUILayout.EndHorizontal();

                var prevGUIState = GUI.enabled;
                GUI.enabled = false;
                EditorGUILayout.LabelField("Element Count:  " + dataCollection.GetDataCount());
                base.OnInspectorGUI();
                GUI.enabled = prevGUIState;
            }
            else
            {
                base.OnInspectorGUI();
            }
        }
Пример #6
0
        private void OnGUI()
        {
            EEGUIStyle.Ensure();

            if (settings == null)
            {
                EditorGUILayout.HelpBox("Cannot find EasyExcel settings file", MessageType.Error);
                return;
            }

            const float tipSpace = 5;

            GUILayout.Space(5);
            GUILayout.Label(settings.Lang == EELang.CN ? "EasyExcel设置" : "EasyExcel Settings", EEGUIStyle.largeLabel);
            GUILayout.Space(5);

            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "语言" : "Language", EEGUIStyle.label, GUILayout.Width(60));
            var langType = (EELang)EEGUIStyle.EnumPopup(settings.Lang, GUILayout.Width(100));

            if (langType != settings.Lang)
            {
                settings.Lang = langType;
            }
            GUILayout.Space(100);
            settings.ShowHelp = GUILayout.Toggle(settings.ShowHelp, settings.Lang == EELang.CN ? "显示帮助" : "Show Help");
            GUILayout.EndHorizontal();
            GUILayout.Space(10);

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("nameRowIndex"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "字段名称行" : "Row of Name", EEGUIStyle.label, nameOptions);
            settings.NameRowIndex = EditorGUILayout.IntField(settings.NameRowIndex, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("typeRowIndex"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "字段类型行" : "Row of Type", EEGUIStyle.label, nameOptions);
            settings.TypeRowIndex = EditorGUILayout.IntField(settings.TypeRowIndex, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("dataStartIndex"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "数据开始行" : "Row of Data", EEGUIStyle.label, nameOptions);
            settings.DataStartIndex = EditorGUILayout.IntField(settings.DataStartIndex, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("useFileNameAsNameSpace"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            settings.UseFileNameAsNameSpace = GUILayout.Toggle(settings.UseFileNameAsNameSpace, settings.Lang == EELang.CN ? "使用文件名作为命名空间" : "Use File Name As Name Space");
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.UseFileNameAsNameSpace)
            {
                if (settings.ShowHelp)
                {
                    GUILayout.Label(GetSettingFieldComment("nameSpacePrefix"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
                }
                GUILayout.BeginHorizontal();
                GUILayout.Label(settings.Lang == EELang.CN ? "命名空间前缀" : "Name Space Prefix", EEGUIStyle.label, nameOptions);
                settings.NameSpacePrefix = EditorGUILayout.TextField(settings.NameSpacePrefix, EEGUIStyle.textField, valueOptions);
                GUILayout.EndHorizontal();
            }
            else
            {
                if (settings.ShowHelp)
                {
                    GUILayout.Label(GetSettingFieldComment("nameSpace"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
                }
                GUILayout.BeginHorizontal();
                GUILayout.Label(settings.Lang == EELang.CN ? "命名空间" : "Name Space", EEGUIStyle.label, nameOptions);
                settings.NameSpace = EditorGUILayout.TextField(settings.NameSpace, EEGUIStyle.textField, valueOptions);
                GUILayout.EndHorizontal();
            }
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("sheetDataPostfix"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "页数据类名后缀" : "SheetData Postfix", EEGUIStyle.label, nameOptions);
            settings.SheetDataPostfix = EditorGUILayout.TextField(settings.SheetDataPostfix, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("rowDataPostfix"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "行数据类名后缀" : "RowData Postfix", EEGUIStyle.label, nameOptions);
            settings.RowDataPostfix = EditorGUILayout.TextField(settings.RowDataPostfix, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("generatedAssetPath"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "生成资源文件路径" : "AssetPath", EEGUIStyle.label, nameOptions);
            settings.GeneratedAssetPath = EditorGUILayout.TextField(settings.GeneratedAssetPath, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("generatedScriptPath"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "生成C#文件路径" : "CSharpPath", EEGUIStyle.label, nameOptions);
            settings.GeneratedScriptPath = EditorGUILayout.TextField(settings.GeneratedScriptPath, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("generatedGoAssetPath"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "生成资源文件路径" : "AssetPath", EEGUIStyle.label, nameOptions);
            settings.GeneratedGoAssetPath = EditorGUILayout.TextField(settings.GeneratedGoAssetPath, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("generatedGolangScriptPath"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "生成Golang文件路径" : "Golang Path", EEGUIStyle.label, nameOptions);
            settings.GeneratedGolangScriptPath = EditorGUILayout.TextField(settings.GeneratedGolangScriptPath, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("goTxtFieldSplitStr"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "生成Golang文件路径" : "Golang Path", EEGUIStyle.label, nameOptions);
            settings.GoTxtFieldSplitStr = EditorGUILayout.TextField(settings.GoTxtFieldSplitStr, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("goTxtRowSplitStr"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label(settings.Lang == EELang.CN ? "生成Golang文件路径" : "Golang Path", EEGUIStyle.label, nameOptions);
            settings.GoTxtRowSplitStr = EditorGUILayout.TextField(settings.GoTxtRowSplitStr, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(tipSpace);
            }
        }
Пример #7
0
        private void OnGUI()
        {
            EEGUIStyle.Ensure();

            if (settings == null)
            {
                EditorGUILayout.HelpBox("Cannot find EasyExcel settings file", MessageType.Error);
                return;
            }

            GUILayout.Space(5);
            GUILayout.Label("EasyExcel Settings", EEGUIStyle.largeLabel);
            GUILayout.Space(10);

            settings.ShowHelp = GUILayout.Toggle(settings.ShowHelp, "Show Help");

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("NameRowIndex"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Row of Name", EEGUIStyle.label, nameOptions);
            settings.NameRowIndex = EditorGUILayout.IntField(settings.NameRowIndex, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(10);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("TypeRowIndex"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Row of Type", EEGUIStyle.label, nameOptions);
            settings.TypeRowIndex = EditorGUILayout.IntField(settings.TypeRowIndex, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(10);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("DataStartIndex"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Row of Data", EEGUIStyle.label, nameOptions);
            settings.DataStartIndex = EditorGUILayout.IntField(settings.DataStartIndex, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(10);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("NameSpace"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Name Space", EEGUIStyle.label, nameOptions);
            settings.NameSpace = EditorGUILayout.TextField(settings.NameSpace, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(10);
            }

            /*GUILayout.Space(5);
             * if (settings.ShowHelp)
             *      GUILayout.Label(GetSettingFieldComment("RowDataClassNamePostfix"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
             * GUILayout.BeginHorizontal();
             * GUILayout.Label("RowDataClassNamePostfix", EEGUIStyle.label, nameOptions);
             * settings.RowDataPostfix = EditorGUILayout.TextField(settings.RowDataPostfix, EEGUIStyle.textField, valueOptions);
             * GUILayout.EndHorizontal();
             * if (settings.ShowHelp)
             *      GUILayout.Space(10);
             *
             * GUILayout.Space(5);
             * if (settings.ShowHelp)
             *      GUILayout.Label(GetSettingFieldComment("DataTableClassNamePostfix"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
             * GUILayout.BeginHorizontal();
             * GUILayout.Label("DataTableClassNamePostfix", EEGUIStyle.label, nameOptions);
             * settings.DataTablePostfix = EditorGUILayout.TextField(settings.DataTablePostfix, EEGUIStyle.textField, valueOptions);
             * GUILayout.EndHorizontal();
             * if (settings.ShowHelp)
             *      GUILayout.Space(10);*/

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("GeneratedAssetPath"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("AssetPath", EEGUIStyle.label, nameOptions);
            settings.GeneratedAssetPath = EditorGUILayout.TextField(settings.GeneratedAssetPath, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(10);
            }

            GUILayout.Space(5);
            if (settings.ShowHelp)
            {
                GUILayout.Label(GetSettingFieldComment("GeneratedScriptPath"), EEGUIStyle.helpBox, GUILayout.Width(helpLength));
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("CSharpPath", EEGUIStyle.label, nameOptions);
            settings.GeneratedScriptPath = EditorGUILayout.TextField(settings.GeneratedScriptPath, EEGUIStyle.textField, valueOptions);
            GUILayout.EndHorizontal();
            if (settings.ShowHelp)
            {
                GUILayout.Space(10);
            }
        }
Пример #8
0
 private void Awake()
 {
     EEGUIStyle.Ensure();
 }