Beispiel #1
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        PluginItemList       = GetNode <ItemList>("VBoxContainer/ItemList");
        GlobalSettings       = GetNode <Global>("/root/Global");
        PluginFolderSelector = GetNode <FileDialog>("FileDialog");

        PluginItemList.Connect("item_selected", this, "OnItemListItemPressed");

        // Disable the load and refresh buttons because we need to think through them more
        Button LoadButton = GetNode <Button>("VBoxContainer/SearchBar/HBoxContainer/LoadButton");

        LoadButton.Disabled = true;
        LoadButton.Connect("pressed", this, "SelectPluginFolder");

        Button RefreshButton = GetNode <Button>("VBoxContainer/SearchBar/HBoxContainer/RefreshButton");

        RefreshButton.Disabled = false;
        RefreshButton.Connect("pressed", this, "RefreshPluginList");

        this.Connect("item_rect_changed", this, "OnRectSizeChanged");

        PluginItemList.MaxColumns      = 2;
        PluginItemList.SameColumnWidth = true;

        PluginItemList.FixedColumnWidth = (int)PluginItemList.RectSize.x / PluginItemList.MaxColumns;


        CreatePluginListHeader();
        RefreshPluginList(true);
    }
Beispiel #2
0
        public override void _Ready()
        {
            base._Ready();

            issuesList = new ItemList {
                SizeFlagsVertical = (int)SizeFlags.ExpandFill
            };
            issuesList.Connect("item_activated", this, nameof(_IssueActivated));
            AddChild(issuesList);
        }
Beispiel #3
0
 public override void _Ready()
 {
     Controller.Register(this);
     Controller.Connect();
     CharacterList.Connect("item_activated", (int idx) => {
         if (idx < 1)
         {
             return;
         }
         Controller.SelectCharacter(idx - 1);
     });
 }
        public override void _Ready()
        {
            _itemList     = GetNode <ItemList>("CanvasLayer/WindowDialog/ItemList");
            _windowDialog = GetNode <WindowDialog>("CanvasLayer/WindowDialog");

            switch (_itemType)
            {
            case ItemType.LOOT:
                _sourceDict = MetadataLoader.LootItemIdToMetadata;
                break;

            case ItemType.ENTITY:
                _sourceDict = MetadataLoader.EntityIdToMetadata;
                break;
            }

            _items = _sourceDict.Select(x => x.Value).OrderBy(x => x.DisplayName).ToList();
            foreach (var item in _items)
            {
                _itemList.AddItem(FormatButtonText(item.Id));
            }
            _itemList.Connect("item_selected", this, nameof(OnItemSelected));
            Connect("pressed", this, nameof(OnItemButtonPressed));
        }
Beispiel #5
0
        public override void _Ready()
        {
            base._Ready();

            editorInterface = GodotSharpEditor.Instance.GetEditorInterface();

            var editorBaseControl = editorInterface.GetBaseControl();

            SizeFlagsVertical = (int)SizeFlags.ExpandFill;
            SetAnchorsAndMarginsPreset(LayoutPreset.Wide);

            panelTabs = new TabContainer
            {
                TabAlign          = TabContainer.TabAlignEnum.Left,
                RectMinSize       = new Vector2(0, 228) * EditorScale,
                SizeFlagsVertical = (int)SizeFlags.ExpandFill
            };
            panelTabs.AddStyleboxOverride("panel", editorBaseControl.GetStylebox("DebuggerPanel", "EditorStyles"));
            panelTabs.AddStyleboxOverride("tab_fg", editorBaseControl.GetStylebox("DebuggerTabFG", "EditorStyles"));
            panelTabs.AddStyleboxOverride("tab_bg", editorBaseControl.GetStylebox("DebuggerTabBG", "EditorStyles"));
            AddChild(panelTabs);

            {
                // Builds tab
                panelBuildsTab = new VBoxContainer
                {
                    Name = "Builds".TTR(),
                    SizeFlagsHorizontal = (int)SizeFlags.ExpandFill
                };
                panelTabs.AddChild(panelBuildsTab);

                var toolBarHBox = new HBoxContainer {
                    SizeFlagsHorizontal = (int)SizeFlags.ExpandFill
                };
                panelBuildsTab.AddChild(toolBarHBox);

                var buildProjectBtn = new Button
                {
                    Text      = "Build Project".TTR(),
                    FocusMode = FocusModeEnum.None
                };
                buildProjectBtn.Connect("pressed", this, nameof(BuildProjectPressed));
                toolBarHBox.AddChild(buildProjectBtn);

                toolBarHBox.AddSpacer(begin: false);

                warningsBtn = new ToolButton
                {
                    Text       = "Warnings".TTR(),
                    ToggleMode = true,
                    Pressed    = true,
                    Visible    = false,
                    FocusMode  = FocusModeEnum.None
                };
                warningsBtn.Connect("toggled", this, nameof(_WarningsToggled));
                toolBarHBox.AddChild(warningsBtn);

                errorsBtn = new ToolButton
                {
                    Text       = "Errors".TTR(),
                    ToggleMode = true,
                    Pressed    = true,
                    Visible    = false,
                    FocusMode  = FocusModeEnum.None
                };
                errorsBtn.Connect("toggled", this, nameof(_ErrorsToggled));
                toolBarHBox.AddChild(errorsBtn);

                toolBarHBox.AddSpacer(begin: false);

                viewLogBtn = new Button
                {
                    Text      = "View log".TTR(),
                    FocusMode = FocusModeEnum.None,
                    Visible   = false
                };
                viewLogBtn.Connect("pressed", this, nameof(_ViewLogPressed));
                toolBarHBox.AddChild(viewLogBtn);

                var hsc = new HSplitContainer
                {
                    SizeFlagsHorizontal = (int)SizeFlags.ExpandFill,
                    SizeFlagsVertical   = (int)SizeFlags.ExpandFill
                };
                panelBuildsTab.AddChild(hsc);

                buildTabsList = new ItemList {
                    SizeFlagsHorizontal = (int)SizeFlags.ExpandFill
                };
                buildTabsList.Connect("item_selected", this, nameof(_BuildTabsItemSelected));
                buildTabsList.Connect("nothing_selected", this, nameof(_BuildTabsNothingSelected));
                hsc.AddChild(buildTabsList);

                buildTabs = new TabContainer
                {
                    TabAlign            = TabContainer.TabAlignEnum.Left,
                    SizeFlagsHorizontal = (int)SizeFlags.ExpandFill,
                    TabsVisible         = false
                };
                hsc.AddChild(buildTabs);
            }
        }