コード例 #1
0
ファイル: Form1.cs プロジェクト: weimingtom/pap2
        private void buttonSave_Click(object sender, EventArgs e) // save
        {
            // 场景编辑器 ini 保存
            int count = SaveIniFiles();

            this.Pg.Refresh();

            // 如果是直接点按钮的话,推出
            DevComponents.DotNetBar.ButtonItem item = sender as DevComponents.DotNetBar.ButtonItem;
            if (item == null)
            {
                return;
            }

            // split指定要保存逻辑
            if (item.Name == "LogicAlso") // 逻辑文件保存
            {
                Program.Engine.ShowProgressForm(1);
                foreach (DictionaryEntry entry in maps)
                {
                    LO_Map map = entry.Value as LO_Map;
                    if (map.logicalChanged)
                    {
                        int selectedScenePtr = (int)htScenePtr[map.name];
                        Program.Engine.SaveLogicScene(map.filename, selectedScenePtr);
                        map.logicalChanged = false;
                    }
                }

                Program.Engine.ShowProgressForm(0);
            }

            // report
            string str = string.Format("成功保存了 {0} 个对象。", count);

            MessageBox.Show(str);
        }
コード例 #2
0
ファイル: SaveData.cs プロジェクト: uvbs/FullSource
        private int SaveIniFiles()
        {
            int affectedObjCount = 0;

            foreach (DictionaryEntry entry in maps)
            {
                LO_Map map = entry.Value as LO_Map;

                if (map.MAIN.changed)
                {
                    SaveOneLogicObj(map.MAIN, map.filename, ref affectedObjCount);
                }
                foreach (LogicObj npc in map.NPCs)
                {
                    if (npc.changed)
                    {
                        SaveOneLogicObj(npc, map.filename, ref affectedObjCount);
                    }
                }
                foreach (LogicObj doodad in map.Doodads)
                {
                    if (doodad.changed)
                    {
                        SaveOneLogicObj(doodad, map.filename, ref affectedObjCount);
                    }
                }
                foreach (LogicObj npcrefreshpointset in map.NPCRefreshPointSets)
                {
                    if (npcrefreshpointset.changed)
                    {
                        SaveOneLogicObj(npcrefreshpointset, map.filename, ref affectedObjCount);
                    }
                    if (npcrefreshpointset.kids1 != null)
                    {
                        foreach (LogicObj point in npcrefreshpointset.kids1)
                        {
                            if (point.changed)
                            {
                                SaveOneLogicObj(point, map.filename, ref affectedObjCount);
                            }
                        }
                        foreach (LogicObj npc in npcrefreshpointset.kids2)
                        {
                            if (npc.changed)
                            {
                                SaveOneLogicObj(npc, map.filename, ref affectedObjCount);
                            }
                        }
                    }
                }
                foreach (LogicObj doodadrefreshpointset in map.DoodadRefreshPointSets)
                {
                    if (doodadrefreshpointset.changed)
                    {
                        SaveOneLogicObj(doodadrefreshpointset, map.filename, ref affectedObjCount);
                    }
                    if (doodadrefreshpointset.kids1 != null)
                    {
                        foreach (LogicObj point in doodadrefreshpointset.kids1)
                        {
                            if (point.changed)
                            {
                                SaveOneLogicObj(point, map.filename, ref affectedObjCount);
                            }
                        }
                        foreach (LogicObj doodad in doodadrefreshpointset.kids2)
                        {
                            if (doodad.changed)
                            {
                                SaveOneLogicObj(doodad, map.filename, ref affectedObjCount);
                            }
                        }
                    }
                }
                foreach (LogicObj aigroup in map.AIGroups)
                {
                    if (aigroup.changed)
                    {
                        SaveOneLogicObj(aigroup, map.filename, ref affectedObjCount);
                    }
                    if (aigroup.kids1 != null)
                    {
                        foreach (LogicObj npc in aigroup.kids1)
                        {
                            if (npc.changed)
                            {
                                SaveOneLogicObj(npc, map.filename, ref affectedObjCount);
                            }
                        }
                    }
                }
                foreach (LogicObj waypointset in map.WayPointSets)
                {
                    if (waypointset.changed)
                    {
                        SaveOneLogicObj(waypointset, map.filename, ref affectedObjCount);
                    }
                    if (waypointset.kids1 != null)
                    {
                        foreach (LogicObj waypoint in waypointset.kids1)
                        {
                            if (waypoint.changed)
                            {
                                SaveOneLogicObj(waypoint, map.filename, ref affectedObjCount);
                            }
                        }
                    }
                }
                foreach (LogicObj logicalpoly in map.LogicalPolys)
                {
                    if (logicalpoly.changed)
                    {
                        SaveOneLogicObj(logicalpoly, map.filename, ref affectedObjCount);
                    }
                    if (logicalpoly.kids1 != null)
                    {
                        foreach (LogicObj vertex in logicalpoly.kids1)
                        {
                            if (vertex.changed)
                            {
                                SaveOneLogicObj(vertex, map.filename, ref affectedObjCount);
                            }
                        }
                    }
                }
            }

            return(affectedObjCount);
        }
