void DrawToolWindow()
    {
        GUILayout.Label("Select trasnlation type", EditorStyles.boldLabel);
        projectOutFileName = EditorGUILayout.TextField("Output file name: ", projectOutFileName);
        scenePrefix        = EditorGUILayout.TextField("Name key prefix: ", scenePrefix);
        translationOption  = (TranslationOptions)EditorGUILayout.EnumPopup("Translate object type of: ", translationOption);
        extension          = (Extensions)EditorGUILayout.EnumPopup("Select file's extension: ", extension);
        fieldTypes         = (GDEFiledTypes)EditorGUILayout.EnumPopup("Select GDE fields type: ", fieldTypes);


        if (GUILayout.Button("Refresh output file"))
        {
            UpdateObjectWithTranslationComponent();
        }

        else if (GUILayout.Button("Confirm"))
        {
            renameType = RenameType.Selection;
            if (string.IsNullOrEmpty(projectOutFileName) || projectOutFileName.Length > 40)
            {
                projectOutFileName = "results";
                EditorUtility.DisplayDialog("Translation plugin message", "Output file name can't be empty or longher than 40 characters. Output file saved as \"results.txt\".\nYou can retype the name of output file via 4Experience/Tools/Setup Translations window.", "OK");
            }
            InvokeSelectWithUpdate();
            AssetDatabase.Refresh();
        }
    }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:CorpsesAutoopen"/> class.
        /// </summary>
        public CalebConfig()
        {
            // Pozn: Snazim se mit staticky jen uplne minimum, protoze co je v instanci sezere pri rekompilaci GC

            autoHeal          = Config.Profile.UserSettings.GetAttribute(true, "Value", "AutoHeal");
            healMoby          = Config.Profile.UserSettings.GetAttribute(true, "Value", "HealMoby");
            destroySpiderWeb  = Config.Profile.UserSettings.GetAttribute(true, "Value", "DestroySpiderWeb");
            handleFrozen      = Config.Profile.UserSettings.GetAttribute(true, "Value", "HandleFrozen");
            rename            = (RenameType)Config.Profile.UserSettings.GetAttribute((int)RenameType.OnAppeared, "Value", "Rename");
            healMinDamagePerc = Config.Profile.UserSettings.GetAttribute(0, "Value", "HealMinDamagePerc");
            attackDelay       = Config.Profile.UserSettings.GetAttribute(1500, "Value", "AttackDelay");
            useWatcher        = Config.Profile.UserSettings.GetAttribute(false, "Value", "UseWatcher");

            healType = (AutoHealType)Config.Profile.UserSettings.GetAttribute((int)AutoHealType.Automatic, "Value", "HealType");
            loot     = (LootType)Config.Profile.UserSettings.GetAttribute((int)LootType.OpenCorpse, "Value", "Loot");

            trainPoison = Config.Profile.UserSettings.GetAttribute(true, "Value", "TrainPoison");

            friendHitsMessageType = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "FriendHitsMessageType");
            enemyHitsMessageType  = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "EnemyHitsMessageType");
            castMessageType       = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "CastMessageType");
            playerHitsMessageType = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "PlayerHitsMessageType");

            useWallTime = Config.Profile.UserSettings.GetAttribute(true, "Value", "UseWallTime");

            lootItemTypes = Config.Profile.UserSettings.GetAttribute(CalExtension.UOExtensions.Loot.LootDefaultItemTypes, "Value", "LootItemTypes");

            Config.Profile.UserSettings.Loaded += new EventHandler(UserSettings_Loaded);
            Config.Profile.UserSettings.Saving += new EventHandler(UserSettings_Saving);
        }
