Ejemplo n.º 1
0
        private void PopulatePatronsList(Control patronsList)
        {
            var margin = new MarginContainer {
                MarginLeftOverride = 2, MarginTopOverride = 2
            };
            var vBox = new VBoxContainer();

            margin.AddChild(vBox);
            var patrons = ReadJson <PatronEntry[]>("/Credits/Patrons.json");

            Button patronButton;

            vBox.AddChild(patronButton = new Button
            {
                Text = "Become a Patron",
                SizeFlagsHorizontal = SizeFlags.ShrinkCenter
            });

            var first = true;

            foreach (var tier in patrons.GroupBy(p => p.Tier).OrderBy(p => PatronTierPriority[p.Key]))
            {
                if (!first)
                {
                    vBox.AddChild(new Control {
                        CustomMinimumSize = (0, 10)
                    });
Ejemplo n.º 2
0
 public override void _Ready()
 {
     GetCommonNodes();
     _marginContainer     = _windowWrapper.GetNode <MarginContainer>("MarginContainer");
     _horizontalContainer = _marginContainer.GetNode <HBoxContainer>("HorizontalContainer");
     SetupView();
 }
        public GalacticBankSelectionMenu()
        {
            IoCManager.InjectDependencies(this);

            Title = _loc.GetString("Galactic Bank Selection");

            _accounts = new ItemList()
            {
                SelectMode = ItemList.ItemListSelectMode.Single
            };

            var margin = new MarginContainer()
            {
                SizeFlagsVertical   = SizeFlags.FillExpand,
                SizeFlagsHorizontal = SizeFlags.FillExpand,
                MarginTop           = 5f,
                MarginLeft          = 5f,
                MarginRight         = -5f,
                MarginBottom        = -5f,
            };

            margin.AddChild(_accounts);

            Contents.AddChild(margin);
        }
        public ResearchClientServerSelectionMenu()
        {
            IoCManager.InjectDependencies(this);

            Title = Loc.GetString("Research Server Selection");

            _servers = new ItemList()
            {
                SelectMode = ItemList.ItemListSelectMode.Single
            };

            _servers.OnItemSelected   += OnItemSelected;
            _servers.OnItemDeselected += OnItemDeselected;

            var margin = new MarginContainer()
            {
                SizeFlagsVertical   = SizeFlags.FillExpand,
                SizeFlagsHorizontal = SizeFlags.FillExpand,

                /*MarginTop = 5f,
                 * MarginLeft = 5f,
                 * MarginRight = -5f,
                 * MarginBottom = -5f,*/
            };

            margin.AddChild(_servers);

            Contents.AddChild(margin);
        }
Ejemplo n.º 5
0
 public void Configure(Generic6DOFJoint joint)
 {
     hideBtn      = (Button)GetNode("Button");
     content      = (MarginContainer)GetNode("Content");
     spacer       = (Control)GetNode("Spacer");
     hideBtn.Text = joint.Name;
 }
Ejemplo n.º 6
0
    public void LiftAnimationFinished(string name)
    {
        animationPlayer.Play("MoveBackground");
        MarginContainer uiContainer = (MarginContainer)FindNode("UIContainer");

        uiContainer.Visible = true;
    }
Ejemplo n.º 7
0
        public override void _Ready()
        {
            MarginContainer = GetNode <MarginContainer>("MarginContainer");
            UpButton        = GetNode <Button>("MarginContainer/VBox/Up");
            LeftButton      = GetNode <Button>("MarginContainer/VBox/HBox/Left");
            RightButton     = GetNode <Button>("MarginContainer/VBox/HBox/Right");
            DownButton      = GetNode <Button>("MarginContainer/VBox/Down");
            UpButton.Connect("button_down", this, nameof(UpButtonPressed));
            LeftButton.Connect("button_down", this, nameof(LeftButtonPressed));
            RightButton.Connect("button_down", this, nameof(RightButtonPressed));
            DownButton.Connect("button_down", this, nameof(DownButtonPressed));
            UpButton.Connect("button_up", this, nameof(UpButtonReleased));
            LeftButton.Connect("button_up", this, nameof(LeftButtonReleased));
            RightButton.Connect("button_up", this, nameof(RightButtonReleased));
            DownButton.Connect("button_up", this, nameof(DownButtonReleased));

            if (OS.GetName() == "Android")
            {
                Show();
            }
            else
            {
                Hide();
            }
        }
Ejemplo n.º 8
0
        public GhostTargetWindow(GhostComponent owner)
        {
            Title  = "Ghost Warp";
            _owner = owner;
            _owner.GhostRequestWarpPoint();
            _owner.GhostRequestPlayerNames();

            var margin = new MarginContainer()
            {
                SizeFlagsVertical   = SizeFlags.FillExpand,
                SizeFlagsHorizontal = SizeFlags.FillExpand,
            };

            _buttonContainer = new VBoxContainer()
            {
                SizeFlagsVertical   = SizeFlags.FillExpand,
                SizeFlagsHorizontal = SizeFlags.Fill,
                SeparationOverride  = 5,
            };

            var scrollBarContainer = new ScrollContainer()
            {
                SizeFlagsVertical   = SizeFlags.FillExpand,
                SizeFlagsHorizontal = SizeFlags.FillExpand
            };

            margin.AddChild(scrollBarContainer);
            scrollBarContainer.AddChild(_buttonContainer);

            Contents.AddChild(margin);
        }
Ejemplo n.º 9
0
        public override void _Ready()
        {
            _overlayWrapper     = GetNode <MarginContainer>("MarginContainer");
            _gameStatusLabel    = _overlayWrapper.GetNode <Label>("GameStatusContainer/GameStatusLabel");
            _nicknameValue      = _overlayWrapper.GetNode <LineEdit>("VBoxContainer/NicknameLabel");
            _gameCodeValue      = _overlayWrapper.GetNode <LineEdit>("VBoxContainer/GameCodeValue");
            _codeErrorLabel     = _overlayWrapper.GetNode <Label>("VBoxContainer/CodeErrorLabel");
            _enterNicknameLabel = _overlayWrapper.GetNode <Label>("VBoxContainer/EnterNicknameLabel");
            _enterCodeLabel     = _overlayWrapper.GetNode <Label>("VBoxContainer/EnterCodeLabel");
            _startButton        = _overlayWrapper.GetNode <Button>("VBoxContainer/StartButton");

            _gameStatusLabel.Visible = false;
            _codeErrorLabel.Visible  = false;

            var font = (DynamicFont)GD.Load($"{Constants.ResourcesPath}Fonts/Montserrat/montserrat_regular.tres");

            font.Size = 25;

            _enterNicknameLabel.AddFontOverride("font", font);
            _enterCodeLabel.AddFontOverride("font", font);
            _codeErrorLabel.AddFontOverride("font", font);
            _nicknameValue.AddFontOverride("font", font);
            _gameCodeValue.AddFontOverride("font", font);
            _startButton.AddFontOverride("font", font);

            var boldFont = (DynamicFont)GD.Load($"{Constants.ResourcesPath}Fonts/Montserrat/montserrat_bold.tres");

            boldFont.Size = 55;

            _gameStatusLabel.AddFontOverride("font", boldFont);
            _gameStatusLabel.AddColorOverride("font_color", new Color("#bf5034"));

            _startButton.Connect("pressed", this, nameof(StartButtonPressed));
        }
Ejemplo n.º 10
0
        private void PopulateLicenses(ScrollContainer licensesList)
        {
            var margin = new MarginContainer {
                MarginLeftOverride = 2, MarginTopOverride = 2
            };
            var vBox = new VBoxContainer();

            margin.AddChild(vBox);

            foreach (var entry in CreditsManager.GetLicenses().OrderBy(p => p.Name))
            {
                vBox.AddChild(new Label {
                    StyleClasses = { StyleBase.StyleClassLabelHeading }, Text = entry.Name
                });

                // We split these line by line because otherwise
                // the LGPL causes Clyde to go out of bounds in the rendering code.
                foreach (var line in entry.License.Split("\n"))
                {
                    vBox.AddChild(new Label {
                        Text = line, FontColorOverride = new Color(200, 200, 200)
                    });
                }
            }

            licensesList.AddChild(margin);
        }
Ejemplo n.º 11
0
 public override void _Ready()
 {
     _player       = GetNode <AnimationPlayer>("AnimationPlayer");
     _messageLabel = GetNode <Label>("Message");
     _scoreBox     = GetNode <MarginContainer>("ScoreBox");
     _scoreLabel   = GetNode <Label>("ScoreBox/HBoxContainer/Score");
 }
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        hideBtn = (Button)GetNode("Button");
        content = (MarginContainer)GetNode("Content");
        spacer  = (Control)GetNode("Spacer");

        hideBtn.Connect("pressed", this, "ToggleHidden");

        content.GetNode("VBoxContainer/Motor/TargVelInput").Connect("text_entered", this, "VelEntered");
    }
Ejemplo n.º 13
0
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     _margin          = GetNode <MarginContainer>("MarginContainer");
     TitlePage        = GD.Load <PackedScene>("res://Scenes/TitlePage.tscn");
     GamePage         = GD.Load <PackedScene>("res://Scenes/GamePage.tscn");
     InstructionsPage = GD.Load <PackedScene>("res://Scenes/InstructionsPage.tscn");
     CreditsPage      = GD.Load <PackedScene>("res://Scenes/CreditsPage.tscn");
     _ActiveScreen    = Screens.Title;
     DisplayScreen();
 }
Ejemplo n.º 14
0
 public override void _Ready()
 {
     margin           = GetNode <MarginContainer>("MarginContainer");
     _coinAmountLabel = GetNode <Label>
                            ("MarginContainer/MarginContainer/VBoxContainer/CoinsDropped/HBoxContainer/CoinAmount");
     _itemsDroppedGrid =
         GetNode <GridContainer>(
             "MarginContainer/MarginContainer/VBoxContainer/ItemsDropped");
     _autoCloseTimer = GetNode <Timer>("AutoClose");
 }
Ejemplo n.º 15
0
    private void PlayerConnected(int id)
    {
        GD.Print("Connection established");
        globals.otherPlayerId = id;
        PackedScene     gui  = ResourceLoader.Load("res://GUI.tscn") as Godot.PackedScene;
        MarginContainer game = (MarginContainer)gui.Instance();

        GetTree().GetRoot().AddChild(game);
        Hide();
    }
Ejemplo n.º 16
0
        public override void _Ready()
        {
            GetCommonNodes();

            _marginContainer = _windowWrapper.GetNode <MarginContainer>("MarginContainer");
            _progressBarSideScrollControl = _marginContainer.GetNode <ProgressBarSideScrollControl>("ProgressBarSideScrollControl");
            _progressBarSideScrollControl.ValueChanged += ChangeValue;

            DefaultValue = 0;
            SetValue(DefaultValue);
        }
Ejemplo n.º 17
0
        protected override void SetupView()
        {
            _textureOff = (Texture)GD.Load($"{_resourcesPath}star_off.png");
            _textureOn  = (Texture)GD.Load($"{_resourcesPath}star_on.png");

            _background.Texture  = (Texture)GD.Load($"{_resourcesPath}rating_background.png");
            _background.Position = new Vector2(181, 155);

            var font = (DynamicFont)GD.Load($"{_resourcesPath}montserrat_light.tres");

            font.Size = 24;
            _title.AddFontOverride("font", font);
            _title.Text = "Ohodnotit";

            _windowWrapper.RectPosition = new Vector2(25, 10);
            _windowWrapper.Set("custom_constants/separation", 21);

            _marginContainer.Set("custom_constants/margin_left", 28);

            _horizontalContainer.Set("custom_constants/separation", 15);

            _commentsMarginContainer = _windowWrapper.GetNode <MarginContainer>("CommentsMarginContainer");
            _commentsMarginContainer.Set("custom_constants/margin_left", 7);

            _commentsContainer = _commentsMarginContainer.GetNode <VBoxContainer>("CommentsContainer");
            _commentsContainer.Set("custom_constants/separation", 15);

            var lineTexture = (Texture)GD.Load($"{_resourcesPath}line.png");
            var comments    = new string[]
            {
                "skvělé\nHana",
                "Líbí se mi tato verze.\nPetr"
            };

            foreach (var comment in comments)
            {
                var line = new TextureRect();
                line.Texture = lineTexture;

                _commentsContainer.AddChild(line);

                var margin = new MarginContainer();
                margin.Set("custom_constants/margin_left", 10);

                var label = new Label();
                label.AddFontOverride("font", font);
                label.Text = comment;

                margin.AddChild(label);
                _commentsContainer.AddChild(margin);
            }
        }
Ejemplo n.º 18
0
        public override void _Ready()
        {
            GetCommonNodes();

            _marginContainer  = _windowWrapper.GetNode <MarginContainer>("MarginContainer");
            _clickableControl = _marginContainer.GetNode <ClickableControl>("ClickableControl");

            SetupView();

            _clickableControl.Init(_textureOff, _textureOn, 0);
            _clickableControl.Selected   += OnSelected;
            _clickableControl.Deselected += OnDeselected;
        }
Ejemplo n.º 19
0
 public override void _Ready()
 {
     _uiScreen = GetParent().GetNode("GUILayer").GetNode <MarginContainer>("UIScreen");
     _shopList = _uiScreen.GetNode <VBoxContainer>(
         "HBoxContainer/SideMenu/Shop/Sections/VBoxContainer/ShopItemsScrollContainer/ShopItems");
     _infoSection =
         _uiScreen.GetNode <MarginContainer>("HBoxContainer/SideMenu/Shop/Sections/VBoxContainer/InfoSection");
     _towerButton  = GD.Load <PackedScene>("res://Data/Scenes/GUI/ShopElements/TowerButton.tscn");
     _towerManager = GetParent().GetNode("Level").GetNode("TowerManager") as TowerManager;
     StartButton   =
         _uiScreen.GetNode <Button>(
             "HBoxContainer/SideMenu/Shop/Sections/VBoxContainer/InfoSection/VBoxContainer/StartButton");
 }
Ejemplo n.º 20
0
    public override void _Ready()
    {
        // Load Save File?

        // Load Main Menu
        GD.Print("I am here!");
        PackedScene MainMenuScene = ResourceLoader.Load <PackedScene>("res://MainMenu.tscn");

        GD.Print(MainMenuScene.ToString());
        MarginContainer MainMenu = MainMenuScene.Instance() as MarginContainer;

        GetTree().Root.CallDeferred("AddChild", MainMenu);
        Hide();
    }
Ejemplo n.º 21
0
        public override void _Ready()
        {
            _margin                       = GetNode <MarginContainer>("MarginContainer");
            _vBox                         = _margin.GetNode <VBoxContainer>("VBoxContainer");
            _topHBox                      = _vBox.GetNode <HBoxContainer>("Top");
            _nameMargin                   = _topHBox.GetNode <MarginContainer>("NameMargin");
            _nameLabelMargin              = _nameMargin.GetNode <MarginContainer>("NameLabelMargin");
            _nameLabel                    = _nameLabelMargin.GetNode <Label>("Name");
            _secondRowHBox                = _vBox.GetNode <HBoxContainer>("SecondRow");
            _itemMargin                   = _secondRowHBox.GetNode <MarginContainer>("ItemMargin");
            _iconMargin                   = _itemMargin.GetNode <MarginContainer>("IconMargin");
            _itemIcon                     = _iconMargin.GetNode <TextureRect>("ItemIcon");
            _buttonMargin                 = _secondRowHBox.GetNode <MarginContainer>("ButtonMargin");
            _equipButton                  = _buttonMargin.GetNode <TextureButton>("Equip");
            _useButton                    = _buttonMargin.GetNode <TextureButton>("Use");
            _damageValues                 = _vBox.GetNode <HBoxContainer>("DamageValues");
            _quickVBox                    = _damageValues.GetNode <VBoxContainer>("Quick");
            _quickDamageLabel             = _quickVBox.GetNode <Label>("DamageValue");
            _quickIconVBox                = _quickVBox.GetNode <VBoxContainer>("IconVBoxContainer");
            _quickTypeIcon                = _quickIconVBox.GetNode <TextureRect>("TypeIcon");
            _quickStatusIcon              = _quickIconVBox.GetNode <TextureRect>("StatusIcon");
            _quickStatusEffectChanceLabel =
                _quickIconVBox.GetNode <Label>("StatusEffectChance");
            _heavyVBox                    = _damageValues.GetNode <VBoxContainer>("Heavy");
            _heavyDamageLabel             = _heavyVBox.GetNode <Label>("DamageValue");
            _heavyIconVBox                = _heavyVBox.GetNode <VBoxContainer>("IconVBoxContainer");
            _heavyTypeIcon                = _heavyIconVBox.GetNode <TextureRect>("TypeIcon");
            _heavyStatusIcon              = _heavyIconVBox.GetNode <TextureRect>("StatusIcon");
            _heavyStatusEffectChanceLabel =
                _heavyIconVBox.GetNode <Label>("StatusEffectChance");
            _counterVBox                    = _damageValues.GetNode <VBoxContainer>("Counter");
            _counterDamageLabel             = _counterVBox.GetNode <Label>("DamageValue");
            _counterIconVBox                = _counterVBox.GetNode <VBoxContainer>("IconVBoxContainer");
            _counterTypeIcon                = _counterIconVBox.GetNode <TextureRect>("TypeIcon");
            _counterStatusIcon              = _counterIconVBox.GetNode <TextureRect>("StatusIcon");
            _counterStatusEffectChanceLabel =
                _counterIconVBox.GetNode <Label>("StatusEffectChance");
            _healthGainedHBox       = _vBox.GetNode <HBoxContainer>("HealthGainedHBox");
            _healthGainedValueLabel =
                _healthGainedHBox.GetNode <Label>("HealthGainedValueLabel");
            _confirmUsePopup = _margin.GetNode <MarginContainer>("ConfirmUsePopup");
            _backButton      =
                GetNode <TextureButton>("MarginContainer/VBoxContainer/Top/Back");
            _yesButton = GetNode <TextureButton>(
                "MarginContainer/ConfirmUsePopup/TextMargin/VBoxContainer/HBoxContainer/Yes");
            _noButton = GetNode <TextureButton>(
                "MarginContainer/ConfirmUsePopup/TextMargin/VBoxContainer/HBoxContainer/No");

            _confirmUsePopup.Visible = false;
        }
Ejemplo n.º 22
0
    public override void _Ready()
    {
        compoundBars = GetTree().GetNodesInGroup("CompoundBar");

        winExtinctBoxHolder = GetNode <Control>("WinExtinctBoxHolder");

        panelsTween     = GetNode <Tween>(PanelsTweenPath);
        mouseHoverPanel = GetNode <MarginContainer>(MouseHoverPanelPath);
        pauseButton     = GetNode <TextureButton>(PauseButtonPath);
        resumeButton    = GetNode <TextureButton>(ResumeButtonPath);
        agentsPanel     = GetNode <Control>(AgentsPanelPath);

        environmentPanel             = GetNode <Panel>(EnvironmentPanelPath);
        environmentPanelBarContainer = GetNode <GridContainer>(EnvironmentPanelBarContainerPath);
        oxygenBar     = GetNode <ProgressBar>(OxygenBarPath);
        co2Bar        = GetNode <ProgressBar>(Co2BarPath);
        nitrogenBar   = GetNode <ProgressBar>(NitrogenBarPath);
        temperature   = GetNode <ProgressBar>(TemperaturePath);
        sunlightLabel = GetNode <ProgressBar>(SunlightPath);
        pressure      = GetNode <ProgressBar>(PressurePath);

        compoundsPanel             = GetNode <Panel>(CompoundsPanelPath);
        compoundsPanelBarContainer = GetNode <GridContainer>(CompoundsPanelBarContainerPath);
        glucoseBar         = GetNode <ProgressBar>(GlucoseBarPath);
        ammoniaBar         = GetNode <ProgressBar>(AmmoniaBarPath);
        phosphateBar       = GetNode <ProgressBar>(PhosphateBarPath);
        hydrogenSulfideBar = GetNode <ProgressBar>(HydrogenSulfideBarPath);
        ironBar            = GetNode <ProgressBar>(IronBarPath);

        oxytoxyBar               = GetNode <ProgressBar>(OxytoxyBarPath);
        atpBar                   = GetNode <TextureProgress>(AtpBarPath);
        healthBar                = GetNode <TextureProgress>(HealthBarPath);
        ammoniaReproductionBar   = GetNode <TextureProgress>(AmmoniaReproductionBarPath);
        phosphateReproductionBar = GetNode <TextureProgress>(PhosphateReproductionBarPath);

        atpLabel                  = GetNode <Label>(AtpLabelPath);
        hpLabel                   = GetNode <Label>(HpLabelPath);
        menu                      = GetNode <PauseMenu>(MenuPath);
        animationPlayer           = GetNode <AnimationPlayer>(AnimationPlayerPath);
        hoveredCompoundsContainer = GetNode <VBoxContainer>(HoveredCompoundsContainerPath);
        hoveredCellsSeparator     = GetNode <HSeparator>(HoverPanelSeparatorPath);
        hoveredCellsContainer     = GetNode <VBoxContainer>(HoveredCellsContainerPath);
        populationLabel           = GetNode <Label>(PopulationLabelPath);
        patchLabel                = GetNode <Label>(PatchLabelPath);
        editorButton              = GetNode <TextureButton>(EditorButtonPath);

        processPanel       = GetNode <ProcessPanel>(ProcessPanelPath);
        processPanelButton = GetNode <TextureButton>(ProcessPanelButtonPath);
    }
Ejemplo n.º 23
0
        public override void _Ready()
        {
            _tree              = GetTree();
            _margin            = GetNode <MarginContainer>("MarginContainer");
            _inventoryContents = GetNode <GridContainer>(
                "MarginContainer/MarginContainer/HBoxContainer/InventoryScroll/InventoryContents");
            _chestContents = GetNode <GridContainer>(
                "MarginContainer/MarginContainer/HBoxContainer/ChestContents");
            _draggableItem = GetNode <TextureRect>("DraggableItem");

            _margin.Visible = false;
            foreach (ChestItems chestItems in _chestContents.GetChildren())
            {
                chestItems.Connect(nameof(ChestItems.LeftClicked), this,
                                   nameof(OnChestItem_LeftClicked));
            }
        }
Ejemplo n.º 24
0
 public override void _Ready()
 {
     _tween = GetNode <Tween>("Tween");
     _popupDisappearDelayTimer = GetNode <Timer>("PopupDisappearDelay");
     _background         = GetNode <TextureRect>("Background");
     _textMargin         = GetNode <MarginContainer>("TextMargin");
     _textVBox           = _textMargin.GetNode <VBoxContainer>("VBoxContainer");
     _itemNameLabel      = _textVBox.GetNode <Label>("Name");
     _damageMargin       = _textVBox.GetNode <MarginContainer>("DamageMargin");
     _damageValuesHBox   = _damageMargin.GetNode <HBoxContainer>("DamageValues");
     _quickDamageLabel   = _damageValuesHBox.GetNode <Label>("QuickDamage");
     _heavyDamageLabel   = _damageValuesHBox.GetNode <Label>("HeavyDamage");
     _counterDamageLabel = _damageValuesHBox.GetNode <Label>("CounterDamage");
     _healthGainedMargin =
         _textVBox.GetNode <MarginContainer>("HealthGainedMargin");
     _healthGainedLabel = _healthGainedMargin.GetNode <Label>("HealthGained");
 }
Ejemplo n.º 25
0
        public override void _Ready()
        {
            _teammateScene = (PackedScene)GD.Load("res://Controls/Teammate/TeammateControl.tscn");

            GetCommonNodes();

            _windowWrapper                = GetNode <VBoxContainer>("WindowWrapper");
            _verticalContainer            = _windowWrapper.GetNode <VBoxContainer>("VerticalContainer");
            _newTeammatesWrapper          = _verticalContainer.GetNode <VBoxContainer>("NewTeammatesWrapper");
            _sideScrollMarginContainer    = _newTeammatesWrapper.GetNode <MarginContainer>("SideScrollMarginContainer");
            _teammatesSideScrollControl   = _sideScrollMarginContainer.GetNode <TeammatesSideScrollControl>("TeammatesSideScrollControl");
            _marginContainer              = _verticalContainer.GetNode <MarginContainer>("MarginContainer");
            _addedTeammatesWrapper        = _marginContainer.GetNode <VBoxContainer>("AddedTeammatesWrapper");
            _teammatesHorizontalContainer = _addedTeammatesWrapper.GetNode <HBoxContainer>("TeammatesHorizontalContainer");
            _newTeammatesLabel            = _newTeammatesWrapper.GetNode <Label>("CenterContainer/NewTeammatesLabel");
            _addedTeammatesLabel          = _addedTeammatesWrapper.GetNode <Label>("AddedTeammatesLabel");
        }
Ejemplo n.º 26
0
        public override void _Ready()
        {
            base._Ready();
            _buttons =
                GetNode <MarginContainer>("VBoxContainer/PlayerHUD/ChoiceHUD/Buttons");
            _mainButtonsMenu =
                GetNode <MarginContainer>(
                    "VBoxContainer/PlayerHUD/ChoiceHUD/Buttons/MainButtonsMenu");
            _attackButtonsMenu =
                GetNode <MarginContainer>(
                    "VBoxContainer/PlayerHUD/ChoiceHUD/Buttons/AttackButtonsMenu");
            combatLabel =
                GetNode <Label>(
                    "VBoxContainer/PlayerHUD/ChoiceHUD/CombatLabelPadding/CombatLabel");
            _combatTurnResult =
                GetNode <CombatTurnResultUI>(
                    "VBoxContainer/PlayerHUD/ChoiceHUD/CombatTurnResult");
            _playerHealthLabel =
                GetNode <Label>(
                    "VBoxContainer/PlayerHUD/HealthHUD/MarginContainer/HBoxContainer/Health");
            _playerHealthIcon =
                GetNode <HealthIcon>(
                    "VBoxContainer/PlayerHUD/HealthHUD/MarginContainer/HBoxContainer/MarginContainer/HealthIcon");
            playerWeapon    = GetNode <TextureRect>("WeaponContainer/PlayerWeapon");
            _enemyHealthBar =
                GetNode <TextureProgress>(
                    "VBoxContainer/EnemyHUD/VBoxContainer/MarginContainer/MarginContainer/EnemyHealthBar");
            _enemyHealthBarTween =
                GetNode <Tween>(
                    "VBoxContainer/EnemyHUD/VBoxContainer/MarginContainer/MarginContainer/Tween");
            enemyImage =
                GetNode <CombatEnemyTexture>(
                    "VBoxContainer/EnemyHUD/VBoxContainer/Enemy");
            _attackEffect     = GetNode <CombatAttackAnim>("EffectsContainer/EffectTexture");
            _damageSpawnArea  = GetNode <Control>("EffectsContainer/DamageSpawnArea");
            _effectAnimations = GetNode <AnimationList>("EffectAnimationList");
            _particlePos      =
                GetNode <Control>(
                    "VBoxContainer/EnemyHUD/VBoxContainer/Enemy/ParticlePos");

            Visible = false;
            ResetUI();
        }
    public void Configure(Godot.HingeJoint joint)
    {
        hideBtn = (Button)GetNode("Button");
        content = (MarginContainer)GetNode("Content");
        spacer  = (Control)GetNode("Spacer");

        hideBtn.Text = joint.Name;
        float upperLimDeg = joint.GetParam(Godot.HingeJoint.Param.LimitUpper);
        float lowerLimDeg = joint.GetParam(Godot.HingeJoint.Param.LimitLower);

        ((Label)content.GetNode("VBoxContainer/AngLimits/UpperVal")).Text =
            upperLimDeg.ToString();
        ((Label)content.GetNode("VBoxContainer/AngLimits/LowerVal")).Text =
            lowerLimDeg.ToString();
        ((LineEdit)content.GetNode("VBoxContainer/Motor/TargVelInput")).Text =
            joint.GetParam(Godot.HingeJoint.Param.MotorTargetVelocity).ToString();
        ((Label)content.GetNode("VBoxContainer/Motor/MaxImpulseVal")).Text =
            joint.GetParam(Godot.HingeJoint.Param.MotorMaxImpulse).ToString();
    }
Ejemplo n.º 28
0
    public override void _Ready()
    {
        AnchorRight  = 1.0f;
        AnchorBottom = 1.0f;

        // Create joystick
        joystickMargin = new MarginContainer();
        AddChild(joystickMargin);
        var joystick = new Joystick();

        joystickMargin.AddChild(joystick);

        // Create buttons
        buttonsMargin = new MarginContainer();
        AddChild(buttonsMargin);
        var buttons = new Buttons();

        buttonsMargin.AddChild(buttons);

        UpdateMargins();
    }
Ejemplo n.º 29
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        hideBtn = (Button)GetNode("Button");
        content = (MarginContainer)GetNode("Content");
        spacer  = (Control)GetNode("Spacer");

        hideBtn.Connect("pressed", this, "ToggleHidden");

        // Connect a lot of signals for the jog buttons
        content.GetNode("VBoxContainer/JogLin/PosX").Connect("pressed", this, "jogLinPosXPressed");
        content.GetNode("VBoxContainer/JogLin/NegX").Connect("pressed", this, "jogLinNegXPressed");
        content.GetNode("VBoxContainer/JogLin/PosY").Connect("pressed", this, "jogLinPosYPressed");
        content.GetNode("VBoxContainer/JogLin/NegY").Connect("pressed", this, "jogLinNegYPressed");
        content.GetNode("VBoxContainer/JogLin/PosZ").Connect("pressed", this, "jogLinPosZPressed");
        content.GetNode("VBoxContainer/JogLin/NegZ").Connect("pressed", this, "jogLinNegZPressed");

        content.GetNode("VBoxContainer/JogAng/PosX").Connect("pressed", this, "jogAngPosXPressed");
        content.GetNode("VBoxContainer/JogAng/NegX").Connect("pressed", this, "jogAngNegXPressed");
        content.GetNode("VBoxContainer/JogAng/PosY").Connect("pressed", this, "jogAngPosYPressed");
        content.GetNode("VBoxContainer/JogAng/NegY").Connect("pressed", this, "jogAngNegYPressed");
        content.GetNode("VBoxContainer/JogAng/PosZ").Connect("pressed", this, "jogAngPosZPressed");
        content.GetNode("VBoxContainer/JogAng/NegZ").Connect("pressed", this, "jogAngNegZPressed");
    }
Ejemplo n.º 30
0
        public override void _Ready()
        {
            hudMargin       = GetNode <MarginContainer>("HUD/MarginContainer");
            _hudHealthLabel =
                GetNode <Label>(
                    "HUD/MarginContainer/HealthMargin/MarginContainer/HBoxContainer/Health");
            _chestDetector     = GetNode <Area2D>("ChestDetector");
            _deskDetector      = GetNode <Area2D>("DeskDetector");
            camera             = GetNode <Camera2D>("Camera2D");
            _collisionDetector = GetNode <Area2D>("CollisionDetector");
            birdsSystem        = GetNode <Node2D>("BirdsSystem");
            cloudsSystem       = GetNode <Node2D>("CloudsSystem");

            base._Ready();

            UpdatePlayerDataFromSaveData();

            if (maxHealth > 0)
            {
                Health = maxHealth;
            }

            _hudHealthLabel.Text = $"{Health}/{maxHealth}";
        }