Beispiel #1
0
        public CompEditTab(RTS.Editor.ComponentEditorWindow window)
        {
            editorWindow = window;
            var comp = window.GetSelectedComp();

            children.Add(new EObjectPropertyEditor().AdaptiveHeight(true).SetTag("objEdit"));
        }
Beispiel #2
0
 public PageListPanel(ComponentEditorWindow window)
 {
     EnableScroll(true);
     RelativeSize(true);
     addPageButton = new EButton().OnClicked((EButton b) => AddNewPage()).Width(70) + new EText("New page");
     dbPageList    = new EVerticalLayout().EnableScroll(true).RelativeSize(true);
     this.window   = window;
     this.children.Add(
         (new EHorizontalLayout().Height(16)
          + addPageButton
         )
         );
     this.children.Add(
         new ESpacer().Height(8)
         );
     this.children.Add(dbPageList);
 }
Beispiel #3
0
            public PageContentPanel(ComponentEditorWindow window)
            {
                RelativeSize(true);
                UCellRelativeSize(false);
                UCellWidth(200);
                HandleSize(4);
                this.window    = window;
                delPageButton  = new EButton().Width(100).OnClicked((EButton b) => DelPage()) + new EText().Content("Del");
                editPageButton = new EButton().Width(100).OnClicked((EButton b) => EditPage()) + new EText().Content("Rename");

                namingBar = (new ESwitchTab().Height(16)
                             + (new EHorizontalLayout().Height(16)
                                + new EText().BindContent(() =>
                {
                    return(this.window.selectedPage == -1 ? "" : window.database.pages[this.window.selectedPage].pageName);
                })
                                .RelativeSize(true)
                                + editPageButton
                                + delPageButton
                                )
                             + (new EHorizontalLayout().Height(16)
                                + new ETextInputField().RelativeSize(true)
                                + editPageButton
                                + delPageButton
                                )
                             );

                compList = new EVerticalLayout().RelativeSize(true).EnableScroll(true);
                uchild   = (new EVerticalLayout().RelativeSize(true)
                            + namingBar
                            + (new EButton().Height(20) + new EText("Flags"))
                            + (new EVerticalLayout().RelativeSize(true).EnableScroll(true)
                               + new EBox().Content(new GUIContent("Placeholder")).Height(50)
                               + new EBox().Content(new GUIContent("Placeholder")).Height(50)
                               + new EBox().Content(new GUIContent("Placeholder")).Height(50)
                               )
                            );
                //page contents
                lchild = (
                    new EVerticalLayout().RelativeSize(true)
                    + (new EButton().OnClicked((EButton b) => window.OpenCompCreateTab()) + new EText("New component"))
                    + compList
                    );
            }
Beispiel #4
0
        public DBEditTab(ComponentEditorWindow window)
        {
            this.window = window;
            //title bar
            children.Add(new EText().Height(16).Content("Select page"));
            //content



            children.Add(new EHorizontalSplitView().RelativeSize(true).LCellRelativeSize(false).LCellWidth(200)
                         //page entry list
                         + (new PageListPanel(window)
                            )
                         //page detail panel
                         + (new PageContentPanel(window)
                            )
                         );
            //operation bar
            children.Add(new EButton());
        }
Beispiel #5
0
        public NewCompTab(ComponentEditorWindow window)
        {
            RelativeSize(true);
            this.window = window;

            aimingAngleField = new ETextInputField().OnInputUpdate((ETextInputField f, string val) =>
            {
                compAim.aimingAngle = Convert.ToSingle(val);
            }).RelativeSize(true);
            horizontalRotationSpeedField = new ETextInputField().OnInputUpdate((ETextInputField f, string val) =>
            {
                compAim.horizontalRotationSpeed = Convert.ToSingle(val);
            }).RelativeSize(true);
            verticalRotationSpeedField = new ETextInputField().OnInputUpdate((ETextInputField f, string val) =>
            {
                compAim.verticalRotationSpeed = Convert.ToSingle(val);
            }).RelativeSize(true);

            List <string> aimingTypes = new List <string>(Enum.GetNames(typeof(ComponentAimingType)));

            aimingTypes.Insert(0, "Disable aiming");

            var aimConfig = new ESwitchTab().RelativeSize(true).OnActivateTab((ESwitchTab tab, int i) => { })
                            + new EBox().Content(new GUIContent("Aiming disabled"))
                            + (new EVerticalLayout()
                               + (new EHorizontalLayout()
                                  + (new EText("Aiming angle resolution").RelativeSize(true))
                                  + aimingAngleField
                                  )
                               + (new EHorizontalLayout()
                                  + (new EText("Horizontal rotation speed").RelativeSize(true))
                                  + horizontalRotationSpeedField
                                  )
                               + (new EHorizontalLayout()
                                  + (new EText("Vertical rotation speed").RelativeSize(true))
                                  + verticalRotationSpeedField
                                  )
                               );

            children.Add(new EVerticalLayout().RelativeSize(true)
                         //Name input field

                         //Name viability status


                         + (new EHorizontalLayout()
                            //Component type
                            + (new ETextInputField().OnInputUpdate((ETextInputField f, string val) => SetName(val))).RelativeSize(true).Width(3)
                            + new EPopup().RelativeSize(true).Width(1)
                            .Content(Enum.GetNames(typeof(ComponentType)))
                            .OnSelectionChange((EPopup p, int i) => { SetType(i); })
                            )
                         + (new EText().BindContent(() => { return(CheckNameViability() ? "All good" : "!! Naming conflict !!"); }))
                         //Component aiming mechanism
                         + new EPopup()
                         .Content(aimingTypes.ToArray())
                         .OnSelectionChange((EPopup p, int i) => {
                if (i == 0)
                {
                    aimConfig.ActivateTab(0);
                }
                else
                {
                    aimConfig.ActivateTab(1);
                }
                SetAimType(i);
            })
                         + aimConfig
                         );

            children.Add(
                new EHorizontalLayout()
                + (new EButton().RelativeSize(true).OnClicked((EButton b) => CreateComponent()) + new EText("Create"))
                + (new EButton().RelativeSize(true).OnClicked((EButton b) => window.OpenDBEditTab()) + new EText("Cancel"))
                );
        }