Visual mode, UDMF: added "Scale Texture Up (X)", "Scale Texture Down (X)", "Scale Texture Up (Y)", "Scale Texture Down (Y)" actions. Default keys are Num6, Num4, Num8, Num5.

Visual mode, UDMF: renamed "Rotate Thing Clockwise" and "Rotate Thing Counterclockwise" actions to "Rotate Clockwise" and "Rotate Counterclockwise". These actions can now be used to change rotation of floor/ceiling textures.
Visual mode, UDMF: "Reset Texture Offsets" action now also resets sidedef's scale and floor/ceiling's scale and rotation.
Visual mode, UDMF: control line's OffsetX and OffsetY were not taken into account when calculating texture offsets of 3d floors' sides.
Visual mode, UDMF: fixed a ton of bugs in Auto align functions.
Visual mode, UDMF: when using "Move Texture Left/Right/Up/Down by 1" actions texture offsets were not updated properly when texture's scale was < 1.0.
Visual mode, UDMF: OffsetX and OffsetY were not taken into account in "Fit Texture Width/Height" actions.
Dockers Panel: added Pin/Unpin button, which acts the same as "Preferences -> Interface -> Side panels -> Auto hide" checkbox.
Texture size labels can now be disabled by unchecking "Preferences -> Interface -> Show texture and flat sizes in browsers" checkbox.
Texture size labels now are not shown for unknown textures.
Most of texture size labels had incorrect bg color.
ZDoom_linedefs.cfg: action specials 223 and 224 had incorrect Arg0.
This commit is contained in:
MaxED 2013-06-24 14:21:13 +00:00
parent 8ebd348e44
commit b77b8e61d9
33 changed files with 657 additions and 336 deletions

View file

@ -61,8 +61,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
private float dragstartanglexy;
private float dragstartanglez;
private Vector3D dragorigin;
//private Vector3D deltaxy;
//private Vector3D deltaz;
private int startoffsetx;
private int startoffsety;
protected bool uvdragging;
@ -95,6 +93,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This changes the height
protected abstract void ChangeHeight(int amount);
protected abstract void ChangeTextureScale(float incrementX, float incrementY); //mxd
public virtual void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight) { } //mxd
// This swaps triangles so that the plane faces the other way
@ -678,6 +677,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Texture offset change
public virtual void OnChangeTextureOffset(int horizontal, int vertical, bool doSurfaceAngleCorrection)
{
if(horizontal == 0 && vertical == 0) return; //mxd
//mxd
if (!General.Map.UDMF) {
General.ShowErrorMessage("Floor/ceiling texture offsets cannot be changed in this map format!", MessageBoxButtons.OK);
@ -714,12 +715,59 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Apply offsets
MoveTextureOffset(new Point(-horizontal, -vertical));
mode.SetActionResult("Changed texture offsets by " + (-horizontal) + ", " + (-vertical) + ".");
// Update sector geometry
Sector s = GetControlSector();
if(s.Index != Sector.Sector.Index) {
s.UpdateNeeded = true;
s.UpdateCache();
mode.GetSectorData(s).Update();
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(s);
vs.UpdateSectorGeometry(false);
vs.Rebuild();
}
Sector.Sector.UpdateNeeded = true;
Sector.Sector.UpdateCache();
Sector.UpdateSectorGeometry(false);
Sector.Rebuild();
}
public virtual void OnChangeTextureRotation(float angle) {
if(!General.Map.UDMF) return;
if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket))
undoticket = mode.CreateUndo("Change texture rotation");
string key = (GeometryType == VisualGeometryType.FLOOR ? "rotationfloor" : "rotationceiling");
mode.SetActionResult( (GeometryType == VisualGeometryType.FLOOR ? "Floor" : "Ceiling") + " rotation changed to " + angle);
//set value
Sector s = GetControlSector();
UDMFTools.SetFloat(s.Fields, key, angle, 0.0f, true);
if(s.Index != Sector.Sector.Index) {
s.UpdateNeeded = true;
s.UpdateCache();
mode.GetSectorData(s).Update();
BaseVisualSector vs = (BaseVisualSector)mode.GetVisualSector(s);
vs.UpdateSectorGeometry(false);
}
Sector.Sector.UpdateNeeded = true;
Sector.Sector.UpdateCache();
Sector.UpdateSectorGeometry(false);
}
//mxd
public virtual void OnChangeTextureScale(float incrementX, float incrementY) {
if(!General.Map.UDMF) return;
if((General.Map.UndoRedo.NextUndo == null) || (General.Map.UndoRedo.NextUndo.TicketID != undoticket))
undoticket = mode.CreateUndo("Change texture scale");
ChangeTextureScale(incrementX, incrementY);
}
#endregion
}