Esempio n. 1
0
        public override int SetResourceParams(ChitinKey ckey, ResourceClass.IResource irFile)
        {
            if ((areFile == null) || (!areFile.Equals(irFile)) || (wedFile == null) || (tisFile == null))
            {
                if (baseImage != null)
                {
                    baseImage.Dispose();
                }
                baseImage = null;

                areFile = (ResourceClass.QAREFile)irFile;

                // load wed
                wedFile = (ResourceClass.GWEDFile)
                          ResourceHandler.LoadResourceFile(areFile.wedFile, ResourceStruct.ResourceType.RTypeGWED);

                if (wedFile == null)
                {
                    return(-1);
                }

                // At the start, lets just load layer 0 overlay & TIS
                tisFile = (ResourceClass.GTISFile)
                          ResourceHandler.LoadResourceFile(wedFile.overlayList[0].resTIS, ResourceStruct.ResourceType.RTypeGTIS);

                if (tisFile == null)
                {
                    return(-1);
                }

                // Loadup the AreaTV for the AREToolWin
                areToolWin.LoadAreaTV(areFile);

                // Just to hide tabpages that aren't used
                areTabs.TabPages.Clear();
                if (!splitter.Panel2Collapsed)
                {
                    LoadAreaElement(QARETreeView.NodeCode.NodeBasic, -1);
                }

                // Since we need to reload the base map;
                refreshMap = true;
            }

            // refreshmap if "edited" or new "are file"
            if (refreshMap)
            {
                this.DrawAreaMapRectangle();
            }

            ActivateControl();

            return(1);
        }
Esempio n. 2
0
        protected static ResourceClass.QDLGFile GetDialogFile(string ckeyName)
        {
            if (ckeyName == dlgFile.GetName())
            {
                return(dlgFile);
            }

            foreach (ResourceClass.QDLGFile dfile in extDialogFileCache)
            {
                if (ckeyName == dfile.GetName())
                {
                    return(dfile);
                }
            }

            ResourceClass.QDLGFile ddfile = (ResourceClass.QDLGFile)
                                            ResourceHandler.LoadResourceFile(ckeyName, ResourceStruct.ResourceType.RTypeQDLG);

            extDialogFileCache.Add(ddfile);

            return(ddfile);
        }