mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-16 17:11:28 +00:00
GZDoom Builder 1.09b:
Added X and Y position controls to Edit Thing menu. Added "Place selected Things at cursor's position" action.
This commit is contained in:
parent
62bd1a6b43
commit
254ffeb610
13 changed files with 787 additions and 610 deletions
30
CompileHelp.bat
Normal file
30
CompileHelp.bat
Normal file
|
@ -0,0 +1,30 @@
|
|||
@ECHO OFF
|
||||
ECHO.
|
||||
ECHO Compiling HTML Help file...
|
||||
ECHO.
|
||||
IF EXIST "Build\Refmanual.chm" DEL /F /Q "Build\Refmanual.chm" > NUL
|
||||
"c:\Program Files (x86)\HTML Help Workshop\hhc" Help\Refmanual.hhp
|
||||
IF %ERRORLEVEL% NEQ 1 GOTO ERRORFAIL
|
||||
IF NOT EXIST "Build\Refmanual.chm" GOTO FILEFAIL
|
||||
|
||||
ECHO.
|
||||
ECHO. BUILD DONE !
|
||||
ECHO.
|
||||
PAUSE > NUL
|
||||
GOTO LEAVE
|
||||
|
||||
:ERRORFAIL
|
||||
ECHO.
|
||||
ECHO. BUILD FAILED (Tool returned error)
|
||||
ECHO.
|
||||
PAUSE > NUL
|
||||
GOTO LEAVE
|
||||
|
||||
:FILEFAIL
|
||||
ECHO.
|
||||
ECHO. BUILD FAILED (Output file was not built)
|
||||
ECHO.
|
||||
PAUSE > NUL
|
||||
GOTO LEAVE
|
||||
|
||||
:LEAVE
|
|
@ -166,25 +166,31 @@
|
|||
<tr>
|
||||
<td><a id="movething"></a>Move Thing Left</td>
|
||||
<td><div align="center">Ctrl-Left</div></td>
|
||||
<td>Moves selected Things left in Visual Modes.</td>
|
||||
<td>Moves selected Things left in Visual Modes. Movement ammount is based on current grid size.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></a>Move Thing Right</td>
|
||||
<td>Move Thing Right</td>
|
||||
<td><div align="center">Ctrl-Right</div></td>
|
||||
<td>Moves selected Things right in Visual Modes.</td>
|
||||
<td>Moves selected Things right in Visual Modes. Movement ammount is based on current grid size.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></a>Move Thing Forward</td>
|
||||
<td>Move Thing Forward</td>
|
||||
<td><div align="center">Ctrl-Up</div></td>
|
||||
<td>Moves selected Things away from camera in Visual Modes.</td>
|
||||
<td>Moves selected Things away from camera in Visual Modes. Movement ammount is based on current grid size.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></a>Move Thing Backward</td>
|
||||
<td>Move Thing Backward</td>
|
||||
<td><div align="center">Ctrl-Down</div></td>
|
||||
<td>Moves selected Things closer to camera in Visual Modes.</td>
|
||||
<td>Moves selected Things closer to camera in Visual Modes. Movement ammount is based on current grid size.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a id="movethingtocursor"></a>Move Thing To Cursor Location</td>
|
||||
<td><div align="center">Ctrl + Middle-Click</div></td>
|
||||
<td>Moves selected Things to cursor location preserving relative offsets in Visual Modes.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
|
|
@ -25,10 +25,11 @@
|
|||
<li>Partial <a href="gz_gldefs.html">GLDEFS</a> and <a href="gz_mapinfo.html">(Z)MAPINFO support.</a></li>
|
||||
<li>Fog rendering (including colored fog in maps in UDMF format).</li>
|
||||
<li><a href="gz_gldefs.html">MD2 and MD3 models</a> rendering in 2D and 3D modes.</li>
|
||||
<li><a href="gz_drawrect.html">Draw Rectangle</a>, <a href="gz_drawellipse.html">Draw Ellipse</a> and <a href="gz_drawbridge.html">Bridge</a> modes.</li>
|
||||
<li><a href="gz_actions.html#newtestmap">"Test Map from current position" feature.</a></li>
|
||||
<li><a href="gz_settings.html">"Sync camera position between 2D and 3D modes" feature.</a></li>
|
||||
<li><a href="gz_actions.html#movething">"Move Things horizontally in Visual Modes" feature.</a></li>
|
||||
<li><a href="gz_mode_drawrect.html">Draw Rectangle</a>, <a href="gz_mode_drawellipse.html">Draw Ellipse</a> and <a href="gz_mode_drawbridge.html">Bridge</a> modes.</li>
|
||||
<li><a href="gz_actions.html#newtestmap">"Test Map from current position"</a> feature.</li>
|
||||
<li><a href="gz_settings.html">"Sync camera position between 2D and 3D modes"</a> feature.</li>
|
||||
<li><a href="gz_actions.html#movething">"Move Things horizontally in Visual Modes"</a> feature.</li>
|
||||
<li><a href="gz_actions.html#movethingtocursor">"Place Things at cursor position in Visual Modes"</a> feature.</li>
|
||||
<li>PNG image format support.</li>
|
||||
<li><a href="gz_plug_colorpicker.html">Color Picker plugin.</a></li>
|
||||
<li><a href="gz_plug_udmfcontrols.html">UDMF Controls plugin.</a></li>
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
<li><a href="gz_plugins.html">Plugins</a></li>
|
||||
<li><a href="gz_faq.html">Frequently asked questions</a></li>
|
||||
</ul>
|
||||
<img style="float:left; margin-right:10px; margin-top:18px" src="gz_mxd_avatar.png"/>
|
||||
<h2>Notice from author:</h2>
|
||||
English is not my first language, so there most likely are things which are explained in a strange or grammatically incorrect way. If you notice such things, please write me a <a href="http://forum.zdoom.org/ucp.php?i=pm&mode=compose&u=7012">personal message</a>, or leave a comment in the <a href="http://forum.zdoom.org/viewtopic.php?f=3&t=32392">Official GZDoom Builder thread</a> at zdoom.org.
|
||||
</p>
|
||||
|
|
BIN
Help/gz_mxd_avatar.png
Normal file
BIN
Help/gz_mxd_avatar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
|
@ -842,7 +842,7 @@ showerrors
|
|||
/////////////////////////
|
||||
gztogglemodels
|
||||
{
|
||||
title = "Toggle models rendering";
|
||||
title = "Toggle models rendering";
|
||||
category = "gzdoombuilder";
|
||||
description = "Toggles models rendering.";
|
||||
allowkeys = true;
|
||||
|
@ -852,7 +852,7 @@ gztogglemodels
|
|||
|
||||
gztogglelights
|
||||
{
|
||||
title = "Toggle dynamic lights rendering";
|
||||
title = "Toggle dynamic lights rendering";
|
||||
category = "gzdoombuilder";
|
||||
description = "Toggles dynamic lights rendering.";
|
||||
allowkeys = true;
|
||||
|
@ -862,7 +862,7 @@ gztogglelights
|
|||
|
||||
gztogglelightsanimation
|
||||
{
|
||||
title = "Toggle dynamic lights animation";
|
||||
title = "Toggle dynamic lights animation";
|
||||
category = "gzdoombuilder";
|
||||
description = "Toggles dynamic lights animation.";
|
||||
allowkeys = true;
|
||||
|
@ -872,7 +872,7 @@ gztogglelightsanimation
|
|||
|
||||
gztogglefog
|
||||
{
|
||||
title = "Toggle fog rendering";
|
||||
title = "Toggle fog rendering";
|
||||
category = "gzdoombuilder";
|
||||
description = "Toggles fog rendering.";
|
||||
allowkeys = true;
|
||||
|
@ -882,7 +882,7 @@ gztogglefog
|
|||
|
||||
gzdrawselectedmodelsonly
|
||||
{
|
||||
title = "Render selected/all models";
|
||||
title = "Render selected/all models";
|
||||
category = "gzdoombuilder";
|
||||
description = "Render all models / render only models for selected things.";
|
||||
allowkeys = true;
|
||||
|
@ -892,7 +892,7 @@ gzdrawselectedmodelsonly
|
|||
|
||||
gztogglefx
|
||||
{
|
||||
title = "Toggle GZDoom effects";
|
||||
title = "Toggle GZDoom effects";
|
||||
category = "gzdoombuilder";
|
||||
description = "Toggles models, dynamic lights and fog rendering.";
|
||||
allowkeys = true;
|
||||
|
@ -900,10 +900,12 @@ gztogglefx
|
|||
allowscroll = false;
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
//GZDOOMBUILDER MENU ACTIONS//
|
||||
//////////////////////////////
|
||||
gzreloadmodeldef
|
||||
{
|
||||
title = "Reload MODELDEF";
|
||||
title = "Reload MODELDEF";
|
||||
category = "tools";
|
||||
description = "Reloads MODELDEF. Useful when resource files have been changed outside of Doom Builder.";
|
||||
allowkeys = true;
|
||||
|
@ -914,7 +916,7 @@ gzreloadmodeldef
|
|||
|
||||
gzreloadgldefs
|
||||
{
|
||||
title = "Reload GLDEFS";
|
||||
title = "Reload GLDEFS";
|
||||
category = "tools";
|
||||
description = "Reloads GLDEFS. Useful when resource files have been changed outside of Doom Builder.";
|
||||
allowkeys = true;
|
||||
|
@ -925,7 +927,7 @@ gzreloadgldefs
|
|||
|
||||
gzreloadmapinfo
|
||||
{
|
||||
title = "Reload (Z)MAPINFO";
|
||||
title = "Reload (Z)MAPINFO";
|
||||
category = "tools";
|
||||
description = "Reloads (Z)MAPINFO. Useful when resource files have been changed outside of Doom Builder.";
|
||||
allowkeys = true;
|
||||
|
@ -934,7 +936,9 @@ gzreloadmapinfo
|
|||
default = 131190;
|
||||
}
|
||||
|
||||
//THING MOVEMENT//
|
||||
/////////////////////////////////////////
|
||||
//GZDOOMBUILDER EXTENDED THING MOVEMENT//
|
||||
/////////////////////////////////////////
|
||||
movethingleft
|
||||
{
|
||||
title = "Move Thing Left";
|
||||
|
@ -981,4 +985,15 @@ movethingback
|
|||
allowscroll = true;
|
||||
repeat = true;
|
||||
default = 131112;
|
||||
}
|
||||
|
||||
placethingatcursor
|
||||
{
|
||||
title = "Move Thing To Cursor Location";
|
||||
category = "visual";
|
||||
description = "Moves selected Things to cursor location preserving relative offsets in Visual Modes.";
|
||||
allowkeys = true;
|
||||
allowmouse = true;
|
||||
allowscroll = false;
|
||||
default = 131076;
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 229 KiB |
|
@ -405,26 +405,41 @@ namespace CodeImp.DoomBuilder.VisualModes
|
|||
//mxd
|
||||
[BeginAction("movethingleft", BaseAction = true)]
|
||||
protected void moveSelectedThingsLeft() {
|
||||
moveSelectedThings(new Vector2D(0f, -General.Map.Grid.GridSize));
|
||||
moveSelectedThings(new Vector2D(0f, -General.Map.Grid.GridSize), false);
|
||||
}
|
||||
|
||||
[BeginAction("movethingright", BaseAction = true)]
|
||||
protected void moveSelectedThingsRight() {
|
||||
moveSelectedThings(new Vector2D(0f, General.Map.Grid.GridSize));
|
||||
moveSelectedThings(new Vector2D(0f, General.Map.Grid.GridSize), false);
|
||||
}
|
||||
|
||||
[BeginAction("movethingfwd", BaseAction = true)]
|
||||
protected void moveSelectedThingsForward() {
|
||||
moveSelectedThings(new Vector2D(-General.Map.Grid.GridSize, 0f));
|
||||
moveSelectedThings(new Vector2D(-General.Map.Grid.GridSize, 0f), false);
|
||||
}
|
||||
|
||||
[BeginAction("movethingback", BaseAction = true)]
|
||||
protected void moveSelectedThingsBackward() {
|
||||
moveSelectedThings(new Vector2D(General.Map.Grid.GridSize, 0f));
|
||||
moveSelectedThings(new Vector2D(General.Map.Grid.GridSize, 0f), false);
|
||||
}
|
||||
|
||||
[BeginAction("placethingatcursor", BaseAction = true)]
|
||||
protected void placeThingAtCursor() {
|
||||
Vector3D start = General.Map.VisualCamera.Position;
|
||||
Vector3D delta = General.Map.VisualCamera.Target - General.Map.VisualCamera.Position;
|
||||
delta = delta.GetFixedLength(General.Settings.ViewDistance * 0.98f);
|
||||
VisualPickResult target = PickObject(start, start + delta);
|
||||
|
||||
if (target.picked == null) {
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Cannot place Thing here");
|
||||
return;
|
||||
}
|
||||
|
||||
moveSelectedThings(new Vector2D((float)Math.Round(target.hitpos.x), (float)Math.Round(target.hitpos.y)), true);
|
||||
}
|
||||
|
||||
//should move selected things in specified direction
|
||||
protected abstract void moveSelectedThings(Vector2D direction);
|
||||
protected abstract void moveSelectedThings(Vector2D direction, bool absolutePosition);
|
||||
//end of mxd :)
|
||||
|
||||
#endregion
|
||||
|
|
1125
Source/Core/Windows/ThingEditForm.Designer.cs
generated
1125
Source/Core/Windows/ThingEditForm.Designer.cs
generated
File diff suppressed because it is too large
Load diff
|
@ -47,6 +47,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
private List<TreeNode> nodes;
|
||||
private ThingTypeInfo thinginfo;
|
||||
private bool preventchanges = false;
|
||||
|
||||
//mxd
|
||||
private Vector2D initialPosition; //initial position of a thing used to fill posX and posY fields
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -119,6 +122,13 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Coordination
|
||||
angle.Text = ft.AngleDoom.ToString();
|
||||
height.Text = ((int)ft.Position.z).ToString();
|
||||
|
||||
//mxd
|
||||
initialPosition = ft.Position;
|
||||
posX.Text = ((int)ft.Position.x).ToString();
|
||||
posY.Text = ((int)ft.Position.y).ToString();
|
||||
posX.ButtonStep = General.Map.Grid.GridSize;
|
||||
posY.ButtonStep = General.Map.Grid.GridSize;
|
||||
|
||||
// Action/tags
|
||||
action.Value = ft.Action;
|
||||
|
@ -320,6 +330,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
// Make undo
|
||||
if(things.Count > 1) undodesc = things.Count + " things";
|
||||
General.Map.UndoRedo.CreateUndo("Edit " + undodesc);
|
||||
|
||||
//mxd
|
||||
Vector2D delta = new Vector2D((float)posX.GetResult((int)initialPosition.x) - initialPosition.x, (float)posY.GetResult((int)initialPosition.y) - initialPosition.y);
|
||||
|
||||
// Go for all the things
|
||||
foreach(Thing t in things)
|
||||
|
@ -329,7 +342,9 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
|
||||
// Coordination
|
||||
t.Rotate(angle.GetResult(t.AngleDoom));
|
||||
t.Move(t.Position.x, t.Position.y, (float)height.GetResult((int)t.Position.z));
|
||||
//mxd
|
||||
//t.Move(t.Position.x, t.Position.y, (float)height.GetResult((int)t.Position.z));
|
||||
t.Move(t.Position.x + delta.x, t.Position.y + delta.y, (float)height.GetResult((int)t.Position.z));
|
||||
|
||||
// Apply all flags
|
||||
foreach(CheckBox c in flags.Checkboxes)
|
||||
|
|
|
@ -126,30 +126,12 @@
|
|||
<metadata name="thingtype.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox2.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="groupBox2.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="height.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="angle.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="heightlabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label5.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="label5.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="anglecontrol.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="taglabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -162,18 +144,9 @@
|
|||
<metadata name="label7.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="tabs.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="tabproperties.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="spritetex.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="settingsgroup.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="flags.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
@ -240,12 +213,6 @@
|
|||
<metadata name="fieldslist.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="cancel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="apply.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
|
|
|
@ -426,7 +426,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
}
|
||||
|
||||
//mxd
|
||||
protected override void moveSelectedThings(Vector2D direction) {
|
||||
protected override void moveSelectedThings(Vector2D direction, bool absolutePosition) {
|
||||
List<VisualThing> things = GetSelectedVisualThings(true);
|
||||
|
||||
if (things.Count == 0) {
|
||||
|
@ -434,14 +434,49 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
return;
|
||||
}
|
||||
|
||||
//move things
|
||||
int camAngle = (int)Math.Round(General.Map.VisualCamera.AngleXY * 180 / Math.PI);
|
||||
int sector = (int)(General.ClampAngle(camAngle - 45f) / 90f);
|
||||
direction = direction.GetRotated((float)(sector * Math.PI / 2f));
|
||||
//move things...
|
||||
if (!absolutePosition) { //...relatively (that's easy)
|
||||
int camAngle = (int)Math.Round(General.Map.VisualCamera.AngleXY * 180 / Math.PI);
|
||||
int sector = (int)(General.ClampAngle(camAngle - 45f) / 90f);
|
||||
direction = direction.GetRotated((float)(sector * Math.PI / 2f));
|
||||
|
||||
for (int i = 0; i < things.Count; i++) {
|
||||
BaseVisualThing t = things[i] as BaseVisualThing;
|
||||
t.OnMove(t.Thing.Position + new Vector3D(direction));
|
||||
for (int i = 0; i < things.Count; i++) {
|
||||
BaseVisualThing t = things[i] as BaseVisualThing;
|
||||
t.OnMove(t.Thing.Position + new Vector3D(direction));
|
||||
}
|
||||
} else { //...to specified location preserving relative positioning (that's harder)
|
||||
if (things.Count == 1) {//just move it there
|
||||
BaseVisualThing t = things[0] as BaseVisualThing;
|
||||
t.OnMove(new Vector3D(direction.x, direction.y, t.Thing.Position.z));
|
||||
return;
|
||||
}
|
||||
|
||||
//we need some reference
|
||||
float minX = things[0].Thing.Position.x;
|
||||
float maxX = minX;
|
||||
float minY = things[0].Thing.Position.y;
|
||||
float maxY = minY;
|
||||
|
||||
//get bounding coordinates for selected things
|
||||
for (int i = 1; i < things.Count; i++) {
|
||||
if (things[i].Thing.Position.x < minX)
|
||||
minX = things[i].Thing.Position.x;
|
||||
else if (things[i].Thing.Position.x > maxX)
|
||||
maxX = things[i].Thing.Position.x;
|
||||
|
||||
if (things[i].Thing.Position.y < minY)
|
||||
minY = things[i].Thing.Position.y;
|
||||
else if (things[i].Thing.Position.y > maxY)
|
||||
maxY = things[i].Thing.Position.y;
|
||||
}
|
||||
|
||||
Vector2D selectionCenter = new Vector2D(minX + (maxX - minX) / 2, minY + (maxY - minY) / 2);
|
||||
|
||||
//move them
|
||||
for (int i = 0; i < things.Count; i++) {
|
||||
BaseVisualThing t = things[i] as BaseVisualThing;
|
||||
t.OnMove(new Vector3D(direction.x - (selectionCenter.x - t.Thing.Position.x), direction.y - (selectionCenter.y - t.Thing.Position.y), t.Thing.Position.z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -442,7 +442,7 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
}
|
||||
|
||||
//mxd
|
||||
protected override void moveSelectedThings(Vector2D direction) {
|
||||
protected override void moveSelectedThings(Vector2D direction, bool absolutePosition) {
|
||||
List<VisualThing> things = GetSelectedVisualThings(true);
|
||||
|
||||
if (things.Count == 0) {
|
||||
|
@ -450,14 +450,49 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
|
|||
return;
|
||||
}
|
||||
|
||||
//move things
|
||||
int camAngle = (int)Math.Round(General.Map.VisualCamera.AngleXY * 180 / Math.PI);
|
||||
int sector = (int)(General.ClampAngle(camAngle - 45f) / 90f);
|
||||
direction = direction.GetRotated((float)(sector * Math.PI / 2f));
|
||||
//move things...
|
||||
if (!absolutePosition) { //...relatively (that's easy)
|
||||
int camAngle = (int)Math.Round(General.Map.VisualCamera.AngleXY * 180 / Math.PI);
|
||||
int sector = (int)(General.ClampAngle(camAngle - 45f) / 90f);
|
||||
direction = direction.GetRotated((float)(sector * Math.PI / 2f));
|
||||
|
||||
for (int i = 0; i < things.Count; i++) {
|
||||
BaseVisualThing t = things[i] as BaseVisualThing;
|
||||
t.OnMove(t.Thing.Position + new Vector3D(direction));
|
||||
for (int i = 0; i < things.Count; i++) {
|
||||
BaseVisualThing t = things[i] as BaseVisualThing;
|
||||
t.OnMove(t.Thing.Position + new Vector3D(direction));
|
||||
}
|
||||
} else { //...to specified location preserving relative positioning (that's harder)
|
||||
if (things.Count == 1) {//just move it there
|
||||
BaseVisualThing t = things[0] as BaseVisualThing;
|
||||
t.OnMove(new Vector3D(direction.x, direction.y, t.Thing.Position.z));
|
||||
return;
|
||||
}
|
||||
|
||||
//we need some reference
|
||||
float minX = things[0].Thing.Position.x;
|
||||
float maxX = minX;
|
||||
float minY = things[0].Thing.Position.y;
|
||||
float maxY = minY;
|
||||
|
||||
//get bounding coordinates for selected things
|
||||
for (int i = 1; i < things.Count; i++) {
|
||||
if (things[i].Thing.Position.x < minX)
|
||||
minX = things[i].Thing.Position.x;
|
||||
else if (things[i].Thing.Position.x > maxX)
|
||||
maxX = things[i].Thing.Position.x;
|
||||
|
||||
if (things[i].Thing.Position.y < minY)
|
||||
minY = things[i].Thing.Position.y;
|
||||
else if (things[i].Thing.Position.y > maxY)
|
||||
maxY = things[i].Thing.Position.y;
|
||||
}
|
||||
|
||||
Vector2D selectionCenter = new Vector2D(minX + (maxX - minX) / 2, minY + (maxY - minY) / 2);
|
||||
|
||||
//move them
|
||||
for (int i = 0; i < things.Count; i++) {
|
||||
BaseVisualThing t = things[i] as BaseVisualThing;
|
||||
t.OnMove(new Vector3D(direction.x - (selectionCenter.x - t.Thing.Position.x), direction.y - (selectionCenter.y - t.Thing.Position.y), t.Thing.Position.z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue