diff --git a/Source/Core/Controls/HintsPanel.Designer.cs b/Source/Core/Controls/HintsPanel.Designer.cs index e9cf559b..f9267e08 100644 --- a/Source/Core/Controls/HintsPanel.Designer.cs +++ b/Source/Core/Controls/HintsPanel.Designer.cs @@ -26,41 +26,54 @@ /// private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HintsPanel)); + this.label1 = new System.Windows.Forms.Label(); this.hints = new System.Windows.Forms.RichTextBox(); this.SuspendLayout(); // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(3, 3); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(110, 13); + this.label1.TabIndex = 1; + this.label1.Text = "hidden focus catcher!"; + // // hints // this.hints.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.hints.BackColor = System.Drawing.SystemColors.Window; - this.hints.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.hints.Cursor = System.Windows.Forms.Cursors.Arrow; this.hints.DetectUrls = false; this.hints.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); - this.hints.Location = new System.Drawing.Point(3, 3); + this.hints.Location = new System.Drawing.Point(6, 3); this.hints.Name = "hints"; this.hints.ReadOnly = true; this.hints.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical; this.hints.ShortcutsEnabled = false; - this.hints.Size = new System.Drawing.Size(384, 542); - this.hints.TabIndex = 1; + this.hints.Size = new System.Drawing.Size(381, 542); + this.hints.TabIndex = 2; this.hints.Text = resources.GetString("hints.Text"); + this.hints.Enter += new System.EventHandler(this.hints_Enter); // // HintsPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.hints); + this.Controls.Add(this.label1); this.Name = "HintsPanel"; this.Size = new System.Drawing.Size(390, 548); this.ResumeLayout(false); + this.PerformLayout(); } #endregion + private System.Windows.Forms.Label label1; private System.Windows.Forms.RichTextBox hints; } diff --git a/Source/Core/Controls/HintsPanel.cs b/Source/Core/Controls/HintsPanel.cs index 8f171ff5..5c524524 100644 --- a/Source/Core/Controls/HintsPanel.cs +++ b/Source/Core/Controls/HintsPanel.cs @@ -1,5 +1,4 @@ using System; -using System.Drawing; using System.Windows.Forms; namespace CodeImp.DoomBuilder.Controls @@ -13,31 +12,22 @@ namespace CodeImp.DoomBuilder.Controls internal void SetHints(string[] hintsText) { hints.Clear(); + if(hintsText.Length == 0) return; - foreach (string s in hintsText) { - hints.AppendText(s + Environment.NewLine + Environment.NewLine); - } + //convert to rtf markup + hintsText[0] = "{\\rtf1" + hintsText[0]; + hintsText[hintsText.Length - 1] += "}"; - //apply tags - int start = hints.Text.IndexOf(""); - int end = hints.Text.IndexOf(""); - Font regular = hints.Font; - Font bold = new Font(hints.SelectionFont, FontStyle.Bold); - - while(start != -1 && end != -1) { - hints.Select(start, end + 4 - start); - hints.SelectionFont = bold; - hints.SelectedText = hints.SelectedText.Replace("", "").Replace("", ""); - - start = hints.Text.IndexOf(""); - end = hints.Text.IndexOf(""); - } - - hints.SelectionFont = regular; + hints.SelectedRtf = string.Join("\\par\\par ", hintsText).Replace("", "{\\b ").Replace("", "}"); } internal void ClearHints() { hints.Clear(); } + + // Fight TextBoxes habit of not releasing the focus by using a carefully placed label + private void hints_Enter(object sender, EventArgs e) { + label1.Focus(); + } } } diff --git a/Source/Core/Controls/HintsPanel.resx b/Source/Core/Controls/HintsPanel.resx index f995c109..6109c157 100644 --- a/Source/Core/Controls/HintsPanel.resx +++ b/Source/Core/Controls/HintsPanel.resx @@ -140,6 +140,7 @@ GZDB is very easy to use: just learn more than 300 awesome hot keys and you are To find the Broom Closet Ending, create the broom closet! -Press F1 to view Achievements! +Press F1 to view Achievements! + \ No newline at end of file diff --git a/Source/Core/Controls/ImageSelectorControl.Designer.cs b/Source/Core/Controls/ImageSelectorControl.Designer.cs index 3b27a7e2..2f0b71c7 100644 --- a/Source/Core/Controls/ImageSelectorControl.Designer.cs +++ b/Source/Core/Controls/ImageSelectorControl.Designer.cs @@ -95,6 +95,7 @@ namespace CodeImp.DoomBuilder.Controls this.Size = new System.Drawing.Size(115, 136); this.Layout += new System.Windows.Forms.LayoutEventHandler(this.ImageSelectorControl_Layout); this.Resize += new System.EventHandler(this.ImageSelectorControl_Resize); + this.EnabledChanged += new System.EventHandler(this.ImageSelectorControl_EnabledChanged); this.preview.ResumeLayout(false); this.preview.PerformLayout(); this.ResumeLayout(false); diff --git a/Source/Core/Controls/ImageSelectorControl.cs b/Source/Core/Controls/ImageSelectorControl.cs index 998e1147..9dd5e6c3 100644 --- a/Source/Core/Controls/ImageSelectorControl.cs +++ b/Source/Core/Controls/ImageSelectorControl.cs @@ -86,7 +86,6 @@ namespace CodeImp.DoomBuilder.Controls // Image clicked private void preview_Click(object sender, EventArgs e) { - //ispressed = false; preview.BackColor = SystemColors.Highlight; ShowPreview(FindImage(name.Text)); if(button == MouseButtons.Right) @@ -156,6 +155,11 @@ namespace CodeImp.DoomBuilder.Controls private void timer_Tick(object sender, EventArgs e) { Refresh(); } + + //mxd + private void ImageSelectorControl_EnabledChanged(object sender, EventArgs e) { + labelSize.Visible = !(!General.Settings.ShowTextureSizes || !this.Enabled || string.IsNullOrEmpty(labelSize.Text)); + } #endregion @@ -196,13 +200,8 @@ namespace CodeImp.DoomBuilder.Controls //mxd protected void DisplayImageSize(float width, float height) { - if(!General.Settings.ShowTextureSizes || !this.Enabled || width == 0 || height == 0) { - labelSize.Visible = false; - return; - } - - labelSize.Visible = true; - labelSize.Text = width + "x" + height; + labelSize.Text = (width > 0 && height > 0) ? width + "x" + height : string.Empty; + ImageSelectorControl_EnabledChanged(this, EventArgs.Empty); } // This must determine and return the image to show @@ -244,7 +243,9 @@ namespace CodeImp.DoomBuilder.Controls // This clamps a value between 0 and 1 private float Saturate(float v) { - if(v < 0f) return 0f; else if(v > 1f) return 1f; else return v; + if(v < 0f) return 0f; + if(v > 1f) return 1f; + return v; } #endregion diff --git a/Source/Core/Resources/Actions.cfg b/Source/Core/Resources/Actions.cfg index 8032bacb..1fbbe729 100644 --- a/Source/Core/Resources/Actions.cfg +++ b/Source/Core/Resources/Actions.cfg @@ -145,7 +145,7 @@ preferences { title = "Preferences"; category = "tools"; - description = "Shows this Preferences dialog."; + description = "Shows the Preferences dialog."; allowkeys = true; allowmouse = false; allowscroll = false; diff --git a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs index 8c597865..8294db9d 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/VerticesMode.cs @@ -474,8 +474,10 @@ namespace CodeImp.DoomBuilder.BuilderModes //render preview if(renderer.StartOverlay(true)) { + float dist = Vector2D.Distance(mousemappos, insertPreview); + byte alpha = (byte)(255 - (dist / BuilderPlug.Me.SplitLinedefsRange) * 192); float vsize = (renderer.VertexSize + 1.0f) / renderer.Scale; - renderer.RenderRectangleFilled(new RectangleF(insertPreview.x - vsize, insertPreview.y - vsize, vsize * 2.0f, vsize * 2.0f), General.Colors.InfoLine, true); + renderer.RenderRectangleFilled(new RectangleF(insertPreview.x - vsize, insertPreview.y - vsize, vsize * 2.0f, vsize * 2.0f), General.Colors.InfoLine.WithAlpha(alpha), true); renderer.Finish(); renderer.Present(); } diff --git a/Source/Plugins/BuilderModes/Interface/SectorDrawingOptionsPanel.Designer.cs b/Source/Plugins/BuilderModes/Interface/SectorDrawingOptionsPanel.Designer.cs index 75e60280..09e1e8f8 100644 --- a/Source/Plugins/BuilderModes/Interface/SectorDrawingOptionsPanel.Designer.cs +++ b/Source/Plugins/BuilderModes/Interface/SectorDrawingOptionsPanel.Designer.cs @@ -29,8 +29,6 @@ this.groupBox1 = new System.Windows.Forms.GroupBox(); this.cbOverrideFloorTexture = new System.Windows.Forms.CheckBox(); this.cbOverrideCeilingTexture = new System.Windows.Forms.CheckBox(); - this.floor = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); - this.ceiling = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label1 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label(); @@ -48,18 +46,20 @@ this.top = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox(); - this.fillceiling = new System.Windows.Forms.Button(); - this.fillfloor = new System.Windows.Forms.Button(); - this.fillupper = new System.Windows.Forms.Button(); - this.fillmiddle = new System.Windows.Forms.Button(); this.filllower = new System.Windows.Forms.Button(); + this.fillmiddle = new System.Windows.Forms.Button(); + this.fillupper = new System.Windows.Forms.Button(); + this.fillfloor = new System.Windows.Forms.Button(); + this.fillceiling = new System.Windows.Forms.Button(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.groupBox5 = new System.Windows.Forms.GroupBox(); this.clearlower = new System.Windows.Forms.Button(); this.clearmiddle = new System.Windows.Forms.Button(); this.clearupper = new System.Windows.Forms.Button(); this.clearfloor = new System.Windows.Forms.Button(); this.clearceiling = new System.Windows.Forms.Button(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.floor = new CodeImp.DoomBuilder.Controls.FlatSelectorControl(); + this.ceiling = new CodeImp.DoomBuilder.Controls.FlatSelectorControl(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -71,10 +71,10 @@ // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.ceiling); + this.groupBox1.Controls.Add(this.floor); this.groupBox1.Controls.Add(this.cbOverrideFloorTexture); this.groupBox1.Controls.Add(this.cbOverrideCeilingTexture); - this.groupBox1.Controls.Add(this.floor); - this.groupBox1.Controls.Add(this.ceiling); this.groupBox1.Location = new System.Drawing.Point(3, 3); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(243, 137); @@ -104,26 +104,6 @@ this.cbOverrideCeilingTexture.UseVisualStyleBackColor = true; this.cbOverrideCeilingTexture.CheckedChanged += new System.EventHandler(this.cbOverrideCeilingTexture_CheckedChanged); // - // floor - // - this.floor.Location = new System.Drawing.Point(87, 41); - this.floor.Name = "floor"; - this.floor.Required = false; - this.floor.Size = new System.Drawing.Size(68, 90); - this.floor.TabIndex = 17; - this.floor.TextureName = ""; - this.floor.OnValueChanged += new System.EventHandler(this.floor_OnValueChanged); - // - // ceiling - // - this.ceiling.Location = new System.Drawing.Point(6, 41); - this.ceiling.Name = "ceiling"; - this.ceiling.Required = false; - this.ceiling.Size = new System.Drawing.Size(68, 90); - this.ceiling.TabIndex = 16; - this.ceiling.TextureName = ""; - this.ceiling.OnValueChanged += new System.EventHandler(this.ceiling_OnValueChanged); - // // groupBox2 // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -332,39 +312,16 @@ this.groupBox4.TabStop = false; this.groupBox4.Text = "Fill Selection with Textures:"; // - // fillceiling + // filllower // - this.fillceiling.Location = new System.Drawing.Point(6, 19); - this.fillceiling.Name = "fillceiling"; - this.fillceiling.Size = new System.Drawing.Size(26, 23); - this.fillceiling.TabIndex = 0; - this.fillceiling.Text = "C"; - this.toolTip1.SetToolTip(this.fillceiling, "Fill all ceiling textures within selection \r\nwith current ceiling override textur" + - "e"); - this.fillceiling.UseVisualStyleBackColor = true; - this.fillceiling.Click += new System.EventHandler(this.fillceiling_Click); - // - // fillfloor - // - this.fillfloor.Location = new System.Drawing.Point(38, 19); - this.fillfloor.Name = "fillfloor"; - this.fillfloor.Size = new System.Drawing.Size(26, 23); - this.fillfloor.TabIndex = 1; - this.fillfloor.Text = "F"; - this.toolTip1.SetToolTip(this.fillfloor, "Fill all floor textures within selection \r\nwith current floor override texture"); - this.fillfloor.UseVisualStyleBackColor = true; - this.fillfloor.Click += new System.EventHandler(this.fillfloor_Click); - // - // fillupper - // - this.fillupper.Location = new System.Drawing.Point(69, 19); - this.fillupper.Name = "fillupper"; - this.fillupper.Size = new System.Drawing.Size(26, 23); - this.fillupper.TabIndex = 2; - this.fillupper.Text = "U"; - this.toolTip1.SetToolTip(this.fillupper, "Fill all upper textures within selection \r\nwith current upper override texture"); - this.fillupper.UseVisualStyleBackColor = true; - this.fillupper.Click += new System.EventHandler(this.fillupper_Click); + this.filllower.Location = new System.Drawing.Point(133, 19); + this.filllower.Name = "filllower"; + this.filllower.Size = new System.Drawing.Size(26, 23); + this.filllower.TabIndex = 4; + this.filllower.Text = "L"; + this.toolTip1.SetToolTip(this.filllower, "Fill all lower textures within selection \r\nwith current lower override texture"); + this.filllower.UseVisualStyleBackColor = true; + this.filllower.Click += new System.EventHandler(this.filllower_Click); // // fillmiddle // @@ -377,32 +334,39 @@ this.fillmiddle.UseVisualStyleBackColor = true; this.fillmiddle.Click += new System.EventHandler(this.fillmiddle_Click); // - // filllower + // fillupper // - this.filllower.Location = new System.Drawing.Point(133, 19); - this.filllower.Name = "filllower"; - this.filllower.Size = new System.Drawing.Size(26, 23); - this.filllower.TabIndex = 4; - this.filllower.Text = "L"; - this.toolTip1.SetToolTip(this.filllower, "Fill all lower textures within selection \r\nwith current lower override texture"); - this.filllower.UseVisualStyleBackColor = true; - this.filllower.Click += new System.EventHandler(this.filllower_Click); + this.fillupper.Location = new System.Drawing.Point(69, 19); + this.fillupper.Name = "fillupper"; + this.fillupper.Size = new System.Drawing.Size(26, 23); + this.fillupper.TabIndex = 2; + this.fillupper.Text = "U"; + this.toolTip1.SetToolTip(this.fillupper, "Fill all upper textures within selection \r\nwith current upper override texture"); + this.fillupper.UseVisualStyleBackColor = true; + this.fillupper.Click += new System.EventHandler(this.fillupper_Click); // - // groupBox5 + // fillfloor // - this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox5.Controls.Add(this.clearlower); - this.groupBox5.Controls.Add(this.clearmiddle); - this.groupBox5.Controls.Add(this.clearupper); - this.groupBox5.Controls.Add(this.clearfloor); - this.groupBox5.Controls.Add(this.clearceiling); - this.groupBox5.Location = new System.Drawing.Point(3, 343); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(243, 48); - this.groupBox5.TabIndex = 31; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "Remove Textures form Selection:"; + this.fillfloor.Location = new System.Drawing.Point(38, 19); + this.fillfloor.Name = "fillfloor"; + this.fillfloor.Size = new System.Drawing.Size(26, 23); + this.fillfloor.TabIndex = 1; + this.fillfloor.Text = "F"; + this.toolTip1.SetToolTip(this.fillfloor, "Fill all floor textures within selection \r\nwith current floor override texture"); + this.fillfloor.UseVisualStyleBackColor = true; + this.fillfloor.Click += new System.EventHandler(this.fillfloor_Click); + // + // fillceiling + // + this.fillceiling.Location = new System.Drawing.Point(6, 19); + this.fillceiling.Name = "fillceiling"; + this.fillceiling.Size = new System.Drawing.Size(26, 23); + this.fillceiling.TabIndex = 0; + this.fillceiling.Text = "C"; + this.toolTip1.SetToolTip(this.fillceiling, "Fill all ceiling textures within selection \r\nwith current ceiling override textur" + + "e"); + this.fillceiling.UseVisualStyleBackColor = true; + this.fillceiling.Click += new System.EventHandler(this.fillceiling_Click); // // clearlower // @@ -459,6 +423,40 @@ this.clearceiling.UseVisualStyleBackColor = true; this.clearceiling.Click += new System.EventHandler(this.clearceiling_Click); // + // groupBox5 + // + this.groupBox5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox5.Controls.Add(this.clearlower); + this.groupBox5.Controls.Add(this.clearmiddle); + this.groupBox5.Controls.Add(this.clearupper); + this.groupBox5.Controls.Add(this.clearfloor); + this.groupBox5.Controls.Add(this.clearceiling); + this.groupBox5.Location = new System.Drawing.Point(3, 343); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(243, 48); + this.groupBox5.TabIndex = 31; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "Remove Textures form Selection:"; + // + // floor + // + this.floor.Location = new System.Drawing.Point(87, 41); + this.floor.Name = "floor"; + this.floor.Size = new System.Drawing.Size(68, 90); + this.floor.TabIndex = 29; + this.floor.TextureName = ""; + this.floor.OnValueChanged += new System.EventHandler(this.floor_OnValueChanged); + // + // ceiling + // + this.ceiling.Location = new System.Drawing.Point(6, 41); + this.ceiling.Name = "ceiling"; + this.ceiling.Size = new System.Drawing.Size(68, 90); + this.ceiling.TabIndex = 30; + this.ceiling.TextureName = ""; + this.ceiling.OnValueChanged += new System.EventHandler(this.ceiling_OnValueChanged); + // // SectorDrawingOptionsPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -486,8 +484,6 @@ private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.CheckBox cbOverrideCeilingTexture; - private CodeImp.DoomBuilder.Controls.TextureSelectorControl floor; - private CodeImp.DoomBuilder.Controls.TextureSelectorControl ceiling; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.CheckBox cbOverrideFloorTexture; private System.Windows.Forms.CheckBox cbBrightness; @@ -518,5 +514,7 @@ private System.Windows.Forms.Button clearupper; private System.Windows.Forms.Button clearfloor; private System.Windows.Forms.Button clearceiling; + private CodeImp.DoomBuilder.Controls.FlatSelectorControl floor; + private CodeImp.DoomBuilder.Controls.FlatSelectorControl ceiling; } } diff --git a/Source/Plugins/BuilderModes/Interface/SectorDrawingOptionsPanel.resx b/Source/Plugins/BuilderModes/Interface/SectorDrawingOptionsPanel.resx index 3fe06434..7ce03af8 100644 --- a/Source/Plugins/BuilderModes/Interface/SectorDrawingOptionsPanel.resx +++ b/Source/Plugins/BuilderModes/Interface/SectorDrawingOptionsPanel.resx @@ -120,19 +120,4 @@ 17, 17 - - 17, 17 - - - 17, 17 - - - 17, 17 - - - 17, 17 - - - 17, 17 - \ No newline at end of file