Esempio n. 1
0
        private static void OnBuildDesignerUI(BuildUserInterfaceXmlRequest request)
        {
            var ns         = XmlLayoutConstants.XmlNamespace;
            var viewButton = request.XmlDocument
                             .Descendants(ns + "Panel")
                             .First(x => (string)x.Attribute("internalId") == "flyout-view");

            viewButton.Parent.Add(
                new XElement(
                    ns + "Panel",
                    new XAttribute("id", _buttonId),
                    new XAttribute("class", "toggle-button audio-btn-click"),
                    new XAttribute("name", "ButtonPanel.DesignerToolsUIController"),
                    new XAttribute("tooltip", "Designer Tools"),
                    new XElement(
                        ns + "Image",
                        new XAttribute("class", "toggle-button-icon"),
                        new XAttribute("sprite", "DesignerTools/Sprites/DesignerToolsIcon"))));

            request.AddOnLayoutRebuiltAction(xmlLayoutController => {
                var button    = xmlLayoutController.XmlLayout.GetElementById(_buttonId);
                _flyoutButton = (XmlElement)button;
                button.AddOnClickEvent(OnButtonClicked);
            });
        }
Esempio n. 2
0
    private static void OnBuildDesignerUi(BuildUserInterfaceXmlRequest request)
    {
        var ns         = XmlLayoutConstants.XmlNamespace;
        var viewButton = request.XmlDocument
                         .Descendants(ns + "Panel")
                         .First(x => (string)x.Attribute("internalId") == "flyout-view");

        viewButton.Parent.Add(
            new XElement(
                ns + "Panel",
                new XAttribute("id", _m2cButtonId),
                new XAttribute("class", "toggle-button audio-btn-click"),
                new XAttribute("name", "ButtonPanel.TutorialDesignerButton"),
                new XAttribute("tooltip", "Mesh2Craft"),
                new XElement(
                    ns + "Image",
                    new XAttribute("class", "toggle-button-icon"),
                    new XAttribute("sprite", "Mesh2Craft/Sprites/m2cIcon_thicker"))));

        request.AddOnLayoutRebuiltAction(XmlLayoutController =>
        {
            var button = XmlLayoutController.XmlLayout.GetElementById(_m2cButtonId);
            button.AddOnClickEvent(OnM2cButtonClicked);
        });
    }
Esempio n. 3
0
 private void OnBuildFlightSceneUI(BuildUserInterfaceXmlRequest request)
 {
     request.AddOnLayoutRebuiltAction(
         xmlLayoutController => {
         var viewPanel = (XmlElement)xmlLayoutController.XmlLayout.GetElementById("view-panel");
         var button    = FindChildElementById(viewPanel, ToggleDockingHudButtonId);
         if (button != null)
         {
             button.AddOnClickEvent(OnToggleHudButtonClicked);
         }
         else
         {
             Debug.LogWarning("Unable to register Toggle Docking HUD button click action");
         }
     });
 }