NPCWindow.xaml.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. using Content.Client.NPC.HTN;
  2. using Content.Client.UserInterface.Controls;
  3. using Content.Shared.NPC;
  4. using Robust.Client.AutoGenerated;
  5. using Robust.Client.UserInterface.XAML;
  6. namespace Content.Client.NPC;
  7. [GenerateTypedNameReferences]
  8. public sealed partial class NPCWindow : FancyWindow
  9. {
  10. public NPCWindow()
  11. {
  12. RobustXamlLoader.Load(this);
  13. IoCManager.InjectDependencies(this);
  14. var sysManager = IoCManager.Resolve<IEntitySystemManager>();
  15. var htn = sysManager.GetEntitySystem<HTNSystem>();
  16. var path = sysManager.GetEntitySystem<PathfindingSystem>();
  17. NPCThonk.Pressed = htn.EnableOverlay;
  18. PathCrumbs.Pressed = (path.Modes & PathfindingDebugMode.Breadcrumbs) != 0x0;
  19. PathPolys.Pressed = (path.Modes & PathfindingDebugMode.Polys) != 0x0;
  20. PathNeighbors.Pressed = (path.Modes & PathfindingDebugMode.PolyNeighbors) != 0x0;
  21. PathRouteCosts.Pressed = (path.Modes & PathfindingDebugMode.RouteCosts) != 0x0;
  22. PathRoutes.Pressed = (path.Modes & PathfindingDebugMode.Routes) != 0x0;
  23. NPCThonk.OnToggled += args => htn.EnableOverlay = args.Pressed;
  24. PathCrumbs.OnToggled += args => path.Modes ^= PathfindingDebugMode.Breadcrumbs;
  25. PathPolys.OnToggled += args => path.Modes ^= PathfindingDebugMode.Polys;
  26. PathNeighbors.OnToggled += args => path.Modes ^= PathfindingDebugMode.PolyNeighbors;
  27. PathRouteCosts.OnToggled += args => path.Modes ^= PathfindingDebugMode.RouteCosts;
  28. PathRoutes.OnToggled += args => path.Modes ^= PathfindingDebugMode.Routes;
  29. }
  30. }