Restore some thing-related functionality for SRB2

This commit is contained in:
spherallic 2023-01-08 13:05:33 +01:00
parent 2cda8bd933
commit 3f70ad23f1
3 changed files with 7 additions and 5 deletions

View file

@ -238,7 +238,7 @@ namespace CodeImp.DoomBuilder.Controls
}
//mxd. Flags panel visibility and size
flagsPanel.Visible = (flags.Items.Count > 0);
flagsPanel.Visible = (flags.Items.Count > 0 || flagsvaluelabel.Enabled);
if(flags.Items.Count > 0)
{
Rectangle rect = flags.GetItemRect(0);

View file

@ -1583,7 +1583,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(Thing t in selected)
{
ThingTypeInfo info = General.Map.Data.GetThingInfo(t.SRB2Type);
if(info == null || info.Category == null || info.Category.Arrow == 0)
if (info == null || !info.Arrow)
continue;
int newangle = Angle2D.RealToDoom(Vector2D.GetAngle(mousemappos, t.Position) + Angle2D.PI);
@ -1597,7 +1597,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
foreach(Thing t in selected)
{
ThingTypeInfo info = General.Map.Data.GetThingInfo(t.SRB2Type);
if(info == null || info.Category == null || info.Category.Arrow == 0)
if (info == null || !info.Arrow)
continue;
int newangle = Angle2D.RealToDoom(Vector2D.GetAngle(mousemappos, t.Position));
@ -1667,9 +1667,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Change angle
foreach(Thing t in selected)
{
int loops = (General.Map.SRB2) ? t.AngleDoom - (t.AngleDoom % 360) : 0;
int newangle = t.AngleDoom + increment;
if(General.Map.Config.DoomThingRotationAngles) newangle = newangle / 45 * 45;
t.Rotate(General.ClampAngle(newangle));
t.Rotate(General.ClampAngle(newangle) + loops);
}
// Redraw screen

View file

@ -3483,10 +3483,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(obj is BaseVisualThing)
{
BaseVisualThing t = (BaseVisualThing)obj;
int loops = (General.Map.SRB2) ? t.Thing.AngleDoom - (t.Thing.AngleDoom % 360) : 0;
int newangle = t.Thing.AngleDoom + thingangleincrement;
if(General.Map.Config.DoomThingRotationAngles) newangle = newangle / 45 * 45;
t.SetAngle(General.ClampAngle(newangle));
t.SetAngle(General.ClampAngle(newangle) + loops);
// Visual sectors may be affected by this thing...
if(thingdata.ContainsKey(t.Thing))