private void ConfirmHookBtn_BtnClick(object sender, EventArgs e) { if (TextractorFunListView.SelectedItems.Count != 0) { Common.TextractorHandle.SetSettingsOutPutform(null);//先关闭对本窗口的输出 string[] res = TextHookHandle.DealCode(TextractorFunListView.SelectedItems[0].SubItems[2].Text); int sum = 0; for (int i = 0; i < TextractorFunListView.Items.Count; i++) { if (TextractorFunListView.Items[i].SubItems[2].Text.Contains(res[0])) { sum++; } if (sum >= 2) { SQLiteHelper sqliteH1 = new SQLiteHelper(Environment.CurrentDirectory + "\\settings\\GameList.sqlite"); sqliteH1.ExecuteSql(string.Format("UPDATE gamelist SET isHookFunMulti = 'True' WHERE gameID = {0};", Common.GameID)); break; } } //不满足的游戏也应该记录一下 if (sum <= 1) { SQLiteHelper sqliteH1 = new SQLiteHelper(Environment.CurrentDirectory + "\\settings\\GameList.sqlite"); sqliteH1.ExecuteSql(string.Format("UPDATE gamelist SET isHookFunMulti = 'False' WHERE gameID = {0};", Common.GameID)); } SQLiteHelper sqliteH = new SQLiteHelper(Environment.CurrentDirectory + "\\settings\\GameList.sqlite"); sqliteH.ExecuteSql(string.Format("UPDATE gamelist SET hookCode = '{0}' WHERE gameID = {1};", res[0], Common.GameID)); Common.HookCode = res[0]; Common.HookCodePlus = res[1]; isNormalClose = true; TextRepeatRepairForm trrf = new TextRepeatRepairForm(); Common.TextractorHandle.SetSettingsOutPutform(trrf); trrf.Show(); this.Close(); } else { MessageBox.Show("请先选择一个Hook方法再进行下一步操作!", "提示"); } }
private void ConfirmHookBtn_BtnClick(object sender, EventArgs e) { if (TextractorFunListView.SelectedItems.Count != 0) { Common.TextractorHandle.SetSettingsOutPutform(null);//先关闭对本窗口的输出 string[] res = TextHookHandle.DealCode(TextractorFunListView.SelectedItems[0].SubItems[2].Text); int sum = 0; for (int i = 0; i < TextractorFunListView.Items.Count; i++) { if (TextractorFunListView.Items[i].SubItems[2].Text.Contains(res[0])) { sum++; } if (sum >= 2) { IniFileHelper.WriteValue(Environment.CurrentDirectory + "\\GameListInfo.ini", "Game" + Common.GameID, "isHookFunMulti", "True"); break; } } //不满足的游戏也应该记录一下 if (sum <= 1) { IniFileHelper.WriteValue(Environment.CurrentDirectory + "\\GameListInfo.ini", "Game" + Common.GameID, "isHookFunMulti", "False"); } IniFileHelper.WriteValue(Environment.CurrentDirectory + "\\GameListInfo.ini", "Game" + Common.GameID, "hookCode", res[0]);//保存特殊码,以后可以自动匹配这个游戏,但需要重设Plus部分 Common.HookCode = res[0]; Common.HookCodePlus = res[1]; isNormalClose = true; TextRepeatRepairForm trrf = new TextRepeatRepairForm(); Common.TextractorHandle.SetSettingsOutPutform(trrf); trrf.Show(); this.Close(); } else { MessageBox.Show("请先选择一个Hook方法再进行下一步操作!", "提示"); } }