mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
fixed flipping linedefs and sidedefs without selection (only highlight is needed at the very least)
This commit is contained in:
parent
94c62a34a2
commit
895c3b8a00
3 changed files with 55 additions and 2 deletions
|
@ -657,8 +657,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
[BeginAction("fliplinedefs")]
|
||||
public void FlipLinedefs()
|
||||
{
|
||||
// Any selected lines?
|
||||
// No selected lines?
|
||||
ICollection<Linedef> selected = General.Map.Map.GetSelectedLinedefs(true);
|
||||
if(selected.Count == 0)
|
||||
{
|
||||
// Anything highlighted?
|
||||
if(highlighted != null)
|
||||
{
|
||||
// Select the highlighted item
|
||||
highlighted.Selected = true;
|
||||
selected.Add(highlighted);
|
||||
}
|
||||
}
|
||||
|
||||
// Any selected lines?
|
||||
if(selected.Count > 0)
|
||||
{
|
||||
// Make undo
|
||||
|
@ -673,9 +685,17 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
l.FlipVertices();
|
||||
l.FlipSidedefs();
|
||||
}
|
||||
|
||||
// Remove selection if only one was selected
|
||||
if(selected.Count == 1)
|
||||
{
|
||||
foreach(Linedef ld in selected) ld.Selected = false;
|
||||
selected.Clear();
|
||||
}
|
||||
|
||||
// Redraw
|
||||
General.Map.IsChanged = true;
|
||||
General.Interface.RefreshInfo();
|
||||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
}
|
||||
|
@ -683,8 +703,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
[BeginAction("flipsidedefs")]
|
||||
public void FlipSidedefs()
|
||||
{
|
||||
// Any selected lines?
|
||||
// No selected lines?
|
||||
ICollection<Linedef> selected = General.Map.Map.GetSelectedLinedefs(true);
|
||||
if(selected.Count == 0)
|
||||
{
|
||||
// Anything highlighted?
|
||||
if(highlighted != null)
|
||||
{
|
||||
// Select the highlighted item
|
||||
highlighted.Selected = true;
|
||||
selected.Add(highlighted);
|
||||
}
|
||||
}
|
||||
|
||||
// Any selected lines?
|
||||
if(selected.Count > 0)
|
||||
{
|
||||
// Make undo
|
||||
|
@ -697,10 +729,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
foreach(Linedef l in selected)
|
||||
{
|
||||
l.FlipSidedefs();
|
||||
if(l.Front != null) l.Front.Sector.UpdateNeeded = true;
|
||||
if(l.Back != null) l.Back.Sector.UpdateNeeded = true;
|
||||
}
|
||||
|
||||
// Remove selection if only one was selected
|
||||
if(selected.Count == 1)
|
||||
{
|
||||
foreach(Linedef ld in selected) ld.Selected = false;
|
||||
selected.Clear();
|
||||
}
|
||||
|
||||
// Redraw
|
||||
General.Map.Map.Update();
|
||||
General.Map.IsChanged = true;
|
||||
General.Interface.RefreshInfo();
|
||||
General.Interface.RedrawDisplay();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
void ShowThingInfo(Thing t);
|
||||
void ShowVertexInfo(Vertex v);
|
||||
void HideInfo();
|
||||
void RefreshInfo();
|
||||
void UpdateCoordinates(Vector2D coords);
|
||||
bool Focus();
|
||||
void SetProcessorState(bool on);
|
||||
|
|
|
@ -1985,6 +1985,15 @@ namespace CodeImp.DoomBuilder.Windows
|
|||
modename.Refresh();
|
||||
}
|
||||
|
||||
// This refreshes info
|
||||
public void RefreshInfo()
|
||||
{
|
||||
if(lastinfoobject is Vertex) ShowVertexInfo(lastinfoobject as Vertex);
|
||||
else if(lastinfoobject is Linedef) ShowLinedefInfo(lastinfoobject as Linedef);
|
||||
else if(lastinfoobject is Sector) ShowSectorInfo(lastinfoobject as Sector);
|
||||
else if(lastinfoobject is Thing) ShowThingInfo(lastinfoobject as Thing);
|
||||
}
|
||||
|
||||
// Show linedef info
|
||||
public void ShowLinedefInfo(Linedef l)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue