public void SetEmail(string subject, string message, bool to, MessageSpecialType specialType, uint typeExpiry) { LetterSubjectTextEdit.CurrentText = subject; LetterTextEdit.CurrentText = GameFacade.Emojis.EmojiToBB(message); if (to) { RespondLetterButton.Disabled = true; } SetSpecialTypeButton(specialType, typeExpiry); }
private void SetSpecialTypeButton(MessageSpecialType type, uint typeExpiry) { var now = ClientEpoch.Now; SpecialButton.Disabled = (typeExpiry != 0 && now > typeExpiry); SpecialType = type; if (type == MessageSpecialType.Normal) { SpecialButton.Visible = false; } else { SpecialButton.Visible = true; SpecialButton.Caption = GameFacade.Strings.GetString("f119", ((int)type).ToString()); SpecialButton.Position = new Vector2( (int)(MessageTextEdit.X + (MessageTextEdit.Size.X - SpecialButton.Width) / 2), Size.Y - 36 ); } }
public bool SendSystemEmail(string cst, int subjectIndex, int msgIndex, int type, MessageSpecialType specialType, uint expireDate, uint targetID, params string[] args) { for (int i = 0; i < args.Length; i++) { args[i] = args[i].Replace(';', ':'); } var item = new MessageItem() { Subject = ";" + cst + ";" + subjectIndex, Body = ";" + expireDate + ";" + cst + ";" + msgIndex + ';' + string.Join(";", args), Type = type, Subtype = (int)specialType, SenderID = uint.MaxValue, TargetID = targetID, SenderName = ";default" }; return(SendEmail(item, true)); }