Ejemplo n.º 1
0
        public void LiveDataError(object sender, DataFetcherLoadedEventArgs e)
        {
            this.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
            {
                this.uiRequestTime.Text      = e.loadStartTime.ToString();
                this.uiResponseDuration.Text = e.getRequestDurationInMs().ToString() + "ms";

                this.uiGameState.Text = "GAME NOT STARTED";

                this.uiPlayer.Text = "";

                this.uiAbilities.Text   = "";
                this.uiPlayerStats.Text = "";

                this.uiProgressHealth.Maximum = 1;
                this.uiProgressHealth.Value   = 0;

                this.uiProgressRessource.Maximum = 1;
                this.uiProgressRessource.Value   = 0;

                this.uiImageSpellQ.Source   = null;
                this.uiImageSpellW.Source   = null;
                this.uiImageSpellE.Source   = null;
                this.uiImageSpellR.Source   = null;
                this.uiChampionImage.Source = null;

                this.uiChampName.Text  = "";
                this.uiChampTitle.Text = "";
            }));
        }
Ejemplo n.º 2
0
        public void LiveDataLoaded(object sender, DataFetcherLoadedEventArgs e)
        {
            this.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
            {
                this.uiRequestTime.Text      = e.loadStartTime.ToString();
                this.uiResponseDuration.Text = e.getRequestDurationInMs().ToString() + "ms";
                this.uiGameState.Text        = "GAME IN PROGRESS";

                string summonerName         = this.dataFetcher.GetActivePlayer().summonerName;
                Player playerFromPlayerList = this.dataFetcher.GetPlayerList().GetPlayerBySummonerName(summonerName);

                this.uiPlayer.Text = playerFromPlayerList.ToString();

                DataProviderActivePlayer activePlayer = this.dataFetcher.GetActivePlayer();
                PlayerState playerStats = activePlayer.playerStats;

                double abilityHaste     = playerStats.abilityHaste;
                this.uiAbilities.Text   = activePlayer.abilities.ToStringWithLiveCooldown(abilityHaste);
                this.uiPlayerStats.Text = playerStats.ToString();

                this.uiProgressHealth.Maximum = playerStats.maxHealth;
                this.uiProgressHealth.Value   = playerStats.currentHealth;

                this.uiProgressRessource.Maximum    = playerStats.resourceMax;
                this.uiProgressRessource.Value      = playerStats.resourceValue;
                this.uiProgressRessource.Foreground = playerStats.getResourceColor();

                if (activePlayer.abilities.Passive.image != null)
                {
                    this.uiImageSpellPassive.Source = activePlayer.abilities.Passive.image.GetImageAsBitmap();
                }

                if (activePlayer.abilities.Q.image != null)
                {
                    this.uiImageSpellQ.Source = activePlayer.abilities.Q.image.GetImageAsBitmap();
                }

                if (activePlayer.abilities.W.image != null)
                {
                    this.uiImageSpellW.Source = activePlayer.abilities.W.image.GetImageAsBitmap();
                }

                if (activePlayer.abilities.E.image != null)
                {
                    this.uiImageSpellE.Source = activePlayer.abilities.E.image.GetImageAsBitmap();
                }

                if (activePlayer.abilities.R.image != null)
                {
                    this.uiImageSpellR.Source = activePlayer.abilities.R.image.GetImageAsBitmap();
                }

                SummonerSpell s1 = this.dataFetcher.GetSummonerSpells().GetSpellByName(playerFromPlayerList.summonerSpells.summonerSpellOne.displayName);
                if (s1.image != null)
                {
                    this.uiImageSummonerSpell1.Source = s1.image.GetImageAsBitmap();
                }

                SummonerSpell s2 = this.dataFetcher.GetSummonerSpells().GetSpellByName(playerFromPlayerList.summonerSpells.summonerSpellTwo.displayName);
                if (s2.image != null)
                {
                    this.uiImageSummonerSpell2.Source = s2.image.GetImageAsBitmap();
                }



                ChampionInfo championInfo = this.dataFetcher.GetChampionDetails().championInfo;

                this.uiChampName.Text  = championInfo.name;
                this.uiChampTitle.Text = championInfo.title;
                if (championInfo.image != null)
                {
                    this.uiChampionImage.Source = championInfo.image.GetImageAsBitmap();
                }
            }));
        }