I keep forgetting that, unlike protected methods, Actions MUST be implemented in derived classes...

This commit is contained in:
MaxED 2013-12-26 08:07:40 +00:00
parent 5d2237b026
commit 46feeb422f
5 changed files with 30 additions and 28 deletions

View file

@ -75,7 +75,6 @@ namespace CodeImp.DoomBuilder.Editing
// View panning
protected bool panning;
private bool autopanenabled;
protected bool paintselectpressed; //mxd
//mxd. used in "Play From Here" Action
private Thing playerStart;
@ -870,29 +869,6 @@ namespace CodeImp.DoomBuilder.Editing
SetViewMode(ViewMode.CeilingTextures);
}
//mxd
[BeginAction("classicpaintselect")]
protected virtual void OnPaintSelectBegin() {
paintselectpressed = true;
}
//mxd
[EndAction("classicpaintselect")]
protected virtual void OnPaintSelectEnd() {
paintselectpressed = false;
}
//mxd
[BeginAction("togglebrightness")]
protected virtual void ToggleBrightness() {
renderer.FullBrightness = !renderer.FullBrightness;
string onoff = renderer.FullBrightness ? "ON" : "OFF";
General.Interface.DisplayStatus(StatusType.Action, "Full Brightness is now " + onoff + ".");
// Redraw display to show changes
General.Interface.RedrawDisplay();
}
#endregion
}

View file

@ -191,8 +191,8 @@ namespace CodeImp.DoomBuilder.Rendering
internal void CreateCorrectionTable()
{
// Determine amounts
float gamma = (float)(General.Settings.ImageBrightness + 10) * 0.1f;
float bright = (float)General.Settings.ImageBrightness * 5f;
float gamma = (General.Settings.ImageBrightness + 10) * 0.1f;
float bright = General.Settings.ImageBrightness * 5f;
// Make table
correctiontable = new byte[256];
@ -201,7 +201,7 @@ namespace CodeImp.DoomBuilder.Rendering
for(int i = 0; i < 256; i++)
{
byte b;
float a = (float)i * gamma + bright;
float a = i * gamma + bright;
if(a < 0f) b = 0; else if(a > 255f) b = 255; else b = (byte)a;
correctiontable[i] = b;
}

View file

@ -79,6 +79,7 @@ namespace CodeImp.DoomBuilder.Windows
this.tvTextureSets.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
this.tvTextureSets.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.tvTextureSets.HideSelection = false;
this.tvTextureSets.ImageIndex = 0;
this.tvTextureSets.ImageList = this.smallimages;
this.tvTextureSets.Location = new System.Drawing.Point(681, 12);

View file

@ -125,7 +125,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAc
DwAAAk1TRnQBSQFMAgEBBwEAAdQBAAHUAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DwAAAk1TRnQBSQFMAgEBBwEAAdwBAAHcAQABEAEAARYBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASwDAAEBAQABCAYAAQsYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View file

@ -39,6 +39,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
#endregion
#region ================== Variables
protected bool paintselectpressed; //mxd
#endregion
@ -291,6 +293,29 @@ namespace CodeImp.DoomBuilder.BuilderModes
General.Interface.RedrawDisplay();
}
//mxd
[BeginAction("classicpaintselect")]
protected virtual void OnPaintSelectBegin() {
paintselectpressed = true;
}
//mxd
[EndAction("classicpaintselect")]
protected virtual void OnPaintSelectEnd() {
paintselectpressed = false;
}
//mxd
[BeginAction("togglebrightness")]
protected virtual void ToggleBrightness() {
renderer.FullBrightness = !renderer.FullBrightness;
string onoff = renderer.FullBrightness ? "ON" : "OFF";
General.Interface.DisplayStatus(StatusType.Action, "Full Brightness is now " + onoff + ".");
// Redraw display to show changes
General.Interface.RedrawDisplay();
}
//mxd
[BeginAction("togglehighlight")]
public void ToggleHighlight() {