Exemple #1
0
            public override void OnResponse(NetState sender, RelayInfo info)
            {
                Mobile from = sender.Mobile;

                if (from == null || info.ButtonID == (int)Buttons.Cancel)
                {
                    return;
                }

                string tip = info.GetTextEntry((int)Buttons.Tip).Text.Trim();

                if (tip.Length == 0)
                {
                    from.SendMessage("You must enter a valid tip.");
                    from.SendGump(new AddTipGump());
                    return;
                }

                string creator = info.GetTextEntry((int)Buttons.From).Text;
                string url     = info.GetTextEntry((int)Buttons.Url).Text;

                Tip t = new Tip();

                t.CreateDate = DateTime.Now.ToShortDateString();
                t.From       = StringUtils.GetString(creator.Trim(), from.Name);
                t.Text       = tip;
                t.Url        = url.Trim();

                TipSystem.AddTip(t);
            }
Exemple #2
0
            public static void Execute_Refresh(CommandEventArgs e)
            {
                Mobile from = e.Mobile;

                if (from is PlayerMobile)
                {
                    TipSystem.LoadTips();
                }
            }