예제 #1
0
        /// <summary>
        /// Is called by SimPe (through the Wrapper) when the Panel is going to be displayed, so
        /// you should updatet the Data displayed by the Panel with the Attributes stored in the
        /// passed Wrapper.
        /// </summary>
        /// <param name="wrapper">The Attributes of this Wrapper have to be displayed</param>
        public void UpdateGUI(IFileWrapper wrapper)
        {
            Nmap wrp = (Nmap)wrapper;

            form.wrapper = wrp;

            form.lblist.Items.Clear();

            foreach (Interfaces.Files.IPackedFileDescriptor pfd in wrp.Items)
            {
                form.lblist.Items.Add(pfd);
            }
        }
예제 #2
0
 public NmapItem(Nmap parent)
 {
     this.parent = parent;
 }
예제 #3
0
        /// <summary>
        /// Load all pending Wallmask Files
        /// </summary>
        /// <param name="modelname"></param>
        /// <returns></returns>
        protected ArrayList LoadWallmask(string modelname)
        {
            ArrayList txmt = new ArrayList();

            //known types (based on a List created by Numenor)
            string[] list =
            {
                "0_0_0_n",                                                      //for all the straight doors/windows/arches
                "0_1s_0_s",                                                     //for all the straight doors/windows/arches
                "1e_0_0_n",                                                     //in addition to them, the 2-tile straight doors/windows/arches
                "1e_1s_0_s",                                                    //in addition to them, the 2-tile straight doors/windows/arches
                "0_0_0_nw",                                                     //all the diagonal doors/window/arches have
                "0_0_0_se",                                                     //all the diagonal doors/window/arches have
                "1e_1n_0_nw",                                                   // in addition to them, the 2-tile diagonals have
                "1e_1n_0_se"                                                    // in addition to them, the 2-tile diagonals have
            };

            modelname = modelname.Trim().ToLower();
            if (modelname.EndsWith("_cres"))
            {
                modelname = modelname.Substring(0, modelname.Length - 5);
            }

            //no Modelname => no Wallmask
            if (modelname == "")
            {
                return(txmt);
            }

            //this applies to all found NameMaps for TXTR Files
            ArrayList foundnames = new ArrayList();

            Interfaces.Scenegraph.IScenegraphFileIndexItem[] namemapitems = FileTable.FileIndex.FindFile(Data.MetaData.NAME_MAP, 0x52737256, Data.MetaData.TXMT, null);
            foreach (Interfaces.Scenegraph.IScenegraphFileIndexItem namemap in namemapitems)
            {
                SimPe.Plugin.Nmap nmap = new Nmap(null);
                nmap.ProcessData(namemap);

                foreach (NmapItem ni in nmap.Items)
                {
                    string name = ni.Filename.Trim().ToLower();
                    if (name.StartsWith(modelname) && name.EndsWith("_wallmask_txmt"))
                    {
                        Interfaces.Scenegraph.IScenegraphFileIndexItem item = FileTable.FileIndex.FindFileByName(name, Data.MetaData.TXMT, ni.Group, true);

                        if (item != null)
                        {
                            if (!foundnames.Contains(item.FileDescriptor))
                            {
                                foundnames.Add(item.FileDescriptor);
                                txmt.Add(item);
                            }
                        }
                    }
                }
            }

            /*foreach (string s in list)
             * {
             *      string nmn = modelname + "_" + s + "_wallmask_txmt";
             *
             *      Interfaces.Scenegraph.IScenegraphFileIndexItem item = FileTable.FileIndex.FindFileByName(nmn, Data.MetaData.TXMT, Data.MetaData.LOCAL_GROUP, true);
             *
             *      if (item!=null) txmt.Add(item);
             * }*/

            return(txmt);
        }