Added: Frame counter to Frame List

This commit is contained in:
quinnvoker
2018-12-31 09:34:30 -08:00
parent 306a8ed808
commit 47a78bc9c1
2 changed files with 47 additions and 7 deletions
+9 -7
View File
@@ -91,8 +91,8 @@
this.animationPanel = new System.Windows.Forms.Panel(); this.animationPanel = new System.Windows.Forms.Panel();
this.animationNameLabel = new System.Windows.Forms.Label(); this.animationNameLabel = new System.Windows.Forms.Label();
this.animationLabel = new System.Windows.Forms.Label(); this.animationLabel = new System.Windows.Forms.Label();
this.loadAnimationSetDialog = new System.Windows.Forms.OpenFileDialog();
this.animationPreview = new AnimationEditor.AnimationPreview(); this.animationPreview = new AnimationEditor.AnimationPreview();
this.loadAnimationSetDialog = new System.Windows.Forms.OpenFileDialog();
((System.ComponentModel.ISupportInitialize)(this.frameTrackBar)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.frameTrackBar)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.delayInputBox)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.delayInputBox)).BeginInit();
this.mainMenuStrip.SuspendLayout(); this.mainMenuStrip.SuspendLayout();
@@ -136,12 +136,14 @@
this.frameListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.frameListBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left))); | System.Windows.Forms.AnchorStyles.Left)));
this.frameListBox.BackColor = System.Drawing.SystemColors.Window; this.frameListBox.BackColor = System.Drawing.SystemColors.Window;
this.frameListBox.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.frameListBox.FormattingEnabled = true; this.frameListBox.FormattingEnabled = true;
this.frameListBox.Location = new System.Drawing.Point(163, 41); this.frameListBox.Location = new System.Drawing.Point(163, 41);
this.frameListBox.Name = "frameListBox"; this.frameListBox.Name = "frameListBox";
this.frameListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; this.frameListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended;
this.frameListBox.Size = new System.Drawing.Size(120, 160); this.frameListBox.Size = new System.Drawing.Size(120, 160);
this.frameListBox.TabIndex = 4; this.frameListBox.TabIndex = 4;
this.frameListBox.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.frameListBox_DrawItem);
this.frameListBox.SelectedIndexChanged += new System.EventHandler(this.frameListBox_SelectedIndexChanged); this.frameListBox.SelectedIndexChanged += new System.EventHandler(this.frameListBox_SelectedIndexChanged);
// //
// addSpriteToFrameListButton // addSpriteToFrameListButton
@@ -777,12 +779,6 @@
this.animationLabel.TabIndex = 22; this.animationLabel.TabIndex = 22;
this.animationLabel.Text = "Animation"; this.animationLabel.Text = "Animation";
// //
// loadAnimationSetDialog
//
this.loadAnimationSetDialog.DefaultExt = "animset";
this.loadAnimationSetDialog.FileName = "openFileDialog1";
this.loadAnimationSetDialog.Filter = "QUROGames AnimationSet|*.animSet";
//
// animationPreview // animationPreview
// //
this.animationPreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.animationPreview.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -803,6 +799,12 @@
this.animationPreview.ZoomLevel = 0F; this.animationPreview.ZoomLevel = 0F;
this.animationPreview.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.animationPreview_MouseWheel); this.animationPreview.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.animationPreview_MouseWheel);
// //
// loadAnimationSetDialog
//
this.loadAnimationSetDialog.DefaultExt = "animset";
this.loadAnimationSetDialog.FileName = "openFileDialog1";
this.loadAnimationSetDialog.Filter = "QUROGames AnimationSet|*.animSet";
//
// Form1 // Form1
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+38
View File
@@ -793,5 +793,43 @@ namespace AnimationEditor
frameNameBoxEdited = true; frameNameBoxEdited = true;
} }
} }
private void frameListBox_DrawItem(object sender, DrawItemEventArgs e)
{
// Draw the background of the ListBox control for each item.
//e.DrawBackground();
// Define the default color of the brush as black.
Brush nameBrush = Brushes.Black;
Brush indexBrush = Brushes.Gray;
if (e.BackColor.GetBrightness() < 0.5)
nameBrush = Brushes.White;
System.Drawing.Rectangle indexRect = e.Bounds;
System.Drawing.Rectangle nameRect = e.Bounds;
indexRect.Width = 26;
nameRect.X += 24;
nameRect.Width -= 24;
string indexString = "";
for(int index = 3 - e.Index.ToString().Length; index > 0; index--)
{
indexString += "0";
}
indexString += e.Index;
indexString += ":";
e.Graphics.FillRectangle(Brushes.White, indexRect);
e.Graphics.FillRectangle(new SolidBrush(e.BackColor), nameRect);
// Draw the current item text based on the current Font
// and the custom brush settings.
e.Graphics.DrawString(indexString,
e.Font, indexBrush, indexRect, StringFormat.GenericDefault);
e.Graphics.DrawString(frames[e.Index].Name,
e.Font, nameBrush, nameRect, StringFormat.GenericDefault);
// If the ListBox has focus, draw a focus rectangle around the selected item.
e.DrawFocusRectangle();
}
} }
} }