Animation support for Advanced Image Viewer

master
1987kostya 5 years ago
parent 87b30637fb
commit 8bcb0cd8a9

@ -69,9 +69,12 @@
this.hexBox1 = new Be.Windows.Forms.HexBox(); this.hexBox1 = new Be.Windows.Forms.HexBox();
this.charBox = new System.Windows.Forms.TextBox(); this.charBox = new System.Windows.Forms.TextBox();
this.advDumpTab = new System.Windows.Forms.TabPage(); this.advDumpTab = new System.Windows.Forms.TabPage();
this.advancedInfoLabel = new System.Windows.Forms.Label();
this.advancedPlayAnimation = new System.Windows.Forms.Button();
this.advancedPictureBox = new System.Windows.Forms.PictureBox(); this.advancedPictureBox = new System.Windows.Forms.PictureBox();
this.advancedTreeView = new System.Windows.Forms.TreeView(); this.advancedTreeView = new System.Windows.Forms.TreeView();
this.pluginTab = new System.Windows.Forms.TabPage(); this.pluginTab = new System.Windows.Forms.TabPage();
this.pluginLogBox = new System.Windows.Forms.TextBox();
this.activatePluginBtn = new System.Windows.Forms.Button(); this.activatePluginBtn = new System.Windows.Forms.Button();
this.pluginsList = new System.Windows.Forms.ListBox(); this.pluginsList = new System.Windows.Forms.ListBox();
this.packDataDialog = new System.Windows.Forms.SaveFileDialog(); this.packDataDialog = new System.Windows.Forms.SaveFileDialog();
@ -590,6 +593,8 @@
// advDumpTab // advDumpTab
// //
this.advDumpTab.BackColor = System.Drawing.Color.DimGray; this.advDumpTab.BackColor = System.Drawing.Color.DimGray;
this.advDumpTab.Controls.Add(this.advancedInfoLabel);
this.advDumpTab.Controls.Add(this.advancedPlayAnimation);
this.advDumpTab.Controls.Add(this.advancedPictureBox); this.advDumpTab.Controls.Add(this.advancedPictureBox);
this.advDumpTab.Controls.Add(this.advancedTreeView); this.advDumpTab.Controls.Add(this.advancedTreeView);
this.advDumpTab.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0))))); this.advDumpTab.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0)))));
@ -600,6 +605,27 @@
this.advDumpTab.TabIndex = 1; this.advDumpTab.TabIndex = 1;
this.advDumpTab.Text = "Advanced"; this.advDumpTab.Text = "Advanced";
// //
// advancedInfoLabel
//
this.advancedInfoLabel.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.advancedInfoLabel.BackColor = System.Drawing.Color.FromArgb(((int) (((byte) (64)))), ((int) (((byte) (64)))), ((int) (((byte) (64)))));
this.advancedInfoLabel.Location = new System.Drawing.Point(777, 3);
this.advancedInfoLabel.Name = "advancedInfoLabel";
this.advancedInfoLabel.Size = new System.Drawing.Size(155, 63);
this.advancedInfoLabel.TabIndex = 3;
this.advancedInfoLabel.Text = "DEBUG";
//
// advancedPlayAnimation
//
this.advancedPlayAnimation.Dock = System.Windows.Forms.DockStyle.Bottom;
this.advancedPlayAnimation.Location = new System.Drawing.Point(170, 441);
this.advancedPlayAnimation.Name = "advancedPlayAnimation";
this.advancedPlayAnimation.Size = new System.Drawing.Size(762, 35);
this.advancedPlayAnimation.TabIndex = 2;
this.advancedPlayAnimation.Text = "Play Animation";
this.advancedPlayAnimation.UseVisualStyleBackColor = true;
this.advancedPlayAnimation.Click += new System.EventHandler(this.advancedPlayAnimation_Click);
//
// advancedPictureBox // advancedPictureBox
// //
this.advancedPictureBox.BackColor = System.Drawing.Color.FromArgb(((int) (((byte) (64)))), ((int) (((byte) (64)))), ((int) (((byte) (64))))); this.advancedPictureBox.BackColor = System.Drawing.Color.FromArgb(((int) (((byte) (64)))), ((int) (((byte) (64)))), ((int) (((byte) (64)))));
@ -623,6 +649,7 @@
// pluginTab // pluginTab
// //
this.pluginTab.BackColor = System.Drawing.Color.Black; this.pluginTab.BackColor = System.Drawing.Color.Black;
this.pluginTab.Controls.Add(this.pluginLogBox);
this.pluginTab.Controls.Add(this.activatePluginBtn); this.pluginTab.Controls.Add(this.activatePluginBtn);
this.pluginTab.Controls.Add(this.pluginsList); this.pluginTab.Controls.Add(this.pluginsList);
this.pluginTab.Location = new System.Drawing.Point(4, 24); this.pluginTab.Location = new System.Drawing.Point(4, 24);
@ -631,14 +658,25 @@
this.pluginTab.TabIndex = 5; this.pluginTab.TabIndex = 5;
this.pluginTab.Text = "Plugins"; this.pluginTab.Text = "Plugins";
// //
// pluginLogBox
//
this.pluginLogBox.Dock = System.Windows.Forms.DockStyle.Right;
this.pluginLogBox.Location = new System.Drawing.Point(530, 0);
this.pluginLogBox.Multiline = true;
this.pluginLogBox.Name = "pluginLogBox";
this.pluginLogBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.pluginLogBox.Size = new System.Drawing.Size(405, 479);
this.pluginLogBox.TabIndex = 2;
//
// activatePluginBtn // activatePluginBtn
// //
this.activatePluginBtn.Dock = System.Windows.Forms.DockStyle.Fill;
this.activatePluginBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.activatePluginBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.activatePluginBtn.Font = new System.Drawing.Font("Feast of Flesh BB", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte) (77))); this.activatePluginBtn.Font = new System.Drawing.Font("Feast of Flesh BB", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte) (77)));
this.activatePluginBtn.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0))))); this.activatePluginBtn.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0)))));
this.activatePluginBtn.Location = new System.Drawing.Point(258, 3); this.activatePluginBtn.Location = new System.Drawing.Point(252, 0);
this.activatePluginBtn.Name = "activatePluginBtn"; this.activatePluginBtn.Name = "activatePluginBtn";
this.activatePluginBtn.Size = new System.Drawing.Size(140, 67); this.activatePluginBtn.Size = new System.Drawing.Size(683, 479);
this.activatePluginBtn.TabIndex = 1; this.activatePluginBtn.TabIndex = 1;
this.activatePluginBtn.Text = "Activate"; this.activatePluginBtn.Text = "Activate";
this.activatePluginBtn.UseVisualStyleBackColor = true; this.activatePluginBtn.UseVisualStyleBackColor = true;
@ -682,9 +720,16 @@
this.advDumpTab.ResumeLayout(false); this.advDumpTab.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize) (this.advancedPictureBox)).EndInit(); ((System.ComponentModel.ISupportInitialize) (this.advancedPictureBox)).EndInit();
this.pluginTab.ResumeLayout(false); this.pluginTab.ResumeLayout(false);
this.pluginTab.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
} }
private System.Windows.Forms.Label advancedInfoLabel;
private System.Windows.Forms.Button advancedPlayAnimation;
public System.Windows.Forms.TextBox pluginLogBox;
private System.Windows.Forms.Button activatePluginBtn; private System.Windows.Forms.Button activatePluginBtn;
private System.Windows.Forms.ListBox pluginsList; private System.Windows.Forms.ListBox pluginsList;

