D4rkh0bb1T

Member
Hi! I'm trying to make my gump buttons having a sound when pressed.
This only seems to work with GumpButtonType.Reply (My quit button for exemple)
I'm trying to add sound when GumpButtonType.Page are pressed.
Is this something possible?
Thanks!

C#:
public enum Buttons
        {
            GotoWebsite,
            GotoWebsite2,
            Quit,
            GotoNews,
        }
       
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;
           
                switch (info.ButtonID)
                {
                   
                    case (int)Buttons.Quit: //this.AddButton(283, 449, 5200, 5201, (int)Buttons.Quit, GumpButtonType.Reply, 0);
                    {
                        from.SendMessage("Check back for Updates!");
                        from.PlaySound(0X04A); //This works
                        break;
                    }
                   
                    case (int)Buttons.GotoWebsite://this.AddButton(418, 339, 2510, 2511, (int)Buttons.GotoWebsite, GumpButtonType.Reply, 0);
                    {
                    from.PlaySound(0X04A); //This Works
                    from.SendMessage("Check back for Updates!");
                        sender.LaunchBrowser("https://MYWEBSITE.COM");
                        break;
                    }

                    case (int)Buttons.GotoWebsite2: //this.AddButton(477, 367, 5609, 5610, (int)Buttons.GotoWebsite2, GumpButtonType.Reply, 0);
                    {
                    from.PlaySound(0X04A); //This works
                    from.SendMessage("Check back for Updates!");
                        sender.LaunchBrowser("https://MYWEBSITE.COM/");
                        break;
                    }
                        case (int)Buttons.GotoNews: //this.AddButton(67, 301, 2510, 2511, (int)Buttons.GotoNews, GumpButtonType.Page, 2);
                    {
                    from.PlaySound(0X04A); //This NOT work
                    from.SendMessage("DEBUG"); //This NOT work
                        break;
                    }
                }
        }
 
If also the SendMessage doesnt work and it is not crashing? Then I think your button is setup wrong. because in that case it never hits that case
 
Well...
SendMessage ("Check back for Updates!") -- These one are working.
My Debug message doesnt appear and the sound does not occur either...
I understand this never hit that case, but why? Wrong button setup, what does that mean?
 
Check if in the actual button, in the code you use Buttons.GotoNews, on the button you actually use for the news button
 
Not sure I get what you mean. But ...
the Buttons.GotoNews is added in the gump like this :
this.AddButton(67, 301, 2510, 2511, (int)Buttons.GotoNews, GumpButtonType.Page, 2);

the Buttons.Quit is added in the gump like this :
this.AddButton(283, 449, 5200, 5201, (int)Buttons.Quit, GumpButtonType.Reply, 0);

Type.Page & Type.Reply - Sounds&Messages only for Reply type buttons?
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back