示例#3
0
        void UserSettings_Loaded(object sender, EventArgs e)
        {
            autoHeal         = Config.Profile.UserSettings.GetAttribute(true, "Value", "AutoHeal");
            healMoby         = Config.Profile.UserSettings.GetAttribute(true, "Value", "HealMoby");
            destroySpiderWeb = Config.Profile.UserSettings.GetAttribute(true, "Value", "DestroySpiderWeb");
            handleFrozen     = Config.Profile.UserSettings.GetAttribute(true, "Value", "HandleFrozen");
            rename           = (RenameType)Config.Profile.UserSettings.GetAttribute((int)RenameType.OnAppeared, "Value", "Rename");

            healMinDamagePerc = Config.Profile.UserSettings.GetAttribute(0, "Value", "HealMinDamagePerc");
            attackDelay       = Config.Profile.UserSettings.GetAttribute(1500, "Value", "AttackDelay");
            useWatcher        = Config.Profile.UserSettings.GetAttribute(false, "Value", "UseWatcher");

            healType = (AutoHealType)Config.Profile.UserSettings.GetAttribute((int)AutoHealType.Automatic, "Value", "HealType");
            loot     = (LootType)Config.Profile.UserSettings.GetAttribute((int)LootType.OpenCorpse, "Value", "Loot");

            trainPoison = Config.Profile.UserSettings.GetAttribute(true, "Value", "TrainPoison");

            friendHitsMessageType = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "FriendHitsMessageType");
            enemyHitsMessageType  = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "EnemyHitsMessageType");
            castMessageType       = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "CastMessageType");
            playerHitsMessageType = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "PlayerHitsMessageType");

            useWallTime = Config.Profile.UserSettings.GetAttribute(true, "Value", "UseWallTime");


            salatAlertHp = Config.Profile.UserSettings.GetAttribute("33%", "Value", "SalatAlertHp");

            lootItemTypes = Config.Profile.UserSettings.GetAttribute(CalExtension.UOExtensions.Loot.LootDefaultItemTypes, "Value", "LootItemTypes");
            // playerAliases = Config.Profile.UserSettings.GetAttribute(String.Empty, "Value", "PlayerAliases");
            playerAliases        = GetGlobalFile("PlayerAliases.txt", "");
            bakGlobalCalebConfig = globalCalebConfig = GetGlobalFile("globalCalebConfig.xml", "<Config></Config>");
            globalDocument       = null;
            OnPropertyChanged(EventArgs.Empty);
        }
 public RenameWindow(Category category)
     : this()
 {
     _renameType = RenameType.RenameCategory;
     Title = "Переименовать категорию";
     ResultNewName = category.Name;
     NewName.Text = category.Name;
 }
示例#5
0
        public RenameSettings(RenameType renameType, List <string> parameters, bool includeExtension = false)
        {
            // if (parameters == null) { throw new ArgumentNullException(nameof(parameters)); }

            this.RenameType       = renameType;
            this.Parameters       = parameters;
            this.IncludeExtension = includeExtension;
        }
 public RenameWindow(Category category)
     : this()
 {
     _renameType   = RenameType.RenameCategory;
     Title         = "Переименовать категорию";
     ResultNewName = category.Name;
     NewName.Text  = category.Name;
 }
 public RenameWindow(Author author) :
     this()
 {
     _renameType   = RenameType.RenameAuthor;
     Title         = "Переименовать автора";
     ResultNewName = author.Name;
     NewName.Text  = author.Name;
 }
 public RenameWindow(Author author)
     : this()
 {
     _renameType = RenameType.RenameAuthor;
     Title = "Переименовать автора";
     ResultNewName = author.Name;
     NewName.Text = author.Name;
 }
示例#9
0
        private void OnGUI()
        {
            _renameType = (RenameType)EditorGUILayout.EnumPopup("重命名方法", _renameType);
            switch (_renameType)
            {
            case RenameType.List:
                DrawGUIByList();
                if (GUILayout.Button(new GUIContent("点我", "点击以重命名")))
                {
                    RenameByList();
                    ResetAll();
                }
                if (_useMySelection && _list != null)
                {
                    for (int i = 0, iMax = _list.Count; i < iMax; i++)
                    {
                        EditorGUILayout.LabelField(_list[i].name);
                    }
                }
                break;

            case RenameType.Add:
                DrawGUIByAdd();
                if (GUILayout.Button(new GUIContent("点我", "点击以重命名")))
                {
                    RenameByAdd();
                    ResetAll();
                }
                break;

            case RenameType.Delete:
                DrawGUIByDelete();
                if (GUILayout.Button(new GUIContent("点我", "点击以重命名")))
                {
                    RenameByDelete();
                    ResetAll();
                }
                break;

            case RenameType.Replace:
                DrawGUIByReplace();
                if (GUILayout.Button(new GUIContent("点我", "点击以重命名")))
                {
                    RenameByReplace();
                    ResetAll();
                }
                break;

            case RenameType.Rename:
                DrawGUIByRename();
                if (GUILayout.Button(new GUIContent("点我", "点击以重命名")))
                {
                    RenameByRename();
                    ResetAll();
                }
                break;
            }
        }
