Exemplo n.º 1
0
        public override void _Ready()
        {
            _creditsRichText = GetNode <RichTextLabel>("CreditsContainer/CenterContainer/VBoxContainer/Credits");

            // make sure bbcode is enabled & set the credits value
            _creditsRichText.BbcodeEnabled = true;
            _creditsRichText.SetBbcode(Game.Autoload().Credits);
            _creditsRichText.Connect("meta_clicked", this, nameof(Clicked));

            _linkSeek     = _creditsRichText.GetVisibleLineCount();
            _maxSeekLines = _creditsRichText.GetLineCount() - 1;

            // was trying to use scrolling credits, but it sucked.
//            _creditsTimer = GetNode<Timer>("CreditsTimer");
//            _creditsTimer.Connect("timeout", this, nameof(ScrollCredits));
        }
Exemplo n.º 2
0
    private void addChatText(string txt)
    {
        const int maxLines = 50;

        chat.AppendBbcode(txt);
        //control max lines: happy ram
        int count = chat.GetLineCount();

        if (count > maxLines)
        {
            int rest = count - maxLines;
            for (int i = 0; i < rest; i++)
            {
                chat.RemoveLine(i);
            }
        }
    }