More fixes
Fixed samplers for switch not mapping properly. Fixed DDS files exporting mip maps wrong. Would cause them to not import back with size errors. Fixed bntx alignment causing corrupted textures. Fixed bfres not opening from null bone indices/unrigged meshes.
This commit is contained in:
parent
356c2eb93f
commit
ddcd0285b3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -708,6 +708,8 @@ namespace FirstPlugin
|
||||
if (resFile.ExternalFiles.Count > 0)
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
//This also can be set to true if we don't want to rebuild the bntx for debug purposes
|
||||
bool IsTexturesReplaced = false;
|
||||
|
||||
foreach (var anim in resFile.ExternalFiles)
|
||||
|
@ -70,7 +70,7 @@ namespace Bfres.Structs
|
||||
ContextMenuStrip.Items.Add(new STToolStipMenuItem("New", null, NewAction, Keys.Control | Keys.N));
|
||||
ContextMenuStrip.Items.Add(new STToolStipMenuItem("Import", null, ImportAction, Keys.Control | Keys.I));
|
||||
ContextMenuStrip.Items.Add(new ToolStripMenuItem("Export All", null, ExportAllAction, Keys.Control | Keys.E));
|
||||
ContextMenuStrip.Items.Add(new ToolStripMenuItem("Replace All", null, ReplaceAllAction, Keys.Control | Keys.R));
|
||||
ContextMenuStrip.Items.Add(new ToolStripMenuItem("Replace (From Folder)", null, ReplaceAllAction, Keys.Control | Keys.R));
|
||||
ContextMenuStrip.Items.Add(new STToolStripSeparator());
|
||||
ContextMenuStrip.Items.Add(new STToolStipMenuItem("Sort", null, SortAction, Keys.Control | Keys.S));
|
||||
ContextMenuStrip.Items.Add(new STToolStipMenuItem("Clear", null, ClearAction, Keys.Control | Keys.C));
|
||||
|
@ -199,6 +199,9 @@ namespace FirstPlugin
|
||||
fshp.TargetAttribCount = shp.TargetAttribCount;
|
||||
fshp.MaterialIndex = shp.MaterialIndex;
|
||||
|
||||
if (shp.SkinBoneIndices == null)
|
||||
shp.SkinBoneIndices = new List<ushort>();
|
||||
|
||||
fshp.BoneIndices = shp.SkinBoneIndices.ToList();
|
||||
|
||||
ReadMeshes(fshp, shp);
|
||||
@ -694,14 +697,18 @@ namespace FirstPlugin
|
||||
texture.wrapModeW = (int)mat.Samplers[id].WrapModeW;
|
||||
texture.SamplerName = mat.SamplerDict.GetKey(id);
|
||||
|
||||
Console.WriteLine("Filter " + mat.Samplers[id].FilterMode);
|
||||
string useSampler = texture.SamplerName;
|
||||
|
||||
//Use the fragment sampler in the shader assign section. It's usually more accurate this way
|
||||
if (m.shaderassign.samplers.ContainsKey(texture.SamplerName))
|
||||
useSampler = m.shaderassign.samplers[texture.SamplerName];
|
||||
|
||||
bool IsAlbedo = Misc.HackyTextureList.Any(TextureName.Contains);
|
||||
|
||||
|
||||
if (Runtime.activeGame == Runtime.ActiveGame.MK8D)
|
||||
{
|
||||
if (texture.SamplerName == "_a0")
|
||||
if (useSampler == "_a0")
|
||||
{
|
||||
if (AlbedoCount == 0)
|
||||
{
|
||||
@ -710,32 +717,32 @@ namespace FirstPlugin
|
||||
texture.Type = MatTexture.TextureType.Diffuse;
|
||||
}
|
||||
}
|
||||
if (texture.SamplerName == "_n0")
|
||||
if (useSampler == "_n0")
|
||||
{
|
||||
m.HasNormalMap = true;
|
||||
texture.Type = MatTexture.TextureType.Normal;
|
||||
}
|
||||
if (texture.SamplerName == "_e0")
|
||||
if (useSampler == "_e0")
|
||||
{
|
||||
m.HasEmissionMap = true;
|
||||
texture.Type = MatTexture.TextureType.Emission;
|
||||
}
|
||||
if (texture.SamplerName == "_s0")
|
||||
if (useSampler == "_s0")
|
||||
{
|
||||
m.HasSpecularMap = true;
|
||||
texture.Type = MatTexture.TextureType.Specular;
|
||||
}
|
||||
if (texture.SamplerName == "_x0")
|
||||
if (useSampler == "_x0")
|
||||
{
|
||||
m.HasSphereMap = true;
|
||||
texture.Type = MatTexture.TextureType.SphereMap;
|
||||
}
|
||||
if (texture.SamplerName == "_b0")
|
||||
if (useSampler == "_b0")
|
||||
{
|
||||
m.HasShadowMap = true;
|
||||
texture.Type = MatTexture.TextureType.Shadow;
|
||||
}
|
||||
if (texture.SamplerName == "_b1")
|
||||
if (useSampler == "_b1")
|
||||
{
|
||||
m.HasLightMap = true;
|
||||
texture.Type = MatTexture.TextureType.Light;
|
||||
@ -743,7 +750,7 @@ namespace FirstPlugin
|
||||
}
|
||||
else if (Runtime.activeGame == Runtime.ActiveGame.SMO)
|
||||
{
|
||||
if (texture.SamplerName == "_a0")
|
||||
if (useSampler == "_a0")
|
||||
{
|
||||
if (AlbedoCount == 0)
|
||||
{
|
||||
@ -752,12 +759,12 @@ namespace FirstPlugin
|
||||
texture.Type = MatTexture.TextureType.Diffuse;
|
||||
}
|
||||
}
|
||||
if (texture.SamplerName == "_n0")
|
||||
if (useSampler == "_n0")
|
||||
{
|
||||
m.HasNormalMap = true;
|
||||
texture.Type = MatTexture.TextureType.Normal;
|
||||
}
|
||||
if (texture.SamplerName == "_e0")
|
||||
if (useSampler == "_e0")
|
||||
{
|
||||
m.HasEmissionMap = true;
|
||||
texture.Type = MatTexture.TextureType.Emission;
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -912,7 +912,7 @@ namespace Switch_Toolbox.Library
|
||||
{
|
||||
foreach (var surface in data)
|
||||
{
|
||||
writer.Write(surface.mipmaps[0]);
|
||||
writer.Write(Utils.CombineByteArray(surface.mipmaps.ToArray()));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -57,14 +57,14 @@ namespace FlatTabControl
|
||||
leftRightImages = new ImageList();
|
||||
//leftRightImages.ImageSize = new Size(16, 16); // default
|
||||
|
||||
/* System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FlatTabControl));
|
||||
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FlatTabControl));
|
||||
Bitmap updownImage = ((System.Drawing.Bitmap)(resources.GetObject("TabIcons.bmp")));
|
||||
|
||||
if (updownImage != null)
|
||||
{
|
||||
updownImage.MakeTransparent(Color.White);
|
||||
leftRightImages.Images.AddStrip(updownImage);
|
||||
}*/
|
||||
leftRightImages.Images.AddStrip(updownImage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -123,7 +123,7 @@ namespace Switch_Toolbox.Library
|
||||
return x + 1;
|
||||
}
|
||||
|
||||
public static byte[] _swizzle(uint width, uint height, uint depth, uint blkWidth, uint blkHeight, uint blkDepth, int roundPitch, uint bpp, uint tileMode, int blockHeightLog2, byte[] data, int toSwizzle)
|
||||
private static byte[] _swizzle(uint width, uint height, uint depth, uint blkWidth, uint blkHeight, uint blkDepth, int roundPitch, uint bpp, uint tileMode, int blockHeightLog2, byte[] data, int toSwizzle)
|
||||
{
|
||||
uint block_height = (uint)(1 << blockHeightLog2);
|
||||
|
||||
@ -154,7 +154,7 @@ namespace Switch_Toolbox.Library
|
||||
|
||||
for (uint y = 0; y < height; y++)
|
||||
{
|
||||
for (uint x = 0; x < width; x++)
|
||||
for (uint x = 0; x < width; x++)
|
||||
{
|
||||
uint pos;
|
||||
uint pos_;
|
||||
|
Binary file not shown.
Binary file not shown.
100
Toolbox/MainForm.Designer.cs
generated
100
Toolbox/MainForm.Designer.cs
generated
@ -52,6 +52,8 @@
|
||||
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.mainSettingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.fileAssociationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.creditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.stPanel1 = new Switch_Toolbox.Library.Forms.STPanel();
|
||||
this.tabForms = new Switch_Toolbox.Library.Forms.STTabControl();
|
||||
this.tabControlContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
@ -59,13 +61,17 @@
|
||||
this.stPanel2 = new Switch_Toolbox.Library.Forms.STPanel();
|
||||
this.stToolStrip1 = new Switch_Toolbox.Library.Forms.STToolStrip();
|
||||
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
|
||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.creditsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.BtnMdiMinimize = new System.Windows.Forms.PictureBox();
|
||||
this.BtnMdiMinMax = new System.Windows.Forms.PictureBox();
|
||||
this.BtnMdiClose = new System.Windows.Forms.PictureBox();
|
||||
this.menuStrip1.SuspendLayout();
|
||||
this.stPanel1.SuspendLayout();
|
||||
this.tabControlContextMenuStrip.SuspendLayout();
|
||||
this.stPanel2.SuspendLayout();
|
||||
this.stToolStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BtnMdiMinimize)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BtnMdiMinMax)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BtnMdiClose)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// menuStrip1
|
||||
@ -190,35 +196,35 @@
|
||||
// cascadeToolStripMenuItem
|
||||
//
|
||||
this.cascadeToolStripMenuItem.Name = "cascadeToolStripMenuItem";
|
||||
this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
|
||||
this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.cascadeToolStripMenuItem.Text = "Cascade";
|
||||
this.cascadeToolStripMenuItem.Click += new System.EventHandler(this.cascadeToolStripMenuItem_Click);
|
||||
//
|
||||
// minimizeToolStripMenuItem
|
||||
//
|
||||
this.minimizeToolStripMenuItem.Name = "minimizeToolStripMenuItem";
|
||||
this.minimizeToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
|
||||
this.minimizeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.minimizeToolStripMenuItem.Text = "Minimize";
|
||||
this.minimizeToolStripMenuItem.Click += new System.EventHandler(this.minimizeToolStripMenuItem_Click);
|
||||
//
|
||||
// maximizeToolStripMenuItem
|
||||
//
|
||||
this.maximizeToolStripMenuItem.Name = "maximizeToolStripMenuItem";
|
||||
this.maximizeToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
|
||||
this.maximizeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.maximizeToolStripMenuItem.Text = "Maximize";
|
||||
this.maximizeToolStripMenuItem.Click += new System.EventHandler(this.maximizeToolStripMenuItem_Click);
|
||||
//
|
||||
// closeToolStripMenuItem
|
||||
//
|
||||
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
|
||||
this.closeToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
|
||||
this.closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.closeToolStripMenuItem.Text = "Close";
|
||||
this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
|
||||
//
|
||||
// closeAllToolStripMenuItem
|
||||
//
|
||||
this.closeAllToolStripMenuItem.Name = "closeAllToolStripMenuItem";
|
||||
this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
|
||||
this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.closeAllToolStripMenuItem.Text = "Close All";
|
||||
this.closeAllToolStripMenuItem.Click += new System.EventHandler(this.closeAllToolStripMenuItem_Click);
|
||||
//
|
||||
@ -235,7 +241,7 @@
|
||||
// mainSettingsToolStripMenuItem
|
||||
//
|
||||
this.mainSettingsToolStripMenuItem.Name = "mainSettingsToolStripMenuItem";
|
||||
this.mainSettingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.mainSettingsToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
|
||||
this.mainSettingsToolStripMenuItem.Text = "Main Settings";
|
||||
this.mainSettingsToolStripMenuItem.Click += new System.EventHandler(this.mainSettingsToolStripMenuItem_Click);
|
||||
//
|
||||
@ -243,10 +249,25 @@
|
||||
//
|
||||
this.fileAssociationsToolStripMenuItem.Enabled = false;
|
||||
this.fileAssociationsToolStripMenuItem.Name = "fileAssociationsToolStripMenuItem";
|
||||
this.fileAssociationsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.fileAssociationsToolStripMenuItem.Size = new System.Drawing.Size(161, 22);
|
||||
this.fileAssociationsToolStripMenuItem.Text = "File Associations";
|
||||
this.fileAssociationsToolStripMenuItem.Click += new System.EventHandler(this.fileAssociationsToolStripMenuItem_Click);
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
//
|
||||
this.aboutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.creditsToolStripMenuItem});
|
||||
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 21);
|
||||
this.aboutToolStripMenuItem.Text = "About";
|
||||
//
|
||||
// creditsToolStripMenuItem
|
||||
//
|
||||
this.creditsToolStripMenuItem.Name = "creditsToolStripMenuItem";
|
||||
this.creditsToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
|
||||
this.creditsToolStripMenuItem.Text = "Credits";
|
||||
this.creditsToolStripMenuItem.Click += new System.EventHandler(this.creditsToolStripMenuItem_Click);
|
||||
//
|
||||
// stPanel1
|
||||
//
|
||||
this.stPanel1.Controls.Add(this.menuStrip1);
|
||||
@ -284,6 +305,9 @@
|
||||
//
|
||||
// stPanel2
|
||||
//
|
||||
this.stPanel2.Controls.Add(this.BtnMdiMinimize);
|
||||
this.stPanel2.Controls.Add(this.BtnMdiMinMax);
|
||||
this.stPanel2.Controls.Add(this.BtnMdiClose);
|
||||
this.stPanel2.Controls.Add(this.stToolStrip1);
|
||||
this.stPanel2.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.stPanel2.Location = new System.Drawing.Point(0, 25);
|
||||
@ -313,20 +337,50 @@
|
||||
this.toolStripButton1.Text = "toolStripButton1";
|
||||
this.toolStripButton1.ToolTipText = "Save File";
|
||||
//
|
||||
// aboutToolStripMenuItem
|
||||
// BtnMdiMinimize
|
||||
//
|
||||
this.aboutToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.creditsToolStripMenuItem});
|
||||
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
|
||||
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 21);
|
||||
this.aboutToolStripMenuItem.Text = "About";
|
||||
this.BtnMdiMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.BtnMdiMinimize.BackColor = System.Drawing.Color.Transparent;
|
||||
this.BtnMdiMinimize.Image = ((System.Drawing.Image)(resources.GetObject("BtnMdiMinimize.Image")));
|
||||
this.BtnMdiMinimize.Location = new System.Drawing.Point(991, 2);
|
||||
this.BtnMdiMinimize.Name = "BtnMdiMinimize";
|
||||
this.BtnMdiMinimize.Size = new System.Drawing.Size(38, 25);
|
||||
this.BtnMdiMinimize.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
||||
this.BtnMdiMinimize.TabIndex = 6;
|
||||
this.BtnMdiMinimize.TabStop = false;
|
||||
this.BtnMdiMinimize.Click += new System.EventHandler(this.BtnMdiMinimize_Click);
|
||||
this.BtnMdiMinimize.MouseEnter += new System.EventHandler(this.BtnMdiMinimize_MouseEnter);
|
||||
this.BtnMdiMinimize.MouseLeave += new System.EventHandler(this.BtnMdiMinimize_MouseLeave);
|
||||
//
|
||||
// creditsToolStripMenuItem
|
||||
// BtnMdiMinMax
|
||||
//
|
||||
this.creditsToolStripMenuItem.Name = "creditsToolStripMenuItem";
|
||||
this.creditsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.creditsToolStripMenuItem.Text = "Credits";
|
||||
this.creditsToolStripMenuItem.Click += new System.EventHandler(this.creditsToolStripMenuItem_Click);
|
||||
this.BtnMdiMinMax.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.BtnMdiMinMax.BackColor = System.Drawing.Color.Transparent;
|
||||
this.BtnMdiMinMax.Image = ((System.Drawing.Image)(resources.GetObject("BtnMdiMinMax.Image")));
|
||||
this.BtnMdiMinMax.Location = new System.Drawing.Point(1029, 2);
|
||||
this.BtnMdiMinMax.Name = "BtnMdiMinMax";
|
||||
this.BtnMdiMinMax.Size = new System.Drawing.Size(38, 25);
|
||||
this.BtnMdiMinMax.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
||||
this.BtnMdiMinMax.TabIndex = 5;
|
||||
this.BtnMdiMinMax.TabStop = false;
|
||||
this.BtnMdiMinMax.Click += new System.EventHandler(this.BtnMdiMinMax_Click);
|
||||
this.BtnMdiMinMax.MouseEnter += new System.EventHandler(this.BtnMdiMinMax_MouseEnter);
|
||||
this.BtnMdiMinMax.MouseLeave += new System.EventHandler(this.BtnMdiMinMax_MouseLeave);
|
||||
//
|
||||
// BtnMdiClose
|
||||
//
|
||||
this.BtnMdiClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.BtnMdiClose.BackColor = System.Drawing.Color.Transparent;
|
||||
this.BtnMdiClose.Image = ((System.Drawing.Image)(resources.GetObject("BtnMdiClose.Image")));
|
||||
this.BtnMdiClose.Location = new System.Drawing.Point(1067, 2);
|
||||
this.BtnMdiClose.Name = "BtnMdiClose";
|
||||
this.BtnMdiClose.Size = new System.Drawing.Size(38, 25);
|
||||
this.BtnMdiClose.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
|
||||
this.BtnMdiClose.TabIndex = 4;
|
||||
this.BtnMdiClose.TabStop = false;
|
||||
this.BtnMdiClose.Click += new System.EventHandler(this.BtnMdiClose_Click);
|
||||
this.BtnMdiClose.MouseEnter += new System.EventHandler(this.BtnMdiClose_MouseEnter);
|
||||
this.BtnMdiClose.MouseLeave += new System.EventHandler(this.BtnMdiClose_MouseLeave);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
@ -357,6 +411,9 @@
|
||||
this.stPanel2.PerformLayout();
|
||||
this.stToolStrip1.ResumeLayout(false);
|
||||
this.stToolStrip1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BtnMdiMinimize)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BtnMdiMinMax)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BtnMdiClose)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@ -394,6 +451,9 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem newFromFileToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem creditsToolStripMenuItem;
|
||||
private System.Windows.Forms.PictureBox BtnMdiMinimize;
|
||||
private System.Windows.Forms.PictureBox BtnMdiMinMax;
|
||||
private System.Windows.Forms.PictureBox BtnMdiClose;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,10 @@ namespace Toolbox
|
||||
|
||||
//Redo setting this since designer keeps resetting this
|
||||
tabForms.myBackColor = FormThemes.BaseTheme.FormBackColor;
|
||||
|
||||
BtnMdiClose.Visible = false;
|
||||
BtnMdiMinMax.Visible = false;
|
||||
BtnMdiMinimize.Visible = false;
|
||||
}
|
||||
|
||||
public void Reload()
|
||||
@ -823,6 +827,8 @@ namespace Toolbox
|
||||
this.ActiveMdiChild.Tag = tp;
|
||||
this.ActiveMdiChild.FormClosed +=
|
||||
new FormClosedEventHandler(ActiveMdiChild_FormClosed);
|
||||
this.ActiveMdiChild.SizeChanged +=
|
||||
new EventHandler(ActiveMdiChild_StateChanged);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -851,6 +857,26 @@ namespace Toolbox
|
||||
}
|
||||
}
|
||||
|
||||
private void ActiveMdiChild_StateChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (ActiveMdiChild == null)
|
||||
return;
|
||||
|
||||
if (ActiveMdiChild.WindowState == FormWindowState.Maximized)
|
||||
{
|
||||
BtnMdiClose.Visible = true;
|
||||
BtnMdiMinMax.Visible = true;
|
||||
BtnMdiMinimize.Visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BtnMdiClose.Visible = false;
|
||||
BtnMdiMinMax.Visible = false;
|
||||
BtnMdiMinimize.Visible = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private const int WM_SETREDRAW = 11;
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
@ -910,5 +936,90 @@ namespace Toolbox
|
||||
CreditsWindow window = new CreditsWindow();
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void BtnMinMax_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void BtnMinMax_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void BtnMinMax_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void BtnClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void BtnClose_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void BtnClose_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void BtnMdiClose_MouseEnter(object sender, System.EventArgs e)
|
||||
{
|
||||
BtnMdiClose.Image = Switch_Toolbox.Library.Properties.Resources.Close_Hover;
|
||||
}
|
||||
|
||||
private void BtnMdiClose_MouseLeave(object sender, System.EventArgs e)
|
||||
{
|
||||
BtnMdiClose.Image = Switch_Toolbox.Library.Properties.Resources.Close;
|
||||
}
|
||||
|
||||
private void BtnMdiMinMax_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
BtnMdiMinMax.Image = Switch_Toolbox.Library.Properties.Resources.maximize_sele;
|
||||
}
|
||||
|
||||
private void BtnMdiMinMax_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
BtnMdiMinMax.Image = Switch_Toolbox.Library.Properties.Resources.maximize;
|
||||
}
|
||||
|
||||
private void BtnMdiMinimize_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
BtnMdiMinimize.Image = Switch_Toolbox.Library.Properties.Resources.minimize_sele;
|
||||
}
|
||||
|
||||
private void BtnMdiMinimize_MouseLeave(object sender, EventArgs e)
|
||||
{
|
||||
BtnMdiMinimize.Image = Switch_Toolbox.Library.Properties.Resources.minimize;
|
||||
}
|
||||
|
||||
private void BtnMdiClose_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach (var child in this.MdiChildren)
|
||||
{
|
||||
if (child == tabForms.SelectedTab.Tag)
|
||||
{
|
||||
child.Close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnMdiMinMax_Click(object sender, EventArgs e)
|
||||
{
|
||||
LayoutMdi(MdiLayout.Cascade);
|
||||
|
||||
foreach (STForm frm in this.MdiChildren) frm.MDIWindowed();
|
||||
}
|
||||
|
||||
private void BtnMdiMinimize_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ActiveMdiChild != null)
|
||||
ActiveMdiChild.WindowState = FormWindowState.Minimized;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -123,10 +123,40 @@
|
||||
<metadata name="tabControlContextMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>249, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="BtnMdiMinimize.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsQAAALEAGtI711AAAAGHRF
|
||||
WHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjVkR1hSAAAAi0lEQVRYR83RMQ6DMBQFQc7AeTicb+4EKVU0
|
||||
wlSwxTRb/GfJ25wzibGAsYCxgLGAsYCxgLGAsYCxgLGAsYCxgLGAsYCxgLGAcWWMsX8dN+26scK48huc
|
||||
Nx26scK4co79jV959GHNr3wCYwFjAWMBYwFjAWMBYwFjAWMBYwFjAWMBYwFjAWMB4/vm9gElTa5pEBd3
|
||||
OQAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="BtnMdiMinMax.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsPAAALDwGS+QOlAAAAGHRF
|
||||
WHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjVkR1hSAAAAtElEQVRYR83VsQ2DQBAFUYqgIVqgyuvyDNIF
|
||||
BOPdH8EET7LGKz6Rvc05lTAaYDTAaIDRAKMBRgOMBhgNMBpgNMBogNEAY2eMsV+O0E7P6GDsrMEZOugZ
|
||||
HYyde2yNnuszub/77MX+jiY3FYydZDS5qWDsJKPJTQVjJxlNbioYO8loclPB2ElGk5sKxs5jVPtzkXj1
|
||||
xZx/SW/AaIDRAKMBRgOMBhgNMBpgNMBogNEAowHG783tB0Zuo526jO7eAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="BtnMdiClose.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6
|
||||
JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAACXBIWXMAAAsQAAALEAGtI711AAAAGHRF
|
||||
WHRTb2Z0d2FyZQBwYWludC5uZXQgNC4xLjVkR1hSAAAAuklEQVRYR83QMQrDMBAFURcucoXcVsfRLWVt
|
||||
sU2YhFVk8BQPwUjgj48xhhJGA4wGGA0wGmA0wGiA0QCjAUYDjAYYDTAaYDTAWNF7nwffpcqbbzBW/frw
|
||||
zqiAcQUN2B0VMK6KIa21M9wxKmBclYNyIL1ZhXGVdlgOyoGf9//AWDFHvKY3DbljHMaKHBUn3e+Ow1iR
|
||||
o+LP0X3YGYfRAKMBRgOMBhgNMBpgNMBogNEAowFGA4wGGA0wPm8cFyDXx0vaICHBAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="stToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>132, 17</value>
|
||||
</metadata>
|
||||
<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">
|
||||
<value>
|
||||
AAABAAQAMDAAAAEAIACoJQAARgAAAEBAAAABACAAKEIAAO4lAACAgAAAAQAgACgIAQAWaAAAAAAAAAEA
|
||||
|
Loading…
x
Reference in New Issue
Block a user