Example #1
0
            public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
            {
                #region Collect Data

                m_Workshop.ZRange = info.Switches.Length == 1;

                foreach (TextRelay text in info.TextEntries)
                {
                    switch (text.EntryID)
                    {
                    case 0:     // Min Z

                        try { m_Workshop.MinZ = sbyte.Parse(text.Text); }
                        catch { }

                        break;

                    case 1:     // Max Z

                        try { m_Workshop.MaxZ = sbyte.Parse(text.Text); }
                        catch { }

                        break;

                    case 2:     // Nudge Amount

                        try { m_Workshop.NudgeAmount = byte.Parse(text.Text); }
                        catch { }

                        break;

                    case 3:     // Hue

                        try { m_Workshop.HueValue = int.Parse(text.Text); }
                        catch { }

                        break;
                    }
                }

                #endregion

                switch (info.ButtonID)
                {
                case 1:     // Add Range

                    m_Workshop.AddRange();

                    break;

                case 2:     // Add Single

                    m_Workshop.AddSingle();

                    break;

                case 3:     // Clear

                    m_Workshop.Clear();

                    break;

                case 4:     // Build

                    m_Workshop.Build();

                    break;

                case 5:     // Delete

                    m_Workshop.DeleteBuilding();

                    break;

                case 6:     // Nudge Down

                    m_Workshop.Nudge(false);

                    break;

                case 7:     // Nudge Up

                    m_Workshop.Nudge(true);

                    break;

                case 8:     // Hue

                    m_Workshop.Hue();

                    break;
                }

                if (info.ButtonID != 0)
                {
                    m_Workshop.m_User.SendGump(new InternalGump(m_Workshop));
                }
            }