Exemple #1
0
        private void BuildGUI()
        {
            progressBar           = new GUIProgressBar();
            messageLabel          = new GUILabel("", EditorStyles.MultiLineLabelCentered, GUIOption.FixedHeight(60));
            cancelImport          = new GUIButton(new LocEdString("Cancel import"));
            cancelImport.OnClick += () =>
            {
                ProjectLibrary.CancelImport();
                cancelImport.Disabled = true;
            };

            GUILayoutY layoutY = GUI.AddLayoutY();

            layoutY.AddFlexibleSpace();
            GUILayoutX messageLayout = layoutY.AddLayoutX();

            messageLayout.AddSpace(15);
            messageLayout.AddElement(messageLabel);
            messageLayout.AddSpace(15);

            layoutY.AddSpace(10);

            GUILayoutX barLayout = layoutY.AddLayoutX();

            barLayout.AddSpace(30);
            barLayout.AddElement(progressBar);
            barLayout.AddSpace(30);

            layoutY.AddSpace(20);

            GUILayoutX buttonLayout = layoutY.AddLayoutX();

            buttonLayout.AddFlexibleSpace();
            buttonLayout.AddElement(cancelImport);
            buttonLayout.AddFlexibleSpace();

            layoutY.AddFlexibleSpace();

            messageLabel.SetContent(new LocEdString("Resource import is still in progress. You can wait until it " +
                                                    "finishes or cancel import. \n\nNote that even when cancelling you will need to wait for active import threads to finish."));
        }