public string GetGameVersion() { string version = ""; string client = xmlconfig.LoLFilepath; string parentPath = client.Substring(0, client.LastIndexOf("\\") - 4); parentPath += "data.ini"; INIConfig ini = new INIConfig(parentPath); version = ini.GetSectionKey_StringValue("TCLS", "version", ""); return version; }
void Snapshot_Load(object sender, EventArgs e) { #region Datas Datas.LoginSeverList LlistObj = new Datas.LoginSeverList(); Utils.FileOperate fo = new Utils.FileOperate(); string loginQ = fo.GetGameLoginPath(); Utils.INIConfig ini = new Utils.INIConfig(loginQ); this.SummorName.Tag = fo.GetLastLoginMasterName(); string QQ = ini.GetSectionKey_StringValue("Public", "LastQQUin", "") == "" ? "" : ini.GetSectionKey_StringValue("Public", "LastQQUin", ""); for (int i = 0; i < LlistObj.GetSeverList().Count; i++) { string key = ini.GetSectionKey_StringValue("LoginUserRecord", "QQ" + QQ.Trim(), ""); if (key == "") { if (LlistObj.GetSeverList()[i].sID == 257) { this.SeverName.Tag = LlistObj.GetSeverList()[i].sName; ini.EditSectionKey_IntValue("NoLoginUserRecord", "LastLogin", 257); break; } } else { if (LlistObj.GetSeverList()[i].sID == Convert.ToInt32(key)) { this.SeverName.Tag = LlistObj.GetSeverList()[i].sName; break; } } } #endregion #region Widget Models.FontText champion = new Models.FontText(); //champion.point = this.ChampionName.Location; champion.text = this.ChampionName.Tag.ToString(); champion.family = "Verdana"; champion.size = 10; Models.FontText server = new Models.FontText(); //server.point = this.SeverName.Location; server.text = this.SeverName.Tag.ToString(); server.size = 12; Models.FontText summor = new Models.FontText(); //summor.point = this.SummorName.Location; summor.text = this.SummorName.Tag.ToString(); summor.size = 12; Models.FontText lolog = new Models.FontText(); //lol.point = this.LOL.Location; lolog.text = this.LOL.Tag.ToString(); lolog.family = "Calibri"; lolog.size = 10; Models.FontText rank = new Models.FontText(); rank.text = "战斗力:"; Fts.Add("RankName", rank); Fts.Add("ChampionName", champion); Fts.Add("SummorName", summor); Fts.Add("SeverName", server); Fts.Add("LOL", lolog); this.ActiveControl = this.ShotPanel; this.Width = this.ShotPanel.Width + 30; this.Height = this.ShotPanel.Height + 40; this.ShotPanel.Top = 15; this.ShotPanel.Left = 15; this.SeverName.Left = 10; this.SeverName.Top = 10; this.SummorName.Left = this.SeverName.Left; this.SummorName.Top = this.SeverName.Bottom + 5; Graphics championname = CreateGraphics(); SizeF championsize = championname.MeasureString(Fts["ChampionName"].text, new Font(Fts["ChampionName"].family, Fts["ChampionName"].size)); ChampionName.Width = Convert.ToInt32(championsize.Width); ChampionName.Height = Convert.ToInt32(championsize.Height); this.ChampionName.Left = this.ShotPanel.Width - Convert.ToInt32(championsize.Width) - 3; this.ChampionName.Top = 3; Graphics lol = CreateGraphics(); SizeF lolsize = lol.MeasureString(Fts["LOL"].text, new Font(Fts["LOL"].family, Fts["LOL"].size)); LOL.Width = Convert.ToInt32(lolsize.Width); LOL.Height = Convert.ToInt32(lolsize.Height); this.LOL.Left = this.ShotPanel.Width - this.LOL.Width + 17; this.LOL.Top = this.ShotPanel.Height - this.LOL.Height - 2; Graphics rankg = CreateGraphics(); SizeF ranksize = rankg.MeasureString(Fts["RankName"].text, new Font(Fts["RankName"].family, Fts["RankName"].size)); RankName.Width = Convert.ToInt32(ranksize.Width); RankName.Height = Convert.ToInt32(ranksize.Height); this.RankName.Top = this.SummorName.Bottom + 5; this.RankName.Left = this.SummorName.Left; this.cancelButton.Top = this.ShotPanel.Top + this.ShotPanel.Height + 2; this.cancelButton.Left = this.Width - this.cancelButton.Width - 10; this.SaveButton.Top = this.cancelButton.Top; this.SaveButton.Left = this.Width - this.SaveButton.Width * 2 - 15; this.CB_Rank.Top = this.SaveButton.Top-2; this.CB_Rank.Left = this.SaveButton.Left - this.CB_Rank.Width; this.Sig.Top = this.cancelButton.Top; this.Sig.Left = this.ShotPanel.Left; this.FileLink.Top = this.cancelButton.Top; this.FileLink.Left = this.Sig.Right - 2; this.SaveOK.Top = this.cancelButton.Top; this.SaveOK.Left = this.FileLink.Right - 2; this.q.Top = this.ShotPanel.Height - this.q.Height - 5; this.q.Left = 5; this.w.Top = this.q.Top; this.w.Left = this.q.Right + 3; this.e.Top = this.q.Top; this.e.Left = this.w.Right + 3; this.r.Top = this.q.Top; this.r.Left = this.e.Right + 3; this.t.Top = this.q.Top; this.t.Left = this.r.Right + 3; this.q.Paint += spell_Paint; this.w.Paint += spell_Paint; this.e.Paint += spell_Paint; this.r.Paint += spell_Paint; this.t.Paint += spell_Paint; this.Spell_Config.Top = this.ShotPanel.Bottom + 20; this.Label_Config.Top = this.ShotPanel.Bottom + 20; this.labelQ.Tag = 1; this.labelW.Tag = 1; this.labelE.Tag = 1; this.labelR.Tag = 1; this.labelT.Tag = 1; string severname = lList.GetSeverDataById(this.SeverName.Tag.ToString()); Datas.WebDatas wb = new Datas.WebDatas(severname, Fts["SummorName"].text); Fts["RankName"].text = wb.Level + " " + wb.WinPoint; //switch (rankdisplay) //{ // case "Fight": Fts["RankName"].text = "战斗力:" + wb.Fight; break; // case "SoloRank": Fts["RankName"].text = "5v5单人:" + wb.SoloRank; break; // case "TeamRank": Fts["RankName"].text = "5v5组队:" + wb.TeamRank; break; //} SetPanelSize(this.RankName); lvdata = wb.Level + " " + wb.WinPoint; //fightInit = wb.Fight; //soloInit = wb.SoloRank; //teamInit = wb.TeamRank; #endregion }
void SeverLabelClick(object sender, EventArgs e) { Utils.FileOperate fo = new Utils.FileOperate(); string loginPath = fo.GetGameLoginPath(); Utils.INIConfig cfg = new Utils.INIConfig(loginPath); Label label = sender as Label; cfg.EditSectionKey_StringValue("LoginUserRecord", "QQ" + cfg.GetSectionKey_StringValue("Public","LastQQUin",""), label.Tag.ToString()); SeverName.Tag = label.Text; LoginSeverList.Visible = false; Fts["SeverName"].text = label.Text; this.SeverName.Invalidate(); }