private void dg1_CurrentCellChanged(object sender, EventArgs e) { txtExplain.Text = ""; if (dg1.CurrentRow == null) { return; } DataGridViewRow dv = dg1.CurrentRow; if (dv.Cells[1].Value == null) { return; } string explain = string.Empty; DataTable dt = DataHelper.XkfyData.Tables["Config"]; switch (_tbName) { //DLC内功 case "DLC_NeigongData": txtExplain.Text = ExplainHelper.ExplainNeiGong(dv); break; case "CharacterData": txtExplain.Text = ExplainHelper.GetCharacterData(dv); break; //战斗奖励 case "RewardData": string[] sRewardData = dv.Cells[1].Value.ToString().Split('*'); txtExplain.Text = ExplainHelper.ExplainRewardData(sRewardData); break; //战斗结果 case "BattleAreaData": gbZhanDou.Visible = true; DataHelper.ExistTable("RewardData"); ExplainBattleArea(dv); break; //招式 case "RoutineData": txtExplain.Text = _tl.ExplainRoutineData(dv);; break; //战斗补充文件 case "BattleSchedule": txtExplain.Text = _tl.ExplainBattleSchedule(dv);; break; } }
private void dg1_CurrentCellChanged(object sender, EventArgs e) { txtExplain.Text = ""; DataGridViewRow dv = dg1.CurrentRow; if (dv?.Cells[1].Value == null) { return; } DataTable dt = DataHelper.DdlDataSet.Tables["TalkManager.iGtype"]; StringBuilder explainText = new StringBuilder(); switch (_configKey) { case "Map": string npcId = dv.Cells["iNpcID"].Value.ToString(); explainText.Append(ExplainHelper.GetNpcName(npcId.Substring(0, npcId.Length - 3))); explainText.Append("\r\n"); explainText.Append("点击对话:"); explainText.Append("\r\n"); explainText.Append(ExplainHelper.GetMapTalkManager(dv.Cells["sDialogueQID"].Value.ToString())); explainText.Append("\r\n"); explainText.Append("NPC移动时对话:"); explainText.Append("\r\n"); explainText.Append(ExplainHelper.GetMapTalkManager(dv.Cells["sMobileQID"].Value.ToString())); txtExplain.Text = explainText.ToString(); break; case "NpcConduct": string[] tmp = dv.Cells["sConduct"].Value.ToString().Replace("(", "").Replace(")", "").Split(','); if (tmp.Length == 4) { txtExplain.Text = ExplainHelper.GetNpcName(tmp[3].Substring(0, tmp[3].Length - 3)); } break; } switch (_tbName) { case "DevelopQuestData": string[] striType = dv.Cells["iType"].Value.ToString().Split(','); string[] striArg1 = dv.Cells["iArg1"].Value.ToString().Split(','); string[] striArg2 = dv.Cells["iArg2"].Value.ToString().Split(','); string[] striCondition = dv.Cells["iCondition"].Value.ToString().Split(','); string[] explain = tl.ExplainDevelopQuest(striCondition, striType, striArg1, striArg2); txtExplain.Text = explain[0] + @"\r\n\r\n" + explain[1]; break; //战斗奖励 case "RewardData": string[] sRewardData = dv.Cells["sRewardData"].Value.ToString().Split('*'); txtExplain.Text = tl.ExplainRewardData(sRewardData, dt); break; //战斗结果 case "BattleAreaData": gbZhanDou.Visible = true; ExplainBattleArea(dv, dt); break; //内功 case "BattleNeigong": txtExplain.Text = tl.ExplainNeiGong(dv.Cells["ID"].Value.ToString()); break; //对话 case "TalkManager": txtExplain.Text = tl.ExplainTalkManager(dv); break; //招式 case "RoutineData": txtExplain.Text = tl.ExplainRoutineData(dv); break; //mapTalkManager case "MapTalkManager": string iGiftId = dv.Cells["iGiftID"].Value.ToString(); if (iGiftId == "0") { break; } DataRow[] drRw = DataHelper.XkfyData.Tables["RewardData"].Select("iRID='" + iGiftId + "'"); if (drRw.Length != 1) { txtExplain.Text = @"奖励ID有误,请检查!"; } else { txtExplain.Text = tl.ExplainRewardData(drRw[0]["sRewardData"].ToString().Split('*'), dt); } break; case "QuestDataManager": if (dv.Cells["sOConditions"].Value.ToString() != "0") { string[] sOConditions = dv.Cells["sOConditions"].Value.ToString().Split('*'); txtExplain.Text = @"触发条件:" + tl.ExplainQuestDataCon(sOConditions, dt); } //关闭剧情 string finshQType = dv.Cells["sFinshQType"].Value.ToString(); if (finshQType != "0" && finshQType != "(1,0,0)") { string[] sFinshQType = finshQType.Split('*'); txtExplain.Text += @"\r\n关闭事件:" + tl.ExplainQuestDataFinish(sFinshQType); } string iGiftId1 = dv.Cells["iGiftID1"].Value.ToString(); if (iGiftId1 == "0") { break; } drRw = DataHelper.XkfyData.Tables["RewardData"].Select("iRID='" + iGiftId1 + "'"); if (drRw.Length != 1) { txtExplain.Text += @"\r\n获得奖励:奖励ID有误,请检查!"; } else { txtExplain.Text += @"\r\n获得奖励:" + tl.ExplainRewardData(drRw[0]["sRewardData"].ToString().Split('*'), dt); } break; //战斗补充文件 case "BattleSchedule": txtExplain.Text = tl.ExplainBattleSchedule(dv); break; case "ItemData": StringBuilder sbExplain = new StringBuilder(); if (dv.Cells[0].Value.ToString() == "") { return; } string snpclike = dv.Cells["sNpcLike$28"].Value.ToString(); if (snpclike != "0" && snpclike != "") { string[] snpclikeArray = snpclike.Split('*'); for (int i = 0; i < snpclikeArray.Length; i++) { string[] str = snpclikeArray[i].Replace("(", "").Replace(")", "").Split(','); sbExplain.AppendFormat("送给【{0}】增加{1}点好感 ", DataHelper.GetValue("NpcData", "sNpcName", "iID", str[0]), str[1]); sbExplain.Append("\r\n"); } } sbExplain.Append("\r\n"); string sUseLimit = dv.Cells["sUseLimit$29"].Value.ToString(); if (sUseLimit != "0" && !string.IsNullOrEmpty(sUseLimit)) { string[] useLimit = sUseLimit.Replace("(", "").Replace(")", "").Split(','); if (useLimit.Length < 3) { return; } string name = string.Empty; switch (useLimit[0]) { case "0": name = DataHelper.GetDicValue("MB", useLimit[1]); break; case "1": name = DataHelper.GetDicValue("JBG", useLimit[1]); break; case "2": name = DataHelper.GetDicValue("ZS", useLimit[1]); break; case "4": name = DataHelper.GetDicValue("JY", useLimit[1]); break; } sbExplain.AppendFormat("使用条件【{0}】{1}", name, useLimit[2]); } txtExplain.Text = sbExplain.ToString(); break; } }