|
3 | 3 | using OpenBveApi.Interface;
|
4 | 4 | using System;
|
5 | 5 | using System.Collections.Generic;
|
| 6 | +using System.Diagnostics; |
6 | 7 | using System.Drawing;
|
7 | 8 | using System.IO;
|
8 | 9 | using System.Text;
|
@@ -462,6 +463,9 @@ public override void ProcessCommand(Translations.Command cmd, double timeElapsed
|
462 | 463 | case MenuTag.MenuControls: // TO CONTROLS MENU
|
463 | 464 | Instance.PushMenu(MenuType.Controls);
|
464 | 465 | break;
|
| 466 | + case MenuTag.MenuTools: // TO CONTROLS MENU |
| 467 | + Instance.PushMenu(MenuType.Tools); |
| 468 | + break; |
465 | 469 | case MenuTag.BackToSim: // OUT OF MENU BACK TO SIMULATION
|
466 | 470 | Reset();
|
467 | 471 | Program.Renderer.CurrentInterface = InterfaceType.Normal;
|
@@ -549,6 +553,9 @@ public override void ProcessCommand(Translations.Command cmd, double timeElapsed
|
549 | 553 | case MenuTag.Options:
|
550 | 554 | Instance.PushMenu(MenuType.Options);
|
551 | 555 | break;
|
| 556 | + case MenuTag.Tools: |
| 557 | + Instance.PushMenu(MenuType.Tools); |
| 558 | + break; |
552 | 559 | case MenuTag.RouteList: // TO ROUTE LIST MENU
|
553 | 560 | Instance.PushMenu(MenuType.RouteList);
|
554 | 561 | routeDescriptionBox.Text = Translations.GetInterfaceString(HostApplication.OpenBve, new[] {"errors","route_please_select"});
|
@@ -707,6 +714,42 @@ public override void ProcessCommand(Translations.Command cmd, double timeElapsed
|
707 | 714 | previousSwitches.Insert(0, ns);
|
708 | 715 | Instance.PushMenu(Instance.Menus[CurrMenu].Type, 0, true);
|
709 | 716 | break;
|
| 717 | + case MenuTag.ObjectViewer: |
| 718 | + string dir = AppDomain.CurrentDomain.BaseDirectory; |
| 719 | + string runCmd = Path.CombineFile(dir, "ObjectViewer.exe"); |
| 720 | + switch (Program.CurrentHost.Platform) |
| 721 | + { |
| 722 | + case HostPlatform.MicrosoftWindows: |
| 723 | + case HostPlatform.WINE: |
| 724 | + // nothing to do |
| 725 | + break; |
| 726 | + case HostPlatform.AppleOSX: |
| 727 | + runCmd = "/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono " + runCmd; |
| 728 | + break; |
| 729 | + default: |
| 730 | + runCmd = "mono " + runCmd; |
| 731 | + break; |
| 732 | + } |
| 733 | + Process.Start(new ProcessStartInfo(runCmd) { UseShellExecute = false }); |
| 734 | + break; |
| 735 | + case MenuTag.RouteViewer: |
| 736 | + dir = AppDomain.CurrentDomain.BaseDirectory; |
| 737 | + runCmd = Path.CombineFile(dir, "RouteViewer.exe"); |
| 738 | + switch (Program.CurrentHost.Platform) |
| 739 | + { |
| 740 | + case HostPlatform.MicrosoftWindows: |
| 741 | + case HostPlatform.WINE: |
| 742 | + // nothing to do |
| 743 | + break; |
| 744 | + case HostPlatform.AppleOSX: |
| 745 | + runCmd = "/Library/Frameworks/Mono.framework/Versions/Current/Commands/mono " + runCmd; |
| 746 | + break; |
| 747 | + default: |
| 748 | + runCmd = "mono " + runCmd; |
| 749 | + break; |
| 750 | + } |
| 751 | + Process.Start(new ProcessStartInfo(runCmd) { UseShellExecute = false }); |
| 752 | + break; |
710 | 753 | }
|
711 | 754 | }
|
712 | 755 | else if (menu.Items[menu.Selection] is MenuOption opt)
|
|
0 commit comments