• Profile image

    Can anyone please tell me how to add another button next to this ToggleMenu button (in Flight/ViewPanel.xml)? I tried everything, but the button doesn't seem to appear.

    <ContentButton name="ToggleMenu" class="view-button audio-btn-click" tooltip="Open the menu" onClick="OnToggleMenuButtonClicked();">

    I found the solution:
    Because ModApi.Ui didn't declare the constant ViewPanel (which contains the Menu button in the flight view), let's extend it and declare:

    using ModApi.Ui;
    public static class ExtendedUserInterfaceIds
    {
        public static class Flight
        {
                   public const string ViewPanel = "Ui/Xml/Flight/ViewPanel";
        }
    }

    Then initialize it:

    public static void Initialize()
     {
         var userInterface = Game.Instance.UserInterface;
         userInterface.AddBuildUserInterfaceXmlAction(ExtendedUserInterfaceIds.Flight.ViewPanel, OnBuildTimePanel);
     }

    Now we can modify the Flight/ViewPanel UI.

    4 months ago