Esempio n. 1
0
 private void DeleteLastRune()
 {
     Godot.Collections.Array runePanelChildren = runePanel.GetChildren();
     if (runePanelChildren.Count > 0)
     {
         Control lastChild = (Control)runePanelChildren[runePanelChildren.Count - 1];
         runePanel.RemoveChild(lastChild);
         runes.Remove(runes.Last());
     }
 }
Esempio n. 2
0
        public override void ResetState()
        {
            foreach (var item in _horizontalContainer.GetChildren())
            {
                if (item is ClickableControl)
                {
                    ((ClickableControl)item).Deselect();
                }
            }

            base.ResetState();
        }
Esempio n. 3
0
 public void OnSigCheckGoal(String colour)
 {
     foreach (GoalPrefab goal in goalConatiner.GetChildren())
     {
         goal.UpdateGoalValues(colour);
     }
 }
Esempio n. 4
0
        public override void _Ready()
        {
            container = GetNode <HBoxContainer>("Container");

            for (var i = 0; i < container.GetChildCount(); i++)
            {
                var cardPanel = container.GetChildren()[i] as Panel;
                var infoBox   = cardPanel.GetNode <Panel>("Info").GetNode <VBoxContainer>("VBoxContainer");

                // add 2 first children, which are usually Title & Description
                Interface.LabelGroup.Add(infoBox.GetChildren()[0] as Label);
                Interface.LabelGroup.Add(infoBox.GetChildren()[1] as Label);

                // add the animation player for this card panel
                Interface.CardsGroup.Add(cardPanel);

                var detector = cardPanel.GetNode <Panel>("Detector");
                detectors.Add(detector);

                detector.Connect("mouse_entered", this, "_on_Detector_mouse_entered", new Array {
                    i
                });
                detector.Connect("mouse_exited", this, "_on_Detector_mouse_exited", new Array {
                    i
                });
                detector.Connect("gui_input", this, "_on_Detector_gui_input", new Array {
                    i
                });
            }
        }
    void ColorSquares(Color color)
    {
        var squaresList   = squaresContainer.GetChildren().Cast <ColorRect>().ToList <ColorRect>();
        var filledSquares = dinoInfo.GetLevel(statButtonMode);

        if (statButtonMode == s.Hp)
        {
            color = hpRed;
        }
        else if (statButtonMode == s.Delay)
        {
            color = delayBlue;
        }

        for (int i = 0; i < filledSquares; i++)
        {
            if (filledSquares == maxSquares)
            {
                squaresList[i].Color = new Color(0, 1, 0, 1);
            }
            else
            {
                squaresList[i].Color = color;
            }
        }
    }
Esempio n. 6
0
        /// <summary>
        /// Deletes all currently shown value nodes from the control.
        /// </summary>
        protected void DeleteContent()
        {
            var contentNodes = _contentContainer.GetChildren();

            foreach (var item in contentNodes)
            {
                _contentContainer.RemoveChild((Node)item);
            }
        }
        public override void ResetState()
        {
            foreach (var item in _teammatesHorizontalContainer.GetChildren())
            {
                if (!(item is TeammateControl teammateControl))
                {
                    continue;
                }

                var teammate = teammateControl.Teammate;
                teammate.IsAddedToTeam = false;
                _teammatesSideScrollControl.AddPossibleTeammate(teammate);
                _teammatesHorizontalContainer.RemoveChild((TeammateControl)item);
                RemoveSelectedValueFromComponent(teammate.Id);
            }

            _teammatesSideScrollControl.ResetState();
        }
Esempio n. 8
0
File: Arena.cs Progetto: exts/ld44
 private void DeleteAmmoUiElements()
 {
     foreach (var ammo in _ammoContainer.GetChildren())
     {
         if (ammo is Node node)
         {
             node.CallDeferred("queue_free");
         }
     }
 }
    private void setAnswerVisibility(bool visible)
    {
        HBoxContainer answerContainer = (HBoxContainer)GetNode("TextEntry");

        foreach (Node child in answerContainer.GetChildren())
        {
            Label answerButton = (Label)child;
            answerButton.Visible = visible;
        }
    }
Esempio n. 10
0
    // turn on particles for this selector and turns off all other particles
    void EnableExclusiveParticles(SelectorSprite selectorToKeepOn)
    {
        var selectors = hBox.GetChildren().Cast <SelectorSprite>().ToList <SelectorSprite>();

        foreach (SelectorSprite s in selectors)
        {
            s.HideParticles();
            if (s == selectorToKeepOn)
            {
                s.ShowParticles();
            }
        }
    }
Esempio n. 11
0
    public override void _Ready()
    {
        Events.dinoDeployed     += OnDinoDeployed;
        Events.dinoFullySpawned += ValidateAbilityStatus;
        Events.dinoDiedType     += ValidateAbilityStatus;
        Events.selectorSelected += OnSelectorSelected;
        Events.newRound         += ValidateAffordStatus;

        hBox = (HBoxContainer)FindNode("HBoxContainer");

        SetupSelectors();
        // get a list of children
        selectorList = hBox.GetChildren().Cast <SelectorSprite>().ToList <SelectorSprite>();
        selectorList[0].ShowParticles();
    }
Esempio n. 12
0
        public override void _Ready()
        {
            container = GetNode <HBoxContainer>("Container");

            for (int i = 0; i < container.GetChildCount(); i++)
            {
                Panel         cardPanel = container.GetChildren()[i] as Panel;
                VBoxContainer infoBox   = cardPanel.GetNode <Panel>("Info").GetNode <VBoxContainer>("VBoxContainer");

                // add 2 first children, which are usually Title & Description
                Interface.LabelGroup.Add(infoBox.GetChildren()[0] as Label);
                Interface.LabelGroup.Add(infoBox.GetChildren()[1] as Label);

                // add the animation player for this card panel
                Interface.cardAnimationGroup.Add(cardPanel.GetNode <AnimationPlayer>("AnimationPlayer"));
            }

            Vars.load();
        }
    // player gets given options of what to say
    private void doWeSay()
    {
        string[]      optionLabels    = MessageLogic.GetOurOptions(messageAt);
        Requirement[] requirements    = MessageLogic.GetOurRequirements(messageAt);
        HBoxContainer answerContainer = (HBoxContainer)GetNode("TextEntry");

        object[] buttonList = answerContainer.GetChildren();

        for (int i = 0; i < buttonList.Length; i++)
        {
            Label answerButton = (Label)buttonList[i];
            if (i < optionLabels.Length && requirements[i].isFulfilled(statManager))
            {
                answerButton.Visible = true;
                answerButton.Text    = optionLabels[i];
            }
            else
            {
                answerButton.Visible = false;
            }
        }
    }