Пример #1
0
    public override void _Ready()
    {
        _network = (ClientNetwork)GetNode("/root/PaintNetwork");

        _landscapeLayout = LandscapeLayout();

        _currentLayout = _landscapeLayout;

        _colorPalette  = (ColorPalette)_currentLayout.ColorToolsContainer.GetNode("ColorPalette");
        _paintPanel    = (PaintPanel)_currentLayout.ColorPanelContainer.GetNode("PaintPanel");
        _messages      = (Messages)_currentLayout.MessagesContainer.GetNode("Messages");
        _paintControls = (PaintControls)_currentLayout.ColorToolsContainer.GetNode("PaintControls");

        _paintControls.Connect(nameof(PaintControls.SetBrushMode), _paintPanel, nameof(PaintPanel.SetBrushMode));
        _paintControls.Connect(nameof(PaintControls.SetBrushSize), _paintPanel, nameof(PaintPanel.SetBrushSize));
        _colorPalette.Connect(nameof(ColorPalette.SetColor), _paintPanel, nameof(PaintPanel.SetColor));
    }