mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-28 06:42:32 +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")]
|
[BeginAction("fliplinedefs")]
|
||||||
public void FlipLinedefs()
|
public void FlipLinedefs()
|
||||||
{
|
{
|
||||||
// Any selected lines?
|
// No selected lines?
|
||||||
ICollection<Linedef> selected = General.Map.Map.GetSelectedLinedefs(true);
|
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)
|
if(selected.Count > 0)
|
||||||
{
|
{
|
||||||
// Make undo
|
// Make undo
|
||||||
|
@ -674,8 +686,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
l.FlipSidedefs();
|
l.FlipSidedefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove selection if only one was selected
|
||||||
|
if(selected.Count == 1)
|
||||||
|
{
|
||||||
|
foreach(Linedef ld in selected) ld.Selected = false;
|
||||||
|
selected.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
// Redraw
|
// Redraw
|
||||||
General.Map.IsChanged = true;
|
General.Map.IsChanged = true;
|
||||||
|
General.Interface.RefreshInfo();
|
||||||
General.Interface.RedrawDisplay();
|
General.Interface.RedrawDisplay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -683,8 +703,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
[BeginAction("flipsidedefs")]
|
[BeginAction("flipsidedefs")]
|
||||||
public void FlipSidedefs()
|
public void FlipSidedefs()
|
||||||
{
|
{
|
||||||
// Any selected lines?
|
// No selected lines?
|
||||||
ICollection<Linedef> selected = General.Map.Map.GetSelectedLinedefs(true);
|
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)
|
if(selected.Count > 0)
|
||||||
{
|
{
|
||||||
// Make undo
|
// Make undo
|
||||||
|
@ -697,10 +729,21 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
||||||
foreach(Linedef l in selected)
|
foreach(Linedef l in selected)
|
||||||
{
|
{
|
||||||
l.FlipSidedefs();
|
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
|
// Redraw
|
||||||
|
General.Map.Map.Update();
|
||||||
General.Map.IsChanged = true;
|
General.Map.IsChanged = true;
|
||||||
|
General.Interface.RefreshInfo();
|
||||||
General.Interface.RedrawDisplay();
|
General.Interface.RedrawDisplay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -64,6 +64,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
void ShowThingInfo(Thing t);
|
void ShowThingInfo(Thing t);
|
||||||
void ShowVertexInfo(Vertex v);
|
void ShowVertexInfo(Vertex v);
|
||||||
void HideInfo();
|
void HideInfo();
|
||||||
|
void RefreshInfo();
|
||||||
void UpdateCoordinates(Vector2D coords);
|
void UpdateCoordinates(Vector2D coords);
|
||||||
bool Focus();
|
bool Focus();
|
||||||
void SetProcessorState(bool on);
|
void SetProcessorState(bool on);
|
||||||
|
|
|
@ -1985,6 +1985,15 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
modename.Refresh();
|
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
|
// Show linedef info
|
||||||
public void ShowLinedefInfo(Linedef l)
|
public void ShowLinedefInfo(Linedef l)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue