private TreeNode ProcessOr(SHXmlCore xmlCore, TreeNode nodeParent, SHOr or) { if (or == null || nodeParent == null) { return(null); } TreeNode nodeThis = new TreeNode(or.GetString(xmlCore)); nodeThis.ImageIndex = 5; nodeThis.SelectedImageIndex = 5; nodeThis.Tag = or; nodeParent.Nodes.Add(nodeThis); if (or.and != null) { ProcessAnd(xmlCore, nodeThis, or.and); } if (or.or != null) { ProcessOr(xmlCore, nodeThis, or.or); } for (int i = 0; i < or.dataList.Count; i++) { SHCondition cond = or.dataList[i] as SHCondition; ListViewItem lvi = new ListViewItem(); ProcessCondition(xmlCore, nodeThis, cond); } return(nodeThis); }
public TreeNode ProcessCondition(SHXmlCore xmlCore, TreeNode nodeParent, SHCondition cond) { if (nodeParent == null || cond == null) { return(null); } TreeNode nodeThis = new TreeNode(cond.GetString(xmlCore)); nodeThis.ImageIndex = 5; nodeThis.SelectedImageIndex = 5; nodeThis.Tag = cond; nodeParent.Nodes.Add(nodeThis); if (cond.and != null) { ProcessAnd(xmlCore, nodeThis, cond.and); } if (cond.or != null) { ProcessOr(xmlCore, nodeThis, cond.or); } nodeThis.ForeColor = (cond.Passed) ? Color.Black : Color.Red; nodeThis.BackColor = (cond.Passed) ? Color.White : Color.Yellow; return(nodeThis); }
public void RefreshData() { if (xmlCore != null) { xmlCore.Refresh(); } else { xmlCore = new SHXmlCore(); } }
public BaseListViewController(SHXmlCore xmlCore, SHXmlDataObject xmlDataObject, ArrayList arrayList, System.Windows.Forms.ListView listView, System.Windows.Forms.ComboBox cbFilter) { m_XmlCore = xmlCore; m_XmlDataObject = xmlDataObject; m_ArrayList = arrayList; m_ListView = listView; m_cbFilter = cbFilter; m_nCopyObjectID = 0; }
static void Main(String[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SHGlobal.Init(); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\npc.xml", SHSCF_Type.Both, Encoding.GetEncoding(51949))); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\talent.xml", SHSCF_Type.Both, Encoding.GetEncoding(51949))); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\conditions.xml", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\conditions_item.xml", SHSCF_Type.Both, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\xitem.xml", SHSCF_Type.Both, Encoding.GetEncoding(51949))); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\lang\\ko_KR\\strings.xml", SHSCF_Type.Client, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\dialog.xml", "\\dialog.xsd", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\quest.xml", "\\quest.xsd", SHSCF_Type.Both, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\loot.xml", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\craft.xml", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\npcshop.xml", SHSCF_Type.Server, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\recipe.xml", SHSCF_Type.Both, Encoding.UTF8)); SHGlobal.AddCheckFile(new SHSmartCheckFile("\\fieldlist.xml", SHSCF_Type.Both, Encoding.UTF8)); if (0 >= args.Length) { Application.Run(new MainForm()); } else if ("droper" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveItemDropers(); } else if ("questrewarder" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveItemQuestRewarders(); } else if ("fieldnpc" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveNPCSpawnInfo(); } else if ("recipenpc" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveRecipeByNPC(); } else if ("all" == args[0]) { SHXmlCore xmlCore = new SHXmlCore(); xmlCore.SaveItemDropers(); xmlCore.SaveItemQuestRewarders(); xmlCore.SaveNPCSpawnInfo(); xmlCore.SaveRecipeByNPC(); } }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.ITEM, lvItems, "ITEM", xmlCore.Items.LoadingFailed, null, null, null); } m_ListViewController = new ItemListViewController(xmlCore, xmlCore.Items, xmlCore.Items.dataList, lvItems, cbItemFilter); m_ListViewController.InitListView(null); SHListViewUtil.SelectIndex(lvItems, 0); }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.LOOTING, lvLooting, "LOOTING", xmlCore.Lootings.LoadingFailed, null, null, xmlCore.SaveLootings); } m_ListViewController = new LootListViewController(xmlCore, xmlCore.Lootings, xmlCore.Lootings.dataList, lvLooting, cbLootFilter); m_ListViewController.InitListView(null); SHListViewUtil.SelectIndex(lvLooting, 0); }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.ITEMCONDITION, lvIConditions, "ITEMCONDITION", xmlCore.ItemConditions.LoadingFailed, null, null, xmlCore.SaveItemConditions); } m_ListViewController = new ItemConditionsListViewController(xmlCore, xmlCore.ItemConditions, xmlCore.ItemConditions.dataList, lvIConditions, cbIConditionFilter); m_ListViewController.InitListView(null); lvIConditions.Tag = xmlCore.ItemConditions; SHListViewUtil.SelectIndex(lvIConditions, 0); }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.NPC, lvNPCs, "NPC", xmlCore.NPCs.LoadingFailed, null, null, xmlCore.SaveNPCString); } if (wbNPCDetail.ObjectForScripting == null) { wbNPCDetail.ObjectForScripting = mainForm; } m_ListViewController = new NPCListViewController(xmlCore, xmlCore.NPCs, xmlCore.NPCs.dataList, lvNPCs, cbNPCFilter); lvNPCs.SuspendLayout(); lvNPCs.Items.Clear(); foreach (SHNPC npc in xmlCore.NPCs.dataList) { ListViewItem lvi = new ListViewItem(); if ((!mainForm.mnuViewMonster.Checked && npc.Type == "monster") || (!mainForm.mnuViewNPC.Checked && npc.Type == "npc") || (!mainForm.mnuViewObject.Checked && npc.Type == "object")) { continue; } if ((mainForm.mnuViewHideNoninteract.Checked && npc.InteractCount < 1) || (mainForm.mnuViewHideNoLoot.Checked && !npc.Item_LootSpecified)) { continue; } m_ListViewController.SetListText(lvi, npc); lvNPCs.Items.Add(lvi); } lvNPCs.ResumeLayout(); Assembly assem = Assembly.GetExecutingAssembly(); AssemblyName assemName = assem.GetName(); String version = Application.ProductVersion + " (rev. " + assemName.Version.Revision.ToString() + ")"; wbNPCDetail.DocumentText = SoulHunt.Properties.Resources.xhtml_template.Replace("[[CONTENT_BODY]]", SoulHunt.Properties.Resources.WhatsNew.Replace("[[PRODUCT_VERSION]]", version)); }
public override void InitEditForm(MainForm mainForm) { if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.STRING, lvStrings, "STRING", xmlCore.Strings.LoadingFailed, null, null, null); } lvStrings.Items.Clear(); foreach (SHString str in xmlCore.Strings.dataList) { ListViewItem lvi = new ListViewItem(); String_SetListText(lvi, str); lvStrings.Items.Add(lvi); } SHListViewUtil.SelectIndex(lvStrings, 0); }
public override void InitEditForm(MainForm mainForm) { if (wbQuestDetail.ObjectForScripting == null) { wbQuestDetail.ObjectForScripting = mainForm; } if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.QUEST, lvQuests, "QUEST", xmlCore.Quests.LoadingFailed, null, null, xmlCore.SaveQuests); } m_ListViewController = new QuestListViewController(xmlCore, xmlCore.Quests, xmlCore.Quests.dataList, lvQuests, cbQuestFilter); m_ListViewController.InitListView(null); SHListViewUtil.SelectIndex(lvQuests, 0); }
public override void InitEditForm(MainForm mainForm) { if (wbDialogDetail.ObjectForScripting == null) { wbDialogDetail.ObjectForScripting = mainForm; } if (xmlCore == null) { xmlCore = Global._xmlCore; mainForm.AddForm(this, ValixianFormType.DIALOG, lvDialogs, "DIALOG", xmlCore.Dialogs.LoadingFailed, null, null, xmlCore.SaveDialogs); } m_ListViewController = new DialogListViewController(xmlCore, xmlCore.Dialogs, xmlCore.Dialogs.dataList, lvDialogs, cbDialogFilter); m_ListViewController.InitListView(null); SHListViewUtil.SelectIndex(lvDialogs, 0); }
public bool CondORClick(object sender, EventArgs e, SHXmlCore xmlCore, TreeView tvList) { if (tvList.SelectedNode == null || tvList.SelectedNode.Tag == null) { return(false); } Type nodeType = tvList.SelectedNode.Tag.GetType(); SHOr newOr = new SHOr(); if (nodeType == typeof(SHConditions)) { SHConditions conds = (SHConditions)tvList.SelectedNode.Tag; conds.or = newOr; } else if (nodeType == typeof(SHAnd)) { SHAnd and = (SHAnd)tvList.SelectedNode.Tag; and.or = newOr; } else if (nodeType == typeof(SHOr)) { SHOr or = (SHOr)tvList.SelectedNode.Tag; or.or = newOr; } else if (nodeType == typeof(SHCondition)) { SHCondition cond = (SHCondition)tvList.SelectedNode.Tag; cond.or = newOr; } else { return(false); } TreeNode newNode = ProcessOr(xmlCore, tvList.SelectedNode, newOr); tvList.SelectedNode = newNode; return(true); }
public bool CondAddCondClick(object sender, EventArgs e, SHXmlCore xmlCore, TreeView tvList) { if (tvList.SelectedNode == null || tvList.SelectedNode.Tag == null) { return(false); } Type nodeType = tvList.SelectedNode.Tag.GetType(); SHCondition newCondition = new SHCondition(); newCondition.Compile(); newCondition.Build(xmlCore); if (nodeType == typeof(SHConditions)) { SHConditions conds = (SHConditions)tvList.SelectedNode.Tag; conds.dataList.Add(newCondition); } else if (nodeType == typeof(SHAnd)) { SHAnd and = (SHAnd)tvList.SelectedNode.Tag; and.dataList.Add(newCondition); } else if (nodeType == typeof(SHOr)) { SHOr or = (SHOr)tvList.SelectedNode.Tag; or.dataList.Add(newCondition); } else { return(true); } TreeNode newNode = ProcessCondition(xmlCore, tvList.SelectedNode, newCondition); tvList.SelectedNode = newNode; return(true); }
/// <param name="lvTarget">구체적인 조건들이 명시될 리스트뷰를 지정한다.</param> /// <param name="conds">조건들의 목록</param> public TreeNode ProcessConditions(SHXmlCore xmlCore, TreeView tvList, SHConditions conds) { if (conds == null) { return(null); } TreeNode nodeRoot = new TreeNode(conds.GetString(xmlCore)); nodeRoot.ImageIndex = 4; nodeRoot.SelectedImageIndex = 4; nodeRoot.Tag = conds; if (conds.and != null) { ProcessAnd(xmlCore, nodeRoot, conds.and); } if (conds.or != null) { ProcessOr(xmlCore, nodeRoot, conds.or); } for (int i = 0; i < conds.dataList.Count; i++) { SHCondition cond = conds.dataList[i] as SHCondition; ProcessCondition(xmlCore, nodeRoot, cond); } tvList.Tag = conds; tvList.Nodes.Clear(); tvList.Nodes.Add(nodeRoot); tvList.ExpandAll(); tvList.SelectedNode = nodeRoot; return(nodeRoot); }
public bool CondDelClick(object sender, EventArgs e, SHXmlCore xmlCore, TreeView tvList, ListView lvMainList) { SHConditions conds = tvList.Tag as SHConditions; if (tvList == null || conds == null || lvMainList == null || tvList.SelectedNode == null) { return(false); } TreeNode selectedNode = tvList.SelectedNode; if (selectedNode == null || selectedNode.Tag == null) { return(false); } if (selectedNode.Tag.GetType() == typeof(SHAnd)) { SHAnd and = selectedNode.Tag as SHAnd; if (selectedNode.Parent.Tag.GetType() == typeof(SHConditions)) { SHConditions parentConditions = (SHConditions)selectedNode.Parent.Tag; parentConditions.and = null; } else if (selectedNode.Parent.Tag.GetType() == typeof(SHAnd)) { SHAnd parentAnd = (SHAnd)selectedNode.Parent.Tag; parentAnd.and = null; } else if (selectedNode.Parent.Tag.GetType() == typeof(SHOr)) { SHOr parentOr = (SHOr)selectedNode.Parent.Tag; parentOr.and = null; } else if (selectedNode.Parent.Tag.GetType() == typeof(SHCondition)) { SHCondition parentCondition = (SHCondition)selectedNode.Parent.Tag; parentCondition.and = null; } else { return(false); } } else if (selectedNode.Tag.GetType() == typeof(SHOr)) { SHOr or = selectedNode.Tag as SHOr; if (selectedNode.Parent.Tag.GetType() == typeof(SHConditions)) { SHConditions parentConditions = (SHConditions)selectedNode.Parent.Tag; parentConditions.or = null; } else if (selectedNode.Parent.Tag.GetType() == typeof(SHAnd)) { SHAnd parentAnd = (SHAnd)selectedNode.Parent.Tag; parentAnd.or = null; } else if (selectedNode.Parent.Tag.GetType() == typeof(SHOr)) { SHOr parentOr = (SHOr)selectedNode.Parent.Tag; parentOr.or = null; } else if (selectedNode.Parent.Tag.GetType() == typeof(SHCondition)) { SHCondition parentCondition = (SHCondition)selectedNode.Parent.Tag; parentCondition.or = null; } else { return(false); } } else if (selectedNode.Tag.GetType() == typeof(SHCondition)) { SHCondition cond = selectedNode.Tag as SHCondition; if (selectedNode.Parent.Tag.GetType() == typeof(SHConditions)) { SHConditions parentConditions = (SHConditions)selectedNode.Parent.Tag; parentConditions.dataList.Remove(cond); } else if (selectedNode.Parent.Tag.GetType() == typeof(SHAnd)) { SHAnd parentAnd = (SHAnd)selectedNode.Parent.Tag; parentAnd.dataList.Remove(cond); } else if (selectedNode.Parent.Tag.GetType() == typeof(SHOr)) { SHOr parentOr = (SHOr)selectedNode.Parent.Tag; parentOr.dataList.Remove(cond); } else { return(false); } } else { return(false); } tvList.Nodes.Remove(selectedNode); selectedNode = selectedNode.Parent; return(true); }
public DialogListViewController(SHXmlCore xmlCore, SHXmlDataObject xmlDataObject, ArrayList arrayList, System.Windows.Forms.ListView listView, System.Windows.Forms.ComboBox cbFilter) : base(xmlCore, xmlDataObject, arrayList, listView, cbFilter) { }
public EditForm_NPC() { InitializeComponent(); xmlCore = null; }
static public void Init(MainForm mainForm, VelixianForms velixianForms, SHXmlCore xmlCore) { _mainForm = mainForm; _VelixianForms = velixianForms; _xmlCore = xmlCore; }