Skip to content

Commit

Permalink
Merge pull request #24 from MrGuffels/AlignCameraCommand
Browse files Browse the repository at this point in the history
#23 Resolution
  • Loading branch information
awgil authored Jul 8, 2024
2 parents 3428c2b + a351b28 commit e10bf93
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion vnavmesh/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,12 @@ Opens the debug menu.
/vnav reload → reload current territory's navmesh from cache
/vnav rebuild → rebuild current territory's navmesh from scratch
/vnav aligncamera → toggle aligning camera to movement direction
/vnav aligncamera true|yes|enable → enable aligning camera to movement direction
/vnav aligncamera false|no|disable → disable aligning camera to movement direction
/vnav dtr → toggle dtr status
/vnav collider → toggle collision debug visualization
""",

ShowInHelp = true,
};
Service.CommandManager.AddHandler("/vnav", cmd);
Expand Down Expand Up @@ -159,7 +162,10 @@ private void OnCommand(string command, string arguments)
_navmeshManager.CancelAllQueries();
break;
case "aligncamera":
Service.Config.AlignCameraToMovement ^= true;
if (args.Length == 1)
Service.Config.AlignCameraToMovement ^= true;
else
AlignCameraCommand(args[1]);
Service.Config.NotifyModified();
break;
case "dtr":
Expand Down Expand Up @@ -193,4 +199,14 @@ private void MoveFlagCommand(bool fly)
return;
_asyncMove.MoveTo(pt.Value, fly);
}

private void AlignCameraCommand(string arg)
{
arg = arg.ToLower();
if (arg == "true" || arg == "yes" || arg == "enable")
Service.Config.AlignCameraToMovement = true;
else if (arg == "false" || arg == "no" || arg == "disable")
Service.Config.AlignCameraToMovement = false;
return;
}
}

0 comments on commit e10bf93

Please sign in to comment.