mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-26 13:50:56 +00:00
Add actions to toggle slope skewing and midtexture pegging
This commit is contained in:
parent
122c7928b7
commit
cf892c3e85
9 changed files with 124 additions and 3 deletions
|
@ -1135,6 +1135,26 @@ togglelowerunpegged
|
||||||
allowscroll = true;
|
allowscroll = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
togglepegmidtexture
|
||||||
|
{
|
||||||
|
title = "Toggle Peg Midtexture";
|
||||||
|
category = "visual";
|
||||||
|
description = "Toggles the Peg Midtexture setting on the selected or targeted linedef.";
|
||||||
|
allowkeys = true;
|
||||||
|
allowmouse = true;
|
||||||
|
allowscroll = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleslopeskew
|
||||||
|
{
|
||||||
|
title = "Toggle Slope Skew";
|
||||||
|
category = "visual";
|
||||||
|
description = "Toggles the Slope Skew setting on the selected or targeted linedef.";
|
||||||
|
allowkeys = true;
|
||||||
|
allowmouse = true;
|
||||||
|
allowscroll = true;
|
||||||
|
}
|
||||||
|
|
||||||
togglegravity
|
togglegravity
|
||||||
{
|
{
|
||||||
title = "Toggle Gravity";
|
title = "Toggle Gravity";
|
||||||
|
|
|
@ -390,6 +390,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public virtual void OnTextureFit(FitTextureOptions options) { } //mxd
|
public virtual void OnTextureFit(FitTextureOptions options) { } //mxd
|
||||||
public virtual void OnToggleUpperUnpegged() { }
|
public virtual void OnToggleUpperUnpegged() { }
|
||||||
public virtual void OnToggleLowerUnpegged() { }
|
public virtual void OnToggleLowerUnpegged() { }
|
||||||
|
public virtual void OnTogglePegMidtexture() { }
|
||||||
|
public virtual void OnToggleSlopeSkew() { }
|
||||||
public virtual void OnResetTextureOffset() { }
|
public virtual void OnResetTextureOffset() { }
|
||||||
public virtual void OnResetLocalTextureOffset() { } //mxd
|
public virtual void OnResetLocalTextureOffset() { } //mxd
|
||||||
public virtual void OnCopyTextureOffsets() { }
|
public virtual void OnCopyTextureOffsets() { }
|
||||||
|
@ -398,6 +400,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
protected virtual void SetTexture(string texturename) { }
|
protected virtual void SetTexture(string texturename) { }
|
||||||
public virtual void ApplyUpperUnpegged(bool set) { }
|
public virtual void ApplyUpperUnpegged(bool set) { }
|
||||||
public virtual void ApplyLowerUnpegged(bool set) { }
|
public virtual void ApplyLowerUnpegged(bool set) { }
|
||||||
|
public virtual void ApplyLineFlag(Linedef line, string flag, string name) { }
|
||||||
protected abstract void MoveTextureOffset(int offsetx, int offsety);
|
protected abstract void MoveTextureOffset(int offsetx, int offsety);
|
||||||
protected abstract Point GetTextureOffset();
|
protected abstract Point GetTextureOffset();
|
||||||
public virtual void OnPaintSelectEnd() { } // biwa
|
public virtual void OnPaintSelectEnd() { } // biwa
|
||||||
|
|
|
@ -1060,6 +1060,31 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Toggle midtexture pegging
|
||||||
|
public virtual void OnTogglePegMidtexture()
|
||||||
|
{
|
||||||
|
mode.ApplyLineFlag(this.Sidedef.Line, "midpeg", "Peg Midtexture");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Toggle slope skew
|
||||||
|
public virtual void OnToggleSlopeSkew()
|
||||||
|
{
|
||||||
|
switch (this.GeometryType)
|
||||||
|
{
|
||||||
|
case VisualGeometryType.WALL_LOWER:
|
||||||
|
case VisualGeometryType.WALL_UPPER:
|
||||||
|
mode.ApplyLineFlag(this.Sidedef.Line, "skewtd", "Slope Skew");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VisualGeometryType.WALL_MIDDLE_3D:
|
||||||
|
mode.ApplyLineFlag(this.GetControlLinedef(), "skewtd", "Slope Skew");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case VisualGeometryType.WALL_MIDDLE:
|
||||||
|
mode.ApplyLineFlag(this.Sidedef.Line, "noskew", "No Midtexture Skew");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This sets the Upper Unpegged flag
|
// This sets the Upper Unpegged flag
|
||||||
public virtual void ApplyUpperUnpegged(bool set)
|
public virtual void ApplyUpperUnpegged(bool set)
|
||||||
|
@ -1092,7 +1117,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This sets the Lower Unpegged flag
|
// This sets the Lower Unpegged flag
|
||||||
public virtual void ApplyLowerUnpegged(bool set)
|
public virtual void ApplyLowerUnpegged(bool set)
|
||||||
{
|
{
|
||||||
|
@ -1124,6 +1148,37 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This sets a specified flag
|
||||||
|
public virtual void ApplyLineFlag(Linedef line, string flag, string name)
|
||||||
|
{
|
||||||
|
if (line.IsFlagSet(flag))
|
||||||
|
{
|
||||||
|
// Remove flag
|
||||||
|
mode.CreateUndo("Remove " + name + " flag");
|
||||||
|
mode.SetActionResult("Removed " + name + " flag.");
|
||||||
|
line.SetFlag(flag, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Add flag
|
||||||
|
mode.CreateUndo("Set " + name + " flag");
|
||||||
|
mode.SetActionResult("Set " + name + " flag.");
|
||||||
|
line.SetFlag(flag, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update sidedef geometry
|
||||||
|
VisualSidedefParts parts = Sector.GetSidedefParts(Sidedef);
|
||||||
|
parts.SetupAllParts();
|
||||||
|
|
||||||
|
// Update other sidedef geometry
|
||||||
|
if (Sidedef.Other != null)
|
||||||
|
{
|
||||||
|
BaseVisualSector othersector = (BaseVisualSector)mode.GetVisualSector(Sidedef.Other.Sector);
|
||||||
|
parts = othersector.GetSidedefParts(Sidedef.Other);
|
||||||
|
parts.SetupAllParts();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Flood-fill textures
|
// Flood-fill textures
|
||||||
public virtual void OnTextureFloodfill()
|
public virtual void OnTextureFloodfill()
|
||||||
|
|
|
@ -2248,6 +2248,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply specified flag
|
||||||
|
public void ApplyLineFlag(Linedef line, string flag, string name)
|
||||||
|
{
|
||||||
|
List<IVisualEventReceiver> objs = GetSelectedObjects(false, true, false, false, false);
|
||||||
|
foreach (IVisualEventReceiver i in objs)
|
||||||
|
{
|
||||||
|
i.ApplyLineFlag(line, flag, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Apply texture change
|
// Apply texture change
|
||||||
public void ApplySelectTexture(string texture, bool flat)
|
public void ApplySelectTexture(string texture, bool flat)
|
||||||
{
|
{
|
||||||
|
@ -3775,6 +3785,22 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
PostAction();
|
PostAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BeginAction("togglepegmidtexture")]
|
||||||
|
public void TogglePegMidtexture()
|
||||||
|
{
|
||||||
|
PreAction(UndoGroup.None);
|
||||||
|
GetTargetEventReceiver(false).OnTogglePegMidtexture();
|
||||||
|
PostAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
[BeginAction("toggleslopeskew")]
|
||||||
|
public void ToggleSlopeSkew()
|
||||||
|
{
|
||||||
|
PreAction(UndoGroup.None);
|
||||||
|
GetTargetEventReceiver(false).OnToggleSlopeSkew();
|
||||||
|
PostAction();
|
||||||
|
}
|
||||||
|
|
||||||
[BeginAction("togglegravity")]
|
[BeginAction("togglegravity")]
|
||||||
public void ToggleGravity()
|
public void ToggleGravity()
|
||||||
{
|
{
|
||||||
|
|
|
@ -120,6 +120,8 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
public void OnTextureAlign(bool alignx, bool aligny) { }
|
public void OnTextureAlign(bool alignx, bool aligny) { }
|
||||||
public void OnToggleUpperUnpegged() { }
|
public void OnToggleUpperUnpegged() { }
|
||||||
public void OnToggleLowerUnpegged() { }
|
public void OnToggleLowerUnpegged() { }
|
||||||
|
public void OnTogglePegMidtexture() { }
|
||||||
|
public void OnToggleSlopeSkew() { }
|
||||||
public void OnProcess(long deltatime) { }
|
public void OnProcess(long deltatime) { }
|
||||||
public void OnTextureFloodfill() { }
|
public void OnTextureFloodfill() { }
|
||||||
public void OnInsert() { }
|
public void OnInsert() { }
|
||||||
|
@ -127,6 +129,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
public void ApplyTexture(string texture) { }
|
public void ApplyTexture(string texture) { }
|
||||||
public void ApplyUpperUnpegged(bool set) { }
|
public void ApplyUpperUnpegged(bool set) { }
|
||||||
public void ApplyLowerUnpegged(bool set) { }
|
public void ApplyLowerUnpegged(bool set) { }
|
||||||
|
public void ApplyLineFlag(Linedef line, string flag, string name) { }
|
||||||
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight, bool stopatselected) { } //mxd
|
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight, bool stopatselected) { } //mxd
|
||||||
public virtual void OnPaintSelectEnd() { } // biwa
|
public virtual void OnPaintSelectEnd() { } // biwa
|
||||||
public void OnChangeScale(int x, int y) { }
|
public void OnChangeScale(int x, int y) { }
|
||||||
|
|
|
@ -714,6 +714,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public void OnTextureAlign(bool alignx, bool aligny) { }
|
public void OnTextureAlign(bool alignx, bool aligny) { }
|
||||||
public void OnToggleUpperUnpegged() { }
|
public void OnToggleUpperUnpegged() { }
|
||||||
public void OnToggleLowerUnpegged() { }
|
public void OnToggleLowerUnpegged() { }
|
||||||
|
public void OnTogglePegMidtexture() { }
|
||||||
|
public void OnToggleSlopeSkew() { }
|
||||||
public void OnProcess(long deltatime) { }
|
public void OnProcess(long deltatime) { }
|
||||||
public void OnTextureFloodfill() { }
|
public void OnTextureFloodfill() { }
|
||||||
public void OnInsert() { }
|
public void OnInsert() { }
|
||||||
|
@ -721,6 +723,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public void ApplyTexture(string texture) { }
|
public void ApplyTexture(string texture) { }
|
||||||
public void ApplyUpperUnpegged(bool set) { }
|
public void ApplyUpperUnpegged(bool set) { }
|
||||||
public void ApplyLowerUnpegged(bool set) { }
|
public void ApplyLowerUnpegged(bool set) { }
|
||||||
|
public void ApplyLineFlag(Linedef line, string flag, string name) { }
|
||||||
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight, bool stopatselected) { } //mxd
|
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight, bool stopatselected) { } //mxd
|
||||||
public virtual void OnPaintSelectEnd() { } // biwa
|
public virtual void OnPaintSelectEnd() { } // biwa
|
||||||
|
|
||||||
|
|
|
@ -252,6 +252,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public void OnTextureFit(FitTextureOptions options) { } //mxd
|
public void OnTextureFit(FitTextureOptions options) { } //mxd
|
||||||
public void OnToggleUpperUnpegged() { }
|
public void OnToggleUpperUnpegged() { }
|
||||||
public void OnToggleLowerUnpegged() { }
|
public void OnToggleLowerUnpegged() { }
|
||||||
|
public void OnTogglePegMidtexture() { }
|
||||||
|
public void OnToggleSlopeSkew() { }
|
||||||
public void OnResetTextureOffset() { }
|
public void OnResetTextureOffset() { }
|
||||||
public void OnResetLocalTextureOffset() { } //mxd
|
public void OnResetLocalTextureOffset() { } //mxd
|
||||||
public void OnProcess(long deltatime) { }
|
public void OnProcess(long deltatime) { }
|
||||||
|
@ -260,6 +262,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public void ApplyTexture(string texture) { }
|
public void ApplyTexture(string texture) { }
|
||||||
public void ApplyUpperUnpegged(bool set) { }
|
public void ApplyUpperUnpegged(bool set) { }
|
||||||
public void ApplyLowerUnpegged(bool set) { }
|
public void ApplyLowerUnpegged(bool set) { }
|
||||||
|
public void ApplyLineFlag(Linedef line, string flag, string name) { }
|
||||||
public string GetTextureName() { return ""; }
|
public string GetTextureName() { return ""; }
|
||||||
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight, bool stopatselected) { } //mxd
|
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight, bool stopatselected) { } //mxd
|
||||||
public virtual void OnPaintSelectBegin() { } // biwa
|
public virtual void OnPaintSelectBegin() { } // biwa
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#region ================== Namespaces
|
#region ================== Namespaces
|
||||||
|
|
||||||
|
using CodeImp.DoomBuilder.Map;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -51,6 +52,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
void OnTextureFloodfill();
|
void OnTextureFloodfill();
|
||||||
void OnToggleUpperUnpegged();
|
void OnToggleUpperUnpegged();
|
||||||
void OnToggleLowerUnpegged();
|
void OnToggleLowerUnpegged();
|
||||||
|
void OnTogglePegMidtexture();
|
||||||
|
void OnToggleSlopeSkew();
|
||||||
void OnProcess(long deltatime);
|
void OnProcess(long deltatime);
|
||||||
void OnInsert();
|
void OnInsert();
|
||||||
void OnDelete();
|
void OnDelete();
|
||||||
|
@ -61,6 +64,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
void ApplyTexture(string texture);
|
void ApplyTexture(string texture);
|
||||||
void ApplyUpperUnpegged(bool set);
|
void ApplyUpperUnpegged(bool set);
|
||||||
void ApplyLowerUnpegged(bool set);
|
void ApplyLowerUnpegged(bool set);
|
||||||
|
void ApplyLineFlag(Linedef line, string flag, string name);
|
||||||
|
|
||||||
// Other methods
|
// Other methods
|
||||||
string GetTextureName();
|
string GetTextureName();
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#region ================== Namespaces
|
#region ================== Namespaces
|
||||||
|
|
||||||
|
using CodeImp.DoomBuilder.Map;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -50,6 +51,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public void OnTextureFloodfill() { }
|
public void OnTextureFloodfill() { }
|
||||||
public void OnToggleUpperUnpegged() { }
|
public void OnToggleUpperUnpegged() { }
|
||||||
public void OnToggleLowerUnpegged() { }
|
public void OnToggleLowerUnpegged() { }
|
||||||
|
public void OnTogglePegMidtexture() { }
|
||||||
|
public void OnToggleSlopeSkew() { }
|
||||||
public void OnProcess(long deltatime) { }
|
public void OnProcess(long deltatime) { }
|
||||||
public void OnInsert() { }
|
public void OnInsert() { }
|
||||||
public void OnDelete() { }
|
public void OnDelete() { }
|
||||||
|
@ -58,6 +61,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
public void ApplyTexture(string texture) { }
|
public void ApplyTexture(string texture) { }
|
||||||
public void ApplyUpperUnpegged(bool set) { }
|
public void ApplyUpperUnpegged(bool set) { }
|
||||||
public void ApplyLowerUnpegged(bool set) { }
|
public void ApplyLowerUnpegged(bool set) { }
|
||||||
|
public void ApplyLineFlag(Linedef line, string flag, string name) { }
|
||||||
public string GetTextureName() { return ""; }
|
public string GetTextureName() { return ""; }
|
||||||
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight, bool stopatselected) { } //mxd
|
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight, bool stopatselected) { } //mxd
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue