mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-22 11:51:42 +00:00
- Slope handles are not shown anymore when showing selection is disabled
- Smart pivot handles are now shown for the highlighted slope handle
This commit is contained in:
parent
37e8154556
commit
afef349220
3 changed files with 35 additions and 9 deletions
|
@ -640,7 +640,7 @@ namespace CodeImp.DoomBuilder.Rendering
|
||||||
|
|
||||||
private void RenderSlopeHandles()
|
private void RenderSlopeHandles()
|
||||||
{
|
{
|
||||||
if (visualslopehandles == null) return;
|
if (visualslopehandles == null || !showselection) return;
|
||||||
|
|
||||||
graphics.SetAlphaBlendEnable(true);
|
graphics.SetAlphaBlendEnable(true);
|
||||||
graphics.SetAlphaTestEnable(false);
|
graphics.SetAlphaTestEnable(false);
|
||||||
|
|
|
@ -472,11 +472,31 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
// Should we update the info on panels?
|
// Should we update the info on panels?
|
||||||
bool updateinfo = (newtarget.picked != target.picked);
|
bool updateinfo = (newtarget.picked != target.picked);
|
||||||
|
|
||||||
|
if (updateinfo)
|
||||||
|
{
|
||||||
|
if (newtarget.picked is VisualSidedefSlope)
|
||||||
|
{
|
||||||
|
// Get the smart pivot handle for the targeted slope handle, so that it can be drawn
|
||||||
|
VisualSidedefSlope handle = VisualSidedefSlope.GetSmartPivotHandle((VisualSidedefSlope)newtarget.picked, this);
|
||||||
|
if (handle != null)
|
||||||
|
handle.SmartPivot = true;
|
||||||
|
}
|
||||||
|
else if(target.picked is VisualSidedefSlope)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Clear smart pivot handles, otherwise it will keep being displayed
|
||||||
|
foreach (KeyValuePair<Sector, List<VisualSlope>> kvp in allslopehandles)
|
||||||
|
foreach (VisualSidedefSlope checkhandle in kvp.Value)
|
||||||
|
checkhandle.SmartPivot = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Apply new target
|
// Apply new target
|
||||||
target = newtarget;
|
target = newtarget;
|
||||||
|
|
||||||
// Show target info
|
// Show target info
|
||||||
if(updateinfo) ShowTargetInfo();
|
if (updateinfo)
|
||||||
|
ShowTargetInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This shows the picked target information
|
// This shows the picked target information
|
||||||
|
@ -1433,7 +1453,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
List<VisualSlope> handles = new List<VisualSlope>();
|
List<VisualSlope> handles = new List<VisualSlope>();
|
||||||
foreach (KeyValuePair<Sector, List<VisualSlope>> kvp in allslopehandles)
|
foreach (KeyValuePair<Sector, List<VisualSlope>> kvp in allslopehandles)
|
||||||
foreach (VisualSlope handle in kvp.Value)
|
foreach (VisualSlope handle in kvp.Value)
|
||||||
if (handle.Selected || handle.Pivot || /* handle.SmartPivot || */ target.picked == handle)
|
if (handle.Selected || handle.Pivot || handle.SmartPivot || target.picked == handle)
|
||||||
handles.Add(handle);
|
handles.Add(handle);
|
||||||
|
|
||||||
renderer.SetVisualSlopeHandles(handles);
|
renderer.SetVisualSlopeHandles(handles);
|
||||||
|
@ -4003,7 +4023,14 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
if (pickingmode != PickingMode.SlopeHandles)
|
if (pickingmode != PickingMode.SlopeHandles)
|
||||||
pickingmode = PickingMode.SlopeHandles;
|
pickingmode = PickingMode.SlopeHandles;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
pickingmode = PickingMode.Default;
|
pickingmode = PickingMode.Default;
|
||||||
|
|
||||||
|
// Clear smart pivot handles, otherwise it will keep being displayed
|
||||||
|
foreach (KeyValuePair<Sector, List<VisualSlope>> kvp in allslopehandles)
|
||||||
|
foreach (VisualSidedefSlope checkhandle in kvp.Value)
|
||||||
|
checkhandle.SmartPivot = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[BeginAction("slopebetweenhandles")]
|
[BeginAction("slopebetweenhandles")]
|
||||||
|
|
|
@ -164,7 +164,7 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="starthandle">The slope handle to start from (the one we need to find a pivot handle for)</param>
|
/// <param name="starthandle">The slope handle to start from (the one we need to find a pivot handle for)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
internal VisualSidedefSlope GetSmartPivotHandle(VisualSidedefSlope starthandle)
|
public static VisualSidedefSlope GetSmartPivotHandle(VisualSidedefSlope starthandle, BaseVisualMode mode)
|
||||||
{
|
{
|
||||||
VisualSidedefSlope handle = starthandle;
|
VisualSidedefSlope handle = starthandle;
|
||||||
List<VisualSidedefSlope> potentialhandles = new List<VisualSidedefSlope>();
|
List<VisualSidedefSlope> potentialhandles = new List<VisualSidedefSlope>();
|
||||||
|
@ -207,9 +207,6 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
if (handle == starthandle)
|
if (handle == starthandle)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if(handle != null)
|
|
||||||
handle.SmartPivot = true;
|
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,12 +295,14 @@ namespace CodeImp.DoomBuilder.VisualModes
|
||||||
|
|
||||||
// User didn't set a pivot handle, try to find the smart pivot handle
|
// User didn't set a pivot handle, try to find the smart pivot handle
|
||||||
if(pivothandle == null)
|
if(pivothandle == null)
|
||||||
pivothandle = GetSmartPivotHandle(this);
|
pivothandle = GetSmartPivotHandle(this, mode);
|
||||||
|
|
||||||
// Still no pivot handle, cancle
|
// Still no pivot handle, cancle
|
||||||
if (pivothandle == null)
|
if (pivothandle == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
pivothandle.SmartPivot = true;
|
||||||
|
|
||||||
mode.CreateUndo("Change slope");
|
mode.CreateUndo("Change slope");
|
||||||
|
|
||||||
Plane originalplane = level.plane;
|
Plane originalplane = level.plane;
|
||||||
|
|
Loading…
Reference in a new issue