示例#10
0
 public RenameWindow()
 {
     InitializeComponent();
     _renameType   = RenameType.NewCategory;
     Title         = "Создать категорию";
     ResultNewName = "";
     NewName.Text  = "";
     NewName.Focus();
 }
示例#11
0
 public RenameWindow()
 {
     InitializeComponent();
     _renameType = RenameType.NewCategory;
     Title = "Создать категорию";
     ResultNewName = "";
     NewName.Text = "";
     NewName.Focus();
 }
示例#12
0
        /// <summary>
        /// Generates new filename
        /// </summary>
        /// <param name="FileName">Filename, ie image.jpg.</param>
        /// <param name="Keyword">Keyword</param>
        /// <param name="Type">Type of rename</param>
        /// <returns>New filename</returns>
        protected virtual string MakeFileName(string FileName, string Keyword, RenameType Type)
        {
            switch (Type)
            {
            // Random
            case RenameType.Random:
            {
                return((StringHelper.MakeRandom(2, 4, StringCharactersType.UpperCase) +
                        StringHelper.MakeRandom(2, 5, StringCharactersType.LowerCase) +
                        StringHelper.MakeRandom(2, 3, StringCharactersType.Numbers)).Mix() +
                       (FileName.Contains(".") ? FileName.Substring(FileName.LastIndexOf(".")) : string.Empty));
            }

            // Name
            case RenameType.Name:
            {
                return(FileName);
            }

            // Name -> En
            case RenameType.NameToEn:
            {
                return(FileName.Translite());
            }

            // Keyword
            case RenameType.Keyword:
            {
                return(Keyword.Clear() +
                       (FileName.Contains(".") ? FileName.Substring(FileName.LastIndexOf(".")) : string.Empty));
            }

            // Keyword -> En
            case RenameType.KeywordToEn:
            {
                return(Keyword.Translite().Clear() +
                       (FileName.Contains(".") ? FileName.Substring(FileName.LastIndexOf(".")) : string.Empty));
            }

            // FromFile
            case RenameType.FromFile:
            {
                return(this.ExternalImageNames[this.Random.Next(this.ExternalImageNames.Length)].Clear() +
                       (FileName.Contains(".") ? FileName.Substring(FileName.LastIndexOf(".")) : string.Empty));
            }

            // FromFile -> En
            case RenameType.FromFileToEn:
            {
                return(this.ExternalImageNames[this.Random.Next(this.ExternalImageNames.Length)].Translite().Clear() +
                       (FileName.Contains(".") ? FileName.Substring(FileName.LastIndexOf(".")) : string.Empty));
            }
            }

            return(FileName);
        }
示例#13
0
        static string get_hash_string(byte[] buffer, RenameType type)
        {
            byte[] hash;
            switch (type)
            {
            case RenameType.md5: hash = Crypto.MD5.Create().ComputeHash(buffer); break;

            case RenameType.sha1: hash = Crypto.SHA1.Create().ComputeHash(buffer); break;

            case RenameType.sha256: hash = Crypto.SHA256.Create().ComputeHash(buffer); break;

            default: throw new NotSupportedException(type.ToString());
            }
            return(new StringBuilder()
                   .AppendJoin("", hash.Select(b => b.ToString("x").PadLeft(2, '0')))
                   .ToString());
        }
