Exemple #1
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            FlummeryApplication.Settings.Load("flummery.config");

            CultureInfo.DefaultThreadCurrentCulture   = FlummeryApplication.Culture;
            CultureInfo.DefaultThreadCurrentUICulture = FlummeryApplication.Culture;

            Toolkit.Init();

            Text += $" v{FlummeryApplication.Version}";

            InputManager inputManager = new InputManager();

            SceneManager.Create(new Renderer.OpenTKRenderer());
            SceneManager.Current.Content.RootPath = Path.GetDirectoryName(Application.ExecutablePath);
            ContentManager.AddHint(Path.GetDirectoryName(Application.ExecutablePath));
            ContentManager.AddHint(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "data", "icons"));

            PnlViewport     viewport  = new PnlViewport();
            PnlMaterialList materials = new PnlMaterialList();
            PnlOverview     overview  = new PnlOverview();
            PnlDetails      details   = new PnlDetails();

            materials.FormClosed += materials_FormClosed;
            overview.FormClosed  += overview_FormClosed;
            details.FormClosed   += details_FormClosed;

            pluginHandler.InitialiseModules();

            viewport.Show(dockPanel, DockState.Document);
            materials.Show(dockPanel, DockState.DockBottom);
            overview.Show(dockPanel, DockState.DockLeft);
            details.Show(dockPanel, DockState.DockRight);

            SceneManager.Current.CanUseVertexBuffer = GL.GetString(StringName.Extensions).Split(' ').Contains("GL_ARB_vertex_buffer_object");

            dockPanel.DockLeftPortion   = 300;
            dockPanel.DockRightPortion  = 315;
            dockPanel.DockBottomPortion = 105;

            viewport.RegisterEventHandlers();
            overview.RegisterEventHandlers();
            materials.RegisterEventHandlers();
            details.RegisterEventHandlers();

            Logger.ResetLog();

            SetActionScalingText("Action Scaling: 1.000");

            KeyPreview = true;
            KeyPress  += new KeyPressEventHandler(frmMain_KeyPress);

            SceneManager.Current.OnProgress += scene_OnProgress;
            SceneManager.Current.OnError    += scene_OnError;
            SceneManager.Current.SetCoordinateSystem(CoordinateSystem.LeftHanded);

            //SceneManager.Current.SetContext(ContextGame.CarmageddonReincarnation, ContextMode.Car);

            pluginHandler.RegisterFileOpens(tsmiFileOpen, ofdBrowse);
            pluginHandler.RegisterFileImports(tsmiFileImport, ofdBrowse);
            pluginHandler.RegisterFileSaveFors(tsmiFileSaveFor, sfdBrowse);
            pluginHandler.RegisterFileSaveAs(tsmiFileSaveAs);
            pluginHandler.RegisterFileExports(tsmiFileExport, sfdBrowse);
            pluginHandler.RegisterTools(tsmiTools);
            pluginHandler.RegisterProcessAlls(tsmiToolsGeneralProcessAll, fbdBrowse);

            FlummeryApplication.UI = this;

            //ToxicRagers.UltimateRacePro.Formats.BankFile.Load(@"C:\Users\errol\Downloads\BNK\TRCK002.BD4");

            //var mshs = ToxicRagers.TDR2000.Formats.MSHS.Load(@"D:\Carmageddon Installations\SCi\Carmageddon TDR2000\ASSETS\Powerups\POWERUPS\newIcons_Fist0.msh");
            //mshs.Save(@"D:\Carmageddon Installations\SCi\Carmageddon TDR2000\ASSETS\Powerups\POWERUPS\newIcons_Fist0_Flummery.msh");

            //var mshs = ToxicRagers.TDR2000.Formats.MSHS.Load(@"D:\Carmageddon Installations\SCi\Carmageddon TDR2000\ASSETS\Cars\Eagle4\eagle_mk4_v8ConvSoft_eagle_mk4\Eagle_mk4_v8ConvSoft_eagle_mk4.mshs");
            //mshs.Save(@"D:\Carmageddon Installations\SCi\Carmageddon TDR2000\ASSETS\Cars\Eagle4\eagle_mk4_v8ConvSoft_eagle_mk4\Eagle_mk4_v8ConvSoft_eagle_mk4_Flummery.mshs");

            //var mshs = ToxicRagers.TDR2000.Formats.MSHS.Load(@"D:\Carmageddon Installations\SCi\Carmageddon TDR2000\ASSETS\Tracks\Arena\Level Convsoft\ArenaMesh\ArenaMesh.mshs");
            //mshs.Save(@"D:\Carmageddon Installations\SCi\Carmageddon TDR2000\ASSETS\Tracks\Arena\Level Convsoft\ArenaMesh\ArenaMesh_Flummery.mshs");

            //Application.Exit();
        }
Exemple #2
0
        private void menuViewClick(object sender, EventArgs e)
        {
            ToolStripMenuItem mi = (ToolStripMenuItem)sender;
            DockContent       panel;

            switch (mi.Text)
            {
            case "Preferences":
                if (new frmPreferences().ShowDialog(this) == DialogResult.OK)
                {
                    InputManager.Current.ReloadBindings();
                }
                break;

            case "Details":
                panel = (DockContent)dockPanel.Contents.FirstOrDefault(p => (p as DockContent).Text == mi.Text);

                if (panel == null)
                {
                    mi.Checked = true;

                    PnlDetails details = new PnlDetails();
                    details.Show(dockPanel, DockState.DockRight);
                    details.RegisterEventHandlers();
                    details.FormClosed += details_FormClosed;
                }
                else
                {
                    panel.Close();
                }
                break;

            case "Material List":
                panel = (DockContent)dockPanel.Contents.FirstOrDefault(p => (p as DockContent).Text == mi.Text);

                if (panel == null)
                {
                    mi.Checked = true;

                    PnlMaterialList materials = new PnlMaterialList();
                    materials.Show(dockPanel, DockState.DockBottom);
                    materials.RegisterEventHandlers();
                    materials.FormClosed += materials_FormClosed;
                }
                else
                {
                    panel.Close();
                }
                break;

            case "Overview":
                panel = (DockContent)dockPanel.Contents.FirstOrDefault(p => (p as DockContent).Text == mi.Text);

                if (panel == null)
                {
                    mi.Checked = true;

                    PnlOverview overview = new PnlOverview();
                    overview.Show(dockPanel, DockState.DockLeft);
                    overview.RegisterEventHandlers();
                    overview.FormClosed += overview_FormClosed;
                }
                else
                {
                    panel.Close();
                }
                break;
            }
        }