private void ChatEdit_Load(object sender, EventArgs e) { TextBox[] rArr = { R, RS, R2, R3, R4, R5 }; TextBox[] gArr = { G, GS, G2, G3, G4, G5 }; TextBox[] bArr = { B, BS, B2, B3, B4, B5 }; string[] rTmp = { "R", "RS", "R2", "R3", "R4", "R5" }; string[] gTmp = { "G", "GS", "G2", "G3", "G4", "G5" }; string[] bTmp = { "B", "BS", "B2", "B3", "B4", "B5" }; for (int i = 0; i <= 5; i++) { rArr[i].Text = ini.GetValue("ChatColour", rTmp[i]); } for (int i = 0; i <= 5; i++) { gArr[i].Text = ini.GetValue("ChatColour", gTmp[i]); } for (int i = 0; i <= 5; i++) { bArr[i].Text = ini.GetValue("ChatColour", bTmp[i]); } FontSize1.Text = ini.GetValue("ChatFontSize", "FontSize"); }
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 = "台服"; }
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 = "美服"; }