Ejemplo n.º 1
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            CloseGump(from);
            PlayerMobile player = from as PlayerMobile;

            if (player == null)
            {
                return;
            }
            switch (info.ButtonID)
            {
            case (int)BUTTONS_ENUM.OK:
                //don't send new gump
                break;

            case (int)BUTTONS_ENUM.ADD_ITEM:
                player.Target = new MasterLooterAddTypeTarget(backpack, player, MasterLooterAddTypeTarget.SELECTION.ITEM_SELECTION);
                break;

            case (int)BUTTONS_ENUM.ADD_TYPE:
                player.Target = new MasterLooterAddTypeTarget(backpack, player, MasterLooterAddTypeTarget.SELECTION.TYPE_SELECTION);
                break;

            case (int)BUTTONS_ENUM.PREVIOUS_PAGE:
                SendGump(from, backpack, page - 1);
                break;

            case (int)BUTTONS_ENUM.NEXT_PAGE:
                SendGump(from, backpack, page + 1);
                break;

            case (int)BUTTONS_ENUM.LOOT_SETTINGS:
                backpack.NextLootSettings();
                SendGump(from, backpack, page);
                break;

            case (int)BUTTONS_ENUM.DELETE_ALL_CORPSES:
                backpack.DeleteAllCorpses = !backpack.DeleteAllCorpses;
                SendGump(from, backpack, page);
                break;

            case (int)BUTTONS_ENUM.RESTORE_DEFAULTS:
                backpack.RestoreDefaultList();
                SendGump(from, backpack, page);
                break;

            case (int)BUTTONS_ENUM.SWITCH_ACTIVE_LIST:
                backpack.SwitchActiveList();
                SendGump(from, backpack, page);
                break;

            default:
                if (info.ButtonID < (int)BUTTONS_ENUM.REMOVE_TYPE_START ||
                    info.ButtonID >= (int)BUTTONS_ENUM.REMOVE_TYPE_START + types.Length)
                {
                    return;
                }
                backpack.RemoveType(types[info.ButtonID - (int)BUTTONS_ENUM.REMOVE_TYPE_START]);
                SendGump(from, backpack, page);
                break;
            }
        }