Esempio n. 1
0
        public MapNames()
        {
            InitializeComponent();

            listH1c.ItemsSource = Halo1.Where(e => e.Type == MapType.Campaign);
            listH1m.ItemsSource = Halo1.Where(e => e.Type == MapType.Multiplayer);

            listH2c.ItemsSource = Halo2.Where(e => e.Type == MapType.Campaign);
            listH2m.ItemsSource = Halo2.Where(e => e.Type == MapType.Multiplayer);

            listH2a.ItemsSource = Halo2A;

            listH3c.ItemsSource = Halo3.Where(e => e.Type == MapType.Campaign);
            listH3m.ItemsSource = Halo3.Where(e => e.Type == MapType.Multiplayer);

            listOdstc.ItemsSource = HaloODST.Where(e => e.Type == MapType.Campaign);
            listOdsts.ItemsSource = HaloODST.Where(e => e.Type == MapType.Survival);

            listReachc.ItemsSource = HaloReach.Where(e => e.Type == MapType.Campaign);
            listReachs.ItemsSource = HaloReach.Where(e => e.Type == MapType.Survival);
            listReachm.ItemsSource = HaloReach.Where(e => e.Type == MapType.Multiplayer);

            listH4c.ItemsSource = Halo4.Where(e => e.Type == MapType.Campaign);
            listH4s.ItemsSource = Halo4.Where(e => e.Type == MapType.Survival);
            listH4m.ItemsSource = Halo4.Where(e => e.Type == MapType.Multiplayer);
        }
Esempio n. 2
0
        /// <summary>Close the resources used by this library</summary>
        public static void Close()
        {
            if (isInitialized)
            {
                Stubbs.Close();
#if NO_HALO4
                Halo4.Close();
#endif
#if NO_HALO_REACH
                HaloReach.Close();
#endif
#if NO_HALO_ODST
                HaloOdst.Close();
#endif
#if NO_HALO3
                Halo3.Close();
#endif
#if !NO_HALO2
                Halo2.Close();
#endif
                Halo1.Close();
                Debug.Exceptions.Dispose();
                Debug.Trace.Close();
                Debug.LogFile.CloseLog();

                isInitialized = false;
            }
        }
        private void btnOpenSandbox_Click(object sender, RoutedEventArgs e)
        {
            var ofd = new OpenFileDialog();

            if ((bool)ofd.ShowDialog())
            {
                var h3 = new Halo3(ofd.FileName);
                lblSandboxPath.Text = ofd.FileName;

                var container = new Model3DCollection();
                foreach (var placedObject in h3.SandboxObjects.Where(placedObject => placedObject.TagIndex != -1))
                {
                    // Try to load Model
                    if (placedObject.TagEntry.Tag.TagPath.Contains("spawning"))
                    {
                    }

                    string gameAssetPath;
                    try
                    {
                        gameAssetPath = VariousFunctions.GetGameAsset(Halo3.GameId, placedObject.TagEntry.Tag.TagPath);
                    }
                    catch (FileNotFoundException)
                    {
                        ActionLog.AddEntry("Missing Game Asset");
                        continue;
                    }

                    var model = (Model3D)ModelImporter.Load(gameAssetPath);
                    model.Transform = CreateTransformGroup(placedObject);
                    container.Add(model);
                }

                ModelViewport.Children.Clear();
                ModelViewport.Children.Add(new GridLines());
                foreach (var model in container)
                {
                    ModelViewport.Children.Add(new ModelVisual3D
                    {
                        Content = model
                    });
                }
                var light        = new LightVisual3D();
                var ambientLight = new AmbientLight(Colors.WhiteSmoke)
                {
                    Transform = new MatrixTransform3D(new Matrix3D
                    {
                        OffsetX = 0,
                        OffsetY = 0,
                        OffsetZ = 100
                    })
                };
                light.Content = ambientLight;
                ModelViewport.Children.Add(light);

                ModelViewport.ShowCameraInfo = true;
                ModelViewport.ZoomExtents();
                ModelViewport.IsHeadLightEnabled = true;
            }
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            if (args != null && args.Length > 0 && File.Exists(args[0]))
                MessageBox.Show("feature not yet implimented.");

            var ofd = new OpenFileDialog
                          {
                              Title = "Visual Forge - Select a Usermap",
                              Filter = "Xbox 360 Container File|*|Sandbox BLF file (sandbox.map)|*.map|All Files|*",
            #if DEBUG
                              InitialDirectory = @"C:\Users\Alex Reed\Desktop\r-search\"
            #endif
                          };
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                var target = GetTarget(ofd.FileName);

                switch(target)
                {
                    case TargetGame.Halo3:
                        using (var game = new Halo3(ofd.FileName))
                        {
                            game.Run();
                        }
                        break;

                    default:
                        throw new InvalidFilterCriteriaException("The selected file is not from a supported game. Current Visual Forge only supports Halo 3.");
                }
            }
        }
Esempio n. 5
0
        public static void Initialize()
        {
            if (!isInitialized)
            {
                //if(System.Diagnostics.Debugger.IsAttached)

                /*{	// HACK: to make the LoaderLock message appear as soon as possible.
                 *      // This is only needed during VS debugging. Won't get it during non-debug runtime.
                 *      // SlimDX doesn't have these issues.
                 *      var t = typeof(Microsoft.DirectX.UnsafeNativeMethods);
                 *      t = typeof(Microsoft.DirectX.Direct3D.Device);
                 *      t = null;
                 * }*/

                Debug.Exceptions.Initialize();

                System.Windows.Forms.Application.ApplicationExit +=
                    new EventHandler(Application_ApplicationExit);

                Halo1.Initialize();
#if !NO_HALO2
                Halo2.Initialize();
#endif
#if NO_HALO3
                Halo3.Initialize();
#endif
#if NO_HALO_ODST
                HaloOdst.Initialize();
#endif
#if NO_HALO_REACH
                HaloReach.Initialize();
#endif
#if NO_HALO4
                Halo4.Initialize();
#endif
                Stubbs.Initialize();

                TagInterface.DefinitionStatePool.PostProcess();

                isInitialized = true;
            }
        }