예제 #1
0
        public Library()
        {
            InitializeComponent();

            bool firstRun = false;

            if (App.library == null)
            {
                App.library = this;
                firstRun    = true;
            }

            if (client == null)
            {
                if (Directory.Exists(iconsPath))
                {
                    Directory.Delete(iconsPath, true);
                }
                Directory.CreateDirectory(iconsPath);
            }

            client          = App.storeClient;
            iconsDownloader = new DownloadManager(client.ipAddress, client.downloadIconsPort);

            originalIcon = GameIcon.Source;


            gameTextBlockPrefab = XamlWriter.Save(GameListTextTemplate);

            //string libraryStr = client.RecquestLibrary();

            //TextBlock newButton = new TextBlock();
            //newButton.Text = "Fortnite";
            //newButton.MouseLeftButtonDown += OnGameTextClick;

            Navbar.SetMode(Controls.NavBar.Modes.Library);

            GetUserInfo();

            Debug.Log("User info: ");
            Debug.Log("ID: " + userInfo.id);
            Debug.Log("Username: "******"Token: " + userInfo.token);

            gamesSPGamesStartIndex = GamesSP.Children.Count;

            GetGamesList();

            if (firstRun)
            {
                CheckForUpdates();
            }
            //client.DownloadGame(0, userInfo.token);
        }