New sorted dumping system, because old one was too unstable(press control in object tab)

master
1987kostya 4 years ago
parent 496cab002f
commit e576dbb890

@ -8,7 +8,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{86D99F9E-98FB-4E50-AB68-F5C115850C33}</ProjectGuid> <ProjectGuid>{86D99F9E-98FB-4E50-AB68-F5C115850C33}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>CTFAK</RootNamespace> <RootNamespace>CTFAK</RootNamespace>
<AssemblyName>CTFAK</AssemblyName> <AssemblyName>CTFAK</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
@ -67,7 +67,7 @@
<OutputPath>bin\x64\Release\</OutputPath> <OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<DebugType>full</DebugType> <DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<LangVersion>7.3</LangVersion> <LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
@ -78,6 +78,8 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\x86\Release\</OutputPath> <OutputPath>bin\x86\Release\</OutputPath>
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Be.Windows.Forms.HexBox, Version=1.6.1.0, Culture=neutral, PublicKeyToken=null"> <Reference Include="Be.Windows.Forms.HexBox, Version=1.6.1.0, Culture=neutral, PublicKeyToken=null">

@ -44,7 +44,6 @@
this.soundsButton = new System.Windows.Forms.Button(); this.soundsButton = new System.Windows.Forms.Button();
this.imagesButton = new System.Windows.Forms.Button(); this.imagesButton = new System.Windows.Forms.Button();
this.loadingLabel = new System.Windows.Forms.Label(); this.loadingLabel = new System.Windows.Forms.Label();
this.dumpSortedBtn = new System.Windows.Forms.Button();
this.ChunkCombo = new System.Windows.Forms.ContextMenuStrip(this.components); this.ChunkCombo = new System.Windows.Forms.ContextMenuStrip(this.components);
this.saveChunkBtn = new System.Windows.Forms.ToolStripMenuItem(); this.saveChunkBtn = new System.Windows.Forms.ToolStripMenuItem();
this.viewHexBtn = new System.Windows.Forms.ToolStripMenuItem(); this.viewHexBtn = new System.Windows.Forms.ToolStripMenuItem();
@ -52,7 +51,6 @@
this.musicsButton = new System.Windows.Forms.Button(); this.musicsButton = new System.Windows.Forms.Button();
this.musicBar = new System.Windows.Forms.ProgressBar(); this.musicBar = new System.Windows.Forms.ProgressBar();
this.musicLabel = new System.Windows.Forms.Label(); this.musicLabel = new System.Windows.Forms.Label();
this.SortedProgressBar = new System.Windows.Forms.ProgressBar();
this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabControl1 = new System.Windows.Forms.TabControl();
this.mainTab = new System.Windows.Forms.TabPage(); this.mainTab = new System.Windows.Forms.TabPage();
this.mfaTab = new System.Windows.Forms.TabPage(); this.mfaTab = new System.Windows.Forms.TabPage();
@ -63,11 +61,11 @@
this.dumpAllPackButton = new System.Windows.Forms.Button(); this.dumpAllPackButton = new System.Windows.Forms.Button();
this.dumpPackButton = new System.Windows.Forms.Button(); this.dumpPackButton = new System.Windows.Forms.Button();
this.packDataListBox = new System.Windows.Forms.ListBox(); this.packDataListBox = new System.Windows.Forms.ListBox();
this.imgViewerTab = new System.Windows.Forms.TabPage(); this.objViewerTab = new System.Windows.Forms.TabPage();
this.imageViewerInfo = new System.Windows.Forms.Label(); this.objViewerInfo = new System.Windows.Forms.Label();
this.imageViewerPlayAnim = new System.Windows.Forms.Button(); this.imageViewerPlayAnim = new System.Windows.Forms.Button();
this.imageViewPictureBox = new System.Windows.Forms.PictureBox(); this.imageViewPictureBox = new System.Windows.Forms.PictureBox();
this.imagesTreeView = new System.Windows.Forms.TreeView(); this.objTreeView = new System.Windows.Forms.TreeView();
this.soundViewTab = new System.Windows.Forms.TabPage(); this.soundViewTab = new System.Windows.Forms.TabPage();
this.stopSoundBtn = new System.Windows.Forms.Button(); this.stopSoundBtn = new System.Windows.Forms.Button();
this.soundList = new System.Windows.Forms.TreeView(); this.soundList = new System.Windows.Forms.TreeView();
@ -81,6 +79,8 @@
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.settingsTab = new System.Windows.Forms.TabPage(); this.settingsTab = new System.Windows.Forms.TabPage();
this.langComboBox = new System.Windows.Forms.ComboBox();
this.langLabel = new System.Windows.Forms.Label();
this.colorLabel = new System.Windows.Forms.Label(); this.colorLabel = new System.Windows.Forms.Label();
this.updateSettings = new System.Windows.Forms.Button(); this.updateSettings = new System.Windows.Forms.Button();
this.colorBox = new System.Windows.Forms.TextBox(); this.colorBox = new System.Windows.Forms.TextBox();
@ -90,7 +90,7 @@
this.mainTab.SuspendLayout(); this.mainTab.SuspendLayout();
this.mfaTab.SuspendLayout(); this.mfaTab.SuspendLayout();
this.packDataTab.SuspendLayout(); this.packDataTab.SuspendLayout();
this.imgViewerTab.SuspendLayout(); this.objViewerTab.SuspendLayout();
((System.ComponentModel.ISupportInitialize) (this.imageViewPictureBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize) (this.imageViewPictureBox)).BeginInit();
this.soundViewTab.SuspendLayout(); this.soundViewTab.SuspendLayout();
this.cryptKeyTab.SuspendLayout(); this.cryptKeyTab.SuspendLayout();
@ -121,16 +121,16 @@
// //
// treeView1 // treeView1
// //
this.treeView1.Anchor = ((System.Windows.Forms.AnchorStyles) (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right)));
this.treeView1.BackColor = System.Drawing.Color.Black; this.treeView1.BackColor = System.Drawing.Color.Black;
this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.None; this.treeView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.treeView1.Dock = System.Windows.Forms.DockStyle.Right;
this.treeView1.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); this.treeView1.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204)));
this.treeView1.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0))))); this.treeView1.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0)))));
this.treeView1.Location = new System.Drawing.Point(649, 8); this.treeView1.Location = new System.Drawing.Point(646, 3);
this.treeView1.Margin = new System.Windows.Forms.Padding(0); this.treeView1.Margin = new System.Windows.Forms.Padding(0);
this.treeView1.MaximumSize = new System.Drawing.Size(500, 900); this.treeView1.MaximumSize = new System.Drawing.Size(500, 900);
this.treeView1.Name = "treeView1"; this.treeView1.Name = "treeView1";
this.treeView1.Size = new System.Drawing.Size(286, 460); this.treeView1.Size = new System.Drawing.Size(286, 473);
this.treeView1.TabIndex = 1; this.treeView1.TabIndex = 1;
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
this.treeView1.DoubleClick += new System.EventHandler(this.treeView1_AfterDblClick); this.treeView1.DoubleClick += new System.EventHandler(this.treeView1_AfterDblClick);
@ -138,20 +138,20 @@
// //
// listBox1 // listBox1
// //
this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.listBox1.BackColor = System.Drawing.Color.Black; this.listBox1.BackColor = System.Drawing.Color.Black;
this.listBox1.BorderStyle = System.Windows.Forms.BorderStyle.None; this.listBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listBox1.Dock = System.Windows.Forms.DockStyle.Right;
this.listBox1.Font = new System.Drawing.Font("Courier New", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); this.listBox1.Font = new System.Drawing.Font("Courier New", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204)));
this.listBox1.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0))))); this.listBox1.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0)))));
this.listBox1.FormattingEnabled = true; this.listBox1.FormattingEnabled = true;
this.listBox1.IntegralHeight = false; this.listBox1.IntegralHeight = false;
this.listBox1.ItemHeight = 17; this.listBox1.ItemHeight = 17;
this.listBox1.Location = new System.Drawing.Point(349, 8); this.listBox1.Location = new System.Drawing.Point(346, 3);
this.listBox1.Margin = new System.Windows.Forms.Padding(0); this.listBox1.Margin = new System.Windows.Forms.Padding(0);
this.listBox1.MaximumSize = new System.Drawing.Size(300, 50000); this.listBox1.MaximumSize = new System.Drawing.Size(300, 50000);
this.listBox1.MinimumSize = new System.Drawing.Size(180, 234); this.listBox1.MinimumSize = new System.Drawing.Size(180, 234);
this.listBox1.Name = "listBox1"; this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(300, 277); this.listBox1.Size = new System.Drawing.Size(300, 473);
this.listBox1.TabIndex = 5; this.listBox1.TabIndex = 5;
// //
// GameInfo // GameInfo
@ -295,22 +295,6 @@
this.loadingLabel.TabIndex = 16; this.loadingLabel.TabIndex = 16;
this.loadingLabel.Text = "Loading..."; this.loadingLabel.Text = "Loading...";
// //
// dumpSortedBtn
//
this.dumpSortedBtn.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.dumpSortedBtn.BackColor = System.Drawing.Color.FromArgb(((int) (((byte) (64)))), ((int) (((byte) (64)))), ((int) (((byte) (64)))));
this.dumpSortedBtn.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.dumpSortedBtn.Font = new System.Drawing.Font("Courier New", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204)));
this.dumpSortedBtn.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0)))));
this.dumpSortedBtn.Location = new System.Drawing.Point(8, 406);
this.dumpSortedBtn.Name = "dumpSortedBtn";
this.dumpSortedBtn.Size = new System.Drawing.Size(83, 42);
this.dumpSortedBtn.TabIndex = 19;
this.dumpSortedBtn.Text = "Dump Sorted";
this.dumpSortedBtn.UseVisualStyleBackColor = false;
this.dumpSortedBtn.Visible = false;
this.dumpSortedBtn.Click += new System.EventHandler(this.dumpSortedBtn_Click);
//
// ChunkCombo // ChunkCombo
// //
this.ChunkCombo.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {this.saveChunkBtn, this.viewHexBtn, this.previewFrameBtn}); this.ChunkCombo.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {this.saveChunkBtn, this.viewHexBtn, this.previewFrameBtn});
@ -380,22 +364,13 @@
this.musicLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.musicLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.musicLabel.Visible = false; this.musicLabel.Visible = false;
// //
// SortedProgressBar
//
this.SortedProgressBar.Location = new System.Drawing.Point(97, 407);
this.SortedProgressBar.Name = "SortedProgressBar";
this.SortedProgressBar.Size = new System.Drawing.Size(209, 41);
this.SortedProgressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.SortedProgressBar.TabIndex = 24;
this.SortedProgressBar.Visible = false;
//
// tabControl1 // tabControl1
// //
this.tabControl1.AllowDrop = true; this.tabControl1.AllowDrop = true;
this.tabControl1.Controls.Add(this.mainTab); this.tabControl1.Controls.Add(this.mainTab);
this.tabControl1.Controls.Add(this.mfaTab); this.tabControl1.Controls.Add(this.mfaTab);
this.tabControl1.Controls.Add(this.packDataTab); this.tabControl1.Controls.Add(this.packDataTab);
this.tabControl1.Controls.Add(this.imgViewerTab); this.tabControl1.Controls.Add(this.objViewerTab);
this.tabControl1.Controls.Add(this.soundViewTab); this.tabControl1.Controls.Add(this.soundViewTab);
this.tabControl1.Controls.Add(this.cryptKeyTab); this.tabControl1.Controls.Add(this.cryptKeyTab);
this.tabControl1.Controls.Add(this.pluginTab); this.tabControl1.Controls.Add(this.pluginTab);
@ -420,7 +395,6 @@
this.mainTab.Controls.Add(this.label1); this.mainTab.Controls.Add(this.label1);
this.mainTab.Controls.Add(this.loadingLabel); this.mainTab.Controls.Add(this.loadingLabel);
this.mainTab.Controls.Add(this.button1); this.mainTab.Controls.Add(this.button1);
this.mainTab.Controls.Add(this.SortedProgressBar);
this.mainTab.Controls.Add(this.imageBar); this.mainTab.Controls.Add(this.imageBar);
this.mainTab.Controls.Add(this.treeView1); this.mainTab.Controls.Add(this.treeView1);
this.mainTab.Controls.Add(this.musicLabel); this.mainTab.Controls.Add(this.musicLabel);
@ -431,7 +405,6 @@
this.mainTab.Controls.Add(this.musicsButton); this.mainTab.Controls.Add(this.musicsButton);
this.mainTab.Controls.Add(this.soundLabel); this.mainTab.Controls.Add(this.soundLabel);
this.mainTab.Controls.Add(this.FolderBTN); this.mainTab.Controls.Add(this.FolderBTN);
this.mainTab.Controls.Add(this.dumpSortedBtn);
this.mainTab.Controls.Add(this.soundsButton); this.mainTab.Controls.Add(this.soundsButton);
this.mainTab.Location = new System.Drawing.Point(4, 24); this.mainTab.Location = new System.Drawing.Point(4, 24);
this.mainTab.Name = "mainTab"; this.mainTab.Name = "mainTab";
@ -547,32 +520,32 @@
this.packDataListBox.TabIndex = 4; this.packDataListBox.TabIndex = 4;
this.packDataListBox.SelectedIndexChanged += new System.EventHandler(this.packDataListBox_SelectedIndexChanged); this.packDataListBox.SelectedIndexChanged += new System.EventHandler(this.packDataListBox_SelectedIndexChanged);
// //
// imgViewerTab // objViewerTab
// //
this.imgViewerTab.BackColor = System.Drawing.Color.Black; this.objViewerTab.BackColor = System.Drawing.Color.Black;
this.imgViewerTab.Controls.Add(this.imageViewerInfo); this.objViewerTab.Controls.Add(this.objViewerInfo);
this.imgViewerTab.Controls.Add(this.imageViewerPlayAnim); this.objViewerTab.Controls.Add(this.imageViewerPlayAnim);
this.imgViewerTab.Controls.Add(this.imageViewPictureBox); this.objViewerTab.Controls.Add(this.imageViewPictureBox);
this.imgViewerTab.Controls.Add(this.imagesTreeView); this.objViewerTab.Controls.Add(this.objTreeView);
this.imgViewerTab.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0))))); this.objViewerTab.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0)))));
this.imgViewerTab.Location = new System.Drawing.Point(4, 24); this.objViewerTab.Location = new System.Drawing.Point(4, 24);
this.imgViewerTab.Name = "imgViewerTab"; this.objViewerTab.Name = "objViewerTab";
this.imgViewerTab.Padding = new System.Windows.Forms.Padding(3); this.objViewerTab.Padding = new System.Windows.Forms.Padding(3);
this.imgViewerTab.Size = new System.Drawing.Size(935, 479); this.objViewerTab.Size = new System.Drawing.Size(935, 479);
this.imgViewerTab.TabIndex = 1; this.objViewerTab.TabIndex = 1;
this.imgViewerTab.Text = "Images"; this.objViewerTab.Text = "Objects";
// //
// imageViewerInfo // objViewerInfo
// //
this.imageViewerInfo.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.objViewerInfo.Anchor = ((System.Windows.Forms.AnchorStyles) ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.imageViewerInfo.BackColor = System.Drawing.Color.FromArgb(((int) (((byte) (64)))), ((int) (((byte) (64)))), ((int) (((byte) (64))))); this.objViewerInfo.BackColor = System.Drawing.Color.FromArgb(((int) (((byte) (64)))), ((int) (((byte) (64)))), ((int) (((byte) (64)))));
this.imageViewerInfo.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204))); this.objViewerInfo.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (204)));
this.imageViewerInfo.Location = new System.Drawing.Point(696, 3); this.objViewerInfo.Location = new System.Drawing.Point(623, 3);
this.imageViewerInfo.Name = "imageViewerInfo"; this.objViewerInfo.Name = "objViewerInfo";
this.imageViewerInfo.RightToLeft = System.Windows.Forms.RightToLeft.Yes; this.objViewerInfo.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
this.imageViewerInfo.Size = new System.Drawing.Size(236, 63); this.objViewerInfo.Size = new System.Drawing.Size(309, 63);
this.imageViewerInfo.TabIndex = 3; this.objViewerInfo.TabIndex = 3;
this.imageViewerInfo.Text = "DEBUG"; this.objViewerInfo.Text = "DEBUG";
// //
// imageViewerPlayAnim // imageViewerPlayAnim
// //
@ -596,15 +569,15 @@
this.imageViewPictureBox.TabIndex = 1; this.imageViewPictureBox.TabIndex = 1;
this.imageViewPictureBox.TabStop = false; this.imageViewPictureBox.TabStop = false;
// //
// imagesTreeView // objTreeView
// //
this.imagesTreeView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.objTreeView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.imagesTreeView.Dock = System.Windows.Forms.DockStyle.Left; this.objTreeView.Dock = System.Windows.Forms.DockStyle.Left;
this.imagesTreeView.Location = new System.Drawing.Point(3, 3); this.objTreeView.Location = new System.Drawing.Point(3, 3);
this.imagesTreeView.Name = "imagesTreeView"; this.objTreeView.Name = "objTreeView";
this.imagesTreeView.Size = new System.Drawing.Size(198, 473); this.objTreeView.Size = new System.Drawing.Size(198, 473);
this.imagesTreeView.TabIndex = 1; this.objTreeView.TabIndex = 1;
this.imagesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.advancedTreeView_AfterSelect); this.objTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.advancedTreeView_AfterSelect);
// //
// soundViewTab // soundViewTab
// //
@ -749,6 +722,8 @@
// settingsTab // settingsTab
// //
this.settingsTab.BackColor = System.Drawing.Color.Black; this.settingsTab.BackColor = System.Drawing.Color.Black;
this.settingsTab.Controls.Add(this.langComboBox);
this.settingsTab.Controls.Add(this.langLabel);
this.settingsTab.Controls.Add(this.colorLabel); this.settingsTab.Controls.Add(this.colorLabel);
this.settingsTab.Controls.Add(this.updateSettings); this.settingsTab.Controls.Add(this.updateSettings);
this.settingsTab.Controls.Add(this.colorBox); this.settingsTab.Controls.Add(this.colorBox);
@ -758,6 +733,25 @@
this.settingsTab.TabIndex = 7; this.settingsTab.TabIndex = 7;
this.settingsTab.Text = "Settings"; this.settingsTab.Text = "Settings";
// //
// langComboBox
//
this.langComboBox.FormattingEnabled = true;
this.langComboBox.Items.AddRange(new object[] {"en-US", "ru-RU"});
this.langComboBox.Location = new System.Drawing.Point(70, 31);
this.langComboBox.Name = "langComboBox";
this.langComboBox.Size = new System.Drawing.Size(109, 23);
this.langComboBox.TabIndex = 4;
this.langComboBox.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
//
// langLabel
//
this.langLabel.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0)))));
this.langLabel.Location = new System.Drawing.Point(8, 34);
this.langLabel.Name = "langLabel";
this.langLabel.Size = new System.Drawing.Size(56, 15);
this.langLabel.TabIndex = 3;
this.langLabel.Text = "Lang:";
//
// colorLabel // colorLabel
// //
this.colorLabel.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0))))); this.colorLabel.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (255)))), ((int) (((byte) (128)))), ((int) (((byte) (0)))));
@ -810,7 +804,7 @@
this.mfaTab.ResumeLayout(false); this.mfaTab.ResumeLayout(false);
this.mfaTab.PerformLayout(); this.mfaTab.PerformLayout();
this.packDataTab.ResumeLayout(false); this.packDataTab.ResumeLayout(false);
this.imgViewerTab.ResumeLayout(false); this.objViewerTab.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize) (this.imageViewPictureBox)).EndInit(); ((System.ComponentModel.ISupportInitialize) (this.imageViewPictureBox)).EndInit();
this.soundViewTab.ResumeLayout(false); this.soundViewTab.ResumeLayout(false);
this.cryptKeyTab.ResumeLayout(false); this.cryptKeyTab.ResumeLayout(false);
@ -822,6 +816,16 @@
this.ResumeLayout(false); this.ResumeLayout(false);
} }
private System.Windows.Forms.ComboBox langComboBox;
private System.Windows.Forms.Label langLabel;
private System.Windows.Forms.TreeView objTreeView;
private System.Windows.Forms.Label objViewerInfo;
private System.Windows.Forms.TabPage objViewerTab;
private System.Windows.Forms.TextBox colorBox; private System.Windows.Forms.TextBox colorBox;
private System.Windows.Forms.Label colorLabel; private System.Windows.Forms.Label colorLabel;
private System.Windows.Forms.Button updateSettings; private System.Windows.Forms.Button updateSettings;
@ -836,12 +840,8 @@
private System.Windows.Forms.TabPage soundViewTab; private System.Windows.Forms.TabPage soundViewTab;
private System.Windows.Forms.TreeView imagesTreeView;
private System.Windows.Forms.Button imageViewerPlayAnim; private System.Windows.Forms.Button imageViewerPlayAnim;
private System.Windows.Forms.PictureBox imageViewPictureBox; private System.Windows.Forms.PictureBox imageViewPictureBox;
private System.Windows.Forms.TabPage imgViewerTab;
private System.Windows.Forms.Label imageViewerInfo;
private System.Windows.Forms.Button activatePluginBtn; private System.Windows.Forms.Button activatePluginBtn;
private System.Windows.Forms.ListBox pluginsList; private System.Windows.Forms.ListBox pluginsList;
@ -875,11 +875,8 @@
private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.ProgressBar SortedProgressBar;
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
private System.Windows.Forms.ContextMenuStrip ChunkCombo; private System.Windows.Forms.ContextMenuStrip ChunkCombo;
private System.Windows.Forms.Button dumpSortedBtn;
private System.Windows.Forms.Button FolderBTN; private System.Windows.Forms.Button FolderBTN;
private System.Windows.Forms.Label GameInfo; private System.Windows.Forms.Label GameInfo;
private System.Windows.Forms.ProgressBar imageBar; private System.Windows.Forms.ProgressBar imageBar;

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Media; using System.Media;
@ -49,6 +50,8 @@ namespace CTFAK.GUI
{ {
//Buttons //Buttons
InitializeComponent(); InitializeComponent();
Thread.CurrentThread.CurrentUICulture=new CultureInfo(LoadableSettings.instance["lang"].ToString());
ColorTheme = color; ColorTheme = color;
foreach (Control item in Controls) foreach (Control item in Controls)
{ {
@ -93,7 +96,6 @@ namespace CTFAK.GUI
imagesButton.Text = Properties.GlobalStrings.dumpImages; imagesButton.Text = Properties.GlobalStrings.dumpImages;
soundsButton.Text = Properties.GlobalStrings.dumpSounds; soundsButton.Text = Properties.GlobalStrings.dumpSounds;
musicsButton.Text = Properties.GlobalStrings.dumpMusics; musicsButton.Text = Properties.GlobalStrings.dumpMusics;
dumpSortedBtn.Text = Properties.GlobalStrings.dumpSorted;
FolderBTN.Text=Properties.GlobalStrings.openFolder; FolderBTN.Text=Properties.GlobalStrings.openFolder;
@ -111,9 +113,9 @@ namespace CTFAK.GUI
if (dlg == DialogResult.Yes) Environment.Exit(0); if (dlg == DialogResult.Yes) Environment.Exit(0);
else e.Cancel = true; else e.Cancel = true;
}; };
imageViewerInfo.Parent = imageViewPictureBox; objViewerInfo.Parent = imageViewPictureBox;
imageViewerInfo.BackColor=Color.Transparent; objViewerInfo.BackColor=Color.Transparent;
imageViewerInfo.Dock = DockStyle.Right; objViewerInfo.Dock = DockStyle.Right;
@ -142,7 +144,12 @@ namespace CTFAK.GUI
var worker = new BackgroundWorker(); var worker = new BackgroundWorker();
worker.DoWork += (workSender, workE) => worker.DoWork += (workSender, workE) =>
{ {
if (File.Exists(openFileDialog1.FileName)) StartReading(); if (File.Exists(openFileDialog1.FileName))
{
objTreeView.Nodes.Clear();
StartReading();
}
else throw new NotImplementedException("File not found"); else throw new NotImplementedException("File not found");
}; };
worker.RunWorkerCompleted += (workSender, workE) => { AfterLoad(); }; worker.RunWorkerCompleted += (workSender, workE) => { AfterLoad(); };
@ -174,7 +181,8 @@ namespace CTFAK.GUI
private void StartReading() private void StartReading()
{ {
var path = openFileDialog1.FileName; var path = openFileDialog1.FileName;
//loadingLabel.Visible = true; Loaded = false;
loadingLabel.Visible = true;
Program.ReadFile(path, Settings.Verbose, Settings.DumpImages, Settings.DumpSounds); Program.ReadFile(path, Settings.Verbose, Settings.DumpImages, Settings.DumpSounds);
imageBar.Value = 0; imageBar.Value = 0;
@ -187,8 +195,6 @@ namespace CTFAK.GUI
imagesButton.Visible = false; imagesButton.Visible = false;
soundsButton.Visible = false; soundsButton.Visible = false;
musicsButton.Visible = false; musicsButton.Visible = false;
dumpSortedBtn.Visible = false;
Loaded = false;
} }
private void treeView1_AfterDblClick(object sender, EventArgs e) private void treeView1_AfterDblClick(object sender, EventArgs e)
@ -306,7 +312,6 @@ namespace CTFAK.GUI
imagesButton.Visible = true; imagesButton.Visible = true;
soundsButton.Visible = true; soundsButton.Visible = true;
musicsButton.Visible = true; musicsButton.Visible = true;
dumpSortedBtn.Visible = true;
GameInfo.Visible = true; GameInfo.Visible = true;
loadingLabel.Visible = false; loadingLabel.Visible = false;
@ -334,7 +339,6 @@ namespace CTFAK.GUI
Exe.Instance.GameData.GameChunks.GetChunk<SoundBank>().OnSoundSaved += UpdateSoundBar; Exe.Instance.GameData.GameChunks.GetChunk<SoundBank>().OnSoundSaved += UpdateSoundBar;
if (Exe.Instance.GameData.GameChunks.GetChunk<MusicBank>() != null) if (Exe.Instance.GameData.GameChunks.GetChunk<MusicBank>() != null)
Exe.Instance.GameData.GameChunks.GetChunk<MusicBank>().OnMusicSaved += UpdateMusicBar; Exe.Instance.GameData.GameChunks.GetChunk<MusicBank>().OnMusicSaved += UpdateMusicBar;
ImageDumper.SortedImageSaved += IncrementSortedBar;
GameInfo.Text = toLog; GameInfo.Text = toLog;
@ -363,13 +367,7 @@ namespace CTFAK.GUI
musicLabel.Text = $@"{index}/{all}"; musicLabel.Text = $@"{index}/{all}";
} }
private void IncrementSortedBar(int all)
{
SortedProgressBar.Visible = true;
SortedProgressBar.Maximum = all;
SortedProgressBar.Value += 1;
if (SortedProgressBar.Value >= SortedProgressBar.Maximum) SortedProgressBar.Visible = false;
}
private void FolderBTN_Click(object sender, EventArgs e) private void FolderBTN_Click(object sender, EventArgs e)
@ -611,7 +609,7 @@ namespace CTFAK.GUI
foreach (var frame in Exe.Instance.GameData.Frames) foreach (var frame in Exe.Instance.GameData.Frames)
{ {
var frameNode = new ChunkNode(frame.Name, frame); var frameNode = new ChunkNode(frame.Name, frame);
imagesTreeView.Nodes.Add(frameNode); objTreeView.Nodes.Add(frameNode);
if (frame.Objects != null) if (frame.Objects != null)
foreach (var objInst in frame.Objects.Items) foreach (var objInst in frame.Objects.Items)
{ {
@ -697,7 +695,7 @@ namespace CTFAK.GUI
private void advancedPlayAnimation_Click(object sender, EventArgs e) private void advancedPlayAnimation_Click(object sender, EventArgs e)
{ {
if (((ChunkNode) imagesTreeView.SelectedNode).loader is Animation anim) if (((ChunkNode) objTreeView.SelectedNode).loader is Animation anim)
{ {
if (_isAnimRunning) if (_isAnimRunning)
{ {
@ -717,7 +715,7 @@ namespace CTFAK.GUI
} }
} }
} }
else if (((ChunkNode) imagesTreeView.SelectedNode).loader is AnimationDirection dir) else if (((ChunkNode) objTreeView.SelectedNode).loader is AnimationDirection dir)
{ {
if (_isAnimRunning) if (_isAnimRunning)
{ {
@ -750,7 +748,7 @@ namespace CTFAK.GUI
foreach (var frame in frames) foreach (var frame in frames)
{ {
imageViewPictureBox.Image = frame; imageViewPictureBox.Image = frame;
imageViewerInfo.Text = $"Current frame: {frames.IndexOf(frame)}\nAnimation Speed: {fps}"; objViewerInfo.Text = $"Current frame: {frames.IndexOf(frame)}\nAnimation Speed: {fps}";
Thread.Sleep((int) (delay * 1500)); Thread.Sleep((int) (delay * 1500));
} }
@ -769,7 +767,7 @@ namespace CTFAK.GUI
{ {
var frame = frames[i]; var frame = frames[i];
imageViewPictureBox.Image = frame; imageViewPictureBox.Image = frame;
imageViewerInfo.Text = $"Current frame: {i.ToString()}\nAnimation Speed: {fps}"; objViewerInfo.Text = $"Current frame: {i.ToString()}\nAnimation Speed: {fps}";
Thread.Sleep((int) (delay * 1500)); Thread.Sleep((int) (delay * 1500));
i++; i++;
if (i == frames.Count) i = 0; if (i == frames.Count) i = 0;
@ -797,6 +795,31 @@ namespace CTFAK.GUI
text += $"Action Point: {img.ActionX}x{img.ActionY}\r\n"; text += $"Action Point: {img.ActionX}x{img.ActionY}\r\n";
text += $"Hotspot: {img.XHotspot}x{img.YHotspot}\r\n"; text += $"Hotspot: {img.XHotspot}x{img.YHotspot}\r\n";
imageViewPictureBox.Image = img.Bitmap; imageViewPictureBox.Image = img.Bitmap;
}
else if (loader is Animation anim)
{
text += $"Current frame: 0";
text+=$"\r\nAnimation Speed: {anim.DirectionDict.FirstOrDefault().Value.MaxSpeed}";
imageViewPictureBox.Image = Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>()
.FromHandle(anim.DirectionDict.FirstOrDefault().Value.Frames[0]).Bitmap;
}
else if (loader is Frame frame)
{
text += $"Name: {frame.Name}\r\n";
text += $"Size: {frame.Width}x{frame.Height}\r\n";
text += $"Objects: {frame.Objects.Items.Count}\r\n";
text += $"Layers: {frame.Layers.Items.Count}\r\n";
text += $"Flags:\r\n";
foreach (var part in frame.Flags.ToString().Split(';'))
{
text += part+"\r\n";
}
} }
else if (loader is ObjectInstance instance) else if (loader is ObjectInstance instance)
{ {
@ -810,6 +833,12 @@ namespace CTFAK.GUI
var common = ((ObjectCommon) instance.FrameItem.Properties.Loader); var common = ((ObjectCommon) instance.FrameItem.Properties.Loader);
switch (instance.FrameItem.ObjectType) switch (instance.FrameItem.ObjectType)
{ {
case 2:
text += $"Animations: {common.Animations?.AnimationDict.Count}";
imageViewPictureBox.Image = Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>()
.FromHandle(common.Animations.AnimationDict.FirstOrDefault().Value.DirectionDict
.FirstOrDefault().Value.Frames.FirstOrDefault()).Bitmap;
break;
case 3: case 3:
ObjectViewerLabel = new Label(); ObjectViewerLabel = new Label();
var content = string.Empty; var content = string.Empty;
@ -825,18 +854,35 @@ namespace CTFAK.GUI
imageViewPictureBox.Controls.Add(ObjectViewerLabel); imageViewPictureBox.Controls.Add(ObjectViewerLabel);
break; break;
case 7:
var handle = common.Counters?.Frames.FirstOrDefault();
if (handle == null) imageViewPictureBox.Image = imageViewPictureBox.ErrorImage;
else
{
imageViewPictureBox.Image = Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>()
.FromHandle((int) handle).Bitmap;
}
//text += $"Add 0's to the left: {common?.Counters?.AddNulls}";
//text += $"Fixed number of digits: {(common.Counters.UseDecimals ? common?.Counters?.FloatDigits : common?.Counters?.IntegerDigits)}";
break;
default: default:
text += "No additional info"; text += "No additional info";
break; break;
} }
} }
else
{
if (instance.FrameItem.ObjectType == 1)
imageViewPictureBox.Image = Exe.Instance.GameData.GameChunks.GetChunk<ImageBank>().FromHandle(((Backdrop)instance.FrameItem.Properties.Loader).Image).Bitmap;
}
} }
imageViewerInfo.Text = text; objViewerInfo.Text = text;
} }
@ -875,12 +921,12 @@ namespace CTFAK.GUI
protected override void OnKeyDown(KeyEventArgs e) protected override void OnKeyDown(KeyEventArgs e)
{ {
if (tabControl1.SelectedTab == imgViewerTab) if (tabControl1.SelectedTab == objViewerTab)
if (e.Control) if (e.Control)
{ {
var node = (ChunkNode) imagesTreeView.SelectedNode; var node = (ChunkNode) objTreeView.SelectedNode;
var path = var path =
$"{Settings.ImagePath}\\{Helper.GetTreePath(imagesTreeView, (ChunkNode) imagesTreeView.SelectedNode)}"; $"{Settings.ImagePath}\\{Helper.GetTreePath(objTreeView, (ChunkNode) objTreeView.SelectedNode)}";
if (node == null) return; if (node == null) return;
ImageDumper.SaveFromNode(node); ImageDumper.SaveFromNode(node);
} }
@ -901,5 +947,10 @@ namespace CTFAK.GUI
{ {
LoadableSettings.instance["mainColor"] = colorBox.Text; LoadableSettings.instance["mainColor"] = colorBox.Text;
} }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
LoadableSettings.instance["lang"] = langComboBox.SelectedItem;
}
} }
} }

@ -127,7 +127,7 @@
<value>270, 17</value> <value>270, 17</value>
</metadata> </metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>73</value> <value>74</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

@ -169,6 +169,9 @@ namespace CTFAK.MMFParser.EXE
case 8741: case 8741:
loader = new AppAuthor(chunk); loader = new AppAuthor(chunk);
break; break;
case 8742:
loader = new AppMenu(chunk);
break;
case 8743: case 8743:
loader = new ExtPath(chunk); loader = new ExtPath(chunk);
break; break;
@ -327,6 +330,7 @@ namespace CTFAK.MMFParser.EXE
case 8770: return Properties.Locale.ChunkNames.protection;//"Protection"; case 8770: return Properties.Locale.ChunkNames.protection;//"Protection";
case 8771: return Properties.Locale.ChunkNames.shaders;//"Shaders"; case 8771: return Properties.Locale.ChunkNames.shaders;//"Shaders";
case 8773: return Properties.Locale.ChunkNames.extHeader;//"Extended Header"; case 8773: return Properties.Locale.ChunkNames.extHeader;//"Extended Header";
case 8774: return "Spacer";//"Spacer";
case 13107:return Properties.Locale.ChunkNames.frame;//"Frame"; case 13107:return Properties.Locale.ChunkNames.frame;//"Frame";
case 13108:return Properties.Locale.ChunkNames.frameHeader;//"Frame Header"; case 13108:return Properties.Locale.ChunkNames.frameHeader;//"Frame Header";
case 13109:return Properties.Locale.ChunkNames.frameName;//"Frame Name"; case 13109:return Properties.Locale.ChunkNames.frameName;//"Frame Name";

@ -62,8 +62,7 @@ namespace CTFAK.MMFParser.EXE
exeReader.Seek(possition); exeReader.Seek(possition);
var firstShort = exeReader.PeekUInt16(); var firstShort = exeReader.PeekUInt16();
Logger.Log("First Short: " + firstShort.ToString("X2"), true, ConsoleColor.Yellow); Logger.Log("First Short: " + firstShort.ToString("X2"), true, ConsoleColor.Yellow);
if (firstShort == 0x7777) Settings.Old = false; if (firstShort != 0x7777) Settings.Old = true;
else Settings.Old = true;
if (!Settings.Old) if (!Settings.Old)
{ {
PackData = new PackData(); PackData = new PackData();
@ -75,6 +74,7 @@ namespace CTFAK.MMFParser.EXE
} }
else else
{ {
Logger.Log("Game is too old");
var oldData = new ChunkList(); var oldData = new ChunkList();
oldData.Read(exeReader); oldData.Read(exeReader);
GameData = new GameData(); GameData = new GameData();

@ -27,7 +27,13 @@ namespace CTFAK.MMFParser.EXE.Loaders
public override string[] GetReadableData() public override string[] GetReadableData()
{ {
throw new NotImplementedException(); List<string> list = new List<string>();
foreach (AppMenuItem item in Items)
{
list.Add(item.Name);
}
return list.ToArray();
} }
public override void Read() public override void Read()

@ -50,6 +50,7 @@ namespace CTFAK.MMFParser.EXE.Loaders.Banks
public ImageItem FromHandle(int handle) public ImageItem FromHandle(int handle)
{ {
Images.TryGetValue(handle, out var img); Images.TryGetValue(handle, out var img);
if (handle == -1) return Images[Images.Count-1];
if (img == null) return null; if (img == null) return null;
else return img; else return img;
} }
@ -57,6 +58,7 @@ namespace CTFAK.MMFParser.EXE.Loaders.Banks
public void LoadByHandle(int handle) public void LoadByHandle(int handle)
{ {
Images[handle].Load(); Images[handle].Load();
} }

@ -49,6 +49,16 @@ namespace CTFAK.MMFParser.EXE.Loaders.Objects
int _floatDecimalsShift = 12; int _floatDecimalsShift = 12;
int _floatPad = 0x0800; int _floatPad = 0x0800;
public List<int> Frames; public List<int> Frames;
public uint Width;
public uint Height;
public int IntegerDigits;
public bool FormatFloat;
public int FloatDigits;
public bool UseDecimals;
public int Decimals;
public ushort Font;
public bool Inverse;
public bool AddNulls;
public Counters(ByteReader reader) : base(reader) public Counters(ByteReader reader) : base(reader)
{ {
@ -62,21 +72,21 @@ namespace CTFAK.MMFParser.EXE.Loaders.Objects
{ {
var size = Reader.ReadUInt32(); var size = Reader.ReadUInt32();
var width = Reader.ReadUInt32(); Width = Reader.ReadUInt32();
var height = Reader.ReadUInt32(); Height = Reader.ReadUInt32();
var player = Reader.ReadUInt16(); var player = Reader.ReadUInt16();
var displayType = Reader.ReadUInt16(); var displayType = Reader.ReadUInt16();
var flags = Reader.ReadUInt16(); var flags = Reader.ReadUInt16();
var integerDigits = flags & _intDigitsMask; IntegerDigits = flags & _intDigitsMask;
var formatFloat = (flags & _formatFloat) != 0; FormatFloat = (flags & _formatFloat) != 0;
var floatDigits = (flags & _floatDigitsMask) >> _floatDigitsShift + 1; FloatDigits = (flags & _floatDigitsMask) >> _floatDigitsShift + 1;
var useDecimals = (flags & _useDecimals) != 0; UseDecimals = (flags & _useDecimals) != 0;
var decimals = (flags & _floatDecimalsMask) >> _floatDecimalsShift; Decimals = (flags & _floatDecimalsMask) >> _floatDecimalsShift;
var addNulls = (flags & _floatPad) != 0; AddNulls = (flags & _floatPad) != 0;
var inverse = ByteFlag.GetFlag(flags, 8); Inverse = ByteFlag.GetFlag(flags, 8);
var font = Reader.ReadUInt16(); Font = Reader.ReadUInt16();
if (displayType == 0) return; if (displayType == 0) return;
else if (displayType == 1 || displayType == 4|| displayType==50) else if (displayType == 1 || displayType == 4|| displayType==50)
{ {

@ -24,6 +24,7 @@ namespace CTFAK
private static void Main(string[] args) private static void Main(string[] args)
{ {
InitNativeLibrary(); InitNativeLibrary();
if (!File.Exists("settings.sav")) if (!File.Exists("settings.sav"))
{ {
File.Create("settings.sav"); File.Create("settings.sav");
@ -33,14 +34,14 @@ namespace CTFAK
// MFAGenerator.ReadTestMFA(); // MFAGenerator.ReadTestMFA();
// Environment.Exit(0); // Environment.Exit(0);
AppDomain.CurrentDomain.FirstChanceException += (sender, eventArgs) => /*AppDomain.CurrentDomain.FirstChanceException += (sender, eventArgs) =>
{ {
if (eventArgs.Exception is ThreadAbortException) return; if (eventArgs.Exception is ThreadAbortException) return;
var ex = (Exception) eventArgs.Exception; var ex = (Exception) eventArgs.Exception;
Logger.Log("ERROR: "); Logger.Log("ERROR: ");
Logger.Log(ex.ToString()); Logger.Log(ex.ToString());
}; };*/
Settings.UseGUI = true; Settings.UseGUI = true;

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading;
namespace CTFAK namespace CTFAK
{ {
@ -37,7 +38,7 @@ namespace CTFAK
public static string DumperVersion = true ? "CTFAK 0.3 Alpha" : "CTFAK 0.2.1-a Debug"; public static string DumperVersion = true ? "CTFAK 0.3.5 Alpha" : "CTFAK 0.2.1-a Debug";
} }
public class LoadableSettings public class LoadableSettings
@ -49,17 +50,19 @@ namespace CTFAK
public static LoadableSettings FromFile(string path) public static LoadableSettings FromFile(string path)
{ {
if (!File.Exists(path)) File.Create(path); if (!File.Exists(path)) File.Create(path);
Thread.Sleep(1500);
var settings = new LoadableSettings(); var settings = new LoadableSettings();
settings.path = path; settings.path = path;
var rawData = File.ReadAllLines(path); var rawData = File.ReadAllLines(path);
if (rawData.Length > 0)
{
foreach (string rawLine in rawData) foreach (string rawLine in rawData)
{ {
var split = rawLine.Split('='); var split = rawLine.Split('=');
settings._data.Add(split[0],split[1]); settings._data.Add(split[0],split[1]);
} }
}
instance = settings; instance = settings;
return settings; return settings;

@ -34,7 +34,10 @@ namespace CTFAK.Utils
SaveAnimation(anim,bank,fullPath); SaveAnimation(anim,bank,fullPath);
} }
else if(node.loader is ObjectInstance) Console.WriteLine("Dumping Common"); else if (node.loader is ObjectInstance instance)
{
SaveInstance(instance,bank,fullPath);
}
else if(node.loader is Backdrop) Console.WriteLine("Dumping Backdrop"); else if(node.loader is Backdrop) Console.WriteLine("Dumping Backdrop");
else if(node.loader is Frame) Console.WriteLine("Dumping Frame"); else if(node.loader is Frame) Console.WriteLine("Dumping Frame");
@ -55,7 +58,32 @@ namespace CTFAK.Utils
bank.Images[frame].Save($"{fullPath}\\{i}.png"); bank.Images[frame].Save($"{fullPath}\\{i}.png");
} }
} }
public static void SaveInstance(ObjectInstance inst, ImageBank bank,string fullPath)
{
if (inst.FrameItem.Properties.IsCommon)
{
var common = ((ObjectCommon)inst.FrameItem.Properties.Loader);
switch (common.Parent.ObjectType)
{
case 2:
foreach (var pair in common.Animations.AnimationDict.ToArray())
{
SaveAnimation(pair.Value,bank,fullPath+"\\Animation "+pair.Key);
}
break;
case 7:
foreach (int frame in common.Counters.Frames)
{
var img = bank.FromHandle(frame);
img.Save(fullPath+$"\\{frame}.png");
}
break;
}
}
}
public static void SaveAnimation(Animation anim, ImageBank bank, string fullPath) public static void SaveAnimation(Animation anim, ImageBank bank, string fullPath)
{ {
if (anim.DirectionDict.ToArray().Length > 1) if (anim.DirectionDict.ToArray().Length > 1)
@ -65,6 +93,7 @@ namespace CTFAK.Utils
Directory.CreateDirectory($"{fullPath}\\Direction {anim.DirectionDict.ToList().IndexOf(dirpair)}"); Directory.CreateDirectory($"{fullPath}\\Direction {anim.DirectionDict.ToList().IndexOf(dirpair)}");
for (int i = 0; i < anim.DirectionDict[0].Frames.Count; i++) for (int i = 0; i < anim.DirectionDict[0].Frames.Count; i++)
{ {
var frame = dirpair.Value.Frames[i]; var frame = dirpair.Value.Frames[i];
bank.Images[frame].Save($"{fullPath}\\Direction {anim.DirectionDict.ToList().IndexOf(dirpair)}\\{i}.png"); bank.Images[frame].Save($"{fullPath}\\Direction {anim.DirectionDict.ToList().IndexOf(dirpair)}\\{i}.png");
} }
@ -74,6 +103,7 @@ namespace CTFAK.Utils
{ {
for (int i = 0; i < anim.DirectionDict[0].Frames.Count; i++) for (int i = 0; i < anim.DirectionDict[0].Frames.Count; i++)
{ {
Directory.CreateDirectory(fullPath);
var frame = anim.DirectionDict[0].Frames[i]; var frame = anim.DirectionDict[0].Frames[i];
bank.Images[frame].Save($"{fullPath}\\{i}.png"); bank.Images[frame].Save($"{fullPath}\\{i}.png");
} }

Loading…
Cancel
Save