diff --git a/renderdocui/Windows/Dialogs/TipsDialog.Designer.cs b/renderdocui/Windows/Dialogs/TipsDialog.Designer.cs new file mode 100644 index 000000000..dc9316e14 --- /dev/null +++ b/renderdocui/Windows/Dialogs/TipsDialog.Designer.cs @@ -0,0 +1,212 @@ +namespace renderdocui.Windows.Dialogs +{ + partial class TipsDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.Button close; + System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + this.randomTip = new System.Windows.Forms.Button(); + this.nextTip = new System.Windows.Forms.Button(); + this.tipBox = new System.Windows.Forms.GroupBox(); + this.tipTitle = new System.Windows.Forms.Label(); + this.tipPicture = new System.Windows.Forms.PictureBox(); + this.tipLink = new System.Windows.Forms.LinkLabel(); + this.tipText = new System.Windows.Forms.TextBox(); + close = new System.Windows.Forms.Button(); + tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + tableLayoutPanel1.SuspendLayout(); + this.tipBox.SuspendLayout(); + tableLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tipPicture)).BeginInit(); + this.SuspendLayout(); + // + // close + // + close.DialogResult = System.Windows.Forms.DialogResult.OK; + close.Location = new System.Drawing.Point(472, 295); + close.Name = "close"; + close.Size = new System.Drawing.Size(75, 23); + close.TabIndex = 0; + close.Text = "Close"; + close.UseVisualStyleBackColor = true; + // + // tableLayoutPanel1 + // + tableLayoutPanel1.ColumnCount = 3; + tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + tableLayoutPanel1.Controls.Add(this.randomTip, 0, 1); + tableLayoutPanel1.Controls.Add(close, 2, 1); + tableLayoutPanel1.Controls.Add(this.nextTip, 1, 1); + tableLayoutPanel1.Controls.Add(this.tipBox, 0, 0); + tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + tableLayoutPanel1.Name = "tableLayoutPanel1"; + tableLayoutPanel1.RowCount = 2; + tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tableLayoutPanel1.Size = new System.Drawing.Size(550, 321); + tableLayoutPanel1.TabIndex = 0; + // + // randomTip + // + this.randomTip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.randomTip.Location = new System.Drawing.Point(311, 295); + this.randomTip.Name = "randomTip"; + this.randomTip.Size = new System.Drawing.Size(74, 23); + this.randomTip.TabIndex = 3; + this.randomTip.Text = "Random Tip"; + this.randomTip.UseVisualStyleBackColor = true; + this.randomTip.Click += new System.EventHandler(this.LoadRandomTip); + // + // nextTip + // + this.nextTip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.nextTip.Location = new System.Drawing.Point(391, 295); + this.nextTip.Name = "nextTip"; + this.nextTip.Size = new System.Drawing.Size(75, 23); + this.nextTip.TabIndex = 1; + this.nextTip.Text = "Next Tip"; + this.nextTip.UseVisualStyleBackColor = true; + this.nextTip.Click += new System.EventHandler(this.LoadNextTip); + // + // tipBox + // + tableLayoutPanel1.SetColumnSpan(this.tipBox, 3); + this.tipBox.Controls.Add(tableLayoutPanel2); + this.tipBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.tipBox.Location = new System.Drawing.Point(3, 3); + this.tipBox.Name = "tipBox"; + this.tipBox.Size = new System.Drawing.Size(544, 286); + this.tipBox.TabIndex = 2; + this.tipBox.TabStop = false; + this.tipBox.Text = "Tip #X"; + // + // tableLayoutPanel2 + // + tableLayoutPanel2.ColumnCount = 1; + tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + tableLayoutPanel2.Controls.Add(this.tipTitle, 0, 0); + tableLayoutPanel2.Controls.Add(this.tipPicture, 0, 2); + tableLayoutPanel2.Controls.Add(this.tipLink, 0, 3); + tableLayoutPanel2.Controls.Add(this.tipText, 0, 1); + tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + tableLayoutPanel2.Location = new System.Drawing.Point(3, 16); + tableLayoutPanel2.Name = "tableLayoutPanel2"; + tableLayoutPanel2.RowCount = 4; + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); + tableLayoutPanel2.Size = new System.Drawing.Size(538, 267); + tableLayoutPanel2.TabIndex = 0; + // + // tipTitle + // + this.tipTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tipTitle.AutoSize = true; + this.tipTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.tipTitle.Location = new System.Drawing.Point(3, 0); + this.tipTitle.Name = "tipTitle"; + this.tipTitle.Size = new System.Drawing.Size(532, 25); + this.tipTitle.TabIndex = 0; + this.tipTitle.Text = "Tip #X: Tip Title"; + this.tipTitle.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // + // tipPicture + // + this.tipPicture.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.tipPicture.Location = new System.Drawing.Point(243, 180); + this.tipPicture.Name = "tipPicture"; + this.tipPicture.Size = new System.Drawing.Size(52, 54); + this.tipPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.tipPicture.TabIndex = 1; + this.tipPicture.TabStop = false; + // + // tipLink + // + this.tipLink.AutoSize = true; + this.tipLink.Location = new System.Drawing.Point(7, 244); + this.tipLink.Margin = new System.Windows.Forms.Padding(7); + this.tipLink.Name = "tipLink"; + this.tipLink.Size = new System.Drawing.Size(141, 13); + this.tipLink.TabIndex = 3; + this.tipLink.TabStop = true; + this.tipLink.Text = "https://renderdoc.org/tips/1"; + this.tipLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.tipLink_LinkClicked); + // + // tipText + // + this.tipText.BackColor = System.Drawing.SystemColors.Window; + this.tipText.Dock = System.Windows.Forms.DockStyle.Fill; + this.tipText.Location = new System.Drawing.Point(3, 28); + this.tipText.Multiline = true; + this.tipText.Name = "tipText"; + this.tipText.ReadOnly = true; + this.tipText.Size = new System.Drawing.Size(532, 146); + this.tipText.TabIndex = 4; + this.tipText.Text = "Tip Text"; + // + // TipsDialog + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(550, 321); + this.Controls.Add(tableLayoutPanel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(556, 346); + this.Name = "TipsDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "RenderDoc Tips"; + this.Load += new System.EventHandler(this.LoadRandomTip); + tableLayoutPanel1.ResumeLayout(false); + this.tipBox.ResumeLayout(false); + tableLayoutPanel2.ResumeLayout(false); + tableLayoutPanel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.tipPicture)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button nextTip; + private System.Windows.Forms.GroupBox tipBox; + private System.Windows.Forms.Label tipTitle; + private System.Windows.Forms.PictureBox tipPicture; + private System.Windows.Forms.LinkLabel tipLink; + private System.Windows.Forms.TextBox tipText; + private System.Windows.Forms.Button randomTip; + } +} \ No newline at end of file diff --git a/renderdocui/Windows/Dialogs/TipsDialog.cs b/renderdocui/Windows/Dialogs/TipsDialog.cs new file mode 100644 index 000000000..426d19e39 --- /dev/null +++ b/renderdocui/Windows/Dialogs/TipsDialog.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace renderdocui.Windows.Dialogs +{ + public partial class TipsDialog : Form + { + struct Tip + { + public Tip(string tt, string tx, Bitmap im) + { + title = tt; + text = tx; + image = im; + } + + public string title; + public string text; + public Bitmap image; + } + private List m_Tips = new List(); + + private Random m_Rand = new Random(); + private int m_CurrentTip = 0; + + public TipsDialog() + { + InitializeComponent(); + + Icon = global::renderdocui.Properties.Resources.icon; + + m_Tips.Add(new Tip( + "Talk to me!", + "RenderDoc is a labour of love and developed entirely in my spare time. If you run into a bug, have a feature " + + "request or just have a question about it, please feel free to get in touch and I'm always happy to talk and " + + "help out in any way I can - baldurk@baldurk.org.", + null)); + + m_Tips.Add(new Tip( + "Quick channel toggling", + "You can quickly toggle between RGB and Alpha in the Texture Viewer by right clicking on A - alpha.\n\n" + + "In general right clicking on a channel will toggle between only showing that channel, and showing all other " + + "channels except it.", + null)); + + m_Tips.Add(new Tip( + "Quick autofit follow", + "If you right click on the 'autofit' wand in the texture viewer, it will be locked on until you right " + + "click again. This means when you change texture or step through events, it will re-fit the texture " + + "continuously.\n\n" + + "This can be useful if you are e.g. jumping between a texture with a very compressed range like a depth " + + "texture and a normal render target.", + global::renderdocui.Properties.Resources.topo_trilist)); + } + + private void LoadRandomTip(object sender, EventArgs e) + { + int cur = m_CurrentTip; + + // ensure we at least switch to a different tip + while(m_CurrentTip == cur) + m_CurrentTip = m_Rand.Next(m_Tips.Count); + + LoadTip(); + } + + private void LoadTip() + { + Tip tip = m_Tips[m_CurrentTip]; + + tipBox.Text = String.Format("Tip #{0}", m_CurrentTip + 1); + tipTitle.Text = String.Format("Tip #{0}: {1}", m_CurrentTip + 1, tip.title); + tipText.Text = tip.text; + tipLink.Text = String.Format("https://renderdoc.org/tips/{0}", m_CurrentTip + 1); + + if (tip.image == null) + { + tipPicture.Image = null; + tipPicture.Visible = false; + } + else + { + tipPicture.Image = tip.image; + tipPicture.Visible = true; + } + } + + private void LoadNextTip(object sender, EventArgs e) + { + m_CurrentTip++; + + if (m_CurrentTip >= m_Tips.Count) + m_CurrentTip = 0; + + LoadTip(); + } + + private void tipLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + Process.Start(tipLink.Text); + } + } +} diff --git a/renderdocui/Windows/Dialogs/TipsDialog.resx b/renderdocui/Windows/Dialogs/TipsDialog.resx new file mode 100644 index 000000000..8616cd963 --- /dev/null +++ b/renderdocui/Windows/Dialogs/TipsDialog.resx @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + False + + + False + + \ No newline at end of file diff --git a/renderdocui/renderdocui.csproj b/renderdocui/renderdocui.csproj index 1eeb654a8..b70cfc1b4 100644 --- a/renderdocui/renderdocui.csproj +++ b/renderdocui/renderdocui.csproj @@ -252,6 +252,12 @@ TextureSaveDialog.cs + + Form + + + TipsDialog.cs + Form @@ -372,6 +378,9 @@ TextureSaveDialog.cs + + TipsDialog.cs + EventBrowser.cs @@ -532,4 +541,4 @@ --> - + \ No newline at end of file