public override bool HandlesKeyPress(char key) { if (chatInputText.Length < Utils.StringLength && !IsInvalidChar(key)) { if (!Validator.IsValidChar(key)) { return(true); } chatInputText.Append(chatInputText.Length, key); if (!Validator.IsValidString(chatInputText.ToString())) { chatInputText.DeleteAt(chatInputText.Length - 1); return(true); } api.DeleteTexture(ref chatInputTexture); SetText(chatInputText.ToString()); } return(true); }
protected override bool AllowedChar(char c) { if (c == '&' || !Utils.IsValidInputChar(c, true)) { return(false); } if (!Validator.IsValidChar(c)) { return(false); } if (Text.Length == UsedLines * MaxCharsPerLine) { return(false); } // See if the new string is in valid format AppendChar(c); bool valid = Validator.IsValidString(Text.ToString()); DeleteChar(); return(valid); }
protected override bool AllowedChar(char c) { if (IsInvalidChar(c)) { return(false); } if (!Validator.IsValidChar(c)) { return(false); } if (Text.Length == MaxCharsPerLine) { return(false); } // See if the new string is in valid format AppendChar(c); bool valid = Validator.IsValidString(Text.ToString()); DeleteChar(); return(valid); }