예제 #1
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            CFGFile ini = new CFGFile(Application.StartupPath + @"\config.ini");

            if (checkBox1.Checked == true)
            {
                ini.SetValue("LoLToolsX", "AutoUpdate", "false");
            }
            else
            {
                ini.SetValue("LoLToolsX", "AutoUpdate", "true");
            }
        }
예제 #2
0
        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            CFGFile ini = new CFGFile(Variable.CurrentDirectory + @"\config.ini");

            if (checkBox1.Checked == true)
            {
                ini.SetValue("LoLToolsX", "AutoUpdate", "false");
            }
            else
            {
                ini.SetValue("LoLToolsX", "AutoUpdate", "true");
            }
        }
예제 #3
0
        private void LoadConfig(FileInfo file)
        {
            Logger.Debug("Trying to load config {0}...", file.FullName.Quote());
            if (!file.Exists)
            {
                return;
            }
            var newCFG = new CFGFile(file);

            Logger.Info("Loaded config {0} with {1} lines.", file.Name.Quote(), newCFG.Data.Lines.Count);
            loadedCFG = newCFG;
            openConfigExternallyToolStripMenuItem.Enabled = true;
            reloadConfigToolStripMenuItem.Enabled         = true;
            saveConfigToolStripMenuItem.Enabled           = true;
            FillConfig();
        }
예제 #4
0
        public static void Synchronize(RafManager manager)
        {
            List <BuildingRecord> records = new List <BuildingRecord>();

            foreach (var file in manager.GetFiles("ObjectCFG.cfg"))
            {
                CFGFile cfg = new CFGFile(file.GetContent(true));

                int mapId = Helper.GetMapId(file.Path);

                foreach (var obj in cfg.Objects)
                {
                    BuildingRecord record = new BuildingRecord();

                    record.MapId             = mapId;
                    record.Name              = obj.Key;
                    record.Health            = GetFloatFromCFG(obj.Value, "mMaxHP", 0);
                    record.CollisionRadius   = GetFloatFromCFG(obj.Value, "Collision Radius", 0);
                    record.BaseStaticHpRegen = GetFloatFromCFG(obj.Value, "mBaseStaticHPRegen", 0);
                    record.CollisionHeight   = GetFloatFromCFG(obj.Value, "Collision Height", 0);
                    record.Mana              = GetFloatFromCFG(obj.Value, "mMaxMP", 0);
                    record.SelectionHeight   = GetFloatFromCFG(obj.Value, "SelectionHeight", 0);
                    record.SelectionRadius   = GetFloatFromCFG(obj.Value, "SelectionRadius", 0);
                    record.SkinId            = GetIntFromCFG(obj.Value, "skinID", 0);
                    record.SkinName1         = GetStringFromCFG(obj.Value, "SkinName1", string.Empty);
                    record.SkinName2         = GetStringFromCFG(obj.Value, "SkinName2", string.Empty);
                    record.Rot  = GetStringFromCFG(obj.Value, "Rot", string.Empty);
                    record.Move = GetStringFromCFG(obj.Value, "Move", string.Empty);
                    record.PerceptionBubbleRadius     = GetFloatFromCFG(obj.Value, "PerceptionBubbleRadius", 0);
                    record.PathfindingCollisionRadius = GetFloatFromCFG(obj.Value, "PathfindingCollisionRadius", 0);
                    records.Add(record);
                }
            }

            foreach (var record in records)
            {
                record.AddElement();
            }

            logger.Write("Buildings Synchronized");
        }
예제 #5
0
        private void Form1_Load(object sender, EventArgs e)     //Form1_Load
        {
            if (!Variable.allowBakRes)
            {
                button24.Enabled = false;
                button25.Enabled = false;
            }
            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);   //If crush, call CrushHandler

            //寫入目前LoLToolsX版本到Log
            Logger.log("LoLToolsX版本: " + Application.ProductVersion, Logger.LogType.Info);

            Logger.log("目前客戶端 : 台服", Logger.LogType.Info);
            //載入LoLToolsX Logo
            PictureBox1.ImageLocation = Application.StartupPath + @"\logo.png";
            Logger.log("LoLToolsX Logo載入成功!", Logger.LogType.Info);

            if (Variable.forceSelectPath)
            {
                goto SelectPath;
            }

            //取得LoL路徑
            GetReg gr = new GetReg();

            installPath = gr.TwPath(Application.StartupPath + @"\config.ini");
            Logger.log("LoL目錄取得成功! " + installPath, Logger.LogType.Info);

