public DecksearchUI(string f, Importer di, GoogleImporterExporter gi)
 {
     this.googleie = gi;
     this.deckimp = di;
     this.deckfolder = f;
     this.infodeck.link = "";
     this.recto = Rectomat.Instance;
     this.setskins((GUISkin)Resources.Load("_GUISkins/CardListPopup"), (GUISkin)Resources.Load("_GUISkins/CardListPopupGradient"), (GUISkin)Resources.Load("_GUISkins/CardListPopupBigLabel"), (GUISkin)Resources.Load("_GUISkins/CardListPopupLeftButton"));
     
 }
		//initialize everything here, Game is loaded at this point
        public deckimporter()
		{

            string homePath = (Environment.OSVersion.Platform == PlatformID.Unix || Environment.OSVersion.Platform == PlatformID.MacOSX) ? Environment.GetEnvironmentVariable("HOME") : Environment.ExpandEnvironmentVariables("%HOMEDRIVE%%HOMEPATH%");
            deckfolder = homePath + Path.DirectorySeparatorChar + "scrollsdecks";

            generateDeckSaveMessage = typeof(DeckBuilder2).GetMethod("generateDeckSaveMessage", BindingFlags.NonPublic | BindingFlags.Instance);
            chatLogStyleinfo = typeof(ChatUI).GetField("chatMsgStyle", BindingFlags.Instance | BindingFlags.NonPublic);
            scrollsBookinfo = typeof(DeckBuilder2).GetField("scrollBook", BindingFlags.Instance | BindingFlags.NonPublic);
            scrollsBookRect2info = typeof(DeckBuilder2).GetField("rectBook", BindingFlags.Instance | BindingFlags.NonPublic);
            scrollsBookRect1info = typeof(DeckBuilder2).GetField("rectLeft", BindingFlags.Instance | BindingFlags.NonPublic);
            dckcrtr = new Deckcreator();
            imp = new Importer();
            googleie = new GoogleImporterExporter();
            dcksrchui = new DecksearchUI(deckfolder,imp,googleie);
            
           
            this.lobbyskin = (GUISkin)Resources.Load("_GUISkins/Lobby");

            
            if (!Directory.Exists(deckfolder + Path.DirectorySeparatorChar))
            {
                Directory.CreateDirectory(deckfolder + Path.DirectorySeparatorChar);
            }

            string[] aucfiles = Directory.GetFiles(this.deckfolder, "decks.txt");
            if (aucfiles.Contains(this.deckfolder + System.IO.Path.DirectorySeparatorChar + "decks.txt"))//File.Exists() was slower
            {
                //loadDecks();
            }
            else
            {
                System.IO.File.WriteAllText(this.deckfolder + System.IO.Path.DirectorySeparatorChar + "decks.txt", "");
            }

            try
            {
                App.Communicator.addListener(this);
            }
            catch { }
            this.systemCopyBufferProperty = T.GetProperty("systemCopyBuffer", BindingFlags.Static | BindingFlags.NonPublic);
            
		}