@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
@ -15,6 +16,8 @@ using DotNetCTFDumper.MMFParser.EXE.Loaders.Objects;
using DotNetCTFDumper.MMFParser.MFA.Loaders.mfachunks; using DotNetCTFDumper.MMFParser.MFA.Loaders.mfachunks;
using DotNetCTFDumper.MMFParser.Translation; using DotNetCTFDumper.MMFParser.Translation;
using DotNetCTFDumper.Utils; using DotNetCTFDumper.Utils;
using Animation = DotNetCTFDumper.MMFParser.EXE.Loaders.Objects.Animation;
using AnimationDirection = DotNetCTFDumper.MMFParser.EXE.Loaders.Objects.AnimationDirection;
namespace DotNetCTFDumper.GUI namespace DotNetCTFDumper.GUI
{ {
@ -49,7 +52,7 @@ namespace DotNetCTFDumper.GUI
if (item is Label) if (item is Label)
{ {
item.BackColor = Color.Transparent; //item.BackColor = Color.Transparent;
item.Refresh(); item.Refresh();
} }
} }
@ -59,12 +62,12 @@ namespace DotNetCTFDumper.GUI
foreach (Control item in tabPage.Controls) foreach (Control item in tabPage.Controls)
{ {
item.ForeColor = ColorTheme; item.ForeColor = ColorTheme;
if(!(item is PictureBox)&&!(item is TabPage))item.BackColor=Color.Black; if (!(item is PictureBox) && !(item is TabPage)&&!(item is Label)) item.BackColor = Color.Black;
if (item is Button) item.BackColor = Color.FromArgb(30, 30, 30); if (item is Button) item.BackColor = Color.FromArgb(30, 30, 30);
if (item is Label) if (item is Label)
{ {
item.BackColor = Color.Transparent; //item.BackColor = Color.Transparent;
item.Refresh(); item.Refresh();
} }
@ -76,6 +79,7 @@ namespace DotNetCTFDumper.GUI
((ToolStripItem) item).ForeColor = ColorTheme; ((ToolStripItem) item).ForeColor = ColorTheme;
((ToolStripItem) item).BackColor = Color.Black; ((ToolStripItem) item).BackColor = Color.Black;
} }
hexBox1.ForeColor = ColorTheme; hexBox1.ForeColor = ColorTheme;
hexBox1.InfoForeColor = Color.FromArgb(ColorTheme.R / 2, ColorTheme.G / 2, ColorTheme.B / 2); hexBox1.InfoForeColor = Color.FromArgb(ColorTheme.R / 2, ColorTheme.G / 2, ColorTheme.B / 2);
hexBox1.SelectionForeColor = Color.FromArgb(ColorTheme.R, ColorTheme.G, ColorTheme.B); hexBox1.SelectionForeColor = Color.FromArgb(ColorTheme.R, ColorTheme.G, ColorTheme.B);
@ -153,6 +157,7 @@ namespace DotNetCTFDumper.GUI
ChunkCombo.Show(Cursor.Position); ChunkCombo.Show(Cursor.Position);
} }
private void treeView1_RightClick(object sender, MouseEventArgs e) private void treeView1_RightClick(object sender, MouseEventArgs e)
{ {
if ((e.Button & MouseButtons.Right) != 0) if ((e.Button & MouseButtons.Right) != 0)
@ -161,6 +166,7 @@ namespace DotNetCTFDumper.GUI
} }
} }
private void ChunkCombo_ItemSelected(object sender, ToolStripItemClickedEventArgs e) private void ChunkCombo_ItemSelected(object sender, ToolStripItemClickedEventArgs e)
{ {
switch (e.ClickedItem.Name) switch (e.ClickedItem.Name)
@ -171,6 +177,7 @@ namespace DotNetCTFDumper.GUI
{ {
chunk.Save(); chunk.Save();
} }
break; break;
case "viewHexBtn": case "viewHexBtn":
ShowHex(); ShowHex();
@ -200,7 +207,8 @@ namespace DotNetCTFDumper.GUI
listBox1.Items.Add($"Id: {nodeChunk.Id}"); listBox1.Items.Add($"Id: {nodeChunk.Id}");
listBox1.Items.Add($"Flag: {nodeChunk.Flag}"); listBox1.Items.Add($"Flag: {nodeChunk.Flag}");
listBox1.Items.Add($"Size: {nodeChunk.Size.ToPrettySize()}"); listBox1.Items.Add($"Size: {nodeChunk.Size.ToPrettySize()}");
if (nodeChunk.DecompressedSize>-1)listBox1.Items.Add($"Decompressed Size: {nodeChunk.DecompressedSize.ToPrettySize()}"); if (nodeChunk.DecompressedSize > -1)
listBox1.Items.Add($"Decompressed Size: {nodeChunk.DecompressedSize.ToPrettySize()}");
} }
if (nodeLoader != null) if (nodeLoader != null)
@ -218,6 +226,7 @@ namespace DotNetCTFDumper.GUI
} }
} }
} }
GameInfo.BackColor = Color.Transparent; GameInfo.BackColor = Color.Transparent;
GameInfo.Refresh(); GameInfo.Refresh();
@ -263,7 +272,8 @@ namespace DotNetCTFDumper.GUI
foreach (var key in items.ItemDict.Keys) foreach (var key in items.ItemDict.Keys)
{ {
var frameItem = items.ItemDict[key]; var frameItem = items.ItemDict[key];
var objNode = new ChunkNode($"{(Constants.ObjectType)frameItem.ObjectType} - {frameItem.Name}", frameItem); var objNode = new ChunkNode($"{(Constants.ObjectType) frameItem.ObjectType} - {frameItem.Name}",
frameItem);
newNode.Nodes.Add(objNode); newNode.Nodes.Add(objNode);
} }
@ -323,6 +333,7 @@ namespace DotNetCTFDumper.GUI
soundBar.Value = (int) (index / (float) all * 100); soundBar.Value = (int) (index / (float) all * 100);
soundLabel.Text = $"{index}/{all}"; soundLabel.Text = $"{index}/{all}";
} }
public void UpdateMusicBar(int index, int all) public void UpdateMusicBar(int index, int all)
{ {
all -= 1; all -= 1;
@ -366,6 +377,7 @@ namespace DotNetCTFDumper.GUI
SetSoundElements(false); SetSoundElements(false);
} }
} }
private void imagesButton_Click(object sender, EventArgs e) private void imagesButton_Click(object sender, EventArgs e)
{ {
if (Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>() == null) return; if (Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>() == null) return;
@ -384,6 +396,7 @@ namespace DotNetCTFDumper.GUI
SetImageElements(false); SetImageElements(false);
} }
} }
private void musicsButton_Click(object sender, EventArgs e) private void musicsButton_Click(object sender, EventArgs e)
{ {
if (Exe.Instance.GameData.GameChunks.GetChunk<MusicBank>() == null) return; if (Exe.Instance.GameData.GameChunks.GetChunk<MusicBank>() == null) return;
@ -410,6 +423,7 @@ namespace DotNetCTFDumper.GUI
soundsButton.Text = state ? "Cancel" : "Dump Sounds"; soundsButton.Text = state ? "Cancel" : "Dump Sounds";
soundBar.Value = 0; soundBar.Value = 0;
} }
public void SetImageElements(bool state) public void SetImageElements(bool state)
{ {
imageBar.Visible = state; imageBar.Visible = state;
@ -417,6 +431,7 @@ namespace DotNetCTFDumper.GUI
imagesButton.Text = state ? "Cancel" : "Dump Images"; imagesButton.Text = state ? "Cancel" : "Dump Images";
imageBar.Value = 0; imageBar.Value = 0;
} }
public void SetMusicElements(bool state) public void SetMusicElements(bool state)
{ {
musicBar.Visible = state; musicBar.Visible = state;
@ -487,6 +502,7 @@ namespace DotNetCTFDumper.GUI
} }
} }
Process.Start($"{Settings.DumpPath}"); Process.Start($"{Settings.DumpPath}");
}; };
@ -510,6 +526,7 @@ namespace DotNetCTFDumper.GUI
rawData += Settings.AppName; rawData += Settings.AppName;
rawData += Settings.Copyright; rawData += Settings.Copyright;
} }
try try
{ {
var previewKey = Decryption.MakeKeyFromBytes(rawData, (byte) int.Parse((charBox.Text))); var previewKey = Decryption.MakeKeyFromBytes(rawData, (byte) int.Parse((charBox.Text)));
@ -529,6 +546,7 @@ namespace DotNetCTFDumper.GUI
{ {
packDataListBox.Items.Add(item.PackFilename); packDataListBox.Items.Add(item.PackFilename);
} }
UpdatePackInfo(0); UpdatePackInfo(0);
} }
@ -537,6 +555,7 @@ namespace DotNetCTFDumper.GUI
var item = Exe.Instance.PackData.Items[index]; var item = Exe.Instance.PackData.Items[index];
infoLabel.Text = $"Name: {item.PackFilename}\nSize: {item.Data.Length.ToPrettySize()}"; infoLabel.Text = $"Name: {item.PackFilename}\nSize: {item.Data.Length.ToPrettySize()}";
} }
private void dumpPackButton_Click(object sender, EventArgs e) private void dumpPackButton_Click(object sender, EventArgs e)
{ {
var item = Exe.Instance.PackData.Items[packDataListBox.SelectedIndex]; var item = Exe.Instance.PackData.Items[packDataListBox.SelectedIndex];
@ -557,18 +576,28 @@ namespace DotNetCTFDumper.GUI
item.Dump(); item.Dump();
} }
} }
private void packDataDialog_FileOk(object sender, CancelEventArgs e) private void packDataDialog_FileOk(object sender, CancelEventArgs e)
{ {
var item = Exe.Instance.PackData.Items[packDataListBox.SelectedIndex]; var item = Exe.Instance.PackData.Items[packDataListBox.SelectedIndex];
item.Dump(packDataDialog.FileName); item.Dump(packDataDialog.FileName);
} }
private void packDataListBox_SelectedIndexChanged(object sender, EventArgs e)=>UpdatePackInfo(packDataListBox.SelectedIndex); private void packDataListBox_SelectedIndexChanged(object sender, EventArgs e) =>
UpdatePackInfo(packDataListBox.SelectedIndex);
private void plusCharBtn_Click(object sender, EventArgs e){ charBox.Text = (byte.Parse(charBox.Text) + 1).ToString(); InitKeyTab();} private void plusCharBtn_Click(object sender, EventArgs e)
{
charBox.Text = (byte.Parse(charBox.Text) + 1).ToString();
InitKeyTab();
}
private void minusCharButton_Click(object sender, EventArgs e){ charBox.Text = (byte.Parse(charBox.Text) - 1).ToString(); InitKeyTab();} private void minusCharButton_Click(object sender, EventArgs e)
{
charBox.Text = (byte.Parse(charBox.Text) - 1).ToString();
InitKeyTab();
}
private void charBox_TextChanged(object sender, EventArgs e) => InitKeyTab(); private void charBox_TextChanged(object sender, EventArgs e) => InitKeyTab();
@ -621,27 +650,44 @@ namespace DotNetCTFDumper.GUI
} }
} }
} }
private void advancedPlayAnimation_Click(object sender, EventArgs e)
public void InitPlugins()
{ {
PluginAPI.PluginAPI.InitializePlugins(); if (((ChunkNode) advancedTreeView.SelectedNode).loader is Animation anim)
foreach (var plugin in PluginAPI.PluginAPI.Plugins)
{ {
pluginsList.Items.Add(plugin.Name); var animThread = new Thread(PlayAnimation);
List<Bitmap> frames = new List<Bitmap>();
foreach (var dir in anim.DirectionDict)
{
foreach (var frame in dir.Value.Frames)
{
frames.Add(Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>().Images[frame].Bitmap);
}
animThread.Start(new Tuple<List<Bitmap>,AnimationDirection>(frames,dir.Value));
}
} }
} }
public void PlayAnimation(object o)
{
var (frames,anim) = (Tuple<List<Bitmap>,AnimationDirection>) o;
var fps = (float)anim.MaxSpeed;
float delay = 1f/fps;
Console.WriteLine((int) (delay*1200));
foreach (Bitmap frame in frames)
{
advancedPictureBox.Image = frame;
advancedInfoLabel.Text = $"Current frame: {frames.IndexOf(frame)}\nAnimation Speed: {fps}";
Thread.Sleep((int) (delay*1500));
}
}
private void advancedTreeView_AfterSelect(object sender, TreeViewEventArgs e) private void advancedTreeView_AfterSelect(object sender, TreeViewEventArgs e)
{ {
var node = e.Node; var node = e.Node;
if (!(((ChunkNode) node).loader is ImageItem)) if (((ChunkNode) node).loader is ImageItem)
{
advancedPictureBox.Image = advancedPictureBox.ErrorImage;
}
else
{ {
var img = ((ImageItem) ((ChunkNode) node).loader); var img = ((ImageItem) ((ChunkNode) node).loader);
advancedPictureBox.Image = img.Bitmap; advancedPictureBox.Image = img.Bitmap;
@ -649,9 +695,29 @@ namespace DotNetCTFDumper.GUI
} }
public void InitPlugins()
{
PluginAPI.PluginAPI.InitializePlugins();
foreach (var plugin in PluginAPI.PluginAPI.Plugins)
{
pluginsList.Items.Add(plugin.Name);
}
}
private void activatePluginBtn_Click(object sender, EventArgs e) private void activatePluginBtn_Click(object sender, EventArgs e)
{ {
PluginAPI.PluginAPI.Plugins[pluginsList.SelectedIndex].pluginClass.Activate(null); PluginAPI.PluginAPI.ActivatePlugin(PluginAPI.PluginAPI.Plugins[pluginsList.SelectedIndex]);
} }
} }
} }

