public AdvancedSearch(float x, float y, DeckEditorManager deck, DeckSearcher searcher)
    {
        GlobalVarAdvSearch.dropDownListOpen = false;

        _DeckSearcher = searcher;
        _DeckEditor = deck;
        /*
        _w *= _DeckEditor._xWindowScale;
        _h *= _DeckEditor._yWindowScale;
        */

        xScale = _DeckEditor._xWindowScale;
        yScale = _DeckEditor._yWindowScale;

        _x = x;
        _y = y;
        _Background = Resources.Load ("DeckEditor/AdvancedSearch") as Texture2D;
        _Data = new CardDataBase();
        AllCards = _Data.GetAllCards();

        _DropDownList = new PopupList((int)(_x + 80.0f), (int)(_y + 30.0f + 25.0f), 130, 20, 5);
        _DropDownList.Add("All");
        _DropDownList.Add("0");
        _DropDownList.Add("1");
        _DropDownList.Add("2");
        _DropDownList.Add("3");
        _DropDownList.Add("4");

        _ClanPopupList = new PopupList((int)(_x + 80), (int)(_y + 115), 130, 20, 5);
        _ClanPopupList.SetSliderYFactor(16.7f);
        _ClanPopupList.Add("All");
        _ClanPopupList.Add("Angel Feather");
        _ClanPopupList.Add("Aqua Force");
        _ClanPopupList.Add("Bermuda Triangle");
        _ClanPopupList.Add("Dark Irregulars");
        _ClanPopupList.Add("Dimension Police");
        _ClanPopupList.Add("Genesis");
        _ClanPopupList.Add("Gold Paladin");
        _ClanPopupList.Add("Granblue");
        _ClanPopupList.Add("Great Nature");
        _ClanPopupList.Add("Kagero");
        _ClanPopupList.Add("Link Joker");
        _ClanPopupList.Add("Megacolony");
        _ClanPopupList.Add("Murakumo");
        _ClanPopupList.Add("Narukami");
        _ClanPopupList.Add("Neo Nectar");
        _ClanPopupList.Add("Nova Grappler");
        _ClanPopupList.Add("Nubatama");
        _ClanPopupList.Add("Oracle Think Tank");
        _ClanPopupList.Add("Pale Moon");
        _ClanPopupList.Add("Royal Paladin");
        _ClanPopupList.Add("Shadow Paladin");
        _ClanPopupList.Add("Spike Brothers");
        _ClanPopupList.Add("Tachikaze");
    }
    private void SetPlayerDeckList()
    {
        string[] deckNames = Directory.GetFiles("Deck");

        bool bAddDummy = false;
        int len = deckNames.Length;
        if(len == 0)
        {
            bAddDummy = true;
            len++;
        }

        decklist = new PopupList((int)(_xAvatar + 128 - 100), (int)(_y + settingsBackground.height - 50), 200, 20, 8);
        for(int i = 0; i < deckNames.Length; i++)
        {
            decklist.Add(deckNames[i].Substring(5, deckNames[i].Length - 5 - 4));
        }

        if(bAddDummy)
        {
            decklist.Add("No deck");
        }

        string defaultDeck = PlayerPrefs.GetString("DefaultDeck");

        if(defaultDeck != "")
        {
            decklist.SelectOptionWithValue(defaultDeck);
        }
    }
    public DeckInformation(float x, float y, DeckEditorManager deck)
    {
        restrictedList = new RCL_Official();
        restrictedList.SetDeckInformation(this);

        CardList = new int[Enum.GetNames(typeof(CardIdentifier)).Length];
        CardLimit = new int[Enum.GetNames(typeof(CardIdentifier)).Length];

        for(int i = 0; i < CardList.Length; i++)
        {
            CardList[i] = 0;
            CardLimit[i] = 4;
        }

        CardLimit[(int)CardIdentifier.MASS_PRODUCTION_SAILOR] = 16;

        _DeckEditor = deck;

        xCorr = _DeckEditor._xWindowScale;
        yCorr = _DeckEditor._yWindowScale;

        textStyle = new GUIStyle();
        textStyle.fontSize = (int)(15  * xCorr);
        textStyle.normal.textColor = Color.white;

        _x = x;
        _y = y;
        _Background = Resources.Load ("DeckEditor/DeckInformation") as Texture2D;

        if(!Directory.Exists("Deck"))
        {
            Directory.CreateDirectory("Deck");
        }

        string[] deckNames = Directory.GetFiles("Deck");

        bool bAddDummy = false;
        int len = deckNames.Length;
        if(len == 0)
        {
            bAddDummy = true;
            len++;
        }

        decklist = new PopupList((int)(_x + (15.0f + 230.0f)), (int)(_y + (40.0f)), 200, 20, 5);
        //decklist.SetSliderYFactor((16.8f/24.0f) * decklist.GetNumOptions());

        for(int i = 0; i < deckNames.Length; i++)
        {
            decklist.Add(deckNames[i].Substring(5, deckNames[i].Length - 5 - 4));
            Debug.Log (deckNames[i].Substring(5, deckNames[i].Length - 5 - 4));
        }

        if(bAddDummy)
        {
            decklist.Add("No deck");
        }

        string defaultDeck = PlayerPrefs.GetString("DefaultDeck");

        if(defaultDeck != "")
        {
            decklist.SelectOptionWithValue(defaultDeck);
        }

        _DeckEditor.DeckName = decklist.GetValue();
        //decklist.GetValue();
    }
    public void ReloadDeckList()
    {
        string[] deckNames = Directory.GetFiles("Deck");

        decklist = new PopupList((int)(_x + (15.0f + 230.0f)), (int)(_y + (40.0f)), 200, 20, 5);
        //decklist.SetSliderYFactor((16.8f/24.0f) * decklist.GetNumOptions());
        for(int i = 0; i < deckNames.Length; i++)
        {
            decklist.Add(deckNames[i].Substring(5, deckNames[i].Length - 5 - 4));
        }
    }