public override void _Ready() { chatButton = GetNode <Button>("ChatButton"); if (!Vars.PersistentData.isMobile) { Visible = false; SetProcess(false); } else { chatButton.Connect("pressed", this, "_onChatButtonPress"); } }
public override void _Ready() { if (instance == null) { instance = this; } else { instance.Dispose(); instance = this; } if (Vars.PersistentData.isMobile) { RectPosition = new Vector2(9, 0); } content = GetNode("MarginContainer").GetNode <VBoxContainer>("Content"); messageScrollerBox = content.GetNode <ScrollContainer>("Messages"); messageBox = messageScrollerBox.GetNode <VBoxContainer>("MessageContainer"); senderBox = content.GetNode <HBoxContainer>("Sender"); chatMessage = messageBox.GetNode <RichTextLabel>("ChatMessage"); button = senderBox.GetNode <Button>("Button"); _lineEdit = senderBox.GetNode <LineEdit>("LineEdit"); _lineEdit.Connect("focus_entered", this, "_onSenderBoxFocusEnter"); _lineEdit.Connect("focus_exited", this, "_onFocusLost"); _lineEdit.Connect("text_changed", this, "_onTextChanged"); _lineEdit.custom_behaviour = true; rnd = new RandomNumberGenerator(); chatMessage.Visible = false; senderBox.Modulate = new Color(0, 0, 0, 0); button.Connect("pressed", this, "SendPressed"); messageScrollerBox.GetVScrollbar().Modulate = new Color(0, 0, 0, 0); }