SelectPath:
            CFGFile CFGFile = new CFGFile(Application.StartupPath + @"\config.ini");

            //檢查路徑是否存有 LoLTW 字串
            if (!installPath.Contains("LoLTW"))
            {
                if (MessageBox.Show("無法取得LoL目錄 請手動選擇LoLTW目錄", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
                {
                    folderBrowserDialog1.ShowDialog();
                    Logger.log("LoL手動選擇目錄! ", Logger.LogType.Info);
                    if (folderBrowserDialog1.SelectedPath.Contains("LoLTW"))
                    {
                        installPath = folderBrowserDialog1.SelectedPath;
                        Logger.log("LoL目錄檢查成功! " + installPath, Logger.LogType.Info);
                        CFGFile.SetValue("LoLPath", "TwPath", "\"" + installPath + "\"");
                        CFGFile.SetValue("LoLToolsX", "Version", Application.ProductVersion.ToString());
                    }
                    else
                    {
                        MessageBox.Show("目錄選擇錯誤 按確定退出程式", "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Logger.log("LoL目錄檢查失敗 ", Logger.LogType.Error);
                        Logger.log("強制關閉程式... ", Logger.LogType.Info);
                        Application.Exit();
                    }
                }
                else
                {
                    Logger.log("LoL目錄選擇取消 ", Logger.LogType.Error);
                    Logger.log("關閉程式... " + installPath, Logger.LogType.Info);
                    Application.Exit();
                }
            }
            else
            {
                CFGFile.SetValue("LoLPath", "TwPath", "\"" + installPath + "\"");
                CFGFile.SetValue("LoLToolsX", "Version", Application.ProductVersion.ToString());
                PathLabel.Text = installPath;
                Logger.log("LoL目錄檢查成功! ", Logger.LogType.Info);
                Logger.log("LoL目錄寫入成功! " + installPath, Logger.LogType.Info);
            }

            //CFGFile = null;

            if (Variable.allowUpdate)
            {
                //CFGFile checkAutoUpdate = new CFGFile(Application.StartupPath + @"\config.ini");
                if (CFGFile.GetValue("LoLToolsX", "AutoUpdate") == "true")
                {
                    Variable.updating      = true;
                    this.checkBox1.Checked = false;
                    Thread updateThread = new Thread(CheckUpdate.checkUpdate);
                    //開始檢查更新
                    updateThread.Start();
                }
                else
                {
                    this.checkBox1.Checked = true;
                }
            }
            else
            {
                button23.Enabled = false;
            }

            //檢查語言檔更新
            //Thread langUpdate = new Thread(LangUpdate.CheckLangUpdate);
            //langUpdate.Start();

            //string test = Application.StartupPath;
            //MessageBox.Show(test);

            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            //取得目前伺服器
            CheckProp cp = new CheckProp();

            cp.CheckPropFL(installPath);
            serverLocation.Text = cp.currentLoc;

            notifyIcon1.Visible = false;
            PathLabel.Text      = installPath;

            //取得版本資訊
            toolsVersion.Text    = Application.ProductVersion.ToString();
            LoLVersionLabel.Text = GetLoLVer();



            //在綫統計使用人數
            try
            {
                WebBrowser1.Navigate("http://nitroxenon.com/loltoolsx/stat.html");
            }
            catch (Exception e2)
            {
                Logger.log("使用人數統計失敗", Logger.LogType.Error);
                Logger.log(e2);
            }

            //刪除物件
            cp = null;
            gr = null;


            string[] skins = File.ReadAllLines(Application.StartupPath + @"\Skin.txt");
            foreach (string s in skins)
            {
                installedSkin.Items.Add(s);
            }

            //Variable.tw_installPath = installPath;
            Variable.curClient = "台服";
        }
예제 #6
0
        public static void ApplySettings()
        {
            CFGFile config = new CFGFile(Path.Combine(Configuration.Instance.ClientPath, CONFIG_PATH));

            config.Set("General", "WindowMode", "1");
            config.Set("General", "Width", LEAGUE_WIDTH.ToString());
            config.Set("General", "Height", LEAGUE_HEIGTH.ToString());
            config.Set("General", "Colors", "32");
            config.Set("General", "RelativeTeamColors", "1");
            config.Set("General", "UserSetResolution", "1");
            config.Set("General", "Antialiasing", "0");
            config.Set("General", "AutoAcquireTarget", "1");


            config.Set("Performance", "GraphicsSlider", "6");
            config.Set("Performance", "ShadowsEnabled", "1");
            config.Set("Performance", "CharacterInking", "1");
            config.Set("Performance", "EnableHUDAnimations", "0");
            config.Set("Performance", "EnableParticleOptimizations", "0");
            config.Set("Performance", "BudgetOverdrawAverage", "10");
            config.Set("Performance", "BudgetSkinnedVertexCount", "200000");
            config.Set("Performance", "BudgetSkinnedDrawCallCount", "100");
            config.Set("Performance", "BudgetTextureUsage", "150000");
            config.Set("Performance", "BudgetVertexCount", "500000");
            config.Set("Performance", "BudgetTriangleCount", "300000");
            config.Set("Performance", "BudgetDrawCallCount", "1000");
            config.Set("Performance", "EnableGrassSwaying", "1");
            config.Set("Performance", "EnableFXAA", "1");
            config.Set("Performance", "FrameCapType", "8");
            config.Set("Performance", "ShadowQuality", "4");
            config.Set("Performance", "EffectsQuality", "4");
            config.Set("Performance", "EnvironmentQuality", "4");
            config.Set("Performance", "CharacterQuality", "4");
            config.Set("Performance", "AutoPerformanceSettings", "0");


            config.Set("HUD", "ShowTimestamps", "0");
            config.Set("HUD", "ShowNeutralCamps", "1");
            config.Set("HUD", "ObjectTooltips", "1");
            config.Set("HUD", "MinimapMoveSelf", "1");
            config.Set("HUD", "DrawHealthBars", "1");
            config.Set("HUD", "ChatScale", "100");
            config.Set("HUD", "AutoDisplayTarget", "1");
            config.Set("HUD", "FlashScreenWhenStunned", "1");
            config.Set("HUD", "FlashScreenWhenDamaged", "1");
            config.Set("HUD", "ShowPlayerPerks", "0");
            config.Set("HUD", "ShowPlayerStats", "1");
            config.Set("HUD", "ShowAllChannelChatSpectator", "0");
            config.Set("HUD", "GlobalScaleReplay", "1.0000");
            config.Set("HUD", "ReplayScrollSmoothingEnabled", "0");
            config.Set("HUD", "ReplayMiddleMouseScrollSpeed", "0.5000");
            config.Set("HUD", "ItemShopPrevY", "0");
            config.Set("HUD", "ItemShopPrevX", "15");
            config.Set("HUD", "ItemShopResizeHeight", "76");
            config.Set("HUD", "ItemShopResizeWidth", "260");
            config.Set("HUD", "ItemShopPrevResizeHeight", "1080");
            config.Set("HUD", "ItemShopPrevResizeWidth", "1920");
            config.Set("HUD", "ShowAlliedChat", "1");
            config.Set("HUD", "ShowAllChannelChat", "1");
            config.Set("HUD", "GlobalScale", "1.0000");
            config.Set("HUD", "MinimapScale", "1.0000");
            config.Set("HUD", "DeathRecapScale", "1.0000");
            config.Set("HUD", "PracticeToolScale", "1.0000");
            config.Set("HUD", "ItemShopItemDisplayMode", "0");
            config.Set("HUD", "ItemShopStartPane", "1");
            config.Set("HUD", "DisableMouseCaptureDebugger", "0");
            config.Set("HUD", "ShowSpellCosts", "0");
            config.Set("HUD", "NameTagDisplay", "1");
            config.Set("HUD", "ShowChampionIndicator", "0");
            config.Set("HUD", "ShowSummonerNames", "1");
            config.Set("HUD", "CameraLockMode", "0");
            config.Set("HUD", "MiddleClickDragScrollEnabled", "0");
            config.Set("HUD", "ScrollSmoothingEnabled", "0");
            config.Set("HUD", "KeyboardScrollSpeed", "0.0000");
            config.Set("HUD", "MiddleMouseScrollSpeed", "0.5000");
            config.Set("HUD", "MapScrollSpeed", "0.5000");
            config.Set("HUD", "ShowAttackRadius", "1");
            config.Set("HUD", "NumericCooldownFormat", "1");
            config.Set("HUD", "EternalsMilestoneDisplayMode", "0");
            config.Set("HUD", "HideEnemySummonerEmotes", "0");
            config.Set("HUD", "DisableHudSpellClick", "0");
            config.Set("HUD", "SmartCastWithIndicator_CastWhenNewSpellSelected", "0");
            config.Set("HUD", "SmartCastOnKeyRelease", "0");
            config.Set("HUD", "EnableLineMissileVis", "1");
            config.Set("HUD", "ShowSummonerNamesInScoreboard", "0");
            config.Set("HUD", "MirroredScoreboard", "0");
            config.Set("HUD", "ShowTeamFramesOnLeft", "0");
            config.Set("HUD", "FlipMiniMap", "0");


            config.Set("Chat", "Transparency", "0.0000");
            config.Set("Chat", "ChatY", "0");
            config.Set("Chat", "ChatX", "0");
            config.Set("Chat", "EnableChatFilter", "1");

            config.Set("Accessibility", "ColorContrast", "0.5000");
            config.Set("Accessibility", "ColorBrightness", "0.5000");
            config.Set("Accessibility", "ColorGamma", "0.5000");
            config.Set("Accessibility", "ColorLevel", "0.5000");

            config.Save();

            Logger.Write("League of legends settings applied.", MessageState.INFO2);

            CFGFile file = new CFGFile(Path.Combine(Configuration.Instance.ClientPath, KEYCONFIG_PATH));


            file.Set("GameEvents", "evtSelectSelf", "[F1]");
            file.Set("GameEvents", "evtSelectAlly4", "[F5]");
            file.Set("GameEvents", "evtSelectAlly3", "[F4]");
            file.Set("GameEvents", "evtSelectAlly2", "[F3]");
            file.Set("GameEvents", "evtSelectAlly1", "[F2]");


            file.Set("GameEvents", "evtCastSpell1", "[1]");
            file.Set("GameEvents", "evtCastSpell2", "[2]");
            file.Set("GameEvents", "evtCastSpell3", "[3]");
            file.Set("GameEvents", "evtCastSpell4", "[4]");


            file.Set("GameEvents", "evtUseItem1", "[q]");
            file.Set("GameEvents", "evtUseItem2", "[w]");
            file.Set("GameEvents", "evtUseItem3", "[e]");


            file.Save();

            string target = Path.Combine(Configuration.Instance.ClientPath, PERSISTED_CONFIG_PATH);

            File.Copy("PersistedSettings.json", target, true);
        }
예제 #7
0
        private void VerSelect_Load(object sender, EventArgs e)
        {
            CFGFile CFGFile = new CFGFile(Variable.CurrentDirectory + @"\config.ini");

            //取得LoL路徑
            GetReg gr = new GetReg();

            installPath = gr.NaPath(Variable.CurrentDirectory + @"\config.ini");
            Logger.log("LoL目錄取得成功! " + installPath, Logger.LogType.Info);



            //檢查路徑是否存有 LoLTW 字串
            if (!installPath.Contains("League of Legends"))
            {
                if (MessageBox.Show("無法取得LoL目錄 請手動選擇 League of Legends 目錄", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
                {
                    folderBrowserDialog1.ShowDialog();
                    Logger.log("LoL手動選擇目錄! ", Logger.LogType.Info);
                    if (folderBrowserDialog1.SelectedPath.Contains("League of Legends"))
                    {
                        installPath = folderBrowserDialog1.SelectedPath;
                        Logger.log("LoL目錄檢查成功! " + installPath, Logger.LogType.Info);

                        CFGFile.SetValue("LoLPath", "NaPath", "\"" + installPath + "\"");
                        CFGFile.SetValue("LoLToolsX", "Version", Application.ProductVersion.ToString());
                        Logger.log("LoL目錄檢查成功! ", Logger.LogType.Info);
                        Logger.log("LoL目錄寫入成功! " + installPath, Logger.LogType.Info);

                        string[] folder = Directory.GetDirectories(installPath + @"\RADS\projects\lol_air_client\releases");
                        foreach (string f in folder)
                        {
                            airBox.Items.Add(Path.GetFileName(f));
                        }

                        string[] folder2 = Directory.GetDirectories(installPath + @"\RADS\projects\lol_game_client\releases");
                        foreach (string f in folder2)
                        {
                            gameBox.Items.Add(Path.GetFileName(f));
                        }
                        Variable.n_installPath = this.installPath;
                    }
                    else
                    {
                        MessageBox.Show("目錄選擇錯誤 按確定退出程式", "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Logger.log("LoL目錄檢查失敗 ", Logger.LogType.Error);
                        Logger.log("強制關閉程式... ", Logger.LogType.Info);
                        Application.Exit();
                    }
                }
                else
                {
                    Logger.log("LoL目錄選擇取消 ", Logger.LogType.Error);
                    Logger.log("關閉程式... " + installPath, Logger.LogType.Info);
                    Application.Exit();
                }
            }
            else
            {
                CFGFile.SetValue("LoLPath", "NaPath", "\"" + installPath + "\"");
                CFGFile.SetValue("LoLToolsX", "Version", Application.ProductVersion.ToString());
                Logger.log("LoL目錄檢查成功! ", Logger.LogType.Info);
                Logger.log("LoL目錄寫入成功! " + installPath, Logger.LogType.Info);

                string[] folder = Directory.GetDirectories(installPath + @"\RADS\projects\lol_air_client\releases");
                foreach (string f in folder)
                {
                    airBox.Items.Add(Path.GetFileName(f));
                }

                string[] folder2 = Directory.GetDirectories(installPath + @"\RADS\projects\lol_game_client\releases");
                foreach (string f in folder2)
                {
                    gameBox.Items.Add(Path.GetFileName(f));
                }
                Variable.n_installPath = this.installPath;
            }
        }
예제 #8
0
        private void NaTools_Load(object sender, EventArgs e)
        {
            if (!Variable.allowBakRes)
            {
                button24.Enabled = false;
                button25.Enabled = false;
            }
            //Initialize Na Path
            installPath      = Variable.n_installPath;
            airVer           = Variable.airVer;
            gameVer          = Variable.gameVer;
            Variable.airPath = airPath = installPath + @"\RADS\projects\lol_air_client\releases\" + airVer + @"\deploy";
            gamePath         = installPath + @"\RADS\projects\lol_game_client\releases\" + gameVer + @"\deploy";

            if (Variable.allowUpdate)
            {
                CFGFile checkAutoUpdate = new CFGFile(Variable.CurrentDirectory + @"\config.ini");
                if (checkAutoUpdate.GetValue("LoLToolsX", "AutoUpdate") == "true")
                {
                    Variable.updating      = true;
                    this.checkBox1.Checked = false;
                    Thread updateThread = new Thread(CheckUpdate.checkUpdate);
                    updateThread.Start();
                }
                else
                {
                    this.checkBox1.Checked = true;
                }
            }
            else
            {
                button23.Enabled = false;
            }

            //AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);   //If crush, call CrushHandler

            //寫入目前LoLToolsX版本到Log
            Logger.log("LoLToolsX版本: " + Application.ProductVersion, Logger.LogType.Info);

            Logger.log("目前客戶端 : 美服", Logger.LogType.Info);
            //載入LoLToolsX Logo
            PictureBox1.ImageLocation = Variable.CurrentDirectory + @"\logo.png";
            Logger.log("LoLToolsX Logo載入成功!", Logger.LogType.Info);


            //取得目前伺服器;
            CheckProp cp = new CheckProp();

            cp.CheckPropNa(airPath);
            serverLocation.Text = cp.currentLoc;

            notifyIcon1.Visible = false;
            PathLabel.Text      = installPath;

            //取得版本資訊
            toolsVersion.Text = Application.ProductVersion.ToString();



            //在綫統計使用人數
            try
            {
                WebBrowser1.Navigate("http://nitroxenon.com/loltoolsx/stat.html");
            }
            catch (Exception e2)
            {
                Logger.log("使用人數統計失敗", Logger.LogType.Error);
                Logger.log(e2);
            }

            //刪除物件
            cp = null;

            //Variable.na_installPath = installPath;
            Variable.curClient = "美服";
        }