Pivot handles can now be set with the normal action to edit objects (no additional hotkey needed)

This commit is contained in:
biwa 2020-02-19 22:43:41 +01:00
parent e4644b7cab
commit 50a73b6af2
3 changed files with 15 additions and 30 deletions

View file

@ -1414,15 +1414,4 @@ togglevisualslopepicking
allowkeys = true;
allowmouse = true;
allowscroll = false;
}
selectvisualslopepivot
{
title = "Select Visual Slope Pivot";
category = "visual";
description = "Selects a visual slope handle to act as the pivot for sloping actions.";
allowkeys = true;
allowmouse = true;
allowscroll = false;
default = 262146; // Alt-RMB
}

View file

@ -3971,24 +3971,6 @@ namespace CodeImp.DoomBuilder.BuilderModes
GetTargetEventReceiver(true).OnPaintSelectEnd();
}
// biwa
[BeginAction("selectvisualslopepivot")]
public void SelectVisualSlopePivot()
{
if (target.picked is VisualSlope)
{
// We can only have one pivot handle, so remove it from all first
foreach (KeyValuePair<Sector, List<VisualSlope>> kvp in allslopehandles)
{
foreach (VisualSlope handle in kvp.Value)
if (target.picked != handle)
handle.Pivot = false;
}
((VisualSlope)target.picked).Pivot = !((VisualSlope)target.picked).Pivot;
}
}
[BeginAction("togglevisualslopepicking")]
public void ToggleVisualSlopePicking()
{

View file

@ -331,6 +331,21 @@ namespace CodeImp.DoomBuilder.VisualModes
}
}
public void OnEditEnd()
{
// We can only have one pivot handle, so remove it from all first
foreach (KeyValuePair<Sector, List<VisualSlope>> kvp in mode.AllSlopeHandles)
{
foreach (VisualSlope handle in kvp.Value)
{
if (handle == mode.HighlightedTarget)
handle.Pivot = !handle.Pivot;
else
handle.Pivot = false;
}
}
}
// Return texture name
public string GetTextureName() { return ""; }
@ -356,7 +371,6 @@ namespace CodeImp.DoomBuilder.VisualModes
public void ApplyLowerUnpegged(bool set) { }
public void SelectNeighbours(bool select, bool withSameTexture, bool withSameHeight) { } //mxd
public virtual void OnPaintSelectEnd() { } // biwa
public void OnEditEnd() { }
public void OnChangeScale(int x, int y) { }
public void OnResetTextureOffset() { }
public void OnResetLocalTextureOffset() { }