StonehearthEditor.MainForm.NewModCallback.checkNewModName C# (CSharp) Method

checkNewModName() private method

private checkNewModName ( string modName ) : bool
modName string
return bool
            private bool checkNewModName(string modName)
            {
                bool isValid = true;

                if (ModuleDataManager.GetInstance().GetMod(modName) != null)
                {
                    MessageBox.Show("Mod already exists in your mods folder!");
                    isValid = false;
                }

                if (!Regex.IsMatch(modName, "^[a-z0-9_]*$"))
                {
                    MessageBox.Show("Mod name can only contain lowercase characters, numbers and underscore.");
                    isValid = false;
                }

                return isValid;
            }