示例#14
0
        //private SynchronizedSettings globalsettings;
        /// <summary>
        /// Initializes a new instance of the <see cref="T:CorpsesAutoopen"/> class.
        /// </summary>
        public CalebConfig()
        {
            // Pozn: Snazim se mit staticky jen uplne minimum, protoze co je v instanci sezere pri rekompilaci GC
            // globalsettings = new SynchronizedSettings("Phoenix");

            // Core.Directory;

            autoHeal          = Config.Profile.UserSettings.GetAttribute(true, "Value", "AutoHeal");
            healMoby          = Config.Profile.UserSettings.GetAttribute(true, "Value", "HealMoby");
            destroySpiderWeb  = Config.Profile.UserSettings.GetAttribute(true, "Value", "DestroySpiderWeb");
            handleFrozen      = Config.Profile.UserSettings.GetAttribute(true, "Value", "HandleFrozen");
            rename            = (RenameType)Config.Profile.UserSettings.GetAttribute((int)RenameType.OnAppeared, "Value", "Rename");
            healMinDamagePerc = Config.Profile.UserSettings.GetAttribute(0, "Value", "HealMinDamagePerc");
            attackDelay       = Config.Profile.UserSettings.GetAttribute(1500, "Value", "AttackDelay");
            useWatcher        = Config.Profile.UserSettings.GetAttribute(false, "Value", "UseWatcher");

            healType = (AutoHealType)Config.Profile.UserSettings.GetAttribute((int)AutoHealType.Automatic, "Value", "HealType");
            loot     = (LootType)Config.Profile.UserSettings.GetAttribute((int)LootType.OpenCorpse, "Value", "Loot");

            trainPoison = Config.Profile.UserSettings.GetAttribute(true, "Value", "TrainPoison");

            friendHitsMessageType = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "FriendHitsMessageType");
            enemyHitsMessageType  = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "EnemyHitsMessageType");
            castMessageType       = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "CastMessageType");
            playerHitsMessageType = (MessagePrintType)Config.Profile.UserSettings.GetAttribute((int)MessagePrintType.Default, "Value", "PlayerHitsMessageType");

            useWallTime = Config.Profile.UserSettings.GetAttribute(true, "Value", "UseWallTime");

            lootItemTypes = Config.Profile.UserSettings.GetAttribute(CalExtension.UOExtensions.Loot.LootDefaultItemTypes, "Value", "LootItemTypes");
            playerAliases = GetGlobalFile("PlayerAliases.txt", "");// Config.Profile.UserSettings.GetAttribute(String.Empty, "Value", "PlayerAliases");

            salatAlertHp = Config.Profile.UserSettings.GetAttribute("33%", "Value", "SalatAlertHp");

            bakGlobalCalebConfig = globalCalebConfig = GetGlobalFile("globalCalebConfig.xml", "<Config></Config>");// Config.Profile.UserSettings.GetAttribute(String.Empty, "Value", "PlayerAliases");

            Config.Profile.UserSettings.Loaded += new EventHandler(UserSettings_Loaded);
            Config.Profile.UserSettings.Saving += new EventHandler(UserSettings_Saving);
            globalDocument = null;
            //globalsettings.Loaded += Globalsettings_Loaded;
            //globalsettings.Saving += Globalsettings_Saving;
        }
 public RenameEngineValidator(RenameType renameType, List <string> parameters, List <NamingRequest> namingRequests)
 {
     this.renameType     = renameType;
     this.parameters     = parameters;
     this.namingRequests = namingRequests;
 }
 void UpdateObjectWithTranslationComponent()
 {
     renameType = RenameType.Update;
     SetTranslationComponent(translationOption);
     AssetDatabase.Refresh();
 }
示例#17
0
 /// <summary>
 /// Generates new filename
 /// </summary>
 /// <param name="FileName">Filename, ie image.jpg.</param>
 /// <param name="Keywords">List of keywords</param>
 /// <param name="Type">Type of rename</param>
 /// <returns>New filename</returns>
 protected virtual string MakeFileName(string FileName, List <string> Keywords, RenameType Type)
 {
     return(MakeFileName(FileName, Keywords[new Random().Next(Keywords.Count)], Type));
 }