コード例 #3
0
        private void LoadTree(string mapName)
        {
            // 添加结点
            foreach (DictionaryEntry entry in maps)
            {
                LO_Map map = entry.Value as LO_Map;
                if (map.name != mapName)
                {
                    continue;
                }

                TreeNode nodeMap = tree1.Nodes.Add(map.name, map.name);
                nodeMap.Tag = map.name;

                TreeNode nodesNPC = nodeMap.Nodes.Add(string.Empty, "NPCs");
                nodesNPC.Tag = nodesNPC.Text;
                foreach (LogicObj npc in map.NPCs)
                {
                    string npcName         = npc.values[0];
                    string fullDisplayName = string.Format("{0} [{1}] {2} {3}", npcName, npc.inDex, npc.values[1].Length != 0 ? "[" + npc.values[1] + "]" : string.Empty, npc.values[2].Length != 0 ? "[√]" : string.Empty);

                    TreeNode[] nodefathers = nodesNPC.Nodes.Find(npcName, false);
                    if (nodefathers.Length == 0)
                    {
                        TreeNode newnpcnode = nodesNPC.Nodes.Add(npcName, fullDisplayName);
                        newnpcnode.Tag = npc;
                    }
                    else if (nodefathers.Length == 1)
                    {
                        // 把原来位于分类上的结点变成它自己的孩子
                        if (nodefathers[0].Tag != null)
                        {
                            TreeNode oldnewnpcnode = nodefathers[0].Nodes.Add(nodefathers[0].Name, nodefathers[0].Text);
                            oldnewnpcnode.Tag = nodefathers[0].Tag;

                            nodefathers[0].Text = nodefathers[0].Name;
                            nodefathers[0].Tag  = null;
                        }

                        // 再添加这一个。
                        TreeNode newnpcnode = nodefathers[0].Nodes.Add(npcName, fullDisplayName);
                        newnpcnode.Tag = npc;
                    }
                }

                TreeNode nodesDoodad = nodeMap.Nodes.Add(string.Empty, "Doodads");
                nodesDoodad.Tag = nodesDoodad.Text;
                foreach (LogicObj doodad in map.Doodads)
                {
                    string doodadName      = doodad.values[0];
                    string fullDisplayName = string.Format("{0} [{1}] {2} {3}", doodadName, doodad.inDex, doodad.values[1].Length != 0 ? "[" + doodad.values[1] + "]" : string.Empty, doodad.values[2].Length != 0 ? "[√]" : string.Empty);

                    TreeNode[] nodefathers = nodesDoodad.Nodes.Find(doodadName, false);
                    if (nodefathers.Length == 0)
                    {
                        TreeNode newdoodadnode = nodesDoodad.Nodes.Add(doodadName, fullDisplayName);
                        newdoodadnode.Tag = doodad;
                    }
                    else if (nodefathers.Length == 1)
                    {
                        // 把原来位于分类上的结点变成它自己的孩子
                        if (nodefathers[0].Tag != null)
                        {
                            TreeNode oldnewdoodadnode = nodefathers[0].Nodes.Add(nodefathers[0].Name, nodefathers[0].Text);
                            oldnewdoodadnode.Tag = nodefathers[0].Tag;

                            nodefathers[0].Text = nodefathers[0].Name;
                            nodefathers[0].Tag  = null;
                        }

                        // 再添加这一个。
                        TreeNode newdoodadnode = nodefathers[0].Nodes.Add(doodadName, fullDisplayName);
                        newdoodadnode.Tag = doodad;
                    }
                }

                TreeNode nodesNPCRefreshPointSet = nodeMap.Nodes.Add(string.Empty, "NPCRefreshPointSets");
                nodesNPCRefreshPointSet.Tag = nodesNPCRefreshPointSet.Text;
                foreach (LogicObj npcrefreshpointset in map.NPCRefreshPointSets)
                {
                    TreeNode newnodeSet = nodesNPCRefreshPointSet.Nodes.Add(npcrefreshpointset.inDex.ToString(), npcrefreshpointset.values[0]);
                    newnodeSet.Tag = npcrefreshpointset;

                    TreeNode nodePoints = newnodeSet.Nodes.Add(string.Empty, "Points");
                    if (npcrefreshpointset.kids1 != null)
                    {
                        //int i = 0;
                        foreach (LogicObj point in npcrefreshpointset.kids1)
                        {
                            TreeNode newnodePoint = nodePoints.Nodes.Add(point.inDex.ToString(), "Point" + point.inDex.ToString());
                            newnodePoint.Tag = point;
                        }
                    }
                    TreeNode nodeNPCs = newnodeSet.Nodes.Add(string.Empty, "NPCs");
                    if (npcrefreshpointset.kids2 != null)
                    {
                        //int i = 0;
                        foreach (LogicObj npc in npcrefreshpointset.kids2)
                        {
                            TreeNode newnodenpc = nodeNPCs.Nodes.Add(npc.inDex.ToString(), "NPC" + npc.inDex.ToString());
                            newnodenpc.Tag = npc;
                        }
                    }
                }

                TreeNode nodesDoodadRefreshPointSet = nodeMap.Nodes.Add(string.Empty, "DoodadRefreshPointSet");
                nodesDoodadRefreshPointSet.Tag = nodesDoodadRefreshPointSet.Text;
                foreach (LogicObj doodadrefreshpointset in map.DoodadRefreshPointSets)
                {
                    TreeNode newnodeSet = nodesDoodadRefreshPointSet.Nodes.Add(doodadrefreshpointset.inDex.ToString(), doodadrefreshpointset.values[0]);
                    newnodeSet.Tag = doodadrefreshpointset;

                    TreeNode nodePoints = newnodeSet.Nodes.Add(string.Empty, "Points");
                    if (doodadrefreshpointset.kids1 != null)
                    {
                        //int i = 0;
                        foreach (LogicObj point in doodadrefreshpointset.kids1)
                        {
                            TreeNode newnodepoint = nodePoints.Nodes.Add(point.inDex.ToString(), "Point" + point.inDex.ToString());
                            newnodepoint.Tag = point;
                        }
                    }
                    TreeNode nodeDoodads = newnodeSet.Nodes.Add(string.Empty, "Doodads");
                    if (doodadrefreshpointset.kids2 != null)
                    {
                        //int i = 0;
                        foreach (LogicObj doodad in doodadrefreshpointset.kids2)
                        {
                            TreeNode newnodedoodad = nodeDoodads.Nodes.Add(doodad.inDex.ToString(), "Doodad" + doodad.inDex.ToString());
                            newnodedoodad.Tag = doodad;
                        }
                    }
                }

                TreeNode nodesAIGroup = nodeMap.Nodes.Add(string.Empty, "AIGroup");
                nodesAIGroup.Tag = nodesAIGroup.Text;
                foreach (LogicObj aigroup in map.AIGroups)
                {
                    TreeNode newnodegroup = nodesAIGroup.Nodes.Add(aigroup.inDex.ToString(), aigroup.values[0]);
                    newnodegroup.Tag = aigroup;

                    TreeNode nodeNPCs = newnodegroup.Nodes.Add(string.Empty, "NPCs");
                    if (aigroup.kids1 != null)
                    {
                        //int i = 0;
                        foreach (LogicObj npc in aigroup.kids1)
                        {
                            TreeNode newnodenpc = nodeNPCs.Nodes.Add(npc.inDex.ToString(), "NPC" + npc.inDex.ToString());
                            newnodenpc.Tag = npc;
                        }
                    }
                }

                TreeNode nodesWayPointSet = nodeMap.Nodes.Add(string.Empty, "WayPointSet");
                nodesWayPointSet.Tag = nodesWayPointSet.Text;
                foreach (LogicObj waypointset in map.WayPointSets)
                {
                    TreeNode newnodeset = nodesWayPointSet.Nodes.Add(waypointset.inDex.ToString(), waypointset.values[0]);
                    newnodeset.Tag = waypointset;

                    TreeNode nodePoint = newnodeset.Nodes.Add(string.Empty, "Points");
                    if (waypointset.kids1 != null)
                    {
                        //int i = 0;
                        foreach (LogicObj point in waypointset.kids1)
                        {
                            TreeNode newnodepoint = nodePoint.Nodes.Add(point.inDex.ToString(), "Point" + point.inDex.ToString());
                            newnodepoint.Tag = point;
                        }
                    }
                }

                TreeNode nodesLogicalPoly = nodeMap.Nodes.Add(string.Empty, "LogicalPoly");
                nodesLogicalPoly.Tag = nodesLogicalPoly.Text;
                foreach (LogicObj poly in map.LogicalPolys)
                {
                    TreeNode newnodepoly = nodesLogicalPoly.Nodes.Add(poly.inDex.ToString(), poly.values[6]);
                    newnodepoly.Tag = poly;

                    TreeNode nodeVertex = newnodepoly.Nodes.Add(string.Empty, "Vertexs");
                    if (poly.kids1 != null)
                    {
                        //int i = 0;
                        foreach (LogicObj v in poly.kids1)
                        {
                            TreeNode newnodevertex = nodeVertex.Nodes.Add(v.inDex.ToString(), "Vertex" + v.inDex.ToString());
                            newnodevertex.Tag = v;
                        }
                    }
                }

                // 加上个数描述
                foreach (TreeNode node in nodeMap.Nodes)
                {
                    if (node.Text == "NPCs" || node.Text == "Doodads")
                    {
                        foreach (TreeNode n in node.Nodes)
                        {
                            if (n.Nodes.Count > 0)
                            {
                                n.Text += string.Format(" [共{0}个]", n.Nodes.Count);
                            }
                        }
                    }

                    node.Text += string.Format(" [共{0}个]", node.Nodes.Count);
                }
            }
        }