@ -2,6 +2,7 @@
{ {
public interface IPlugin public interface IPlugin
{ {
object Activate(object input); object Activate(object input);
} }

@ -4,6 +4,7 @@ using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using DotNetCTFDumper.MMFParser.EXE;
using DotNetCTFDumper.MMFParser.EXE.Loaders; using DotNetCTFDumper.MMFParser.EXE.Loaders;
using DotNetCTFDumper.MMFParser.MFA; using DotNetCTFDumper.MMFParser.MFA;
using DotNetCTFDumper.MMFParser.MFA.Loaders; using DotNetCTFDumper.MMFParser.MFA.Loaders;
@ -37,27 +38,86 @@ namespace DotNetCTFDumper.PluginAPI
foreach (var type in types) foreach (var type in types)
{ {
var pluginClass = asm.CreateInstance(type.FullName) as IPlugin; var pluginClass = asm.CreateInstance(type.FullName) as IPlugin;
var plugin = new Plugin(type.Name,"Kostya",pluginClass); string name = "ERROR";
foreach (var attribute in asm.GetCustomAttributes(typeof(CTFDumperPluginAttribute)))
{
name = ((CTFDumperPluginAttribute) attribute).Name;
}
var plugin = new Plugin(name,"Kostya",asm,pluginClass);
Plugins.Add(plugin); Plugins.Add(plugin);
} }
} }
} }
public static object ActivatePlugin(Plugin plugin)
{
foreach (var attribute in plugin.Asm.GetCustomAttributes(typeof(CTFDumperPluginAttribute)))
{
if (((CTFDumperPluginAttribute) attribute).Type == PluginIOType.GameData)
{
return plugin.pluginClass.Activate(Exe.Instance.GameData);
}
else throw new NotImplementedException("Not Supported");
}
throw new NotImplementedException("Critical error ");
}
public static void Message(string msg, bool showTime = true)
{
var date = DateTime.Now;
if (showTime)
Program.MyForm.pluginLogBox.AppendText(
$"[{date.Hour,2}:{date.Minute,2}:{date.Second,2}:{date.Millisecond,3}] " + msg + "\r\n");
else Program.MyForm.pluginLogBox.AppendText(msg + "\r\n");
}
} }
public class Plugin public class Plugin
{ {
public string Name; public string Name;
public Assembly Asm;
public Plugin(string name, string author, IPlugin pluginClass) public string Author;
public IPlugin pluginClass;
public Plugin(string name, string author,Assembly asm, IPlugin pluginClass)
{ {
Name = name; Name = name;
Author = author; Author = author;
Asm=asm;
this.pluginClass = pluginClass; this.pluginClass = pluginClass;
} }
public string Author;
public IPlugin pluginClass;
}
public enum PluginIOType
{
GameData,
PackData,
MFA,
Chunk,
ChunkLoader,
MFALoader
}
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
public class CTFDumperPluginAttribute : Attribute
{
public string Name { get; }
public PluginIOType Type { get; }
public CTFDumperPluginAttribute(string name, PluginIOType type)
{
Name = name;
Type = type;
}
} }
} }

Loading…
Cancel
Save