private void SetOngoingRootNode() { this.m_Quest_Info_List_TreeView.InitTreeData(); string textFromInterface = NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("1200"); string textFromInterface2 = NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("1201"); string textFromInterface3 = NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("1636"); TREE_TYPE tREE_TYPE = new TREE_TYPE(); TREE_TYPE tREE_TYPE2 = new TREE_TYPE(); TREE_TYPE tREE_TYPE3 = new TREE_TYPE(); tREE_TYPE.bType = 0; tREE_TYPE2.bType = 0; tREE_TYPE3.bType = 0; this.m_OngoingNode = this.m_Quest_Info_List_TreeView.InsertChildRoot(NrTSingleton<CTextParser>.Instance.GetTextColor("1107") + textFromInterface, tREE_TYPE, true); this.m_AcceptableNode = this.m_Quest_Info_List_TreeView.InsertChildRoot(NrTSingleton<CTextParser>.Instance.GetTextColor("1107") + textFromInterface2, tREE_TYPE2, true); this.m_DayQuestNode = this.m_Quest_Info_List_TreeView.InsertChildRoot(NrTSingleton<CTextParser>.Instance.GetTextColor("1107") + textFromInterface3, tREE_TYPE3, true); this.m_Quest_Info_List_TreeView.RepositionItems(); }
private void BtnClickQuestList(IUIObject obj) { TreeView treeView = (TreeView)obj; int index = treeView.SelectedItem.GetIndex(); UIListItemContainer selectedItem = treeView.SelectedItem; TreeView.TreeNode treeNode = (TreeView.TreeNode)selectedItem.Data; TREE_TYPE tREE_TYPE = treeNode.ObjectData as TREE_TYPE; if (tREE_TYPE.bType == 0) { treeView.ExpandNode(treeNode, index); } else if (tREE_TYPE.bType == 1) { if (this.m_eMode == QUESTLIST_TAB_MODE.Total) { this.m_CurQuestGroup = (CQuestGroup)tREE_TYPE.bData; } else if (this.m_eMode == QUESTLIST_TAB_MODE.OnGoing) { this.m_CurQuest = (CQuest)tREE_TYPE.bData; this.m_CurQuestGroup = NrTSingleton<NkQuestManager>.Instance.GetQuestGroupByQuestUnique(this.m_CurQuest.GetQuestUnique()); this.m_QuestListInfo = (base.SetChildForm(G_ID.QUESTLISTINFO_DLG) as QuestListInfo_DLG); this.m_QuestListInfo.SetQuestInfo((CQuest)tREE_TYPE.bData); this.m_QuestListInfo.Show(); if (this.m_DramaInfo != null) { this.m_DramaInfo.Close(); } } treeView.ExpandNode(treeNode, index); } else if (tREE_TYPE.bType == 2 && this.m_eMode == QUESTLIST_TAB_MODE.Total) { this.m_CurQuest = (CQuest)tREE_TYPE.bData; this.m_CurQuestGroup = NrTSingleton<NkQuestManager>.Instance.GetQuestGroupByQuestUnique(this.m_CurQuest.GetQuestUnique()); this.m_QuestListInfo = (base.SetChildForm(G_ID.QUESTLISTINFO_DLG) as QuestListInfo_DLG); this.m_QuestListInfo.SetQuestInfo((CQuest)tREE_TYPE.bData); this.m_QuestListInfo.Show(); if (this.m_DramaInfo != null) { this.m_DramaInfo.Close(); } } }
private TreeNode ConvertJSONInput(TreeNode parent, JObject input, int depth) { var node = new TreeNode (); node.nodeName = input ["title"].ToString (); node.nodeType = input ["type"].ToString (); node.filePath = input ["filepath"].ToString (); node.nodeLevel = depth + 1; foreach (var c in input ["children"]) { node.nodeChild.Add (ConvertJSONInput (node,JObject.Parse(c.ToString()),node.nodeLevel)); } return node; }
public void SetTotal() { string str = string.Empty; this.m_Quest_Info_completeTreeview.ClearList(true); string textFromInterface = NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("666"); Dictionary<short, QUEST_CHAPTER> hashQuestChapter = NrTSingleton<NkQuestManager>.Instance.GetHashQuestChapter(); this.m_ChapterTree.Clear(); if (hashQuestChapter != null) { foreach (QUEST_CHAPTER current in hashQuestChapter.Values) { if (this.m_CurQuestType == QUEST_CONST.E_QUEST_TYPE.E_QUEST_TYPE_SUB || this.m_CurQuestType == QUEST_CONST.E_QUEST_TYPE.E_QUEST_TYPE_DAY) { bool flag = false; foreach (CQuestGroup current2 in this.m_QuesGroupList) { if (current.i16QuestChapterUnique == current2.GetChapterUnique() && this.m_CurQuestType == (QUEST_CONST.E_QUEST_TYPE)current2.GetQuestType()) { flag = true; break; } } if (!flag) { continue; } } TREE_TYPE tREE_TYPE = new TREE_TYPE(); tREE_TYPE.bType = 0; tREE_TYPE.bData = current; string textFromInterface2 = NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("667"); string textFromQuest_Title = NrTSingleton<NrTextMgr>.Instance.GetTextFromQuest_Title(current.strChapterTextKey); string text = current.i16QuestChapterUnique.ToString() + textFromInterface2 + ". " + textFromQuest_Title; text = this.m_str1206 + text; TreeView.TreeNode value = this.m_Quest_Info_completeTreeview.InsertChildRoot(text, tREE_TYPE, true); this.m_ChapterTree.Add(current.i16QuestChapterUnique, value); } } this.m_PageTree.Clear(); foreach (CQuestGroup current3 in this.m_QuesGroupList) { if (this.m_CurQuestType == (QUEST_CONST.E_QUEST_TYPE)current3.GetQuestType() || this.m_CurQuestType == QUEST_CONST.E_QUEST_TYPE.E_QUEST_TYPE_TOTAL) { if (NrTSingleton<NkQuestManager>.Instance.QuestGroupClearCheck(current3.GetGroupUnique()) == QUEST_CONST.E_QUEST_GROUP_STATE.E_QUEST_GROUP_STATE_NONE) { this.m_str1205 = NrTSingleton<CTextParser>.Instance.GetTextColor("1205"); } else { this.m_str1205 = NrTSingleton<CTextParser>.Instance.GetTextColor("1102"); } TREE_TYPE tREE_TYPE2 = new TREE_TYPE(); tREE_TYPE2.bType = 1; tREE_TYPE2.bData = current3; str = string.Concat(new string[] { this.m_str1205, current3.GetPage(), textFromInterface, ". ", current3.GetGroupTitle() }); if (this.m_CurQuestType == QUEST_CONST.E_QUEST_TYPE.E_QUEST_TYPE_SUB) { str = this.m_str1205 + NrTSingleton<NrTextMgr>.Instance.GetTextFromInterface("1454") + ". " + current3.GetGroupTitle(); } else if (this.m_CurQuestType == QUEST_CONST.E_QUEST_TYPE.E_QUEST_TYPE_DAY) { str = this.m_str1205 + current3.GetGroupTitle(); } if (this.m_ChapterTree.ContainsKey(current3.GetChapterUnique())) { TreeView.TreeNode treeNode = this.m_ChapterTree[current3.GetChapterUnique()]; if (treeNode != null) { TreeView.TreeNode treeNode2 = treeNode.AddChild(1, str, tREE_TYPE2); this.m_PageTree.Add(current3.GetGroupUnique(), treeNode2); foreach (QUEST_SORTID current4 in current3.GetGroupInfo().m_QuestList) { CQuest questByQuestUnique = NrTSingleton<NkQuestManager>.Instance.GetQuestByQuestUnique(current4.m_strQuestUnique); if (questByQuestUnique != null) { TREE_TYPE tREE_TYPE3 = new TREE_TYPE(); tREE_TYPE3.bType = 2; tREE_TYPE3.bData = questByQuestUnique; string str2 = string.Empty; if (NrTSingleton<NkQuestManager>.Instance.GetQuestState(current4.m_strQuestUnique) == QUEST_CONST.eQUESTSTATE.QUESTSTATE_NONE) { str2 = NrTSingleton<UIDataManager>.Instance.GetString(this.m_str1202, "- ", questByQuestUnique.GetQuestTitle()); } else { str2 = NrTSingleton<UIDataManager>.Instance.GetString(this.m_str1102, "- ", questByQuestUnique.GetQuestTitle()); } treeNode2.AddChild(2, str2, tREE_TYPE3); } } } } } } this.m_Quest_Info_completeTreeview.RepositionItems(); this.SetProgress(); }