コード例 #4
0
ファイル: LoadData.cs プロジェクト: viticm/pap2
        private void DoImportOneTarget(string strFile, string mapname)
        {
            this.progressBar1.Visible = true;

            // 读文件
            string content = Helper.FileToString(strFile, Encoding.Default);
            byte[] bytes = Encoding.Default.GetBytes(content);
            bytes = Encoding.Convert(Encoding.Default, Encoding.Unicode, bytes);
            char[] chars = Encoding.Unicode.GetChars(bytes);
            content = new String(chars);
            Helper.OpenIniFile(strFile, content);
            if (Helper.m_inis == null)
            {
                string strErr = string.Format("{0} 不是正确的ini格式,\r\n可能包含有 \"<<<<<<< .mine\" 等 SVN 合并残留字符串。\r\n请检查之。", strFile);
                MessageBox.Show(strErr);
                return;
            }

            // map 对象
            LO_Map map = new LO_Map();
            maps.Add(mapname, map);
            //maps.Add(map);

            map.logicalChanged = false;
            map.name = mapname;
            map.filename = strFile;
            LogicObj main = new LogicObj("MAIN");
            main.Read();
            map.MAIN = main;
            map.NPCs = new LogicObj[Convert.ToInt32(map.MAIN.values[0])];
            map.Doodads = new LogicObj[Convert.ToInt32(map.MAIN.values[1])];
            map.NPCRefreshPointSets = new LogicObj[Convert.ToInt32(map.MAIN.values[2])];
            map.DoodadRefreshPointSets = new LogicObj[Convert.ToInt32(map.MAIN.values[4])];
            map.AIGroups = new LogicObj[Convert.ToInt32(map.MAIN.values[6])];
            map.WayPointSets = new LogicObj[Convert.ToInt32(map.MAIN.values[8])];
            map.LogicalPolys = new LogicObj[Convert.ToInt32(map.MAIN.values[13])];

            this.progressBar1.Step = 1;
            this.progressBar1.Minimum = 0;

            this.progressBar1.Value = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[0]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[0]); i++)
            {
                LogicObj npc = new LogicObj("NPC");
                npc.inDex = i;
                npc.Read();
                map.NPCs[i] = npc;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[1]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[1]); i++)
            {
                LogicObj doodad = new LogicObj("Doodad");
                doodad.inDex = i;
                doodad.Read();
                map.Doodads[i] = doodad;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[2]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[2]); i++)
            {
                LogicObj npcrefreshset = new LogicObj("NPCRefreshPointSet");
                npcrefreshset.inDex = i;
                npcrefreshset.Read();
                npcrefreshset.kids1 = new LogicObj[Convert.ToInt32(npcrefreshset.values[2])];
                npcrefreshset.kids2 = new LogicObj[Convert.ToInt32(npcrefreshset.values[3])];
                for (int j = 0; j < Convert.ToInt32(npcrefreshset.values[2]); j++)
                {
                    LogicObj point = new LogicObj("NPCRefreshPoint");
                    point.inDex = j;
                    point.parentindex = i;
                    point.Read();
                    npcrefreshset.kids1[j] = point;
                }
                for (int j = 0; j < Convert.ToInt32(npcrefreshset.values[3]); j++)
                {
                    LogicObj npc = new LogicObj("NPCRefreshNPC");
                    npc.inDex = j;
                    npc.parentindex = i;
                    npc.Read();
                    npcrefreshset.kids2[j] = npc;
                }
                map.NPCRefreshPointSets[i] = npcrefreshset;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[4]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[4]); i++)
            {
                LogicObj doodadrefreshset = new LogicObj("DoodadRefreshPointSet");
                doodadrefreshset.inDex = i;
                doodadrefreshset.Read();
                doodadrefreshset.kids1 = new LogicObj[Convert.ToInt32(doodadrefreshset.values[2])];
                doodadrefreshset.kids2 = new LogicObj[Convert.ToInt32(doodadrefreshset.values[3])];
                for (int j = 0; j < Convert.ToInt32(doodadrefreshset.values[2]); j++)
                {
                    LogicObj point = new LogicObj("DoodadRefreshPoint");
                    point.inDex = j;
                    point.parentindex = i;
                    point.Read();
                    doodadrefreshset.kids1[j] = point;
                }
                for (int j = 0; j < Convert.ToInt32(doodadrefreshset.values[3]); j++)
                {
                    LogicObj doodad = new LogicObj("DoodadRefreshDoodad");
                    doodad.inDex = j;
                    doodad.parentindex = i;
                    doodad.Read();
                    doodadrefreshset.kids2[j] = doodad;
                }
                map.DoodadRefreshPointSets[i] = doodadrefreshset;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[6]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[6]); i++)
            {
                LogicObj aigroup = new LogicObj("AIGroup");
                aigroup.inDex = i;
                aigroup.Read();
                aigroup.kids1 = new LogicObj[Convert.ToInt32(aigroup.values[5])];
                for (int j = 0; j < Convert.ToInt32(aigroup.values[5]); j++)
                {
                    LogicObj npc = new LogicObj("AIGroupNPC");
                    npc.inDex = j;
                    npc.parentindex = i;
                    npc.Read();
                    aigroup.kids1[j] = npc;
                }
                map.AIGroups[i] = aigroup;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[8]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[8]); i++)
            {
                LogicObj waypointset = new LogicObj("WayPointSet");
                waypointset.inDex = i;
                waypointset.Read();
                waypointset.kids1 = new LogicObj[Convert.ToInt32(waypointset.values[2])];
                for (int j = 0; j < Convert.ToInt32(waypointset.values[2]); j++)
                {
                    LogicObj waypoint = new LogicObj("WayPoint");
                    waypoint.inDex = j;
                    waypoint.parentindex = i;
                    waypoint.Read();
                    waypointset.kids1[j] = waypoint;
                }
                map.WayPointSets[i] = waypointset;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[13]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[13]); i++)
            {
                LogicObj logicalpoly = new LogicObj("LogicalPoly");
                logicalpoly.inDex = i;
                logicalpoly.Read();
                logicalpoly.kids1 = new LogicObj[Convert.ToInt32(logicalpoly.values[4])];
                for (int j = 0; j < Convert.ToInt32(logicalpoly.values[4]); j++)
                {
                    LogicObj vertex = new LogicObj("LogicalPolyVertex");
                    vertex.inDex = j;
                    vertex.parentindex = i;
                    vertex.Read();
                    logicalpoly.kids1[j] = vertex;
                }
                map.LogicalPolys[i] = logicalpoly;
                this.progressBar1.Value++;
            }
            this.progressBar1.Visible = false;

            Helper.CloseIniFile();
        }
