Esempio n. 1
0
        private void HandleSDSMap(FileInfo info, bool forceBigEndian = false)
        {
            //make sure to load materials.
            MaterialData.Load();


            //we now build scene data from GameExplorer rather than d3d viewer.
            SceneData.ScenePath = info.DirectoryName;
            SceneData.BuildData(forceBigEndian);

            //d3d viewer expects data inside scenedata.
            D3DForm d3dForm = new D3DForm(info);

            d3dForm.Dispose();
        }
Esempio n. 2
0
        //Improve this, its bad.
        private void HandleFile(ListViewItem item)
        {
            if (ToolkitSettings.UseSDSToolFormat)
            {
                switch (item.SubItems[1].Text)
                {
                case "Directory":
                    OpenDirectory((DirectoryInfo)item.Tag);
                    return;

                case "SDS Archive":
                    OpenSDS((FileInfo)item.Tag);
                    break;

                default:
                    Process.Start(((FileInfo)item.Tag).FullName);
                    break;
                }
                return;
            }

            MaterialTool            mTool;
            CollisionEditor         cTool;
            ActorEditor             aTool;
            PrefabLoader            prefabs;
            SpeechEditor            sTool;
            CutsceneLoader          cutscene;
            IOFxFile                iofx;
            EmitterFile             emitterFile;
            TableEditor             tTool;
            NAVData                 nav;
            ApexRenderMesh          mesh;
            ApexClothingAssetLoader aca;
            CityAreaEditor          caEditor;
            CityShopEditor          csEditor;
            SoundSectorLoader       soundSector;

            //DEBUG
            D3DForm d3dForm;

            //special case:
            if (item.SubItems[0].Text.Contains("SDSContent") && item.SubItems[1].Text == "XML")
            {
                new SDSContentEditor((FileInfo)item.Tag);
                return;
            }
            else if (item.SubItems[0].Text.Contains("cityareas") && item.SubItems[1].Text == "BIN")
            {
                caEditor = new CityAreaEditor((FileInfo)item.Tag);
                return;
            }
            else if (item.SubItems[0].Text.Contains("FrameProps") && item.SubItems[1].Text == "BIN")
            {
                FrameProps fProps = new FrameProps((FileInfo)item.Tag);
                return;
            }
            else if (item.SubItems[0].Text.Contains("cityshop") && item.SubItems[1].Text == "BIN")
            {
                csEditor = new CityShopEditor((FileInfo)item.Tag);
                return;
            }
            else if (item.SubItems[0].Text.Contains("roadmap") && item.SubItems[1].Text == "GSD")
            {
                Roadmap roadmap = new Roadmap((item.Tag as FileInfo));
                return;
            }
            else if (item.SubItems[0].Text.Contains("shopmenu2") && item.SubItems[1].Text == "BIN")
            {
                ShopMenu2Editor editor = new ShopMenu2Editor((item.Tag as FileInfo));
                return;
            }
            else if (item.SubItems[1].Text == "BIN" && HandleStreamMap((item.Tag as FileInfo)))
            {
                StreamEditor editor = new StreamEditor((item.Tag as FileInfo));
                return;
            }
            else if (item.SubItems[1].Text == "BIN" && CGameData.CheckHeader((item.Tag as FileInfo)))
            {
                CGameData data = new CGameData((item.Tag as FileInfo));
                return;
            }
            else if (item.SubItems[0].Text.Contains("sdsconfig") && item.SubItems[1].Text == "BIN")
            {
                using (BinaryReader reader = new BinaryReader(File.Open((item.Tag as FileInfo).FullName, FileMode.Open)))
                {
                    SdsConfigFile sdsConfig = new SdsConfigFile();
                    sdsConfig.ReadFromFile(reader);
                }
                return;
            }

            switch (item.SubItems[1].Text)
            {
            case "ARM":
                mesh = new ApexRenderMesh((FileInfo)item.Tag);
                return;

            case "ATP":
                AnimalTrafficLoader loader = new AnimalTrafficLoader((FileInfo)item.Tag);
                return;

            case "ACA":
                aca = new ApexClothingAssetLoader((FileInfo)item.Tag);
                return;

            case "Directory":
                OpenDirectory((DirectoryInfo)item.Tag);
                return;

            case "Material Library":
                mTool = new MaterialTool((FileInfo)item.Tag);
                return;

            case "NAV":
            case "NOV":
            case "NHV":
                nav = new NAVData((FileInfo)item.Tag);
                return;

            case "Speech Data":
                sTool = new SpeechEditor((FileInfo)item.Tag);
                return;

            case "CUT":
                cutscene = new CutsceneLoader((FileInfo)item.Tag);
                return;

            case "SDS Archive":
                OpenSDS((FileInfo)item.Tag);
                break;

            case "PATCH Archive":
                OpenPATCH((FileInfo)item.Tag);
                break;

            case "FR":
                //fTool = new FrameResourceTool((FileInfo)item.Tag);
                d3dForm = new D3DForm((FileInfo)item.Tag);
                d3dForm.Dispose();
                return;

            case "COL":
                cTool = new CollisionEditor((FileInfo)item.Tag);
                return;

            case "IOFX":
                iofx = new IOFxFile((FileInfo)item.Tag);
                return;

            case "AEA":
                emitterFile = new EmitterFile((FileInfo)item.Tag);
                return;

            case "Table":
                tTool = new TableEditor((FileInfo)item.Tag);
                return;

            case "TRA":
                TranslokatorEditor editor = new TranslokatorEditor((FileInfo)item.Tag);
                return;

            case "ACT":
                aTool = new ActorEditor((FileInfo)item.Tag);
                break;

            case "PRF":
                prefabs = new PrefabLoader((FileInfo)item.Tag);
                return;

            case "LUA":
            case "AP":
            case "SHP":
                HandleLuaFile((FileInfo)item.Tag);
                return;

            case "IFL":
                ResourceTypes.AnimatedTexture.AnimatedTextureLoader an = new ResourceTypes.AnimatedTexture.AnimatedTextureLoader((FileInfo)item.Tag);
                return;

            case "IDS":
                ResourceTypes.ItemDesc.ItemDescLoader itemDesc = new ResourceTypes.ItemDesc.ItemDescLoader((item.Tag as FileInfo).FullName);
                return;

            case "BIN":
                SoundSectorLoader sLoader = new SoundSectorLoader(item.Tag as FileInfo);
                return;

            default:
                Process.Start(((FileInfo)item.Tag).FullName);
                break;
            }
        }