From cabb11d440cd6d8bfef646c89edd519af9fd4c6c Mon Sep 17 00:00:00 2001 From: Gericom Date: Thu, 6 Nov 2014 19:16:24 +0100 Subject: [PATCH] Plugin stuff, open multiple files at a time, bugfix --- 3DS/UI/CLYTViewer.Designer.cs | 23 ++-- 3DS/UI/CLYTViewer.cs | 5 + EveryFileExplorer/EveryFileExplorer.csproj | 3 + EveryFileExplorer/Form1.Designer.cs | 108 +++++++++++++------ EveryFileExplorer/Form1.cs | 5 +- EveryFileExplorer/Form1.resx | 3 - EveryFileExplorer/Plugins/Plugin.cs | 6 +- EveryFileExplorer/Properties/AssemblyInfo.cs | 4 +- LibEveryFileExplorer/Projects/Project.cs | 24 ++++- README.md | 1 + 10 files changed, 130 insertions(+), 52 deletions(-) diff --git a/3DS/UI/CLYTViewer.Designer.cs b/3DS/UI/CLYTViewer.Designer.cs index 4d8fbcd..a5a1b33 100644 --- a/3DS/UI/CLYTViewer.Designer.cs +++ b/3DS/UI/CLYTViewer.Designer.cs @@ -35,6 +35,7 @@ this.tabPage1 = new System.Windows.Forms.TabPage(); this.treeView1 = new System.Windows.Forms.TreeView(); this.tabPage2 = new System.Windows.Forms.TabPage(); + this.treeView2 = new System.Windows.Forms.TreeView(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.tabPage5 = new System.Windows.Forms.TabPage(); @@ -42,7 +43,6 @@ this.simpleOpenGlControl1 = new Tao.Platform.Windows.SimpleOpenGlControl(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.mainMenu1 = new LibEveryFileExplorer.UI.MainMenu(this.components); - this.treeView2 = new System.Windows.Forms.TreeView(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -138,6 +138,16 @@ this.tabPage2.Text = "Groups"; this.tabPage2.UseVisualStyleBackColor = true; // + // treeView2 + // + this.treeView2.Dock = System.Windows.Forms.DockStyle.Fill; + this.treeView2.HideSelection = false; + this.treeView2.HotTracking = true; + this.treeView2.Location = new System.Drawing.Point(0, 0); + this.treeView2.Name = "treeView2"; + this.treeView2.Size = new System.Drawing.Size(186, 156); + this.treeView2.TabIndex = 0; + // // tabPage3 // this.tabPage3.Location = new System.Drawing.Point(4, 22); @@ -200,16 +210,6 @@ this.toolStrip1.TabIndex = 0; this.toolStrip1.Text = "toolStrip1"; // - // treeView2 - // - this.treeView2.Dock = System.Windows.Forms.DockStyle.Fill; - this.treeView2.HideSelection = false; - this.treeView2.HotTracking = true; - this.treeView2.Location = new System.Drawing.Point(0, 0); - this.treeView2.Name = "treeView2"; - this.treeView2.Size = new System.Drawing.Size(186, 156); - this.treeView2.TabIndex = 0; - // // CLYTViewer // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -219,6 +219,7 @@ this.Menu = this.mainMenu1; this.Name = "CLYTViewer"; this.Text = "CLYTViewer"; + this.Activated += new System.EventHandler(this.CLYTViewer_Activated); this.Load += new System.EventHandler(this.CLYTViewer_Load); this.Layout += new System.Windows.Forms.LayoutEventHandler(this.CLYTViewer_Layout); this.Resize += new System.EventHandler(this.CLYTViewer_Resize); diff --git a/3DS/UI/CLYTViewer.cs b/3DS/UI/CLYTViewer.cs index 34f886e..af492b1 100644 --- a/3DS/UI/CLYTViewer.cs +++ b/3DS/UI/CLYTViewer.cs @@ -231,5 +231,10 @@ namespace _3DS.UI Render(); Render(); } + + private void CLYTViewer_Activated(object sender, EventArgs e) + { + for (int i = 0; i < 8; i++) Render(); + } } } diff --git a/EveryFileExplorer/EveryFileExplorer.csproj b/EveryFileExplorer/EveryFileExplorer.csproj index 6afcb6a..cd891d6 100644 --- a/EveryFileExplorer/EveryFileExplorer.csproj +++ b/EveryFileExplorer/EveryFileExplorer.csproj @@ -36,6 +36,9 @@ Propeller_Box_Artwork_-_Super_Mario_3D_World.ico + + EveryFileExplorer.Program + diff --git a/EveryFileExplorer/Form1.Designer.cs b/EveryFileExplorer/Form1.Designer.cs index c46da47..9dcf968 100644 --- a/EveryFileExplorer/Form1.Designer.cs +++ b/EveryFileExplorer/Form1.Designer.cs @@ -34,14 +34,22 @@ this.menuFile = new System.Windows.Forms.MenuItem(); this.menuNew = new System.Windows.Forms.MenuItem(); this.menuFileNew = new System.Windows.Forms.MenuItem(); + this.menuItem10 = new System.Windows.Forms.MenuItem(); + this.menuItem11 = new System.Windows.Forms.MenuItem(); this.menuOpen = new System.Windows.Forms.MenuItem(); + this.menuItem1 = new System.Windows.Forms.MenuItem(); + this.menuItem8 = new System.Windows.Forms.MenuItem(); this.menuClose = new System.Windows.Forms.MenuItem(); + this.menuItem9 = new System.Windows.Forms.MenuItem(); this.menuItem5 = new System.Windows.Forms.MenuItem(); this.menuSave = new System.Windows.Forms.MenuItem(); this.menuSaveAs = new System.Windows.Forms.MenuItem(); this.menuItem7 = new System.Windows.Forms.MenuItem(); this.menuExit = new System.Windows.Forms.MenuItem(); this.menuEdit = new System.Windows.Forms.MenuItem(); + this.menuProject = new System.Windows.Forms.MenuItem(); + this.menuItem3 = new System.Windows.Forms.MenuItem(); + this.menuItem6 = new System.Windows.Forms.MenuItem(); this.menuTools = new System.Windows.Forms.MenuItem(); this.menuCompression = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); @@ -59,9 +67,6 @@ this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.panel2 = new System.Windows.Forms.Panel(); this.splitter1 = new System.Windows.Forms.Splitter(); - this.menuProject = new System.Windows.Forms.MenuItem(); - this.menuItem3 = new System.Windows.Forms.MenuItem(); - this.menuItem6 = new System.Windows.Forms.MenuItem(); this.panel1.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); @@ -82,8 +87,13 @@ this.menuFile.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuNew, this.menuFileNew, + this.menuItem10, + this.menuItem11, this.menuOpen, + this.menuItem1, + this.menuItem8, this.menuClose, + this.menuItem9, this.menuItem5, this.menuSave, this.menuSaveAs, @@ -101,46 +111,72 @@ this.menuFileNew.Index = 1; this.menuFileNew.Text = "New from File"; // + // menuItem10 + // + this.menuItem10.Index = 2; + this.menuItem10.Text = "New Project"; + // + // menuItem11 + // + this.menuItem11.Index = 3; + this.menuItem11.Text = "-"; + // // menuOpen // - this.menuOpen.Index = 2; + this.menuOpen.Index = 4; this.menuOpen.Text = "Open..."; this.menuOpen.Click += new System.EventHandler(this.OpenFile); // + // menuItem1 + // + this.menuItem1.Index = 5; + this.menuItem1.Text = "Open Project..."; + // + // menuItem8 + // + this.menuItem8.Index = 6; + this.menuItem8.Text = "-"; + // // menuClose // this.menuClose.Enabled = false; - this.menuClose.Index = 3; + this.menuClose.Index = 7; this.menuClose.Text = "Close"; this.menuClose.Click += new System.EventHandler(this.menuClose_Click); // + // menuItem9 + // + this.menuItem9.Enabled = false; + this.menuItem9.Index = 8; + this.menuItem9.Text = "Close Project"; + // // menuItem5 // - this.menuItem5.Index = 4; + this.menuItem5.Index = 9; this.menuItem5.Text = "-"; // // menuSave // this.menuSave.Enabled = false; - this.menuSave.Index = 5; + this.menuSave.Index = 10; this.menuSave.Text = "Save"; this.menuSave.Click += new System.EventHandler(this.SaveFile); // // menuSaveAs // this.menuSaveAs.Enabled = false; - this.menuSaveAs.Index = 6; + this.menuSaveAs.Index = 11; this.menuSaveAs.Text = "Save As..."; this.menuSaveAs.Click += new System.EventHandler(this.menuSaveAs_Click); // // menuItem7 // - this.menuItem7.Index = 7; + this.menuItem7.Index = 12; this.menuItem7.Text = "-"; // // menuExit // - this.menuExit.Index = 8; + this.menuExit.Index = 13; this.menuExit.Text = "Exit"; this.menuExit.Click += new System.EventHandler(this.menuExit_Click); // @@ -151,6 +187,29 @@ this.menuEdit.MergeType = System.Windows.Forms.MenuMerge.MergeItems; this.menuEdit.Text = "Edit"; // + // menuProject + // + this.menuProject.Index = 2; + this.menuProject.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { + this.menuItem3, + this.menuItem6}); + this.menuProject.MergeOrder = 2; + this.menuProject.MergeType = System.Windows.Forms.MenuMerge.MergeItems; + this.menuProject.Text = "Project"; + this.menuProject.Visible = false; + // + // menuItem3 + // + this.menuItem3.Index = 0; + this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.F6; + this.menuItem3.Text = "Build"; + // + // menuItem6 + // + this.menuItem6.Index = 1; + this.menuItem6.Shortcut = System.Windows.Forms.Shortcut.F5; + this.menuItem6.Text = "Build and Run"; + // // menuTools // this.menuTools.Index = 3; @@ -215,6 +274,7 @@ // openFileDialog1 // this.openFileDialog1.FileName = "openFileDialog1"; + this.openFileDialog1.Multiselect = true; // // panel1 // @@ -276,29 +336,6 @@ this.splitter1.TabStop = false; this.splitter1.Visible = false; // - // menuProject - // - this.menuProject.Index = 2; - this.menuProject.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { - this.menuItem3, - this.menuItem6}); - this.menuProject.MergeOrder = 2; - this.menuProject.MergeType = System.Windows.Forms.MenuMerge.MergeItems; - this.menuProject.Text = "Project"; - this.menuProject.Visible = false; - // - // menuItem3 - // - this.menuItem3.Index = 0; - this.menuItem3.Shortcut = System.Windows.Forms.Shortcut.F6; - this.menuItem3.Text = "Build"; - // - // menuItem6 - // - this.menuItem6.Index = 1; - this.menuItem6.Shortcut = System.Windows.Forms.Shortcut.F5; - this.menuItem6.Text = "Build and Run"; - // // Form1 // this.AllowDrop = true; @@ -361,6 +398,11 @@ private System.Windows.Forms.MenuItem menuProject; private System.Windows.Forms.MenuItem menuItem3; private System.Windows.Forms.MenuItem menuItem6; + private System.Windows.Forms.MenuItem menuItem1; + private System.Windows.Forms.MenuItem menuItem8; + private System.Windows.Forms.MenuItem menuItem9; + private System.Windows.Forms.MenuItem menuItem10; + private System.Windows.Forms.MenuItem menuItem11; } } diff --git a/EveryFileExplorer/Form1.cs b/EveryFileExplorer/Form1.cs index 5572f4f..9c34d2e 100644 --- a/EveryFileExplorer/Form1.cs +++ b/EveryFileExplorer/Form1.cs @@ -171,7 +171,10 @@ namespace EveryFileExplorer if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK && openFileDialog1.FileName.Length > 0) { - Program.FileManager.OpenFile(new EFEDiskFile(openFileDialog1.FileName)); + foreach (String s in openFileDialog1.FileNames) + { + Program.FileManager.OpenFile(new EFEDiskFile(s)); + } } opening = false; } diff --git a/EveryFileExplorer/Form1.resx b/EveryFileExplorer/Form1.resx index e1ce271..3f1a16a 100644 --- a/EveryFileExplorer/Form1.resx +++ b/EveryFileExplorer/Form1.resx @@ -126,9 +126,6 @@ 379, 17 - - 379, 17 - diff --git a/EveryFileExplorer/Plugins/Plugin.cs b/EveryFileExplorer/Plugins/Plugin.cs index 2b2a26a..c4ea1d6 100644 --- a/EveryFileExplorer/Plugins/Plugin.cs +++ b/EveryFileExplorer/Plugins/Plugin.cs @@ -15,6 +15,7 @@ namespace EveryFileExplorer.Plugins public String Version; public Type[] CompressionTypes; public Type[] FileFormatTypes; + public Type[] ProjectTypes; public Plugin(Assembly Assembly) { @@ -31,15 +32,18 @@ namespace EveryFileExplorer.Plugins Type[] tt = Assembly.GetExportedTypes(); List fe = new List(); List ce = new List(); + List pe = new List(); foreach (var t in tt) { if (!t.IsClass) continue; var v = t.GetInterfaces(); if (v.Length != 0 && t.GetInterfaces()[0].Name == "FileFormatBase") fe.Add(t); else if (v.Length != 0 && t.GetInterfaces()[0].Name == "CompressionFormatBase") ce.Add(t); + else if (v.Length != 0 && t.GetInterfaces()[0].Name == "ProjectBase") pe.Add(t); } FileFormatTypes = fe.ToArray(); CompressionTypes = ce.ToArray(); + ProjectTypes = pe.ToArray(); } public static bool IsPlugin(Assembly Assembly) @@ -49,7 +53,7 @@ namespace EveryFileExplorer.Plugins { if (!t.IsClass) continue; var v = t.GetInterfaces(); - if (v.Length != 0 && (t.GetInterfaces()[0].Name == "FileFormatBase" || t.GetInterfaces()[0].Name == "CompressionFormatBase")) return true; + if (v.Length != 0 && (t.GetInterfaces()[0].Name == "FileFormatBase" || t.GetInterfaces()[0].Name == "CompressionFormatBase" || t.GetInterfaces()[0].Name == "ProjectBase")) return true; } return false; } diff --git a/EveryFileExplorer/Properties/AssemblyInfo.cs b/EveryFileExplorer/Properties/AssemblyInfo.cs index 7641e2a..85e4156 100644 --- a/EveryFileExplorer/Properties/AssemblyInfo.cs +++ b/EveryFileExplorer/Properties/AssemblyInfo.cs @@ -6,8 +6,8 @@ using System.Runtime.InteropServices; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Every File Explorer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] +[assembly: AssemblyDescription("Takes hacking to a higher level!")] +[assembly: AssemblyConfiguration("Devbuild")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Every File Explorer")] [assembly: AssemblyCopyright("Copyright © Florian Nouwt 2014")] diff --git a/LibEveryFileExplorer/Projects/Project.cs b/LibEveryFileExplorer/Projects/Project.cs index 7c3f7b6..9107d44 100644 --- a/LibEveryFileExplorer/Projects/Project.cs +++ b/LibEveryFileExplorer/Projects/Project.cs @@ -6,8 +6,23 @@ using System.Windows.Forms; namespace LibEveryFileExplorer.Projects { - public abstract class Project + public interface ProjectBase { + String ProjectDirectory { get; } + bool CanRun { get; } + + Control GetProjectControl(); + + void Build(); + void Run(); + void SaveProjectFile(); + } + + public abstract class Project : ProjectBase where T : ProjectIdentifier, new() + { + private static T _identifier = new T(); + public static T Identifier { get { return _identifier; } } + public Project(String ProjectDir) { ProjectDirectory = ProjectDir; @@ -20,5 +35,12 @@ namespace LibEveryFileExplorer.Projects public abstract void Build(); public abstract void Run(); + public abstract void SaveProjectFile(); + } + + public abstract class ProjectIdentifier + { + public abstract String GetProjectDescription(); + public abstract bool IsProject(byte[] Data); } } diff --git a/README.md b/README.md index 4000442..da33073 100644 --- a/README.md +++ b/README.md @@ -10,5 +10,6 @@ Just open the project in Visual Studio, and build it. You may need to specify th * 3DS * Common Compressors * Common Files +* Lego Pirates of the Carribean * Mario Kart * NDS \ No newline at end of file