mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-30 07:31:36 +00:00
Visual Mode: added "Apply Camera Rotation To Things" action that applies the Visual Mode's current camera pitch and yaw to the selected things. No default key bound
This commit is contained in:
parent
8064bc63b7
commit
e6a7751c2d
2 changed files with 33 additions and 0 deletions
|
@ -1445,3 +1445,13 @@ archbetweenhandles
|
||||||
allowmouse = true;
|
allowmouse = true;
|
||||||
allowscroll = false;
|
allowscroll = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
applycamerarotationtothings
|
||||||
|
{
|
||||||
|
title = "Apply Camera Rotation To Things";
|
||||||
|
category = "visual";
|
||||||
|
description = "Applies the Visual Mode's current camera pitch and yaw to the selected things.";
|
||||||
|
allowkeys = true;
|
||||||
|
allowmouse = true;
|
||||||
|
allowscroll = false;
|
||||||
|
}
|
|
@ -4318,6 +4318,29 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Applies the Visual Mode's current camera pitch and yaw to the selected things
|
||||||
|
/// </summary>
|
||||||
|
[BeginAction("applycamerarotationtothings")]
|
||||||
|
public void ApplyCameraRotationToThings()
|
||||||
|
{
|
||||||
|
List<Thing> things = GetSelectedThings();
|
||||||
|
|
||||||
|
if(things.Count == 0)
|
||||||
|
{
|
||||||
|
General.Interface.DisplayStatus(StatusType.Warning, "Can't apply camera rotation to things: no things selected.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
General.Map.UndoRedo.CreateUndo("Apply camera rotation to things");
|
||||||
|
|
||||||
|
foreach (Thing t in things)
|
||||||
|
{
|
||||||
|
t.Rotate(General.Map.VisualCamera.AngleXY);
|
||||||
|
t.SetPitch((int)Angle2D.RadToDeg(-General.Map.VisualCamera.AngleZ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ================== Texture Alignment
|
#region ================== Texture Alignment
|
||||||
|
|
Loading…
Reference in a new issue