コード例 #5
0
        private void DoImportOneTarget(string strFile, string mapname)
        {
            this.progressBar1.Visible = true;

            // 读文件
            string content = Helper.FileToString(strFile, Encoding.Default);

            byte[] bytes = Encoding.Default.GetBytes(content);
            bytes = Encoding.Convert(Encoding.Default, Encoding.Unicode, bytes);
            char[] chars = Encoding.Unicode.GetChars(bytes);
            content = new String(chars);
            Helper.OpenIniFile(strFile, content);
            if (Helper.m_inis == null)
            {
                string strErr = string.Format("{0} 不是正确的ini格式,\r\n可能包含有 \"<<<<<<< .mine\" 等 SVN 合并残留字符串。\r\n请检查之。", strFile);
                MessageBox.Show(strErr);
                return;
            }

            // map 对象
            LO_Map map = new LO_Map();

            maps.Add(mapname, map);
            //maps.Add(map);

            map.logicalChanged = false;
            map.name           = mapname;
            map.filename       = strFile;
            LogicObj main = new LogicObj("MAIN");

            main.Read();
            map.MAIN                   = main;
            map.NPCs                   = new LogicObj[Convert.ToInt32(map.MAIN.values[0])];
            map.Doodads                = new LogicObj[Convert.ToInt32(map.MAIN.values[1])];
            map.NPCRefreshPointSets    = new LogicObj[Convert.ToInt32(map.MAIN.values[2])];
            map.DoodadRefreshPointSets = new LogicObj[Convert.ToInt32(map.MAIN.values[4])];
            map.AIGroups               = new LogicObj[Convert.ToInt32(map.MAIN.values[6])];
            map.WayPointSets           = new LogicObj[Convert.ToInt32(map.MAIN.values[8])];
            map.LogicalPolys           = new LogicObj[Convert.ToInt32(map.MAIN.values[13])];

            this.progressBar1.Step    = 1;
            this.progressBar1.Minimum = 0;

            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[0]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[0]); i++)
            {
                LogicObj npc = new LogicObj("NPC");
                npc.inDex = i;
                npc.Read();
                map.NPCs[i] = npc;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[1]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[1]); i++)
            {
                LogicObj doodad = new LogicObj("Doodad");
                doodad.inDex = i;
                doodad.Read();
                map.Doodads[i] = doodad;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[2]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[2]); i++)
            {
                LogicObj npcrefreshset = new LogicObj("NPCRefreshPointSet");
                npcrefreshset.inDex = i;
                npcrefreshset.Read();
                npcrefreshset.kids1 = new LogicObj[Convert.ToInt32(npcrefreshset.values[2])];
                npcrefreshset.kids2 = new LogicObj[Convert.ToInt32(npcrefreshset.values[3])];
                for (int j = 0; j < Convert.ToInt32(npcrefreshset.values[2]); j++)
                {
                    LogicObj point = new LogicObj("NPCRefreshPoint");
                    point.inDex       = j;
                    point.parentindex = i;
                    point.Read();
                    npcrefreshset.kids1[j] = point;
                }
                for (int j = 0; j < Convert.ToInt32(npcrefreshset.values[3]); j++)
                {
                    LogicObj npc = new LogicObj("NPCRefreshNPC");
                    npc.inDex       = j;
                    npc.parentindex = i;
                    npc.Read();
                    npcrefreshset.kids2[j] = npc;
                }
                map.NPCRefreshPointSets[i] = npcrefreshset;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[4]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[4]); i++)
            {
                LogicObj doodadrefreshset = new LogicObj("DoodadRefreshPointSet");
                doodadrefreshset.inDex = i;
                doodadrefreshset.Read();
                doodadrefreshset.kids1 = new LogicObj[Convert.ToInt32(doodadrefreshset.values[2])];
                doodadrefreshset.kids2 = new LogicObj[Convert.ToInt32(doodadrefreshset.values[3])];
                for (int j = 0; j < Convert.ToInt32(doodadrefreshset.values[2]); j++)
                {
                    LogicObj point = new LogicObj("DoodadRefreshPoint");
                    point.inDex       = j;
                    point.parentindex = i;
                    point.Read();
                    doodadrefreshset.kids1[j] = point;
                }
                for (int j = 0; j < Convert.ToInt32(doodadrefreshset.values[3]); j++)
                {
                    LogicObj doodad = new LogicObj("DoodadRefreshDoodad");
                    doodad.inDex       = j;
                    doodad.parentindex = i;
                    doodad.Read();
                    doodadrefreshset.kids2[j] = doodad;
                }
                map.DoodadRefreshPointSets[i] = doodadrefreshset;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[6]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[6]); i++)
            {
                LogicObj aigroup = new LogicObj("AIGroup");
                aigroup.inDex = i;
                aigroup.Read();
                aigroup.kids1 = new LogicObj[Convert.ToInt32(aigroup.values[5])];
                for (int j = 0; j < Convert.ToInt32(aigroup.values[5]); j++)
                {
                    LogicObj npc = new LogicObj("AIGroupNPC");
                    npc.inDex       = j;
                    npc.parentindex = i;
                    npc.Read();
                    aigroup.kids1[j] = npc;
                }
                map.AIGroups[i] = aigroup;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[8]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[8]); i++)
            {
                LogicObj waypointset = new LogicObj("WayPointSet");
                waypointset.inDex = i;
                waypointset.Read();
                waypointset.kids1 = new LogicObj[Convert.ToInt32(waypointset.values[2])];
                for (int j = 0; j < Convert.ToInt32(waypointset.values[2]); j++)
                {
                    LogicObj waypoint = new LogicObj("WayPoint");
                    waypoint.inDex       = j;
                    waypoint.parentindex = i;
                    waypoint.Read();
                    waypointset.kids1[j] = waypoint;
                }
                map.WayPointSets[i] = waypointset;
                this.progressBar1.Value++;
            }
            this.progressBar1.Value   = 0;
            this.progressBar1.Maximum = Convert.ToInt32(map.MAIN.values[13]);
            for (int i = 0; i < Convert.ToInt32(map.MAIN.values[13]); i++)
            {
                LogicObj logicalpoly = new LogicObj("LogicalPoly");
                logicalpoly.inDex = i;
                logicalpoly.Read();
                logicalpoly.kids1 = new LogicObj[Convert.ToInt32(logicalpoly.values[4])];
                for (int j = 0; j < Convert.ToInt32(logicalpoly.values[4]); j++)
                {
                    LogicObj vertex = new LogicObj("LogicalPolyVertex");
                    vertex.inDex       = j;
                    vertex.parentindex = i;
                    vertex.Read();
                    logicalpoly.kids1[j] = vertex;
                }
                map.LogicalPolys[i] = logicalpoly;
                this.progressBar1.Value++;
            }
            this.progressBar1.Visible = false;

            Helper.CloseIniFile();
        }